@supernova-studio/client 0.58.18 → 1.0.0-alpha.2
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 +1349 -1323
- package/dist/index.d.ts +1349 -1323
- package/dist/index.js +462 -329
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +764 -631
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
- package/src/api/client.ts +0 -31
- package/src/api/conversion/documentation/documentation-group-v1-to-dto.ts +0 -114
- package/src/api/conversion/documentation/documentation-group-v2-to-dto.ts +0 -92
- package/src/api/conversion/documentation/documentation-item-configuration-v1-to-dto.ts +0 -52
- package/src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts +0 -34
- package/src/api/conversion/documentation/documentation-page-to-dto-utils.ts +0 -131
- package/src/api/conversion/documentation/documentation-page-v1-to-dto.ts +0 -69
- package/src/api/conversion/documentation/documentation-page-v2-to-dto.ts +0 -72
- package/src/api/conversion/documentation/index.ts +0 -7
- package/src/api/conversion/export/index.ts +0 -1
- package/src/api/conversion/export/pipeline.ts +0 -25
- package/src/api/conversion/index.ts +0 -3
- package/src/api/conversion/integrations/git.ts +0 -37
- package/src/api/conversion/integrations/index.ts +0 -2
- package/src/api/conversion/integrations/integration.ts +0 -37
- package/src/api/dto/aux/color.ts +0 -7
- package/src/api/dto/aux/index.ts +0 -3
- package/src/api/dto/aux/meta.ts +0 -8
- package/src/api/dto/aux/pagination.ts +0 -8
- package/src/api/dto/bff/app-bootstrap-data.ts +0 -20
- package/src/api/dto/bff/index.ts +0 -1
- package/src/api/dto/collections/index.ts +0 -1
- package/src/api/dto/collections/token-collection.ts +0 -24
- package/src/api/dto/design-systems/brand.ts +0 -44
- package/src/api/dto/design-systems/component.ts +0 -40
- package/src/api/dto/design-systems/contact.ts +0 -11
- package/src/api/dto/design-systems/data-source.ts +0 -141
- package/src/api/dto/design-systems/design-system.ts +0 -68
- package/src/api/dto/design-systems/elements-diff.ts +0 -14
- package/src/api/dto/design-systems/figma-variables.ts +0 -108
- package/src/api/dto/design-systems/import-job.ts +0 -61
- package/src/api/dto/design-systems/index.ts +0 -13
- package/src/api/dto/design-systems/members.ts +0 -50
- package/src/api/dto/design-systems/role.ts +0 -11
- package/src/api/dto/design-systems/stats.ts +0 -19
- package/src/api/dto/design-systems/version.ts +0 -56
- package/src/api/dto/design-systems/view.ts +0 -45
- package/src/api/dto/design-tokens/design-token.ts +0 -78
- package/src/api/dto/design-tokens/index.ts +0 -1
- package/src/api/dto/documentation/anchor.ts +0 -15
- package/src/api/dto/documentation/approvals.ts +0 -15
- package/src/api/dto/documentation/block-definition.ts +0 -28
- package/src/api/dto/documentation/block.ts +0 -6
- package/src/api/dto/documentation/documentation-page-snapshot.ts +0 -18
- package/src/api/dto/documentation/index.ts +0 -8
- package/src/api/dto/documentation/link-preview.ts +0 -23
- package/src/api/dto/documentation/publish.ts +0 -23
- package/src/api/dto/documentation/room.ts +0 -12
- package/src/api/dto/elements/components/figma-component-group.ts +0 -19
- package/src/api/dto/elements/components/figma-component.ts +0 -56
- package/src/api/dto/elements/components/index.ts +0 -2
- package/src/api/dto/elements/documentation/draft-state.ts +0 -37
- package/src/api/dto/elements/documentation/group-action.ts +0 -108
- package/src/api/dto/elements/documentation/group-v1.ts +0 -35
- package/src/api/dto/elements/documentation/group-v2.ts +0 -117
- package/src/api/dto/elements/documentation/hierarchy.ts +0 -22
- package/src/api/dto/elements/documentation/index.ts +0 -13
- package/src/api/dto/elements/documentation/item-configuration-v1.ts +0 -24
- package/src/api/dto/elements/documentation/item-configuration-v2.ts +0 -14
- package/src/api/dto/elements/documentation/metadata.ts +0 -8
- package/src/api/dto/elements/documentation/page-actions-v2.ts +0 -121
- package/src/api/dto/elements/documentation/page-content.ts +0 -15
- package/src/api/dto/elements/documentation/page-v1.ts +0 -21
- package/src/api/dto/elements/documentation/page-v2.ts +0 -120
- package/src/api/dto/elements/documentation/structure.ts +0 -37
- package/src/api/dto/elements/elements-action-v2.ts +0 -104
- package/src/api/dto/elements/figma-nodes/figma-node.ts +0 -106
- package/src/api/dto/elements/figma-nodes/index.ts +0 -2
- package/src/api/dto/elements/figma-nodes/node-actions-v2.ts +0 -24
- package/src/api/dto/elements/frame-node-structures/frame-node-structure.ts +0 -17
- package/src/api/dto/elements/frame-node-structures/index.ts +0 -1
- package/src/api/dto/elements/get-elements-v2.ts +0 -21
- package/src/api/dto/elements/index.ts +0 -7
- package/src/api/dto/elements/properties/index.ts +0 -2
- package/src/api/dto/elements/properties/property-definitions.ts +0 -75
- package/src/api/dto/elements/properties/property-values.ts +0 -38
- package/src/api/dto/export/exporter-property.ts +0 -95
- package/src/api/dto/export/exporter.ts +0 -87
- package/src/api/dto/export/filter.ts +0 -6
- package/src/api/dto/export/index.ts +0 -5
- package/src/api/dto/export/job.ts +0 -87
- package/src/api/dto/export/pipeline.ts +0 -43
- package/src/api/dto/figma-components/assets/download.ts +0 -30
- package/src/api/dto/figma-components/assets/index.ts +0 -1
- package/src/api/dto/figma-components/index.ts +0 -1
- package/src/api/dto/index.ts +0 -13
- package/src/api/dto/liveblocks/auth-response.ts +0 -7
- package/src/api/dto/liveblocks/index.ts +0 -1
- package/src/api/dto/themes/index.ts +0 -2
- package/src/api/dto/themes/override.ts +0 -27
- package/src/api/dto/themes/theme.ts +0 -45
- package/src/api/dto/users/authenticated-user.ts +0 -43
- package/src/api/dto/users/index.ts +0 -3
- package/src/api/dto/users/update.ts +0 -8
- package/src/api/dto/users/user.ts +0 -31
- package/src/api/dto/workspaces/git.ts +0 -32
- package/src/api/dto/workspaces/index.ts +0 -6
- package/src/api/dto/workspaces/integrations.ts +0 -34
- package/src/api/dto/workspaces/invitations.ts +0 -30
- package/src/api/dto/workspaces/membership.ts +0 -41
- package/src/api/dto/workspaces/npm-registry.ts +0 -35
- package/src/api/dto/workspaces/workspace.ts +0 -34
- package/src/api/endpoints/codegen/codegen.ts +0 -13
- package/src/api/endpoints/codegen/exporters.ts +0 -13
- package/src/api/endpoints/codegen/index.ts +0 -3
- package/src/api/endpoints/codegen/pipelines.ts +0 -37
- package/src/api/endpoints/design-system/bff.ts +0 -13
- package/src/api/endpoints/design-system/contact.ts +0 -12
- package/src/api/endpoints/design-system/design-systems.ts +0 -55
- package/src/api/endpoints/design-system/index.ts +0 -6
- package/src/api/endpoints/design-system/members.ts +0 -24
- package/src/api/endpoints/design-system/sources.ts +0 -35
- package/src/api/endpoints/design-system/versions/brands.ts +0 -45
- package/src/api/endpoints/design-system/versions/documentation.ts +0 -27
- package/src/api/endpoints/design-system/versions/ds-components.ts +0 -28
- package/src/api/endpoints/design-system/versions/elements-action.ts +0 -55
- package/src/api/endpoints/design-system/versions/elements.ts +0 -13
- package/src/api/endpoints/design-system/versions/figma-component-groups.ts +0 -13
- package/src/api/endpoints/design-system/versions/figma-components.ts +0 -13
- package/src/api/endpoints/design-system/versions/figma-frame-structures.ts +0 -13
- package/src/api/endpoints/design-system/versions/import-jobs.ts +0 -13
- package/src/api/endpoints/design-system/versions/index.ts +0 -18
- package/src/api/endpoints/design-system/versions/overrides.ts +0 -17
- package/src/api/endpoints/design-system/versions/property-definitions.ts +0 -43
- package/src/api/endpoints/design-system/versions/property-values.ts +0 -25
- package/src/api/endpoints/design-system/versions/stats.ts +0 -12
- package/src/api/endpoints/design-system/versions/themes.ts +0 -35
- package/src/api/endpoints/design-system/versions/token-collections.ts +0 -13
- package/src/api/endpoints/design-system/versions/token-groups.ts +0 -28
- package/src/api/endpoints/design-system/versions/tokens.ts +0 -27
- package/src/api/endpoints/design-system/versions/versions.ts +0 -79
- package/src/api/endpoints/index.ts +0 -5
- package/src/api/endpoints/liveblocks.ts +0 -14
- package/src/api/endpoints/users.ts +0 -26
- package/src/api/endpoints/workspaces/index.ts +0 -3
- package/src/api/endpoints/workspaces/workspace-invites.ts +0 -34
- package/src/api/endpoints/workspaces/workspace-members.ts +0 -31
- package/src/api/endpoints/workspaces/workspaces.ts +0 -47
- package/src/api/index.ts +0 -6
- package/src/api/payloads/design-systems/index.ts +0 -2
- package/src/api/payloads/design-systems/update-design-system.ts +0 -29
- package/src/api/payloads/design-systems/version.ts +0 -29
- package/src/api/payloads/documentation/block-definitions.ts +0 -12
- package/src/api/payloads/documentation/design-data-doc-diff.ts +0 -7
- package/src/api/payloads/documentation/index.ts +0 -2
- package/src/api/payloads/export/index.ts +0 -1
- package/src/api/payloads/export/pipeline.ts +0 -50
- package/src/api/payloads/index.ts +0 -6
- package/src/api/payloads/liveblocks/auth.ts +0 -7
- package/src/api/payloads/liveblocks/index.ts +0 -1
- package/src/api/payloads/users/index.ts +0 -2
- package/src/api/payloads/users/notifications/index.ts +0 -1
- package/src/api/payloads/users/notifications/notification-settings.ts +0 -17
- package/src/api/payloads/users/profile/index.ts +0 -1
- package/src/api/payloads/users/profile/update.ts +0 -4
- package/src/api/payloads/workspaces/index.ts +0 -3
- package/src/api/payloads/workspaces/transfer-ownership.ts +0 -7
- package/src/api/payloads/workspaces/workspace-configuration.ts +0 -50
- package/src/api/payloads/workspaces/workspace-integrations.ts +0 -26
- package/src/api/transport/index.ts +0 -2
- package/src/api/transport/request-executor-error.ts +0 -66
- package/src/api/transport/request-executor.ts +0 -87
- package/src/index.ts +0 -3
- package/src/utils/figma.ts +0 -53
- package/src/utils/hash.ts +0 -62
- package/src/utils/index.ts +0 -3
- package/src/utils/query.ts +0 -18
- package/src/yjs/design-system-content/documentation-hierarchy.ts +0 -35
- package/src/yjs/design-system-content/index.ts +0 -2
- package/src/yjs/design-system-content/item-configuration.ts +0 -93
- package/src/yjs/docs-editor/blocks-to-prosemirror.ts +0 -764
- package/src/yjs/docs-editor/index.ts +0 -7
- package/src/yjs/docs-editor/list-tree-builder.ts +0 -127
- package/src/yjs/docs-editor/mock.ts +0 -2104
- package/src/yjs/docs-editor/model/block.ts +0 -8
- package/src/yjs/docs-editor/model/index.ts +0 -2
- package/src/yjs/docs-editor/model/page.ts +0 -8
- package/src/yjs/docs-editor/prosemirror/index.ts +0 -3
- package/src/yjs/docs-editor/prosemirror/inner-editor-schema.ts +0 -145
- package/src/yjs/docs-editor/prosemirror/main-editor-schema.ts +0 -577
- package/src/yjs/docs-editor/prosemirror/types.ts +0 -19
- package/src/yjs/docs-editor/prosemirror-to-blocks.ts +0 -975
- package/src/yjs/docs-editor/utils.ts +0 -115
- package/src/yjs/index.ts +0 -3
- package/src/yjs/version-room/backend.ts +0 -78
- package/src/yjs/version-room/base.ts +0 -211
- package/src/yjs/version-room/frontend.ts +0 -461
- package/src/yjs/version-room/index.ts +0 -4
- package/src/yjs/version-room/utils.ts +0 -109
package/src/api/dto/index.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from "./aux";
|
|
2
|
-
export * from "./bff";
|
|
3
|
-
export * from "./collections";
|
|
4
|
-
export * from "./design-systems";
|
|
5
|
-
export * from "./design-tokens";
|
|
6
|
-
export * from "./documentation";
|
|
7
|
-
export * from "./elements";
|
|
8
|
-
export * from "./export";
|
|
9
|
-
export * from "./figma-components";
|
|
10
|
-
export * from "./liveblocks";
|
|
11
|
-
export * from "./themes";
|
|
12
|
-
export * from "./users";
|
|
13
|
-
export * from "./workspaces";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./auth-response";
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { DesignTokenTypedData, ThemeOverrideOrigin } from "@supernova-studio/model";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//
|
|
5
|
-
// Read
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
export const DTOThemeOverride = DesignTokenTypedData.and(
|
|
9
|
-
z.object({
|
|
10
|
-
tokenPersistentId: z.string(),
|
|
11
|
-
origin: ThemeOverrideOrigin.optional(),
|
|
12
|
-
})
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
export type DTOThemeOverride = z.infer<typeof DTOThemeOverride>;
|
|
16
|
-
|
|
17
|
-
//
|
|
18
|
-
// Write
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
export const DTOThemeOverrideCreatePayload = DesignTokenTypedData.and(
|
|
22
|
-
z.object({
|
|
23
|
-
tokenPersistentId: z.string(),
|
|
24
|
-
})
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
export type DTOThemeOverrideCreatePayload = z.infer<typeof DTOThemeOverrideCreatePayload>;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ObjectMeta } from "@supernova-studio/model";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { DTOThemeOverride } from "./override";
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
// Read
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
export const DTOTheme = z.object({
|
|
10
|
-
id: z.string(),
|
|
11
|
-
persistentId: z.string(),
|
|
12
|
-
designSystemVersionId: z.string(),
|
|
13
|
-
brandId: z.string(),
|
|
14
|
-
|
|
15
|
-
meta: ObjectMeta,
|
|
16
|
-
codeName: z.string(),
|
|
17
|
-
|
|
18
|
-
overrides: DTOThemeOverride.array(),
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export const DTOThemeResponse = z.object({
|
|
22
|
-
theme: DTOTheme,
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export const DTOThemeListResponse = z.object({
|
|
26
|
-
themes: DTOTheme.array(),
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export type DTOTheme = z.infer<typeof DTOTheme>;
|
|
30
|
-
export type DTOThemeResponse = z.infer<typeof DTOThemeResponse>;
|
|
31
|
-
export type DTOThemeListResponse = z.infer<typeof DTOThemeListResponse>;
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
// Write
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
export const DTOThemeCreatePayload = z.object({
|
|
38
|
-
meta: ObjectMeta,
|
|
39
|
-
persistentId: z.string(),
|
|
40
|
-
brandId: z.string(),
|
|
41
|
-
codeName: z.string(),
|
|
42
|
-
overrides: DTOThemeOverride.array(),
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
export type DTOThemeCreatePayload = z.infer<typeof DTOThemeCreatePayload>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { UserOnboardingDepartment, UserOnboardingJobLevel, UserSource } from "@supernova-studio/model";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { DTOUser, DTOUserProfile } from "./user";
|
|
4
|
-
|
|
5
|
-
export const DTOUserOnboardingDepartment = UserOnboardingDepartment;
|
|
6
|
-
export const DTOUserOnboardingJobLevel = UserOnboardingJobLevel;
|
|
7
|
-
export const DTOUserSource = UserSource;
|
|
8
|
-
|
|
9
|
-
export const DTOUserOnboarding = z.object({
|
|
10
|
-
companyName: z.string().optional(),
|
|
11
|
-
numberOfPeopleInOrg: z.string().optional(),
|
|
12
|
-
numberOfPeopleInDesignTeam: z.string().optional(),
|
|
13
|
-
department: DTOUserOnboardingDepartment.optional(),
|
|
14
|
-
jobTitle: z.string().optional(),
|
|
15
|
-
phase: z.string().optional(),
|
|
16
|
-
jobLevel: DTOUserOnboardingJobLevel.optional(),
|
|
17
|
-
designSystemName: z.string().optional(),
|
|
18
|
-
defaultDestination: z.string().optional(),
|
|
19
|
-
isPageDraftOnboardingFinished: z.boolean().optional(),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export const DTOAuthenticatedUserProfile = DTOUserProfile.extend({
|
|
23
|
-
onboarding: DTOUserOnboarding.optional(),
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
export const DTOAuthenticatedUser = DTOUser.extend({
|
|
27
|
-
profile: DTOAuthenticatedUserProfile,
|
|
28
|
-
createdAt: z.coerce.date(),
|
|
29
|
-
loggedOutAt: z.coerce.date().optional(),
|
|
30
|
-
source: DTOUserSource.optional(),
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
export const DTOAuthenticatedUserResponse = z.object({
|
|
34
|
-
user: DTOAuthenticatedUser,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
export type DTOUserOnboardingDepartment = z.infer<typeof DTOUserOnboardingDepartment>;
|
|
38
|
-
export type DTOUserOnboardingJobLevel = z.infer<typeof DTOUserOnboardingJobLevel>;
|
|
39
|
-
export type DTOUserSource = z.infer<typeof DTOUserSource>;
|
|
40
|
-
export type DTOUserOnboarding = z.infer<typeof DTOUserOnboarding>;
|
|
41
|
-
export type DTOAuthenticatedUserProfile = z.infer<typeof DTOAuthenticatedUserProfile>;
|
|
42
|
-
export type DTOAuthenticatedUser = z.infer<typeof DTOAuthenticatedUser>;
|
|
43
|
-
export type DTOAuthenticatedUserResponse = z.infer<typeof DTOAuthenticatedUserResponse>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { UserProfileUpdate } from "@supernova-studio/model";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Definition of a user profile as inspectable by other users (i.e. reduced version)
|
|
6
|
-
*/
|
|
7
|
-
export const DTOUserProfile = z.object({
|
|
8
|
-
name: z.string(),
|
|
9
|
-
nickname: z.string().optional(),
|
|
10
|
-
avatar: z.string().optional(),
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Definition of a user as inspectable by other users (i.e. reduced version)
|
|
15
|
-
*/
|
|
16
|
-
export const DTOUser = z.object({
|
|
17
|
-
id: z.string(),
|
|
18
|
-
email: z.string(),
|
|
19
|
-
profile: DTOUserProfile,
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export const DTOUserGetResponse = z.object({
|
|
23
|
-
user: DTOUser,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
export const DTOUserProfileUpdate = UserProfileUpdate;
|
|
27
|
-
|
|
28
|
-
export type DTOUserProfile = z.infer<typeof DTOUserProfile>;
|
|
29
|
-
export type DTOUser = z.infer<typeof DTOUser>;
|
|
30
|
-
export type DTOUserGetResponse = z.infer<typeof DTOUserGetResponse>;
|
|
31
|
-
export type DTOUserProfileUpdate = z.infer<typeof DTOUserProfileUpdate>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const DTOGitOrganization = z.object({
|
|
4
|
-
id: z.string(),
|
|
5
|
-
name: z.string(),
|
|
6
|
-
url: z.string(),
|
|
7
|
-
slug: z.string(),
|
|
8
|
-
});
|
|
9
|
-
export type DTOGitOrganization = z.infer<typeof DTOGitOrganization>;
|
|
10
|
-
|
|
11
|
-
export const DTOGitProject = z.object({
|
|
12
|
-
id: z.string(),
|
|
13
|
-
name: z.string(),
|
|
14
|
-
url: z.string(),
|
|
15
|
-
slug: z.string(),
|
|
16
|
-
});
|
|
17
|
-
export type DTOGitProject = z.infer<typeof DTOGitProject>;
|
|
18
|
-
|
|
19
|
-
export const DTOGitRepository = z.object({
|
|
20
|
-
id: z.string(),
|
|
21
|
-
name: z.string(),
|
|
22
|
-
url: z.string(),
|
|
23
|
-
slug: z.string(),
|
|
24
|
-
defaultBranch: z.string().optional(),
|
|
25
|
-
});
|
|
26
|
-
export type DTOGitRepository = z.infer<typeof DTOGitRepository>;
|
|
27
|
-
|
|
28
|
-
export const DTOGitBranch = z.object({
|
|
29
|
-
name: z.string(),
|
|
30
|
-
lastCommitId: z.string(),
|
|
31
|
-
});
|
|
32
|
-
export type DTOGitBranch = z.infer<typeof DTOGitBranch>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ExtendedIntegrationType, IntegrationCredentials, IntegrationDesignSystem } from "@supernova-studio/model";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
export const DTOIntegrationCredentials = IntegrationCredentials.omit({
|
|
5
|
-
accessToken: true,
|
|
6
|
-
refreshToken: true,
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export const DTOIntegration = z.object({
|
|
10
|
-
id: z.string(),
|
|
11
|
-
workspaceId: z.string(),
|
|
12
|
-
type: ExtendedIntegrationType,
|
|
13
|
-
createdAt: z.coerce.date(),
|
|
14
|
-
integrationCredentials: z.array(DTOIntegrationCredentials).optional(),
|
|
15
|
-
integrationDesignSystems: z.array(IntegrationDesignSystem).optional(),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export const DTOIntegrationOAuthGetResponse = z.object({
|
|
19
|
-
url: z.string(),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export const DTOIntegrationPostResponse = z.object({
|
|
23
|
-
integration: DTOIntegration,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
export const DTOIntegrationsGetListResponse = z.object({
|
|
27
|
-
integrations: DTOIntegration.array(),
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
export type DTOIntegration = z.infer<typeof DTOIntegration>;
|
|
31
|
-
export type DTOIntegrationCredentials = z.infer<typeof DTOIntegrationCredentials>;
|
|
32
|
-
export type DTOIntegrationOAuthGetResponse = z.infer<typeof DTOIntegrationOAuthGetResponse>;
|
|
33
|
-
export type DTOIntegrationPostResponse = z.infer<typeof DTOIntegrationPostResponse>;
|
|
34
|
-
export type DTOIntegrationsGetListResponse = z.infer<typeof DTOIntegrationsGetListResponse>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { WorkspaceInvitation, WorkspaceRoleSchema } from "@supernova-studio/model";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
export const DTOWorkspaceInvitationInput = z.object({
|
|
5
|
-
email: z.string().email(),
|
|
6
|
-
role: WorkspaceRoleSchema,
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export const DTOWorkspaceInvitationsListInput = z.object({
|
|
10
|
-
invites: DTOWorkspaceInvitationInput.array().max(100),
|
|
11
|
-
designSystemId: z.string().optional(),
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export const DTOWorkspaceInvitationsResponse = z.object({
|
|
15
|
-
invitations: WorkspaceInvitation.array(),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export const DTOWorkspaceInviteUpdate = z.object({
|
|
19
|
-
role: WorkspaceRoleSchema,
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export const DTOWorkspaceInvitationUpdateResponse = z.object({
|
|
23
|
-
invitation: WorkspaceInvitation,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
export type DTOWorkspaceInvitationInput = z.infer<typeof DTOWorkspaceInvitationInput>;
|
|
27
|
-
export type DTOWorkspaceInvitationsListInput = z.infer<typeof DTOWorkspaceInvitationsListInput>;
|
|
28
|
-
export type DTOWorkspaceInvitationsResponse = z.infer<typeof DTOWorkspaceInvitationsResponse>;
|
|
29
|
-
export type DTOWorkspaceInviteUpdate = z.infer<typeof DTOWorkspaceInviteUpdate>;
|
|
30
|
-
export type DTOWorkspaceInvitationUpdateResponse = z.infer<typeof DTOWorkspaceInvitationUpdateResponse>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { DTOWorkspace } from "./workspace";
|
|
3
|
-
import { User, WorkspaceRoleSchema } from "@supernova-studio/model";
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
// Read
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
export const DTOWorkspaceRole = z.enum(["Owner", "Admin", "Creator", "Viewer", "Billing", "Contributor"]);
|
|
10
|
-
|
|
11
|
-
export const DTOUserWorkspaceMembership = z.object({
|
|
12
|
-
// Workspace the user is a member of
|
|
13
|
-
workspace: DTOWorkspace,
|
|
14
|
-
|
|
15
|
-
// Assigned role the user has in the workspace
|
|
16
|
-
role: DTOWorkspaceRole,
|
|
17
|
-
|
|
18
|
-
// Role that determines actual permissions the user has in the workspace
|
|
19
|
-
// E.g. this is different from the default role when editors are downgraded to viewers
|
|
20
|
-
// when a workspace's subscription is downgraded to free tier
|
|
21
|
-
effectiveRole: DTOWorkspaceRole,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
export const DTOWorkspaceMember = z.object({
|
|
25
|
-
user: User,
|
|
26
|
-
role: WorkspaceRoleSchema,
|
|
27
|
-
effectiveRole: WorkspaceRoleSchema,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
export const DTOUserWorkspaceMembershipsResponse = z.object({
|
|
31
|
-
membership: z.array(DTOUserWorkspaceMembership),
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export const DTOWorkspaceMembersListResponse = z.object({
|
|
35
|
-
members: z.array(DTOWorkspaceMember),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export type DTOWorkspaceRole = z.infer<typeof DTOWorkspaceRole>;
|
|
39
|
-
export type DTOUserWorkspaceMembership = z.infer<typeof DTOUserWorkspaceMembership>;
|
|
40
|
-
export type DTOUserWorkspaceMembershipsResponse = z.infer<typeof DTOUserWorkspaceMembershipsResponse>;
|
|
41
|
-
export type DTOWorkspaceMembersListResponse = z.infer<typeof DTOWorkspaceMembersListResponse>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { NpmRegistryAuthType, NpmRegistryType } from "@supernova-studio/model";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//
|
|
5
|
-
// Read
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
export const DTONpmRegistryConfigConstants = {
|
|
9
|
-
passwordPlaceholder: "redacted",
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const DTONpmRegistryConfig = z.object({
|
|
13
|
-
// Registry basic configuration
|
|
14
|
-
registryType: NpmRegistryType,
|
|
15
|
-
registryUrl: z.string(),
|
|
16
|
-
customRegistryUrl: z.string().optional(),
|
|
17
|
-
|
|
18
|
-
// URL of Supernova NPM packages proxy
|
|
19
|
-
proxyUrl: z.string(),
|
|
20
|
-
|
|
21
|
-
// Auth configuration
|
|
22
|
-
authType: NpmRegistryAuthType,
|
|
23
|
-
accessToken: z.literal(DTONpmRegistryConfigConstants.passwordPlaceholder).optional(),
|
|
24
|
-
username: z.string().optional(),
|
|
25
|
-
password: z.literal(DTONpmRegistryConfigConstants.passwordPlaceholder).optional(),
|
|
26
|
-
|
|
27
|
-
// NPM package scopes for whih the proxy should be enabled
|
|
28
|
-
enabledScopes: z.array(z.string()),
|
|
29
|
-
|
|
30
|
-
// True if client should bypass Supernova proxy and connect directly to the registry
|
|
31
|
-
// (e.g. when the NPM registry is behind a VPN or firewall which prevents Supernova from accessing it)
|
|
32
|
-
bypassProxy: z.boolean(),
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export type DTONpmRegistryConfig = z.infer<typeof DTONpmRegistryConfig>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Subscription, WorkspaceProfile } from "@supernova-studio/model";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { DTONpmRegistryConfig } from "./npm-registry";
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
// Read
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
export const DTOWorkspaceProfile = WorkspaceProfile;
|
|
10
|
-
|
|
11
|
-
export const DTOWorkspace = z.object({
|
|
12
|
-
id: z.string(),
|
|
13
|
-
profile: DTOWorkspaceProfile,
|
|
14
|
-
subscription: Subscription,
|
|
15
|
-
npmRegistry: DTONpmRegistryConfig.optional(),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export type DTOWorkspaceProfile = z.infer<typeof DTOWorkspaceProfile>;
|
|
19
|
-
export type DTOWorkspace = z.infer<typeof DTOWorkspace>;
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
// Write
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
export const DTOWorkspaceCreateInput = z.object({
|
|
26
|
-
name: z.string(),
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export const DTOWorkspaceResponse = z.object({
|
|
30
|
-
workspace: DTOWorkspace,
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
export type DTOWorkspaceCreateInput = z.infer<typeof DTOWorkspaceCreateInput>;
|
|
34
|
-
export type DTOWorkspaceResponse = z.infer<typeof DTOWorkspaceResponse>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RequestExecutor } from "../../transport";
|
|
2
|
-
import { ExportersEndpoint } from "./exporters";
|
|
3
|
-
import { PipelinesEndpoint } from "./pipelines";
|
|
4
|
-
|
|
5
|
-
export class CodegenEndpoint {
|
|
6
|
-
readonly exporters: ExportersEndpoint;
|
|
7
|
-
readonly pipelines: PipelinesEndpoint;
|
|
8
|
-
|
|
9
|
-
constructor(private readonly requestExecutor: RequestExecutor) {
|
|
10
|
-
this.pipelines = new PipelinesEndpoint(requestExecutor);
|
|
11
|
-
this.exporters = new ExportersEndpoint(requestExecutor);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { serializeQuery } from "../../../utils";
|
|
2
|
-
import { DTOExporterListQuery, DTOExporterListResponse } from "../../dto";
|
|
3
|
-
import { RequestExecutor } from "../../transport";
|
|
4
|
-
|
|
5
|
-
export class ExportersEndpoint {
|
|
6
|
-
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
7
|
-
|
|
8
|
-
list(workspaceId: string, query: DTOExporterListQuery) {
|
|
9
|
-
return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/exporters`, DTOExporterListResponse, {
|
|
10
|
-
query: serializeQuery(query),
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { DTOExportJobResponse, DTOPipelineListQuery, DTOPipelineListResponse, DTOPipelineResponse } from "../../dto";
|
|
2
|
-
import { DTOPipelineCreateBody, DTOPipelineTriggerBody } from "../../payloads";
|
|
3
|
-
import { RequestExecutor } from "../../transport";
|
|
4
|
-
|
|
5
|
-
export class PipelinesEndpoint {
|
|
6
|
-
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
7
|
-
|
|
8
|
-
list(workspaceId: string, query: DTOPipelineListQuery) {
|
|
9
|
-
const queryWithStrings = Object.fromEntries(
|
|
10
|
-
Object.entries(query)
|
|
11
|
-
.filter(e => !!e[1])
|
|
12
|
-
.map(([k, v]) => [k, v.toString()])
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/pipelines`, DTOPipelineListResponse, {
|
|
16
|
-
query: new URLSearchParams(queryWithStrings),
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
create(workspaceId: string, payload: DTOPipelineCreateBody) {
|
|
21
|
-
return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/pipelines`, DTOPipelineResponse, {
|
|
22
|
-
body: payload,
|
|
23
|
-
method: "POST",
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
trigger(workspaceId: string, pipelineId: string, payload: DTOPipelineTriggerBody) {
|
|
28
|
-
return this.requestExecutor.json(
|
|
29
|
-
`/codegen/workspaces/${workspaceId}/pipelines/${pipelineId}/trigger`,
|
|
30
|
-
DTOExportJobResponse,
|
|
31
|
-
{
|
|
32
|
-
body: payload,
|
|
33
|
-
method: "POST",
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DTOBffImportRequestBody, DTOImportJobResponse } from "../../dto";
|
|
2
|
-
import { RequestExecutor } from "../../transport/request-executor";
|
|
3
|
-
|
|
4
|
-
export class DesignSystemBffEndpoint {
|
|
5
|
-
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
6
|
-
|
|
7
|
-
import(dsId: string, payload: DTOBffImportRequestBody) {
|
|
8
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/bff/import`, DTOImportJobResponse, {
|
|
9
|
-
method: "POST",
|
|
10
|
-
body: payload,
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DTODesignSystemContactsResponse } from "../../dto";
|
|
2
|
-
import { RequestExecutor } from "../../transport/request-executor";
|
|
3
|
-
|
|
4
|
-
export class DesignSystemContactsEndpoint {
|
|
5
|
-
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
6
|
-
|
|
7
|
-
list(dsId: string) {
|
|
8
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/contacts`, DTODesignSystemContactsResponse, {
|
|
9
|
-
method: "GET",
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
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";
|
|
5
|
-
import { DesignSystemBffEndpoint } from "./bff";
|
|
6
|
-
import { DesignSystemMembersEndpoint } from "./members";
|
|
7
|
-
import { DesignSystemSourcesEndpoint } from "./sources";
|
|
8
|
-
import { DesignSystemVersionsEndpoint } from "./versions/versions";
|
|
9
|
-
import { DesignSystemContactsEndpoint } from "./contact";
|
|
10
|
-
|
|
11
|
-
export class DesignSystemsEndpoint {
|
|
12
|
-
readonly members: DesignSystemMembersEndpoint;
|
|
13
|
-
readonly versions: DesignSystemVersionsEndpoint;
|
|
14
|
-
readonly bff: DesignSystemBffEndpoint;
|
|
15
|
-
readonly sources: DesignSystemSourcesEndpoint;
|
|
16
|
-
readonly contacts: DesignSystemContactsEndpoint;
|
|
17
|
-
|
|
18
|
-
constructor(private readonly requestExecutor: RequestExecutor) {
|
|
19
|
-
this.members = new DesignSystemMembersEndpoint(requestExecutor);
|
|
20
|
-
this.versions = new DesignSystemVersionsEndpoint(requestExecutor);
|
|
21
|
-
this.bff = new DesignSystemBffEndpoint(requestExecutor);
|
|
22
|
-
this.sources = new DesignSystemSourcesEndpoint(requestExecutor);
|
|
23
|
-
this.contacts = new DesignSystemContactsEndpoint(requestExecutor);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
create(body: DTODesignSystemCreateInput) {
|
|
27
|
-
return this.requestExecutor.json("/design-systems", DTODesignSystemResponse, { method: "POST", body });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
list(wsId: string) {
|
|
31
|
-
return this.requestExecutor.json(`/workspaces/${wsId}/design-systems`, DTODesignSystemsListResponse);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
get(dsId: string) {
|
|
35
|
-
return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
delete(dsId: string) {
|
|
39
|
-
return this.requestExecutor.json(`/design-systems/${dsId}`, z.any(), { method: "DELETE" });
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
update(dsId: string, body: DTODesignSystemUpdateInput) {
|
|
43
|
-
return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse, {
|
|
44
|
-
method: "PUT",
|
|
45
|
-
body,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
updateAccessMode(dsId: string, body: DTODesignSystemUpdateAccessModeInput) {
|
|
50
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/access-mode`, DTODesignSystemResponse, {
|
|
51
|
-
method: "PUT",
|
|
52
|
-
body,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DTODesignSystemMemberListResponse,
|
|
3
|
-
DTODesignSystemMembersUpdatePayload,
|
|
4
|
-
DTODesignSystemMembersUpdateResponse,
|
|
5
|
-
DTOUserGetResponse,
|
|
6
|
-
} from "../../dto";
|
|
7
|
-
import { RequestExecutor } from "../../transport/request-executor";
|
|
8
|
-
|
|
9
|
-
export class DesignSystemMembersEndpoint {
|
|
10
|
-
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
11
|
-
|
|
12
|
-
list(dsId: string) {
|
|
13
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/members`, DTODesignSystemMemberListResponse, {
|
|
14
|
-
method: "GET",
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
update(dsId: string, body: DTODesignSystemMembersUpdatePayload) {
|
|
19
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/members`, DTODesignSystemMembersUpdateResponse, {
|
|
20
|
-
method: "POST",
|
|
21
|
-
body,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
DTODataSourceFigmaCreatePayload,
|
|
4
|
-
DTODataSourceFigmaImportPayload,
|
|
5
|
-
DTODataSourceResponse,
|
|
6
|
-
DTODataSourcesListResponse,
|
|
7
|
-
DTOImportJobResponse,
|
|
8
|
-
} from "../../dto";
|
|
9
|
-
import { RequestExecutor } from "../../transport/request-executor";
|
|
10
|
-
|
|
11
|
-
export class DesignSystemSourcesEndpoint {
|
|
12
|
-
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
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
|
-
|
|
21
|
-
list(dsId: string) {
|
|
22
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/sources`, DTODataSourcesListResponse);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
delete(dsId: string, sourceId: string) {
|
|
26
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, z.any(), { method: "DELETE" });
|
|
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
|
-
}
|
|
35
|
-
}
|