@supernova-studio/supernova-sdk-beta 1.6.17 → 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.
@@ -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.integrations = new SDKAreaIntegrations_1.AreaIntegrations(this.dataCore);
34965
+ this.automation = new SDKAreaAutomation_1.AreaAutomation(this.dataCore);
34966
34966
  this.users = new SDKAreaUsers_1.AreaUsers(this.dataCore);
34967
- this.pipelines = new SDKAreaPipelines_1.AreaPipelines(this.dataCore);
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
 
@@ -35849,121 +36096,11 @@ class AreaMe {
35849
36096
  /** Updates the avatar of the current user */
35850
36097
  deleteAvatar(userId) {
35851
36098
  return __awaiter(this, void 0, void 0, function* () {
35852
- return this.dataCore.deleteUserAvatar(userId);
35853
- });
35854
- }
35855
- }
35856
- exports.AreaMe = AreaMe;
35857
-
35858
-
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
- };
36099
+ return this.dataCore.deleteUserAvatar(userId);
35963
36100
  });
35964
36101
  }
35965
36102
  }
35966
- exports.AreaPipelines = AreaPipelines;
36103
+ exports.AreaMe = AreaMe;
35967
36104
 
35968
36105
 
35969
36106
  /***/ }),
@@ -36777,14 +36914,21 @@ class AreaVersions {
36777
36914
  }
36778
36915
  getTokenStudioData(from) {
36779
36916
  return __awaiter(this, void 0, void 0, function* () {
36780
- return this.dataCore.getTokenStudioData(from.designSystemId, from.versionId);
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 this.dataCore.writeTokenStudioData(from.designSystemId, from.versionId, data);
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: - User
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: - TS Data
38297
- getTokenStudioData(designSystemId, versionId) {
38531
+ // MARK: - Automation
38532
+ getImportJob(designSystemId, versionId, jobId) {
38533
+ return __awaiter(this, void 0, void 0, function* () {
38534
+ const data = yield this.read.getImportJob(designSystemId, versionId, jobId);
38535
+ return new SDKImportJob_1.ImportJob(data);
38536
+ });
38537
+ }
38538
+ getImportJobs(designSystemId, versionId) {
38298
38539
  return __awaiter(this, void 0, void 0, function* () {
38299
- return this.read.getTokenStudioData(designSystemId, versionId);
38540
+ const data = yield this.read.getImportJobs(designSystemId, versionId);
38541
+ return data.map((d) => new SDKImportJob_1.ImportJob(d));
38300
38542
  });
38301
38543
  }
38302
- writeTokenStudioData(designSystemId, versionId, data) {
38544
+ scheduleImportJobForFigmaSources(designSystemId, versionId, sourceIds, dryRun) {
38303
38545
  return __awaiter(this, void 0, void 0, function* () {
38304
- return this.write.writeTokenStudioJSONData(designSystemId, versionId, data);
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 has access to */
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.sources;
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: - TS Data
38740
- getTokenStudioData(designSystemId, versionId) {
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, "bff/token-studio");
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. Can only really update its own 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;
@@ -39188,7 +39495,7 @@ class DataCoreWriteRequests {
39188
39495
  return __awaiter(this, void 0, void 0, function* () {
39189
39496
  const endpoint = this.bridge.getVersionEndpoint(designSystemId, versionId, "design-system-components");
39190
39497
  const payload = yield this.bridge.post(endpoint, component);
39191
- return payload.result.component;
39498
+ return payload.result.designSystemComponent;
39192
39499
  });
39193
39500
  }
39194
39501
  updateRemoteComponent(designSystemId, versionId, component) {
@@ -39295,12 +39602,56 @@ class DataCoreWriteRequests {
39295
39602
  });
39296
39603
  }
39297
39604
  // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
39298
- // MARK: - TS Data
39299
- writeTokenStudioJSONData(designSystemId, versionId, data) {
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.getVersionEndpoint(designSystemId, versionId, "bff/token-studio");
39302
- yield this.bridge.post(endpoint, data);
39303
- return true;
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":
@@ -50595,6 +51028,14 @@ class SupernovaToolsDesignTokensPlugin {
50595
51028
  themesInSource.includes(t.name.toLowerCase().trim())));
50596
51029
  for (const themeToRemove of themesToRemove) {
50597
51030
  const brand = brands.find((b) => b.id === themeToRemove.brandId);
51031
+ const themeBrandInMapping = mapping.find(m => m.bindToBrand === brand.id ||
51032
+ m.bindToBrand.toLowerCase().trim() === brand.name.toLowerCase().trim());
51033
+ if (!themeBrandInMapping) {
51034
+ if (settings.verbose) {
51035
+ console.log(`✅ (task done) Skip remove themes' overrides for brand ${brand.name}, theme ${themeToRemove.name}`);
51036
+ }
51037
+ continue;
51038
+ }
50598
51039
  yield this.mergeThemeWithRemoteSource([], brand, themeToRemove, !settings.dryRun, settings.verbose, settings.preciseCopy);
50599
51040
  if (settings.verbose) {
50600
51041
  console.log(`✅ (task done) Removed themes' overrides for brand ${brand.name}, theme ${themeToRemove.name}`);
@@ -52032,7 +52473,7 @@ class DTTokenGroupTreeMerger {
52032
52473
  // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
52033
52474
  // MARK: - Merger
52034
52475
  makeGroupsDiff(tokensDiff, existingElements) {
52035
- // Contruct roots to take data from
52476
+ // Construct roots to take data from
52036
52477
  const exitingRoots = (0, SDKDTGroupTree_1.buildBrandedElementRoots)(existingElements);
52037
52478
  const desiredStructures = new Map();
52038
52479
  // Make group structure
@@ -52067,21 +52508,26 @@ class DTTokenGroupTreeMerger {
52067
52508
  const compareDesiredAndExisting = (importNode, existingNode) => {
52068
52509
  var _a;
52069
52510
  if (importNode.isGroup) {
52511
+ let isChildGroupChanged = false;
52070
52512
  for (const c of importNode.children) {
52071
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);
52072
- compareDesiredAndExisting(c, existingChild);
52514
+ isChildGroupChanged =
52515
+ compareDesiredAndExisting(c, existingChild) || isChildGroupChanged;
52073
52516
  }
52074
52517
  const importChildrenIds = importNode.children.map((c) => c.element.id);
52075
52518
  if (existingNode) {
52076
52519
  importNode.element.id = existingNode.element.id;
52077
52520
  importNode.element.idInVersion = existingNode.element.idInVersion;
52078
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
52079
52523
  if (JSON.stringify(importChildrenIds) !==
52080
- JSON.stringify(existingChildrenIds)) {
52524
+ JSON.stringify(existingChildrenIds) ||
52525
+ isChildGroupChanged) {
52081
52526
  toUpdate.push({
52082
52527
  element: importNode.element,
52083
52528
  childrenIds: importChildrenIds,
52084
52529
  });
52530
+ return true;
52085
52531
  }
52086
52532
  }
52087
52533
  else {
@@ -52089,8 +52535,10 @@ class DTTokenGroupTreeMerger {
52089
52535
  element: importNode.element,
52090
52536
  childrenIds: importChildrenIds,
52091
52537
  });
52538
+ return true;
52092
52539
  }
52093
52540
  }
52541
+ return false;
52094
52542
  };
52095
52543
  for (const [brandId, typeRoots] of desiredStructures.entries()) {
52096
52544
  for (const type of typeRoots.keys()) {
@@ -55969,9 +56417,15 @@ const SDKDimensionToken_1 = __webpack_require__(/*! ../../model/tokens/SDKDimens
55969
56417
  const TokenUtils_1 = __webpack_require__(/*! ../../utils/TokenUtils */ "./src/utils/TokenUtils.ts");
55970
56418
  // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
55971
56419
  // MARK: - Utility
56420
+ const appendPercentageIfApplicable = (measure, stringToAppendTo) => {
56421
+ if (measure < 1) {
56422
+ return stringToAppendTo.concat(` / ${Math.round(measure * 100)}%`);
56423
+ }
56424
+ return stringToAppendTo;
56425
+ };
55972
56426
  class TokenUtilPreviewSegmentGenerator {
55973
56427
  static resolvedSegmentsForToken(token, allTokens) {
55974
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45;
56428
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51;
55975
56429
  switch (token.tokenType) {
55976
56430
  case SDKTokenType_1.TokenType.color: {
55977
56431
  const t = token;
@@ -55998,16 +56452,25 @@ class TokenUtilPreviewSegmentGenerator {
55998
56452
  case SDKTokenType_1.TokenType.blur: {
55999
56453
  const t = token;
56000
56454
  const reference = TokenUtils_1.TokenUtils.lookupReference((_d = t.value) === null || _d === void 0 ? void 0 : _d.referencedTokenId, allTokens);
56455
+ if (reference) {
56456
+ return [
56457
+ {
56458
+ value: `${t.value.type.toLowerCase()} ${SDKDimensionToken_1.DimensionToken.valueToString(t.value.radius)}`,
56459
+ prefersReferenceName: true,
56460
+ referencedName: (_e = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _e !== void 0 ? _e : undefined,
56461
+ },
56462
+ ];
56463
+ }
56001
56464
  return [
56002
56465
  {
56003
- value: (_e = t.value) === null || _e === void 0 ? void 0 : _e.type.toLowerCase(),
56466
+ value: (_f = t.value) === null || _f === void 0 ? void 0 : _f.type.toLowerCase(),
56004
56467
  prefersReferenceName: false,
56005
56468
  referencedName: undefined,
56006
56469
  },
56007
56470
  {
56008
56471
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value.radius),
56009
56472
  prefersReferenceName: false,
56010
- referencedName: (_f = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _f !== void 0 ? _f : undefined,
56473
+ referencedName: (_g = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _g !== void 0 ? _g : undefined,
56011
56474
  },
56012
56475
  ];
56013
56476
  }
@@ -56083,78 +56546,78 @@ class TokenUtilPreviewSegmentGenerator {
56083
56546
  }
56084
56547
  case SDKTokenType_1.TokenType.fontFamily: {
56085
56548
  const t = token;
56086
- const reference = TokenUtils_1.TokenUtils.lookupReference((_g = t.value) === null || _g === void 0 ? void 0 : _g.referencedTokenId, allTokens);
56549
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_h = t.value) === null || _h === void 0 ? void 0 : _h.referencedTokenId, allTokens);
56087
56550
  return [
56088
56551
  {
56089
56552
  value: t.value.text,
56090
56553
  prefersReferenceName: false,
56091
- referencedName: (_h = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _h !== void 0 ? _h : undefined,
56554
+ referencedName: (_j = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _j !== void 0 ? _j : undefined,
56092
56555
  },
56093
56556
  ];
56094
56557
  }
56095
56558
  case SDKTokenType_1.TokenType.fontWeight: {
56096
56559
  const t = token;
56097
- const reference = TokenUtils_1.TokenUtils.lookupReference((_j = t.value) === null || _j === void 0 ? void 0 : _j.referencedTokenId, allTokens);
56560
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_k = t.value) === null || _k === void 0 ? void 0 : _k.referencedTokenId, allTokens);
56098
56561
  return [
56099
56562
  {
56100
56563
  value: t.value.text,
56101
56564
  prefersReferenceName: false,
56102
- referencedName: (_k = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _k !== void 0 ? _k : undefined,
56565
+ referencedName: (_l = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _l !== void 0 ? _l : undefined,
56103
56566
  },
56104
56567
  ];
56105
56568
  }
56106
56569
  case SDKTokenType_1.TokenType.fontSize: {
56107
56570
  const t = token;
56108
- const reference = TokenUtils_1.TokenUtils.lookupReference((_l = t.value) === null || _l === void 0 ? void 0 : _l.referencedTokenId, allTokens);
56571
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_m = t.value) === null || _m === void 0 ? void 0 : _m.referencedTokenId, allTokens);
56109
56572
  return [
56110
56573
  {
56111
56574
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value),
56112
56575
  prefersReferenceName: false,
56113
- referencedName: (_m = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _m !== void 0 ? _m : undefined,
56576
+ referencedName: (_o = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _o !== void 0 ? _o : undefined,
56114
56577
  },
56115
56578
  ];
56116
56579
  }
56117
56580
  case SDKTokenType_1.TokenType.lineHeight: {
56118
56581
  const t = token;
56119
- const reference = TokenUtils_1.TokenUtils.lookupReference((_o = t.value) === null || _o === void 0 ? void 0 : _o.referencedTokenId, allTokens);
56582
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_p = t.value) === null || _p === void 0 ? void 0 : _p.referencedTokenId, allTokens);
56120
56583
  return [
56121
56584
  {
56122
56585
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value),
56123
56586
  prefersReferenceName: false,
56124
- referencedName: (_p = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _p !== void 0 ? _p : undefined,
56587
+ referencedName: (_q = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _q !== void 0 ? _q : undefined,
56125
56588
  },
56126
56589
  ];
56127
56590
  }
56128
56591
  case SDKTokenType_1.TokenType.letterSpacing: {
56129
56592
  const t = token;
56130
- const reference = TokenUtils_1.TokenUtils.lookupReference((_q = t.value) === null || _q === void 0 ? void 0 : _q.referencedTokenId, allTokens);
56593
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_r = t.value) === null || _r === void 0 ? void 0 : _r.referencedTokenId, allTokens);
56131
56594
  return [
56132
56595
  {
56133
56596
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value),
56134
56597
  prefersReferenceName: false,
56135
- referencedName: (_r = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _r !== void 0 ? _r : undefined,
56598
+ referencedName: (_s = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _s !== void 0 ? _s : undefined,
56136
56599
  },
56137
56600
  ];
56138
56601
  }
56139
56602
  case SDKTokenType_1.TokenType.paragraphSpacing: {
56140
56603
  const t = token;
56141
- const reference = TokenUtils_1.TokenUtils.lookupReference((_s = t.value) === null || _s === void 0 ? void 0 : _s.referencedTokenId, allTokens);
56604
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_t = t.value) === null || _t === void 0 ? void 0 : _t.referencedTokenId, allTokens);
56142
56605
  return [
56143
56606
  {
56144
56607
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value),
56145
56608
  prefersReferenceName: false,
56146
- referencedName: (_t = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _t !== void 0 ? _t : undefined,
56609
+ referencedName: (_u = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _u !== void 0 ? _u : undefined,
56147
56610
  },
56148
56611
  ];
56149
56612
  }
56150
56613
  case SDKTokenType_1.TokenType.opacity: {
56151
56614
  const t = token;
56152
- const reference = TokenUtils_1.TokenUtils.lookupReference((_u = t.value) === null || _u === void 0 ? void 0 : _u.referencedTokenId, allTokens);
56615
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_v = t.value) === null || _v === void 0 ? void 0 : _v.referencedTokenId, allTokens);
56153
56616
  return [
56154
56617
  {
56155
56618
  value: `${Math.round(t.value.measure * 100)}%`,
56156
56619
  prefersReferenceName: false,
56157
- referencedName: (_v = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _v !== void 0 ? _v : undefined,
56620
+ referencedName: (_w = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _w !== void 0 ? _w : undefined,
56158
56621
  },
56159
56622
  ];
56160
56623
  }
@@ -56177,11 +56640,12 @@ class TokenUtilPreviewSegmentGenerator {
56177
56640
  default:
56178
56641
  break;
56179
56642
  }
56643
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_x = t.value) === null || _x === void 0 ? void 0 : _x.referencedTokenId, allTokens);
56180
56644
  let segments = [
56181
56645
  {
56182
56646
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value.width),
56183
56647
  prefersReferenceName: false,
56184
- referencedName: (_z = (_y = TokenUtils_1.TokenUtils.lookupReference((_x = (_w = t.value) === null || _w === void 0 ? void 0 : _w.width) === null || _x === void 0 ? void 0 : _x.referencedTokenId, allTokens)) === null || _y === void 0 ? void 0 : _y.name) !== null && _z !== void 0 ? _z : undefined,
56648
+ referencedName: (_1 = (_0 = TokenUtils_1.TokenUtils.lookupReference((_z = (_y = t.value) === null || _y === void 0 ? void 0 : _y.width) === null || _z === void 0 ? void 0 : _z.referencedTokenId, allTokens)) === null || _0 === void 0 ? void 0 : _0.name) !== null && _1 !== void 0 ? _1 : undefined,
56185
56649
  },
56186
56650
  {
56187
56651
  value: style,
@@ -56191,9 +56655,19 @@ class TokenUtilPreviewSegmentGenerator {
56191
56655
  {
56192
56656
  value: SDKColorToken_1.ColorToken.colorValueToHex6(t.value.color).toUpperCase(),
56193
56657
  prefersReferenceName: true,
56194
- referencedName: (_3 = (_2 = TokenUtils_1.TokenUtils.lookupReference((_1 = (_0 = t.value) === null || _0 === void 0 ? void 0 : _0.color) === null || _1 === void 0 ? void 0 : _1.referencedTokenId, allTokens)) === null || _2 === void 0 ? void 0 : _2.name) !== null && _3 !== void 0 ? _3 : undefined,
56658
+ referencedName: (_5 = (_4 = TokenUtils_1.TokenUtils.lookupReference((_3 = (_2 = t.value) === null || _2 === void 0 ? void 0 : _2.color) === null || _3 === void 0 ? void 0 : _3.referencedTokenId, allTokens)) === null || _4 === void 0 ? void 0 : _4.name) !== null && _5 !== void 0 ? _5 : undefined,
56195
56659
  },
56196
56660
  ];
56661
+ if (reference) {
56662
+ segments = [
56663
+ {
56664
+ value: appendPercentageIfApplicable(t.value.color.opacity.measure, `${SDKDimensionToken_1.DimensionToken.valueToString((_6 = t.value) === null || _6 === void 0 ? void 0 : _6.width)} ${style} ${SDKColorToken_1.ColorToken.colorValueToHex6(t.value.color).toUpperCase()}`),
56665
+ prefersReferenceName: true,
56666
+ referencedName: (_7 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _7 !== void 0 ? _7 : undefined,
56667
+ },
56668
+ ];
56669
+ return segments;
56670
+ }
56197
56671
  if (t.value.color.opacity.measure < 1) {
56198
56672
  // Only add opacity if it is not 100%
56199
56673
  segments = segments.concat([
@@ -56201,7 +56675,7 @@ class TokenUtilPreviewSegmentGenerator {
56201
56675
  {
56202
56676
  value: `${Math.round(t.value.color.opacity.measure * 100)}%`,
56203
56677
  prefersReferenceName: false,
56204
- referencedName: (_5 = (_4 = TokenUtils_1.TokenUtils.lookupReference(t.value.color.opacity.referencedTokenId, allTokens)) === null || _4 === void 0 ? void 0 : _4.name) !== null && _5 !== void 0 ? _5 : undefined,
56678
+ referencedName: (_9 = (_8 = TokenUtils_1.TokenUtils.lookupReference(t.value.color.opacity.referencedTokenId, allTokens)) === null || _8 === void 0 ? void 0 : _8.name) !== null && _9 !== void 0 ? _9 : undefined,
56205
56679
  },
56206
56680
  ]);
56207
56681
  }
@@ -56209,45 +56683,45 @@ class TokenUtilPreviewSegmentGenerator {
56209
56683
  }
56210
56684
  case SDKTokenType_1.TokenType.radius: {
56211
56685
  const t = token;
56212
- const reference = TokenUtils_1.TokenUtils.lookupReference((_6 = t.value) === null || _6 === void 0 ? void 0 : _6.referencedTokenId, allTokens);
56686
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_10 = t.value) === null || _10 === void 0 ? void 0 : _10.referencedTokenId, allTokens);
56213
56687
  return [
56214
56688
  {
56215
56689
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value),
56216
56690
  prefersReferenceName: false,
56217
- referencedName: (_7 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _7 !== void 0 ? _7 : undefined,
56691
+ referencedName: (_11 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _11 !== void 0 ? _11 : undefined,
56218
56692
  },
56219
56693
  ];
56220
56694
  }
56221
56695
  case SDKTokenType_1.TokenType.borderWidth: {
56222
56696
  const t = token;
56223
- const reference = TokenUtils_1.TokenUtils.lookupReference((_8 = t.value) === null || _8 === void 0 ? void 0 : _8.referencedTokenId, allTokens);
56697
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_12 = t.value) === null || _12 === void 0 ? void 0 : _12.referencedTokenId, allTokens);
56224
56698
  return [
56225
56699
  {
56226
56700
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value),
56227
56701
  prefersReferenceName: false,
56228
- referencedName: (_9 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _9 !== void 0 ? _9 : undefined,
56702
+ referencedName: (_13 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _13 !== void 0 ? _13 : undefined,
56229
56703
  },
56230
56704
  ];
56231
56705
  }
56232
56706
  case SDKTokenType_1.TokenType.duration: {
56233
56707
  const t = token;
56234
- const reference = TokenUtils_1.TokenUtils.lookupReference((_10 = t.value) === null || _10 === void 0 ? void 0 : _10.referencedTokenId, allTokens);
56708
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_14 = t.value) === null || _14 === void 0 ? void 0 : _14.referencedTokenId, allTokens);
56235
56709
  return [
56236
56710
  {
56237
56711
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value),
56238
56712
  prefersReferenceName: false,
56239
- referencedName: (_11 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _11 !== void 0 ? _11 : undefined,
56713
+ referencedName: (_15 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _15 !== void 0 ? _15 : undefined,
56240
56714
  },
56241
56715
  ];
56242
56716
  }
56243
56717
  case SDKTokenType_1.TokenType.zIndex: {
56244
56718
  const t = token;
56245
- const reference = TokenUtils_1.TokenUtils.lookupReference((_12 = t.value) === null || _12 === void 0 ? void 0 : _12.referencedTokenId, allTokens);
56719
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_16 = t.value) === null || _16 === void 0 ? void 0 : _16.referencedTokenId, allTokens);
56246
56720
  return [
56247
56721
  {
56248
56722
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value),
56249
56723
  prefersReferenceName: false,
56250
- referencedName: (_13 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _13 !== void 0 ? _13 : undefined,
56724
+ referencedName: (_17 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _17 !== void 0 ? _17 : undefined,
56251
56725
  },
56252
56726
  ];
56253
56727
  }
@@ -56273,12 +56747,12 @@ class TokenUtilPreviewSegmentGenerator {
56273
56747
  default:
56274
56748
  throw new Error("Unknown text case");
56275
56749
  }
56276
- const reference = TokenUtils_1.TokenUtils.lookupReference((_14 = t.value) === null || _14 === void 0 ? void 0 : _14.referencedTokenId, allTokens);
56750
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_18 = t.value) === null || _18 === void 0 ? void 0 : _18.referencedTokenId, allTokens);
56277
56751
  return [
56278
56752
  {
56279
56753
  value,
56280
56754
  prefersReferenceName: false,
56281
- referencedName: (_15 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _15 !== void 0 ? _15 : undefined,
56755
+ referencedName: (_19 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _19 !== void 0 ? _19 : undefined,
56282
56756
  },
56283
56757
  ];
56284
56758
  }
@@ -56298,12 +56772,12 @@ class TokenUtilPreviewSegmentGenerator {
56298
56772
  default:
56299
56773
  throw new Error("Unknown text decoration option");
56300
56774
  }
56301
- const reference = TokenUtils_1.TokenUtils.lookupReference((_16 = t.value) === null || _16 === void 0 ? void 0 : _16.referencedTokenId, allTokens);
56775
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_20 = t.value) === null || _20 === void 0 ? void 0 : _20.referencedTokenId, allTokens);
56302
56776
  return [
56303
56777
  {
56304
56778
  value,
56305
56779
  prefersReferenceName: false,
56306
- referencedName: (_17 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _17 !== void 0 ? _17 : undefined,
56780
+ referencedName: (_21 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _21 !== void 0 ? _21 : undefined,
56307
56781
  },
56308
56782
  ];
56309
56783
  }
@@ -56320,80 +56794,90 @@ class TokenUtilPreviewSegmentGenerator {
56320
56794
  default:
56321
56795
  throw new Error("Unknown visibility option");
56322
56796
  }
56323
- const reference = TokenUtils_1.TokenUtils.lookupReference((_18 = t.value) === null || _18 === void 0 ? void 0 : _18.referencedTokenId, allTokens);
56797
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_22 = t.value) === null || _22 === void 0 ? void 0 : _22.referencedTokenId, allTokens);
56324
56798
  return [
56325
56799
  {
56326
56800
  value,
56327
56801
  prefersReferenceName: false,
56328
- referencedName: (_19 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _19 !== void 0 ? _19 : undefined,
56802
+ referencedName: (_23 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _23 !== void 0 ? _23 : undefined,
56329
56803
  },
56330
56804
  ];
56331
56805
  }
56332
56806
  case SDKTokenType_1.TokenType.productCopy: {
56333
56807
  const t = token;
56334
- const reference = TokenUtils_1.TokenUtils.lookupReference((_20 = t.value) === null || _20 === void 0 ? void 0 : _20.referencedTokenId, allTokens);
56808
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_24 = t.value) === null || _24 === void 0 ? void 0 : _24.referencedTokenId, allTokens);
56335
56809
  return [
56336
56810
  {
56337
56811
  value: t.value.text,
56338
56812
  prefersReferenceName: false,
56339
- referencedName: (_21 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _21 !== void 0 ? _21 : undefined,
56813
+ referencedName: (_25 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _25 !== void 0 ? _25 : undefined,
56340
56814
  },
56341
56815
  ];
56342
56816
  }
56343
56817
  case SDKTokenType_1.TokenType.string: {
56344
56818
  const t = token;
56345
- const reference = TokenUtils_1.TokenUtils.lookupReference((_22 = t.value) === null || _22 === void 0 ? void 0 : _22.referencedTokenId, allTokens);
56819
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_26 = t.value) === null || _26 === void 0 ? void 0 : _26.referencedTokenId, allTokens);
56346
56820
  return [
56347
56821
  {
56348
56822
  value: t.value.text,
56349
56823
  prefersReferenceName: false,
56350
- referencedName: (_23 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _23 !== void 0 ? _23 : undefined,
56824
+ referencedName: (_27 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _27 !== void 0 ? _27 : undefined,
56351
56825
  },
56352
56826
  ];
56353
56827
  }
56354
56828
  case SDKTokenType_1.TokenType.dimension: {
56355
56829
  const t = token;
56356
- const reference = TokenUtils_1.TokenUtils.lookupReference((_24 = t.value) === null || _24 === void 0 ? void 0 : _24.referencedTokenId, allTokens);
56830
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_28 = t.value) === null || _28 === void 0 ? void 0 : _28.referencedTokenId, allTokens);
56357
56831
  return [
56358
56832
  {
56359
56833
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value),
56360
56834
  prefersReferenceName: false,
56361
- referencedName: (_25 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _25 !== void 0 ? _25 : undefined,
56835
+ referencedName: (_29 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _29 !== void 0 ? _29 : undefined,
56362
56836
  },
56363
56837
  ];
56364
56838
  }
56365
56839
  case SDKTokenType_1.TokenType.size: {
56366
56840
  const t = token;
56367
- const reference = TokenUtils_1.TokenUtils.lookupReference((_26 = t.value) === null || _26 === void 0 ? void 0 : _26.referencedTokenId, allTokens);
56841
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_30 = t.value) === null || _30 === void 0 ? void 0 : _30.referencedTokenId, allTokens);
56368
56842
  return [
56369
56843
  {
56370
56844
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value),
56371
56845
  prefersReferenceName: false,
56372
- referencedName: (_27 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _27 !== void 0 ? _27 : undefined,
56846
+ referencedName: (_31 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _31 !== void 0 ? _31 : undefined,
56373
56847
  },
56374
56848
  ];
56375
56849
  }
56376
56850
  case SDKTokenType_1.TokenType.space: {
56377
56851
  const t = token;
56378
- const reference = TokenUtils_1.TokenUtils.lookupReference((_28 = t.value) === null || _28 === void 0 ? void 0 : _28.referencedTokenId, allTokens);
56852
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_32 = t.value) === null || _32 === void 0 ? void 0 : _32.referencedTokenId, allTokens);
56379
56853
  return [
56380
56854
  {
56381
56855
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value),
56382
56856
  prefersReferenceName: false,
56383
- referencedName: (_29 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _29 !== void 0 ? _29 : undefined,
56857
+ referencedName: (_33 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _33 !== void 0 ? _33 : undefined,
56384
56858
  },
56385
56859
  ];
56386
56860
  }
56387
56861
  case SDKTokenType_1.TokenType.typography: {
56388
56862
  const t = token;
56389
56863
  let lineHeightFragments = [];
56864
+ const reference = TokenUtils_1.TokenUtils.lookupReference((_34 = t.value) === null || _34 === void 0 ? void 0 : _34.referencedTokenId, allTokens);
56865
+ if (reference) {
56866
+ return [
56867
+ {
56868
+ value: `${SDKDimensionToken_1.DimensionToken.valueToString(t.value.fontSize)} / ${SDKDimensionToken_1.DimensionToken.valueToString(t.value.lineHeight)} ${t.value.fontFamily.text} ${t.value.fontWeight.text}`,
56869
+ prefersReferenceName: true,
56870
+ referencedName: (_35 = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _35 !== void 0 ? _35 : undefined,
56871
+ },
56872
+ ];
56873
+ }
56390
56874
  if (t.value.lineHeight) {
56391
56875
  lineHeightFragments = [
56392
56876
  "separator",
56393
56877
  {
56394
56878
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value.lineHeight),
56395
56879
  prefersReferenceName: false,
56396
- referencedName: (_33 = (_32 = TokenUtils_1.TokenUtils.lookupReference((_31 = (_30 = t.value) === null || _30 === void 0 ? void 0 : _30.lineHeight) === null || _31 === void 0 ? void 0 : _31.referencedTokenId, allTokens)) === null || _32 === void 0 ? void 0 : _32.name) !== null && _33 !== void 0 ? _33 : undefined,
56880
+ referencedName: (_39 = (_38 = TokenUtils_1.TokenUtils.lookupReference((_37 = (_36 = t.value) === null || _36 === void 0 ? void 0 : _36.lineHeight) === null || _37 === void 0 ? void 0 : _37.referencedTokenId, allTokens)) === null || _38 === void 0 ? void 0 : _38.name) !== null && _39 !== void 0 ? _39 : undefined,
56397
56881
  },
56398
56882
  ];
56399
56883
  }
@@ -56401,18 +56885,18 @@ class TokenUtilPreviewSegmentGenerator {
56401
56885
  {
56402
56886
  value: SDKDimensionToken_1.DimensionToken.valueToString(t.value.fontSize),
56403
56887
  prefersReferenceName: false,
56404
- referencedName: (_37 = (_36 = TokenUtils_1.TokenUtils.lookupReference((_35 = (_34 = t.value) === null || _34 === void 0 ? void 0 : _34.fontSize) === null || _35 === void 0 ? void 0 : _35.referencedTokenId, allTokens)) === null || _36 === void 0 ? void 0 : _36.name) !== null && _37 !== void 0 ? _37 : undefined,
56888
+ referencedName: (_43 = (_42 = TokenUtils_1.TokenUtils.lookupReference((_41 = (_40 = t.value) === null || _40 === void 0 ? void 0 : _40.fontSize) === null || _41 === void 0 ? void 0 : _41.referencedTokenId, allTokens)) === null || _42 === void 0 ? void 0 : _42.name) !== null && _43 !== void 0 ? _43 : undefined,
56405
56889
  },
56406
56890
  ...lineHeightFragments,
56407
56891
  {
56408
56892
  value: t.value.fontFamily.text,
56409
56893
  prefersReferenceName: false,
56410
- referencedName: (_41 = (_40 = TokenUtils_1.TokenUtils.lookupReference((_39 = (_38 = t.value) === null || _38 === void 0 ? void 0 : _38.fontFamily) === null || _39 === void 0 ? void 0 : _39.referencedTokenId, allTokens)) === null || _40 === void 0 ? void 0 : _40.name) !== null && _41 !== void 0 ? _41 : undefined,
56894
+ referencedName: (_47 = (_46 = TokenUtils_1.TokenUtils.lookupReference((_45 = (_44 = t.value) === null || _44 === void 0 ? void 0 : _44.fontFamily) === null || _45 === void 0 ? void 0 : _45.referencedTokenId, allTokens)) === null || _46 === void 0 ? void 0 : _46.name) !== null && _47 !== void 0 ? _47 : undefined,
56411
56895
  },
56412
56896
  {
56413
56897
  value: t.value.fontWeight.text,
56414
56898
  prefersReferenceName: false,
56415
- referencedName: (_45 = (_44 = TokenUtils_1.TokenUtils.lookupReference((_43 = (_42 = t.value) === null || _42 === void 0 ? void 0 : _42.fontWeight) === null || _43 === void 0 ? void 0 : _43.referencedTokenId, allTokens)) === null || _44 === void 0 ? void 0 : _44.name) !== null && _45 !== void 0 ? _45 : undefined,
56899
+ referencedName: (_51 = (_50 = TokenUtils_1.TokenUtils.lookupReference((_49 = (_48 = t.value) === null || _48 === void 0 ? void 0 : _48.fontWeight) === null || _49 === void 0 ? void 0 : _49.referencedTokenId, allTokens)) === null || _50 === void 0 ? void 0 : _50.name) !== null && _51 !== void 0 ? _51 : undefined,
56416
56900
  },
56417
56901
  ];
56418
56902
  }
@@ -56421,39 +56905,55 @@ class TokenUtilPreviewSegmentGenerator {
56421
56905
  }
56422
56906
  }
56423
56907
  static shadowValuesToSegments(layer, allTokens) {
56424
- var _a, _b, _c, _d;
56908
+ var _a, _b, _c, _d, _e;
56425
56909
  if (!layer) {
56426
56910
  return [];
56427
56911
  }
56912
+ const reference = TokenUtils_1.TokenUtils.lookupReference(layer.referencedTokenId, allTokens);
56913
+ const formatDimension = (value, unit) => value === 0 ? `0` : `${SDKDimensionToken_1.DimensionToken.numberToString(value)}${unit}`;
56914
+ const getReferencedValuePreview = () => {
56915
+ const x = formatDimension(layer.x, "px");
56916
+ const y = formatDimension(layer.y, "px");
56917
+ const radius = formatDimension(layer.radius, "px");
56918
+ const spread = formatDimension(layer.spread, "px");
56919
+ const color = SDKColorToken_1.ColorToken.colorValueToHex6(layer.color).toUpperCase();
56920
+ const value = `${x} ${y} ${radius} ${spread} ${color}`;
56921
+ return appendPercentageIfApplicable(layer.opacity.measure, value);
56922
+ };
56923
+ if (reference) {
56924
+ return [
56925
+ {
56926
+ value: getReferencedValuePreview(),
56927
+ prefersReferenceName: true,
56928
+ referencedName: (_a = reference === null || reference === void 0 ? void 0 : reference.name) !== null && _a !== void 0 ? _a : undefined,
56929
+ },
56930
+ ];
56931
+ }
56428
56932
  let segments = [
56429
56933
  {
56430
- value: layer.x === 0 ? `0` : `${SDKDimensionToken_1.DimensionToken.numberToString(layer.x)}px`,
56934
+ value: formatDimension(layer.x, "px"),
56431
56935
  prefersReferenceName: false,
56432
56936
  referencedName: undefined,
56433
56937
  },
56434
56938
  {
56435
- value: layer.y === 0 ? `0` : `${SDKDimensionToken_1.DimensionToken.numberToString(layer.y)}px`,
56939
+ value: formatDimension(layer.y, "px"),
56436
56940
  prefersReferenceName: false,
56437
56941
  referencedName: undefined,
56438
56942
  },
56439
56943
  {
56440
- value: layer.radius === 0
56441
- ? `0`
56442
- : `${SDKDimensionToken_1.DimensionToken.numberToString(layer.radius)}px`,
56944
+ value: formatDimension(layer.radius, "px"),
56443
56945
  prefersReferenceName: false,
56444
56946
  referencedName: undefined,
56445
56947
  },
56446
56948
  {
56447
- value: layer.spread === 0
56448
- ? `0`
56449
- : `${SDKDimensionToken_1.DimensionToken.numberToString(layer.spread)}px`,
56949
+ value: formatDimension(layer.spread, "px"),
56450
56950
  prefersReferenceName: false,
56451
56951
  referencedName: undefined,
56452
56952
  },
56453
56953
  {
56454
56954
  value: SDKColorToken_1.ColorToken.colorValueToHex6(layer.color).toUpperCase(),
56455
56955
  prefersReferenceName: false,
56456
- referencedName: (_b = (_a = TokenUtils_1.TokenUtils.lookupReference(layer.color.referencedTokenId, allTokens)) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : undefined,
56956
+ referencedName: (_c = (_b = TokenUtils_1.TokenUtils.lookupReference(layer.color.referencedTokenId, allTokens)) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : undefined,
56457
56957
  },
56458
56958
  ];
56459
56959
  if (layer.opacity.measure < 1) {
@@ -56463,7 +56963,7 @@ class TokenUtilPreviewSegmentGenerator {
56463
56963
  {
56464
56964
  value: `${Math.round(layer.opacity.measure * 100)}%`,
56465
56965
  prefersReferenceName: false,
56466
- referencedName: (_d = (_c = TokenUtils_1.TokenUtils.lookupReference(layer.opacity.referencedTokenId, allTokens)) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : undefined,
56966
+ referencedName: (_e = (_d = TokenUtils_1.TokenUtils.lookupReference(layer.opacity.referencedTokenId, allTokens)) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : undefined,
56467
56967
  },
56468
56968
  ]);
56469
56969
  }
@@ -65842,10 +66342,6 @@ function getNodeRequestOptions(request) {
65842
66342
  agent = agent(parsedURL);
65843
66343
  }
65844
66344
 
65845
- if (!headers.has('Connection') && !agent) {
65846
- headers.set('Connection', 'close');
65847
- }
65848
-
65849
66345
  // HTTP-network fetch step 4.2
65850
66346
  // chunked encoding is handled by Node.js
65851
66347
 
@@ -66219,8 +66715,11 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
66219
66715
 
66220
66716
  if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {
66221
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`
66222
66721
  // if a data listener is still present we didn't end cleanly
66223
- const hasDataListener = socket.listenerCount('data') > 0;
66722
+ const hasDataListener = socket && socket.listenerCount('data') > 0;
66224
66723
 
66225
66724
  if (hasDataListener && !hadError) {
66226
66725
  const err = new Error('Premature close');