@supernova-studio/supernova-sdk-beta 2.4.9 → 2.4.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/build/supernova-sdk-typescript.js +1 -1
- package/build/supernova-sdk-typescript.js.map +1 -1
- package/build/types/core/areas/SDKAreaBulkOperations.d.ts +72 -72
- package/build/types/core/areas/SDKAreaDesignSystems.d.ts +13 -13
- package/build/types/core/areas/SDKAreaDocumentation.d.ts +288 -288
- package/build/types/core/areas/SDKAreaMCP.d.ts +8 -1
- package/build/types/core/areas/SDKAreaProjects.d.ts +1091 -1091
- package/build/types/core/areas/SDKAreaRawData.d.ts +1046 -1046
- package/build/types/core/areas/SDKAreaResources.d.ts +90 -90
- package/build/types/core/areas/SDKAreaSanboxes.d.ts +9 -9
- package/build/types/core/areas/SDKAreaThreads.d.ts +67 -67
- package/build/types/core/areas/SDKAreaWorkspaces.d.ts +1 -1
- package/build/types/core/data/SDKDataCore.d.ts +1735 -1732
- package/build/types/core/data/requests/SDKDataCoreReadRequests.d.ts +628 -601
- package/build/types/core/data/requests/SDKDataCoreWriteRequests.d.ts +2494 -2495
- package/build/types/core/resolvers/SDKDocsEntityItemResolver.d.ts +121 -121
- package/build/types/exports.d.ts +1 -0
- package/build/types/model/activity-events/SDKActivityEvent.d.ts +3 -0
- package/build/types/model/agent-chats/SDKAgentChat.d.ts +3 -0
- package/build/types/model/base/SDKDesignSystem.d.ts +3 -1
- package/build/types/model/docs/blocks/properties/SDKDocsBlockContextProperty.d.ts +1 -1
- package/build/types/model/exporters/SDKPipeline.d.ts +1 -1
- package/build/types/tools/design-tokens/utilities/SDKDTJSONConverter.d.ts +29 -3
- package/build/types/tools/design-tokens/utilities/SDKDTJSONLoader.d.ts +2 -0
- package/build/types/tools/design-tokens/utilities/SDKDTMapLoader.d.ts +31 -0
- package/build/types/tools/design-tokens/utilities/SDKDTTokenReferenceResolver.d.ts +2 -0
- package/build/types/tools/design-tokens/utilities/unresolvable-modes/index.d.ts +4 -0
- package/build/types/tools/design-tokens/utilities/unresolvable-modes/lenient-resolve.d.ts +2 -0
- package/build/types/tools/design-tokens/utilities/unresolvable-modes/placeholder.d.ts +2 -0
- package/build/types/tools/design-tokens/utilities/unresolvable-modes/preserve.d.ts +2 -0
- package/build/types/tools/design-tokens/utilities/unresolvable-modes/strict.d.ts +2 -0
- package/build/types/tools/design-tokens/utilities/unresolvable-modes/types.d.ts +33 -0
- package/package.json +1 -1
|
@@ -3,208 +3,208 @@ import { DocsEntityGroup } from "../../model/docs/entities/SDKDocsEntityGroup";
|
|
|
3
3
|
import { DocsEntityPage } from "../../model/docs/entities/SDKDocsEntityPage";
|
|
4
4
|
export declare class DocsEntityItemResolver {
|
|
5
5
|
hashedItems: Map<string, {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
id: string;
|
|
7
|
+
designSystemVersionId: string;
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
updatedAt: Date;
|
|
10
|
+
persistentId: string;
|
|
11
|
+
title: string;
|
|
12
|
+
isRoot: boolean;
|
|
13
|
+
childrenIds: string[];
|
|
14
|
+
groupBehavior: "Group" | "Tabs";
|
|
15
|
+
shortPersistentId: string;
|
|
16
|
+
configuration: {
|
|
17
|
+
showSidebar: boolean;
|
|
18
|
+
isPrivate: boolean;
|
|
19
|
+
isHidden: boolean;
|
|
20
|
+
header: {
|
|
21
|
+
description: string;
|
|
22
|
+
alignment: "Left" | "Center";
|
|
23
|
+
backgroundImageScaleType: "AspectFill" | "AspectFit";
|
|
24
|
+
showBackgroundOverlay: boolean;
|
|
25
|
+
showCoverText: boolean;
|
|
21
26
|
foregroundColor?: {
|
|
22
|
-
value
|
|
27
|
+
value: string;
|
|
23
28
|
referencedTokenId?: string;
|
|
24
29
|
};
|
|
25
30
|
backgroundColor?: {
|
|
26
|
-
value
|
|
31
|
+
value: string;
|
|
27
32
|
referencedTokenId?: string;
|
|
28
33
|
};
|
|
29
34
|
backgroundImageAsset?: {
|
|
30
|
-
type
|
|
35
|
+
type: "Resource" | "FigmaNode";
|
|
31
36
|
resource?: {
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
resourceId: string;
|
|
38
|
+
url: string;
|
|
34
39
|
};
|
|
35
40
|
figmaNode?: {
|
|
36
|
-
sourceId
|
|
37
|
-
frameReferenceId
|
|
41
|
+
sourceId: string;
|
|
42
|
+
frameReferenceId: string;
|
|
38
43
|
};
|
|
39
44
|
};
|
|
40
|
-
backgroundImageScaleType?: "AspectFill" | "AspectFit";
|
|
41
|
-
showBackgroundOverlay?: boolean;
|
|
42
|
-
showCoverText?: boolean;
|
|
43
45
|
minHeight?: number;
|
|
44
46
|
};
|
|
45
47
|
};
|
|
46
|
-
|
|
48
|
+
type: "Group";
|
|
47
49
|
slug?: string;
|
|
48
50
|
userSlug?: string;
|
|
51
|
+
publishMetadata?: {
|
|
52
|
+
lastPublishedByUserId: string;
|
|
53
|
+
lastPublishedAt: Date;
|
|
54
|
+
};
|
|
55
|
+
approvalState?: {
|
|
56
|
+
persistentId: string;
|
|
57
|
+
groupPersistentId: string;
|
|
58
|
+
designSystemVersionId: string;
|
|
59
|
+
approvalState: "ReadyForReview" | "ChangesRequested" | "Approved";
|
|
60
|
+
};
|
|
49
61
|
draftState?: {
|
|
50
|
-
changeType
|
|
62
|
+
changeType: "Created";
|
|
51
63
|
} | {
|
|
52
|
-
changeType
|
|
53
|
-
changes
|
|
64
|
+
changeType: "Updated";
|
|
65
|
+
changes: {
|
|
54
66
|
previousTitle?: string;
|
|
55
67
|
previousConfiguration?: {
|
|
56
|
-
showSidebar
|
|
57
|
-
isPrivate
|
|
58
|
-
isHidden
|
|
59
|
-
header
|
|
60
|
-
description
|
|
61
|
-
alignment
|
|
68
|
+
showSidebar: boolean;
|
|
69
|
+
isPrivate: boolean;
|
|
70
|
+
isHidden: boolean;
|
|
71
|
+
header: {
|
|
72
|
+
description: string;
|
|
73
|
+
alignment: "Left" | "Center";
|
|
74
|
+
backgroundImageScaleType: "AspectFill" | "AspectFit";
|
|
75
|
+
showBackgroundOverlay: boolean;
|
|
76
|
+
showCoverText: boolean;
|
|
62
77
|
foregroundColor?: {
|
|
63
|
-
value
|
|
78
|
+
value: string;
|
|
64
79
|
referencedTokenId?: string;
|
|
65
80
|
};
|
|
66
81
|
backgroundColor?: {
|
|
67
|
-
value
|
|
82
|
+
value: string;
|
|
68
83
|
referencedTokenId?: string;
|
|
69
84
|
};
|
|
70
85
|
backgroundImageAsset?: {
|
|
71
|
-
type
|
|
86
|
+
type: "Resource" | "FigmaNode";
|
|
72
87
|
resource?: {
|
|
73
|
-
|
|
74
|
-
|
|
88
|
+
resourceId: string;
|
|
89
|
+
url: string;
|
|
75
90
|
};
|
|
76
91
|
figmaNode?: {
|
|
77
|
-
sourceId
|
|
78
|
-
frameReferenceId
|
|
92
|
+
sourceId: string;
|
|
93
|
+
frameReferenceId: string;
|
|
79
94
|
};
|
|
80
95
|
};
|
|
81
|
-
backgroundImageScaleType?: "AspectFill" | "AspectFit";
|
|
82
|
-
showBackgroundOverlay?: boolean;
|
|
83
|
-
showCoverText?: boolean;
|
|
84
96
|
minHeight?: number;
|
|
85
97
|
};
|
|
86
98
|
};
|
|
87
99
|
previousContentHash?: string;
|
|
88
100
|
};
|
|
89
101
|
} | {
|
|
90
|
-
changeType
|
|
91
|
-
deletedAt
|
|
92
|
-
deletedByUserId
|
|
102
|
+
changeType: "Deleted";
|
|
103
|
+
deletedAt: Date;
|
|
104
|
+
deletedByUserId: string;
|
|
93
105
|
};
|
|
94
|
-
publishMetadata?: {
|
|
95
|
-
lastPublishedByUserId?: string;
|
|
96
|
-
lastPublishedAt?: Date;
|
|
97
|
-
};
|
|
98
|
-
approvalState?: {
|
|
99
|
-
designSystemVersionId?: string;
|
|
100
|
-
createdAt?: Date;
|
|
101
|
-
updatedAt?: Date;
|
|
102
|
-
approvalState?: "ReadyForReview" | "ChangesRequested" | "Approved";
|
|
103
|
-
pagePersistentId?: string;
|
|
104
|
-
updatedByUserId?: string;
|
|
105
|
-
};
|
|
106
|
-
liveblocksRoomId?: string;
|
|
107
106
|
} | {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
designSystemVersionId
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
107
|
+
id: string;
|
|
108
|
+
persistentId: string;
|
|
109
|
+
designSystemVersionId: string;
|
|
110
|
+
title: string;
|
|
111
|
+
configuration: {
|
|
112
|
+
showSidebar: boolean;
|
|
113
|
+
isPrivate: boolean;
|
|
114
|
+
isHidden: boolean;
|
|
115
|
+
header: {
|
|
116
|
+
description: string;
|
|
117
|
+
alignment: "Left" | "Center";
|
|
118
|
+
backgroundImageScaleType: "AspectFill" | "AspectFit";
|
|
119
|
+
showBackgroundOverlay: boolean;
|
|
120
|
+
showCoverText: boolean;
|
|
122
121
|
foregroundColor?: {
|
|
123
|
-
value
|
|
122
|
+
value: string;
|
|
124
123
|
referencedTokenId?: string;
|
|
125
124
|
};
|
|
126
125
|
backgroundColor?: {
|
|
127
|
-
value
|
|
126
|
+
value: string;
|
|
128
127
|
referencedTokenId?: string;
|
|
129
128
|
};
|
|
130
129
|
backgroundImageAsset?: {
|
|
131
|
-
type
|
|
130
|
+
type: "Resource" | "FigmaNode";
|
|
132
131
|
resource?: {
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
resourceId: string;
|
|
133
|
+
url: string;
|
|
135
134
|
};
|
|
136
135
|
figmaNode?: {
|
|
137
|
-
sourceId
|
|
138
|
-
frameReferenceId
|
|
136
|
+
sourceId: string;
|
|
137
|
+
frameReferenceId: string;
|
|
139
138
|
};
|
|
140
139
|
};
|
|
141
|
-
backgroundImageScaleType?: "AspectFill" | "AspectFit";
|
|
142
|
-
showBackgroundOverlay?: boolean;
|
|
143
|
-
showCoverText?: boolean;
|
|
144
140
|
minHeight?: number;
|
|
145
141
|
};
|
|
146
142
|
};
|
|
147
|
-
shortPersistentId
|
|
143
|
+
shortPersistentId: string;
|
|
144
|
+
createdAt: Date;
|
|
145
|
+
updatedAt: Date;
|
|
146
|
+
path: string;
|
|
147
|
+
type: "Page";
|
|
148
148
|
slug?: string;
|
|
149
149
|
userSlug?: string;
|
|
150
|
+
publishMetadata?: {
|
|
151
|
+
lastPublishedByUserId: string;
|
|
152
|
+
lastPublishedAt: Date;
|
|
153
|
+
};
|
|
154
|
+
approvalState?: {
|
|
155
|
+
approvalState: "ReadyForReview" | "ChangesRequested" | "Approved";
|
|
156
|
+
pagePersistentId: string;
|
|
157
|
+
updatedByUserId: string;
|
|
158
|
+
designSystemVersionId: string;
|
|
159
|
+
updatedAt: Date;
|
|
160
|
+
createdAt: Date;
|
|
161
|
+
};
|
|
162
|
+
liveblocksRoomId?: string;
|
|
150
163
|
draftState?: {
|
|
151
|
-
changeType
|
|
164
|
+
changeType: "Created";
|
|
152
165
|
} | {
|
|
153
|
-
changeType
|
|
154
|
-
changes
|
|
166
|
+
changeType: "Updated";
|
|
167
|
+
changes: {
|
|
155
168
|
previousTitle?: string;
|
|
156
169
|
previousConfiguration?: {
|
|
157
|
-
showSidebar
|
|
158
|
-
isPrivate
|
|
159
|
-
isHidden
|
|
160
|
-
header
|
|
161
|
-
description
|
|
162
|
-
alignment
|
|
170
|
+
showSidebar: boolean;
|
|
171
|
+
isPrivate: boolean;
|
|
172
|
+
isHidden: boolean;
|
|
173
|
+
header: {
|
|
174
|
+
description: string;
|
|
175
|
+
alignment: "Left" | "Center";
|
|
176
|
+
backgroundImageScaleType: "AspectFill" | "AspectFit";
|
|
177
|
+
showBackgroundOverlay: boolean;
|
|
178
|
+
showCoverText: boolean;
|
|
163
179
|
foregroundColor?: {
|
|
164
|
-
value
|
|
180
|
+
value: string;
|
|
165
181
|
referencedTokenId?: string;
|
|
166
182
|
};
|
|
167
183
|
backgroundColor?: {
|
|
168
|
-
value
|
|
184
|
+
value: string;
|
|
169
185
|
referencedTokenId?: string;
|
|
170
186
|
};
|
|
171
187
|
backgroundImageAsset?: {
|
|
172
|
-
type
|
|
188
|
+
type: "Resource" | "FigmaNode";
|
|
173
189
|
resource?: {
|
|
174
|
-
|
|
175
|
-
|
|
190
|
+
resourceId: string;
|
|
191
|
+
url: string;
|
|
176
192
|
};
|
|
177
193
|
figmaNode?: {
|
|
178
|
-
sourceId
|
|
179
|
-
frameReferenceId
|
|
194
|
+
sourceId: string;
|
|
195
|
+
frameReferenceId: string;
|
|
180
196
|
};
|
|
181
197
|
};
|
|
182
|
-
backgroundImageScaleType?: "AspectFill" | "AspectFit";
|
|
183
|
-
showBackgroundOverlay?: boolean;
|
|
184
|
-
showCoverText?: boolean;
|
|
185
198
|
minHeight?: number;
|
|
186
199
|
};
|
|
187
200
|
};
|
|
188
201
|
previousContentHash?: string;
|
|
189
202
|
};
|
|
190
203
|
} | {
|
|
191
|
-
changeType
|
|
192
|
-
deletedAt
|
|
193
|
-
deletedByUserId
|
|
194
|
-
};
|
|
195
|
-
publishMetadata?: {
|
|
196
|
-
lastPublishedByUserId?: string;
|
|
197
|
-
lastPublishedAt?: Date;
|
|
198
|
-
};
|
|
199
|
-
approvalState?: {
|
|
200
|
-
designSystemVersionId?: string;
|
|
201
|
-
persistentId?: string;
|
|
202
|
-
approvalState?: "ReadyForReview" | "ChangesRequested" | "Approved";
|
|
203
|
-
groupPersistentId?: string;
|
|
204
|
+
changeType: "Deleted";
|
|
205
|
+
deletedAt: Date;
|
|
206
|
+
deletedByUserId: string;
|
|
204
207
|
};
|
|
205
|
-
isRoot?: boolean;
|
|
206
|
-
childrenIds?: string[];
|
|
207
|
-
groupBehavior?: "Group" | "Tabs";
|
|
208
208
|
}>;
|
|
209
209
|
resolvedItems: Map<string, DocsEntityPage | DocsEntityGroup>;
|
|
210
210
|
resolveMultiplayerItems(pageDetails: Array<DTODocumentationHierarchyV2["pages"][number]>, groupDetails: Array<DTODocumentationHierarchyV2["groups"][number]>): Array<DocsEntityGroup | DocsEntityPage>;
|
package/build/types/exports.d.ts
CHANGED
|
@@ -228,6 +228,7 @@ export { DocumentationLegacyRichText } from "./model/documentation/SDKDocumentat
|
|
|
228
228
|
export { RichTextSpan } from "./model/documentation/SDKDocumentationLegacyRichTextSpan";
|
|
229
229
|
export { RichTextSpanAttribute } from "./model/documentation/SDKDocumentationLegacyRichTextSpanAttribute";
|
|
230
230
|
export { AssetGroup } from "./model/groups/SDKAssetGroup";
|
|
231
|
+
export { ComponentGroup } from "./model/groups/SDKComponentGroup";
|
|
231
232
|
export { DesignComponentGroup } from "./model/groups/SDKDesignComponentGroup";
|
|
232
233
|
export { TokenGroup } from "./model/groups/SDKTokenGroup";
|
|
233
234
|
export { DesignSystemCollection } from "./model/base/SDKDesignSystemCollection";
|
|
@@ -21,6 +21,7 @@ export declare class ActivityEvent {
|
|
|
21
21
|
action: ActivityEventAction;
|
|
22
22
|
targetType: ActivityEventTargetType;
|
|
23
23
|
targetId: string;
|
|
24
|
+
targetName: ActivityEventRemoteModel["targetName"];
|
|
24
25
|
targetSubtype: ActivityEventRemoteModel["targetSubtype"];
|
|
25
26
|
parentId: string | undefined;
|
|
26
27
|
changes: ActivityEventChange[];
|
|
@@ -38,6 +39,8 @@ export type ActivityEventListFilter = {
|
|
|
38
39
|
versionId: string;
|
|
39
40
|
/** Scopes the query to one entity's history; omitted reads the whole version */
|
|
40
41
|
targetId?: string;
|
|
42
|
+
/** Brand persistent ids; the "null" sentinel adds workspace-level rows */
|
|
43
|
+
brandIds?: string[];
|
|
41
44
|
/** "null" reads root events only, an id reads that parent's children */
|
|
42
45
|
parentId?: DTOActivityEventListInput["parentId"];
|
|
43
46
|
/** Keyset cursor from the previous page; omitted reads the newest page */
|
|
@@ -21,6 +21,9 @@ export declare class AgentChat {
|
|
|
21
21
|
eveSessionId: string | undefined;
|
|
22
22
|
name: string;
|
|
23
23
|
isArchived: boolean;
|
|
24
|
+
isRead: boolean;
|
|
25
|
+
isInProgress: boolean;
|
|
26
|
+
lastMessageAt: Date;
|
|
24
27
|
createdAt: Date;
|
|
25
28
|
updatedAt: Date;
|
|
26
29
|
constructor(model: AgentChatRemoteModel);
|
|
@@ -5,7 +5,7 @@ export type DesignSystemSwitcher = {
|
|
|
5
5
|
designSystemIds: Array<string>;
|
|
6
6
|
};
|
|
7
7
|
export type DesignSystemAccessMode = "Open" | "InviteOnly";
|
|
8
|
-
export type DesignSystemTransportModel = Pick<DesignSystem, "id" | "name" | "description" | "isPublic" | "isMultiBrand" | "documentationSlug" | "documentationUserSlug" | "documentationExporterId" | "designSystemSwitcher" | "workspaceId">;
|
|
8
|
+
export type DesignSystemTransportModel = Pick<DesignSystem, "id" | "name" | "description" | "isPublic" | "isMultiBrand" | "documentationSlug" | "documentationUserSlug" | "documentationExporterId" | "designSystemSwitcher" | "workspaceId" | "createdAt">;
|
|
9
9
|
export declare class DesignSystem {
|
|
10
10
|
/** Unique identifier of design system */
|
|
11
11
|
id: string;
|
|
@@ -45,6 +45,8 @@ export declare class DesignSystem {
|
|
|
45
45
|
isAvailableToUser: boolean;
|
|
46
46
|
/** Unique identifier of the shared draft version of the design system */
|
|
47
47
|
sharedDraftId: string;
|
|
48
|
+
/** When the design system was created */
|
|
49
|
+
createdAt: Date;
|
|
48
50
|
constructor(model: Omit<DTODesignSystem, "isPublic"> & {
|
|
49
51
|
isPublic: boolean;
|
|
50
52
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PageBlockContextConnection, type PageBlockItemContextValue } from "@supernova-studio/model";
|
|
2
2
|
import { DocsBlockItemPropertyType } from "../../../enums/SDKDocsBlockItemPropertyType";
|
|
3
3
|
import { DocsBlockPropertyDefinition, DocsBlockPropertyDefinitionModel } from "./SDKDocsBlockProperty";
|
|
4
|
-
export declare const DocsBlockContextPropertyConnectionValues:
|
|
4
|
+
export declare const DocsBlockContextPropertyConnectionValues: ("url" | "cursor" | "claudeCode" | "vsCode" | "codex" | "codeSnippet")[];
|
|
5
5
|
export type DocsBlockContextPropertyConnection = PageBlockContextConnection;
|
|
6
6
|
export type DocsBlockContextPropertyOptions = Record<string, never>;
|
|
7
7
|
/** Context property - Data */
|
|
@@ -1,22 +1,48 @@
|
|
|
1
1
|
import { Brand } from "../../../model/base/SDKBrand";
|
|
2
2
|
import { DTOriginalTokenType } from "../../../model/enums/SDKTokenType";
|
|
3
3
|
import { AnyToken } from "../../../model/tokens/SDKTokenValue";
|
|
4
|
-
import { DTParsedNode } from "./SDKDTJSONLoader";
|
|
5
|
-
import { DTPluginToSupernovaMapPack } from "./SDKDTMapLoader";
|
|
4
|
+
import { DTParsedNode, DTParsedThemeSetPriority, DTParsedTokenSet } from "./SDKDTJSONLoader";
|
|
5
|
+
import { DTPluginSourceMode, DTPluginToSupernovaMapPack, DTPluginUnresolvableFallback, DTPluginUnresolvableRefMode } from "./SDKDTMapLoader";
|
|
6
6
|
import { DTTokenReferenceResolver } from "./SDKDTTokenReferenceResolver";
|
|
7
7
|
export type DTProcessedTokenNode<T extends AnyToken = AnyToken> = {
|
|
8
8
|
token: T;
|
|
9
9
|
originalType: DTOriginalTokenType;
|
|
10
10
|
path: Array<string>;
|
|
11
11
|
key: string;
|
|
12
|
+
/** Originating set's status in `$themes.json`; absent for explicit-`tokenSets` mappings */
|
|
13
|
+
sourcePriority?: DTParsedThemeSetPriority;
|
|
14
|
+
};
|
|
15
|
+
export type DTJSONConverterOptions = {
|
|
16
|
+
/** How to handle references that can't resolve; defaults to `strict` (throw). */
|
|
17
|
+
unresolvableRefMode?: DTPluginUnresolvableRefMode;
|
|
18
|
+
/** Per-type fallback values used by `placeholder` and `lenientResolve` modes. */
|
|
19
|
+
unresolvableFallback?: Required<DTPluginUnresolvableFallback>;
|
|
20
|
+
/** Full input token sets — used only by `lenientResolve` for wider-scope lookup. */
|
|
21
|
+
allLoadedSets?: Array<DTParsedTokenSet>;
|
|
22
|
+
/** Attribution label included in warnings — usually `"<brand>/<theme>"`. */
|
|
23
|
+
mappingKey?: string;
|
|
24
|
+
/** How to handle `source`-statused sets (Fix B). Defaults to `emit`. */
|
|
25
|
+
sourceMode?: DTPluginSourceMode;
|
|
12
26
|
};
|
|
13
27
|
/** Utility to DS Tokens plugin JSON to Supernova entities */
|
|
14
28
|
export declare class DTJSONConverter {
|
|
15
29
|
versionId: string;
|
|
16
30
|
mapping: DTPluginToSupernovaMapPack;
|
|
17
31
|
referenceResolver: DTTokenReferenceResolver;
|
|
18
|
-
|
|
32
|
+
unresolvableRefMode: DTPluginUnresolvableRefMode;
|
|
33
|
+
unresolvableFallback: Required<DTPluginUnresolvableFallback>;
|
|
34
|
+
allLoadedSets: Array<DTParsedTokenSet>;
|
|
35
|
+
mappingKey: string;
|
|
36
|
+
sourceMode: DTPluginSourceMode;
|
|
37
|
+
/** Warnings surfaced during resolution (emitted by non-strict unresolvable modes). Consumed by the plugin and folded into logs[]. */
|
|
38
|
+
warnings: Array<string>;
|
|
39
|
+
/** Keys of processed nodes that should be dropped before emission (populated by `preserve` mode and Fix B source filtering). */
|
|
40
|
+
skippedKeys: Set<string>;
|
|
41
|
+
constructor(versionId: string, mapping: DTPluginToSupernovaMapPack, options?: DTJSONConverterOptions);
|
|
19
42
|
convertNodesToTokens(nodes: Array<DTParsedNode>, brand: Brand): Array<DTProcessedTokenNode>;
|
|
43
|
+
private applySourceModeSkip;
|
|
44
|
+
/** Single-pass cascade: mark tokens whose referencedTokenId targets are in `skipIds`. Returns true if any new skip was added. */
|
|
45
|
+
private markCascadingSkips;
|
|
20
46
|
private restoreInitialTokenOrder;
|
|
21
47
|
private remapRootNodeKey;
|
|
22
48
|
private remapRootNodeKeys;
|
|
@@ -7,6 +7,8 @@ export type DTParsedNode = {
|
|
|
7
7
|
type: DTOriginalTokenType;
|
|
8
8
|
value: JSONValue;
|
|
9
9
|
description: string | null;
|
|
10
|
+
/** Originating set's status in `$themes.json`; absent for explicit-`tokenSets` mappings */
|
|
11
|
+
sourcePriority?: DTParsedThemeSetPriority;
|
|
10
12
|
};
|
|
11
13
|
export type DTParsedTokenSet = {
|
|
12
14
|
name: string;
|
|
@@ -15,6 +15,31 @@ export declare enum DTPluginPreciseCopyStrategy {
|
|
|
15
15
|
deleteAll = "deleteAll",// preciseCopy = true
|
|
16
16
|
keepManualTokens = "keepManualTokens"
|
|
17
17
|
}
|
|
18
|
+
/** Controls how `source`-statused sets in `$themes.json` are handled during sync. */
|
|
19
|
+
export declare enum DTPluginSourceMode {
|
|
20
|
+
/** Source sets contribute tokens AND resolve references (current SDK behavior) */
|
|
21
|
+
emit = "emit",
|
|
22
|
+
/** Source sets are used for reference resolution only; their tokens are inlined into referring enabled tokens and not emitted separately */
|
|
23
|
+
referenceOnly = "referenceOnly"
|
|
24
|
+
}
|
|
25
|
+
/** Controls what happens when a `{...}` reference can't be resolved within the mapping's set pool. */
|
|
26
|
+
export declare enum DTPluginUnresolvableRefMode {
|
|
27
|
+
/** Throw the enriched error listing missing refs (current SDK behavior) */
|
|
28
|
+
strict = "strict",
|
|
29
|
+
/** Substitute unresolvable refs with configured fallback values; emit warnings to logs */
|
|
30
|
+
placeholder = "placeholder",
|
|
31
|
+
/** Keep the `{...}` literal in the token value; self-heals on next sync when target exists */
|
|
32
|
+
preserve = "preserve",
|
|
33
|
+
/** Try to resolve against all loaded sets (not just mapping's subset); fall back to placeholder if still unresolvable */
|
|
34
|
+
lenientResolve = "lenientResolve"
|
|
35
|
+
}
|
|
36
|
+
/** Per-type fallback values used by `placeholder` mode (and `lenientResolve` fallback). */
|
|
37
|
+
export type DTPluginUnresolvableFallback = {
|
|
38
|
+
color?: string;
|
|
39
|
+
dimension?: number;
|
|
40
|
+
string?: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const DEFAULT_UNRESOLVABLE_FALLBACK: Required<DTPluginUnresolvableFallback>;
|
|
18
43
|
export declare const isPreciseCopyEnabled: (preciseCopy: DTPluginPreciseCopyStrategy) => preciseCopy is DTPluginPreciseCopyStrategy.deleteAll | DTPluginPreciseCopyStrategy.keepManualTokens;
|
|
19
44
|
export declare const toPreciseCopyStrategy: (preciseCopy?: boolean | DTPluginPreciseCopyStrategy) => DTPluginPreciseCopyStrategy;
|
|
20
45
|
export type DTPluginToSupernovaMap = {
|
|
@@ -42,6 +67,9 @@ export type DTPluginToSupernovaMappingFile = {
|
|
|
42
67
|
dryRun?: boolean;
|
|
43
68
|
preciseCopy?: boolean | DTPluginPreciseCopyStrategy;
|
|
44
69
|
themeOverridesStrategy?: DTPluginThemeOverrideStrategy;
|
|
70
|
+
sourceMode?: DTPluginSourceMode;
|
|
71
|
+
unresolvableRefMode?: DTPluginUnresolvableRefMode;
|
|
72
|
+
unresolvableFallback?: DTPluginUnresolvableFallback;
|
|
45
73
|
};
|
|
46
74
|
};
|
|
47
75
|
export type DTPluginToSupernovaSettings = {
|
|
@@ -49,4 +77,7 @@ export type DTPluginToSupernovaSettings = {
|
|
|
49
77
|
dryRun: boolean;
|
|
50
78
|
preciseCopy: DTPluginPreciseCopyStrategy;
|
|
51
79
|
themeOverridesStrategy: DTPluginThemeOverrideStrategy;
|
|
80
|
+
sourceMode: DTPluginSourceMode;
|
|
81
|
+
unresolvableRefMode: DTPluginUnresolvableRefMode;
|
|
82
|
+
unresolvableFallback: Required<DTPluginUnresolvableFallback>;
|
|
52
83
|
};
|
|
@@ -45,4 +45,6 @@ export declare class DTTokenReferenceResolver {
|
|
|
45
45
|
dollarTypeReference: boolean;
|
|
46
46
|
}[];
|
|
47
47
|
isDollarIdentifier(value: string): boolean;
|
|
48
|
+
/** Extract references appearing in `value` that aren't defined in the atomic table. Returns bracket-normalized keys (e.g. `{color.base.foo}`). */
|
|
49
|
+
unresolvedReferencesIn(value: unknown): Array<string>;
|
|
48
50
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Brand } from "../../../../model/base/SDKBrand";
|
|
2
|
+
import { DTParsedNode, DTParsedTokenSet } from "../SDKDTJSONLoader";
|
|
3
|
+
import { DTPluginUnresolvableFallback } from "../SDKDTMapLoader";
|
|
4
|
+
import { DTTokenReferenceResolver } from "../SDKDTTokenReferenceResolver";
|
|
5
|
+
/** Context passed to each unresolvable-ref handler. */
|
|
6
|
+
export type UnresolvableModeContext = {
|
|
7
|
+
/** Nodes that failed to resolve within the depth limit, paired with their original processing index. */
|
|
8
|
+
unresolvedTokens: Array<[DTParsedNode, number]>;
|
|
9
|
+
/** All token sets loaded from the input file (used by `lenientResolve`; other handlers ignore). */
|
|
10
|
+
allLoadedSets: Array<DTParsedTokenSet>;
|
|
11
|
+
/** The atomic-token table built during resolution; used to check what IS known. */
|
|
12
|
+
atomicResolver: DTTokenReferenceResolver;
|
|
13
|
+
/** Fully-populated fallback values (defaults merged with any user overrides). */
|
|
14
|
+
fallback: Required<DTPluginUnresolvableFallback>;
|
|
15
|
+
/** Brand context — passed to per-token conversion. */
|
|
16
|
+
brand: Brand;
|
|
17
|
+
/** Short label used in warning strings for attribution (e.g. "Jetstar/jq-web-light"). */
|
|
18
|
+
mappingKey: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Result from a handler. Instead of directly writing tokens, handlers return
|
|
22
|
+
* substituted nodes (whose values may have been rewritten) and/or skipped nodes.
|
|
23
|
+
* The caller re-runs the atomic-conversion path on substituted nodes.
|
|
24
|
+
*/
|
|
25
|
+
export type UnresolvableModeResult = {
|
|
26
|
+
/** Nodes whose values were substituted; re-run conversion on these. */
|
|
27
|
+
substitutedNodes: Array<[DTParsedNode, number]>;
|
|
28
|
+
/** Nodes to skip entirely — not emitted this sync. */
|
|
29
|
+
skippedNodes: Array<[DTParsedNode, number]>;
|
|
30
|
+
/** `[WARN]`-prefixed lines appended to the existing `logs[]` return value. */
|
|
31
|
+
warnings: Array<string>;
|
|
32
|
+
};
|
|
33
|
+
export type UnresolvableModeHandler = (context: UnresolvableModeContext) => UnresolvableModeResult;
|