@supernova-studio/model 0.48.37 → 0.49.0

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.48.37",
3
+ "version": "0.49.0",
4
4
  "description": "Supernova Data Models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,6 +21,7 @@ export const DesignSystem = z.object({
21
21
  docViewUrl: nullishToOptional(z.string()),
22
22
  basePrefixes: z.array(z.string()),
23
23
  designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),
24
+ isApprovalFeatureEnabled: z.boolean(),
24
25
  createdAt: z.coerce.date(),
25
26
  updatedAt: z.coerce.date(),
26
27
  });
@@ -0,0 +1,4 @@
1
+ import { z } from "zod";
2
+
3
+ export const DocumentationPageApprovalState = z.enum(["ReadyForReview", "ChangesRequested", "Approved"]);
4
+ export type DocumentationPageApprovalState = z.infer<typeof DocumentationPageApprovalState>;
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+ import { DbCreateInputOmit, DocumentationPageApprovalState } from "../../../";
3
+
4
+ export const DocumentationPageApproval = z.object({
5
+ id: z.string(),
6
+ approvalState: DocumentationPageApprovalState,
7
+ persistentId: z.string(),
8
+ pageId: z.string(),
9
+ pagePersistentId: z.string(),
10
+ updatedByUserId: z.string(),
11
+ designSystemVersionId: z.string(),
12
+ updatedAt: z.coerce.date(),
13
+ createdAt: z.coerce.date(),
14
+ });
15
+
16
+ export type CreateDocumentationPageApproval = DbCreateInputOmit<DocumentationPageApproval>;
17
+ export type DocumentationPageApproval = z.infer<typeof DocumentationPageApproval>;
@@ -0,0 +1,2 @@
1
+ export * from "./approval-state";
2
+ export * from "./approval";
@@ -1,3 +1,4 @@
1
+ export * from "./approvals";
1
2
  export * from "./block-definitions";
2
3
  export * from "./group";
3
4
  export * from "./link-preview";
@@ -3,8 +3,7 @@ import { FigmaComponentSetProperties } from "./component-properties";
3
3
  import { z } from "zod";
4
4
 
5
5
  export const ComponentSet = BaseComponent.extend({
6
- properties: FigmaComponentSetProperties,
6
+ properties: FigmaComponentSetProperties,
7
7
  });
8
8
 
9
-
10
9
  export type ComponentSet = z.infer<typeof ComponentSet>;
@@ -30,10 +30,10 @@ export const BaseComponent = DesignElementBase.extend(DesignElementGroupableRequ
30
30
  });
31
31
 
32
32
  export const Component = BaseComponent.extend({
33
- svg: ComponentAsset.optional(),
34
- isAsset: z.boolean(),
35
- componentSetId: z.string().optional(),
36
- properties: FigmaComponentProperties.optional(),
33
+ svg: ComponentAsset.optional(),
34
+ isAsset: z.boolean(),
35
+ componentSetId: z.string().optional(),
36
+ properties: FigmaComponentProperties.optional(),
37
37
  });
38
38
 
39
39
  export type ComponentAsset = z.infer<typeof ComponentAsset>;
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { Entity } from "../../common/entity";
3
- import { DocumentationPageSnapshot, ElementGroupSnapshot } from "../../dsm";
3
+ import { DocumentationPageApproval, DocumentationPageSnapshot, ElementGroupSnapshot } from "../../dsm";
4
4
  import { DocumentationPageV2 } from "../../dsm/elements/documentation-page-v2";
5
5
  import { ElementGroup } from "../../dsm/elements/group";
6
6
  import { DbCreateInputOmit, DbUpdate } from "../../helpers";
@@ -26,6 +26,7 @@ export type UpdateDesignSystemVersionRoom = DbUpdate<DesignSystemVersionRoom>;
26
26
  export const DesignSystemVersionRoomInternalSettings = z.object({
27
27
  routingVersion: z.string(),
28
28
  isDraftFeatureAdopted: z.boolean(),
29
+ isApprovalFeatureEnabled: z.boolean(),
29
30
  });
30
31
 
31
32
  export const DesignSystemVersionRoomInitialState = z.object({
@@ -35,6 +36,7 @@ export const DesignSystemVersionRoomInitialState = z.object({
35
36
  pageSnapshots: z.array(DocumentationPageSnapshot),
36
37
  groupSnapshots: z.array(ElementGroupSnapshot),
37
38
 
39
+ pageApprovals: z.array(DocumentationPageApproval),
38
40
  internalSettings: DesignSystemVersionRoomInternalSettings,
39
41
  });
40
42
 
@@ -49,6 +51,9 @@ export const DesignSystemVersionRoomUpdate = z.object({
49
51
  pageSnapshotIdsToDelete: z.array(z.string()),
50
52
  groupSnapshotIdsToDelete: z.array(z.string()),
51
53
  pageHashesToUpdate: z.record(z.string(), z.string()),
54
+
55
+ pageApprovals: z.array(DocumentationPageApproval),
56
+ pageApprovalIdsToDelete: z.array(z.string()),
52
57
  });
53
58
 
54
59
  export type DesignSystemVersionRoomInternalSettings = z.infer<typeof DesignSystemVersionRoomInternalSettings>;