@supernova-studio/supernova-sdk-beta 1.6.18 → 1.6.19
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 +5 -5
- package/build/sdk-typescript/src/core/areas/{SDKAreaPipelines.d.ts → SDKAreaAutomation.d.ts} +10 -2
- package/build/sdk-typescript/src/core/areas/SDKAreaDataSources.d.ts +23 -1
- package/build/sdk-typescript/src/core/areas/SDKAreaDesignSystems.d.ts +23 -0
- package/build/sdk-typescript/src/core/areas/SDKAreaIntegrations.d.ts +25 -0
- package/build/sdk-typescript/src/core/areas/SDKAreaWorkspaces.d.ts +7 -1
- package/build/sdk-typescript/src/core/data/SDKDataCore.d.ts +40 -4
- package/build/sdk-typescript/src/core/data/requests/SDKDataCoreReadRequests.d.ts +8 -3
- package/build/sdk-typescript/src/core/data/requests/SDKDataCoreWriteRequests.d.ts +23 -4
- package/build/sdk-typescript/src/model/enums/SDKImportJobOperation.d.ts +4 -0
- package/build/sdk-typescript/src/model/enums/SDKImportJobState.d.ts +6 -0
- package/build/sdk-typescript/src/model/jobs/SDKImportJob.d.ts +35 -0
- package/build/sdk-typescript/src/model/membership/SDKMembership.d.ts +1 -1
- package/build/sdk-typescript/src/model/users/SDKUserMembership.d.ts +18 -0
- package/build/sdk-typescript/src/model/workspaces/SDKWorkspaceSSOSettings.d.ts +2 -2
- package/build/sdk-typescript/src/tools/json-builder/elements-transformers/SDKToolsJSONElementTransformer.d.ts +1 -1
- package/build/supernova-sdk-typescript.js +586 -148
- package/build/supernova-sdk-typescript.js.map +1 -1
- package/package.json +1 -1
- /package/build/sdk-typescript/src/tests/{Enterprise/PluginFigmaTokens.spec.d.ts → Areas/AreaDesignSystems.spec.d.ts} +0 -0
|
@@ -34919,6 +34919,7 @@ exports.Supernova = void 0;
|
|
|
34919
34919
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
34920
34920
|
// MARK: - Imports
|
|
34921
34921
|
const SDKAreaAssets_1 = __webpack_require__(/*! ./areas/SDKAreaAssets */ "./src/core/areas/SDKAreaAssets.ts");
|
|
34922
|
+
const SDKAreaAutomation_1 = __webpack_require__(/*! ./areas/SDKAreaAutomation */ "./src/core/areas/SDKAreaAutomation.ts");
|
|
34922
34923
|
const SDKAreaBrands_1 = __webpack_require__(/*! ./areas/SDKAreaBrands */ "./src/core/areas/SDKAreaBrands.ts");
|
|
34923
34924
|
const SDKAreaBulkOperations_1 = __webpack_require__(/*! ./areas/SDKAreaBulkOperations */ "./src/core/areas/SDKAreaBulkOperations.ts");
|
|
34924
34925
|
const SDKAreaComponents_1 = __webpack_require__(/*! ./areas/SDKAreaComponents */ "./src/core/areas/SDKAreaComponents.ts");
|
|
@@ -34927,7 +34928,6 @@ const SDKAreaDesignSystems_1 = __webpack_require__(/*! ./areas/SDKAreaDesignSyst
|
|
|
34927
34928
|
const SDKAreaDocumentation_1 = __webpack_require__(/*! ./areas/SDKAreaDocumentation */ "./src/core/areas/SDKAreaDocumentation.ts");
|
|
34928
34929
|
const SDKAreaIntegrations_1 = __webpack_require__(/*! ./areas/SDKAreaIntegrations */ "./src/core/areas/SDKAreaIntegrations.ts");
|
|
34929
34930
|
const SDKAreaMe_1 = __webpack_require__(/*! ./areas/SDKAreaMe */ "./src/core/areas/SDKAreaMe.ts");
|
|
34930
|
-
const SDKAreaPipelines_1 = __webpack_require__(/*! ./areas/SDKAreaPipelines */ "./src/core/areas/SDKAreaPipelines.ts");
|
|
34931
34931
|
const SDKAreaTokens_1 = __webpack_require__(/*! ./areas/SDKAreaTokens */ "./src/core/areas/SDKAreaTokens.ts");
|
|
34932
34932
|
const SDKAreaUsers_1 = __webpack_require__(/*! ./areas/SDKAreaUsers */ "./src/core/areas/SDKAreaUsers.ts");
|
|
34933
34933
|
const SDKAreaVersions_1 = __webpack_require__(/*! ./areas/SDKAreaVersions */ "./src/core/areas/SDKAreaVersions.ts");
|
|
@@ -34962,9 +34962,9 @@ class Supernova {
|
|
|
34962
34962
|
this.components = new SDKAreaComponents_1.AreaComponents(this.dataCore);
|
|
34963
34963
|
this.assets = new SDKAreaAssets_1.AreaAssets(this.dataCore);
|
|
34964
34964
|
this.documentation = new SDKAreaDocumentation_1.AreaDocumentation(this.dataCore);
|
|
34965
|
-
this.
|
|
34965
|
+
this.automation = new SDKAreaAutomation_1.AreaAutomation(this.dataCore);
|
|
34966
34966
|
this.users = new SDKAreaUsers_1.AreaUsers(this.dataCore);
|
|
34967
|
-
this.
|
|
34967
|
+
this.integrations = new SDKAreaIntegrations_1.AreaIntegrations(this.dataCore);
|
|
34968
34968
|
this.dataSources = new SDKAreaDataSources_1.AreaDataSources(this.dataCore);
|
|
34969
34969
|
this.bulkOperations = new SDKAreaBulkOperations_1.AreaBulkOperations(this.dataCore);
|
|
34970
34970
|
}
|
|
@@ -35057,6 +35057,137 @@ class AreaAssets {
|
|
|
35057
35057
|
exports.AreaAssets = AreaAssets;
|
|
35058
35058
|
|
|
35059
35059
|
|
|
35060
|
+
/***/ }),
|
|
35061
|
+
|
|
35062
|
+
/***/ "./src/core/areas/SDKAreaAutomation.ts":
|
|
35063
|
+
/*!*********************************************!*\
|
|
35064
|
+
!*** ./src/core/areas/SDKAreaAutomation.ts ***!
|
|
35065
|
+
\*********************************************/
|
|
35066
|
+
/***/ (function(__unused_webpack_module, exports) {
|
|
35067
|
+
|
|
35068
|
+
"use strict";
|
|
35069
|
+
|
|
35070
|
+
//
|
|
35071
|
+
// AreaAutomation.ts
|
|
35072
|
+
// Supernova SDK
|
|
35073
|
+
//
|
|
35074
|
+
// Created by Jiri Trecak.
|
|
35075
|
+
//
|
|
35076
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
35077
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
35078
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
35079
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
35080
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35081
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
35082
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35083
|
+
});
|
|
35084
|
+
};
|
|
35085
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
35086
|
+
exports.AreaAutomation = void 0;
|
|
35087
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
35088
|
+
// MARK: - Automation Area
|
|
35089
|
+
class AreaAutomation {
|
|
35090
|
+
// --- --- --- --- --- --- --- --- --- ---
|
|
35091
|
+
// MARK: - Constructor
|
|
35092
|
+
constructor(dataCore) {
|
|
35093
|
+
this.dataCore = dataCore;
|
|
35094
|
+
}
|
|
35095
|
+
// --- --- --- --- --- --- --- --- --- ---
|
|
35096
|
+
// MARK: - Read
|
|
35097
|
+
/** Fetches exporters belonging to workspace by id */
|
|
35098
|
+
getExporters(workspaceId) {
|
|
35099
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35100
|
+
return this.dataCore.exporters(workspaceId);
|
|
35101
|
+
});
|
|
35102
|
+
}
|
|
35103
|
+
/** Fetches all custom configuration properties that specific exporter provides
|
|
35104
|
+
* @param exporterId - Identifier of the exporter to fetch configuration for
|
|
35105
|
+
* @param from - Remote version to fetch from
|
|
35106
|
+
* @returns All custom blocks
|
|
35107
|
+
*/
|
|
35108
|
+
getExporterConfiguration(workspaceId, exporterId, designSystemId) {
|
|
35109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35110
|
+
return this.dataCore.exporterConfigurationProperties(exporterId, workspaceId, designSystemId);
|
|
35111
|
+
});
|
|
35112
|
+
}
|
|
35113
|
+
/** Fetches all custom variants that specific exporter provides
|
|
35114
|
+
* @param workspaceId - Identifier of the workspace where the exporter is installed
|
|
35115
|
+
* @param exporterId - Identifier of the exporter to fetch configuration for
|
|
35116
|
+
* @returns All custom variants
|
|
35117
|
+
*/
|
|
35118
|
+
getExporterBlockVariants(workspaceId, exporterId) {
|
|
35119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35120
|
+
return this.dataCore.documentationExporterCustomVariants(workspaceId, exporterId);
|
|
35121
|
+
});
|
|
35122
|
+
}
|
|
35123
|
+
/** Publish documentation. This queues a build on Supernova's server that will be processed by the asynchronous CI/CD pipeline. You can request status of the build with associated `isBeingPublished` method. */
|
|
35124
|
+
publish(to, environment) {
|
|
35125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35126
|
+
// Check if doc is being published by downloading the latest documentation job. If so, prevent publishing
|
|
35127
|
+
const lastJob = yield this.isPublishing(to, environment);
|
|
35128
|
+
if (lastJob.status === "Idle") {
|
|
35129
|
+
const result = this.dataCore.documentationPublish(to.workspaceId, to.designSystemId, to.versionId, environment);
|
|
35130
|
+
return result;
|
|
35131
|
+
}
|
|
35132
|
+
return {
|
|
35133
|
+
status: "InProgress",
|
|
35134
|
+
jobId: lastJob.jobId,
|
|
35135
|
+
exporterId: lastJob.exporterId,
|
|
35136
|
+
};
|
|
35137
|
+
});
|
|
35138
|
+
}
|
|
35139
|
+
/** Publish documentation. This queues a build on Supernova's server that will be processed by the asynchronous CI/CD pipeline. You can request status of the build with associated `isBeingPublished` method. */
|
|
35140
|
+
isPublishing(to, environment) {
|
|
35141
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35142
|
+
const jobs = yield this.dataCore.documentationBuilds(to.workspaceId, to.designSystemId, to.versionId, environment, 1);
|
|
35143
|
+
const job = jobs[0];
|
|
35144
|
+
if (!job) {
|
|
35145
|
+
// Nothing published just yet
|
|
35146
|
+
return {
|
|
35147
|
+
status: "Idle",
|
|
35148
|
+
jobId: null,
|
|
35149
|
+
exporterId: null,
|
|
35150
|
+
};
|
|
35151
|
+
}
|
|
35152
|
+
if (job.status === "InProgress") {
|
|
35153
|
+
return {
|
|
35154
|
+
status: "InProgress",
|
|
35155
|
+
jobId: job.id,
|
|
35156
|
+
exporterId: job.exporterId,
|
|
35157
|
+
};
|
|
35158
|
+
}
|
|
35159
|
+
return {
|
|
35160
|
+
status: "Idle",
|
|
35161
|
+
jobId: null,
|
|
35162
|
+
exporterId: null,
|
|
35163
|
+
};
|
|
35164
|
+
});
|
|
35165
|
+
}
|
|
35166
|
+
/** Gets all import jobs that are currently in progress.
|
|
35167
|
+
* @param userId - User id to delete integration for. Can only be invoked on user id that is currently authenticated.
|
|
35168
|
+
* @returns Nothing
|
|
35169
|
+
*/
|
|
35170
|
+
getImportJobs(from) {
|
|
35171
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35172
|
+
return this.dataCore.getImportJobs(from.designSystemId, from.versionId);
|
|
35173
|
+
});
|
|
35174
|
+
}
|
|
35175
|
+
getImportJob(from, jobId) {
|
|
35176
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35177
|
+
return this.dataCore.getImportJob(from.designSystemId, from.versionId, jobId);
|
|
35178
|
+
});
|
|
35179
|
+
}
|
|
35180
|
+
// --- --- --- --- --- --- --- --- --- ---
|
|
35181
|
+
// MARK: - Create/Update
|
|
35182
|
+
scheduleImportJobForFigmaSources(from, sourceIds, dryRun = false) {
|
|
35183
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35184
|
+
return this.dataCore.scheduleImportJobForFigmaSources(from.designSystemId, from.versionId, sourceIds, dryRun);
|
|
35185
|
+
});
|
|
35186
|
+
}
|
|
35187
|
+
}
|
|
35188
|
+
exports.AreaAutomation = AreaAutomation;
|
|
35189
|
+
|
|
35190
|
+
|
|
35060
35191
|
/***/ }),
|
|
35061
35192
|
|
|
35062
35193
|
/***/ "./src/core/areas/SDKAreaBrands.ts":
|
|
@@ -35514,6 +35645,30 @@ class AreaDataSources {
|
|
|
35514
35645
|
return this.dataCore.designSystemSources(from.designSystemId);
|
|
35515
35646
|
});
|
|
35516
35647
|
}
|
|
35648
|
+
// --- --- --- --- --- --- --- --- --- ---
|
|
35649
|
+
// MARK: - Create/Update
|
|
35650
|
+
linkFigmaSource(from, url, options) {
|
|
35651
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35652
|
+
return this.dataCore.linkFigmaSource(from.designSystemId, from.brandId, url, options);
|
|
35653
|
+
});
|
|
35654
|
+
}
|
|
35655
|
+
updateFigmaSource(from, sourceId, options) {
|
|
35656
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35657
|
+
return this.dataCore.updateFigmaSource(from.designSystemId, sourceId, options);
|
|
35658
|
+
});
|
|
35659
|
+
}
|
|
35660
|
+
updateFigmaSourceClaimOwnership(from, sourceId) {
|
|
35661
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35662
|
+
return this.dataCore.updateFigmaSourceClaimOwnership(from.designSystemId, sourceId);
|
|
35663
|
+
});
|
|
35664
|
+
}
|
|
35665
|
+
// --- --- --- --- --- --- --- --- --- ---
|
|
35666
|
+
// MARK: - Delete
|
|
35667
|
+
deleteFigmaSource(from, sourceId) {
|
|
35668
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35669
|
+
return this.dataCore.deleteFigmaSource(from.designSystemId, sourceId);
|
|
35670
|
+
});
|
|
35671
|
+
}
|
|
35517
35672
|
}
|
|
35518
35673
|
exports.AreaDataSources = AreaDataSources;
|
|
35519
35674
|
|
|
@@ -35573,6 +35728,49 @@ class AreaDesignSystems {
|
|
|
35573
35728
|
return this.dataCore.designSystem(designSystemId);
|
|
35574
35729
|
});
|
|
35575
35730
|
}
|
|
35731
|
+
// --- --- --- --- --- --- --- --- --- ---
|
|
35732
|
+
// MARK: - Create/Update
|
|
35733
|
+
/** Creates a new design system and retrieves the newly created DS object
|
|
35734
|
+
* @param name - Name of the design system
|
|
35735
|
+
* @returns Newly created design system object
|
|
35736
|
+
*/
|
|
35737
|
+
createDesignSystem(workspaceId, name, description) {
|
|
35738
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35739
|
+
return this.dataCore.createDesignSystem(workspaceId, name, description);
|
|
35740
|
+
});
|
|
35741
|
+
}
|
|
35742
|
+
/** Updates design system metadata for a specific design system
|
|
35743
|
+
* @param designSystemId - ID of the design system
|
|
35744
|
+
* @param name - New DS name
|
|
35745
|
+
* @param description - New DS description
|
|
35746
|
+
* @returns Nothing
|
|
35747
|
+
*/
|
|
35748
|
+
updateDesignSystemMetadata(designSystemId, name, description) {
|
|
35749
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35750
|
+
return this.dataCore.updateDesignSystemMetadata(designSystemId, name, description);
|
|
35751
|
+
});
|
|
35752
|
+
}
|
|
35753
|
+
/** Enabled or disables multibrand functionality for a specific design system
|
|
35754
|
+
* @param designSystemId - ID of the design system
|
|
35755
|
+
* @param isMultibrand - Multibrand functionality enabled or disabled
|
|
35756
|
+
* @returns Nothing
|
|
35757
|
+
*/
|
|
35758
|
+
updateDesignSystemIsMultibrand(designSystem, isMultibrand) {
|
|
35759
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35760
|
+
return this.dataCore.updateDesignSystemIsMultibrand(designSystem, isMultibrand);
|
|
35761
|
+
});
|
|
35762
|
+
}
|
|
35763
|
+
// --- --- --- --- --- --- --- --- --- ---
|
|
35764
|
+
// MARK: - Delete
|
|
35765
|
+
/** Deletes a design system. This action is irreversible, all data will be lost, and can only be performed by the admins of the workspace
|
|
35766
|
+
* @param designSystemId - ID of the design system
|
|
35767
|
+
* @returns Nothing. RIP design system.
|
|
35768
|
+
*/
|
|
35769
|
+
deleteDesignSystem(designSystemId) {
|
|
35770
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35771
|
+
return this.dataCore.deleteDesignSystem(designSystemId);
|
|
35772
|
+
});
|
|
35773
|
+
}
|
|
35576
35774
|
}
|
|
35577
35775
|
exports.AreaDesignSystems = AreaDesignSystems;
|
|
35578
35776
|
|
|
@@ -35765,6 +35963,55 @@ class AreaIntegrations {
|
|
|
35765
35963
|
return this.dataCore.getOAuthURL("azure");
|
|
35766
35964
|
});
|
|
35767
35965
|
}
|
|
35966
|
+
// --- --- --- --- --- --- --- --- --- ---
|
|
35967
|
+
// MARK: - Create/Update
|
|
35968
|
+
// --- --- --- --- --- --- --- --- --- ---
|
|
35969
|
+
// MARK: - Delete
|
|
35970
|
+
/** Deletes user Figma OAuth integration.
|
|
35971
|
+
* @param userId - User id to delete integration for. Can only be invoked on user id that is currently authenticated.
|
|
35972
|
+
* @returns Nothing
|
|
35973
|
+
*/
|
|
35974
|
+
deleteFigmaOAuthIntegration(userId) {
|
|
35975
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35976
|
+
return this.dataCore.deleteOAuthIntegration(userId, "figma");
|
|
35977
|
+
});
|
|
35978
|
+
}
|
|
35979
|
+
/** Deletes user GitHub OAuth integration.
|
|
35980
|
+
* @param userId - User id to delete integration for. Can only be invoked on user id that is currently authenticated.
|
|
35981
|
+
* @returns Nothing
|
|
35982
|
+
*/
|
|
35983
|
+
deleteGitHubOAuthIntegration(userId) {
|
|
35984
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35985
|
+
return this.dataCore.deleteOAuthIntegration(userId, "github");
|
|
35986
|
+
});
|
|
35987
|
+
}
|
|
35988
|
+
/** Deletes user GitLab OAuth integration.
|
|
35989
|
+
* @param userId - User id to delete integration for. Can only be invoked on user id that is currently authenticated.
|
|
35990
|
+
* @returns Nothing
|
|
35991
|
+
*/
|
|
35992
|
+
deleteGitLabOAuthIntegration(userId) {
|
|
35993
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35994
|
+
return this.dataCore.deleteOAuthIntegration(userId, "gitlab");
|
|
35995
|
+
});
|
|
35996
|
+
}
|
|
35997
|
+
/** Deletes user Bitbucket OAuth integration.
|
|
35998
|
+
* @param userId - User id to delete integration for. Can only be invoked on user id that is currently authenticated.
|
|
35999
|
+
* @returns Nothing
|
|
36000
|
+
*/
|
|
36001
|
+
deleteBitbucketOAuthIntegration(userId) {
|
|
36002
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36003
|
+
return this.dataCore.deleteOAuthIntegration(userId, "bitbucket");
|
|
36004
|
+
});
|
|
36005
|
+
}
|
|
36006
|
+
/** Deletes user Azure OAuth integration.
|
|
36007
|
+
* @param userId - User id to delete integration for. Can only be invoked on user id that is currently authenticated.
|
|
36008
|
+
* @returns Nothing
|
|
36009
|
+
*/
|
|
36010
|
+
deleteAzureOAuthIntegration(userId) {
|
|
36011
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36012
|
+
return this.dataCore.deleteOAuthIntegration(userId, "azure");
|
|
36013
|
+
});
|
|
36014
|
+
}
|
|
35768
36015
|
}
|
|
35769
36016
|
exports.AreaIntegrations = AreaIntegrations;
|
|
35770
36017
|
|
|
@@ -35856,116 +36103,6 @@ class AreaMe {
|
|
|
35856
36103
|
exports.AreaMe = AreaMe;
|
|
35857
36104
|
|
|
35858
36105
|
|
|
35859
|
-
/***/ }),
|
|
35860
|
-
|
|
35861
|
-
/***/ "./src/core/areas/SDKAreaPipelines.ts":
|
|
35862
|
-
/*!********************************************!*\
|
|
35863
|
-
!*** ./src/core/areas/SDKAreaPipelines.ts ***!
|
|
35864
|
-
\********************************************/
|
|
35865
|
-
/***/ (function(__unused_webpack_module, exports) {
|
|
35866
|
-
|
|
35867
|
-
"use strict";
|
|
35868
|
-
|
|
35869
|
-
//
|
|
35870
|
-
// AreaPipelines.ts
|
|
35871
|
-
// Supernova SDK
|
|
35872
|
-
//
|
|
35873
|
-
// Created by Jiri Trecak.
|
|
35874
|
-
//
|
|
35875
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
35876
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
35877
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
35878
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
35879
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35880
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
35881
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35882
|
-
});
|
|
35883
|
-
};
|
|
35884
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
35885
|
-
exports.AreaPipelines = void 0;
|
|
35886
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
35887
|
-
// MARK: - Pipelines Area
|
|
35888
|
-
class AreaPipelines {
|
|
35889
|
-
// --- --- --- --- --- --- --- --- --- ---
|
|
35890
|
-
// MARK: - Constructor
|
|
35891
|
-
constructor(dataCore) {
|
|
35892
|
-
this.dataCore = dataCore;
|
|
35893
|
-
}
|
|
35894
|
-
// --- --- --- --- --- --- --- --- --- ---
|
|
35895
|
-
// MARK: - Read
|
|
35896
|
-
/** Fetches exporters belonging to workspace by id */
|
|
35897
|
-
getExporters(workspaceId) {
|
|
35898
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
35899
|
-
return this.dataCore.exporters(workspaceId);
|
|
35900
|
-
});
|
|
35901
|
-
}
|
|
35902
|
-
/** Fetches all custom configuration properties that specific exporter provides
|
|
35903
|
-
* @param exporterId - Identifier of the exporter to fetch configuration for
|
|
35904
|
-
* @param from - Remote version to fetch from
|
|
35905
|
-
* @returns All custom blocks
|
|
35906
|
-
*/
|
|
35907
|
-
getExporterConfiguration(workspaceId, exporterId, designSystemId) {
|
|
35908
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
35909
|
-
return this.dataCore.exporterConfigurationProperties(exporterId, workspaceId, designSystemId);
|
|
35910
|
-
});
|
|
35911
|
-
}
|
|
35912
|
-
/** Fetches all custom variants that specific exporter provides
|
|
35913
|
-
* @param workspaceId - Identifier of the workspace where the exporter is installed
|
|
35914
|
-
* @param exporterId - Identifier of the exporter to fetch configuration for
|
|
35915
|
-
* @returns All custom variants
|
|
35916
|
-
*/
|
|
35917
|
-
getExporterBlockVariants(workspaceId, exporterId) {
|
|
35918
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
35919
|
-
return this.dataCore.documentationExporterCustomVariants(workspaceId, exporterId);
|
|
35920
|
-
});
|
|
35921
|
-
}
|
|
35922
|
-
/** Publish documentation. This queues a build on Supernova's server that will be processed by the asynchronous CI/CD pipeline. You can request status of the build with associated `isBeingPublished` method. */
|
|
35923
|
-
publish(to, environment) {
|
|
35924
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
35925
|
-
// Check if doc is being published by downloading the latest documentation job. If so, prevent publishing
|
|
35926
|
-
const lastJob = yield this.isPublishing(to, environment);
|
|
35927
|
-
if (lastJob.status === "Idle") {
|
|
35928
|
-
const result = this.dataCore.documentationPublish(to.workspaceId, to.designSystemId, to.versionId, environment);
|
|
35929
|
-
return result;
|
|
35930
|
-
}
|
|
35931
|
-
return {
|
|
35932
|
-
status: "InProgress",
|
|
35933
|
-
jobId: lastJob.jobId,
|
|
35934
|
-
exporterId: lastJob.exporterId,
|
|
35935
|
-
};
|
|
35936
|
-
});
|
|
35937
|
-
}
|
|
35938
|
-
/** Publish documentation. This queues a build on Supernova's server that will be processed by the asynchronous CI/CD pipeline. You can request status of the build with associated `isBeingPublished` method. */
|
|
35939
|
-
isPublishing(to, environment) {
|
|
35940
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
35941
|
-
const jobs = yield this.dataCore.documentationBuilds(to.workspaceId, to.designSystemId, to.versionId, environment, 1);
|
|
35942
|
-
const job = jobs[0];
|
|
35943
|
-
if (!job) {
|
|
35944
|
-
// Nothing published just yet
|
|
35945
|
-
return {
|
|
35946
|
-
status: "Idle",
|
|
35947
|
-
jobId: null,
|
|
35948
|
-
exporterId: null,
|
|
35949
|
-
};
|
|
35950
|
-
}
|
|
35951
|
-
if (job.status === "InProgress") {
|
|
35952
|
-
return {
|
|
35953
|
-
status: "InProgress",
|
|
35954
|
-
jobId: job.id,
|
|
35955
|
-
exporterId: job.exporterId,
|
|
35956
|
-
};
|
|
35957
|
-
}
|
|
35958
|
-
return {
|
|
35959
|
-
status: "Idle",
|
|
35960
|
-
jobId: null,
|
|
35961
|
-
exporterId: null,
|
|
35962
|
-
};
|
|
35963
|
-
});
|
|
35964
|
-
}
|
|
35965
|
-
}
|
|
35966
|
-
exports.AreaPipelines = AreaPipelines;
|
|
35967
|
-
|
|
35968
|
-
|
|
35969
36106
|
/***/ }),
|
|
35970
36107
|
|
|
35971
36108
|
/***/ "./src/core/areas/SDKAreaTokenValues.ts":
|
|
@@ -36777,14 +36914,21 @@ class AreaVersions {
|
|
|
36777
36914
|
}
|
|
36778
36915
|
getTokenStudioData(from) {
|
|
36779
36916
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36780
|
-
return
|
|
36917
|
+
return {};
|
|
36918
|
+
// return this.dataCore.getTokenStudioData(from.designSystemId, from.versionId)
|
|
36781
36919
|
});
|
|
36782
36920
|
}
|
|
36783
36921
|
// --- --- --- --- --- --- --- --- --- ---
|
|
36784
36922
|
// MARK: - Create/Update
|
|
36785
36923
|
writeTokenStudioData(from, data) {
|
|
36786
36924
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36787
|
-
return
|
|
36925
|
+
return false;
|
|
36926
|
+
/*
|
|
36927
|
+
return this.dataCore.writeTokenStudioData(
|
|
36928
|
+
from.designSystemId,
|
|
36929
|
+
from.versionId,
|
|
36930
|
+
data
|
|
36931
|
+
) */
|
|
36788
36932
|
});
|
|
36789
36933
|
}
|
|
36790
36934
|
}
|
|
@@ -36857,6 +37001,16 @@ class AreaWorkspaces {
|
|
|
36857
37001
|
return memberships;
|
|
36858
37002
|
});
|
|
36859
37003
|
}
|
|
37004
|
+
/** Fetches all users that are part of the workspace. Each user contains user role as well.
|
|
37005
|
+
* @param workspaceId - ID of the workspace
|
|
37006
|
+
* @returns All users that are members of the provided workspace
|
|
37007
|
+
*/
|
|
37008
|
+
userMemberships(workspaceId) {
|
|
37009
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37010
|
+
const memberships = yield this.dataCore.userMemberships(workspaceId);
|
|
37011
|
+
return memberships;
|
|
37012
|
+
});
|
|
37013
|
+
}
|
|
36860
37014
|
subscriptionProductFeatures() {
|
|
36861
37015
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36862
37016
|
return this.dataCore.subscriptionProductFeatures();
|
|
@@ -37296,6 +37450,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
37296
37450
|
};
|
|
37297
37451
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
37298
37452
|
exports.DataCore = void 0;
|
|
37453
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
37454
|
+
// MARK: - Imports
|
|
37299
37455
|
const SDKAcl_1 = __webpack_require__(/*! ../../model/acl/SDKAcl */ "./src/model/acl/SDKAcl.ts");
|
|
37300
37456
|
const SDKAsset_1 = __webpack_require__(/*! ../../model/assets/SDKAsset */ "./src/model/assets/SDKAsset.ts");
|
|
37301
37457
|
const SDKBrand_1 = __webpack_require__(/*! ../../model/base/SDKBrand */ "./src/model/base/SDKBrand.ts");
|
|
@@ -37308,9 +37464,11 @@ const SDKElementProperty_1 = __webpack_require__(/*! ../../model/elements/SDKEle
|
|
|
37308
37464
|
const SDKElementPropertyValue_1 = __webpack_require__(/*! ../../model/elements/values/SDKElementPropertyValue */ "./src/model/elements/values/SDKElementPropertyValue.ts");
|
|
37309
37465
|
const SDKExporterCustomBlock_1 = __webpack_require__(/*! ../../model/exporters/custom_blocks/SDKExporterCustomBlock */ "./src/model/exporters/custom_blocks/SDKExporterCustomBlock.ts");
|
|
37310
37466
|
const SDKExporter_1 = __webpack_require__(/*! ../../model/exporters/SDKExporter */ "./src/model/exporters/SDKExporter.ts");
|
|
37467
|
+
const SDKImportJob_1 = __webpack_require__(/*! ../../model/jobs/SDKImportJob */ "./src/model/jobs/SDKImportJob.ts");
|
|
37311
37468
|
const SDKMembership_1 = __webpack_require__(/*! ../../model/membership/SDKMembership */ "./src/model/membership/SDKMembership.ts");
|
|
37312
37469
|
const SDKSource_1 = __webpack_require__(/*! ../../model/support/SDKSource */ "./src/model/support/SDKSource.ts");
|
|
37313
37470
|
const SDKUser_1 = __webpack_require__(/*! ../../model/users/SDKUser */ "./src/model/users/SDKUser.ts");
|
|
37471
|
+
const SDKUserMembership_1 = __webpack_require__(/*! ../../model/users/SDKUserMembership */ "./src/model/users/SDKUserMembership.ts");
|
|
37314
37472
|
const SDKWorkspace_1 = __webpack_require__(/*! ../../model/workspaces/SDKWorkspace */ "./src/model/workspaces/SDKWorkspace.ts");
|
|
37315
37473
|
const SDKWorkspaceIPWhitelistSettings_1 = __webpack_require__(/*! ../../model/workspaces/SDKWorkspaceIPWhitelistSettings */ "./src/model/workspaces/SDKWorkspaceIPWhitelistSettings.ts");
|
|
37316
37474
|
const SDKWorkspaceNPMRegistrySettings_1 = __webpack_require__(/*! ../../model/workspaces/SDKWorkspaceNPMRegistrySettings */ "./src/model/workspaces/SDKWorkspaceNPMRegistrySettings.ts");
|
|
@@ -37339,7 +37497,7 @@ class DataCore {
|
|
|
37339
37497
|
this.render = new SDKDataCoreRenderRequests_1.DataCoreRenderRequests(bridge);
|
|
37340
37498
|
}
|
|
37341
37499
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
37342
|
-
// MARK: -
|
|
37500
|
+
// MARK: - Users
|
|
37343
37501
|
/** Remote: Get information about currently logged in user */
|
|
37344
37502
|
currentUser() {
|
|
37345
37503
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -37361,6 +37519,13 @@ class DataCore {
|
|
|
37361
37519
|
return data.map((m) => new SDKMembership_1.Membership(m));
|
|
37362
37520
|
});
|
|
37363
37521
|
}
|
|
37522
|
+
/** Remote: Get information about all workspaces user has access to, including which role they play */
|
|
37523
|
+
userMemberships(workspaceId) {
|
|
37524
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37525
|
+
const data = yield this.read.getRemoteUserMemberships(workspaceId);
|
|
37526
|
+
return data.map((m) => new SDKUserMembership_1.UserMembership(m));
|
|
37527
|
+
});
|
|
37528
|
+
}
|
|
37364
37529
|
subscriptionProductFeatures() {
|
|
37365
37530
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37366
37531
|
const data = yield this.read.getRemoteSubscriptionProductFeatures();
|
|
@@ -38164,6 +38329,31 @@ class DataCore {
|
|
|
38164
38329
|
return data.map((d) => new SDKDesignSystem_1.DesignSystem(d));
|
|
38165
38330
|
});
|
|
38166
38331
|
}
|
|
38332
|
+
/** Creates a design system */
|
|
38333
|
+
createDesignSystem(workspaceId, name, description) {
|
|
38334
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38335
|
+
const data = yield this.write.createRemoteDesignSystem(workspaceId, name, description);
|
|
38336
|
+
return new SDKDesignSystem_1.DesignSystem(data);
|
|
38337
|
+
});
|
|
38338
|
+
}
|
|
38339
|
+
/** Updates a design system metadata */
|
|
38340
|
+
updateDesignSystemMetadata(designSystemId, name, description) {
|
|
38341
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38342
|
+
yield this.write.updateRemoteDesignSystemMetadata(designSystemId, name, description);
|
|
38343
|
+
});
|
|
38344
|
+
}
|
|
38345
|
+
/** Updates a design system multibrand option */
|
|
38346
|
+
updateDesignSystemIsMultibrand(designSystem, isMultibrand) {
|
|
38347
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38348
|
+
yield this.write.updateRemoteDesignSystemIsMultibrand(designSystem, isMultibrand);
|
|
38349
|
+
});
|
|
38350
|
+
}
|
|
38351
|
+
/** Delete a design system */
|
|
38352
|
+
deleteDesignSystem(designSystemId) {
|
|
38353
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38354
|
+
yield this.write.deleteDesignSystem(designSystemId);
|
|
38355
|
+
});
|
|
38356
|
+
}
|
|
38167
38357
|
/** Download information about a desing system source within a design system design and retrieve it resolved */
|
|
38168
38358
|
designSystemSource(designSystemId, sourceId) {
|
|
38169
38359
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -38178,6 +38368,48 @@ class DataCore {
|
|
|
38178
38368
|
return data.map((d) => new SDKSource_1.Source(d));
|
|
38179
38369
|
});
|
|
38180
38370
|
}
|
|
38371
|
+
deleteFigmaSource(designSystemId, sourceId) {
|
|
38372
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38373
|
+
return this.write.deleteRemoteSource(designSystemId, sourceId);
|
|
38374
|
+
});
|
|
38375
|
+
}
|
|
38376
|
+
linkFigmaSource(designSystemId, brandId, url, options) {
|
|
38377
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38378
|
+
const payload = {
|
|
38379
|
+
figmaFileUrl: url,
|
|
38380
|
+
autoImportMode: options.autoImport,
|
|
38381
|
+
brandId,
|
|
38382
|
+
scopes: options.scopes,
|
|
38383
|
+
};
|
|
38384
|
+
if (options.themeId) {
|
|
38385
|
+
payload.themeId = options.themeId;
|
|
38386
|
+
}
|
|
38387
|
+
const data = yield this.write.linkFigmaSource(designSystemId, payload);
|
|
38388
|
+
return new SDKSource_1.Source(data);
|
|
38389
|
+
});
|
|
38390
|
+
}
|
|
38391
|
+
updateFigmaSource(designSystemId, sourceId, options) {
|
|
38392
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38393
|
+
const payload = {};
|
|
38394
|
+
if (options.scopes) {
|
|
38395
|
+
payload.scopes = options.scopes;
|
|
38396
|
+
}
|
|
38397
|
+
if (options.hasOwnProperty("autoImport")) {
|
|
38398
|
+
payload.autoImportMode = options.autoImport;
|
|
38399
|
+
}
|
|
38400
|
+
if (options.hasOwnProperty("themeId")) {
|
|
38401
|
+
payload.themeId = options.themeId;
|
|
38402
|
+
}
|
|
38403
|
+
const data = yield this.write.updateFigmaSource(designSystemId, sourceId, payload);
|
|
38404
|
+
return new SDKSource_1.Source(data);
|
|
38405
|
+
});
|
|
38406
|
+
}
|
|
38407
|
+
updateFigmaSourceClaimOwnership(designSystemId, sourceId) {
|
|
38408
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38409
|
+
const data = yield this.write.updateFigmaSourceClaimOwnership(designSystemId, sourceId);
|
|
38410
|
+
return new SDKSource_1.Source(data);
|
|
38411
|
+
});
|
|
38412
|
+
}
|
|
38181
38413
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
38182
38414
|
// MARK: - Versions
|
|
38183
38415
|
versions(designSystemId) {
|
|
@@ -38211,6 +38443,9 @@ class DataCore {
|
|
|
38211
38443
|
getOAuthURL(service) {
|
|
38212
38444
|
return this.read.getOAuthURL(service);
|
|
38213
38445
|
}
|
|
38446
|
+
deleteOAuthIntegration(userId, service) {
|
|
38447
|
+
return this.write.deleteOAuthIntegration(userId, service);
|
|
38448
|
+
}
|
|
38214
38449
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
38215
38450
|
// MARK: - Transactions
|
|
38216
38451
|
bulkUpdateTokenData(designSystemId, versionId, data) {
|
|
@@ -38293,15 +38528,23 @@ class DataCore {
|
|
|
38293
38528
|
});
|
|
38294
38529
|
}
|
|
38295
38530
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
38296
|
-
// MARK: -
|
|
38297
|
-
|
|
38531
|
+
// MARK: - Automation
|
|
38532
|
+
getImportJob(designSystemId, versionId, jobId) {
|
|
38298
38533
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38299
|
-
|
|
38534
|
+
const data = yield this.read.getImportJob(designSystemId, versionId, jobId);
|
|
38535
|
+
return new SDKImportJob_1.ImportJob(data);
|
|
38300
38536
|
});
|
|
38301
38537
|
}
|
|
38302
|
-
|
|
38538
|
+
getImportJobs(designSystemId, versionId) {
|
|
38303
38539
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38304
|
-
|
|
38540
|
+
const data = yield this.read.getImportJobs(designSystemId, versionId);
|
|
38541
|
+
return data.map((d) => new SDKImportJob_1.ImportJob(d));
|
|
38542
|
+
});
|
|
38543
|
+
}
|
|
38544
|
+
scheduleImportJobForFigmaSources(designSystemId, versionId, sourceIds, dryRun) {
|
|
38545
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38546
|
+
const data = yield this.write.scheduleImportJobForFigmaSources(designSystemId, versionId, sourceIds, dryRun);
|
|
38547
|
+
return new SDKImportJob_1.ImportJob(data);
|
|
38305
38548
|
});
|
|
38306
38549
|
}
|
|
38307
38550
|
}
|
|
@@ -38362,7 +38605,7 @@ class DataCoreReadRequests {
|
|
|
38362
38605
|
return payload.result.user;
|
|
38363
38606
|
});
|
|
38364
38607
|
}
|
|
38365
|
-
/** Remote: Get information about all workspaces user
|
|
38608
|
+
/** Remote: Get information about all workspaces user can access */
|
|
38366
38609
|
getRemoteMemberships(userId) {
|
|
38367
38610
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38368
38611
|
const endpoint = this.bridge.getUserEndpoint(userId, "workspaces");
|
|
@@ -38404,6 +38647,14 @@ class DataCoreReadRequests {
|
|
|
38404
38647
|
return payload.result.status === "OK";
|
|
38405
38648
|
});
|
|
38406
38649
|
}
|
|
38650
|
+
/** Remote: Get all users memberships */
|
|
38651
|
+
getRemoteUserMemberships(workspaceId) {
|
|
38652
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38653
|
+
const endpoint = this.bridge.getWorkspaceEndpoint(workspaceId, "members");
|
|
38654
|
+
const payload = yield this.bridge.get(endpoint);
|
|
38655
|
+
return payload.result.members;
|
|
38656
|
+
});
|
|
38657
|
+
}
|
|
38407
38658
|
/** Remote: Get information about the state of workspace onboarding, what was completed and what not */
|
|
38408
38659
|
getRemoteWorkspaceOnboarding(workspaceId) {
|
|
38409
38660
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -38459,7 +38710,7 @@ class DataCoreReadRequests {
|
|
|
38459
38710
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38460
38711
|
const endpoint = this.bridge.getDesignSystemEndpoint(designSystemId, `sources/${sourceId}`);
|
|
38461
38712
|
const payload = yield this.bridge.get(endpoint);
|
|
38462
|
-
return payload.result.
|
|
38713
|
+
return payload.result.source;
|
|
38463
38714
|
});
|
|
38464
38715
|
}
|
|
38465
38716
|
/** Remote: Get all design sources of a single design system */
|
|
@@ -38736,12 +38987,19 @@ class DataCoreReadRequests {
|
|
|
38736
38987
|
});
|
|
38737
38988
|
}
|
|
38738
38989
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
38739
|
-
// MARK: -
|
|
38740
|
-
|
|
38990
|
+
// MARK: - Automation
|
|
38991
|
+
getImportJobs(designSystemId, versionId) {
|
|
38741
38992
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38742
|
-
const endpoint = this.bridge.getVersionEndpoint(designSystemId, versionId, "
|
|
38993
|
+
const endpoint = this.bridge.getVersionEndpoint(designSystemId, versionId, "import-jobs");
|
|
38743
38994
|
const payload = yield this.bridge.get(endpoint);
|
|
38744
|
-
return payload.result;
|
|
38995
|
+
return payload.result.jobs;
|
|
38996
|
+
});
|
|
38997
|
+
}
|
|
38998
|
+
getImportJob(designSystemId, versionId, jobId) {
|
|
38999
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39000
|
+
const endpoint = this.bridge.getVersionEndpoint(designSystemId, versionId, `import-jobs/${jobId}`);
|
|
39001
|
+
const payload = yield this.bridge.get(endpoint);
|
|
39002
|
+
return payload.result.job;
|
|
38745
39003
|
});
|
|
38746
39004
|
}
|
|
38747
39005
|
}
|
|
@@ -38908,7 +39166,7 @@ class DataCoreWriteRequests {
|
|
|
38908
39166
|
return true;
|
|
38909
39167
|
});
|
|
38910
39168
|
}
|
|
38911
|
-
/** Remote: Updates the user profile of specified user.
|
|
39169
|
+
/** Remote: Updates the user profile of specified user. This call can only be used on the user who is authenticated with the token */
|
|
38912
39170
|
updateRemoteUserProfile(profile, userId) {
|
|
38913
39171
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38914
39172
|
const endpoint = this.bridge.getUserEndpoint(userId, "profile");
|
|
@@ -39015,6 +39273,55 @@ class DataCoreWriteRequests {
|
|
|
39015
39273
|
});
|
|
39016
39274
|
}
|
|
39017
39275
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
39276
|
+
// MARK: - Design System
|
|
39277
|
+
/** Remote: Creates a new design system */
|
|
39278
|
+
createRemoteDesignSystem(workspaceId, name, description) {
|
|
39279
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39280
|
+
const endpoint = this.bridge.getBaseEndpoint("design-systems");
|
|
39281
|
+
const payload = yield this.bridge.post(endpoint, {
|
|
39282
|
+
meta: {
|
|
39283
|
+
name,
|
|
39284
|
+
description: description !== null && description !== void 0 ? description : "",
|
|
39285
|
+
},
|
|
39286
|
+
workspaceId,
|
|
39287
|
+
});
|
|
39288
|
+
return payload.result.designSystem;
|
|
39289
|
+
});
|
|
39290
|
+
}
|
|
39291
|
+
/** Remote: Updates a design system metadata */
|
|
39292
|
+
updateRemoteDesignSystemMetadata(designSystemId, name, description) {
|
|
39293
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39294
|
+
const endpoint = this.bridge.getDesignSystemEndpoint(designSystemId, undefined);
|
|
39295
|
+
yield this.bridge.put(endpoint, {
|
|
39296
|
+
meta: {
|
|
39297
|
+
name,
|
|
39298
|
+
description: description !== null && description !== void 0 ? description : "",
|
|
39299
|
+
},
|
|
39300
|
+
});
|
|
39301
|
+
});
|
|
39302
|
+
}
|
|
39303
|
+
/** Remote: Updates a design system multibrand capabilities */
|
|
39304
|
+
updateRemoteDesignSystemIsMultibrand(designSystem, isMultibrand) {
|
|
39305
|
+
var _a;
|
|
39306
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39307
|
+
const endpoint = this.bridge.getDesignSystemEndpoint(designSystem.id, undefined);
|
|
39308
|
+
yield this.bridge.put(endpoint, {
|
|
39309
|
+
isMultibrand,
|
|
39310
|
+
meta: {
|
|
39311
|
+
name: designSystem.name,
|
|
39312
|
+
description: (_a = designSystem.description) !== null && _a !== void 0 ? _a : "",
|
|
39313
|
+
},
|
|
39314
|
+
});
|
|
39315
|
+
});
|
|
39316
|
+
}
|
|
39317
|
+
/** Remote: Deletes a design system */
|
|
39318
|
+
deleteDesignSystem(designSystemId) {
|
|
39319
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39320
|
+
const endpoint = this.bridge.getDesignSystemEndpoint(designSystemId, null);
|
|
39321
|
+
return this.bridge.delete(endpoint);
|
|
39322
|
+
});
|
|
39323
|
+
}
|
|
39324
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
39018
39325
|
// MARK: - Documentation
|
|
39019
39326
|
publishDocumentation(workspaceId, designSystemId, versionId, environment) {
|
|
39020
39327
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -39022,7 +39329,7 @@ class DataCoreWriteRequests {
|
|
|
39022
39329
|
const payload = {
|
|
39023
39330
|
designSystemId,
|
|
39024
39331
|
designSystemVersionId: versionId,
|
|
39025
|
-
environment
|
|
39332
|
+
environment,
|
|
39026
39333
|
};
|
|
39027
39334
|
const response = yield this.bridge.post(endpoint, payload);
|
|
39028
39335
|
const result = response.result.job;
|
|
@@ -39295,12 +39602,56 @@ class DataCoreWriteRequests {
|
|
|
39295
39602
|
});
|
|
39296
39603
|
}
|
|
39297
39604
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
39298
|
-
// MARK: -
|
|
39299
|
-
|
|
39605
|
+
// MARK: - Integrations
|
|
39606
|
+
/** Remote: Deletes a OAuth integration */
|
|
39607
|
+
deleteOAuthIntegration(userId, service) {
|
|
39300
39608
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39301
|
-
const endpoint = this.bridge.
|
|
39302
|
-
yield this.bridge.
|
|
39303
|
-
|
|
39609
|
+
const endpoint = this.bridge.getBaseEndpoint(`users/${userId}/integration/${service}`);
|
|
39610
|
+
yield this.bridge.delete(endpoint);
|
|
39611
|
+
});
|
|
39612
|
+
}
|
|
39613
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
39614
|
+
// MARK: - Jobs
|
|
39615
|
+
/** Remote: Schedules import job */
|
|
39616
|
+
scheduleImportJobForFigmaSources(designSystemId, versionId, sourceIds, dryRun) {
|
|
39617
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39618
|
+
const endpoint = this.bridge.getVersionEndpoint(designSystemId, versionId, "cloud-import");
|
|
39619
|
+
const data = {
|
|
39620
|
+
sourceIds,
|
|
39621
|
+
dryRun,
|
|
39622
|
+
};
|
|
39623
|
+
const payload = yield this.bridge.post(endpoint, data);
|
|
39624
|
+
return payload.result.token;
|
|
39625
|
+
});
|
|
39626
|
+
}
|
|
39627
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
39628
|
+
// MARK: - Sources
|
|
39629
|
+
/** Remote: Deletes a remote data source */
|
|
39630
|
+
deleteRemoteSource(designSystemId, sourceId) {
|
|
39631
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39632
|
+
const endpoint = this.bridge.getDesignSystemEndpoint(designSystemId, `sources/${sourceId}`);
|
|
39633
|
+
return this.bridge.delete(endpoint);
|
|
39634
|
+
});
|
|
39635
|
+
}
|
|
39636
|
+
linkFigmaSource(designSystemId, data) {
|
|
39637
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39638
|
+
const endpoint = this.bridge.getDesignSystemEndpoint(designSystemId, `sources`);
|
|
39639
|
+
const payload = yield this.bridge.post(endpoint, data);
|
|
39640
|
+
return payload.result.source;
|
|
39641
|
+
});
|
|
39642
|
+
}
|
|
39643
|
+
updateFigmaSource(designSystemId, sourceId, data) {
|
|
39644
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39645
|
+
const endpoint = this.bridge.getDesignSystemEndpoint(designSystemId, `sources/${sourceId}`);
|
|
39646
|
+
const payload = yield this.bridge.put(endpoint, data);
|
|
39647
|
+
return payload.result.source;
|
|
39648
|
+
});
|
|
39649
|
+
}
|
|
39650
|
+
updateFigmaSourceClaimOwnership(designSystemId, sourceId) {
|
|
39651
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39652
|
+
const endpoint = this.bridge.getDesignSystemEndpoint(designSystemId, `sources/${sourceId}/ownership`);
|
|
39653
|
+
const payload = yield this.bridge.put(endpoint, {});
|
|
39654
|
+
return payload.result.source;
|
|
39304
39655
|
});
|
|
39305
39656
|
}
|
|
39306
39657
|
}
|
|
@@ -43965,10 +44316,9 @@ class DocumentationBlockBuilder {
|
|
|
43965
44316
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
43966
44317
|
// MARK: - Static
|
|
43967
44318
|
static fromGenericModel(model, customBlocks, configuration) {
|
|
44319
|
+
var _a;
|
|
43968
44320
|
// Map children. Children that are not supported by the data model natively should be ignored
|
|
43969
|
-
const children = model.children
|
|
43970
|
-
.map((c) => DocumentationBlockBuilder.fromGenericModel(c, customBlocks, configuration))
|
|
43971
|
-
.filter((c) => c !== undefined);
|
|
44321
|
+
const children = ((_a = model.children) === null || _a === void 0 ? void 0 : _a.map((c) => DocumentationBlockBuilder.fromGenericModel(c, customBlocks, configuration)).filter((c) => c !== undefined)) || [];
|
|
43972
44322
|
switch (model.type) {
|
|
43973
44323
|
case SDKDocumentationPageBlockType_1.DocumentationPageBlockType.text:
|
|
43974
44324
|
return new SDKDocumentationPageBlockText_1.DocumentationPageBlockText(model, children);
|
|
@@ -46089,6 +46439,48 @@ class TokenGroup {
|
|
|
46089
46439
|
exports.TokenGroup = TokenGroup;
|
|
46090
46440
|
|
|
46091
46441
|
|
|
46442
|
+
/***/ }),
|
|
46443
|
+
|
|
46444
|
+
/***/ "./src/model/jobs/SDKImportJob.ts":
|
|
46445
|
+
/*!****************************************!*\
|
|
46446
|
+
!*** ./src/model/jobs/SDKImportJob.ts ***!
|
|
46447
|
+
\****************************************/
|
|
46448
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
46449
|
+
|
|
46450
|
+
"use strict";
|
|
46451
|
+
|
|
46452
|
+
//
|
|
46453
|
+
// SDKImportJob.ts
|
|
46454
|
+
// Supernova SDK
|
|
46455
|
+
//
|
|
46456
|
+
// Created by Jiri Trecak.
|
|
46457
|
+
//
|
|
46458
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
46459
|
+
exports.ImportJob = void 0;
|
|
46460
|
+
const SDKSource_1 = __webpack_require__(/*! ../support/SDKSource */ "./src/model/support/SDKSource.ts");
|
|
46461
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
46462
|
+
// MARK: - Function Definition
|
|
46463
|
+
class ImportJob {
|
|
46464
|
+
// --- --- --- --- --- --- --- --- --- ---
|
|
46465
|
+
// MARK: - Constructor
|
|
46466
|
+
constructor(model) {
|
|
46467
|
+
var _a;
|
|
46468
|
+
this.id = model.id;
|
|
46469
|
+
this.designSystemId = model.designSystemId;
|
|
46470
|
+
this.designSystemVersionId = model.designSystemVersionId;
|
|
46471
|
+
this.createdAt = model.createdAt ? new Date(model.createdAt) : null;
|
|
46472
|
+
this.state = model.state;
|
|
46473
|
+
this.operation = model.operation;
|
|
46474
|
+
this.stateChangedAt = model.stateChangedAt
|
|
46475
|
+
? new Date(model.stateChangedAt)
|
|
46476
|
+
: null;
|
|
46477
|
+
this.error = (_a = model.error) !== null && _a !== void 0 ? _a : null;
|
|
46478
|
+
this.sources = model.sources.map((source) => new SDKSource_1.Source(source));
|
|
46479
|
+
}
|
|
46480
|
+
}
|
|
46481
|
+
exports.ImportJob = ImportJob;
|
|
46482
|
+
|
|
46483
|
+
|
|
46092
46484
|
/***/ }),
|
|
46093
46485
|
|
|
46094
46486
|
/***/ "./src/model/membership/SDKMembership.ts":
|
|
@@ -46107,8 +46499,6 @@ exports.TokenGroup = TokenGroup;
|
|
|
46107
46499
|
//
|
|
46108
46500
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
46109
46501
|
exports.Membership = void 0;
|
|
46110
|
-
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
46111
|
-
// MARK: - Imports
|
|
46112
46502
|
const SDKWorkspace_1 = __webpack_require__(/*! ../workspaces/SDKWorkspace */ "./src/model/workspaces/SDKWorkspace.ts");
|
|
46113
46503
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
46114
46504
|
// MARK: - Function Definition
|
|
@@ -49749,6 +50139,49 @@ class User {
|
|
|
49749
50139
|
exports.User = User;
|
|
49750
50140
|
|
|
49751
50141
|
|
|
50142
|
+
/***/ }),
|
|
50143
|
+
|
|
50144
|
+
/***/ "./src/model/users/SDKUserMembership.ts":
|
|
50145
|
+
/*!**********************************************!*\
|
|
50146
|
+
!*** ./src/model/users/SDKUserMembership.ts ***!
|
|
50147
|
+
\**********************************************/
|
|
50148
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
50149
|
+
|
|
50150
|
+
"use strict";
|
|
50151
|
+
|
|
50152
|
+
//
|
|
50153
|
+
// SDKUserMembership.ts
|
|
50154
|
+
// Supernova SDK
|
|
50155
|
+
//
|
|
50156
|
+
// Created by Jiri Trecak.
|
|
50157
|
+
//
|
|
50158
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
50159
|
+
exports.UserMembership = void 0;
|
|
50160
|
+
const SDKUser_1 = __webpack_require__(/*! ./SDKUser */ "./src/model/users/SDKUser.ts");
|
|
50161
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -- - --- --- --- --- --- --- --- --- --- ---
|
|
50162
|
+
// MARK: - Object Definition
|
|
50163
|
+
class UserMembership {
|
|
50164
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
50165
|
+
// MARK: - Constructor
|
|
50166
|
+
constructor(model) {
|
|
50167
|
+
this.user = new SDKUser_1.User(model.user);
|
|
50168
|
+
this.role = model.role;
|
|
50169
|
+
this.effectiveRole = model.effectiveRole;
|
|
50170
|
+
}
|
|
50171
|
+
// --- --- --- --- --- --- --- --- --- ---
|
|
50172
|
+
// MARK: - Serialization & Deserialization
|
|
50173
|
+
/** Constructs representation that can be used to write full object to remote */
|
|
50174
|
+
toRemote() {
|
|
50175
|
+
return {
|
|
50176
|
+
user: this.user.toRemote(),
|
|
50177
|
+
role: this.role,
|
|
50178
|
+
effectiveRole: this.effectiveRole,
|
|
50179
|
+
};
|
|
50180
|
+
}
|
|
50181
|
+
}
|
|
50182
|
+
exports.UserMembership = UserMembership;
|
|
50183
|
+
|
|
50184
|
+
|
|
49752
50185
|
/***/ }),
|
|
49753
50186
|
|
|
49754
50187
|
/***/ "./src/model/users/SDKUserProfile.ts":
|
|
@@ -52040,7 +52473,7 @@ class DTTokenGroupTreeMerger {
|
|
|
52040
52473
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
52041
52474
|
// MARK: - Merger
|
|
52042
52475
|
makeGroupsDiff(tokensDiff, existingElements) {
|
|
52043
|
-
//
|
|
52476
|
+
// Construct roots to take data from
|
|
52044
52477
|
const exitingRoots = (0, SDKDTGroupTree_1.buildBrandedElementRoots)(existingElements);
|
|
52045
52478
|
const desiredStructures = new Map();
|
|
52046
52479
|
// Make group structure
|
|
@@ -52075,21 +52508,26 @@ class DTTokenGroupTreeMerger {
|
|
|
52075
52508
|
const compareDesiredAndExisting = (importNode, existingNode) => {
|
|
52076
52509
|
var _a;
|
|
52077
52510
|
if (importNode.isGroup) {
|
|
52511
|
+
let isChildGroupChanged = false;
|
|
52078
52512
|
for (const c of importNode.children) {
|
|
52079
52513
|
const existingChild = ((_a = existingNode === null || existingNode === void 0 ? void 0 : existingNode.children) !== null && _a !== void 0 ? _a : []).find((exc) => exc.name === c.name && exc.isGroup === c.isGroup);
|
|
52080
|
-
|
|
52514
|
+
isChildGroupChanged =
|
|
52515
|
+
compareDesiredAndExisting(c, existingChild) || isChildGroupChanged;
|
|
52081
52516
|
}
|
|
52082
52517
|
const importChildrenIds = importNode.children.map((c) => c.element.id);
|
|
52083
52518
|
if (existingNode) {
|
|
52084
52519
|
importNode.element.id = existingNode.element.id;
|
|
52085
52520
|
importNode.element.idInVersion = existingNode.element.idInVersion;
|
|
52086
52521
|
const existingChildrenIds = existingNode.children.map((c) => c.element.id);
|
|
52522
|
+
// mark changed group not only if 1st level children are changed, but for lower levels as well
|
|
52087
52523
|
if (JSON.stringify(importChildrenIds) !==
|
|
52088
|
-
JSON.stringify(existingChildrenIds)
|
|
52524
|
+
JSON.stringify(existingChildrenIds) ||
|
|
52525
|
+
isChildGroupChanged) {
|
|
52089
52526
|
toUpdate.push({
|
|
52090
52527
|
element: importNode.element,
|
|
52091
52528
|
childrenIds: importChildrenIds,
|
|
52092
52529
|
});
|
|
52530
|
+
return true;
|
|
52093
52531
|
}
|
|
52094
52532
|
}
|
|
52095
52533
|
else {
|
|
@@ -52097,8 +52535,10 @@ class DTTokenGroupTreeMerger {
|
|
|
52097
52535
|
element: importNode.element,
|
|
52098
52536
|
childrenIds: importChildrenIds,
|
|
52099
52537
|
});
|
|
52538
|
+
return true;
|
|
52100
52539
|
}
|
|
52101
52540
|
}
|
|
52541
|
+
return false;
|
|
52102
52542
|
};
|
|
52103
52543
|
for (const [brandId, typeRoots] of desiredStructures.entries()) {
|
|
52104
52544
|
for (const type of typeRoots.keys()) {
|
|
@@ -56478,7 +56918,6 @@ class TokenUtilPreviewSegmentGenerator {
|
|
|
56478
56918
|
const spread = formatDimension(layer.spread, "px");
|
|
56479
56919
|
const color = SDKColorToken_1.ColorToken.colorValueToHex6(layer.color).toUpperCase();
|
|
56480
56920
|
const value = `${x} ${y} ${radius} ${spread} ${color}`;
|
|
56481
|
-
console.log(layer);
|
|
56482
56921
|
return appendPercentageIfApplicable(layer.opacity.measure, value);
|
|
56483
56922
|
};
|
|
56484
56923
|
if (reference) {
|
|
@@ -65903,10 +66342,6 @@ function getNodeRequestOptions(request) {
|
|
|
65903
66342
|
agent = agent(parsedURL);
|
|
65904
66343
|
}
|
|
65905
66344
|
|
|
65906
|
-
if (!headers.has('Connection') && !agent) {
|
|
65907
|
-
headers.set('Connection', 'close');
|
|
65908
|
-
}
|
|
65909
|
-
|
|
65910
66345
|
// HTTP-network fetch step 4.2
|
|
65911
66346
|
// chunked encoding is handled by Node.js
|
|
65912
66347
|
|
|
@@ -66280,8 +66715,11 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
|
|
|
66280
66715
|
|
|
66281
66716
|
if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {
|
|
66282
66717
|
response.once('close', function (hadError) {
|
|
66718
|
+
// tests for socket presence, as in some situations the
|
|
66719
|
+
// the 'socket' event is not triggered for the request
|
|
66720
|
+
// (happens in deno), avoids `TypeError`
|
|
66283
66721
|
// if a data listener is still present we didn't end cleanly
|
|
66284
|
-
const hasDataListener = socket.listenerCount('data') > 0;
|
|
66722
|
+
const hasDataListener = socket && socket.listenerCount('data') > 0;
|
|
66285
66723
|
|
|
66286
66724
|
if (hasDataListener && !hadError) {
|
|
66287
66725
|
const err = new Error('Premature close');
|