@trops/dash-core 0.1.184 → 0.1.185
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/dist/electron/index.js +27 -29
- package/dist/electron/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -31447,7 +31447,8 @@ var widgetRegistryExports = widgetRegistry$1.exports;
|
|
|
31447
31447
|
*/
|
|
31448
31448
|
|
|
31449
31449
|
const REGISTRY_BASE_URL$1 =
|
|
31450
|
-
process.env.DASH_REGISTRY_API_URL ||
|
|
31450
|
+
process.env.DASH_REGISTRY_API_URL ||
|
|
31451
|
+
"https://main.d919rwhuzp7rj.amplifyapp.com";
|
|
31451
31452
|
|
|
31452
31453
|
// Lazy-load electron-store to avoid issues when not installed
|
|
31453
31454
|
let store$2 = null;
|
|
@@ -31538,7 +31539,7 @@ async function pollForToken$1(deviceCode) {
|
|
|
31538
31539
|
*
|
|
31539
31540
|
* @returns {Object|null} { token, userId, authenticatedAt } or null if not authenticated
|
|
31540
31541
|
*/
|
|
31541
|
-
function getStoredToken$
|
|
31542
|
+
function getStoredToken$2() {
|
|
31542
31543
|
try {
|
|
31543
31544
|
const s = getStore$1();
|
|
31544
31545
|
const token = s.get("accessToken");
|
|
@@ -31560,7 +31561,7 @@ function getStoredToken$1() {
|
|
|
31560
31561
|
* @returns {Object} { authenticated: boolean, userId?: string }
|
|
31561
31562
|
*/
|
|
31562
31563
|
function getAuthStatus$1() {
|
|
31563
|
-
const stored = getStoredToken$
|
|
31564
|
+
const stored = getStoredToken$2();
|
|
31564
31565
|
if (!stored) {
|
|
31565
31566
|
return { authenticated: false };
|
|
31566
31567
|
}
|
|
@@ -31578,7 +31579,7 @@ function getAuthStatus$1() {
|
|
|
31578
31579
|
* @returns {Promise<Object|null>} User profile or null
|
|
31579
31580
|
*/
|
|
31580
31581
|
async function getRegistryProfile$2() {
|
|
31581
|
-
const stored = getStoredToken$
|
|
31582
|
+
const stored = getStoredToken$2();
|
|
31582
31583
|
if (!stored) return null;
|
|
31583
31584
|
|
|
31584
31585
|
try {
|
|
@@ -31622,7 +31623,7 @@ function clearToken() {
|
|
|
31622
31623
|
* @returns {Promise<Object|null>} Updated user or null on 401
|
|
31623
31624
|
*/
|
|
31624
31625
|
async function updateRegistryProfile$1(updates) {
|
|
31625
|
-
const stored = getStoredToken$
|
|
31626
|
+
const stored = getStoredToken$2();
|
|
31626
31627
|
if (!stored) return null;
|
|
31627
31628
|
|
|
31628
31629
|
try {
|
|
@@ -31654,7 +31655,7 @@ async function updateRegistryProfile$1(updates) {
|
|
|
31654
31655
|
* @returns {Promise<Object|null>} { packages: [...] } or null
|
|
31655
31656
|
*/
|
|
31656
31657
|
async function getRegistryPackages$1() {
|
|
31657
|
-
const stored = getStoredToken$
|
|
31658
|
+
const stored = getStoredToken$2();
|
|
31658
31659
|
if (!stored) return null;
|
|
31659
31660
|
|
|
31660
31661
|
try {
|
|
@@ -31685,7 +31686,7 @@ async function getRegistryPackages$1() {
|
|
|
31685
31686
|
* @returns {Promise<Object|null>} Updated package or null
|
|
31686
31687
|
*/
|
|
31687
31688
|
async function updateRegistryPackage$1(scope, name, updates) {
|
|
31688
|
-
const stored = getStoredToken$
|
|
31689
|
+
const stored = getStoredToken$2();
|
|
31689
31690
|
if (!stored) return null;
|
|
31690
31691
|
|
|
31691
31692
|
try {
|
|
@@ -31721,7 +31722,7 @@ async function updateRegistryPackage$1(scope, name, updates) {
|
|
|
31721
31722
|
* @returns {Promise<Object|null>} Response or null
|
|
31722
31723
|
*/
|
|
31723
31724
|
async function deleteRegistryPackage(scope, name) {
|
|
31724
|
-
const stored = getStoredToken$
|
|
31725
|
+
const stored = getStoredToken$2();
|
|
31725
31726
|
if (!stored) return null;
|
|
31726
31727
|
|
|
31727
31728
|
try {
|
|
@@ -31750,7 +31751,7 @@ async function deleteRegistryPackage(scope, name) {
|
|
|
31750
31751
|
var registryAuthController$1 = {
|
|
31751
31752
|
initiateDeviceFlow: initiateDeviceFlow$1,
|
|
31752
31753
|
pollForToken: pollForToken$1,
|
|
31753
|
-
getStoredToken: getStoredToken$
|
|
31754
|
+
getStoredToken: getStoredToken$2,
|
|
31754
31755
|
getAuthStatus: getAuthStatus$1,
|
|
31755
31756
|
getRegistryProfile: getRegistryProfile$2,
|
|
31756
31757
|
updateRegistryProfile: updateRegistryProfile$1,
|
|
@@ -31769,10 +31770,11 @@ var registryAuthController$1 = {
|
|
|
31769
31770
|
|
|
31770
31771
|
const fs = require$$0$3;
|
|
31771
31772
|
const path$3 = require$$1$2;
|
|
31772
|
-
const { getStoredToken } = registryAuthController$1;
|
|
31773
|
+
const { getStoredToken: getStoredToken$1 } = registryAuthController$1;
|
|
31773
31774
|
|
|
31774
31775
|
const REGISTRY_BASE_URL =
|
|
31775
|
-
process.env.DASH_REGISTRY_API_URL ||
|
|
31776
|
+
process.env.DASH_REGISTRY_API_URL ||
|
|
31777
|
+
"https://main.d919rwhuzp7rj.amplifyapp.com";
|
|
31776
31778
|
|
|
31777
31779
|
/**
|
|
31778
31780
|
* Publish a package to the registry.
|
|
@@ -31782,7 +31784,7 @@ const REGISTRY_BASE_URL =
|
|
|
31782
31784
|
* @returns {Promise<Object>} { success, registryUrl, packageId, version, error? }
|
|
31783
31785
|
*/
|
|
31784
31786
|
async function publishToRegistry$1(zipPath, manifest) {
|
|
31785
|
-
const auth = getStoredToken();
|
|
31787
|
+
const auth = getStoredToken$1();
|
|
31786
31788
|
if (!auth) {
|
|
31787
31789
|
return {
|
|
31788
31790
|
success: false,
|
|
@@ -31874,6 +31876,7 @@ const registryApiController$1 = registryApiController$2;
|
|
|
31874
31876
|
const {
|
|
31875
31877
|
getAuthStatus,
|
|
31876
31878
|
getRegistryProfile: getRegistryProfile$1,
|
|
31879
|
+
getStoredToken,
|
|
31877
31880
|
} = registryAuthController$1;
|
|
31878
31881
|
|
|
31879
31882
|
/**
|
|
@@ -32107,29 +32110,24 @@ async function installThemeFromRegistry$1(win, appId, packageName) {
|
|
|
32107
32110
|
};
|
|
32108
32111
|
}
|
|
32109
32112
|
|
|
32110
|
-
//
|
|
32111
|
-
|
|
32112
|
-
|
|
32113
|
-
|
|
32114
|
-
}
|
|
32115
|
-
|
|
32116
|
-
// Resolve template variables
|
|
32117
|
-
downloadUrl = downloadUrl
|
|
32118
|
-
.replace("{version}", pkg.version || "1.0.0")
|
|
32119
|
-
.replace("{name}", pkg.name || "");
|
|
32120
|
-
|
|
32121
|
-
// Enforce HTTPS
|
|
32122
|
-
if (!downloadUrl.startsWith("https://")) {
|
|
32123
|
-
return { success: false, error: "Download URL must use HTTPS" };
|
|
32124
|
-
}
|
|
32113
|
+
// Construct download URL from package metadata using the working registry base
|
|
32114
|
+
const registryBaseUrl =
|
|
32115
|
+
process.env.DASH_REGISTRY_API_URL ||
|
|
32116
|
+
"https://main.d919rwhuzp7rj.amplifyapp.com";
|
|
32117
|
+
const downloadUrl = `${registryBaseUrl}/api/packages/${encodeURIComponent(pkg.scope)}/${encodeURIComponent(pkg.name)}/download?version=${encodeURIComponent(pkg.version || "1.0.0")}`;
|
|
32125
32118
|
|
|
32126
32119
|
console.log(
|
|
32127
32120
|
"[ThemeRegistryController] Downloading theme from:",
|
|
32128
32121
|
downloadUrl,
|
|
32129
32122
|
);
|
|
32130
32123
|
|
|
32131
|
-
// Download the ZIP
|
|
32132
|
-
const
|
|
32124
|
+
// Download the ZIP (with auth header)
|
|
32125
|
+
const headers = {};
|
|
32126
|
+
const auth = getStoredToken();
|
|
32127
|
+
if (auth?.token) {
|
|
32128
|
+
headers["Authorization"] = `Bearer ${auth.token}`;
|
|
32129
|
+
}
|
|
32130
|
+
const response = await fetch(downloadUrl, { headers });
|
|
32133
32131
|
if (!response.ok) {
|
|
32134
32132
|
return {
|
|
32135
32133
|
success: false,
|