@supernova-studio/client 0.46.0 → 0.46.1
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 +134 -45
- package/dist/index.d.ts +134 -45
- package/dist/index.js +37 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/dto/design-systems/version.ts +13 -1
- package/src/api/dto/elements/figma-nodes/figma-node.ts +9 -0
- package/src/api/payloads/design-systems/version.ts +4 -2
- package/src/yjs/design-system-content/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { ObjectMeta } from "@supernova-studio/model";
|
|
2
|
+
import { ObjectMeta, VersionCreationJob, OmitStrict } from "@supernova-studio/model";
|
|
3
3
|
import { DTOCreateVersionInput } from "../../payloads";
|
|
4
4
|
|
|
5
5
|
export const DTODesignSystemVersion = z.object({
|
|
@@ -26,9 +26,11 @@ export const DTODesignSystemVersionCreationResponse = z.object({
|
|
|
26
26
|
changeLog: z.string(),
|
|
27
27
|
isReadOnly: z.boolean(),
|
|
28
28
|
designSystemId: z.string(),
|
|
29
|
+
jobId: z.string(),
|
|
29
30
|
})
|
|
30
31
|
|
|
31
32
|
export const VersionSQSPayload = z.object({
|
|
33
|
+
jobId: z.string(),
|
|
32
34
|
designSystemId: z.string(),
|
|
33
35
|
input: DTOCreateVersionInput,
|
|
34
36
|
});
|
|
@@ -39,3 +41,13 @@ export type DTODesignSystemVersionCreationResponse = z.infer<typeof DTODesignSys
|
|
|
39
41
|
export type DTODesignSystemVersion = z.infer<typeof DTODesignSystemVersion>;
|
|
40
42
|
export type DTODesignSystemVersionsListResponse = z.infer<typeof DTODesignSystemVersionsListResponse>;
|
|
41
43
|
export type DTODesignSystemVersionGetResponse = z.infer<typeof DTODesignSystemVersionGetResponse>;
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
// Creation job status response
|
|
47
|
+
export const DTODesignSystemVersionJobStatusResponse = z.object({
|
|
48
|
+
job: VersionCreationJob.omit({
|
|
49
|
+
_id: true,
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export type DTODesignSystemVersionJobStatusResponse = z.infer<typeof DTODesignSystemVersionJobStatusResponse>;
|
|
@@ -5,6 +5,12 @@ import { z } from "zod";
|
|
|
5
5
|
// Read
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
+
export const DTOFigmaNodeOrigin = z.object({
|
|
9
|
+
sourceId: z.string(),
|
|
10
|
+
fileId: z.string().optional(),
|
|
11
|
+
parentName: z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
|
|
8
14
|
export const DTOFigmaNodeData = z.object({
|
|
9
15
|
// Id of the node in the Figma file
|
|
10
16
|
figmaNodeId: z.string(),
|
|
@@ -24,10 +30,13 @@ export const DTOFigmaNodeData = z.object({
|
|
|
24
30
|
|
|
25
31
|
export const DTOFigmaNode = FigmaFileStructure.omit({
|
|
26
32
|
data: true,
|
|
33
|
+
origin: true
|
|
27
34
|
}).extend({
|
|
28
35
|
data: DTOFigmaNodeData,
|
|
36
|
+
origin: DTOFigmaNodeOrigin
|
|
29
37
|
});
|
|
30
38
|
|
|
39
|
+
export type DTOFigmaNodeOrigin = z.infer<typeof DTOFigmaNodeOrigin>;
|
|
31
40
|
export type DTOFigmaNodeData = z.infer<typeof DTOFigmaNodeData>;
|
|
32
41
|
export type DTOFigmaNode = z.infer<typeof DTOFigmaNode>;
|
|
33
42
|
|
|
@@ -6,8 +6,10 @@ export const ObjectMeta = z.object({
|
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
export function validateSemver(version: string) {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const semverRegex = /^(\d+)\.(\d+)(?:\.(\d+))?(?:-([\da-z-]+(?:\.[\da-z-]+)*))?(?:\+([\da-z-]+(?:\.[\da-z-]+)*))?$/i;
|
|
10
|
+
const semverRegexWithSingleDigit = /^(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-([\da-z-]+(?:\.[\da-z-]+)*))?(?:\+([\da-z-]+(?:\.[\da-z-]+)*))?$/i;
|
|
11
|
+
const isValidSemver = semverRegex.test(version) || semverRegexWithSingleDigit.test(version);
|
|
12
|
+
return isValidSemver;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export const DTOCreateVersionInput = z.object({
|