@supernova-studio/model 0.47.68 → 0.47.70

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.47.68",
3
+ "version": "0.47.70",
4
4
  "description": "Supernova Data Models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,12 +1,13 @@
1
1
  import { z } from "zod";
2
+ import { nullishToOptional } from "../../../helpers";
2
3
  import { ColorTokenData } from "./color";
4
+ import { PageBlockAsset } from "./documentation-block-v1";
3
5
  import {
4
6
  DocumentationItemHeaderAlignment,
5
7
  DocumentationItemHeaderAlignmentSchema,
6
8
  DocumentationItemHeaderImageScaleType,
7
9
  DocumentationItemHeaderImageScaleTypeSchema,
8
10
  } from "./item-header";
9
- import { PageBlockAsset } from "./documentation-block-v1";
10
11
 
11
12
  //
12
13
  // Definitions
@@ -15,13 +16,13 @@ import { PageBlockAsset } from "./documentation-block-v1";
15
16
  export const DocumentationItemHeaderV1 = z.object({
16
17
  description: z.string(),
17
18
  alignment: DocumentationItemHeaderAlignmentSchema,
18
- foregroundColor: ColorTokenData.nullish(),
19
- backgroundColor: ColorTokenData.nullish(),
20
- backgroundImageAsset: PageBlockAsset.nullish(),
19
+ foregroundColor: nullishToOptional(ColorTokenData),
20
+ backgroundColor: nullishToOptional(ColorTokenData),
21
+ backgroundImageAsset: nullishToOptional(PageBlockAsset),
21
22
  backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,
22
23
  showBackgroundOverlay: z.boolean(),
23
24
  showCoverText: z.boolean(),
24
- minHeight: z.number().nullish(),
25
+ minHeight: nullishToOptional(z.number()),
25
26
  });
26
27
 
27
28
  export type DocumentationItemHeaderV1 = z.infer<typeof DocumentationItemHeaderV1>;
@@ -1,11 +1,12 @@
1
1
  import { z } from "zod";
2
+ import { nullishToOptional } from "../../../helpers";
3
+ import { PageBlockColorV2, PageBlockImageReference } from "./documentation-block-v2";
2
4
  import {
3
5
  DocumentationItemHeaderAlignment,
4
6
  DocumentationItemHeaderAlignmentSchema,
5
7
  DocumentationItemHeaderImageScaleType,
6
8
  DocumentationItemHeaderImageScaleTypeSchema,
7
9
  } from "./item-header";
8
- import { PageBlockColorV2, PageBlockImageReference } from "./documentation-block-v2";
9
10
 
10
11
  //
11
12
  // Definitions
@@ -14,13 +15,13 @@ import { PageBlockColorV2, PageBlockImageReference } from "./documentation-block
14
15
  export const DocumentationItemHeaderV2 = z.object({
15
16
  description: z.string(),
16
17
  alignment: DocumentationItemHeaderAlignmentSchema,
17
- foregroundColor: PageBlockColorV2.nullish(),
18
- backgroundColor: PageBlockColorV2.nullish(),
19
- backgroundImageAsset: PageBlockImageReference.nullish(),
18
+ foregroundColor: nullishToOptional(PageBlockColorV2),
19
+ backgroundColor: nullishToOptional(PageBlockColorV2),
20
+ backgroundImageAsset: nullishToOptional(PageBlockImageReference),
20
21
  backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,
21
22
  showBackgroundOverlay: z.boolean(),
22
23
  showCoverText: z.boolean(),
23
- minHeight: z.number().nullish(),
24
+ minHeight: nullishToOptional(z.number()),
24
25
  });
25
26
 
26
27
  export type DocumentationItemHeaderV2 = z.infer<typeof DocumentationItemHeaderV2>;
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
- import { OmitStrict } from "../utils";
3
2
  import { DbCreateInputOmit, DbUpdate, nullishToOptional } from "../helpers";
3
+ import { OmitStrict } from "../utils";
4
4
 
5
5
  export const DesignSystemVersion = z.object({
6
6
  id: z.string(),
@@ -12,6 +12,7 @@ export const DesignSystemVersion = z.object({
12
12
  isReadonly: z.boolean(),
13
13
  changeLog: z.string(),
14
14
  parentId: z.string().optional(),
15
+ isDraftsFeatureAdopted: z.boolean(),
15
16
  });
16
17
 
17
18
  export type DesignSystemVersion = z.infer<typeof DesignSystemVersion>;
@@ -23,20 +24,18 @@ export type UpdateDesignSystemVersion = OmitStrict<
23
24
  "designSystemId" | "isReadonly" | "version" | "parentId"
24
25
  >;
25
26
 
26
-
27
27
  // Jobs
28
28
  export const VersionCreationJobStatus = z.enum(["Success", "InProgress", "Error"]);
29
29
 
30
30
  export type VersionCreationJobStatus = z.infer<typeof VersionCreationJobStatus>;
31
31
 
32
32
  export const VersionCreationJob = z.object({
33
- id: z.string(),
34
- version: z.string(),
35
- designSystemId: z.string(),
36
- designSystemVersionId: nullishToOptional(z.string()),
37
- status: VersionCreationJobStatus,
38
- errorMessage: nullishToOptional(z.string()),
33
+ id: z.string(),
34
+ version: z.string(),
35
+ designSystemId: z.string(),
36
+ designSystemVersionId: nullishToOptional(z.string()),
37
+ status: VersionCreationJobStatus,
38
+ errorMessage: nullishToOptional(z.string()),
39
39
  });
40
40
 
41
41
  export type VersionCreationJob = z.infer<typeof VersionCreationJob>;
42
-
@@ -28,7 +28,7 @@ export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
28
28
  export type Defined<T> = T extends null | undefined ? never : T;
29
29
 
30
30
  // Makes specific properties in the type required
31
- export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }
31
+ export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
32
32
 
33
33
  export function forceUnwrapNullish<T>(value: Nullish<T>): T {
34
34
  if (value === null) throw new Error("Illegal null");