@supernova-studio/model 0.54.3 → 0.54.5

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.3",
3
+ "version": "0.54.5",
4
4
  "description": "Supernova Data Models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,6 +1,16 @@
1
1
  import { z } from "zod";
2
2
  import { nullishToOptional } from "../helpers";
3
- import { Workspace } from "../workspace/workspace";
3
+
4
+ //
5
+ // Enums
6
+ //
7
+
8
+ export const DesignSystemAccessMode = z.enum(["Open", "InviteOnly"]);
9
+ export type DesignSystemAccessMode = z.infer<typeof DesignSystemAccessMode>;
10
+
11
+ //
12
+ // Model
13
+ //
4
14
 
5
15
  export const DesignSystemSwitcher = z.object({
6
16
  isEnabled: z.boolean(),
@@ -23,15 +33,10 @@ export const DesignSystem = z.object({
23
33
  designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),
24
34
  isApprovalFeatureEnabled: z.boolean(),
25
35
  approvalRequiredForPublishing: z.boolean(),
36
+ accessMode: DesignSystemAccessMode,
26
37
  createdAt: z.coerce.date(),
27
38
  updatedAt: z.coerce.date(),
28
39
  });
29
40
 
30
- export const DesignSystemWithWorkspace = z.object({
31
- designSystem: DesignSystem,
32
- workspace: Workspace,
33
- });
34
-
35
41
  export type DesignSystemSwitcher = z.infer<typeof DesignSystemSwitcher>;
36
42
  export type DesignSystem = z.infer<typeof DesignSystem>;
37
- export type DesignSystemWithWorkspace = z.infer<typeof DesignSystemWithWorkspace>;
@@ -2,24 +2,34 @@ import { z } from "zod";
2
2
 
3
3
  export const FigmaComponentPropertyType = z.enum(["Boolean", "InstanceSwap", "Variant", "Text"]);
4
4
 
5
- export const FigmaComponentBooleanProperty = z.object({
5
+ export const FigmaComponentPropertyOrigin = z.object({
6
+ id: z.string(),
7
+ });
8
+
9
+ const FigmaComponentPropertyBase = z.object({
10
+ id: z.string(),
11
+ name: z.string(),
12
+ });
13
+
14
+ export const FigmaComponentBooleanProperty = FigmaComponentPropertyBase.extend({
6
15
  type: z.literal(FigmaComponentPropertyType.enum.Boolean),
7
16
  defaultValue: z.boolean(),
8
17
  });
9
18
 
10
- export const FigmaComponentInstanceSwapProperty = z.object({
19
+ export const FigmaComponentInstanceSwapProperty = FigmaComponentPropertyBase.extend({
11
20
  type: z.literal(FigmaComponentPropertyType.enum.InstanceSwap),
12
21
  defaultValue: z.string(),
13
22
  });
14
23
 
15
- export const FigmaComponentVariantProperty = z.object({
24
+ export const FigmaComponentVariantProperty = FigmaComponentPropertyBase.extend({
16
25
  type: z.literal(FigmaComponentPropertyType.enum.Variant),
17
26
  defaultValue: z.string(),
18
27
  options: z.array(z.string()),
19
28
  });
20
29
 
21
- export const FigmaComponentTextProperty = z.object({
30
+ export const FigmaComponentTextProperty = FigmaComponentPropertyBase.extend({
22
31
  type: z.literal(FigmaComponentPropertyType.enum.Text),
32
+ id: z.string(),
23
33
  defaultValue: z.string(),
24
34
  });
25
35
 
@@ -27,6 +37,7 @@ export const FigmaComponentProperty = z.discriminatedUnion("type", [
27
37
  FigmaComponentBooleanProperty,
28
38
  FigmaComponentInstanceSwapProperty,
29
39
  FigmaComponentTextProperty,
40
+ FigmaComponentVariantProperty,
30
41
  ]);
31
42
 
32
43
  export const FigmaComponentPropertyMap = z.record(z.string(), FigmaComponentProperty);