@supernova-studio/model 0.54.13 → 0.54.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supernova-studio/model",
3
- "version": "0.54.13",
3
+ "version": "0.54.15",
4
4
  "description": "Supernova Data Models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
- import { nullishToOptional } from "../helpers";
2
+ import { DbCreateInputOmit, DbUpdate, nullishToOptional } from "../helpers";
3
+ import { OmitStrict } from "../utils";
3
4
 
4
5
  //
5
6
  // Enums
@@ -34,9 +35,13 @@ export const DesignSystem = z.object({
34
35
  isApprovalFeatureEnabled: z.boolean(),
35
36
  approvalRequiredForPublishing: z.boolean(),
36
37
  accessMode: DesignSystemAccessMode,
38
+
37
39
  createdAt: z.coerce.date(),
38
40
  updatedAt: z.coerce.date(),
39
41
  });
40
42
 
41
43
  export type DesignSystemSwitcher = z.infer<typeof DesignSystemSwitcher>;
42
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">;
@@ -29,7 +29,6 @@ export const DesignTokenType = z.enum([
29
29
  "ParagraphSpacing",
30
30
  "BorderWidth",
31
31
  "BorderRadius",
32
- "Duration",
33
32
  "ZIndex",
34
33
  "Image",
35
34
  "String",
package/src/dsm/index.ts CHANGED
@@ -9,9 +9,7 @@ export * from "./membership";
9
9
  export * from "./properties";
10
10
  export * from "./views";
11
11
  export * from "./brand";
12
- export * from "./design-system-update";
13
12
  export * from "./design-system";
14
- export * from "./desing-system-create";
15
13
  export * from "./exporter-property-values-collection";
16
14
  export * from "./published-doc-page";
17
15
  export * from "./published-doc";
@@ -1,27 +0,0 @@
1
- import { z } from "zod";
2
- import { DesignSystem } from "./design-system";
3
-
4
- const DS_NAME_MIN_LENGTH: number = 2;
5
- const DS_NAME_MAX_LENGTH: number = 64;
6
- const DS_DESC_MAX_LENGTH: number = 2048;
7
-
8
- const DesignSystemUpdateInputMetadata = z.object({
9
- name: z.string().min(DS_NAME_MIN_LENGTH).max(DS_NAME_MAX_LENGTH).trim().optional(),
10
- description: z.string().max(DS_DESC_MAX_LENGTH).trim().optional(),
11
- });
12
-
13
- export const DesignSystemUpdateInput = DesignSystem.partial()
14
- .omit({
15
- id: true,
16
- workspaceId: true,
17
- createdAt: true,
18
- updatedAt: true,
19
- docSlug: true,
20
- docViewUrl: true,
21
- })
22
- .extend({
23
- meta: DesignSystemUpdateInputMetadata.optional(),
24
- });
25
-
26
- export type DesignSystemUpdateInput = z.infer<typeof DesignSystemUpdateInput>;
27
- export type DesignSystemUpdateInputMetadata = z.infer<typeof DesignSystemUpdateInputMetadata>;
@@ -1,21 +0,0 @@
1
- import { z } from "zod";
2
-
3
- const DS_NAME_MIN_LENGTH: number = 2;
4
- const DS_NAME_MAX_LENGTH: number = 64;
5
- const DS_DESC_MAX_LENGTH: number = 64;
6
-
7
- const DesignSystemCreateInputMetadata = z.object({
8
- name: z.string().min(DS_NAME_MIN_LENGTH).max(DS_NAME_MAX_LENGTH).trim(),
9
- description: z.string().max(DS_DESC_MAX_LENGTH).trim(),
10
- });
11
-
12
- export const DesignSystemCreateInput = z.object({
13
- meta: DesignSystemCreateInputMetadata,
14
- workspaceId: z.string(),
15
- isPublic: z.boolean().optional(),
16
- basePrefixes: z.array(z.string()).optional(),
17
- docUserSlug: z.string().nullish().optional(),
18
- source: z.array(z.string()).optional(),
19
- });
20
-
21
- export type DesignSystemCreateInput = z.infer<typeof DesignSystemCreateInput>;