@supernova-studio/supernova-sdk-beta 2.1.3 → 2.1.12
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/sdk-typescript/src/core/SDKSupernova.d.ts +10 -2
- package/build/sdk-typescript/src/core/areas/SDKAreaAI.d.ts +37 -5
- package/build/sdk-typescript/src/core/areas/SDKAreaAutomation.d.ts +2 -1
- package/build/sdk-typescript/src/core/areas/SDKAreaDataSources.d.ts +6 -0
- package/build/sdk-typescript/src/core/areas/SDKAreaDocsAnalytics.d.ts +8 -0
- package/build/sdk-typescript/src/core/areas/SDKAreaDocumentation.d.ts +9 -9
- package/build/sdk-typescript/src/core/areas/SDKAreaNetwork.d.ts +1 -2
- package/build/sdk-typescript/src/core/areas/SDKAreaProjects.d.ts +69 -0
- package/build/sdk-typescript/src/core/areas/SDKAreaRawData.d.ts +33 -49
- package/build/sdk-typescript/src/core/areas/SDKAreaResources.d.ts +9 -0
- package/build/sdk-typescript/src/core/areas/SDKAreaWorkspaces.d.ts +35 -0
- package/build/sdk-typescript/src/core/data/SDKDataBridge.d.ts +10 -3
- package/build/sdk-typescript/src/core/data/SDKDataCore.d.ts +73 -8
- package/build/sdk-typescript/src/core/data/SDKDataCoreCached.d.ts +50 -0
- package/build/sdk-typescript/src/core/data/requests/SDKDataCoreAIRequests.d.ts +19 -4
- package/build/sdk-typescript/src/core/data/requests/SDKDataCoreReadRequests.d.ts +70 -1
- package/build/sdk-typescript/src/core/data/requests/SDKDataCoreWriteRequests.d.ts +25 -14
- package/build/sdk-typescript/src/core/resolvers/SDKDesignComponentGroupResolver.d.ts +0 -1
- package/build/sdk-typescript/src/core/resolvers/SDKDocsEntityItemResolver.d.ts +13 -13
- package/build/sdk-typescript/src/exports.d.ts +13 -3
- package/build/sdk-typescript/src/model/code-components/SDKCodeComponentPropertyControlDefinition.d.ts +1 -4
- package/build/sdk-typescript/src/model/code-components/SDKCodeComponentPropertyDefinition.d.ts +0 -2
- package/build/sdk-typescript/src/model/docs/blocks/definition/actual/files/SDKDocsBlockActualFiles.d.ts +6 -0
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockFileProperty.d.ts +19 -0
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockStorybookProperty.d.ts +19 -5
- package/build/sdk-typescript/src/model/docs_analytics/SDKDocsAnalyticsComparisonData.d.ts +10 -0
- package/build/sdk-typescript/src/model/docs_analytics/SDKDocsAnalyticsData.d.ts +14 -0
- package/build/sdk-typescript/src/model/docs_analytics/SDKDocsAnalyticsPageComparisonData.d.ts +6 -0
- package/build/sdk-typescript/src/model/docs_analytics/SDKDocsAnalyticsPageVisitData.d.ts +6 -0
- package/build/sdk-typescript/src/model/docs_analytics/SDKDocsAnalyticsTimeFrame.d.ts +6 -0
- package/build/sdk-typescript/src/model/docs_analytics/SDKDocsAnalyticsVisitData.d.ts +9 -0
- package/build/sdk-typescript/src/model/docs_analytics/SDKDocsAnalyticsVisitHeatMapWeek.d.ts +14 -0
- package/build/sdk-typescript/src/model/enums/SDKDocsBlockBehaviorDataType.d.ts +3 -1
- package/build/sdk-typescript/src/model/enums/SDKDocsBlockItemPropertyType.d.ts +3 -1
- package/build/sdk-typescript/src/model/enums/SDKSourceType.d.ts +2 -1
- package/build/sdk-typescript/src/model/enums/SDKUserRole.d.ts +0 -2
- package/build/sdk-typescript/src/model/exporters/SDKPipeline.d.ts +1 -1
- package/build/sdk-typescript/src/model/files/SDKFileUpload.d.ts +28 -0
- package/build/sdk-typescript/src/model/groups/SDKTokenGroup.d.ts +1 -0
- package/build/sdk-typescript/src/model/projects/SDKProject.d.ts +39 -0
- package/build/sdk-typescript/src/model/projects/SDKProjectContext.d.ts +47 -0
- package/build/sdk-typescript/src/model/storybook/SDKStorybookEntry.d.ts +23 -0
- package/build/sdk-typescript/src/model/storybook/SDKStorybookUpdate.d.ts +17 -0
- package/build/sdk-typescript/src/model/support/SDKSource.d.ts +27 -1
- package/build/sdk-typescript/src/model/support/SDKTokenOrigin.d.ts +2 -2
- package/build/sdk-typescript/src/model/tokens/SDKToken.d.ts +1 -0
- package/build/sdk-typescript/src/model/workspaces/SDKWorkspaceProductFeatures.d.ts +1 -1
- package/build/sdk-typescript/src/tools/docs-block-builder/SDKDocsBlockBuilder.d.ts +12 -0
- package/build/sdk-typescript/src/utils/RawUtils.d.ts +69 -0
- package/build/supernova-sdk-typescript.js +1 -2
- package/build/supernova-sdk-typescript.js.map +1 -1
- package/package.json +33 -50
- package/build/sdk-typescript/src/model/exporters/remote/SDKRemotePipelineModel.d.ts +0 -51
- package/build/supernova-sdk-typescript.js.LICENSE.txt +0 -8
|
@@ -7,11 +7,13 @@ import { AreaCodeComponents } from "./areas/SDKAreaCodeComponents";
|
|
|
7
7
|
import { AreaComponents } from "./areas/SDKAreaComponents";
|
|
8
8
|
import { AreaDataSources } from "./areas/SDKAreaDataSources";
|
|
9
9
|
import { AreaDesignSystems } from "./areas/SDKAreaDesignSystems";
|
|
10
|
+
import { AreaDocsAnalytics } from "./areas/SDKAreaDocsAnalytics";
|
|
10
11
|
import { AreaDocumentation } from "./areas/SDKAreaDocumentation";
|
|
11
12
|
import { AreaIntegrations } from "./areas/SDKAreaIntegrations";
|
|
12
13
|
import { AreaMe } from "./areas/SDKAreaMe";
|
|
13
14
|
import { AreaMultiplayer } from "./areas/SDKAreaMultiplayer";
|
|
14
15
|
import { AreaNetwork } from "./areas/SDKAreaNetwork";
|
|
16
|
+
import { AreaProjects } from "./areas/SDKAreaProjects";
|
|
15
17
|
import { AreaRawData } from "./areas/SDKAreaRawData";
|
|
16
18
|
import { AreaResources } from "./areas/SDKAreaResources";
|
|
17
19
|
import { AreaStorage } from "./areas/SDKAreaStorage";
|
|
@@ -20,7 +22,7 @@ import { AreaUsers } from "./areas/SDKAreaUsers";
|
|
|
20
22
|
import { AreaVersions } from "./areas/SDKAreaVersions";
|
|
21
23
|
import { AreaWorkspaceIntegrations } from "./areas/SDKAreaWorkspaceIntegrations";
|
|
22
24
|
import { AreaWorkspaces } from "./areas/SDKAreaWorkspaces";
|
|
23
|
-
import { DataBridgeRequestHook } from "./data/SDKDataBridge";
|
|
25
|
+
import { DataBridgeRequestHook, DebugRequestObserver, DebugResponseObserver } from "./data/SDKDataBridge";
|
|
24
26
|
/** Main Supernova.io SDK object. Use this to connect to your data instance and retrieve workspace / design system / version from which you can access all neccessary data. */
|
|
25
27
|
export declare class Supernova {
|
|
26
28
|
private apiKey;
|
|
@@ -49,6 +51,8 @@ export declare class Supernova {
|
|
|
49
51
|
resources: AreaResources;
|
|
50
52
|
/** Get, create, update, manipulate or delete documentation items */
|
|
51
53
|
documentation: AreaDocumentation;
|
|
54
|
+
/** Get published documentation items */
|
|
55
|
+
docsAnalytics: AreaDocsAnalytics;
|
|
52
56
|
/** Get, create, update, manipulate or delete pipelines and automation jobs */
|
|
53
57
|
automation: AreaAutomation;
|
|
54
58
|
/** Get, create, update, manipulate or delete users */
|
|
@@ -71,6 +75,8 @@ export declare class Supernova {
|
|
|
71
75
|
multiplayer: AreaMultiplayer;
|
|
72
76
|
/** Get access to AI capabilities */
|
|
73
77
|
ai: AreaAI;
|
|
78
|
+
/** Get access to projects */
|
|
79
|
+
projects: AreaProjects;
|
|
74
80
|
/** Get access to raw data for local-only restoration of data */
|
|
75
81
|
raw: AreaRawData;
|
|
76
82
|
/**
|
|
@@ -86,11 +92,13 @@ export declare class Supernova {
|
|
|
86
92
|
apiUrl?: string;
|
|
87
93
|
aiApiUrl?: string;
|
|
88
94
|
requestHook?: DataBridgeRequestHook;
|
|
95
|
+
debugRequestObserver?: DebugRequestObserver | null;
|
|
96
|
+
debugResponseObserver?: DebugResponseObserver | null;
|
|
89
97
|
customFetchLib?: any;
|
|
90
98
|
customProxyLib?: any;
|
|
91
|
-
proxyUrl?: string;
|
|
92
99
|
isPreview?: boolean;
|
|
93
100
|
jobId?: string;
|
|
101
|
+
useDataCoreCached?: boolean;
|
|
94
102
|
});
|
|
95
103
|
get apiKeySet(): boolean;
|
|
96
104
|
}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { DataCore } from "../data/SDKDataCore";
|
|
2
2
|
import { RemoteWorkspaceVersionIdentifier } from "./SDKRemoteIdentifiers";
|
|
3
|
+
export declare enum AIGetRouteQueryTask {
|
|
4
|
+
answer = "answer",
|
|
5
|
+
answerWithStream = "answerWithStream",
|
|
6
|
+
autocomplete = "autocomplete",
|
|
7
|
+
reindex = "reindex",
|
|
8
|
+
summarize = "summarize",
|
|
9
|
+
code = "code"
|
|
10
|
+
}
|
|
3
11
|
export declare class AreaAI {
|
|
4
12
|
/** Internal: Engine */
|
|
5
13
|
private dataCore;
|
|
@@ -15,16 +23,35 @@ export declare class AreaAI {
|
|
|
15
23
|
maxWordCount: number;
|
|
16
24
|
strategy: "noun" | "verb";
|
|
17
25
|
}): Promise<string>;
|
|
26
|
+
/** Populates Forge instance a code snippet from a prompt. Response is streamed.
|
|
27
|
+
* @param from - Version identifier
|
|
28
|
+
* @param projectId - Project identifier
|
|
29
|
+
* @param participantId - Participant identifier
|
|
30
|
+
* @param messageType - Message type
|
|
31
|
+
* @param prompt - User prompt
|
|
32
|
+
* @param options - Population options
|
|
33
|
+
* @returns Populated code snippet
|
|
34
|
+
* @disclaimer This method will throw if the user is not authorized to use AI features (if you are reading this, you are not authorized).
|
|
35
|
+
*/
|
|
36
|
+
aiCode(from: RemoteWorkspaceVersionIdentifier, projectId: string, participantId: string, messageType: "note" | "action", prompt: string, options: {
|
|
37
|
+
agentId?: string;
|
|
38
|
+
branchId?: string;
|
|
39
|
+
}): Promise<ReadableStreamDefaultReader<Uint8Array>>;
|
|
18
40
|
/** Autocompletes a prompt into a full text. Response is not streamed.
|
|
19
41
|
* @param from - Version identifier
|
|
20
|
-
* @param
|
|
42
|
+
* @param textToComplete - Text to autocomplete
|
|
21
43
|
* @param options - Autocomplete options
|
|
22
44
|
* @returns Autocompleted text
|
|
23
45
|
* @disclaimer This method will throw if the user is not authorized to use AI features (if you are reading this, you are not authorized).
|
|
24
46
|
*/
|
|
25
|
-
autocompleteText(from: RemoteWorkspaceVersionIdentifier,
|
|
47
|
+
autocompleteText(from: RemoteWorkspaceVersionIdentifier, textToComplete: string, options?: {
|
|
26
48
|
maximumLength: number;
|
|
27
|
-
|
|
49
|
+
previousText?: string;
|
|
50
|
+
afterText?: string;
|
|
51
|
+
}): Promise<{
|
|
52
|
+
completion: string;
|
|
53
|
+
fullText: string;
|
|
54
|
+
}>;
|
|
28
55
|
/** Answers question based on the data of design system in natural language. This method is non-streaming.
|
|
29
56
|
* @param from - Version identifier
|
|
30
57
|
* @param prompt - Question to answer
|
|
@@ -48,11 +75,16 @@ export declare class AreaAI {
|
|
|
48
75
|
persona: "designer" | "developer";
|
|
49
76
|
scope: "all" | "tokens" | "components" | "assets" | "docs";
|
|
50
77
|
density: "compact" | "full";
|
|
51
|
-
}): Promise<
|
|
78
|
+
}): Promise<ReadableStreamDefaultReader<Uint8Array>>;
|
|
52
79
|
/** Indexes or reindexes a design system to prepare it for QA engine
|
|
53
80
|
* @param from - Version identifier
|
|
54
81
|
* @returns Indexing status
|
|
55
82
|
* @disclaimer This method will throw if the user is not authorized to use AI features (if you are reading this, you are not authorized).
|
|
56
83
|
*/
|
|
57
|
-
rebuildAnswerIndex(from: RemoteWorkspaceVersionIdentifier): Promise<
|
|
84
|
+
rebuildAnswerIndex(from: RemoteWorkspaceVersionIdentifier): Promise<void>;
|
|
85
|
+
/** Temp: Retrieves dynamic URL for all AI tasks
|
|
86
|
+
* @param task - Which task to retrieve URL for
|
|
87
|
+
* @returns Url for the task
|
|
88
|
+
*/
|
|
89
|
+
executableTaskUrl(task: AIGetRouteQueryTask): Promise<string>;
|
|
58
90
|
}
|
|
@@ -117,7 +117,8 @@ export declare class AreaAutomation {
|
|
|
117
117
|
* @param brandId
|
|
118
118
|
* @param themePersistentIds
|
|
119
119
|
* @param exporterConfigurationProperties
|
|
120
|
+
* @param previewMode
|
|
120
121
|
*/
|
|
121
|
-
createExporterBuild(workspaceId: string, designSystemId: string, versionId: string, exporterId: string, destinations: ExporterJobDestination, brandId: string | undefined, themePersistentIds: Array<string> | undefined, exporterConfigurationProperties: DTOExporterPropertyValueMap | undefined): Promise<ExportBuild>;
|
|
122
|
+
createExporterBuild(workspaceId: string, designSystemId: string, versionId: string, exporterId: string, destinations: ExporterJobDestination, brandId: string | undefined, themePersistentIds: Array<string> | undefined, exporterConfigurationProperties: DTOExporterPropertyValueMap | undefined, previewMode: boolean | undefined): Promise<ExportBuild>;
|
|
122
123
|
deletePipeline(workspaceId: string, pipelineId: string): Promise<void>;
|
|
123
124
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { DTODataSourceStorybookCreatePayload, DTOStorybookEntryReplaceAction, DTOStorybookImportPayload } from "@supernova-studio/client";
|
|
2
|
+
import { StorybookEntry } from "../../model/storybook/SDKStorybookEntry";
|
|
1
3
|
import { FigmaStructure } from "../../model/support/SDKFigmaStructure";
|
|
2
4
|
import { FigmaStructureDetail } from "../../model/support/SDKFigmaStructureDetail";
|
|
3
5
|
import { Source, SourceRemoteModelCloud } from "../../model/support/SDKSource";
|
|
@@ -29,6 +31,7 @@ export declare class AreaDataSources {
|
|
|
29
31
|
getFigmaNodeStructureDetail(from: RemoteVersionIdentifier & {
|
|
30
32
|
figmaStructureId: string;
|
|
31
33
|
}): Promise<FigmaStructureDetail>;
|
|
34
|
+
getStorybookEntries(from: RemoteVersionIdentifier): Promise<StorybookEntry[]>;
|
|
32
35
|
linkFigmaSource(from: RemoteBrandIdentifier, url: string, options: {
|
|
33
36
|
scopes: {
|
|
34
37
|
tokens: boolean;
|
|
@@ -51,5 +54,8 @@ export declare class AreaDataSources {
|
|
|
51
54
|
autoImport?: SourceRemoteModelCloud["autoImportMode"];
|
|
52
55
|
themeId?: string | null;
|
|
53
56
|
}): Promise<Source>;
|
|
57
|
+
linkStorybookSource(from: RemoteVersionIdentifier, payload: DTODataSourceStorybookCreatePayload): Promise<Source>;
|
|
58
|
+
updateStorybookSource(from: RemoteVersionIdentifier, payload: DTOStorybookImportPayload): Promise<import("../../model/storybook/SDKStorybookUpdate").StorybookUpdate>;
|
|
59
|
+
replaceStorybookStory(from: RemoteVersionIdentifier, storyId: string, payload: DTOStorybookEntryReplaceAction): Promise<any>;
|
|
54
60
|
deleteFigmaSource(from: RemoteVersionIdentifier, sourceId: string): Promise<void>;
|
|
55
61
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DocsAnalyticsTimeFrame } from "../../model/docs_analytics/SDKDocsAnalyticsTimeFrame";
|
|
2
|
+
import { DataCore } from "../data/SDKDataCore";
|
|
3
|
+
export declare class AreaDocsAnalytics {
|
|
4
|
+
/** Internal: Engine */
|
|
5
|
+
private dataCore;
|
|
6
|
+
constructor(dataCore: DataCore);
|
|
7
|
+
getDocsPageAnalytics(designSystemId: string, versionId: string, timeFrames: Array<DocsAnalyticsTimeFrame>): Promise<import("../../model/docs_analytics/SDKDocsAnalyticsData").DocsAnalyticsData>;
|
|
8
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DTOCreateDocumentationGroupInput, DTOCreateDocumentationPageInputV2, DTOUpdateDocumentationGroupInput, DTOUpdateDocumentationPageInputV2, DTODuplicateDocumentationGroupInput, DTODuplicateDocumentationPageInputV2, DTODeleteDocumentationGroupInput, DTOMoveDocumentationPageInputV2, DTOMoveDocumentationGroupInput, DTOCreateDocumentationTabInput, DTODocumentationPageAnchor, DTODesignElementsDataDiffResponse, DTOPublishDocumentationRequest, DTOElementActionInput, DTOElementActionOutput } from "@supernova-studio/client";
|
|
1
|
+
import { DTOCreateDocumentationGroupInput, DTOCreateDocumentationPageInputV2, DTOUpdateDocumentationGroupInput, DTOUpdateDocumentationPageInputV2, DTODuplicateDocumentationGroupInput, DTODuplicateDocumentationPageInputV2, DTODeleteDocumentationGroupInput, DTOMoveDocumentationPageInputV2, DTOMoveDocumentationGroupInput, DTOCreateDocumentationTabInput, DTODocumentationPageAnchor, DTODesignElementsDataDiffResponse, DTOPublishDocumentationRequest, DTOElementActionInput, DTOElementActionOutput, DTODocumentationPageDependenciesGetResponse } from "@supernova-studio/client";
|
|
2
2
|
import { DocumentationLegacy, DocumentationLegacyModel } from "../../model/base/SDKDocumentationLegacy";
|
|
3
3
|
import { DocsBlockDefinition } from "../../model/docs/blocks/definition/SDKDocsBlockDefinition";
|
|
4
4
|
import { DocsBlock } from "../../model/docs/blocks/usage/SDKDocsBlock";
|
|
@@ -7,6 +7,7 @@ import { DocsEntityGroupModel } from "../../model/docs/entities/SDKDocsEntityGro
|
|
|
7
7
|
import { DocsEntityPageModel } from "../../model/docs/entities/SDKDocsEntityPage";
|
|
8
8
|
import { DocsSection } from "../../model/docs/sections/SDKDocsSection";
|
|
9
9
|
import { DocumentationLegacyGroup } from "../../model/documentation/SDKDocumentationLegacyGroup";
|
|
10
|
+
import { DocumentationLegacyPage } from "../../model/documentation/SDKDocumentationLegacyPage";
|
|
10
11
|
import { DocsPublishStatus } from "../../model/enums/SDKDocsPublishStatus";
|
|
11
12
|
import { DocumentationEnvironment } from "../../model/enums/SDKDocumentationEnvironment";
|
|
12
13
|
import { ExportBuild, ExportBuildStatus } from "../../model/exporters/exporter_builds/SDKExportBuild";
|
|
@@ -166,17 +167,15 @@ export declare class AreaDocumentation {
|
|
|
166
167
|
* @returns nothing
|
|
167
168
|
*/
|
|
168
169
|
ungroupDocumentationGroup(from: RemoteWorkspaceVersionIdentifier, payload: DTODeleteDocumentationGroupInput): Promise<void>;
|
|
169
|
-
/** Fetches
|
|
170
|
-
* Not implemented for now
|
|
171
|
-
* @param from - Remote version to fetch from
|
|
172
|
-
* @returnsDocumentationLegacy object
|
|
173
|
-
*/
|
|
174
|
-
getDocumentationStructureFromRoot(from: RemoteWorkspaceVersionIdentifier): Promise<DocumentationLegacyGroup>;
|
|
175
|
-
/** Fetches entire documentation documentation structure, including all pages and groups and their payloads
|
|
170
|
+
/** Fetches entire documentation including content in the legacy format
|
|
176
171
|
* @param from - Remote version to fetch from
|
|
177
172
|
* @returns All documentation items
|
|
178
173
|
*/
|
|
179
|
-
|
|
174
|
+
getFullDocumentationLegacyRepresentation(from: RemoteWorkspaceVersionIdentifier): Promise<{
|
|
175
|
+
rootGroup: DocumentationLegacyGroup;
|
|
176
|
+
allPages: Array<DocumentationLegacyPage>;
|
|
177
|
+
allGroups: Array<DocumentationLegacyGroup>;
|
|
178
|
+
}>;
|
|
180
179
|
/** Get ID of the multiplayer room for a given documentation page
|
|
181
180
|
* @param from - Remote version to fetch from
|
|
182
181
|
* @param pageId - ID of the documentation page
|
|
@@ -209,6 +208,7 @@ export declare class AreaDocumentation {
|
|
|
209
208
|
* */
|
|
210
209
|
publishDrafts(to: RemoteWorkspaceVersionIdentifier, environment: DocumentationEnvironment, changes: DTOPublishDocumentationRequest["changes"], isForcing?: boolean): Promise<ExportBuild>;
|
|
211
210
|
getDocumentationPageAnchors(from: RemoteWorkspaceVersionIdentifier, pageId: string): Promise<Array<DTODocumentationPageAnchor>>;
|
|
211
|
+
getDocumentationDependencies(from: RemoteVersionIdentifier): Promise<DTODocumentationPageDependenciesGetResponse["dependencies"]>;
|
|
212
212
|
getDocumentationMockedStructure(): Array<DocsEntity>;
|
|
213
213
|
getDocumentationMockedPageContent(pageId: string): Array<DocsBlock | DocsSection>;
|
|
214
214
|
getDocumentationMockedEditorBlockDefinitions(): Array<DocsBlockDefinition>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { DataCore } from "../data/SDKDataCore";
|
|
2
|
-
import { RequestInfo, RequestInit, Response } from "node-fetch";
|
|
3
2
|
export declare class AreaNetwork {
|
|
4
3
|
/** Internal: Engine */
|
|
5
4
|
private dataCore;
|
|
6
5
|
constructor(dataCore: DataCore);
|
|
7
|
-
/** Fires network request using node-fetch
|
|
6
|
+
/** Fires network request using either node-fetch or native fetch if available inside the environment sdk runs in */
|
|
8
7
|
fetch(url: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
9
8
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { SDKProject } from "../../model/projects/SDKProject";
|
|
2
|
+
import { SDKProjectContext, SDKProjectContextCreationModel } from "../../model/projects/SDKProjectContext";
|
|
3
|
+
import { DataCore } from "../data/SDKDataCore";
|
|
4
|
+
/**
|
|
5
|
+
* Manages project-related operations within a workspace using untyped data storage.
|
|
6
|
+
*/
|
|
7
|
+
export declare class AreaProjects {
|
|
8
|
+
/** Internal reference to DataCore for data operations */
|
|
9
|
+
private dataCore;
|
|
10
|
+
/** Key under which all projects are stored */
|
|
11
|
+
private readonly PROJECTS_KEY;
|
|
12
|
+
/** Key under which all project contexts are stored */
|
|
13
|
+
private readonly PROJECT_CONTEXTS_KEY;
|
|
14
|
+
constructor(dataCore: DataCore);
|
|
15
|
+
/**
|
|
16
|
+
* Fetches all projects for a given workspace.
|
|
17
|
+
* @param workspaceId - The ID of the workspace.
|
|
18
|
+
* @returns A promise resolving to an array of SDKProject instances.
|
|
19
|
+
*/
|
|
20
|
+
getAllProjects(workspaceId: string): Promise<SDKProject[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a new project in the specified workspace.
|
|
23
|
+
* @param workspaceId - The ID of the workspace.
|
|
24
|
+
* @param name - The name of the new project.
|
|
25
|
+
* @returns A promise resolving to the created SDKProject instance.
|
|
26
|
+
*/
|
|
27
|
+
createProject(workspaceId: string, name: string, contextId: string): Promise<SDKProject>;
|
|
28
|
+
/**
|
|
29
|
+
* Updates an existing project in the specified workspace.
|
|
30
|
+
* @param workspaceId - The ID of the workspace.
|
|
31
|
+
* @param updatedProject - The updated SDKProject instance.
|
|
32
|
+
* @returns A promise that resolves when the update is complete.
|
|
33
|
+
* @throws Error if the project is not found.
|
|
34
|
+
*/
|
|
35
|
+
updateProject(workspaceId: string, updatedProject: SDKProject): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Deletes a project from the specified workspace.
|
|
38
|
+
* @param workspaceId - The ID of the workspace.
|
|
39
|
+
* @param projectId - The ID of the project to delete.
|
|
40
|
+
* @returns A promise that resolves when the deletion is complete.
|
|
41
|
+
*/
|
|
42
|
+
deleteProject(workspaceId: string, projectId: string): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves all project contexts in a workspace.
|
|
45
|
+
* @param workspaceId - The ID of the workspace.
|
|
46
|
+
* @returns An array of SDKProjectContext instances.
|
|
47
|
+
*/
|
|
48
|
+
getAllProjectContexts(workspaceId: string): Promise<SDKProjectContext[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Creates a new project context.
|
|
51
|
+
* @param workspaceId - The ID of the workspace.
|
|
52
|
+
* @param creationModel - The properties for the new context.
|
|
53
|
+
* @returns The created SDKProjectContext instance.
|
|
54
|
+
*/
|
|
55
|
+
createProjectContext(workspaceId: string, creationModel: SDKProjectContextCreationModel): Promise<SDKProjectContext>;
|
|
56
|
+
/**
|
|
57
|
+
* Updates an existing project context.
|
|
58
|
+
* @param workspaceId - The ID of the workspace.
|
|
59
|
+
* @param updatedContext - The updated context instance.
|
|
60
|
+
* @throws Error if the context is not found.
|
|
61
|
+
*/
|
|
62
|
+
updateProjectContext(workspaceId: string, updatedContext: SDKProjectContext): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Deletes a project context.
|
|
65
|
+
* @param workspaceId - The ID of the workspace.
|
|
66
|
+
* @param contextId - The ID of the context to delete.
|
|
67
|
+
*/
|
|
68
|
+
deleteProjectContext(workspaceId: string, contextId: string): Promise<void>;
|
|
69
|
+
}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import { DTODesignSystem } from "@supernova-studio/client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { DesignSystemVersion, DesignSystemVersionRemoteModel } from "../../model/base/SDKDesignSystemVersion";
|
|
6
|
-
import { Component, ComponentRemoteModel } from "../../model/components/SDKComponent";
|
|
2
|
+
import { BrandRemoteModel } from "../../model/base/SDKBrand";
|
|
3
|
+
import { DesignSystemVersionRemoteModel } from "../../model/base/SDKDesignSystemVersion";
|
|
4
|
+
import { ComponentRemoteModel } from "../../model/components/SDKComponent";
|
|
7
5
|
import { DesignComponentRemoteModel } from "../../model/components/SDKDesignComponent";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
6
|
+
import { DocsEntityGroupModel } from "../../model/docs/entities/SDKDocsEntityGroup";
|
|
7
|
+
import { DocsEntityPageModel } from "../../model/docs/entities/SDKDocsEntityPage";
|
|
8
|
+
import { ElementDataViewRemoteModel } from "../../model/elements/SDKElementDataView";
|
|
9
|
+
import { ElementPropertyRemoteModel } from "../../model/elements/SDKElementProperty";
|
|
10
|
+
import { ElementPropertyValueRemoteModel } from "../../model/elements/values/SDKElementPropertyValue";
|
|
11
|
+
import { DocumentationEnvironment } from "../../model/enums/SDKDocumentationEnvironment";
|
|
12
|
+
import { ExportBuildModel, ExportBuildStatus } from "../../model/exporters/exporter_builds/SDKExportBuild";
|
|
13
|
+
import { ComponentGroupRemoteModel } from "../../model/groups/SDKComponentGroup";
|
|
13
14
|
import { DesignComponentGroupRemoteModel } from "../../model/groups/SDKDesignComponentGroup";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
15
|
+
import { TokenGroupRemoteModel } from "../../model/groups/SDKTokenGroup";
|
|
16
|
+
import { MembershipRemoteModel } from "../../model/membership/SDKMembership";
|
|
17
|
+
import { ResourceFontModel } from "../../model/resources/SDKResourceFont";
|
|
18
|
+
import { RemoteStorybookEntry } from "../../model/storybook/SDKStorybookEntry";
|
|
19
|
+
import { SourceRemoteModel } from "../../model/support/SDKSource";
|
|
19
20
|
import { TokenRemoteModel } from "../../model/tokens/remote/SDKRemoteTokenModel";
|
|
21
|
+
import { UserRemoteModel } from "../../model/users/SDKUser";
|
|
22
|
+
import { UserMembershipRemoteModel } from "../../model/users/SDKUserMembership";
|
|
20
23
|
import { DataCore } from "../data/SDKDataCore";
|
|
21
24
|
export declare class AreaRawData {
|
|
22
25
|
/** Internal: Engine */
|
|
@@ -52,38 +55,19 @@ export declare class AreaRawData {
|
|
|
52
55
|
getRawVersionModelData(designSystemId: string): Promise<Array<DesignSystemVersionRemoteModel>>;
|
|
53
56
|
/** Fetches raw brands */
|
|
54
57
|
getRawBrandModelData(designSystemId: string, versionId: string): Promise<Array<BrandRemoteModel>>;
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
propertyViews: Array<ElementDataViewRemoteModel>;
|
|
71
|
-
propertyDefinitions: Array<ElementPropertyRemoteModel>;
|
|
72
|
-
}): {
|
|
73
|
-
propertyValues: Array<ElementPropertyValue>;
|
|
74
|
-
propertyViews: Array<ElementDataView>;
|
|
75
|
-
propertyDefinitions: Array<ElementProperty>;
|
|
76
|
-
};
|
|
77
|
-
/** Build sources */
|
|
78
|
-
buildSourcesFromRaw(rawData: Array<SourceRemoteModel>): Array<Source>;
|
|
79
|
-
/** Build font resources */
|
|
80
|
-
buildFontResourcesFromRaw(rawData: Array<ResourceFontModel>): Array<ResourceFont>;
|
|
81
|
-
/** Builds memberships */
|
|
82
|
-
buildMembershipsFromRaw(rawData: Array<MembershipRemoteModel>): Array<Membership>;
|
|
83
|
-
/** Builds design systems */
|
|
84
|
-
buildDesignSystemsFromRaw(rawData: Array<DTODesignSystem>): Array<DesignSystem>;
|
|
85
|
-
/** Builds versions */
|
|
86
|
-
buildVersionsFromRaw(rawData: Array<DesignSystemVersionRemoteModel>): Array<DesignSystemVersion>;
|
|
87
|
-
/** Builds brands */
|
|
88
|
-
buildBrandsFromRaw(rawData: Array<BrandRemoteModel>): Array<Brand>;
|
|
58
|
+
/** Fetches raw current user */
|
|
59
|
+
getRawCurrentUserModelData(): Promise<UserRemoteModel>;
|
|
60
|
+
/** Fetches raw user memberships */
|
|
61
|
+
getRawWorkspaceMemberships(workspaceId: string): Promise<Array<UserMembershipRemoteModel>>;
|
|
62
|
+
/** Fetches raw design components */
|
|
63
|
+
getRawDesignComponentModelData(designSystemId: string, versionId: string, filter?: {
|
|
64
|
+
brandId?: string;
|
|
65
|
+
}): Promise<Array<DesignComponentRemoteModel>>;
|
|
66
|
+
/** Fetches raw design component groups */
|
|
67
|
+
getRawDesignComponentGroupModelData(designSystemId: string, versionId: string, filter?: {
|
|
68
|
+
brandId?: string;
|
|
69
|
+
}): Promise<Array<DesignComponentGroupRemoteModel>>;
|
|
70
|
+
getRawStorybookEntries(designSystemId: string, versionId: string): Promise<Array<RemoteStorybookEntry>>;
|
|
71
|
+
getRawDocumentationStructure(designSystemId: string, versionId: string): Promise<(DocsEntityPageModel | DocsEntityGroupModel)[]>;
|
|
72
|
+
getRawDocumentationBuilds(workspaceId: string, versionId: string, environment: DocumentationEnvironment, status?: ExportBuildStatus, createdByUserId?: string, limit?: number): Promise<Array<ExportBuildModel>>;
|
|
89
73
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DTOFigmaNode, DTOFigmaNodeV2 } from "@supernova-studio/client";
|
|
2
2
|
import { DocsImageRef, ResourceAsset, ResourceFont } from "../../exports";
|
|
3
|
+
import { FileUploadItem } from "../../model/files/SDKFileUpload";
|
|
3
4
|
import { DataCore } from "../data/SDKDataCore";
|
|
4
5
|
import { RemoteVersionIdentifier } from "./SDKRemoteIdentifiers";
|
|
5
6
|
export declare class AreaResources {
|
|
@@ -38,12 +39,20 @@ export declare class AreaResources {
|
|
|
38
39
|
* @returns URL of the hosted image resource, either uploaded file or Figma frame
|
|
39
40
|
*/
|
|
40
41
|
getImageRefHostedUrl(from: RemoteVersionIdentifier, imageRef: DocsImageRef | undefined): string | undefined;
|
|
42
|
+
/** Fetches all files in the version or a subset of them based on the persistentIds
|
|
43
|
+
* @param from - Remote version to fetch from
|
|
44
|
+
* @param persistentIds - Optional array of persistentIds to filter the files by
|
|
45
|
+
* @returns All files in the specified version or a subset of them based on the persistentIds
|
|
46
|
+
*/
|
|
47
|
+
getFiles(from: RemoteVersionIdentifier): Promise<import("../../exports").RemoteFile[]>;
|
|
41
48
|
/** Uploads new asset resource */
|
|
42
49
|
uploadAssetResource(from: RemoteVersionIdentifier, asset: File): Promise<ResourceAsset>;
|
|
43
50
|
/** Uploads new font resource */
|
|
44
51
|
uploadFontResource(from: RemoteVersionIdentifier, font: File): Promise<ResourceFont | null>;
|
|
45
52
|
/** Uploads new font resources */
|
|
46
53
|
uploadFontResources(from: RemoteVersionIdentifier, fonts: FileList): Promise<ResourceFont[]>;
|
|
54
|
+
initializeFileUpload(from: RemoteVersionIdentifier, fileUploadItems: Array<FileUploadItem>): Promise<import("../../model/files/SDKFileUpload").FileUploadResult>;
|
|
55
|
+
finalizeFileUpload(from: RemoteVersionIdentifier, fileIds: Array<string>): Promise<any>;
|
|
47
56
|
/** Deletes single resource of any type */
|
|
48
57
|
deleteResource(from: RemoteVersionIdentifier, resourceId: string): Promise<void>;
|
|
49
58
|
/** Deletes multiple resource of any type */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DTOWorkspaceUntypedDataListResponse, DTOWorkspaceUntypedDataResponse } from "@supernova-studio/client";
|
|
1
2
|
import { Acl } from "../../model/acl/SDKAcl";
|
|
2
3
|
import { UserRole } from "../../model/enums/SDKUserRole";
|
|
3
4
|
import { Membership } from "../../model/membership/SDKMembership";
|
|
@@ -234,4 +235,38 @@ export declare class AreaWorkspaces {
|
|
|
234
235
|
* @returns Nothing
|
|
235
236
|
*/
|
|
236
237
|
deleteWorkspaceInvitation(workspaceId: string, invitationId: string): Promise<void>;
|
|
238
|
+
/**
|
|
239
|
+
* Lists all untyped data for a given workspace.
|
|
240
|
+
* @param workspaceId - The ID of the workspace.
|
|
241
|
+
* @returns A promise that resolves to the list of untyped data.
|
|
242
|
+
*/
|
|
243
|
+
listUntypedData(workspaceId: string): Promise<DTOWorkspaceUntypedDataListResponse>;
|
|
244
|
+
/**
|
|
245
|
+
* Creates new untyped data in the specified workspace.
|
|
246
|
+
* @param workspaceId - The ID of the workspace.
|
|
247
|
+
* @param data - The data to create. Must be a valid JSON object.
|
|
248
|
+
* @returns A promise that resolves to the created untyped data.
|
|
249
|
+
*/
|
|
250
|
+
createUntypedData(workspaceId: string, data: any): Promise<DTOWorkspaceUntypedDataResponse>;
|
|
251
|
+
/**
|
|
252
|
+
* Deletes all untyped data in the specified workspace.
|
|
253
|
+
* @param workspaceId - The ID of the workspace.
|
|
254
|
+
* @returns A promise that resolves when the operation is complete.
|
|
255
|
+
*/
|
|
256
|
+
deleteAllUntypedData(workspaceId: string): Promise<void>;
|
|
257
|
+
/**
|
|
258
|
+
* Updates specific untyped data in the specified workspace.
|
|
259
|
+
* @param workspaceId - The ID of the workspace.
|
|
260
|
+
* @param id - The ID of the untyped data to update.
|
|
261
|
+
* @param data - The updated data. Must be a valid JSON object.
|
|
262
|
+
* @returns A promise that resolves to the updated untyped data.
|
|
263
|
+
*/
|
|
264
|
+
updateUntypedData(workspaceId: string, id: string, data: any): Promise<DTOWorkspaceUntypedDataResponse>;
|
|
265
|
+
/**
|
|
266
|
+
* Deletes specific untyped data in the specified workspace.
|
|
267
|
+
* @param workspaceId - The ID of the workspace.
|
|
268
|
+
* @param id - The ID of the untyped data to delete.
|
|
269
|
+
* @returns A promise that resolves when the operation is complete.
|
|
270
|
+
*/
|
|
271
|
+
deleteUntypedData(workspaceId: string, id: string): Promise<void>;
|
|
237
272
|
}
|
|
@@ -5,13 +5,15 @@ type DataBridgeRequestHookResult = {
|
|
|
5
5
|
export type DataBridgeRequestHook = (request: any) => void | DataBridgeRequestHookResult | Promise<void | DataBridgeRequestHookResult>;
|
|
6
6
|
export type DebugResponseObserver = (info: {
|
|
7
7
|
requestUrl: string;
|
|
8
|
-
response
|
|
8
|
+
response?: any;
|
|
9
9
|
executionTime: number;
|
|
10
|
-
error?:
|
|
10
|
+
error?: any;
|
|
11
11
|
}) => void;
|
|
12
12
|
export type DebugRequestObserver = (info: {
|
|
13
13
|
requestUrl: string;
|
|
14
14
|
requestMethod: string;
|
|
15
|
+
asData?: boolean;
|
|
16
|
+
isStreamed?: boolean;
|
|
15
17
|
}) => void;
|
|
16
18
|
export type DataBridgeConfiguration = {
|
|
17
19
|
apiUrl: string;
|
|
@@ -43,15 +45,20 @@ export declare class DataBridge {
|
|
|
43
45
|
constructor(conf: DataBridgeConfiguration);
|
|
44
46
|
delete(endpoint: string): Promise<any>;
|
|
45
47
|
get(endpoint: string): Promise<any>;
|
|
48
|
+
getStreamed(endpoint: string): Promise<ReadableStreamDefaultReader<Uint8Array>>;
|
|
46
49
|
getAsData(endpoint: string): Promise<any>;
|
|
47
50
|
put(endpoint: string, payload: any | null): Promise<any>;
|
|
48
51
|
post(endpoint: string, payload: any | null): Promise<any>;
|
|
52
|
+
postStreamed(endpoint: string, payload: any | null): Promise<ReadableStreamDefaultReader<Uint8Array>>;
|
|
49
53
|
upload(endpoint: string, formData: FormData, method?: "PUT" | "POST"): Promise<any>;
|
|
50
54
|
private request;
|
|
55
|
+
private streamedRequest;
|
|
51
56
|
private handleResponse;
|
|
57
|
+
private handleStreamedResponse;
|
|
52
58
|
private buildRequestConfig;
|
|
53
59
|
private getProxyAgent;
|
|
54
|
-
|
|
60
|
+
getFetchInvoker(): any;
|
|
61
|
+
getAIEndpoint(fragment: string | null): string;
|
|
55
62
|
getApiEndpoint(fragment: string | null): string;
|
|
56
63
|
getBaseEndpoint(fragment: string | null): string;
|
|
57
64
|
getPublicEndpoint(fragment: string): string;
|