@supernova-studio/client 0.58.8 → 0.58.9
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 +821 -90
- package/dist/index.d.ts +821 -90
- package/dist/index.js +123 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +124 -32
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/dto/design-systems/data-source.ts +28 -3
- package/src/api/endpoints/design-system/sources.ts +21 -1
- package/src/api/endpoints/design-system/versions/elements-action.ts +1 -3
- package/src/api/endpoints/design-system/versions/index.ts +0 -1
- package/src/api/endpoints/design-system/versions/versions.ts +3 -3
- package/src/api/endpoints/design-system/versions/elements-actions.ts +0 -20
package/package.json
CHANGED
|
@@ -10,6 +10,12 @@ import {
|
|
|
10
10
|
} from "@supernova-studio/model";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
|
|
13
|
+
//
|
|
14
|
+
// Read
|
|
15
|
+
//
|
|
16
|
+
|
|
17
|
+
export const DTODataSourceFigmaScope = DataSourceFigmaScope;
|
|
18
|
+
|
|
13
19
|
const DTODataSourceFigmaFileVersion = z.object({
|
|
14
20
|
id: z.string(),
|
|
15
21
|
created_at: z.coerce.date(),
|
|
@@ -36,7 +42,7 @@ export const DTODataSourceFigma = z.object({
|
|
|
36
42
|
id: z.string(),
|
|
37
43
|
type: z.literal(DataSourceRemoteType.Enum.Figma),
|
|
38
44
|
fileName: z.string(),
|
|
39
|
-
scope:
|
|
45
|
+
scope: DTODataSourceFigmaScope,
|
|
40
46
|
brandId: z.string(),
|
|
41
47
|
themeId: z.string().nullish(),
|
|
42
48
|
cloud: DTODataSourceFigmaCloud.nullish(),
|
|
@@ -104,7 +110,7 @@ export const DTODataSourcesListResponse = z.object({
|
|
|
104
110
|
sources: z.array(DTODataSource),
|
|
105
111
|
});
|
|
106
112
|
|
|
107
|
-
export const
|
|
113
|
+
export const DTODataSourceResponse = z.object({
|
|
108
114
|
source: DTODataSource,
|
|
109
115
|
});
|
|
110
116
|
|
|
@@ -112,5 +118,24 @@ export type DTODataSourceFigma = z.infer<typeof DTODataSourceFigma>;
|
|
|
112
118
|
export type DTODataSourceTokenStudio = z.infer<typeof DTODataSourceTokenStudio>;
|
|
113
119
|
export type DTODataSourceFigmaVariablesPlugin = z.infer<typeof DTODataSourceFigmaVariablesPlugin>;
|
|
114
120
|
export type DTODataSource = z.infer<typeof DTODataSource>;
|
|
115
|
-
export type
|
|
121
|
+
export type DTODataSourceResponse = z.infer<typeof DTODataSourceResponse>;
|
|
116
122
|
export type DTODataSourcesListResponse = z.infer<typeof DTODataSourcesListResponse>;
|
|
123
|
+
|
|
124
|
+
//
|
|
125
|
+
// Write
|
|
126
|
+
//
|
|
127
|
+
|
|
128
|
+
export const DTODataSourceFigmaCreatePayload = z.object({
|
|
129
|
+
brandPersistentId: z.string(),
|
|
130
|
+
figmaFileUrl: z.string(),
|
|
131
|
+
scope: DTODataSourceFigmaScope,
|
|
132
|
+
autoImportMode: DataSourceAutoImportMode,
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
export const DTODataSourceFigmaImportPayload = z.object({
|
|
136
|
+
sourceIds: z.array(z.string()),
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
export type DTODataSourceFigmaScope = z.infer<typeof DTODataSourceFigmaScope>;
|
|
140
|
+
export type DTODataSourceFigmaCreatePayload = z.infer<typeof DTODataSourceFigmaCreatePayload>;
|
|
141
|
+
export type DTODataSourceFigmaImportPayload = z.infer<typeof DTODataSourceFigmaImportPayload>;
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
DTODataSourceFigmaCreatePayload,
|
|
4
|
+
DTODataSourceFigmaImportPayload,
|
|
5
|
+
DTODataSourceResponse,
|
|
6
|
+
DTODataSourcesListResponse,
|
|
7
|
+
DTOImportJobResponse,
|
|
8
|
+
} from "../../dto";
|
|
3
9
|
import { RequestExecutor } from "../../transport/request-executor";
|
|
4
10
|
|
|
5
11
|
export class DesignSystemSourcesEndpoint {
|
|
6
12
|
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
7
13
|
|
|
14
|
+
create(dsId: string, payload: DTODataSourceFigmaCreatePayload) {
|
|
15
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/sources`, DTODataSourceResponse, {
|
|
16
|
+
method: "POST",
|
|
17
|
+
body: payload,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
8
21
|
list(dsId: string) {
|
|
9
22
|
return this.requestExecutor.json(`/design-systems/${dsId}/sources`, DTODataSourcesListResponse);
|
|
10
23
|
}
|
|
@@ -12,4 +25,11 @@ export class DesignSystemSourcesEndpoint {
|
|
|
12
25
|
delete(dsId: string, sourceId: string) {
|
|
13
26
|
return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, z.any(), { method: "DELETE" });
|
|
14
27
|
}
|
|
28
|
+
|
|
29
|
+
figmaImport(dsId: string, payload: DTODataSourceFigmaImportPayload) {
|
|
30
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/cloud-import`, DTOImportJobResponse, {
|
|
31
|
+
method: "POST",
|
|
32
|
+
body: payload,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
15
35
|
}
|
|
@@ -2,8 +2,6 @@ import {
|
|
|
2
2
|
DTOCreateDocumentationGroupInput,
|
|
3
3
|
DTOCreateDocumentationPageInputV2,
|
|
4
4
|
DTOCreateDocumentationTabInput,
|
|
5
|
-
DTODocumentationStructure,
|
|
6
|
-
DTODocumentationStructureItem,
|
|
7
5
|
DTOElementActionOutput,
|
|
8
6
|
DTOMoveDocumentationGroupInput,
|
|
9
7
|
DTOUpdateDocumentationGroupInput,
|
|
@@ -11,7 +9,7 @@ import {
|
|
|
11
9
|
} from "../../../dto";
|
|
12
10
|
import { RequestExecutor } from "../../../transport/request-executor";
|
|
13
11
|
|
|
14
|
-
export class
|
|
12
|
+
export class ElementsActionEndpoint {
|
|
15
13
|
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
16
14
|
|
|
17
15
|
async createDocPage(dsId: string, vId: string, input: DTOCreateDocumentationPageInputV2) {
|
|
@@ -2,7 +2,6 @@ export * from "./brands";
|
|
|
2
2
|
export * from "./components";
|
|
3
3
|
export * from "./documentation";
|
|
4
4
|
export * from "./elements-action";
|
|
5
|
-
export * from "./elements-actions";
|
|
6
5
|
export * from "./import-jobs";
|
|
7
6
|
export * from "./overrides";
|
|
8
7
|
export * from "./property-definitions";
|
|
@@ -8,7 +8,7 @@ import { RequestExecutor } from "../../../transport/request-executor";
|
|
|
8
8
|
import { BrandsEndpoint } from "./brands";
|
|
9
9
|
import { DesignSystemComponentEndpoint } from "./components";
|
|
10
10
|
import { DocumentationEndpoint } from "./documentation";
|
|
11
|
-
import {
|
|
11
|
+
import { ElementsActionEndpoint } from "./elements-action";
|
|
12
12
|
import { ImportJobsEndpoint } from "./import-jobs";
|
|
13
13
|
import { ElementPropertyDefinitionsEndpoint } from "./property-definitions";
|
|
14
14
|
import { ElementPropertyValuesEndpoint } from "./property-values";
|
|
@@ -28,7 +28,7 @@ export class DesignSystemVersionsEndpoint {
|
|
|
28
28
|
readonly stats: VersionStatsEndpoint;
|
|
29
29
|
readonly elementPropertyDefinitions: ElementPropertyDefinitionsEndpoint;
|
|
30
30
|
readonly elementPropertyValues: ElementPropertyValuesEndpoint;
|
|
31
|
-
readonly
|
|
31
|
+
readonly elementsAction: ElementsActionEndpoint;
|
|
32
32
|
readonly designSystemComponents: DesignSystemComponentEndpoint;
|
|
33
33
|
readonly documentation: DocumentationEndpoint;
|
|
34
34
|
|
|
@@ -42,7 +42,7 @@ export class DesignSystemVersionsEndpoint {
|
|
|
42
42
|
this.stats = new VersionStatsEndpoint(requestExecutor);
|
|
43
43
|
this.elementPropertyDefinitions = new ElementPropertyDefinitionsEndpoint(requestExecutor);
|
|
44
44
|
this.elementPropertyValues = new ElementPropertyValuesEndpoint(requestExecutor);
|
|
45
|
-
this.
|
|
45
|
+
this.elementsAction = new ElementsActionEndpoint(requestExecutor);
|
|
46
46
|
this.designSystemComponents = new DesignSystemComponentEndpoint(requestExecutor);
|
|
47
47
|
this.documentation = new DocumentationEndpoint(requestExecutor);
|
|
48
48
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { DTOCreateDocumentationPageInputV2, DTOElementActionOutput } from "../../../dto";
|
|
2
|
-
import { RequestExecutor } from "../../../transport/request-executor";
|
|
3
|
-
|
|
4
|
-
export class ElementsActionsEndpoint {
|
|
5
|
-
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
6
|
-
|
|
7
|
-
async createDocPage(dsId: string, vId: string, input: DTOCreateDocumentationPageInputV2) {
|
|
8
|
-
return this.requestExecutor.json(
|
|
9
|
-
`/design-systems/${dsId}/versions/${vId}/elements-action`,
|
|
10
|
-
DTOElementActionOutput,
|
|
11
|
-
{
|
|
12
|
-
body: {
|
|
13
|
-
type: "DocumentationPageCreate",
|
|
14
|
-
input,
|
|
15
|
-
},
|
|
16
|
-
method: "POST",
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
}
|