@hot-updater/plugin-core 0.35.12 → 0.36.0
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/assetStorageLayout.cjs +4 -0
- package/dist/assetStorageLayout.d.cts +3 -1
- package/dist/assetStorageLayout.d.mts +3 -1
- package/dist/assetStorageLayout.mjs +3 -1
- package/dist/bundleStorageLayout.cjs +22 -0
- package/dist/bundleStorageLayout.d.cts +6 -0
- package/dist/bundleStorageLayout.d.mts +6 -0
- package/dist/bundleStorageLayout.mjs +20 -0
- package/dist/contentAddressedAssets.cjs +2 -0
- package/dist/contentAddressedAssets.d.cts +2 -1
- package/dist/contentAddressedAssets.d.mts +2 -1
- package/dist/contentAddressedAssets.mjs +2 -1
- package/dist/createBlobDatabasePlugin.cjs +11 -2
- package/dist/createBlobDatabasePlugin.d.cts +1 -0
- package/dist/createBlobDatabasePlugin.d.mts +1 -0
- package/dist/createBlobDatabasePlugin.mjs +11 -2
- package/dist/createStoragePlugin.cjs +33 -15
- package/dist/createStoragePlugin.mjs +33 -15
- package/dist/index.cjs +7 -0
- package/dist/index.d.cts +5 -4
- package/dist/index.d.mts +5 -4
- package/dist/index.mjs +4 -3
- package/dist/types/index.d.cts +15 -1
- package/dist/types/index.d.mts +15 -1
- package/package.json +4 -4
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const require_contentAddressedAssets = require("./contentAddressedAssets.cjs");
|
|
2
2
|
const require_legacyAssetStorageLayout = require("./legacyAssetStorageLayout.cjs");
|
|
3
3
|
//#region src/assetStorageLayout.ts
|
|
4
|
+
const isBrotliManifestAssetPath = (assetPath) => /(^|\/)index\.[^/]+\.bundle$/.test(assetPath.replace(/\\/g, "/"));
|
|
5
|
+
const getManifestAssetDownloadPath = (assetPath) => isBrotliManifestAssetPath(assetPath) ? `${assetPath}.br` : assetPath;
|
|
4
6
|
const createStorageUriWithRelativePath = ({ baseStorageUri, relativePath }) => {
|
|
5
7
|
const storageUrl = new URL(baseStorageUri);
|
|
6
8
|
storageUrl.pathname = `${storageUrl.pathname.replace(/\/+$/, "")}/${relativePath.replace(/\\/g, "/").split("/").filter(Boolean).map((segment) => encodeURIComponent(segment)).join("/")}`;
|
|
@@ -29,6 +31,8 @@ const resolveManifestAssetStorageUri = ({ assetBaseStorageUri, assetPath, fileHa
|
|
|
29
31
|
//#endregion
|
|
30
32
|
exports.createStorageUriWithRelativePath = createStorageUriWithRelativePath;
|
|
31
33
|
exports.getAssetStorageLayout = getAssetStorageLayout;
|
|
34
|
+
exports.getManifestAssetDownloadPath = getManifestAssetDownloadPath;
|
|
32
35
|
exports.getManifestAssetStoragePath = getManifestAssetStoragePath;
|
|
36
|
+
exports.isBrotliManifestAssetPath = isBrotliManifestAssetPath;
|
|
33
37
|
exports.isContentAddressedAssetBaseStorageUri = isContentAddressedAssetBaseStorageUri;
|
|
34
38
|
exports.resolveManifestAssetStorageUri = resolveManifestAssetStorageUri;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
//#region src/assetStorageLayout.d.ts
|
|
2
2
|
type AssetStorageLayout = "content-addressed" | "legacy-files";
|
|
3
|
+
declare const isBrotliManifestAssetPath: (assetPath: string) => boolean;
|
|
4
|
+
declare const getManifestAssetDownloadPath: (assetPath: string) => string;
|
|
3
5
|
declare const createStorageUriWithRelativePath: ({
|
|
4
6
|
baseStorageUri,
|
|
5
7
|
relativePath
|
|
@@ -28,4 +30,4 @@ declare const resolveManifestAssetStorageUri: ({
|
|
|
28
30
|
fileHash: string;
|
|
29
31
|
}) => string;
|
|
30
32
|
//#endregion
|
|
31
|
-
export { AssetStorageLayout, createStorageUriWithRelativePath, getAssetStorageLayout, getManifestAssetStoragePath, isContentAddressedAssetBaseStorageUri, resolveManifestAssetStorageUri };
|
|
33
|
+
export { AssetStorageLayout, createStorageUriWithRelativePath, getAssetStorageLayout, getManifestAssetDownloadPath, getManifestAssetStoragePath, isBrotliManifestAssetPath, isContentAddressedAssetBaseStorageUri, resolveManifestAssetStorageUri };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
//#region src/assetStorageLayout.d.ts
|
|
2
2
|
type AssetStorageLayout = "content-addressed" | "legacy-files";
|
|
3
|
+
declare const isBrotliManifestAssetPath: (assetPath: string) => boolean;
|
|
4
|
+
declare const getManifestAssetDownloadPath: (assetPath: string) => string;
|
|
3
5
|
declare const createStorageUriWithRelativePath: ({
|
|
4
6
|
baseStorageUri,
|
|
5
7
|
relativePath
|
|
@@ -28,4 +30,4 @@ declare const resolveManifestAssetStorageUri: ({
|
|
|
28
30
|
fileHash: string;
|
|
29
31
|
}) => string;
|
|
30
32
|
//#endregion
|
|
31
|
-
export { AssetStorageLayout, createStorageUriWithRelativePath, getAssetStorageLayout, getManifestAssetStoragePath, isContentAddressedAssetBaseStorageUri, resolveManifestAssetStorageUri };
|
|
33
|
+
export { AssetStorageLayout, createStorageUriWithRelativePath, getAssetStorageLayout, getManifestAssetDownloadPath, getManifestAssetStoragePath, isBrotliManifestAssetPath, isContentAddressedAssetBaseStorageUri, resolveManifestAssetStorageUri };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { getContentAddressedAssetStoragePath } from "./contentAddressedAssets.mjs";
|
|
2
2
|
import { getLegacyManifestAssetStoragePath } from "./legacyAssetStorageLayout.mjs";
|
|
3
3
|
//#region src/assetStorageLayout.ts
|
|
4
|
+
const isBrotliManifestAssetPath = (assetPath) => /(^|\/)index\.[^/]+\.bundle$/.test(assetPath.replace(/\\/g, "/"));
|
|
5
|
+
const getManifestAssetDownloadPath = (assetPath) => isBrotliManifestAssetPath(assetPath) ? `${assetPath}.br` : assetPath;
|
|
4
6
|
const createStorageUriWithRelativePath = ({ baseStorageUri, relativePath }) => {
|
|
5
7
|
const storageUrl = new URL(baseStorageUri);
|
|
6
8
|
storageUrl.pathname = `${storageUrl.pathname.replace(/\/+$/, "")}/${relativePath.replace(/\\/g, "/").split("/").filter(Boolean).map((segment) => encodeURIComponent(segment)).join("/")}`;
|
|
@@ -27,4 +29,4 @@ const resolveManifestAssetStorageUri = ({ assetBaseStorageUri, assetPath, fileHa
|
|
|
27
29
|
})
|
|
28
30
|
});
|
|
29
31
|
//#endregion
|
|
30
|
-
export { createStorageUriWithRelativePath, getAssetStorageLayout, getManifestAssetStoragePath, isContentAddressedAssetBaseStorageUri, resolveManifestAssetStorageUri };
|
|
32
|
+
export { createStorageUriWithRelativePath, getAssetStorageLayout, getManifestAssetDownloadPath, getManifestAssetStoragePath, isBrotliManifestAssetPath, isContentAddressedAssetBaseStorageUri, resolveManifestAssetStorageUri };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/bundleStorageLayout.ts
|
|
2
|
+
const BUNDLE_STORAGE_PREFIX = "bundles";
|
|
3
|
+
const createBundleStorageKey = (bundleId, ...relativePaths) => [
|
|
4
|
+
BUNDLE_STORAGE_PREFIX,
|
|
5
|
+
bundleId,
|
|
6
|
+
...relativePaths
|
|
7
|
+
].filter(Boolean).join("/");
|
|
8
|
+
const createStorageRootUriWithPath = (storageUri, bundleId, relativePath) => {
|
|
9
|
+
const storageUrl = new URL(storageUri);
|
|
10
|
+
const segments = storageUrl.pathname.split("/").filter(Boolean);
|
|
11
|
+
const bundleIndex = segments.lastIndexOf(bundleId);
|
|
12
|
+
if (bundleIndex < 0) throw new Error(`Storage URI does not contain bundle id: ${bundleId}`);
|
|
13
|
+
const rootSegments = segments.slice(0, bundleIndex);
|
|
14
|
+
if (rootSegments.at(-1) === "bundles") rootSegments.pop();
|
|
15
|
+
const relativeSegments = relativePath.split("/").filter(Boolean).map((segment) => encodeURIComponent(segment));
|
|
16
|
+
storageUrl.pathname = `/${[...rootSegments, ...relativeSegments].join("/")}`;
|
|
17
|
+
return storageUrl.toString();
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.BUNDLE_STORAGE_PREFIX = BUNDLE_STORAGE_PREFIX;
|
|
21
|
+
exports.createBundleStorageKey = createBundleStorageKey;
|
|
22
|
+
exports.createStorageRootUriWithPath = createStorageRootUriWithPath;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/bundleStorageLayout.d.ts
|
|
2
|
+
declare const BUNDLE_STORAGE_PREFIX = "bundles";
|
|
3
|
+
declare const createBundleStorageKey: (bundleId: string, ...relativePaths: string[]) => string;
|
|
4
|
+
declare const createStorageRootUriWithPath: (storageUri: string, bundleId: string, relativePath: string) => string;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { BUNDLE_STORAGE_PREFIX, createBundleStorageKey, createStorageRootUriWithPath };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/bundleStorageLayout.d.ts
|
|
2
|
+
declare const BUNDLE_STORAGE_PREFIX = "bundles";
|
|
3
|
+
declare const createBundleStorageKey: (bundleId: string, ...relativePaths: string[]) => string;
|
|
4
|
+
declare const createStorageRootUriWithPath: (storageUri: string, bundleId: string, relativePath: string) => string;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { BUNDLE_STORAGE_PREFIX, createBundleStorageKey, createStorageRootUriWithPath };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/bundleStorageLayout.ts
|
|
2
|
+
const BUNDLE_STORAGE_PREFIX = "bundles";
|
|
3
|
+
const createBundleStorageKey = (bundleId, ...relativePaths) => [
|
|
4
|
+
BUNDLE_STORAGE_PREFIX,
|
|
5
|
+
bundleId,
|
|
6
|
+
...relativePaths
|
|
7
|
+
].filter(Boolean).join("/");
|
|
8
|
+
const createStorageRootUriWithPath = (storageUri, bundleId, relativePath) => {
|
|
9
|
+
const storageUrl = new URL(storageUri);
|
|
10
|
+
const segments = storageUrl.pathname.split("/").filter(Boolean);
|
|
11
|
+
const bundleIndex = segments.lastIndexOf(bundleId);
|
|
12
|
+
if (bundleIndex < 0) throw new Error(`Storage URI does not contain bundle id: ${bundleId}`);
|
|
13
|
+
const rootSegments = segments.slice(0, bundleIndex);
|
|
14
|
+
if (rootSegments.at(-1) === "bundles") rootSegments.pop();
|
|
15
|
+
const relativeSegments = relativePath.split("/").filter(Boolean).map((segment) => encodeURIComponent(segment));
|
|
16
|
+
storageUrl.pathname = `/${[...rootSegments, ...relativeSegments].join("/")}`;
|
|
17
|
+
return storageUrl.toString();
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { BUNDLE_STORAGE_PREFIX, createBundleStorageKey, createStorageRootUriWithPath };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
//#region src/contentAddressedAssets.ts
|
|
2
|
+
const CONTENT_ADDRESSED_ASSET_PREFIX = "assets";
|
|
2
3
|
const getContentAddressedAssetStoragePath = ({ assetPath, fileHash }) => {
|
|
3
4
|
const extension = assetPath.endsWith(".br") ? ".br" : assetPath.includes(".") ? `.${assetPath.split(".").pop()}` : "";
|
|
4
5
|
return `sha256/${fileHash.slice(0, 2)}/${fileHash}${extension}`;
|
|
5
6
|
};
|
|
6
7
|
//#endregion
|
|
8
|
+
exports.CONTENT_ADDRESSED_ASSET_PREFIX = CONTENT_ADDRESSED_ASSET_PREFIX;
|
|
7
9
|
exports.getContentAddressedAssetStoragePath = getContentAddressedAssetStoragePath;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
//#region src/contentAddressedAssets.d.ts
|
|
2
|
+
declare const CONTENT_ADDRESSED_ASSET_PREFIX = "assets";
|
|
2
3
|
declare const getContentAddressedAssetStoragePath: ({
|
|
3
4
|
assetPath,
|
|
4
5
|
fileHash
|
|
@@ -7,4 +8,4 @@ declare const getContentAddressedAssetStoragePath: ({
|
|
|
7
8
|
fileHash: string;
|
|
8
9
|
}) => string;
|
|
9
10
|
//#endregion
|
|
10
|
-
export { getContentAddressedAssetStoragePath };
|
|
11
|
+
export { CONTENT_ADDRESSED_ASSET_PREFIX, getContentAddressedAssetStoragePath };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
//#region src/contentAddressedAssets.d.ts
|
|
2
|
+
declare const CONTENT_ADDRESSED_ASSET_PREFIX = "assets";
|
|
2
3
|
declare const getContentAddressedAssetStoragePath: ({
|
|
3
4
|
assetPath,
|
|
4
5
|
fileHash
|
|
@@ -7,4 +8,4 @@ declare const getContentAddressedAssetStoragePath: ({
|
|
|
7
8
|
fileHash: string;
|
|
8
9
|
}) => string;
|
|
9
10
|
//#endregion
|
|
10
|
-
export { getContentAddressedAssetStoragePath };
|
|
11
|
+
export { CONTENT_ADDRESSED_ASSET_PREFIX, getContentAddressedAssetStoragePath };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
//#region src/contentAddressedAssets.ts
|
|
2
|
+
const CONTENT_ADDRESSED_ASSET_PREFIX = "assets";
|
|
2
3
|
const getContentAddressedAssetStoragePath = ({ assetPath, fileHash }) => {
|
|
3
4
|
const extension = assetPath.endsWith(".br") ? ".br" : assetPath.includes(".") ? `.${assetPath.split(".").pop()}` : "";
|
|
4
5
|
return `sha256/${fileHash.slice(0, 2)}/${fileHash}${extension}`;
|
|
5
6
|
};
|
|
6
7
|
//#endregion
|
|
7
|
-
export { getContentAddressedAssetStoragePath };
|
|
8
|
+
export { CONTENT_ADDRESSED_ASSET_PREFIX, getContentAddressedAssetStoragePath };
|
|
@@ -93,10 +93,17 @@ function addTargetVersionRemoval(mutations, bundle) {
|
|
|
93
93
|
getTargetVersionMutation(mutations, bundle).removals.add(targetAppVersion);
|
|
94
94
|
}
|
|
95
95
|
function getManagementListPrefixes(where) {
|
|
96
|
+
if (where?.channel && where.platform && typeof where.targetAppVersion === "string") {
|
|
97
|
+
const targetAppVersion = normalizeTargetAppVersion(where.targetAppVersion);
|
|
98
|
+
if (targetAppVersion) return [`${where.channel}/${where.platform}/${targetAppVersion}/`];
|
|
99
|
+
}
|
|
96
100
|
if (where?.channel && where.platform) return [`${where.channel}/${where.platform}/`];
|
|
97
101
|
if (where?.channel) return [`${where.channel}/`];
|
|
98
102
|
return [""];
|
|
99
103
|
}
|
|
104
|
+
function getChannelFromUpdateJsonKey(key) {
|
|
105
|
+
return key.match(/^([^/]+)\/(?:ios|android)\/[^/]+\/update\.json$/)?.[1] ?? null;
|
|
106
|
+
}
|
|
100
107
|
const DEFAULT_DESC_ORDER = {
|
|
101
108
|
field: "id",
|
|
102
109
|
direction: "desc"
|
|
@@ -113,7 +120,7 @@ function sortManagedBundles(bundles, orderBy = DEFAULT_DESC_ORDER) {
|
|
|
113
120
|
*/
|
|
114
121
|
const createBlobDatabasePlugin = ({ name, factory }) => {
|
|
115
122
|
return (config, hooks) => {
|
|
116
|
-
const { listObjects, loadObject, uploadObject, deleteObject, shouldSkipLoadObjectError, invalidatePaths, apiBasePath } = factory(config);
|
|
123
|
+
const { listObjects, loadObject, uploadObject, deleteObject, shouldSkipLoadObjectError, validateChannel, invalidatePaths, apiBasePath } = factory(config);
|
|
117
124
|
const bundlesMap = /* @__PURE__ */ new Map();
|
|
118
125
|
const pendingBundlesMap = /* @__PURE__ */ new Map();
|
|
119
126
|
const locallyDeletedBundleIds = /* @__PURE__ */ new Set();
|
|
@@ -249,10 +256,12 @@ const createBlobDatabasePlugin = ({ name, factory }) => {
|
|
|
249
256
|
});
|
|
250
257
|
},
|
|
251
258
|
async getChannels() {
|
|
252
|
-
|
|
259
|
+
const channels = (await listObjects("")).map(getChannelFromUpdateJsonKey).filter((channel) => channel !== null);
|
|
260
|
+
return [...new Set(channels)].sort();
|
|
253
261
|
},
|
|
254
262
|
async commitBundle({ changedSets }) {
|
|
255
263
|
if (changedSets.length === 0) return;
|
|
264
|
+
for (const { operation, data } of changedSets) if (operation === "insert" || operation === "update" && data.channel !== void 0) validateChannel?.(data.channel);
|
|
256
265
|
const changedBundlesByKey = {};
|
|
257
266
|
const removalsByKey = {};
|
|
258
267
|
const targetVersionRemovalsByKey = {};
|
|
@@ -7,6 +7,7 @@ interface BlobOperations {
|
|
|
7
7
|
uploadObject: <T>(key: string, data: T) => Promise<void>;
|
|
8
8
|
deleteObject: (key: string) => Promise<void>;
|
|
9
9
|
shouldSkipLoadObjectError?: (error: unknown, key: string) => boolean;
|
|
10
|
+
validateChannel?: (channel: string) => void;
|
|
10
11
|
invalidatePaths: (paths: string[]) => Promise<void>;
|
|
11
12
|
apiBasePath: string;
|
|
12
13
|
}
|
|
@@ -7,6 +7,7 @@ interface BlobOperations {
|
|
|
7
7
|
uploadObject: <T>(key: string, data: T) => Promise<void>;
|
|
8
8
|
deleteObject: (key: string) => Promise<void>;
|
|
9
9
|
shouldSkipLoadObjectError?: (error: unknown, key: string) => boolean;
|
|
10
|
+
validateChannel?: (channel: string) => void;
|
|
10
11
|
invalidatePaths: (paths: string[]) => Promise<void>;
|
|
11
12
|
apiBasePath: string;
|
|
12
13
|
}
|
|
@@ -92,10 +92,17 @@ function addTargetVersionRemoval(mutations, bundle) {
|
|
|
92
92
|
getTargetVersionMutation(mutations, bundle).removals.add(targetAppVersion);
|
|
93
93
|
}
|
|
94
94
|
function getManagementListPrefixes(where) {
|
|
95
|
+
if (where?.channel && where.platform && typeof where.targetAppVersion === "string") {
|
|
96
|
+
const targetAppVersion = normalizeTargetAppVersion(where.targetAppVersion);
|
|
97
|
+
if (targetAppVersion) return [`${where.channel}/${where.platform}/${targetAppVersion}/`];
|
|
98
|
+
}
|
|
95
99
|
if (where?.channel && where.platform) return [`${where.channel}/${where.platform}/`];
|
|
96
100
|
if (where?.channel) return [`${where.channel}/`];
|
|
97
101
|
return [""];
|
|
98
102
|
}
|
|
103
|
+
function getChannelFromUpdateJsonKey(key) {
|
|
104
|
+
return key.match(/^([^/]+)\/(?:ios|android)\/[^/]+\/update\.json$/)?.[1] ?? null;
|
|
105
|
+
}
|
|
99
106
|
const DEFAULT_DESC_ORDER = {
|
|
100
107
|
field: "id",
|
|
101
108
|
direction: "desc"
|
|
@@ -112,7 +119,7 @@ function sortManagedBundles(bundles, orderBy = DEFAULT_DESC_ORDER) {
|
|
|
112
119
|
*/
|
|
113
120
|
const createBlobDatabasePlugin = ({ name, factory }) => {
|
|
114
121
|
return (config, hooks) => {
|
|
115
|
-
const { listObjects, loadObject, uploadObject, deleteObject, shouldSkipLoadObjectError, invalidatePaths, apiBasePath } = factory(config);
|
|
122
|
+
const { listObjects, loadObject, uploadObject, deleteObject, shouldSkipLoadObjectError, validateChannel, invalidatePaths, apiBasePath } = factory(config);
|
|
116
123
|
const bundlesMap = /* @__PURE__ */ new Map();
|
|
117
124
|
const pendingBundlesMap = /* @__PURE__ */ new Map();
|
|
118
125
|
const locallyDeletedBundleIds = /* @__PURE__ */ new Set();
|
|
@@ -248,10 +255,12 @@ const createBlobDatabasePlugin = ({ name, factory }) => {
|
|
|
248
255
|
});
|
|
249
256
|
},
|
|
250
257
|
async getChannels() {
|
|
251
|
-
|
|
258
|
+
const channels = (await listObjects("")).map(getChannelFromUpdateJsonKey).filter((channel) => channel !== null);
|
|
259
|
+
return [...new Set(channels)].sort();
|
|
252
260
|
},
|
|
253
261
|
async commitBundle({ changedSets }) {
|
|
254
262
|
if (changedSets.length === 0) return;
|
|
263
|
+
for (const { operation, data } of changedSets) if (operation === "insert" || operation === "update" && data.channel !== void 0) validateChannel?.(data.channel);
|
|
255
264
|
const changedBundlesByKey = {};
|
|
256
265
|
const removalsByKey = {};
|
|
257
266
|
const targetVersionRemovalsByKey = {};
|
|
@@ -38,21 +38,39 @@ const createProfiledStoragePlugin = ({ createProfiles, name, profileShape, suppo
|
|
|
38
38
|
return runtime;
|
|
39
39
|
};
|
|
40
40
|
const profiles = {};
|
|
41
|
-
if (profileShape?.node)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
if (profileShape?.node) {
|
|
42
|
+
const nodeProfile = {
|
|
43
|
+
async delete(storageUri) {
|
|
44
|
+
return requireNodeProfile().delete(storageUri);
|
|
45
|
+
},
|
|
46
|
+
async downloadFile(storageUri, filePath) {
|
|
47
|
+
return requireNodeProfile().downloadFile(storageUri, filePath);
|
|
48
|
+
},
|
|
49
|
+
async exists(storageUri) {
|
|
50
|
+
return requireNodeProfile().exists(storageUri);
|
|
51
|
+
},
|
|
52
|
+
async upload(key, filePath) {
|
|
53
|
+
return requireNodeProfile().upload(key, filePath);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
Object.defineProperties(nodeProfile, {
|
|
57
|
+
deleteObjects: {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: () => {
|
|
60
|
+
const deleteObjects = requireNodeProfile().deleteObjects;
|
|
61
|
+
return deleteObjects ? (keys) => deleteObjects(keys) : void 0;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
listObjects: {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: () => {
|
|
67
|
+
const listObjects = requireNodeProfile().listObjects;
|
|
68
|
+
return listObjects ? (prefix) => listObjects(prefix) : void 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
profiles.node = nodeProfile;
|
|
73
|
+
} else if (profileShape?.node !== false) Object.defineProperty(profiles, "node", {
|
|
56
74
|
enumerable: true,
|
|
57
75
|
get: getNodeProfile
|
|
58
76
|
});
|
|
@@ -38,21 +38,39 @@ const createProfiledStoragePlugin = ({ createProfiles, name, profileShape, suppo
|
|
|
38
38
|
return runtime;
|
|
39
39
|
};
|
|
40
40
|
const profiles = {};
|
|
41
|
-
if (profileShape?.node)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
if (profileShape?.node) {
|
|
42
|
+
const nodeProfile = {
|
|
43
|
+
async delete(storageUri) {
|
|
44
|
+
return requireNodeProfile().delete(storageUri);
|
|
45
|
+
},
|
|
46
|
+
async downloadFile(storageUri, filePath) {
|
|
47
|
+
return requireNodeProfile().downloadFile(storageUri, filePath);
|
|
48
|
+
},
|
|
49
|
+
async exists(storageUri) {
|
|
50
|
+
return requireNodeProfile().exists(storageUri);
|
|
51
|
+
},
|
|
52
|
+
async upload(key, filePath) {
|
|
53
|
+
return requireNodeProfile().upload(key, filePath);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
Object.defineProperties(nodeProfile, {
|
|
57
|
+
deleteObjects: {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: () => {
|
|
60
|
+
const deleteObjects = requireNodeProfile().deleteObjects;
|
|
61
|
+
return deleteObjects ? (keys) => deleteObjects(keys) : void 0;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
listObjects: {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: () => {
|
|
67
|
+
const listObjects = requireNodeProfile().listObjects;
|
|
68
|
+
return listObjects ? (prefix) => listObjects(prefix) : void 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
profiles.node = nodeProfile;
|
|
73
|
+
} else if (profileShape?.node !== false) Object.defineProperty(profiles, "node", {
|
|
56
74
|
enumerable: true,
|
|
57
75
|
get: getNodeProfile
|
|
58
76
|
});
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_calculatePagination = require("./calculatePagination.cjs");
|
|
3
|
+
const require_bundleStorageLayout = require("./bundleStorageLayout.cjs");
|
|
3
4
|
const require_compressionFormat = require("./compressionFormat.cjs");
|
|
4
5
|
const require_contentAddressedAssets = require("./contentAddressedAssets.cjs");
|
|
5
6
|
const require_assetStorageLayout = require("./assetStorageLayout.cjs");
|
|
@@ -18,17 +19,21 @@ const require_parseStorageUri = require("./parseStorageUri.cjs");
|
|
|
18
19
|
const require_storageProfile = require("./storageProfile.cjs");
|
|
19
20
|
const require_index = require("./types/index.cjs");
|
|
20
21
|
const require_uuidv7 = require("./uuidv7.cjs");
|
|
22
|
+
exports.BUNDLE_STORAGE_PREFIX = require_bundleStorageLayout.BUNDLE_STORAGE_PREFIX;
|
|
23
|
+
exports.CONTENT_ADDRESSED_ASSET_PREFIX = require_contentAddressedAssets.CONTENT_ADDRESSED_ASSET_PREFIX;
|
|
21
24
|
exports.assertNodeStoragePlugin = require_storageProfile.assertNodeStoragePlugin;
|
|
22
25
|
exports.assertRuntimeStoragePlugin = require_storageProfile.assertRuntimeStoragePlugin;
|
|
23
26
|
exports.bundleIdMatchesFilter = require_queryBundles.bundleIdMatchesFilter;
|
|
24
27
|
exports.bundleMatchesQueryWhere = require_queryBundles.bundleMatchesQueryWhere;
|
|
25
28
|
exports.calculatePagination = require_calculatePagination.calculatePagination;
|
|
26
29
|
exports.createBlobDatabasePlugin = require_createBlobDatabasePlugin.createBlobDatabasePlugin;
|
|
30
|
+
exports.createBundleStorageKey = require_bundleStorageLayout.createBundleStorageKey;
|
|
27
31
|
exports.createDatabasePlugin = require_createDatabasePlugin.createDatabasePlugin;
|
|
28
32
|
exports.createNodeStoragePlugin = require_createStoragePlugin.createNodeStoragePlugin;
|
|
29
33
|
exports.createRequestUpdateBundleResolver = require_requestUpdateBundleState.createRequestUpdateBundleResolver;
|
|
30
34
|
exports.createRuntimeStoragePlugin = require_createStoragePlugin.createRuntimeStoragePlugin;
|
|
31
35
|
exports.createStorageKeyBuilder = require_createStorageKeyBuilder.createStorageKeyBuilder;
|
|
36
|
+
exports.createStorageRootUriWithPath = require_bundleStorageLayout.createStorageRootUriWithPath;
|
|
32
37
|
exports.createStorageUriWithRelativePath = require_assetStorageLayout.createStorageUriWithRelativePath;
|
|
33
38
|
exports.createUUIDv7 = require_uuidv7.createUUIDv7;
|
|
34
39
|
exports.createUUIDv7WithSameTimestamp = require_uuidv7.createUUIDv7WithSameTimestamp;
|
|
@@ -41,8 +46,10 @@ exports.getAssetStorageLayout = require_assetStorageLayout.getAssetStorageLayout
|
|
|
41
46
|
exports.getCompressionMimeType = require_compressionFormat.getCompressionMimeType;
|
|
42
47
|
exports.getContentAddressedAssetStoragePath = require_contentAddressedAssets.getContentAddressedAssetStoragePath;
|
|
43
48
|
exports.getContentType = require_compressionFormat.getContentType;
|
|
49
|
+
exports.getManifestAssetDownloadPath = require_assetStorageLayout.getManifestAssetDownloadPath;
|
|
44
50
|
exports.getManifestAssetStoragePath = require_assetStorageLayout.getManifestAssetStoragePath;
|
|
45
51
|
exports.getRequestUpdateBundleSeeds = require_requestUpdateBundleState.getRequestUpdateBundleSeeds;
|
|
52
|
+
exports.isBrotliManifestAssetPath = require_assetStorageLayout.isBrotliManifestAssetPath;
|
|
46
53
|
exports.isContentAddressedAssetBaseStorageUri = require_assetStorageLayout.isContentAddressedAssetBaseStorageUri;
|
|
47
54
|
exports.isNodeStoragePlugin = require_storageProfile.isNodeStoragePlugin;
|
|
48
55
|
exports.isRuntimeStoragePlugin = require_storageProfile.isRuntimeStoragePlugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BuiltIns, HasMultipleCallSignatures, Primitive, RequiredDeep } from "./types/utils.cjs";
|
|
2
|
-
import { AppVersionGetBundlesArgs, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, Bundle, ConfigInput, DatabaseBundleCursor, DatabaseBundleIdFilter, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, DatabasePlugin, DatabasePluginHooks, FingerprintExtraSources, FingerprintGetBundlesArgs, GetBundlesArgs, HotUpdaterContext, IosBuildDestination, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, NodeStoragePlugin, NodeStorageProfile, Paginated, PaginatedResult, PaginationInfo, Platform, PlatformConfig, RequestEnvContext, RuntimeStoragePlugin, RuntimeStorageProfile, SigningConfig, StoragePlugin, StoragePluginHooks, StoragePluginProfiles, StorageResolveContext, UniversalStoragePlugin, UpdateInfo, supportedIosPlatforms } from "./types/index.cjs";
|
|
2
|
+
import { AppVersionGetBundlesArgs, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, Bundle, ConfigInput, DatabaseBundleCursor, DatabaseBundleIdFilter, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, DatabasePlugin, DatabasePluginHooks, FingerprintExtraSources, FingerprintGetBundlesArgs, GetBundlesArgs, HotUpdaterContext, IosBuildDestination, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, NodeStoragePlugin, NodeStorageProfile, Paginated, PaginatedResult, PaginationInfo, Platform, PlatformConfig, RequestEnvContext, RuntimeStoragePlugin, RuntimeStorageProfile, SigningConfig, StorageObject, StoragePlugin, StoragePluginHooks, StoragePluginProfiles, StorageResolveContext, UniversalStoragePlugin, UpdateInfo, supportedIosPlatforms } from "./types/index.cjs";
|
|
3
3
|
import { PaginationOptions, calculatePagination } from "./calculatePagination.cjs";
|
|
4
|
+
import { BUNDLE_STORAGE_PREFIX, createBundleStorageKey, createStorageRootUriWithPath } from "./bundleStorageLayout.cjs";
|
|
4
5
|
import { CompressionFormat, CompressionFormatInfo, detectCompressionFormat, getCompressionMimeType, getContentType } from "./compressionFormat.cjs";
|
|
5
|
-
import { AssetStorageLayout, createStorageUriWithRelativePath, getAssetStorageLayout, getManifestAssetStoragePath, isContentAddressedAssetBaseStorageUri, resolveManifestAssetStorageUri } from "./assetStorageLayout.cjs";
|
|
6
|
-
import { getContentAddressedAssetStoragePath } from "./contentAddressedAssets.cjs";
|
|
6
|
+
import { AssetStorageLayout, createStorageUriWithRelativePath, getAssetStorageLayout, getManifestAssetDownloadPath, getManifestAssetStoragePath, isBrotliManifestAssetPath, isContentAddressedAssetBaseStorageUri, resolveManifestAssetStorageUri } from "./assetStorageLayout.cjs";
|
|
7
|
+
import { CONTENT_ADDRESSED_ASSET_PREFIX, getContentAddressedAssetStoragePath } from "./contentAddressedAssets.cjs";
|
|
7
8
|
import { BlobOperations, createBlobDatabasePlugin } from "./createBlobDatabasePlugin.cjs";
|
|
8
9
|
import { AbstractDatabasePlugin, CreateDatabasePluginOptions, createDatabasePlugin } from "./createDatabasePlugin.cjs";
|
|
9
10
|
import { createStorageKeyBuilder } from "./createStorageKeyBuilder.cjs";
|
|
@@ -18,4 +19,4 @@ import { ResolveUpdateInfoFromBundlesOptions, resolveUpdateInfoFromBundles } fro
|
|
|
18
19
|
import { semverSatisfies } from "./semverSatisfies.cjs";
|
|
19
20
|
import { assertNodeStoragePlugin, assertRuntimeStoragePlugin, isNodeStoragePlugin, isRuntimeStoragePlugin } from "./storageProfile.cjs";
|
|
20
21
|
import { createUUIDv7, createUUIDv7WithSameTimestamp, extractTimestampFromUUIDv7 } from "./uuidv7.cjs";
|
|
21
|
-
export { AbstractDatabasePlugin, AppVersionGetBundlesArgs, ApplePlatform, AssetStorageLayout, BasePluginArgs, BlobOperations, BuildPlugin, BuildPluginConfig, BuiltIns, Bundle, CompressionFormat, CompressionFormatInfo, ConfigInput, CreateDatabasePluginOptions, DatabaseBundleCursor, DatabaseBundleIdFilter, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, DatabasePlugin, DatabasePluginHooks, FingerprintExtraSources, FingerprintGetBundlesArgs, GetBundlesArgs, HasMultipleCallSignatures, HotUpdaterContext, IosBuildDestination, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, NodeStoragePlugin, NodeStorageProfile, Paginated, PaginatedResult, PaginationInfo, PaginationOptions, ParsedStorageUri, Platform, PlatformConfig, Primitive, RequestEnvContext, RequiredDeep, ResolveUpdateInfoFromBundlesOptions, RuntimeStoragePlugin, RuntimeStorageProfile, SigningConfig, StoragePlugin, StoragePluginHooks, StoragePluginProfiles, StorageResolveContext, UniversalStoragePlugin, UpdateInfo, assertNodeStoragePlugin, assertRuntimeStoragePlugin, bundleIdMatchesFilter, bundleMatchesQueryWhere, calculatePagination, createBlobDatabasePlugin, createDatabasePlugin, createNodeStoragePlugin, createRequestUpdateBundleResolver, createRuntimeStoragePlugin, createStorageKeyBuilder, createStorageUriWithRelativePath, createUUIDv7, createUUIDv7WithSameTimestamp, createUniversalStoragePlugin, detectCompressionFormat, extractTimestampFromUUIDv7, filterCompatibleAppVersions, generateMinBundleId, getAssetStorageLayout, getCompressionMimeType, getContentAddressedAssetStoragePath, getContentType, getManifestAssetStoragePath, getRequestUpdateBundleSeeds, isContentAddressedAssetBaseStorageUri, isNodeStoragePlugin, isRuntimeStoragePlugin, paginateBundles, parseStorageUri, resolveManifestAssetStorageUri, resolveUpdateInfoFromBundles, semverSatisfies, sortBundles, supportedIosPlatforms };
|
|
22
|
+
export { AbstractDatabasePlugin, AppVersionGetBundlesArgs, ApplePlatform, AssetStorageLayout, BUNDLE_STORAGE_PREFIX, BasePluginArgs, BlobOperations, BuildPlugin, BuildPluginConfig, BuiltIns, Bundle, CONTENT_ADDRESSED_ASSET_PREFIX, CompressionFormat, CompressionFormatInfo, ConfigInput, CreateDatabasePluginOptions, DatabaseBundleCursor, DatabaseBundleIdFilter, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, DatabasePlugin, DatabasePluginHooks, FingerprintExtraSources, FingerprintGetBundlesArgs, GetBundlesArgs, HasMultipleCallSignatures, HotUpdaterContext, IosBuildDestination, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, NodeStoragePlugin, NodeStorageProfile, Paginated, PaginatedResult, PaginationInfo, PaginationOptions, ParsedStorageUri, Platform, PlatformConfig, Primitive, RequestEnvContext, RequiredDeep, ResolveUpdateInfoFromBundlesOptions, RuntimeStoragePlugin, RuntimeStorageProfile, SigningConfig, StorageObject, StoragePlugin, StoragePluginHooks, StoragePluginProfiles, StorageResolveContext, UniversalStoragePlugin, UpdateInfo, assertNodeStoragePlugin, assertRuntimeStoragePlugin, bundleIdMatchesFilter, bundleMatchesQueryWhere, calculatePagination, createBlobDatabasePlugin, createBundleStorageKey, createDatabasePlugin, createNodeStoragePlugin, createRequestUpdateBundleResolver, createRuntimeStoragePlugin, createStorageKeyBuilder, createStorageRootUriWithPath, createStorageUriWithRelativePath, createUUIDv7, createUUIDv7WithSameTimestamp, createUniversalStoragePlugin, detectCompressionFormat, extractTimestampFromUUIDv7, filterCompatibleAppVersions, generateMinBundleId, getAssetStorageLayout, getCompressionMimeType, getContentAddressedAssetStoragePath, getContentType, getManifestAssetDownloadPath, getManifestAssetStoragePath, getRequestUpdateBundleSeeds, isBrotliManifestAssetPath, isContentAddressedAssetBaseStorageUri, isNodeStoragePlugin, isRuntimeStoragePlugin, paginateBundles, parseStorageUri, resolveManifestAssetStorageUri, resolveUpdateInfoFromBundles, semverSatisfies, sortBundles, supportedIosPlatforms };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BuiltIns, HasMultipleCallSignatures, Primitive, RequiredDeep } from "./types/utils.mjs";
|
|
2
|
-
import { AppVersionGetBundlesArgs, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, Bundle, ConfigInput, DatabaseBundleCursor, DatabaseBundleIdFilter, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, DatabasePlugin, DatabasePluginHooks, FingerprintExtraSources, FingerprintGetBundlesArgs, GetBundlesArgs, HotUpdaterContext, IosBuildDestination, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, NodeStoragePlugin, NodeStorageProfile, Paginated, PaginatedResult, PaginationInfo, Platform, PlatformConfig, RequestEnvContext, RuntimeStoragePlugin, RuntimeStorageProfile, SigningConfig, StoragePlugin, StoragePluginHooks, StoragePluginProfiles, StorageResolveContext, UniversalStoragePlugin, UpdateInfo, supportedIosPlatforms } from "./types/index.mjs";
|
|
2
|
+
import { AppVersionGetBundlesArgs, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, Bundle, ConfigInput, DatabaseBundleCursor, DatabaseBundleIdFilter, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, DatabasePlugin, DatabasePluginHooks, FingerprintExtraSources, FingerprintGetBundlesArgs, GetBundlesArgs, HotUpdaterContext, IosBuildDestination, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, NodeStoragePlugin, NodeStorageProfile, Paginated, PaginatedResult, PaginationInfo, Platform, PlatformConfig, RequestEnvContext, RuntimeStoragePlugin, RuntimeStorageProfile, SigningConfig, StorageObject, StoragePlugin, StoragePluginHooks, StoragePluginProfiles, StorageResolveContext, UniversalStoragePlugin, UpdateInfo, supportedIosPlatforms } from "./types/index.mjs";
|
|
3
3
|
import { PaginationOptions, calculatePagination } from "./calculatePagination.mjs";
|
|
4
|
+
import { BUNDLE_STORAGE_PREFIX, createBundleStorageKey, createStorageRootUriWithPath } from "./bundleStorageLayout.mjs";
|
|
4
5
|
import { CompressionFormat, CompressionFormatInfo, detectCompressionFormat, getCompressionMimeType, getContentType } from "./compressionFormat.mjs";
|
|
5
|
-
import { AssetStorageLayout, createStorageUriWithRelativePath, getAssetStorageLayout, getManifestAssetStoragePath, isContentAddressedAssetBaseStorageUri, resolveManifestAssetStorageUri } from "./assetStorageLayout.mjs";
|
|
6
|
-
import { getContentAddressedAssetStoragePath } from "./contentAddressedAssets.mjs";
|
|
6
|
+
import { AssetStorageLayout, createStorageUriWithRelativePath, getAssetStorageLayout, getManifestAssetDownloadPath, getManifestAssetStoragePath, isBrotliManifestAssetPath, isContentAddressedAssetBaseStorageUri, resolveManifestAssetStorageUri } from "./assetStorageLayout.mjs";
|
|
7
|
+
import { CONTENT_ADDRESSED_ASSET_PREFIX, getContentAddressedAssetStoragePath } from "./contentAddressedAssets.mjs";
|
|
7
8
|
import { BlobOperations, createBlobDatabasePlugin } from "./createBlobDatabasePlugin.mjs";
|
|
8
9
|
import { AbstractDatabasePlugin, CreateDatabasePluginOptions, createDatabasePlugin } from "./createDatabasePlugin.mjs";
|
|
9
10
|
import { createStorageKeyBuilder } from "./createStorageKeyBuilder.mjs";
|
|
@@ -18,4 +19,4 @@ import { ResolveUpdateInfoFromBundlesOptions, resolveUpdateInfoFromBundles } fro
|
|
|
18
19
|
import { semverSatisfies } from "./semverSatisfies.mjs";
|
|
19
20
|
import { assertNodeStoragePlugin, assertRuntimeStoragePlugin, isNodeStoragePlugin, isRuntimeStoragePlugin } from "./storageProfile.mjs";
|
|
20
21
|
import { createUUIDv7, createUUIDv7WithSameTimestamp, extractTimestampFromUUIDv7 } from "./uuidv7.mjs";
|
|
21
|
-
export { AbstractDatabasePlugin, AppVersionGetBundlesArgs, ApplePlatform, AssetStorageLayout, BasePluginArgs, BlobOperations, BuildPlugin, BuildPluginConfig, BuiltIns, Bundle, CompressionFormat, CompressionFormatInfo, ConfigInput, CreateDatabasePluginOptions, DatabaseBundleCursor, DatabaseBundleIdFilter, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, DatabasePlugin, DatabasePluginHooks, FingerprintExtraSources, FingerprintGetBundlesArgs, GetBundlesArgs, HasMultipleCallSignatures, HotUpdaterContext, IosBuildDestination, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, NodeStoragePlugin, NodeStorageProfile, Paginated, PaginatedResult, PaginationInfo, PaginationOptions, ParsedStorageUri, Platform, PlatformConfig, Primitive, RequestEnvContext, RequiredDeep, ResolveUpdateInfoFromBundlesOptions, RuntimeStoragePlugin, RuntimeStorageProfile, SigningConfig, StoragePlugin, StoragePluginHooks, StoragePluginProfiles, StorageResolveContext, UniversalStoragePlugin, UpdateInfo, assertNodeStoragePlugin, assertRuntimeStoragePlugin, bundleIdMatchesFilter, bundleMatchesQueryWhere, calculatePagination, createBlobDatabasePlugin, createDatabasePlugin, createNodeStoragePlugin, createRequestUpdateBundleResolver, createRuntimeStoragePlugin, createStorageKeyBuilder, createStorageUriWithRelativePath, createUUIDv7, createUUIDv7WithSameTimestamp, createUniversalStoragePlugin, detectCompressionFormat, extractTimestampFromUUIDv7, filterCompatibleAppVersions, generateMinBundleId, getAssetStorageLayout, getCompressionMimeType, getContentAddressedAssetStoragePath, getContentType, getManifestAssetStoragePath, getRequestUpdateBundleSeeds, isContentAddressedAssetBaseStorageUri, isNodeStoragePlugin, isRuntimeStoragePlugin, paginateBundles, parseStorageUri, resolveManifestAssetStorageUri, resolveUpdateInfoFromBundles, semverSatisfies, sortBundles, supportedIosPlatforms };
|
|
22
|
+
export { AbstractDatabasePlugin, AppVersionGetBundlesArgs, ApplePlatform, AssetStorageLayout, BUNDLE_STORAGE_PREFIX, BasePluginArgs, BlobOperations, BuildPlugin, BuildPluginConfig, BuiltIns, Bundle, CONTENT_ADDRESSED_ASSET_PREFIX, CompressionFormat, CompressionFormatInfo, ConfigInput, CreateDatabasePluginOptions, DatabaseBundleCursor, DatabaseBundleIdFilter, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, DatabasePlugin, DatabasePluginHooks, FingerprintExtraSources, FingerprintGetBundlesArgs, GetBundlesArgs, HasMultipleCallSignatures, HotUpdaterContext, IosBuildDestination, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, NodeStoragePlugin, NodeStorageProfile, Paginated, PaginatedResult, PaginationInfo, PaginationOptions, ParsedStorageUri, Platform, PlatformConfig, Primitive, RequestEnvContext, RequiredDeep, ResolveUpdateInfoFromBundlesOptions, RuntimeStoragePlugin, RuntimeStorageProfile, SigningConfig, StorageObject, StoragePlugin, StoragePluginHooks, StoragePluginProfiles, StorageResolveContext, UniversalStoragePlugin, UpdateInfo, assertNodeStoragePlugin, assertRuntimeStoragePlugin, bundleIdMatchesFilter, bundleMatchesQueryWhere, calculatePagination, createBlobDatabasePlugin, createBundleStorageKey, createDatabasePlugin, createNodeStoragePlugin, createRequestUpdateBundleResolver, createRuntimeStoragePlugin, createStorageKeyBuilder, createStorageRootUriWithPath, createStorageUriWithRelativePath, createUUIDv7, createUUIDv7WithSameTimestamp, createUniversalStoragePlugin, detectCompressionFormat, extractTimestampFromUUIDv7, filterCompatibleAppVersions, generateMinBundleId, getAssetStorageLayout, getCompressionMimeType, getContentAddressedAssetStoragePath, getContentType, getManifestAssetDownloadPath, getManifestAssetStoragePath, getRequestUpdateBundleSeeds, isBrotliManifestAssetPath, isContentAddressedAssetBaseStorageUri, isNodeStoragePlugin, isRuntimeStoragePlugin, paginateBundles, parseStorageUri, resolveManifestAssetStorageUri, resolveUpdateInfoFromBundles, semverSatisfies, sortBundles, supportedIosPlatforms };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { calculatePagination } from "./calculatePagination.mjs";
|
|
2
|
+
import { BUNDLE_STORAGE_PREFIX, createBundleStorageKey, createStorageRootUriWithPath } from "./bundleStorageLayout.mjs";
|
|
2
3
|
import { detectCompressionFormat, getCompressionMimeType, getContentType } from "./compressionFormat.mjs";
|
|
3
|
-
import { getContentAddressedAssetStoragePath } from "./contentAddressedAssets.mjs";
|
|
4
|
-
import { createStorageUriWithRelativePath, getAssetStorageLayout, getManifestAssetStoragePath, isContentAddressedAssetBaseStorageUri, resolveManifestAssetStorageUri } from "./assetStorageLayout.mjs";
|
|
4
|
+
import { CONTENT_ADDRESSED_ASSET_PREFIX, getContentAddressedAssetStoragePath } from "./contentAddressedAssets.mjs";
|
|
5
|
+
import { createStorageUriWithRelativePath, getAssetStorageLayout, getManifestAssetDownloadPath, getManifestAssetStoragePath, isBrotliManifestAssetPath, isContentAddressedAssetBaseStorageUri, resolveManifestAssetStorageUri } from "./assetStorageLayout.mjs";
|
|
5
6
|
import { bundleIdMatchesFilter, bundleMatchesQueryWhere, sortBundles } from "./queryBundles.mjs";
|
|
6
7
|
import { createDatabasePlugin } from "./createDatabasePlugin.mjs";
|
|
7
8
|
import { semverSatisfies } from "./semverSatisfies.mjs";
|
|
@@ -17,4 +18,4 @@ import { parseStorageUri } from "./parseStorageUri.mjs";
|
|
|
17
18
|
import { assertNodeStoragePlugin, assertRuntimeStoragePlugin, isNodeStoragePlugin, isRuntimeStoragePlugin } from "./storageProfile.mjs";
|
|
18
19
|
import { supportedIosPlatforms } from "./types/index.mjs";
|
|
19
20
|
import { createUUIDv7, createUUIDv7WithSameTimestamp, extractTimestampFromUUIDv7 } from "./uuidv7.mjs";
|
|
20
|
-
export { assertNodeStoragePlugin, assertRuntimeStoragePlugin, bundleIdMatchesFilter, bundleMatchesQueryWhere, calculatePagination, createBlobDatabasePlugin, createDatabasePlugin, createNodeStoragePlugin, createRequestUpdateBundleResolver, createRuntimeStoragePlugin, createStorageKeyBuilder, createStorageUriWithRelativePath, createUUIDv7, createUUIDv7WithSameTimestamp, createUniversalStoragePlugin, detectCompressionFormat, extractTimestampFromUUIDv7, filterCompatibleAppVersions, generateMinBundleId, getAssetStorageLayout, getCompressionMimeType, getContentAddressedAssetStoragePath, getContentType, getManifestAssetStoragePath, getRequestUpdateBundleSeeds, isContentAddressedAssetBaseStorageUri, isNodeStoragePlugin, isRuntimeStoragePlugin, paginateBundles, parseStorageUri, resolveManifestAssetStorageUri, resolveUpdateInfoFromBundles, semverSatisfies, sortBundles, supportedIosPlatforms };
|
|
21
|
+
export { BUNDLE_STORAGE_PREFIX, CONTENT_ADDRESSED_ASSET_PREFIX, assertNodeStoragePlugin, assertRuntimeStoragePlugin, bundleIdMatchesFilter, bundleMatchesQueryWhere, calculatePagination, createBlobDatabasePlugin, createBundleStorageKey, createDatabasePlugin, createNodeStoragePlugin, createRequestUpdateBundleResolver, createRuntimeStoragePlugin, createStorageKeyBuilder, createStorageRootUriWithPath, createStorageUriWithRelativePath, createUUIDv7, createUUIDv7WithSameTimestamp, createUniversalStoragePlugin, detectCompressionFormat, extractTimestampFromUUIDv7, filterCompatibleAppVersions, generateMinBundleId, getAssetStorageLayout, getCompressionMimeType, getContentAddressedAssetStoragePath, getContentType, getManifestAssetDownloadPath, getManifestAssetStoragePath, getRequestUpdateBundleSeeds, isBrotliManifestAssetPath, isContentAddressedAssetBaseStorageUri, isNodeStoragePlugin, isRuntimeStoragePlugin, paginateBundles, parseStorageUri, resolveManifestAssetStorageUri, resolveUpdateInfoFromBundles, semverSatisfies, sortBundles, supportedIosPlatforms };
|
package/dist/types/index.d.cts
CHANGED
|
@@ -279,6 +279,13 @@ interface RequestEnvContext<TEnv = unknown> {
|
|
|
279
279
|
}
|
|
280
280
|
type HotUpdaterContext<TContext = unknown> = TContext;
|
|
281
281
|
type StorageResolveContext<TContext = unknown> = HotUpdaterContext<TContext>;
|
|
282
|
+
interface StorageObject {
|
|
283
|
+
/** Object key relative to the storage plugin's configured base path. */
|
|
284
|
+
key: string;
|
|
285
|
+
storageUri: string;
|
|
286
|
+
size: number;
|
|
287
|
+
lastModifiedAt?: Date;
|
|
288
|
+
}
|
|
282
289
|
interface NodeStorageProfile {
|
|
283
290
|
upload: (key: string, filePath: string) => Promise<{
|
|
284
291
|
storageUri: string;
|
|
@@ -291,6 +298,13 @@ interface NodeStorageProfile {
|
|
|
291
298
|
exists: (storageUri: string) => Promise<boolean>;
|
|
292
299
|
delete: (storageUri: string) => Promise<void>;
|
|
293
300
|
downloadFile: (storageUri: string, filePath: string) => Promise<void>;
|
|
301
|
+
/**
|
|
302
|
+
* Optional management capabilities used by storage garbage collection.
|
|
303
|
+
* Object keys are relative to the configured storage base path.
|
|
304
|
+
* `deleteObjects` must delete only the exact keys it receives.
|
|
305
|
+
*/
|
|
306
|
+
listObjects?: (prefix?: string) => Promise<StorageObject[]>;
|
|
307
|
+
deleteObjects?: (keys: readonly string[]) => Promise<void>;
|
|
294
308
|
}
|
|
295
309
|
interface RuntimeStorageProfile<TContext = unknown> {
|
|
296
310
|
getDownloadUrl: (storageUri: string, context?: StorageResolveContext<TContext>) => Promise<{
|
|
@@ -521,4 +535,4 @@ interface NativeBuildOptions {
|
|
|
521
535
|
scheme?: string;
|
|
522
536
|
}
|
|
523
537
|
//#endregion
|
|
524
|
-
export { type AppVersionGetBundlesArgs, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, type Bundle$1 as Bundle, ConfigInput, DatabaseBundleCursor, DatabaseBundleIdFilter, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, DatabasePlugin, DatabasePluginHooks, FingerprintExtraSources, type FingerprintGetBundlesArgs, type GetBundlesArgs$1 as GetBundlesArgs, HotUpdaterContext, IosBuildDestination, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, NodeStoragePlugin, NodeStorageProfile, Paginated, PaginatedResult, PaginationInfo, type Platform$1 as Platform, PlatformConfig, RequestEnvContext, RuntimeStoragePlugin, RuntimeStorageProfile, SigningConfig, StoragePlugin, StoragePluginHooks, StoragePluginProfiles, StorageResolveContext, UniversalStoragePlugin, type UpdateInfo$1 as UpdateInfo, supportedIosPlatforms };
|
|
538
|
+
export { type AppVersionGetBundlesArgs, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, type Bundle$1 as Bundle, ConfigInput, DatabaseBundleCursor, DatabaseBundleIdFilter, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, DatabasePlugin, DatabasePluginHooks, FingerprintExtraSources, type FingerprintGetBundlesArgs, type GetBundlesArgs$1 as GetBundlesArgs, HotUpdaterContext, IosBuildDestination, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, NodeStoragePlugin, NodeStorageProfile, Paginated, PaginatedResult, PaginationInfo, type Platform$1 as Platform, PlatformConfig, RequestEnvContext, RuntimeStoragePlugin, RuntimeStorageProfile, SigningConfig, StorageObject, StoragePlugin, StoragePluginHooks, StoragePluginProfiles, StorageResolveContext, UniversalStoragePlugin, type UpdateInfo$1 as UpdateInfo, supportedIosPlatforms };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -279,6 +279,13 @@ interface RequestEnvContext<TEnv = unknown> {
|
|
|
279
279
|
}
|
|
280
280
|
type HotUpdaterContext<TContext = unknown> = TContext;
|
|
281
281
|
type StorageResolveContext<TContext = unknown> = HotUpdaterContext<TContext>;
|
|
282
|
+
interface StorageObject {
|
|
283
|
+
/** Object key relative to the storage plugin's configured base path. */
|
|
284
|
+
key: string;
|
|
285
|
+
storageUri: string;
|
|
286
|
+
size: number;
|
|
287
|
+
lastModifiedAt?: Date;
|
|
288
|
+
}
|
|
282
289
|
interface NodeStorageProfile {
|
|
283
290
|
upload: (key: string, filePath: string) => Promise<{
|
|
284
291
|
storageUri: string;
|
|
@@ -291,6 +298,13 @@ interface NodeStorageProfile {
|
|
|
291
298
|
exists: (storageUri: string) => Promise<boolean>;
|
|
292
299
|
delete: (storageUri: string) => Promise<void>;
|
|
293
300
|
downloadFile: (storageUri: string, filePath: string) => Promise<void>;
|
|
301
|
+
/**
|
|
302
|
+
* Optional management capabilities used by storage garbage collection.
|
|
303
|
+
* Object keys are relative to the configured storage base path.
|
|
304
|
+
* `deleteObjects` must delete only the exact keys it receives.
|
|
305
|
+
*/
|
|
306
|
+
listObjects?: (prefix?: string) => Promise<StorageObject[]>;
|
|
307
|
+
deleteObjects?: (keys: readonly string[]) => Promise<void>;
|
|
294
308
|
}
|
|
295
309
|
interface RuntimeStorageProfile<TContext = unknown> {
|
|
296
310
|
getDownloadUrl: (storageUri: string, context?: StorageResolveContext<TContext>) => Promise<{
|
|
@@ -521,4 +535,4 @@ interface NativeBuildOptions {
|
|
|
521
535
|
scheme?: string;
|
|
522
536
|
}
|
|
523
537
|
//#endregion
|
|
524
|
-
export { type AppVersionGetBundlesArgs, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, type Bundle$1 as Bundle, ConfigInput, DatabaseBundleCursor, DatabaseBundleIdFilter, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, DatabasePlugin, DatabasePluginHooks, FingerprintExtraSources, type FingerprintGetBundlesArgs, type GetBundlesArgs$1 as GetBundlesArgs, HotUpdaterContext, IosBuildDestination, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, NodeStoragePlugin, NodeStorageProfile, Paginated, PaginatedResult, PaginationInfo, type Platform$1 as Platform, PlatformConfig, RequestEnvContext, RuntimeStoragePlugin, RuntimeStorageProfile, SigningConfig, StoragePlugin, StoragePluginHooks, StoragePluginProfiles, StorageResolveContext, UniversalStoragePlugin, type UpdateInfo$1 as UpdateInfo, supportedIosPlatforms };
|
|
538
|
+
export { type AppVersionGetBundlesArgs, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, type Bundle$1 as Bundle, ConfigInput, DatabaseBundleCursor, DatabaseBundleIdFilter, DatabaseBundleQueryOptions, DatabaseBundleQueryOrder, DatabaseBundleQueryWhere, DatabasePlugin, DatabasePluginHooks, FingerprintExtraSources, type FingerprintGetBundlesArgs, type GetBundlesArgs$1 as GetBundlesArgs, HotUpdaterContext, IosBuildDestination, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, NodeStoragePlugin, NodeStorageProfile, Paginated, PaginatedResult, PaginationInfo, type Platform$1 as Platform, PlatformConfig, RequestEnvContext, RuntimeStoragePlugin, RuntimeStorageProfile, SigningConfig, StorageObject, StoragePlugin, StoragePluginHooks, StoragePluginProfiles, StorageResolveContext, UniversalStoragePlugin, type UpdateInfo$1 as UpdateInfo, supportedIosPlatforms };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/plugin-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
"es-toolkit": "^1.32.0",
|
|
46
46
|
"mime": "^4.0.4",
|
|
47
47
|
"verkit": "0.3.2",
|
|
48
|
-
"@hot-updater/
|
|
49
|
-
"@hot-updater/
|
|
48
|
+
"@hot-updater/core": "0.36.0",
|
|
49
|
+
"@hot-updater/js": "0.36.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/node": "^20",
|
|
53
53
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
54
54
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
55
|
-
"@hot-updater/test-utils": "0.
|
|
55
|
+
"@hot-updater/test-utils": "0.36.0"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsdown",
|