@supernova-studio/client 0.58.9 → 0.58.11
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 +2478 -228
- package/dist/index.d.ts +2478 -228
- package/dist/index.js +312 -146
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +910 -744
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/dto/design-systems/brand.ts +23 -1
- package/src/api/dto/design-systems/component.ts +32 -2
- package/src/api/dto/design-systems/index.ts +0 -1
- package/src/api/dto/elements/components/figma-component-group.ts +19 -0
- package/src/api/dto/elements/components/index.ts +1 -0
- package/src/api/dto/elements/frame-node-structures/frame-node-structure.ts +17 -0
- package/src/api/dto/elements/frame-node-structures/index.ts +1 -0
- package/src/api/dto/elements/index.ts +1 -0
- package/src/api/dto/export/exporter-property.ts +95 -0
- package/src/api/dto/export/exporter.ts +2 -0
- package/src/api/dto/export/index.ts +1 -0
- package/src/api/dto/export/job.ts +3 -0
- package/src/api/dto/export/pipeline.ts +3 -0
- package/src/api/endpoints/codegen/exporters.ts +2 -7
- package/src/api/endpoints/design-system/versions/brands.ts +16 -3
- package/src/api/endpoints/design-system/versions/ds-components.ts +28 -0
- package/src/api/endpoints/design-system/versions/elements-action.ts +16 -59
- package/src/api/endpoints/design-system/versions/elements.ts +13 -0
- package/src/api/endpoints/design-system/versions/figma-component-groups.ts +13 -0
- package/src/api/endpoints/design-system/versions/figma-components.ts +13 -0
- package/src/api/endpoints/design-system/versions/figma-frame-structures.ts +13 -0
- package/src/api/endpoints/design-system/versions/index.ts +5 -1
- package/src/api/endpoints/design-system/versions/versions.ts +13 -1
- package/src/api/payloads/design-systems/index.ts +0 -1
- package/src/api/payloads/export/pipeline.ts +3 -0
- package/src/api/transport/request-executor-error.ts +1 -1
- package/src/api/transport/request-executor.ts +2 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/query.ts +18 -0
- package/src/api/dto/design-systems/exporter-property.ts +0 -8
- package/src/api/endpoints/design-system/versions/components.ts +0 -15
- package/src/api/payloads/design-systems/brand.ts +0 -12
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type CompatibleValue = number | string | boolean | undefined;
|
|
2
|
+
type QueryObject = Record<string, CompatibleValue | CompatibleValue[]>;
|
|
3
|
+
|
|
4
|
+
export function serializeQuery(query: QueryObject): URLSearchParams {
|
|
5
|
+
const queryWithStrings = Object.fromEntries(
|
|
6
|
+
Object.entries(query)
|
|
7
|
+
.filter(e => !!e[1])
|
|
8
|
+
.map(([k, v]) => {
|
|
9
|
+
if (Array.isArray(v)) {
|
|
10
|
+
return [k, v.join(", ")];
|
|
11
|
+
} else {
|
|
12
|
+
return [k, v!.toString()];
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
return new URLSearchParams(queryWithStrings);
|
|
18
|
+
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const DTOExporterProperty = z.any({});
|
|
4
|
-
|
|
5
|
-
export const DTOExporterPropertyListResponse = z.object({ items: z.array(DTOExporterProperty) });
|
|
6
|
-
|
|
7
|
-
export type DTOExporterProperty = z.infer<typeof DTOExporterProperty>;
|
|
8
|
-
export type DTOExporterPropertyListResponse = z.infer<typeof DTOExporterPropertyListResponse>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DTOElementActionOutput } from "../../../dto";
|
|
2
|
-
import { RequestExecutor } from "../../../transport/request-executor";
|
|
3
|
-
import { DTODesignSystemComponentCreateInput } from "../../../dto/design-systems/component";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
|
|
6
|
-
export class DesignSystemComponentEndpoint {
|
|
7
|
-
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
8
|
-
|
|
9
|
-
async create(dsId: string, vId: string, body: DTODesignSystemComponentCreateInput) {
|
|
10
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/design-system-components`, z.any(), {
|
|
11
|
-
body,
|
|
12
|
-
method: "POST",
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
// TODO make sure these are all accurate.
|
|
4
|
-
export const DTOCreateBrandInput = z.object({
|
|
5
|
-
persistentId: z.string().uuid(),
|
|
6
|
-
meta: z.object({
|
|
7
|
-
name: z.string(),
|
|
8
|
-
description: z.string(),
|
|
9
|
-
}),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export type DTOCreateBrandInput = z.infer<typeof DTOCreateBrandInput>;
|