@supernova-studio/client 0.46.1 → 0.46.4
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 +339 -63
- package/dist/index.d.ts +339 -63
- package/dist/index.js +167 -95
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1029 -957
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -2
- package/src/api/conversion/integrations/integration.ts +3 -2
- package/src/api/dto/design-systems/version.ts +7 -3
- package/src/api/dto/workspaces/integrations.ts +3 -2
- package/src/api/payloads/design-systems/version.ts +4 -6
- package/src/yjs/design-system-content/index.ts +0 -1
- package/src/yjs/design-system-content/item-title.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supernova-studio/client",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.4",
|
|
4
4
|
"description": "Supernova Data Models",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "tsup",
|
|
27
27
|
"typecheck": "tsc --noEmit",
|
|
28
|
-
"publish": "npm run build && npm publish",
|
|
29
28
|
"test:unit": "vitest run",
|
|
30
29
|
"index": "node ./create-indexes.js"
|
|
31
30
|
},
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExtendedIntegration } from "@supernova-studio/model";
|
|
2
2
|
import { DTOIntegration } from "../../dto";
|
|
3
3
|
|
|
4
|
-
export function integrationToDto(integration:
|
|
4
|
+
export function integrationToDto(integration: ExtendedIntegration): DTOIntegration {
|
|
5
5
|
return {
|
|
6
6
|
id: integration.id,
|
|
7
7
|
workspaceId: integration.workspaceId,
|
|
8
8
|
type: integration.type,
|
|
9
9
|
createdAt: integration.createdAt,
|
|
10
10
|
integrationCredentials: integration.integrationCredentials ?? undefined,
|
|
11
|
+
integrationDesignSystems: integration.integrationDesignSystems ?? undefined,
|
|
11
12
|
};
|
|
12
13
|
}
|
|
@@ -43,11 +43,15 @@ export type DTODesignSystemVersionsListResponse = z.infer<typeof DTODesignSystem
|
|
|
43
43
|
export type DTODesignSystemVersionGetResponse = z.infer<typeof DTODesignSystemVersionGetResponse>;
|
|
44
44
|
|
|
45
45
|
|
|
46
|
+
export const DTODesignSystemVersionJobsResponse = z.object({
|
|
47
|
+
jobs: z.array(VersionCreationJob)
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
export type DTODesignSystemVersionJobsResponse = z.infer<typeof DTODesignSystemVersionJobsResponse>;
|
|
51
|
+
|
|
46
52
|
// Creation job status response
|
|
47
53
|
export const DTODesignSystemVersionJobStatusResponse = z.object({
|
|
48
|
-
job: VersionCreationJob
|
|
49
|
-
_id: true,
|
|
50
|
-
})
|
|
54
|
+
job: VersionCreationJob
|
|
51
55
|
});
|
|
52
56
|
|
|
53
57
|
export type DTODesignSystemVersionJobStatusResponse = z.infer<typeof DTODesignSystemVersionJobStatusResponse>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { IntegrationCredentials,
|
|
1
|
+
import { IntegrationCredentials, IntegrationDesignSystem, ExtendedIntegrationType } from "@supernova-studio/model";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
export const DTOIntegration = z.object({
|
|
5
5
|
id: z.string(),
|
|
6
6
|
workspaceId: z.string(),
|
|
7
|
-
type:
|
|
7
|
+
type: ExtendedIntegrationType,
|
|
8
8
|
createdAt: z.coerce.date(),
|
|
9
9
|
integrationCredentials: z.array(IntegrationCredentials).optional(),
|
|
10
|
+
integrationDesignSystems: z.array(IntegrationDesignSystem).optional(),
|
|
10
11
|
});
|
|
11
12
|
|
|
12
13
|
export const DTOIntegrationOAuthGetResponse = z.object({
|
|
@@ -5,16 +5,14 @@ export const ObjectMeta = z.object({
|
|
|
5
5
|
description: z.string().max(2000).optional(),
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
export function
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const isValidSemver = semverRegex.test(version) || semverRegexWithSingleDigit.test(version);
|
|
12
|
-
return isValidSemver;
|
|
8
|
+
export function validateDesignSystemVersion(version: string) {
|
|
9
|
+
const urlCompliantRegex = /^[a-zA-Z0-9+.-]+$/;
|
|
10
|
+
return urlCompliantRegex.test(version);
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
export const DTOCreateVersionInput = z.object({
|
|
16
14
|
meta: ObjectMeta,
|
|
17
|
-
version: z.string().refine(
|
|
15
|
+
version: z.string().refine(validateDesignSystemVersion, {
|
|
18
16
|
message: "Invalid semantic versioning format",
|
|
19
17
|
}),
|
|
20
18
|
changeLog: z.string().max(2000).optional()
|
|
File without changes
|