@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/dist/index.d.mts +233 -22
- package/dist/index.d.ts +233 -22
- package/dist/index.js +39 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +127 -118
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/dsm/data-sources/data-source.ts +2 -1
- package/src/dsm/import/support/import-context.ts +7 -0
- package/src/dsm/import/warning.ts +7 -0
- package/src/integrations/integration.ts +3 -3
- package/src/integrations/oauth-token.ts +3 -2
package/package.json
CHANGED
|
@@ -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
|
-
|
|
72
|
-
export const
|
|
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
|
|
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
|
|
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
|
-
|
|
15
|
+
// Renamed because will be deleted later after full migration / end of project
|
|
16
|
+
export type IntegrationTokenOld = z.infer<typeof IntegrationTokenSchemaOld>;
|