@supernova-studio/model 1.0.0 → 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.
- package/dist/index.d.mts +26740 -18977
- package/dist/index.d.ts +26740 -18977
- package/dist/index.js +275 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2201 -1973
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -4
- package/src/asset-delete-schedule/asset-delete-schedule.ts +0 -20
- package/src/asset-delete-schedule/index.ts +0 -1
- package/src/auth/index.ts +0 -1
- package/src/auth/plugin-oauth-request.ts +0 -14
- package/src/billing/card.ts +0 -12
- package/src/billing/checkoutSession.ts +0 -16
- package/src/billing/customer.ts +0 -29
- package/src/billing/features.ts +0 -48
- package/src/billing/index.ts +0 -9
- package/src/billing/invoice.ts +0 -34
- package/src/billing/portalSession.ts +0 -19
- package/src/billing/price.ts +0 -24
- package/src/billing/product.ts +0 -5
- package/src/billing/subscription.ts +0 -65
- package/src/common/entity.ts +0 -9
- package/src/common/index.ts +0 -2
- package/src/common/object-meta.ts +0 -8
- package/src/custom-domains/custom-domains.ts +0 -24
- package/src/custom-domains/index.ts +0 -1
- package/src/data-dumps/code-integration-dump.ts +0 -19
- package/src/data-dumps/design-system-dump.ts +0 -16
- package/src/data-dumps/design-system-version-dump.ts +0 -45
- package/src/data-dumps/index.ts +0 -6
- package/src/data-dumps/published-docs-dump.ts +0 -10
- package/src/data-dumps/user-data-dump.ts +0 -10
- package/src/data-dumps/workspace-dump.ts +0 -14
- package/src/docs-server/index.ts +0 -1
- package/src/docs-server/session.ts +0 -39
- package/src/dsm/assets/asset-dynamo-record.ts +0 -10
- package/src/dsm/assets/asset-reference.ts +0 -18
- package/src/dsm/assets/asset-value.ts +0 -3
- package/src/dsm/assets/asset.ts +0 -60
- package/src/dsm/assets/index.ts +0 -4
- package/src/dsm/brand.ts +0 -13
- package/src/dsm/collection.ts +0 -51
- package/src/dsm/components/asset-rendering.ts +0 -22
- package/src/dsm/components/index.ts +0 -1
- package/src/dsm/data-sources/data-source.ts +0 -167
- package/src/dsm/data-sources/import-job.ts +0 -30
- package/src/dsm/data-sources/import-summary.ts +0 -70
- package/src/dsm/data-sources/index.ts +0 -3
- package/src/dsm/design-system.ts +0 -47
- package/src/dsm/documentation/approvals/approval-state.ts +0 -4
- package/src/dsm/documentation/approvals/approval.ts +0 -18
- package/src/dsm/documentation/approvals/index.ts +0 -2
- package/src/dsm/documentation/block-definitions/aux.ts +0 -10
- package/src/dsm/documentation/block-definitions/definition.ts +0 -76
- package/src/dsm/documentation/block-definitions/index.ts +0 -4
- package/src/dsm/documentation/block-definitions/item.ts +0 -233
- package/src/dsm/documentation/block-definitions/variant.ts +0 -49
- package/src/dsm/documentation/group.ts +0 -19
- package/src/dsm/documentation/index.ts +0 -10
- package/src/dsm/documentation/link-preview.ts +0 -10
- package/src/dsm/documentation/page-anchor.ts +0 -9
- package/src/dsm/documentation/page-content-backup.ts +0 -13
- package/src/dsm/documentation/page-content.ts +0 -32
- package/src/dsm/documentation/page.ts +0 -18
- package/src/dsm/documentation/settings.ts +0 -18
- package/src/dsm/documentation/thread.ts +0 -35
- package/src/dsm/element-snapshots/base.ts +0 -34
- package/src/dsm/element-snapshots/documentation-page-snapshot.ts +0 -29
- package/src/dsm/element-snapshots/group-snapshot.ts +0 -27
- package/src/dsm/element-snapshots/index.ts +0 -3
- package/src/dsm/elements/base.ts +0 -49
- package/src/dsm/elements/component-properties.ts +0 -63
- package/src/dsm/elements/data/base.ts +0 -18
- package/src/dsm/elements/data/blur.ts +0 -16
- package/src/dsm/elements/data/border-radius.ts +0 -16
- package/src/dsm/elements/data/border-width.ts +0 -16
- package/src/dsm/elements/data/border.ts +0 -21
- package/src/dsm/elements/data/color.ts +0 -13
- package/src/dsm/elements/data/component.ts +0 -30
- package/src/dsm/elements/data/dimension.ts +0 -15
- package/src/dsm/elements/data/documentation-block-v1.ts +0 -498
- package/src/dsm/elements/data/documentation-block-v2.ts +0 -429
- package/src/dsm/elements/data/documentation-page-v1.ts +0 -9
- package/src/dsm/elements/data/documentation-page-v2.ts +0 -7
- package/src/dsm/elements/data/documentation-section-v2.ts +0 -47
- package/src/dsm/elements/data/documentation-v1.ts +0 -16
- package/src/dsm/elements/data/documentation-v2.ts +0 -18
- package/src/dsm/elements/data/duration.ts +0 -16
- package/src/dsm/elements/data/figma-file-structure.ts +0 -65
- package/src/dsm/elements/data/figma-node-reference.ts +0 -27
- package/src/dsm/elements/data/font-family.ts +0 -8
- package/src/dsm/elements/data/font-size.ts +0 -16
- package/src/dsm/elements/data/font-weight.ts +0 -8
- package/src/dsm/elements/data/font.ts +0 -9
- package/src/dsm/elements/data/gradient.ts +0 -32
- package/src/dsm/elements/data/group.ts +0 -20
- package/src/dsm/elements/data/index.ts +0 -43
- package/src/dsm/elements/data/item-header-v1.ts +0 -35
- package/src/dsm/elements/data/item-header-v2.ts +0 -34
- package/src/dsm/elements/data/item-header.ts +0 -14
- package/src/dsm/elements/data/letter-spacing.ts +0 -16
- package/src/dsm/elements/data/line-height.ts +0 -16
- package/src/dsm/elements/data/opacity.ts +0 -13
- package/src/dsm/elements/data/paragraph-indent.ts +0 -16
- package/src/dsm/elements/data/paragraph-spacing.ts +0 -16
- package/src/dsm/elements/data/product-copy.ts +0 -8
- package/src/dsm/elements/data/safe-id.ts +0 -13
- package/src/dsm/elements/data/shadow.ts +0 -23
- package/src/dsm/elements/data/size.ts +0 -16
- package/src/dsm/elements/data/space.ts +0 -16
- package/src/dsm/elements/data/string.ts +0 -8
- package/src/dsm/elements/data/text-case.ts +0 -10
- package/src/dsm/elements/data/text-decoration.ts +0 -10
- package/src/dsm/elements/data/typography.ts +0 -28
- package/src/dsm/elements/data/visibility.ts +0 -10
- package/src/dsm/elements/data/z-index.ts +0 -16
- package/src/dsm/elements/documentation-page-v1.ts +0 -34
- package/src/dsm/elements/documentation-page-v2.ts +0 -21
- package/src/dsm/elements/figma-component.ts +0 -67
- package/src/dsm/elements/figma-file-structures.ts +0 -40
- package/src/dsm/elements/figma-node-reference.ts +0 -25
- package/src/dsm/elements/group.ts +0 -40
- package/src/dsm/elements/index.ts +0 -15
- package/src/dsm/elements/page-block-v2.ts +0 -25
- package/src/dsm/elements/primitives/index.ts +0 -2
- package/src/dsm/elements/primitives/point.ts +0 -8
- package/src/dsm/elements/primitives/size.ts +0 -28
- package/src/dsm/elements/raw-element.ts +0 -164
- package/src/dsm/elements/theme.ts +0 -76
- package/src/dsm/elements/tokens.ts +0 -311
- package/src/dsm/elements/utils.ts +0 -114
- package/src/dsm/exporter-property-values-collection.ts +0 -31
- package/src/dsm/import/asset.ts +0 -6
- package/src/dsm/import/base.ts +0 -24
- package/src/dsm/import/collection.ts +0 -16
- package/src/dsm/import/component.ts +0 -40
- package/src/dsm/import/data-source.ts +0 -9
- package/src/dsm/import/figma-frames.ts +0 -74
- package/src/dsm/import/image.ts +0 -87
- package/src/dsm/import/index.ts +0 -12
- package/src/dsm/import/origin.ts +0 -5
- package/src/dsm/import/support/figma-files.ts +0 -19
- package/src/dsm/import/support/import-context.ts +0 -94
- package/src/dsm/import/support/import-model-collections.ts +0 -50
- package/src/dsm/import/support/index.ts +0 -3
- package/src/dsm/import/theme.ts +0 -76
- package/src/dsm/import/tokens.ts +0 -50
- package/src/dsm/import/warning.ts +0 -38
- package/src/dsm/index.ts +0 -19
- package/src/dsm/membership/additions.ts +0 -13
- package/src/dsm/membership/design-system-membership.ts +0 -92
- package/src/dsm/membership/ds-role.ts +0 -28
- package/src/dsm/membership/index.ts +0 -4
- package/src/dsm/membership/invitations.ts +0 -21
- package/src/dsm/properties/index.ts +0 -3
- package/src/dsm/properties/property-definition.ts +0 -57
- package/src/dsm/properties/property-reference.ts +0 -5
- package/src/dsm/properties/property-value.ts +0 -29
- package/src/dsm/published-doc-page-visits.ts +0 -15
- package/src/dsm/published-doc-page.ts +0 -37
- package/src/dsm/published-doc.ts +0 -32
- package/src/dsm/reference.ts +0 -9
- package/src/dsm/version.ts +0 -41
- package/src/dsm/views/column.ts +0 -58
- package/src/dsm/views/index.ts +0 -2
- package/src/dsm/views/view.ts +0 -19
- package/src/emails/design-system-invite.ts +0 -31
- package/src/emails/index.ts +0 -2
- package/src/emails/workspace-invite.ts +0 -29
- package/src/events/base.ts +0 -7
- package/src/events/data-source-imported.ts +0 -9
- package/src/events/index.ts +0 -3
- package/src/events/version-released.ts +0 -10
- package/src/export/export-destinations.ts +0 -127
- package/src/export/export-jobs.ts +0 -122
- package/src/export/export-runner/export-context.ts +0 -34
- package/src/export/export-runner/exporter-payload.ts +0 -10
- package/src/export/export-runner/index.ts +0 -2
- package/src/export/exporter-workspace-membership-role.ts +0 -4
- package/src/export/exporter-workspace-membership.ts +0 -14
- package/src/export/exporter.ts +0 -55
- package/src/export/git-providers.ts +0 -11
- package/src/export/index.ts +0 -9
- package/src/export/pipeline.ts +0 -34
- package/src/export/pulsar.ts +0 -71
- package/src/feature-flags/feature-flags.ts +0 -21
- package/src/feature-flags/index.ts +0 -1
- package/src/helpers/db.ts +0 -82
- package/src/helpers/index.ts +0 -2
- package/src/helpers/nullish-to-optional.ts +0 -9
- package/src/index.ts +0 -20
- package/src/integrations/external-oauth-request.ts +0 -12
- package/src/integrations/git.ts +0 -49
- package/src/integrations/index.ts +0 -6
- package/src/integrations/integration.ts +0 -143
- package/src/integrations/oauth-providers.ts +0 -13
- package/src/integrations/oauth-token.ts +0 -16
- package/src/integrations/workspace-oauth-requests.ts +0 -12
- package/src/liveblocks/index.ts +0 -1
- package/src/liveblocks/rooms/design-system-version-room.ts +0 -62
- package/src/liveblocks/rooms/documentation-page-room.ts +0 -65
- package/src/liveblocks/rooms/index.ts +0 -4
- package/src/liveblocks/rooms/room-type.ts +0 -12
- package/src/liveblocks/rooms/workspace-room.ts +0 -16
- package/src/npm/index.ts +0 -2
- package/src/npm/npm-package.ts +0 -30
- package/src/npm/npm-proxy-token-payload.ts +0 -7
- package/src/tokens/index.ts +0 -1
- package/src/tokens/personal-access-token.ts +0 -25
- package/src/users/index.ts +0 -9
- package/src/users/linked-integrations.ts +0 -36
- package/src/users/user-analytics-cleanup-schedule.ts +0 -15
- package/src/users/user-identity.ts +0 -8
- package/src/users/user-minified.ts +0 -10
- package/src/users/user-notification-settings.ts +0 -18
- package/src/users/user-profile.ts +0 -41
- package/src/users/user-test.ts +0 -8
- package/src/users/user-with-pat.ts +0 -7
- package/src/users/user.ts +0 -21
- package/src/utils/common.ts +0 -172
- package/src/utils/content-loader-instruction.ts +0 -31
- package/src/utils/errors.ts +0 -120
- package/src/utils/index.ts +0 -6
- package/src/utils/naming.ts +0 -73
- package/src/utils/slugify.ts +0 -636
- package/src/utils/validation.ts +0 -4
- package/src/workspace/index.ts +0 -10
- package/src/workspace/npm-registry-settings.ts +0 -45
- package/src/workspace/sso-provider.ts +0 -13
- package/src/workspace/user-invite.ts +0 -18
- package/src/workspace/workspace-configuration.ts +0 -14
- package/src/workspace/workspace-context.ts +0 -13
- package/src/workspace/workspace-create.ts +0 -25
- package/src/workspace/workspace-invitations.ts +0 -22
- package/src/workspace/workspace-membership.ts +0 -31
- package/src/workspace/workspace-role.ts +0 -6
- package/src/workspace/workspace.ts +0 -62
package/src/dsm/assets/index.ts
DELETED
package/src/dsm/brand.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { DbCreateInputOmit } from "../helpers";
|
|
3
|
-
|
|
4
|
-
export const Brand = z.object({
|
|
5
|
-
id: z.string(),
|
|
6
|
-
designSystemVersionId: z.string(),
|
|
7
|
-
persistentId: z.string(),
|
|
8
|
-
name: z.string(),
|
|
9
|
-
description: z.string(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export type Brand = z.infer<typeof Brand>;
|
|
13
|
-
export type CreateBrand = DbCreateInputOmit<Brand>;
|
package/src/dsm/collection.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { DbCreateInputOmit, DbUpdate } from "../helpers";
|
|
3
|
-
import { OmitStrict } from "../utils";
|
|
4
|
-
import { ColorTokenInlineData } from "./properties";
|
|
5
|
-
|
|
6
|
-
export const CollectionOrigin = z.object({
|
|
7
|
-
id: z.string(),
|
|
8
|
-
sourceId: z.string(),
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
export const Collection = z.object({
|
|
12
|
-
id: z.string(),
|
|
13
|
-
persistentId: z.string(),
|
|
14
|
-
|
|
15
|
-
designSystemVersionId: z.string(),
|
|
16
|
-
|
|
17
|
-
name: z.string(),
|
|
18
|
-
description: z.string(),
|
|
19
|
-
backgroundColor: ColorTokenInlineData.optional(),
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* ID of Select element property definition's option that corresponds to this collection.
|
|
23
|
-
*
|
|
24
|
-
* Each collection is represented by an option in a special kind of element property that
|
|
25
|
-
* is present in each design system where a collections are present. The property is maintained
|
|
26
|
-
* automatically and is not available to the user (see immutable element properties).
|
|
27
|
-
*
|
|
28
|
-
* Collections have an immutable element property that allows bridging places where element properites
|
|
29
|
-
* can be selected (e.g. documentation blocks) with the concept of collection without having to add
|
|
30
|
-
* specific logic for collection selection.
|
|
31
|
-
*/
|
|
32
|
-
elementPropertyOptionId: z.string(),
|
|
33
|
-
|
|
34
|
-
createdAt: z.coerce.date(),
|
|
35
|
-
updatedAt: z.coerce.date(),
|
|
36
|
-
|
|
37
|
-
sortOrder: z.string(),
|
|
38
|
-
|
|
39
|
-
origin: CollectionOrigin.optional(),
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
export type CollectionOrigin = z.infer<typeof CollectionOrigin>;
|
|
43
|
-
export type Collection = z.infer<typeof Collection>;
|
|
44
|
-
|
|
45
|
-
export type CreateCollection = OmitStrict<DbCreateInputOmit<Collection>, "elementPropertyOptionId">;
|
|
46
|
-
export type UpdateCollection = OmitStrict<
|
|
47
|
-
DbUpdate<Collection>,
|
|
48
|
-
"designSystemVersionId" | "origin" | "elementPropertyOptionId"
|
|
49
|
-
> & {
|
|
50
|
-
origin?: Partial<CollectionOrigin>;
|
|
51
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { FigmaRenderFormat } from "../import";
|
|
3
|
-
|
|
4
|
-
export const AssetRenderConfiguration = z.object({
|
|
5
|
-
prefix: z.string().optional(),
|
|
6
|
-
suffix: z.string().optional(),
|
|
7
|
-
scale: z.number(),
|
|
8
|
-
format: FigmaRenderFormat,
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
export const RenderedAssetFile = z.object({
|
|
12
|
-
assetPersistentId: z.string(),
|
|
13
|
-
assetName: z.string(),
|
|
14
|
-
|
|
15
|
-
renderedImageFileName: z.string(),
|
|
16
|
-
renderedImageUrl: z.string(),
|
|
17
|
-
|
|
18
|
-
settings: AssetRenderConfiguration,
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export type AssetRenderConfiguration = z.infer<typeof AssetRenderConfiguration>;
|
|
22
|
-
export type RenderedAssetFile = z.infer<typeof RenderedAssetFile>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./asset-rendering";
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { DbCreateInputOmit, DbUpdate, nullishToOptional } from "../../helpers";
|
|
3
|
-
import { OmitStrict } from "../../utils";
|
|
4
|
-
import { ImportWarning } from "../import/warning";
|
|
5
|
-
import { SourceImportSummary } from "./import-summary";
|
|
6
|
-
|
|
7
|
-
//
|
|
8
|
-
// Enums
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
export const DataSourceRemoteType = z.enum(["Figma", "TokenStudio", "FigmaVariablesPlugin"]);
|
|
12
|
-
export const DataSourceUploadRemoteSource = z.enum(["TokenStudio", "FigmaVariablesPlugin", "Custom"]);
|
|
13
|
-
export const DataSourceFigmaState = z.enum(["Active", "MissingIntegration", "MissingFileAccess", "MissingFileOwner"]);
|
|
14
|
-
export const DataSourceAutoImportMode = z.enum(["Never", "Hourly"]);
|
|
15
|
-
|
|
16
|
-
export type DataSourceRemoteType = z.infer<typeof DataSourceRemoteType>;
|
|
17
|
-
export type DataSourceUploadRemoteSource = z.infer<typeof DataSourceUploadRemoteSource>;
|
|
18
|
-
export type DataSourceFigmaState = z.infer<typeof DataSourceFigmaState>;
|
|
19
|
-
export type DataSourceAutoImportMode = z.infer<typeof DataSourceAutoImportMode>;
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
// Aux
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
export const DataSourceStats = z.object({
|
|
26
|
-
tokens: zeroNumberByDefault(),
|
|
27
|
-
components: zeroNumberByDefault(),
|
|
28
|
-
assets: zeroNumberByDefault(),
|
|
29
|
-
frames: zeroNumberByDefault(),
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export type DataSourceStats = z.infer<typeof DataSourceStats>;
|
|
33
|
-
|
|
34
|
-
//
|
|
35
|
-
// Figma
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
export const DataSourceFigmaFileData = z.object({
|
|
39
|
-
lastUpdatedAt: z.coerce.date(),
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
export const DataSourceFigmaFileVersionData = z.object({
|
|
43
|
-
id: z.string(),
|
|
44
|
-
label: z.string().optional(),
|
|
45
|
-
description: z.string().optional(),
|
|
46
|
-
createdAt: z.coerce.date(),
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
export const DataSourceFigmaScope = z.object({
|
|
50
|
-
assets: z.boolean(),
|
|
51
|
-
components: z.boolean(),
|
|
52
|
-
documentationFrames: z.boolean(),
|
|
53
|
-
tokens: z.boolean(),
|
|
54
|
-
themePersistentId: z.string().optional(),
|
|
55
|
-
isUnpublishedContentFallbackEnabled: z.boolean(),
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
export const DataSourceFigmaImportMetadata = z.object({
|
|
59
|
-
fileData: DataSourceFigmaFileData.optional(),
|
|
60
|
-
importedPublishedVersion: DataSourceFigmaFileVersionData.optional(),
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
export const DataSourceFigmaRemote = z.object({
|
|
64
|
-
type: z.literal(DataSourceRemoteType.Enum.Figma),
|
|
65
|
-
fileId: z.string(),
|
|
66
|
-
preferredCredentialId: z.string().optional(),
|
|
67
|
-
ownerId: z.string(), // todo remove or keep to reference who created data source
|
|
68
|
-
ownerName: z.string(), // todo probably remove
|
|
69
|
-
scope: DataSourceFigmaScope,
|
|
70
|
-
state: DataSourceFigmaState,
|
|
71
|
-
requiresSync: z
|
|
72
|
-
.boolean()
|
|
73
|
-
.optional()
|
|
74
|
-
.transform(v => v ?? false),
|
|
75
|
-
lastImportMetadata: DataSourceFigmaImportMetadata.optional(),
|
|
76
|
-
downloadChunkSize: z.number().optional(),
|
|
77
|
-
figmaRenderChunkSize: z.number().optional(),
|
|
78
|
-
maxFileDepth: z.number().optional(),
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
export type DataSourceFigmaFileData = z.infer<typeof DataSourceFigmaFileData>;
|
|
82
|
-
export type DataSourceFigmaFileVersionData = z.infer<typeof DataSourceFigmaFileVersionData>;
|
|
83
|
-
export type DataSourceFigmaScope = z.infer<typeof DataSourceFigmaScope>;
|
|
84
|
-
export type DataSourceFigmaImportMetadata = z.infer<typeof DataSourceFigmaImportMetadata>;
|
|
85
|
-
export type DataSourceFigmaRemote = z.infer<typeof DataSourceFigmaRemote>;
|
|
86
|
-
|
|
87
|
-
//
|
|
88
|
-
// Token Studio
|
|
89
|
-
//
|
|
90
|
-
|
|
91
|
-
export const DataSourceTokenStudioRemote = z.object({
|
|
92
|
-
type: z.literal(DataSourceRemoteType.Enum.TokenStudio),
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
export type DataSourceTokenStudioRemote = z.infer<typeof DataSourceTokenStudioRemote>;
|
|
96
|
-
|
|
97
|
-
//
|
|
98
|
-
// Figma Variables Plugin
|
|
99
|
-
//
|
|
100
|
-
|
|
101
|
-
export const DataSourceUploadImportMetadata = z.record(z.any());
|
|
102
|
-
|
|
103
|
-
export const DataSourceUploadRemote = z.object({
|
|
104
|
-
type: z.literal(DataSourceRemoteType.Enum.FigmaVariablesPlugin),
|
|
105
|
-
remoteId: z.string(),
|
|
106
|
-
remoteSourceType: DataSourceUploadRemoteSource,
|
|
107
|
-
lastImportMetadata: DataSourceUploadImportMetadata.optional(),
|
|
108
|
-
warnings: nullishToOptional(ImportWarning.array()),
|
|
109
|
-
isTokenTypeSplitEnabled: z.boolean(),
|
|
110
|
-
isCollectionsMigrationCompleted: z.boolean(),
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
export type DataSourceUploadImportMetadata = z.infer<typeof DataSourceUploadImportMetadata>;
|
|
114
|
-
export type DataSourceUploadRemote = z.infer<typeof DataSourceUploadRemote>;
|
|
115
|
-
|
|
116
|
-
//
|
|
117
|
-
// Base
|
|
118
|
-
//
|
|
119
|
-
|
|
120
|
-
export const DataSourceRemote = z.discriminatedUnion("type", [
|
|
121
|
-
DataSourceFigmaRemote,
|
|
122
|
-
DataSourceUploadRemote,
|
|
123
|
-
DataSourceTokenStudioRemote,
|
|
124
|
-
]);
|
|
125
|
-
|
|
126
|
-
export const DataSource = z.object({
|
|
127
|
-
id: z.string(),
|
|
128
|
-
|
|
129
|
-
name: z.string(),
|
|
130
|
-
thumbnailUrl: z.string().optional(),
|
|
131
|
-
|
|
132
|
-
createdAt: z.coerce.date().optional(),
|
|
133
|
-
|
|
134
|
-
lastImportedAt: z.coerce.date().optional(),
|
|
135
|
-
lastImportSummary: SourceImportSummary.optional(),
|
|
136
|
-
|
|
137
|
-
designSystemId: z.string(),
|
|
138
|
-
brandPersistentId: z.string(),
|
|
139
|
-
autoImportMode: DataSourceAutoImportMode,
|
|
140
|
-
stats: DataSourceStats,
|
|
141
|
-
|
|
142
|
-
remote: DataSourceRemote,
|
|
143
|
-
|
|
144
|
-
sortOrder: z.number(),
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
export const DataSourceVersion = z.object({
|
|
148
|
-
id: z.string(),
|
|
149
|
-
createdAt: z.coerce.date(),
|
|
150
|
-
label: z.string().nullish(),
|
|
151
|
-
description: z.string().nullish(),
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
export type DataSourceVersion = z.infer<typeof DataSourceVersion>;
|
|
155
|
-
|
|
156
|
-
export type DataSourceRemote = z.infer<typeof DataSourceRemote>;
|
|
157
|
-
export type DataSource = z.infer<typeof DataSource>;
|
|
158
|
-
|
|
159
|
-
export type CreateDataSource = OmitStrict<DbCreateInputOmit<DataSource>, "sortOrder">;
|
|
160
|
-
export type UpdateDataSource = OmitStrict<DbUpdate<DataSource>, "brandPersistentId" | "designSystemId">;
|
|
161
|
-
|
|
162
|
-
function zeroNumberByDefault() {
|
|
163
|
-
return z
|
|
164
|
-
.number()
|
|
165
|
-
.nullish()
|
|
166
|
-
.transform(v => v ?? 0);
|
|
167
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { DbCreateInputOmit, DbUpdate } from "../../helpers";
|
|
3
|
-
import { OmitStrict } from "../../utils";
|
|
4
|
-
import { DataSourceRemoteType } from "./data-source";
|
|
5
|
-
import { Entity } from "../../common";
|
|
6
|
-
|
|
7
|
-
export const ImportJobState = z.enum(["PendingInput", "Queued", "InProgress", "Failed", "Success"]);
|
|
8
|
-
export const ImportJobOperation = z.enum(["Check", "Import"]);
|
|
9
|
-
|
|
10
|
-
export const ImportJob = Entity.extend({
|
|
11
|
-
designSystemId: z.string(),
|
|
12
|
-
designSystemVersionId: z.string(),
|
|
13
|
-
sourceIds: z.array(z.string()),
|
|
14
|
-
state: ImportJobState,
|
|
15
|
-
createdByUserId: z.string().optional(),
|
|
16
|
-
importContextId: z.string(),
|
|
17
|
-
error: z.string().optional(),
|
|
18
|
-
sourceType: DataSourceRemoteType,
|
|
19
|
-
importContextCleanedUp: z.boolean(),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export type ImportJobState = z.infer<typeof ImportJobState>;
|
|
23
|
-
export type ImportJobOperation = z.infer<typeof ImportJobOperation>;
|
|
24
|
-
export type ImportJob = z.infer<typeof ImportJob>;
|
|
25
|
-
|
|
26
|
-
export type CreateImportJob = DbCreateInputOmit<ImportJob>;
|
|
27
|
-
export type UpdateImportJob = OmitStrict<
|
|
28
|
-
DbUpdate<ImportJob>,
|
|
29
|
-
"designSystemId" | "createdByUserId" | "sourceIds" | "importContextId"
|
|
30
|
-
>;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { nullishToOptional } from "../../helpers";
|
|
3
|
-
import { DesignTokenType } from "../elements";
|
|
4
|
-
import { ImportWarning } from "../import/warning";
|
|
5
|
-
|
|
6
|
-
export const FileStructureStats = z.object({
|
|
7
|
-
frames: zeroNumberByDefault(),
|
|
8
|
-
components: zeroNumberByDefault(),
|
|
9
|
-
componentSets: zeroNumberByDefault(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const SourceImportSummaryByTokenTypeKey = DesignTokenType.or(
|
|
13
|
-
// Backward compatibility
|
|
14
|
-
z.enum(["Measure", "Radius", "GenericToken", "Font", "Text"])
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
export const SourceImportSummaryByTokenType = z.record(SourceImportSummaryByTokenTypeKey, z.number());
|
|
18
|
-
|
|
19
|
-
export const SourceImportTokenSummary = z.object({
|
|
20
|
-
tokensCreated: zeroNumberByDefault(),
|
|
21
|
-
tokensUpdated: zeroNumberByDefault(),
|
|
22
|
-
tokensDeleted: zeroNumberByDefault(),
|
|
23
|
-
tokensCreatedPerType: SourceImportSummaryByTokenType.nullish().transform(v => v ?? {}),
|
|
24
|
-
tokensUpdatedPerType: SourceImportSummaryByTokenType.nullish().transform(v => v ?? {}),
|
|
25
|
-
tokensDeletedPerType: SourceImportSummaryByTokenType.nullish().transform(v => v ?? {}),
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
export const SourceImportComponentSummary = z.object({
|
|
29
|
-
componentsCreated: zeroNumberByDefault(),
|
|
30
|
-
componentsUpdated: zeroNumberByDefault(),
|
|
31
|
-
componentsDeleted: zeroNumberByDefault(),
|
|
32
|
-
componentAssetsCreated: zeroNumberByDefault(),
|
|
33
|
-
componentAssetsUpdated: zeroNumberByDefault(),
|
|
34
|
-
componentAssetsDeleted: zeroNumberByDefault(),
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
export const SourceImportFrameSummary = z.object({
|
|
38
|
-
assetsInFile: nullishToOptional(FileStructureStats.optional()),
|
|
39
|
-
invalidReferencesCount: nullishToOptional(z.number().optional()),
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
export const SourceImportSummary = z.object({
|
|
43
|
-
sourceId: nullishToOptional(z.string()),
|
|
44
|
-
brandId: nullishToOptional(z.string()),
|
|
45
|
-
versionId: nullishToOptional(z.string()),
|
|
46
|
-
error: nullishToOptional(z.any()),
|
|
47
|
-
isFailed: z.boolean(),
|
|
48
|
-
warnings: z
|
|
49
|
-
.array(ImportWarning)
|
|
50
|
-
.nullish()
|
|
51
|
-
.transform(v => v ?? []),
|
|
52
|
-
|
|
53
|
-
...SourceImportTokenSummary.shape,
|
|
54
|
-
...SourceImportComponentSummary.shape,
|
|
55
|
-
...FileStructureStats.shape,
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
export type FileStructureStats = z.infer<typeof FileStructureStats>;
|
|
59
|
-
export type SourceImportSummaryByTokenType = z.infer<typeof SourceImportSummaryByTokenType>;
|
|
60
|
-
export type SourceImportTokenSummary = z.infer<typeof SourceImportTokenSummary>;
|
|
61
|
-
export type SourceImportComponentSummary = z.infer<typeof SourceImportComponentSummary>;
|
|
62
|
-
export type SourceImportFrameSummary = z.infer<typeof SourceImportFrameSummary>;
|
|
63
|
-
export type SourceImportSummary = z.infer<typeof SourceImportSummary>;
|
|
64
|
-
|
|
65
|
-
function zeroNumberByDefault() {
|
|
66
|
-
return z
|
|
67
|
-
.number()
|
|
68
|
-
.nullish()
|
|
69
|
-
.transform(v => v ?? 0);
|
|
70
|
-
}
|
package/src/dsm/design-system.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { DbCreateInputOmit, DbUpdate, nullishToOptional } from "../helpers";
|
|
3
|
-
import { OmitStrict } from "../utils";
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
// Enums
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
export const DesignSystemAccessMode = z.enum(["Open", "InviteOnly"]);
|
|
10
|
-
export type DesignSystemAccessMode = z.infer<typeof DesignSystemAccessMode>;
|
|
11
|
-
|
|
12
|
-
//
|
|
13
|
-
// Model
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
export const DesignSystemSwitcher = z.object({
|
|
17
|
-
isEnabled: z.boolean(),
|
|
18
|
-
designSystemIds: z.array(z.string()),
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export const DesignSystem = z.object({
|
|
22
|
-
id: z.string(),
|
|
23
|
-
workspaceId: z.string(),
|
|
24
|
-
name: z.string(),
|
|
25
|
-
description: z.string(),
|
|
26
|
-
docExporterId: nullishToOptional(z.string()),
|
|
27
|
-
docSlug: z.string(),
|
|
28
|
-
docUserSlug: nullishToOptional(z.string()),
|
|
29
|
-
docSlugDeprecated: z.string(),
|
|
30
|
-
isMultibrand: z.boolean(),
|
|
31
|
-
docViewUrl: nullishToOptional(z.string()),
|
|
32
|
-
basePrefixes: z.array(z.string()),
|
|
33
|
-
designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),
|
|
34
|
-
isApprovalFeatureEnabled: z.boolean(),
|
|
35
|
-
approvalRequiredForPublishing: z.boolean(),
|
|
36
|
-
accessMode: DesignSystemAccessMode,
|
|
37
|
-
membersGenerated: z.boolean(),
|
|
38
|
-
|
|
39
|
-
createdAt: z.coerce.date(),
|
|
40
|
-
updatedAt: z.coerce.date(),
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
export type DesignSystemSwitcher = z.infer<typeof DesignSystemSwitcher>;
|
|
44
|
-
export type DesignSystem = z.infer<typeof DesignSystem>;
|
|
45
|
-
|
|
46
|
-
export type CreateDesignSystem = DbCreateInputOmit<DesignSystem>;
|
|
47
|
-
export type UpdateDesignSystem = OmitStrict<DbUpdate<DesignSystem>, "workspaceId" | "docSlug" | "docSlugDeprecated">;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { DbCreateInputOmit } from "../../../helpers/db";
|
|
3
|
-
import { DocumentationPageApprovalState } from "../approvals/approval-state";
|
|
4
|
-
|
|
5
|
-
export const DocumentationPageApproval = z.object({
|
|
6
|
-
id: z.string(),
|
|
7
|
-
approvalState: DocumentationPageApprovalState,
|
|
8
|
-
persistentId: z.string(),
|
|
9
|
-
pageId: z.string(),
|
|
10
|
-
pagePersistentId: z.string(),
|
|
11
|
-
updatedByUserId: z.string(),
|
|
12
|
-
designSystemVersionId: z.string(),
|
|
13
|
-
updatedAt: z.coerce.date(),
|
|
14
|
-
createdAt: z.coerce.date(),
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export type CreateDocumentationPageApproval = DbCreateInputOmit<DocumentationPageApproval>;
|
|
18
|
-
export type DocumentationPageApproval = z.infer<typeof DocumentationPageApproval>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const PageBlockDefinitionAppearance = z.object({
|
|
4
|
-
isBordered: z.boolean().optional(),
|
|
5
|
-
hasBackground: z.boolean().optional(),
|
|
6
|
-
isEditorPresentationDifferent: z.boolean().optional(),
|
|
7
|
-
showBlockHeaderInEditor: z.boolean().optional(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export type PageBlockDefinitionAppearance = z.infer<typeof PageBlockDefinitionAppearance>;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { PageBlockDefinitionAppearance } from "./aux";
|
|
3
|
-
import { PageBlockDefinitionItem } from "./item";
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
// Enums
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
export const PageBlockCategory = z.enum([
|
|
10
|
-
"Text",
|
|
11
|
-
"Layout",
|
|
12
|
-
"Media",
|
|
13
|
-
"Embed",
|
|
14
|
-
"Figma",
|
|
15
|
-
"Code",
|
|
16
|
-
"Guidelines",
|
|
17
|
-
"Tokens",
|
|
18
|
-
"Components",
|
|
19
|
-
"Assets",
|
|
20
|
-
"Data",
|
|
21
|
-
"Other",
|
|
22
|
-
]);
|
|
23
|
-
|
|
24
|
-
export const PageBlockBehaviorDataType = z.enum(["Item", "Token", "Asset", "Component", "FigmaNode", "FigmaComponent"]);
|
|
25
|
-
export const PageBlockBehaviorSelectionType = z.enum(["Entity", "Group", "EntityAndGroup"]);
|
|
26
|
-
|
|
27
|
-
export type PageBlockCategory = z.infer<typeof PageBlockCategory>;
|
|
28
|
-
export type PageBlockBehaviorDataType = z.infer<typeof PageBlockBehaviorDataType>;
|
|
29
|
-
export type PageBlockBehaviorSelectionType = z.infer<typeof PageBlockBehaviorSelectionType>;
|
|
30
|
-
|
|
31
|
-
//
|
|
32
|
-
// Definitions
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
export const PageBlockDefinitionBehavior = z.object({
|
|
36
|
-
dataType: PageBlockBehaviorDataType,
|
|
37
|
-
items: z
|
|
38
|
-
.object({
|
|
39
|
-
numberOfItems: z.number(),
|
|
40
|
-
allowLinks: z.boolean(),
|
|
41
|
-
newItemLabel: z.string().optional(),
|
|
42
|
-
})
|
|
43
|
-
.optional(),
|
|
44
|
-
entities: z
|
|
45
|
-
.object({
|
|
46
|
-
selectionType: PageBlockBehaviorSelectionType,
|
|
47
|
-
maxSelected: z.number(),
|
|
48
|
-
})
|
|
49
|
-
.optional(),
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
export const PageBlockDefinitionOnboarding = z.object({
|
|
53
|
-
helpText: z.string(),
|
|
54
|
-
documentationLink: z.string().optional(),
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
export const PageBlockDefinition = z.object({
|
|
58
|
-
id: z.string(),
|
|
59
|
-
name: z.string(),
|
|
60
|
-
description: z.string(),
|
|
61
|
-
category: PageBlockCategory,
|
|
62
|
-
icon: z.string().optional(),
|
|
63
|
-
documentationLink: z.string().optional(),
|
|
64
|
-
searchKeywords: z.array(z.string()).optional(),
|
|
65
|
-
item: PageBlockDefinitionItem,
|
|
66
|
-
behavior: PageBlockDefinitionBehavior,
|
|
67
|
-
editorOptions: z.object({
|
|
68
|
-
onboarding: PageBlockDefinitionOnboarding.optional(),
|
|
69
|
-
newItemLabel: z.string().optional(),
|
|
70
|
-
}),
|
|
71
|
-
appearance: PageBlockDefinitionAppearance.optional(),
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
export type PageBlockDefinitionBehavior = z.infer<typeof PageBlockDefinitionBehavior>;
|
|
75
|
-
export type PageBlockDefinitionOnboarding = z.infer<typeof PageBlockDefinitionOnboarding>;
|
|
76
|
-
export type PageBlockDefinition = z.infer<typeof PageBlockDefinition>;
|