@supernova-studio/supernova-sdk-beta 2.0.20 → 2.0.22

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 (29) hide show
  1. package/build/sdk-typescript/src/core/areas/SDKAreaBulkOperations.d.ts +8 -0
  2. package/build/sdk-typescript/src/core/areas/SDKAreaDesignSystems.d.ts +19 -4
  3. package/build/sdk-typescript/src/core/areas/SDKAreaTokens.d.ts +1 -1
  4. package/build/sdk-typescript/src/core/data/SDKDataCore.d.ts +7 -2
  5. package/build/sdk-typescript/src/core/data/requests/SDKDataCoreReadRequests.d.ts +2 -0
  6. package/build/sdk-typescript/src/core/data/requests/SDKDataCoreWriteRequests.d.ts +6 -3
  7. package/build/sdk-typescript/src/exports-pulsar.d.ts +2 -0
  8. package/build/sdk-typescript/src/exports.d.ts +2 -0
  9. package/build/sdk-typescript/src/model/assets/SDKAsset.d.ts +1 -1
  10. package/build/sdk-typescript/src/model/base/SDKBootstrapData.d.ts +23 -0
  11. package/build/sdk-typescript/src/model/base/SDKDesignSystem.d.ts +7 -0
  12. package/build/sdk-typescript/src/model/base/SDKDesignSystemMemberList.d.ts +9 -3
  13. package/build/sdk-typescript/src/model/components/SDKDesignComponent.d.ts +9 -31
  14. package/build/sdk-typescript/src/model/components/SDKDesignComponentBase.d.ts +15 -0
  15. package/build/sdk-typescript/src/model/components/SDKDesignComponentPropertyDefinition.d.ts +38 -0
  16. package/build/sdk-typescript/src/model/components/SDKDesignComponentVariant.d.ts +9 -0
  17. package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockFigmaComponentProperty.d.ts +0 -4
  18. package/build/sdk-typescript/src/model/enums/SDKTokenType.d.ts +2 -2
  19. package/build/sdk-typescript/src/model/enums/SDKUserRole.d.ts +2 -0
  20. package/build/sdk-typescript/src/model/exporters/SDKPipeline.d.ts +3 -0
  21. package/build/sdk-typescript/src/model/support/SDKDesignComponentOrigin.d.ts +2 -8
  22. package/build/sdk-typescript/src/model/themes/SDKTokenTheme.d.ts +2 -2
  23. package/build/sdk-typescript/src/model/themes/SDKTokenThemeOverride.d.ts +2 -2
  24. package/build/sdk-typescript/src/tests/validators.d.ts +4 -0
  25. package/build/sdk-typescript/src/tools/json-builder/elements-transformers/SDKToolsJSONElementTransformer.d.ts +1 -1
  26. package/build/supernova-sdk-typescript.js +1 -1
  27. package/build/supernova-sdk-typescript.js.map +1 -1
  28. package/package.json +3 -3
  29. /package/build/sdk-typescript/src/model/docs/blocks/definition/actual/{figma-component-propstable → figma-component-props-table}/SDKDocsBlockActualFigmaComponentPropsTable.d.ts +0 -0
@@ -1,3 +1,4 @@
1
+ import { BootstrapData } from "../../model/base/SDKBootstrapData";
1
2
  import { Component } from "../../model/components/SDKComponent";
2
3
  import { ElementProperty } from "../../model/elements/SDKElementProperty";
3
4
  import { TokenGroup } from "../../model/groups/SDKTokenGroup";
@@ -65,4 +66,11 @@ export declare class AreaBulkOperations {
65
66
  * @returns Nothing
66
67
  */
67
68
  updateComponentData(to: RemoteVersionIdentifier, data: ComponentUpdateTransactionData): Promise<void>;
69
+ /** Fetches a chain of workspace, design system, version and brand, available to the current user.
70
+ * @param preferredWorkspaceId - Preferred workspace ID to fetch
71
+ * @param preferredDesignSystemId - Preferred design system ID to fetch
72
+ * @param preferredVersionId - Preferred version ID to fetch
73
+ * @param preferredBrandId - Preferred brand ID to fetch
74
+ */
75
+ bootstrapData(preferredWorkspaceId?: string, preferredDesignSystemId?: string, preferredVersionId?: string, preferredBrandId?: string): Promise<BootstrapData>;
68
76
  }
@@ -1,4 +1,5 @@
1
1
  import { DTODocumentationLinkPreviewRequest, DTODocumentationPageApprovalStateChangeInput } from "@supernova-studio/client";
2
+ import { DesignSystemInvite, DesignSystemPendingMemberInvite, DesignSystemUserInvitation } from "@supernova-studio/model";
2
3
  import { DesignSystem, DesignSystemAccessMode, DesignSystemSwitcher } from "../../model/base/SDKDesignSystem";
3
4
  import { DesignSystemMemberList } from "../../model/base/SDKDesignSystemMemberList";
4
5
  import { CustomDomain } from "../../model/support/SDKCustomDomain";
@@ -32,9 +33,12 @@ export declare class AreaDesignSystems {
32
33
  * @param name - Name of the design system
33
34
  * @param description - Description of the design system
34
35
  * @param accessMode - Defines who can access the design system
36
+ * @param usersToInvite - Existing users to invite
37
+ * @param invitesToInvite - Pending memberships to invite
38
+ * @param emailsToInvite - New emails to invite
35
39
  * @returns Newly created design system object
36
40
  */
37
- createDesignSystem(workspaceId: string, name: string, description?: string, accessMode?: DesignSystemAccessMode): Promise<DesignSystem>;
41
+ createDesignSystem(workspaceId: string, name: string, description?: string, accessMode?: DesignSystemAccessMode, usersToInvite?: Array<DesignSystemUserInvitation>, invitesToInvite?: Array<DesignSystemPendingMemberInvite>, emailsToInvite?: Array<DesignSystemInvite>): Promise<DesignSystem>;
38
42
  getBlockDefinitions(designSystemId: string, versionId: string): Promise<import("../..").DocsBlockDefinition[]>;
39
43
  getUrlPreview(designSystemId: string, versionId: string, request: DTODocumentationLinkPreviewRequest): Promise<{
40
44
  linkPreview: {
@@ -106,13 +110,24 @@ export declare class AreaDesignSystems {
106
110
  * @returns nothing
107
111
  */
108
112
  updateDesignSystemCustomDomain(designSystemId: string, newDomain: string): Promise<CustomDomain>;
113
+ /** Updates design system's access mode and, if switching to invite-only, also the member list
114
+ * @param designSystemId - ID of the design system
115
+ * @param accessMode - new access mode
116
+ * @param retainUserIds - which users to keep when switching to invite-only
117
+ * @param retainInviteIds - which invites to keep when switching to invite-only
118
+ * @returns nothing
119
+ */
120
+ updateDesignSystemAccessAndMemberList(designSystemId: string, accessMode: DesignSystemAccessMode, retainUserIds: Array<string>, retainInviteIds: Array<string>): Promise<void>;
109
121
  /** Updates design system's member list
110
122
  * @param designSystemId - ID of the design system
111
- * @param inviteUserIds - User IDs to invite
112
- * @param removeUserIds - User IDs to remove
123
+ * @param usersToInvite - Existing users to invite
124
+ * @param invitesToInvite - Pending memberships to invite
125
+ * @param emailsToInvite - New emails to invite
126
+ * @param deleteInvitationIds - Pending memberships to delete
127
+ * @param removeUserIds - Existing users to remove
113
128
  * @returns nothing
114
129
  */
115
- updateDesignSystemMemberList(designSystemId: string, inviteUserIds: Array<string>, removeUserIds: Array<string>): Promise<void>;
130
+ updateDesignSystemMemberList(designSystemId: string, usersToInvite?: Array<DesignSystemUserInvitation>, invitesToInvite?: Array<DesignSystemPendingMemberInvite>, emailsToInvite?: Array<DesignSystemInvite>, deleteInvitationIds?: Array<string>, removeUserIds?: Array<string>): Promise<void>;
116
131
  /** Deletes a design system. This action is irreversible, all data will be lost, and can only be performed by the admins of the workspace
117
132
  * @param designSystemId - ID of the design system
118
133
  * @returns Nothing. RIP design system.
@@ -213,7 +213,7 @@ export declare class AreaTokens {
213
213
  /** Warning: INTERNAL, DO NOT USE YET, NOT STABLE INTERFACE. Write theme in bulk */
214
214
  writeTheme(to: RemoteVersionIdentifier, theme: TokenTheme): Promise<void>;
215
215
  /** Resolves tokens by applying themes to them and retrieves new token set where values correctly correspond to that theme */
216
- computeTokensByApplyingThemes(tokens: Array<Token>, themes: Array<TokenTheme>): Array<Token>;
216
+ computeTokensByApplyingThemes(allTokens: Array<Token>, tokens: Array<Token>, themes: Array<TokenTheme>): Array<Token>;
217
217
  /** Separates groups by types */
218
218
  computeGroupTrees(groups: Array<TokenGroup>): Promise<Map<TokenType, Array<TokenGroup>>>;
219
219
  /** Get determistic mocked token data. Must be used with mocked token groups */
@@ -1,9 +1,11 @@
1
1
  import { DTOCreateDocumentationGroupInput, DTOCreateDocumentationPageInputV2, DTOCreateDocumentationTabInput, DTODeleteDocumentationGroupInput, DTODeleteDocumentationPageInputV2, DTODeleteDocumentationTabGroupInput, DTODesignElementsDataDiffResponse, DTODocumentationLinkPreviewRequest, DTODocumentationPageAnchor, DTODocumentationPageApprovalStateChangeInput, DTODuplicateDocumentationGroupInput, DTODuplicateDocumentationPageInputV2, DTOFigmaNode, // TODO? DTODeleteDocumentationTabGroupInput,
2
2
  DTOFigmaNodeRenderInput, DTOMoveDocumentationGroupInput, DTOMoveDocumentationPageInputV2, DTOPublishDocumentationRequest, DTORestoreDocumentationGroupInput, DTORestoreDocumentationPageInput, DTOUpdateDocumentationGroupInput, DTOUpdateDocumentationPageInputV2 } from "@supernova-studio/client";
3
+ import { DesignSystemInvite, DesignSystemPendingMemberInvite, DesignSystemUserInvitation } from "@supernova-studio/model";
3
4
  import { DesignSystemAccessMode, DocsBlockDefinition, ExportBuildStatus, ResourceFont, TokenThemeOverrideTranserObject } from "../../exports";
4
5
  import { Acl } from "../../model/acl/SDKAcl";
5
6
  import { Asset } from "../../model/assets/SDKAsset";
6
7
  import { RenderedAsset } from "../../model/assets/SDKRenderedAsset";
8
+ import { BootstrapData } from "../../model/base/SDKBootstrapData";
7
9
  import { Brand, BrandUpdateModel } from "../../model/base/SDKBrand";
8
10
  import { DesignSystem, DesignSystemSwitcher } from "../../model/base/SDKDesignSystem";
9
11
  import { DesignSystemMemberList } from "../../model/base/SDKDesignSystemMemberList";
@@ -85,6 +87,7 @@ export declare class DataCore {
85
87
  getBridgeInternal(): DataBridge;
86
88
  fetch(url: RequestInfo, init?: RequestInit): Promise<Response>;
87
89
  dataThroughCorsProxy(urlToRalay: string): Promise<ArrayBuffer | undefined>;
90
+ bootstrapData(preferredWorkspaceId?: string, preferredDesignSystemId?: string, preferredVersionId?: string, preferredBrandId?: string): Promise<BootstrapData>;
88
91
  /** Remote: Get single-use multiplayer token */
89
92
  multiplayerToken(room: string | undefined): Promise<{
90
93
  token: string;
@@ -186,8 +189,10 @@ export declare class DataCore {
186
189
  createDocumentationPage(designSystemId: string, versionId: string, payload: Omit<DTOCreateDocumentationPageInputV2, "persistentId">): Promise<string>;
187
190
  /** Update page approval state */
188
191
  updateApprovalState(designSystemId: string, versionId: string, payload: DTODocumentationPageApprovalStateChangeInput): Promise<string>;
192
+ /** Update design system's access mode and, if switching to invite-only, also the member list */
193
+ updateDesignSystemAccessModeAndMemberList(designSystemId: string, accessMode: DesignSystemAccessMode, retainUserIds: Array<string>, retainInviteIds: Array<string>): Promise<void>;
189
194
  /** Update design system's member list */
190
- updateDesignSystemMemberList(designSystemId: string, inviteUserIds: Array<string>, removeUserIds: Array<string>): Promise<void>;
195
+ updateDesignSystemMemberList(designSystemId: string, usersToInvite?: Array<DesignSystemUserInvitation>, invitesToInvite?: Array<DesignSystemPendingMemberInvite>, emailsToInvite?: Array<DesignSystemInvite>, deleteInvitationIds?: Array<string>, removeUserIds?: Array<string>): Promise<void>;
191
196
  /** Create a group within documentation */
192
197
  createDocumentationGroup(designSystemId: string, versionId: string, payload: Omit<DTOCreateDocumentationGroupInput, "persistentId">): Promise<string>;
193
198
  /** Create a tab group within documentation */
@@ -461,7 +466,7 @@ export declare class DataCore {
461
466
  /** Download information about design systems that user has access to under a single workspace and retrieve it resolved */
462
467
  designSystems(workspaceId: any): Promise<Array<DesignSystem>>;
463
468
  /** Creates a design system */
464
- createDesignSystem(workspaceId: string, name: string, description?: string, accessMode?: DesignSystemAccessMode): Promise<DesignSystem>;
469
+ createDesignSystem(workspaceId: string, name: string, description?: string, accessMode?: DesignSystemAccessMode, usersToInvite?: Array<DesignSystemUserInvitation>, invitesToInvite?: Array<DesignSystemPendingMemberInvite>, emailsToInvite?: Array<DesignSystemInvite>): Promise<DesignSystem>;
465
470
  getBlockDefinitions(designSystemId: string, versionId: string): Promise<Array<DocsBlockDefinition>>;
466
471
  getUrlPreview(designSystemId: string, versionId: string, request: DTODocumentationLinkPreviewRequest): Promise<{
467
472
  linkPreview: {
@@ -1,5 +1,6 @@
1
1
  import { DTODesignElementsDataDiffResponse, DTODesignSystem, DTODesignSystemMemberListResponse, DTODocumentationLinkPreviewRequest, DTOFigmaNode, DTOGetDocumentationPageAnchorsResponse, DTOPipeline } from "@supernova-studio/client";
2
2
  import { AclRemoteModel } from "../../../model/acl/SDKAcl";
3
+ import { BootstrapDataRemoteModel } from "../../../model/base/SDKBootstrapData";
3
4
  import { BrandRemoteModel } from "../../../model/base/SDKBrand";
4
5
  import { DesignSystemVersionCreationJobRemoteModel, DesignSystemVersionRemoteModel } from "../../../model/base/SDKDesignSystemVersion";
5
6
  import { DocumentationLegacyModel } from "../../../model/base/SDKDocumentationLegacy";
@@ -54,6 +55,7 @@ export declare class DataCoreReadRequests {
54
55
  private bridge;
55
56
  constructor(bridge: DataBridge);
56
57
  getDataThroughCorsProxy(url: string): Promise<ArrayBuffer | undefined>;
58
+ getRemoteBootstrapData(preferredWorkspaceId?: string, preferredDesignSystemId?: string, preferredVersionId?: string, preferredBrandId?: string): Promise<BootstrapDataRemoteModel>;
57
59
  /** Remote: Get information about currently logged in user */
58
60
  getRemoteMultiplayerToken(room: string | undefined): Promise<{
59
61
  token: string;
@@ -1,4 +1,5 @@
1
1
  import { DTOCreateDocumentationGroupInput, DTOCreateDocumentationPageInputV2, DTOCreateDocumentationTabInput, DTODeleteDocumentationGroupInput, DTODeleteDocumentationPageInputV2, DTODeleteDocumentationTabGroupInput, DTODesignSystem, DTODocumentationPageApprovalStateChangeInput, DTODuplicateDocumentationGroupInput, DTODuplicateDocumentationPageInputV2, DTOFigmaNode, DTOFigmaNodeRenderInput, DTOMoveDocumentationGroupInput, DTOMoveDocumentationPageInputV2, DTOPublishDocumentationRequest, DTORestoreDocumentationGroupInput, DTORestoreDocumentationPageInput, DTOUpdateDocumentationGroupInput, DTOUpdateDocumentationPageInputV2 } from "@supernova-studio/client";
2
+ import { DesignSystemInvite, DesignSystemPendingMemberInvite, DesignSystemUserInvitation } from "@supernova-studio/model";
2
3
  import { DesignSystemAccessMode, TokenThemeOverrideTranserObject } from "../../../exports";
3
4
  import { Brand, BrandRemoteModel, BrandUpdateModel } from "../../../model/base/SDKBrand";
4
5
  import { DesignSystem, DesignSystemSwitcher } from "../../../model/base/SDKDesignSystem";
@@ -116,7 +117,7 @@ export declare class DataCoreWriteRequests {
116
117
  /** Remote: Restore the cancelled subscription */
117
118
  restoreRemoteWorkspaceSubscription(workspaceId: string): Promise<void>;
118
119
  /** Remote: Creates a new design system */
119
- createRemoteDesignSystem(workspaceId: string, name: string, description?: string, accessMode?: DesignSystemAccessMode): Promise<DTODesignSystem>;
120
+ createRemoteDesignSystem(workspaceId: string, name: string, description?: string, accessMode?: DesignSystemAccessMode, usersToInvite?: Array<DesignSystemUserInvitation>, invitesToInvite?: Array<DesignSystemPendingMemberInvite>, emailsToInvite?: Array<DesignSystemInvite>): Promise<DTODesignSystem>;
120
121
  /** Remote: Updates a design system metadata */
121
122
  updateRemoteDesignSystemMetadata(designSystemId: string, name: string, description?: string): Promise<void>;
122
123
  /** Remote: Updates a design system multibrand capabilities */
@@ -134,10 +135,12 @@ export declare class DataCoreWriteRequests {
134
135
  updateRemoteDocumentationStructure(designSystemId: string, versionId: string, model: DocumentationLegacyModel): Promise<void>;
135
136
  /** Remote: Updates a design system documentation slug */
136
137
  updateRemoteDesignSystemDocumentationSlug(designSystem: DesignSystem, docUserSlug: string): Promise<void>;
138
+ /** Remote: Updates a design system's access mode and, if switching to invite-only, also the member list */
139
+ updateRemoteDesignSystemAccessModeAndMemberList(designSystemId: string, accessMode: DesignSystemAccessMode, retainUserIds: Array<string>, retainInviteIds: Array<string>): Promise<void>;
140
+ /** Remote: Updates a design system's member list */
141
+ updateRemoteDesignSystemMemberList(designSystemId: string, usersToInvite?: Array<DesignSystemUserInvitation>, invitesToInvite?: Array<DesignSystemPendingMemberInvite>, emailsToInvite?: Array<DesignSystemInvite>, deleteInvitationIds?: Array<string>, removeUserIds?: Array<string>): Promise<void>;
137
142
  /** Remote: Deletes a design system */
138
143
  deleteDesignSystem(designSystemId: string): Promise<void>;
139
- /** Remote: Updates a design system's member list */
140
- updateRemoteDesignSystemMemberList(designSystemId: string, inviteUserIds: Array<string>, removeUserIds: Array<string>): Promise<void>;
141
144
  private elementAction;
142
145
  createRemoteDocumentationPage(designSystemId: string, versionId: string, data: DTOCreateDocumentationPageInputV2): Promise<any>;
143
146
  updateApprovalState(designSystemId: string, versionId: string, data: DTODocumentationPageApprovalStateChangeInput): Promise<any>;
@@ -37,6 +37,8 @@ export type { ElementPropertyOptionBadgeColor } from "./model/elements/SDKElemen
37
37
  export type { ElementDataView } from "./model/elements/SDKElementDataView";
38
38
  export type { ElementDataViewColumn } from "./model/elements/SDKElementDataViewColumn";
39
39
  export type { DesignComponent } from "./model/components/SDKDesignComponent";
40
+ export type { DesignComponentVariant } from "./model/components/SDKDesignComponentVariant";
41
+ export type { DesignComponentPropertyBoolean, DesignComponentPropertyDefinition, DesignComponentPropertyInstanceSwap, DesignComponentPropertyText, DesignComponentPropertyVariant, DesignComponentPropertyType, } from "./model/components/SDKDesignComponentPropertyDefinition";
40
42
  export type { DocsBlockBehavior } from "./model/docs/blocks/definition/SDKDocsBlockBehavior";
41
43
  export type { DocsBlockDefinition } from "./model/docs/blocks/definition/SDKDocsBlockDefinition";
42
44
  export type { DocsBlockItemDefinition } from "./model/docs/blocks/definition/SDKDocsBlockItemDefinition";
@@ -56,6 +56,8 @@ export type { ElementPropertyOptionBadgeColor } from "./model/elements/SDKElemen
56
56
  export { ElementDataView } from "./model/elements/SDKElementDataView";
57
57
  export { ElementDataViewColumn, ElementDataViewColumnBasePropertyType, ElementDataViewColumnType, } from "./model/elements/SDKElementDataViewColumn";
58
58
  export { DesignComponent } from "./model/components/SDKDesignComponent";
59
+ export { DesignComponentVariant } from "./model/components/SDKDesignComponentVariant";
60
+ export { DesignComponentPropertyBoolean, DesignComponentPropertyDefinition, DesignComponentPropertyInstanceSwap, DesignComponentPropertyText, DesignComponentPropertyVariant, DesignComponentPropertyType, } from "./model/components/SDKDesignComponentPropertyDefinition";
59
61
  export { DocsBlockBehavior } from "./model/docs/blocks/definition/SDKDocsBlockBehavior";
60
62
  export { DocsBlockDefinition } from "./model/docs/blocks/definition/SDKDocsBlockDefinition";
61
63
  export { DocsBlockItemDefinition } from "./model/docs/blocks/definition/SDKDocsBlockItemDefinition";
@@ -7,7 +7,7 @@ export declare class Asset {
7
7
  thumbnailUrl: string | null;
8
8
  svgUrl: string | null;
9
9
  name: string;
10
- description: string;
10
+ description: string | null;
11
11
  componentId: string | null;
12
12
  previouslyDuplicatedNames: number;
13
13
  origin: DesignComponentOrigin | null;
@@ -0,0 +1,23 @@
1
+ import { DTODesignSystem } from "@supernova-studio/client";
2
+ import { Membership, MembershipRemoteModel } from "../membership/SDKMembership";
3
+ import { Brand, BrandRemoteModel } from "./SDKBrand";
4
+ import { DesignSystem } from "./SDKDesignSystem";
5
+ import { DesignSystemVersion, DesignSystemVersionRemoteModel } from "./SDKDesignSystemVersion";
6
+ export type BootstrapDataRemoteModel = {
7
+ id: string;
8
+ workspaceMembership: MembershipRemoteModel;
9
+ designSystem: DTODesignSystem;
10
+ version: DesignSystemVersionRemoteModel;
11
+ brand: BrandRemoteModel;
12
+ };
13
+ export declare class BootstrapData {
14
+ /** Workspace membership available to the current user */
15
+ workspaceMembership: Membership | null;
16
+ /** Design system available to the current user */
17
+ designSystem: DesignSystem | null;
18
+ /** Design system version available to the current user */
19
+ version: DesignSystemVersion | null;
20
+ /** Brand available to the current user */
21
+ brand: Brand | null;
22
+ constructor(model: BootstrapDataRemoteModel);
23
+ }
@@ -1,4 +1,5 @@
1
1
  import { DTODesignSystem } from "@supernova-studio/client";
2
+ import { UserRole } from "../enums/SDKUserRole";
2
3
  export type DesignSystemSwitcher = {
3
4
  isEnabled: boolean;
4
5
  designSystemIds: Array<string>;
@@ -30,10 +31,16 @@ export declare class DesignSystem {
30
31
  documentationUserSlug: string | null;
31
32
  /** Binding multiple design systems together */
32
33
  designSystemSwitcher: DesignSystemSwitcher;
34
+ /** Access mode of the design system */
33
35
  accessMode: DesignSystemAccessMode;
36
+ /** Effective role of the user in the design system.
37
+ * Is `null` when the user doesn't have access to the design system, but can know about its existence (e.g. Owners). */
38
+ effectiveRole: UserRole | null;
34
39
  constructor(model: DTODesignSystem);
35
40
  /** Constructs representation that can be used to transport the instantiated object as JSON, for example for SSR <> Client use-cases. Reconstruct to class instance using `fromTransport` */
36
41
  toTransport(): DesignSystemTransportModel;
37
42
  /** Reconstructs class from the transport model */
38
43
  static fromTransport(model: DesignSystemTransportModel): DesignSystem;
44
+ /** Returns true if the design system is available to the current user */
45
+ get isAvailableToUser(): boolean;
39
46
  }
@@ -1,9 +1,15 @@
1
1
  import { DTODesignSystemMemberListResponse } from "@supernova-studio/client";
2
- export type DesignSystemMembership = {
2
+ export type DesignSystemUser = {
3
3
  userId: string;
4
4
  };
5
+ export type DesignSystemInvitation = {
6
+ id: string;
7
+ workspaceInvitationId: string;
8
+ };
5
9
  export declare class DesignSystemMemberList {
6
- /** List of members that belong to the design system */
7
- members: Array<DesignSystemMembership>;
10
+ /** List of existing users that belong to the design system */
11
+ users: Array<DesignSystemUser>;
12
+ /** List of invitations that belong to the design system */
13
+ invitations: Array<DesignSystemInvitation>;
8
14
  constructor(model: DTODesignSystemMemberListResponse);
9
15
  }
@@ -1,34 +1,12 @@
1
- import { DesignComponentOrigin, DesignComponentOriginModel } from "../support/SDKDesignComponentOrigin";
1
+ import { DTOFigmaComponent } from "@supernova-studio/client";
2
2
  import { Source } from "../support/SDKSource";
3
- export type DesignComponentRemoteModel = {
4
- id: string;
5
- persistentId: string;
6
- designSystemVersionId: string;
7
- brandId: string;
8
- thumbnailUrl?: string;
9
- svgUrl?: string;
10
- exportProperties: {
11
- isAsset: boolean;
12
- };
13
- meta: {
14
- name: string;
15
- description: string;
16
- };
17
- originComponent?: DesignComponentOriginModel;
18
- properties: Array<any>;
19
- rootNode?: any;
20
- createdAt?: string;
21
- updatedAt?: string;
22
- };
23
- export declare class DesignComponent {
24
- id: string;
25
- brandId: string;
26
- thumbnailUrl: string | null;
27
- svgUrl: string | null;
28
- name: string;
29
- description: string;
30
- origin: DesignComponentOrigin | null;
31
- createdAt: Date | null;
32
- updatedAt: Date | null;
3
+ import { DesignComponentBase } from "./SDKDesignComponentBase";
4
+ import { DesignComponentPropertyDefinition } from "./SDKDesignComponentPropertyDefinition";
5
+ import { DesignComponentVariant } from "./SDKDesignComponentVariant";
6
+ export type DesignComponentRemoteModel = DTOFigmaComponent;
7
+ export declare class DesignComponent extends DesignComponentBase {
8
+ componentPropertyDefinitions: DesignComponentPropertyDefinition[] | null;
9
+ childrenPersistentIds: Array<string> | null;
10
+ children: Array<DesignComponentVariant> | null;
33
11
  constructor(model: DesignComponentRemoteModel, sources: Array<Source>);
34
12
  }
@@ -0,0 +1,15 @@
1
+ import { DTOFigmaComponent } from "@supernova-studio/client";
2
+ import { DesignComponentOrigin } from "../support/SDKDesignComponentOrigin";
3
+ import { Source } from "../support/SDKSource";
4
+ export declare abstract class DesignComponentBase {
5
+ id: string;
6
+ brandId: string;
7
+ thumbnailUrl: string | null;
8
+ svgUrl: string | null;
9
+ name: string;
10
+ description: string | null;
11
+ origin: DesignComponentOrigin | null;
12
+ createdAt: Date | null;
13
+ updatedAt: Date | null;
14
+ constructor(model: DTOFigmaComponent, sources: Array<Source>);
15
+ }
@@ -0,0 +1,38 @@
1
+ import { DTOFigmaComponent, DTOFigmaComponentBooleanProperty, DTOFigmaComponentInstanceSwapProperty, DTOFigmaComponentTextProperty, DTOFigmaComponentVariantProperty } from "@supernova-studio/client";
2
+ export declare enum DesignComponentPropertyType {
3
+ Boolean = "Boolean",
4
+ InstanceSwap = "InstanceSwap",
5
+ Text = "Text",
6
+ Variant = "Variant"
7
+ }
8
+ type DesignComponentPropertyDefinitionRemoteType = NonNullable<DTOFigmaComponent["componentPropertyDefinitions"]>[string];
9
+ export declare abstract class DesignComponentPropertyDefinition {
10
+ id: string;
11
+ abstract type: DesignComponentPropertyType;
12
+ abstract defaultValue: string | boolean;
13
+ name: string;
14
+ constructor(model: DesignComponentPropertyDefinitionRemoteType);
15
+ }
16
+ export declare class DesignComponentPropertyBoolean extends DesignComponentPropertyDefinition {
17
+ type: DesignComponentPropertyType.Boolean;
18
+ defaultValue: boolean;
19
+ constructor(model: DTOFigmaComponentBooleanProperty);
20
+ }
21
+ export declare class DesignComponentPropertyText extends DesignComponentPropertyDefinition {
22
+ type: DesignComponentPropertyType.Text;
23
+ defaultValue: string;
24
+ constructor(model: DTOFigmaComponentTextProperty);
25
+ }
26
+ export declare class DesignComponentPropertyInstanceSwap extends DesignComponentPropertyDefinition {
27
+ type: DesignComponentPropertyType.InstanceSwap;
28
+ defaultValue: string;
29
+ constructor(model: DTOFigmaComponentInstanceSwapProperty);
30
+ }
31
+ export declare class DesignComponentPropertyVariant extends DesignComponentPropertyDefinition {
32
+ type: DesignComponentPropertyType.Variant;
33
+ defaultValue: string;
34
+ options: string[];
35
+ constructor(model: DTOFigmaComponentVariantProperty);
36
+ }
37
+ export declare function resolveComponentPropertyDefinition(model?: DTOFigmaComponent["componentPropertyDefinitions"]): DesignComponentPropertyDefinition[];
38
+ export {};
@@ -0,0 +1,9 @@
1
+ import { DTOFigmaComponent } from "@supernova-studio/client";
2
+ import { Source } from "../support/SDKSource";
3
+ import { DesignComponentBase } from "./SDKDesignComponentBase";
4
+ export type DesignComponentRemoteModel = DTOFigmaComponent;
5
+ export declare class DesignComponentVariant extends DesignComponentBase {
6
+ variantPropertyValues: Record<string, string> | null;
7
+ parentComponentPersistentId: string | null;
8
+ constructor(model: DesignComponentRemoteModel, sources: Array<Source>);
9
+ }
@@ -1,6 +1,5 @@
1
1
  import { DocsBlockContainerSize } from "../../../enums/SDKDocsBlockContainerSize";
2
2
  import { DocsBlockItemPropertyType } from "../../../enums/SDKDocsBlockItemPropertyType";
3
- import { DocsColorRef } from "../support/SDKDocsColorRef";
4
3
  import { DocsBlockPropertyData, DocsBlockPropertyDefinition, DocsBlockPropertyDefinitionModel } from "./SDKDocsBlockProperty";
5
4
  /** Figma Component property - Additional non-value options */
6
5
  export type DocsBlockFigmaComponentPropertyOptions = {
@@ -17,9 +16,6 @@ export type DocsBlockFigmaComponentPropertyData = DocsBlockPropertyData<Array<{
17
16
  entityId: string;
18
17
  entityType: "FigmaComponent";
19
18
  entityMeta?: {
20
- title?: string;
21
- description?: string;
22
- backgroundColor?: DocsColorRef | null;
23
19
  selectedComponentProperties?: Array<string>;
24
20
  };
25
21
  }>> & {
@@ -44,6 +44,6 @@ export type ReplacableTokenType = (typeof REPLACABLE_TOKEN_TYPES)[number];
44
44
  export declare const REFERENCABLE_TOKEN_TYPES: readonly [TokenType.color, TokenType.dimension, TokenType.size, TokenType.space, TokenType.opacity, TokenType.fontSize, TokenType.lineHeight, TokenType.letterSpacing, TokenType.paragraphSpacing, TokenType.borderWidth, TokenType.radius, TokenType.duration, TokenType.zIndex, TokenType.fontFamily, TokenType.fontWeight, TokenType.textCase, TokenType.textDecoration];
45
45
  export type ReferencableTokenType = (typeof REFERENCABLE_TOKEN_TYPES)[number];
46
46
  export declare const tokenTypeIsReferencable: (tokenType: TokenType) => tokenType is TokenType.color | TokenType.radius | TokenType.borderWidth | TokenType.duration | TokenType.fontSize | TokenType.dimension | TokenType.letterSpacing | TokenType.lineHeight | TokenType.opacity | TokenType.paragraphSpacing | TokenType.size | TokenType.space | TokenType.zIndex | TokenType.textDecoration | TokenType.textCase | TokenType.fontFamily | TokenType.fontWeight;
47
- export declare const DT_TOKEN_TYPES: readonly [TokenType.color, TokenType.shadow, TokenType.gradient, TokenType.typography, TokenType.border, TokenType.dimension, TokenType.size, TokenType.space, TokenType.opacity, TokenType.fontSize, TokenType.lineHeight, TokenType.letterSpacing, TokenType.paragraphSpacing, TokenType.borderWidth, TokenType.radius, TokenType.duration, TokenType.zIndex, TokenType.fontFamily, TokenType.fontWeight, TokenType.textCase, TokenType.textDecoration, TokenType.visibility];
47
+ export declare const DT_TOKEN_TYPES: readonly [TokenType.color, TokenType.shadow, TokenType.gradient, TokenType.typography, TokenType.border, TokenType.dimension, TokenType.size, TokenType.space, TokenType.opacity, TokenType.fontSize, TokenType.lineHeight, TokenType.letterSpacing, TokenType.paragraphSpacing, TokenType.borderWidth, TokenType.radius, TokenType.duration, TokenType.zIndex, TokenType.fontFamily, TokenType.fontWeight, TokenType.string, TokenType.textCase, TokenType.textDecoration, TokenType.visibility];
48
48
  export type DTTokenType = (typeof DT_TOKEN_TYPES)[number];
49
- export type DTOriginalTokenType = "color" | "borderRadius" | "boxShadow" | "gradient" | "typography" | "border" | "borderWidth" | "sizing" | "opacity" | "spacing" | "fontSizes" | "paragraphSpacing" | "letterSpacing" | "lineHeights" | "other" | "dimension" | "fontFamilies" | "fontWeights" | "textCase" | "textDecoration" | "duration";
49
+ export type DTOriginalTokenType = "color" | "borderRadius" | "boxShadow" | "gradient" | "typography" | "border" | "borderWidth" | "sizing" | "opacity" | "spacing" | "fontSizes" | "paragraphSpacing" | "letterSpacing" | "lineHeights" | "other" | "text" | "dimension" | "fontFamilies" | "fontWeights" | "textCase" | "textDecoration" | "duration";
@@ -1,3 +1,4 @@
1
+ import { WorkspaceRole } from "@supernova-studio/model";
1
2
  export declare enum UserRole {
2
3
  owner = "Owner",
3
4
  admin = "Admin",
@@ -6,4 +7,5 @@ export declare enum UserRole {
6
7
  billing = "Billing",
7
8
  viewer = "Viewer"
8
9
  }
10
+ export declare const convertRemoteToUserRole: (remoteRole: WorkspaceRole) => UserRole;
9
11
  export type UserRoleWithoutOwner = Exclude<UserRole, UserRole.owner>;
@@ -36,6 +36,7 @@ export type NewPipelinePayloadDestination = "Github" | "Gitlab" | "Bitbucket" |
36
36
  export type NewPipelinePayload = {
37
37
  brandPersistentId?: string;
38
38
  themePersistentIds?: string[];
39
+ themePersistentId?: string;
39
40
  designSystemId: string;
40
41
  destinations: {
41
42
  azure: AzureDestinationPayload | null;
@@ -98,6 +99,8 @@ export declare class Pipeline {
98
99
  };
99
100
  brandPersistentId?: string;
100
101
  themePersistentIds?: string[];
102
+ /** @deprecated Use themePersistentIds instead */
103
+ themePersistentId?: string;
101
104
  latestJobs: Array<ExportBuild>;
102
105
  constructor(data: DTOPipeline);
103
106
  get isBuildOnly(): boolean;
@@ -1,13 +1,7 @@
1
+ import { DTOFigmaComponent } from "@supernova-studio/client";
1
2
  import { SourceType } from "../enums/SDKSourceType";
2
3
  import { Source } from "./SDKSource";
3
- export type DesignComponentOriginModel = {
4
- id: string;
5
- sourceId: string;
6
- nodeId: string;
7
- name?: string;
8
- width?: number;
9
- height?: number;
10
- };
4
+ export type DesignComponentOriginModel = NonNullable<DTOFigmaComponent["originComponent"]>;
11
5
  export declare class DesignComponentOrigin {
12
6
  sourceType: SourceType;
13
7
  sourceId: string | null;
@@ -47,9 +47,9 @@ export declare class TokenTheme {
47
47
  value: import("../tokens/remote/SDKRemoteTokenValue").AnyDimensionTokenRemoteValue;
48
48
  } | {
49
49
  aliasTo: string | undefined;
50
- value: import("../tokens/remote/SDKRemoteTokenValue").TypographyTokenRemoteValue;
50
+ value: string;
51
51
  } | {
52
52
  aliasTo: string | undefined;
53
- value: string;
53
+ value: import("../tokens/remote/SDKRemoteTokenValue").TypographyTokenRemoteValue;
54
54
  };
55
55
  }
@@ -38,9 +38,9 @@ export declare class TokenThemeOverride {
38
38
  value: import("../tokens/remote/SDKRemoteTokenValue").AnyDimensionTokenRemoteValue;
39
39
  } | {
40
40
  aliasTo: string | undefined;
41
- value: import("../tokens/remote/SDKRemoteTokenValue").TypographyTokenRemoteValue;
41
+ value: string;
42
42
  } | {
43
43
  aliasTo: string | undefined;
44
- value: string;
44
+ value: import("../tokens/remote/SDKRemoteTokenValue").TypographyTokenRemoteValue;
45
45
  };
46
46
  }
@@ -1,7 +1,9 @@
1
+ import { AnyStringToken } from "../model/tokens/SDKStringToken";
1
2
  import { BorderPosition, ColorToken, ShadowType, TextCase, TextDecoration, Unit } from "../index";
2
3
  import { BorderStyle } from "../model/enums/SDKBorderStyle";
3
4
  import { StringTokenType } from "../model/enums/SDKTokenType";
4
5
  import { Token } from "../model/tokens/SDKToken";
6
+ import { AnyToken } from "../model/tokens/SDKTokenValue";
5
7
  export declare const validateToken: (t: any, tokens: Token[], name: string, hex: string, opacity?: number, aliasName?: string) => void;
6
8
  export declare const validateDimensionToken: (t: any, tokens: Token[], name: string, measure: number, unit: Unit) => void;
7
9
  export declare const validateStringToken: (t: any, tokens: Token[], name: string, text: string, type: StringTokenType) => void;
@@ -84,3 +86,5 @@ export declare const validateDimensionTokenRef: (t: any, tokens: Token[], descri
84
86
  export declare const validateBorderTokenRef: (t: any, tokens: Token[], description: string, refName: string, hex: string, position: BorderPosition, style: BorderStyle, measure: number, unit: Unit) => void;
85
87
  export declare const validateBorderTokenInnerRef: (t: any, tokens: Token[], name: string, hex: string, position: BorderPosition, style: BorderStyle, measure: number, unit: Unit) => void;
86
88
  export declare const validateOrigin: (t: any, tokens: Token[], name: string, nameRef: string) => void;
89
+ export declare const isStringToken: (token?: Token | AnyToken | undefined | null) => token is AnyStringToken;
90
+ export declare const getExpectedByDescription: (description: string) => string | undefined;
@@ -62,7 +62,7 @@ export declare class TokenJSONElementTransformer {
62
62
  safeGroupName(group: TokenGroup): string;
63
63
  processedName(name: string, naming: JSONBuilderNamingOption): string;
64
64
  /** Retrieve human-readable token type in unified fashion, used both as token type and as token master group */
65
- typeLabel(type: TokenType): "visibility" | "color" | "gradient" | "typography" | "border" | "textCase" | "textDecoration" | "text" | "shadow" | "measure" | undefined;
65
+ typeLabel(type: TokenType): "visibility" | "color" | "gradient" | "typography" | "border" | "text" | "textCase" | "textDecoration" | "shadow" | "measure" | undefined;
66
66
  /** Retrieve chain of groups up to a specified group, ordered from parent to children */
67
67
  referenceGroupChain(containingGroup: TokenGroup, allGroups: Array<TokenGroup>): Array<TokenGroup>;
68
68
  }