@supernova-studio/model 0.46.11 → 0.46.13

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.46.11",
3
+ "version": "0.46.13",
4
4
  "description": "Supernova Data Models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
- import { SourceImportSummary } from "./import-summary";
3
2
  import { DbCreateInputOmit, DbUpdate } from "../../helpers";
4
3
  import { OmitStrict } from "../../utils";
4
+ import { SourceImportSummary } from "./import-summary";
5
5
 
6
6
  //
7
7
  // Enums
@@ -51,6 +51,7 @@ export const DataSourceFigmaScope = z.object({
51
51
  documentationFrames: z.boolean(),
52
52
  tokens: z.boolean(),
53
53
  themePersistentId: z.string().optional(),
54
+ isUnpublishedImportFallbackEnabled: z.boolean(),
54
55
  });
55
56
 
56
57
  export const DataSourceFigmaImportMetadata = z.object({
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { DataSourceFigmaImportMetadata, DataSourceFigmaRemote } from "../../data-sources";
3
+ import { ImportWarning } from "../warning";
3
4
  import { FigmaFileAccessData, FigmaFileDownloadScope } from "./figma-files";
4
5
 
5
6
  //
@@ -40,6 +41,12 @@ export const FigmaImportBaseContext = z.object({
40
41
  * sourceId: source data
41
42
  */
42
43
  importedSourceDataBySourceId: z.record(ImportedFigmaSourceData),
44
+
45
+ /**
46
+ * Array of warnings that will be written into the import result summary at the end
47
+ * of import job execution and displayed by the client.
48
+ */
49
+ importWarnings: z.record(ImportWarning.array()).default({}),
43
50
  });
44
51
 
45
52
  export type ImportedFigmaSourceData = z.infer<typeof ImportedFigmaSourceData>;
@@ -2,17 +2,24 @@ import { z } from "zod";
2
2
 
3
3
  export const ImportWarningType = z.enum([
4
4
  "NoVersionFound",
5
+
5
6
  "UnsupportedFill",
6
7
  "UnsupportedStroke",
7
8
  "UnsupportedEffect",
9
+
8
10
  "NoPublishedElements",
9
11
  "NoPublishedStyles",
10
12
  "NoPublishedComponents",
11
13
  "NoPublishedAssets",
14
+
12
15
  "StyleNotApplied",
16
+
13
17
  "ComponentHasNoThumbnail",
18
+
14
19
  "DuplicateImportedStyleId",
15
20
  "DuplicateImportedStylePath",
21
+
22
+ "NoUnpublishedStyles",
16
23
  ]);
17
24
 
18
25
  export const ImportWarning = z.object({
@@ -68,8 +68,8 @@ export type ExtendedIntegration = Omit<Integration, "type"> & {
68
68
 
69
69
  // Custom URL validation
70
70
  const forbiddenCustomUrldomainList = ["github.com", "gitlab.com", "bitbucket.org", "figma.com", "dev.azure.com"];
71
- // Will be renamed to IntegrationToken in the future as there is already a type named IntegrationToken
72
- export const IntegrationTokenResponse = z
71
+
72
+ export const IntegrationToken = z
73
73
  .object({
74
74
  access_token: z.string(),
75
75
  refresh_token: z.string().optional(),
@@ -106,4 +106,4 @@ export const IntegrationTokenResponse = z
106
106
  };
107
107
  });
108
108
 
109
- export type IntegrationTokenResponse = z.infer<typeof IntegrationTokenResponse>;
109
+ export type IntegrationToken = z.infer<typeof IntegrationToken>;
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { OAuthProviderSchema } from "./oauth-providers";
3
3
 
4
- export const IntegrationTokenSchema = z.object({
4
+ export const IntegrationTokenSchemaOld = z.object({
5
5
  id: z.string(),
6
6
  provider: OAuthProviderSchema,
7
7
  scope: z.string(),
@@ -12,4 +12,5 @@ export const IntegrationTokenSchema = z.object({
12
12
  externalUserId: z.string().nullish(),
13
13
  });
14
14
 
15
- export type IntegrationToken = z.infer<typeof IntegrationTokenSchema>;
15
+ // Renamed because will be deleted later after full migration / end of project
16
+ export type IntegrationTokenOld = z.infer<typeof IntegrationTokenSchemaOld>;