@supernova-studio/client 0.55.19 → 0.55.21

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.
Files changed (27) hide show
  1. package/dist/index.d.mts +105 -33
  2. package/dist/index.d.ts +105 -33
  3. package/dist/index.js +101 -7
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +733 -639
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +1 -1
  8. package/src/api/client.ts +1 -1
  9. package/src/api/endpoints/{design-system-members.ts → design-system/design-system-members.ts} +2 -2
  10. package/src/api/endpoints/design-system/design-system-versions.ts +20 -0
  11. package/src/api/endpoints/{design-systems.ts → design-system/design-systems.ts} +4 -3
  12. package/src/api/endpoints/design-system/index.ts +4 -0
  13. package/src/api/endpoints/design-system/versions/brands.ts +17 -0
  14. package/src/api/endpoints/design-system/versions/index.ts +4 -0
  15. package/src/api/endpoints/design-system/versions/overrides.ts +17 -0
  16. package/src/api/endpoints/design-system/versions/themes.ts +24 -0
  17. package/src/api/endpoints/design-system/versions/tokens.ts +13 -0
  18. package/src/api/endpoints/index.ts +2 -6
  19. package/src/api/endpoints/users.ts +0 -1
  20. package/src/api/endpoints/workspaces/index.ts +3 -0
  21. package/src/api/endpoints/{workspace-invites.ts → workspaces/workspace-invites.ts} +2 -2
  22. package/src/api/endpoints/{workspace-members.ts → workspaces/workspace-members.ts} +2 -2
  23. package/src/api/endpoints/{workspaces.ts → workspaces/workspaces.ts} +3 -3
  24. package/src/api/payloads/design-systems/brand.ts +6 -5
  25. package/src/api/payloads/design-systems/index.ts +1 -0
  26. package/src/api/payloads/design-systems/theme.ts +14 -0
  27. package/src/api/endpoints/design-system-versions.ts +0 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supernova-studio/client",
3
- "version": "0.55.19",
3
+ "version": "0.55.21",
4
4
  "description": "Supernova Data Models",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
package/src/api/client.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { WorkspacesEndpoint } from "./endpoints";
2
- import { DesignSystemsEndpoint } from "./endpoints/design-systems";
2
+ import { DesignSystemsEndpoint } from "./endpoints/design-system";
3
3
  import { UsersEndpoint } from "./endpoints/users";
4
4
  import { RequestExecutor } from "./transport/request-executor";
5
5
 
@@ -3,8 +3,8 @@ import {
3
3
  DTODesignSystemMembersUpdatePayload,
4
4
  DTODesignSystemMembersUpdateResponse,
5
5
  DTOUserGetResponse,
6
- } from "../dto";
7
- import { RequestExecutor } from "../transport/request-executor";
6
+ } from "../../dto";
7
+ import { RequestExecutor } from "../../transport/request-executor";
8
8
 
9
9
  export class DesignSystemMembersEndpoint {
10
10
  constructor(private readonly requestExecutor: RequestExecutor) {}
@@ -0,0 +1,20 @@
1
+ import { DTODesignSystemVersionsListResponse } from "../../dto";
2
+ import { RequestExecutor } from "../../transport/request-executor";
3
+ import { TokensEndpoint } from "./versions";
4
+ import { BrandsEndpoint } from "./versions/brands";
5
+ import { ThemesEndpoint } from "./versions/themes";
6
+
7
+ export class DesignSystemVersionsEndpoint {
8
+ readonly themes: ThemesEndpoint;
9
+ readonly brands: BrandsEndpoint;
10
+ readonly tokens: TokensEndpoint;
11
+ constructor(private readonly requestExecutor: RequestExecutor) {
12
+ this.themes = new ThemesEndpoint(requestExecutor);
13
+ this.brands = new BrandsEndpoint(requestExecutor);
14
+ this.tokens = new TokensEndpoint(requestExecutor);
15
+ }
16
+
17
+ list(dsId: string) {
18
+ return this.requestExecutor.json(`/design-systems/${dsId}/versions`, DTODesignSystemVersionsListResponse);
19
+ }
20
+ }
@@ -1,9 +1,10 @@
1
1
  import { z } from "zod";
2
- import { DTODesignSystemCreateInput, DTODesignSystemResponse, DTODesignSystemsListResponse } from "../dto";
3
- import { DTODesignSystemUpdateAccessModeInput, DTODesignSystemUpdateInput } from "../payloads";
4
- import { RequestExecutor } from "../transport/request-executor";
2
+ import { DTODesignSystemCreateInput, DTODesignSystemResponse, DTODesignSystemsListResponse } from "../../dto";
3
+ import { DTODesignSystemUpdateAccessModeInput, DTODesignSystemUpdateInput } from "../../payloads";
4
+ import { RequestExecutor } from "../../transport/request-executor";
5
5
  import { DesignSystemMembersEndpoint } from "./design-system-members";
6
6
  import { DesignSystemVersionsEndpoint } from "./design-system-versions";
7
+ import { TokensEndpoint } from "./versions";
7
8
 
8
9
  export class DesignSystemsEndpoint {
9
10
  readonly members: DesignSystemMembersEndpoint;
@@ -0,0 +1,4 @@
1
+ export * from "./versions";
2
+ export * from "./design-system-members";
3
+ export * from "./design-system-versions";
4
+ export * from "./design-systems";
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+ import { RequestExecutor } from "../../../transport/request-executor";
3
+
4
+ export class BrandsEndpoint {
5
+ constructor(private readonly requestExecutor: RequestExecutor) {}
6
+
7
+ get(designSystemId: string, versionId: string, brandId: string) {
8
+ return this.requestExecutor.json(
9
+ `/design-systems/${designSystemId}/versions/${versionId}/brands/${brandId}`,
10
+ z.any()
11
+ );
12
+ }
13
+
14
+ list(designSystemId: string, versionId: string) {
15
+ return this.requestExecutor.json(`/design-systems/${designSystemId}/versions/${versionId}/brands`, z.any());
16
+ }
17
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./brands";
2
+ export * from "./overrides";
3
+ export * from "./themes";
4
+ export * from "./tokens";
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+ import { RequestExecutor } from "../../../transport/request-executor";
3
+
4
+ export class OverridesEndpoint {
5
+ constructor(private readonly requestExecutor: RequestExecutor) {}
6
+
7
+ create(dsId: string, versionId: string, themeId: string, body: any) {
8
+ return this.requestExecutor.json(
9
+ `/design-systems/${dsId}/versions/${versionId}/themes/${themeId}/overrides`,
10
+ z.any(),
11
+ {
12
+ method: "POST",
13
+ body,
14
+ }
15
+ );
16
+ }
17
+ }
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+ import { RequestExecutor } from "../../../transport/request-executor";
3
+ import { OverridesEndpoint } from "./overrides";
4
+ import { DTOCreateThemeInput } from "../../../payloads/design-systems/theme";
5
+
6
+ export class ThemesEndpoint {
7
+ readonly overrides: OverridesEndpoint;
8
+ constructor(private readonly requestExecutor: RequestExecutor) {
9
+ this.overrides = new OverridesEndpoint(requestExecutor);
10
+ }
11
+
12
+ create(dsId: string, versionId: string, body: DTOCreateThemeInput) {
13
+ return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes`, z.any(), {
14
+ method: "POST",
15
+ body,
16
+ });
17
+ }
18
+
19
+ delete(dsId: string, versionId: string, themeId: string) {
20
+ return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes/${themeId}`, z.any(), {
21
+ method: "DELETE",
22
+ });
23
+ }
24
+ }
@@ -0,0 +1,13 @@
1
+ import { z } from "zod";
2
+ import { RequestExecutor } from "../../../transport/request-executor";
3
+
4
+ export class TokensEndpoint {
5
+ constructor(private readonly requestExecutor: RequestExecutor) {}
6
+
7
+ create(dsId: string, versionId: string, body: any) {
8
+ return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/tokens`, z.any(), {
9
+ method: "POST",
10
+ body,
11
+ });
12
+ }
13
+ }
@@ -1,8 +1,4 @@
1
- export * from "./design-system-members";
2
- export * from "./design-system-versions";
3
- export * from "./design-systems";
1
+ export * from "./design-system";
2
+ export * from "./workspaces";
4
3
  export * from "./token-collections";
5
4
  export * from "./users";
6
- export * from "./workspace-invites";
7
- export * from "./workspace-members";
8
- export * from "./workspaces";
@@ -1,4 +1,3 @@
1
- import { UserProfileUpdate } from "@supernova-studio/model";
2
1
  import { DTOUserProfileUpdate, DTOUserWorkspaceMembershipsResponse } from "../dto";
3
2
  import { DTOAuthenticatedUserResponse } from "../dto/users/authenticated-user";
4
3
  import { RequestExecutor } from "../transport/request-executor";
@@ -0,0 +1,3 @@
1
+ export * from "./workspace-invites";
2
+ export * from "./workspace-members";
3
+ export * from "./workspaces";
@@ -1,5 +1,5 @@
1
- import { DTOWorkspaceInvitationsResponse, DTOWorkspaceResponse } from "../dto";
2
- import { RequestExecutor } from "../transport";
1
+ import { DTOWorkspaceInvitationsResponse, DTOWorkspaceResponse } from "../../dto";
2
+ import { RequestExecutor } from "../../transport";
3
3
 
4
4
  export class WorkspaceInvitationsEndpoint {
5
5
  constructor(private readonly requestExecutor: RequestExecutor) {}
@@ -1,7 +1,7 @@
1
1
  import { UpdateMembershipRolesInput } from "@supernova-studio/model";
2
2
  import { z } from "zod";
3
- import { DTOUserWorkspaceMembershipsResponse, DTOWorkspaceInvitationsListInput, DTOWorkspaceResponse } from "../dto";
4
- import { RequestExecutor } from "../transport";
3
+ import { DTOUserWorkspaceMembershipsResponse, DTOWorkspaceInvitationsListInput, DTOWorkspaceResponse } from "../../dto";
4
+ import { RequestExecutor } from "../../transport";
5
5
 
6
6
  export class WorkspaceMembersEndpoint {
7
7
  constructor(private readonly requestExecutor: RequestExecutor) {}
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
- import { DTOWorkspaceCreateInput, DTOWorkspaceResponse } from "../dto";
3
- import { RequestExecutor } from "../transport/request-executor";
4
- import { WorkspaceMembersEndpoint } from "./workspace-members";
2
+ import { DTOWorkspaceCreateInput, DTOWorkspaceResponse } from "../../dto";
3
+ import { RequestExecutor } from "../../transport/request-executor";
5
4
  import { WorkspaceInvitationsEndpoint } from "./workspace-invites";
5
+ import { WorkspaceMembersEndpoint } from "./workspace-members";
6
6
 
7
7
  // TODO Response types
8
8
  export class WorkspacesEndpoint {
@@ -1,11 +1,12 @@
1
1
  import { z } from "zod";
2
2
 
3
+ // TODO make sure these are all accurate.
3
4
  export const DTOCreateBrandInput = z.object({
4
- persistentId: z.string().uuid(),
5
- meta: z.object({
6
- name: z.string(),
7
- description: z.string(),
8
- }),
5
+ persistentId: z.string().uuid(),
6
+ meta: z.object({
7
+ name: z.string(),
8
+ description: z.string(),
9
+ }),
9
10
  });
10
11
 
11
12
  export type DTOCreateBrandInput = z.infer<typeof DTOCreateBrandInput>;
@@ -1,3 +1,4 @@
1
1
  export * from "./brand";
2
+ export * from "./theme";
2
3
  export * from "./update-design-system";
3
4
  export * from "./version";
@@ -0,0 +1,14 @@
1
+ import { ObjectMeta } from "@supernova-studio/model";
2
+ import { z } from "zod";
3
+
4
+ export const DTOCreateThemeInput = z.object({
5
+ meta: ObjectMeta,
6
+ persistentId: z.string(),
7
+ designSystemVersionId: z.string(),
8
+ brandId: z.string(),
9
+ codeName: z.string(),
10
+ version: z.string().optional(),
11
+ overrides: z.array(z.any()), // TODO Add actual overrides.
12
+ });
13
+
14
+ export type DTOCreateThemeInput = z.infer<typeof DTOCreateThemeInput>;
@@ -1,10 +0,0 @@
1
- import { DTODesignSystemVersionsListResponse } from "../dto";
2
- import { RequestExecutor } from "../transport/request-executor";
3
-
4
- export class DesignSystemVersionsEndpoint {
5
- constructor(private readonly requestExecutor: RequestExecutor) {}
6
-
7
- list(dsId: string) {
8
- return this.requestExecutor.json(`/design-systems/${dsId}/versions`, DTODesignSystemVersionsListResponse);
9
- }
10
- }