@devicecloud.dev/dcd 3.7.11 → 3.7.12-beta.1
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export declare class SupabaseGateway {
|
|
2
2
|
private static SB;
|
|
3
|
-
static getSupabaseKeys(env: '
|
|
3
|
+
static getSupabaseKeys(env: 'dev' | 'prod'): {
|
|
4
4
|
SUPABASE_PUBLIC_KEY: string;
|
|
5
5
|
SUPABASE_URL: string;
|
|
6
6
|
} | {
|
|
7
7
|
SUPABASE_PUBLIC_KEY: string;
|
|
8
8
|
SUPABASE_URL: string;
|
|
9
9
|
};
|
|
10
|
-
static uploadToSignedUrl(env: '
|
|
10
|
+
static uploadToSignedUrl(env: 'dev' | 'prod', path: string, token: string, file: File): Promise<void>;
|
|
11
11
|
}
|
|
@@ -10,7 +10,7 @@ class SupabaseGateway {
|
|
|
10
10
|
},
|
|
11
11
|
prod: {
|
|
12
12
|
SUPABASE_PUBLIC_KEY: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBneWRucGhiaW1ldGluc2dma2JvIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDc1OTQzNDYsImV4cCI6MjAyMzE3MDM0Nn0.hAYOMFxxwX1exkQkY9xyQJGC_GhGnyogkj2N-kBkMI8',
|
|
13
|
-
SUPABASE_URL: 'https://
|
|
13
|
+
SUPABASE_URL: 'https://cloud.devicecloud.dev',
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
16
|
static getSupabaseKeys(env) {
|
|
@@ -22,8 +22,11 @@ class SupabaseGateway {
|
|
|
22
22
|
const uploadToUrl = await supabase.storage
|
|
23
23
|
.from('organizations')
|
|
24
24
|
.uploadToSignedUrl(path, token, file);
|
|
25
|
-
if (uploadToUrl.error)
|
|
26
|
-
|
|
25
|
+
if (uploadToUrl.error) {
|
|
26
|
+
const error = uploadToUrl.error;
|
|
27
|
+
const errorMessage = typeof error === 'string' ? error : error?.message || 'Upload failed';
|
|
28
|
+
throw new Error(errorMessage);
|
|
29
|
+
}
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
exports.SupabaseGateway = SupabaseGateway;
|
package/dist/methods.js
CHANGED
|
@@ -148,7 +148,7 @@ const uploadBinary = async (filePath, apiUrl, apiKey, ignoreShaCheck = false, lo
|
|
|
148
148
|
file = new file_1.File([zippedAppBlob], filePath + '.zip');
|
|
149
149
|
}
|
|
150
150
|
else {
|
|
151
|
-
const binaryBlob = new Blob([await (0, promises_1.readFile)(filePath)], {
|
|
151
|
+
const binaryBlob = new Blob([new Uint8Array(await (0, promises_1.readFile)(filePath))], {
|
|
152
152
|
type: cloud_1.mimeTypeLookupByExtension[filePath.split('.').pop()],
|
|
153
153
|
});
|
|
154
154
|
file = new file_1.File([binaryBlob], filePath);
|
package/oclif.manifest.json
CHANGED