@hot-updater/supabase 0.36.0 → 0.36.2
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/edge.cjs +1 -1
- package/dist/edge.mjs +1 -1
- package/dist/iac/index.cjs +1 -1
- package/dist/iac/index.mjs +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.mjs +10 -10
- package/dist/{supabaseEdgeFunctionStorage-CRgm-8_T.cjs → supabaseEdgeFunctionStorage-BSLlUeqi.cjs} +1 -4
- package/dist/{supabaseEdgeFunctionStorage-DaRCRhn-.mjs → supabaseEdgeFunctionStorage-pV0s_mTF.mjs} +2 -5
- package/package.json +9 -9
package/dist/edge.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_supabaseEdgeFunctionStorage = require("./supabaseEdgeFunctionStorage-
|
|
2
|
+
const require_supabaseEdgeFunctionStorage = require("./supabaseEdgeFunctionStorage-BSLlUeqi.cjs");
|
|
3
3
|
exports.supabaseEdgeFunctionDatabase = require_supabaseEdgeFunctionStorage.supabaseEdgeFunctionDatabase;
|
|
4
4
|
exports.supabaseEdgeFunctionStorage = require_supabaseEdgeFunctionStorage.supabaseEdgeFunctionStorage;
|
package/dist/edge.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as supabaseEdgeFunctionDatabase, t as supabaseEdgeFunctionStorage } from "./supabaseEdgeFunctionStorage-
|
|
1
|
+
import { r as supabaseEdgeFunctionDatabase, t as supabaseEdgeFunctionStorage } from "./supabaseEdgeFunctionStorage-pV0s_mTF.mjs";
|
|
2
2
|
export { supabaseEdgeFunctionDatabase, supabaseEdgeFunctionStorage };
|
package/dist/iac/index.cjs
CHANGED
|
@@ -6909,7 +6909,7 @@ const SOURCE_TEMPLATE = `// add this to your App.tsx
|
|
|
6909
6909
|
import { HotUpdater } from "@hot-updater/react-native";
|
|
6910
6910
|
|
|
6911
6911
|
function App() {
|
|
6912
|
-
return
|
|
6912
|
+
return null; // Replace with your app root
|
|
6913
6913
|
}
|
|
6914
6914
|
|
|
6915
6915
|
export default HotUpdater.wrap({
|
package/dist/iac/index.mjs
CHANGED
|
@@ -6904,7 +6904,7 @@ const SOURCE_TEMPLATE = `// add this to your App.tsx
|
|
|
6904
6904
|
import { HotUpdater } from "@hot-updater/react-native";
|
|
6905
6905
|
|
|
6906
6906
|
function App() {
|
|
6907
|
-
return
|
|
6907
|
+
return null; // Replace with your app root
|
|
6908
6908
|
}
|
|
6909
6909
|
|
|
6910
6910
|
export default HotUpdater.wrap({
|
package/dist/index.cjs
CHANGED
|
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
23
|
//#endregion
|
|
24
|
-
const require_supabaseEdgeFunctionStorage = require("./supabaseEdgeFunctionStorage-
|
|
24
|
+
const require_supabaseEdgeFunctionStorage = require("./supabaseEdgeFunctionStorage-BSLlUeqi.cjs");
|
|
25
25
|
let _hot_updater_plugin_core = require("@hot-updater/plugin-core");
|
|
26
26
|
let _supabase_supabase_js = require("@supabase/supabase-js");
|
|
27
27
|
let fs_promises = require("fs/promises");
|
|
@@ -54,6 +54,9 @@ async function verifyObjectCanBeSignedForRuntime({ bucket, key }) {
|
|
|
54
54
|
expiresIn: 3600
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
+
const parseSupabaseStorageUri = (storageUri) => {
|
|
58
|
+
return (0, _hot_updater_plugin_core.parseStorageUri)(storageUri, "supabase-storage");
|
|
59
|
+
};
|
|
57
60
|
const supabaseStorage = (0, _hot_updater_plugin_core.createUniversalStoragePlugin)({
|
|
58
61
|
name: "supabaseStorage",
|
|
59
62
|
supportedProtocol: "supabase-storage",
|
|
@@ -68,7 +71,7 @@ const supabaseStorage = (0, _hot_updater_plugin_core.createUniversalStoragePlugi
|
|
|
68
71
|
return {
|
|
69
72
|
node: {
|
|
70
73
|
async delete(storageUri) {
|
|
71
|
-
const { key, bucket: bucketName } = (
|
|
74
|
+
const { key, bucket: bucketName } = parseSupabaseStorageUri(storageUri);
|
|
72
75
|
if (bucketName !== config.bucketName) throw new Error(`Bucket name mismatch: expected "${config.bucketName}", but found "${bucketName}".`);
|
|
73
76
|
const { error } = await bucket.remove([key]);
|
|
74
77
|
if (error) {
|
|
@@ -93,7 +96,7 @@ const supabaseStorage = (0, _hot_updater_plugin_core.createUniversalStoragePlugi
|
|
|
93
96
|
return { storageUri: `supabase-storage://${upload.data.fullPath}` };
|
|
94
97
|
},
|
|
95
98
|
async exists(storageUri) {
|
|
96
|
-
const { key, bucket: bucketName } = (
|
|
99
|
+
const { key, bucket: bucketName } = parseSupabaseStorageUri(storageUri);
|
|
97
100
|
if (bucketName !== config.bucketName) throw new Error(`Bucket name mismatch: expected "${config.bucketName}", but found "${bucketName}".`);
|
|
98
101
|
const { data, error } = await bucket.exists(key);
|
|
99
102
|
if (data === false) return false;
|
|
@@ -105,7 +108,7 @@ const supabaseStorage = (0, _hot_updater_plugin_core.createUniversalStoragePlugi
|
|
|
105
108
|
return data;
|
|
106
109
|
},
|
|
107
110
|
async downloadFile(storageUri, filePath) {
|
|
108
|
-
const { key, bucket: bucketName } = (
|
|
111
|
+
const { key, bucket: bucketName } = parseSupabaseStorageUri(storageUri);
|
|
109
112
|
if (bucketName !== config.bucketName) throw new Error(`Bucket name mismatch: expected "${config.bucketName}", but found "${bucketName}".`);
|
|
110
113
|
const { data, error } = await bucket.download(key);
|
|
111
114
|
if (error) throw new Error(`Failed to download bundle: ${error.message}`);
|
|
@@ -116,7 +119,7 @@ const supabaseStorage = (0, _hot_updater_plugin_core.createUniversalStoragePlugi
|
|
|
116
119
|
},
|
|
117
120
|
runtime: {
|
|
118
121
|
async readText(storageUri) {
|
|
119
|
-
const { key, bucket: bucketName } = (
|
|
122
|
+
const { key, bucket: bucketName } = parseSupabaseStorageUri(storageUri);
|
|
120
123
|
if (bucketName !== config.bucketName) throw new Error(`Bucket name mismatch: expected "${config.bucketName}", but found "${bucketName}".`);
|
|
121
124
|
const { data, error } = await bucket.download(key);
|
|
122
125
|
if (error) {
|
|
@@ -127,11 +130,8 @@ const supabaseStorage = (0, _hot_updater_plugin_core.createUniversalStoragePlugi
|
|
|
127
130
|
return data.text();
|
|
128
131
|
},
|
|
129
132
|
async getDownloadUrl(storageUri) {
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
132
|
-
let key = `${u.host}${u.pathname}`.replace(/^\//, "");
|
|
133
|
-
if (!key) throw new Error("Invalid Supabase storage URI: missing key");
|
|
134
|
-
if (key.startsWith(`${config.bucketName}/`)) key = key.substring(`${config.bucketName}/`.length);
|
|
133
|
+
const { bucket: bucketName, key } = parseSupabaseStorageUri(storageUri);
|
|
134
|
+
if (bucketName !== config.bucketName) throw new Error(`Bucket name mismatch: expected "${config.bucketName}", but found "${bucketName}".`);
|
|
135
135
|
return { fileUrl: await resolveSignedUrl(config.bucketName, key) };
|
|
136
136
|
}
|
|
137
137
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as resolveSupabaseServiceRoleKey, i as supabaseDatabase, n as createSupabaseSignedUrlBatcher, r as supabaseEdgeFunctionDatabase, t as supabaseEdgeFunctionStorage } from "./supabaseEdgeFunctionStorage-
|
|
1
|
+
import { a as resolveSupabaseServiceRoleKey, i as supabaseDatabase, n as createSupabaseSignedUrlBatcher, r as supabaseEdgeFunctionDatabase, t as supabaseEdgeFunctionStorage } from "./supabaseEdgeFunctionStorage-pV0s_mTF.mjs";
|
|
2
2
|
import { createStorageKeyBuilder, createUniversalStoragePlugin, getContentType, parseStorageUri } from "@hot-updater/plugin-core";
|
|
3
3
|
import { createClient } from "@supabase/supabase-js";
|
|
4
4
|
import fs from "fs/promises";
|
|
@@ -29,6 +29,9 @@ async function verifyObjectCanBeSignedForRuntime({ bucket, key }) {
|
|
|
29
29
|
expiresIn: 3600
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
+
const parseSupabaseStorageUri = (storageUri) => {
|
|
33
|
+
return parseStorageUri(storageUri, "supabase-storage");
|
|
34
|
+
};
|
|
32
35
|
const supabaseStorage = createUniversalStoragePlugin({
|
|
33
36
|
name: "supabaseStorage",
|
|
34
37
|
supportedProtocol: "supabase-storage",
|
|
@@ -43,7 +46,7 @@ const supabaseStorage = createUniversalStoragePlugin({
|
|
|
43
46
|
return {
|
|
44
47
|
node: {
|
|
45
48
|
async delete(storageUri) {
|
|
46
|
-
const { key, bucket: bucketName } =
|
|
49
|
+
const { key, bucket: bucketName } = parseSupabaseStorageUri(storageUri);
|
|
47
50
|
if (bucketName !== config.bucketName) throw new Error(`Bucket name mismatch: expected "${config.bucketName}", but found "${bucketName}".`);
|
|
48
51
|
const { error } = await bucket.remove([key]);
|
|
49
52
|
if (error) {
|
|
@@ -68,7 +71,7 @@ const supabaseStorage = createUniversalStoragePlugin({
|
|
|
68
71
|
return { storageUri: `supabase-storage://${upload.data.fullPath}` };
|
|
69
72
|
},
|
|
70
73
|
async exists(storageUri) {
|
|
71
|
-
const { key, bucket: bucketName } =
|
|
74
|
+
const { key, bucket: bucketName } = parseSupabaseStorageUri(storageUri);
|
|
72
75
|
if (bucketName !== config.bucketName) throw new Error(`Bucket name mismatch: expected "${config.bucketName}", but found "${bucketName}".`);
|
|
73
76
|
const { data, error } = await bucket.exists(key);
|
|
74
77
|
if (data === false) return false;
|
|
@@ -80,7 +83,7 @@ const supabaseStorage = createUniversalStoragePlugin({
|
|
|
80
83
|
return data;
|
|
81
84
|
},
|
|
82
85
|
async downloadFile(storageUri, filePath) {
|
|
83
|
-
const { key, bucket: bucketName } =
|
|
86
|
+
const { key, bucket: bucketName } = parseSupabaseStorageUri(storageUri);
|
|
84
87
|
if (bucketName !== config.bucketName) throw new Error(`Bucket name mismatch: expected "${config.bucketName}", but found "${bucketName}".`);
|
|
85
88
|
const { data, error } = await bucket.download(key);
|
|
86
89
|
if (error) throw new Error(`Failed to download bundle: ${error.message}`);
|
|
@@ -91,7 +94,7 @@ const supabaseStorage = createUniversalStoragePlugin({
|
|
|
91
94
|
},
|
|
92
95
|
runtime: {
|
|
93
96
|
async readText(storageUri) {
|
|
94
|
-
const { key, bucket: bucketName } =
|
|
97
|
+
const { key, bucket: bucketName } = parseSupabaseStorageUri(storageUri);
|
|
95
98
|
if (bucketName !== config.bucketName) throw new Error(`Bucket name mismatch: expected "${config.bucketName}", but found "${bucketName}".`);
|
|
96
99
|
const { data, error } = await bucket.download(key);
|
|
97
100
|
if (error) {
|
|
@@ -102,11 +105,8 @@ const supabaseStorage = createUniversalStoragePlugin({
|
|
|
102
105
|
return data.text();
|
|
103
106
|
},
|
|
104
107
|
async getDownloadUrl(storageUri) {
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
let key = `${u.host}${u.pathname}`.replace(/^\//, "");
|
|
108
|
-
if (!key) throw new Error("Invalid Supabase storage URI: missing key");
|
|
109
|
-
if (key.startsWith(`${config.bucketName}/`)) key = key.substring(`${config.bucketName}/`.length);
|
|
108
|
+
const { bucket: bucketName, key } = parseSupabaseStorageUri(storageUri);
|
|
109
|
+
if (bucketName !== config.bucketName) throw new Error(`Bucket name mismatch: expected "${config.bucketName}", but found "${bucketName}".`);
|
|
110
110
|
return { fileUrl: await resolveSignedUrl(config.bucketName, key) };
|
|
111
111
|
}
|
|
112
112
|
}
|
package/dist/{supabaseEdgeFunctionStorage-CRgm-8_T.cjs → supabaseEdgeFunctionStorage-BSLlUeqi.cjs}
RENAMED
|
@@ -318,10 +318,7 @@ const createSupabaseSignedUrlBatcher = ({ createSignedUrls, expiresIn, formatObj
|
|
|
318
318
|
//#endregion
|
|
319
319
|
//#region src/supabaseEdgeFunctionStorage.ts
|
|
320
320
|
const parseSupabaseStorageUri = (storageUri) => {
|
|
321
|
-
const
|
|
322
|
-
if (storageUrl.protocol !== "supabase-storage:") throw new Error("Invalid Supabase storage URI protocol");
|
|
323
|
-
const bucketName = storageUrl.host;
|
|
324
|
-
const key = storageUrl.pathname.replace(/^\/+/, "");
|
|
321
|
+
const { bucket: bucketName, key } = (0, _hot_updater_plugin_core.parseStorageUri)(storageUri, "supabase-storage");
|
|
325
322
|
if (!bucketName || !key) throw new Error("Invalid Supabase storage URI");
|
|
326
323
|
return {
|
|
327
324
|
bucketName,
|
package/dist/{supabaseEdgeFunctionStorage-DaRCRhn-.mjs → supabaseEdgeFunctionStorage-pV0s_mTF.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_ROLLOUT_COHORT_COUNT, NIL_UUID, getAssetBaseStorageUri, getBundlePatches, getManifestFileHash, getManifestStorageUri, stripBundleArtifactMetadata } from "@hot-updater/core";
|
|
2
|
-
import { calculatePagination, createDatabasePlugin, createRuntimeStoragePlugin, filterCompatibleAppVersions } from "@hot-updater/plugin-core";
|
|
2
|
+
import { calculatePagination, createDatabasePlugin, createRuntimeStoragePlugin, filterCompatibleAppVersions, parseStorageUri } from "@hot-updater/plugin-core";
|
|
3
3
|
import { createClient } from "@supabase/supabase-js";
|
|
4
4
|
//#region src/supabaseBundleMapper.ts
|
|
5
5
|
const BUNDLE_SELECT_COLUMNS = "id, channel, enabled, platform, should_force_update, file_hash, git_commit_hash, message, fingerprint_hash, target_app_version, storage_uri, metadata, manifest_storage_uri, manifest_file_hash, asset_base_storage_uri, rollout_cohort_count, target_cohorts";
|
|
@@ -317,10 +317,7 @@ const createSupabaseSignedUrlBatcher = ({ createSignedUrls, expiresIn, formatObj
|
|
|
317
317
|
//#endregion
|
|
318
318
|
//#region src/supabaseEdgeFunctionStorage.ts
|
|
319
319
|
const parseSupabaseStorageUri = (storageUri) => {
|
|
320
|
-
const
|
|
321
|
-
if (storageUrl.protocol !== "supabase-storage:") throw new Error("Invalid Supabase storage URI protocol");
|
|
322
|
-
const bucketName = storageUrl.host;
|
|
323
|
-
const key = storageUrl.pathname.replace(/^\/+/, "");
|
|
320
|
+
const { bucket: bucketName, key } = parseStorageUri(storageUri, "supabase-storage");
|
|
324
321
|
if (!bucketName || !key) throw new Error("Invalid Supabase storage URI");
|
|
325
322
|
return {
|
|
326
323
|
bucketName,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/supabase",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.36.
|
|
4
|
+
"version": "0.36.2",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.mjs",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"@supabase/supabase-js": "2.76.1",
|
|
56
56
|
"hono": "4.12.9",
|
|
57
57
|
"uuidv7": "^1.0.2",
|
|
58
|
-
"@hot-updater/core": "0.36.
|
|
59
|
-
"@hot-updater/
|
|
60
|
-
"@hot-updater/
|
|
61
|
-
"@hot-updater/
|
|
58
|
+
"@hot-updater/core": "0.36.2",
|
|
59
|
+
"@hot-updater/plugin-core": "0.36.2",
|
|
60
|
+
"@hot-updater/cli-tools": "0.36.2",
|
|
61
|
+
"@hot-updater/server": "0.36.2"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@electric-sql/pglite": "0.4.1",
|
|
@@ -68,10 +68,10 @@
|
|
|
68
68
|
"execa": "9.5.2",
|
|
69
69
|
"@types/node": "^20",
|
|
70
70
|
"mime": "^4.0.4",
|
|
71
|
-
"@hot-updater/js": "0.36.
|
|
72
|
-
"@hot-updater/
|
|
73
|
-
"@hot-updater/
|
|
74
|
-
"@hot-updater/postgres": "0.36.
|
|
71
|
+
"@hot-updater/js": "0.36.2",
|
|
72
|
+
"@hot-updater/test-utils": "0.36.2",
|
|
73
|
+
"@hot-updater/mock": "0.36.2",
|
|
74
|
+
"@hot-updater/postgres": "0.36.2"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"build": "tsdown",
|