@supernova-studio/model 0.19.0 → 0.19.2

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.19.0",
3
+ "version": "0.19.2",
4
4
  "description": "Supernova Data Models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,7 +8,7 @@ export const PluginOAuthRequestSchema = z.object({
8
8
  readKeyConsumed: z.boolean(),
9
9
  writeKeyConsumed: z.boolean(),
10
10
  oAuthCode: z.string().optional(),
11
- createdAt: z.date(),
11
+ createdAt: z.coerce.date(),
12
12
  });
13
13
 
14
14
  export type PluginOAuthRequest = z.infer<typeof PluginOAuthRequestSchema>;
@@ -5,14 +5,14 @@ export const InvoiceSchema = z.object({
5
5
  id: z.string(),
6
6
  number: z.string(),
7
7
  amount_due: z.number(),
8
- date: z.date(),
8
+ date: z.coerce.date(),
9
9
  hostedUrl: z.string().url(),
10
10
  card: CardSchema.nullish(),
11
11
  });
12
12
 
13
13
  export const PeriodSchema = z.object({
14
- start: z.date(),
15
- end: z.date(),
14
+ start: z.coerce.date(),
15
+ end: z.coerce.date(),
16
16
  });
17
17
 
18
18
  export const InvoiceLineSchema = z.object({
@@ -2,8 +2,8 @@ import { z } from "zod";
2
2
 
3
3
  export const Entity = z.object({
4
4
  id: z.string(),
5
- createdAt: z.date(),
6
- updatedAt: z.date(),
5
+ createdAt: z.coerce.date(),
6
+ updatedAt: z.coerce.date(),
7
7
  });
8
8
 
9
9
  export type Entity = z.infer<typeof Entity>;
@@ -17,7 +17,7 @@ export type SessionData = z.infer<typeof SessionData>;
17
17
 
18
18
  export const Session = z.object({
19
19
  id: z.string(),
20
- expiresAt: z.date(),
20
+ expiresAt: z.coerce.date(),
21
21
  userId: z.string().nullable(),
22
22
  data: SessionData,
23
23
  });
@@ -140,7 +140,7 @@ export type DataSource = {
140
140
 
141
141
  export const DataSourceVersion = z.object({
142
142
  id: z.string(),
143
- createdAt: z.date(),
143
+ createdAt: z.coerce.date(),
144
144
  label: z.string().nullish(),
145
145
  description: z.string().nullish(),
146
146
  });
@@ -21,8 +21,8 @@ export const DesignSystem = z.object({
21
21
  docViewUrl: nullishToOptional(z.string()),
22
22
  basePrefixes: z.array(z.string()),
23
23
  designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),
24
- createdAt: z.date(),
25
- updatedAt: z.date(),
24
+ createdAt: z.coerce.date(),
25
+ updatedAt: z.coerce.date(),
26
26
  });
27
27
 
28
28
  export const DesignSystemWithWorkspace = z.object({
@@ -12,8 +12,8 @@ export const DocumentationPageGroup = z.object({
12
12
  title: z.string(),
13
13
  slug: z.string(),
14
14
  userSlug: z.string().nullish(),
15
- createdAt: z.date(),
16
- updatedAt: z.date(),
15
+ createdAt: z.coerce.date(),
16
+ updatedAt: z.coerce.date(),
17
17
  });
18
18
 
19
19
  export type DocumentationPageGroup = z.infer<typeof DocumentationPageGroup>;
@@ -11,8 +11,8 @@ export const DocumentationPage = z.object({
11
11
  title: z.string(),
12
12
  slug: z.string(),
13
13
  userSlug: z.string().nullish(),
14
- createdAt: z.date(),
15
- updatedAt: z.date(),
14
+ createdAt: z.coerce.date(),
15
+ updatedAt: z.coerce.date(),
16
16
  });
17
17
 
18
18
  export type DocumentationPage = z.infer<typeof DocumentationPage>;
@@ -12,8 +12,8 @@ export const DesignElementBase = z.object({
12
12
  persistentId: z.string(),
13
13
  meta: ObjectMeta,
14
14
  designSystemVersionId: z.string(),
15
- createdAt: z.date(),
16
- updatedAt: z.date(),
15
+ createdAt: z.coerce.date(),
16
+ updatedAt: z.coerce.date(),
17
17
  });
18
18
 
19
19
  export const DesignElementImportedBase = DesignElementBase.extend({
@@ -116,8 +116,8 @@ export const DesignElement = ShallowDesignElement.extend({
116
116
  meta: ObjectMeta,
117
117
  slug: z.string().optional(),
118
118
  userSlug: z.string().optional(),
119
- createdAt: z.date(),
120
- updatedAt: z.date(),
119
+ createdAt: z.coerce.date(),
120
+ updatedAt: z.coerce.date(),
121
121
  exportProperties: DesignSystemElementExportProps.optional(),
122
122
  data: z.record(z.any()),
123
123
  origin: z.record(z.any()).optional(),
@@ -10,9 +10,9 @@ export const PublishedDocRoutingVersion = z.enum(["1", "2"]);
10
10
  export const PublishedDoc = z.object({
11
11
  id: z.string(),
12
12
  designSystemVersionId: z.string(),
13
- createdAt: z.date(),
14
- updatedAt: z.date(),
15
- lastPublishedAt: z.date(),
13
+ createdAt: z.coerce.date(),
14
+ updatedAt: z.coerce.date(),
15
+ lastPublishedAt: z.coerce.date(),
16
16
  isDefault: z.boolean(),
17
17
  isPublic: z.boolean(),
18
18
  environment: PublishedDocEnvironment,
@@ -5,7 +5,7 @@ export const FeatureFlagMap = z.record(FlaggedFeature, z.boolean());
5
5
  export const FeatureFlag = z.object({
6
6
  id: z.string(),
7
7
  feature: FlaggedFeature,
8
- createdAt: z.date(),
8
+ createdAt: z.coerce.date(),
9
9
  enabled: z.boolean(),
10
10
  });
11
11
 
@@ -6,7 +6,7 @@ export const ExternalOAuthRequest = z.object({
6
6
  provider: OAuthProviderSchema,
7
7
  userId: z.string(),
8
8
  state: z.string(),
9
- createdAt: z.date(),
9
+ createdAt: z.coerce.date(),
10
10
  });
11
11
 
12
12
  export type ExternalOAuthRequest = z.infer<typeof ExternalOAuthRequest>;
@@ -8,7 +8,7 @@ export const IntegrationTokenSchema = z.object({
8
8
  userId: z.string(),
9
9
  accessToken: z.string(),
10
10
  refreshToken: z.string(),
11
- expiresAt: z.date(),
11
+ expiresAt: z.coerce.date(),
12
12
  externalUserId: z.string().nullish(),
13
13
  });
14
14
 
@@ -6,11 +6,11 @@ export const PersonalAccessToken = z.object({
6
6
  userId: z.string(),
7
7
  name: z.string(),
8
8
  token: z.string(),
9
- createdAt: z.date(),
9
+ createdAt: z.coerce.date(),
10
10
  hidden: z.boolean(),
11
11
  workspaceId: z.string().optional(),
12
12
  workspaceRole: WorkspaceRoleSchema.optional(),
13
- expireAt: z.date().optional(),
13
+ expireAt: z.coerce.date().optional(),
14
14
  scope: z.string().optional(),
15
15
  });
16
16
 
package/src/users/user.ts CHANGED
@@ -6,11 +6,11 @@ export const User = z.object({
6
6
  id: z.string(),
7
7
  email: z.string(),
8
8
  emailVerified: z.boolean(),
9
- createdAt: z.date(),
10
- trialExpiresAt: z.date().optional(),
9
+ createdAt: z.coerce.date(),
10
+ trialExpiresAt: z.coerce.date().optional(),
11
11
  profile: UserProfile,
12
12
  linkedIntegrations: UserLinkedIntegrations.optional(),
13
- loggedOutAt: z.date().optional(),
13
+ loggedOutAt: z.coerce.date().optional(),
14
14
  isProtected: z.boolean(),
15
15
  });
16
16
 
@@ -4,8 +4,8 @@ import { z } from "zod";
4
4
  export const WorkspaceInvitation = z.object({
5
5
  id: z.string(),
6
6
  email: z.string().email(),
7
- createdAt: z.date(),
8
- resentAt: z.date().nullish(),
7
+ createdAt: z.coerce.date(),
8
+ resentAt: z.coerce.date().nullish(),
9
9
  role: z.nativeEnum(WorkspaceRole),
10
10
  workspaceId: z.string(),
11
11
  invitedBy: z.string(),