@hot-updater/plugin-core 0.36.1 → 0.36.3

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/index.cjs CHANGED
@@ -38,6 +38,7 @@ exports.createStorageUriWithRelativePath = require_assetStorageLayout.createStor
38
38
  exports.createUUIDv7 = require_uuidv7.createUUIDv7;
39
39
  exports.createUUIDv7WithSameTimestamp = require_uuidv7.createUUIDv7WithSameTimestamp;
40
40
  exports.createUniversalStoragePlugin = require_createStoragePlugin.createUniversalStoragePlugin;
41
+ exports.decodeStorageObjectKey = require_parseStorageUri.decodeStorageObjectKey;
41
42
  exports.detectCompressionFormat = require_compressionFormat.detectCompressionFormat;
42
43
  exports.extractTimestampFromUUIDv7 = require_uuidv7.extractTimestampFromUUIDv7;
43
44
  exports.filterCompatibleAppVersions = require_filterCompatibleAppVersions.filterCompatibleAppVersions;
package/dist/index.d.cts CHANGED
@@ -11,7 +11,7 @@ import { createStorageKeyBuilder } from "./createStorageKeyBuilder.cjs";
11
11
  import { createNodeStoragePlugin, createRuntimeStoragePlugin, createUniversalStoragePlugin } from "./createStoragePlugin.cjs";
12
12
  import { filterCompatibleAppVersions } from "./filterCompatibleAppVersions.cjs";
13
13
  import { generateMinBundleId } from "./generateMinBundleId.cjs";
14
- import { ParsedStorageUri, parseStorageUri } from "./parseStorageUri.cjs";
14
+ import { ParsedStorageUri, decodeStorageObjectKey, parseStorageUri } from "./parseStorageUri.cjs";
15
15
  import { paginateBundles } from "./paginateBundles.cjs";
16
16
  import { bundleIdMatchesFilter, bundleMatchesQueryWhere, sortBundles } from "./queryBundles.cjs";
17
17
  import { createRequestUpdateBundleResolver, getRequestUpdateBundleSeeds } from "./requestUpdateBundleState.cjs";
@@ -19,4 +19,4 @@ import { ResolveUpdateInfoFromBundlesOptions, resolveUpdateInfoFromBundles } fro
19
19
  import { semverSatisfies } from "./semverSatisfies.cjs";
20
20
  import { assertNodeStoragePlugin, assertRuntimeStoragePlugin, isNodeStoragePlugin, isRuntimeStoragePlugin } from "./storageProfile.cjs";
21
21
  import { createUUIDv7, createUUIDv7WithSameTimestamp, extractTimestampFromUUIDv7 } from "./uuidv7.cjs";
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 };
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, decodeStorageObjectKey, 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
@@ -11,7 +11,7 @@ import { createStorageKeyBuilder } from "./createStorageKeyBuilder.mjs";
11
11
  import { createNodeStoragePlugin, createRuntimeStoragePlugin, createUniversalStoragePlugin } from "./createStoragePlugin.mjs";
12
12
  import { filterCompatibleAppVersions } from "./filterCompatibleAppVersions.mjs";
13
13
  import { generateMinBundleId } from "./generateMinBundleId.mjs";
14
- import { ParsedStorageUri, parseStorageUri } from "./parseStorageUri.mjs";
14
+ import { ParsedStorageUri, decodeStorageObjectKey, parseStorageUri } from "./parseStorageUri.mjs";
15
15
  import { paginateBundles } from "./paginateBundles.mjs";
16
16
  import { bundleIdMatchesFilter, bundleMatchesQueryWhere, sortBundles } from "./queryBundles.mjs";
17
17
  import { createRequestUpdateBundleResolver, getRequestUpdateBundleSeeds } from "./requestUpdateBundleState.mjs";
@@ -19,4 +19,4 @@ import { ResolveUpdateInfoFromBundlesOptions, resolveUpdateInfoFromBundles } fro
19
19
  import { semverSatisfies } from "./semverSatisfies.mjs";
20
20
  import { assertNodeStoragePlugin, assertRuntimeStoragePlugin, isNodeStoragePlugin, isRuntimeStoragePlugin } from "./storageProfile.mjs";
21
21
  import { createUUIDv7, createUUIDv7WithSameTimestamp, extractTimestampFromUUIDv7 } from "./uuidv7.mjs";
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 };
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, decodeStorageObjectKey, 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
@@ -14,8 +14,8 @@ import { createBlobDatabasePlugin } from "./createBlobDatabasePlugin.mjs";
14
14
  import { createStorageKeyBuilder } from "./createStorageKeyBuilder.mjs";
15
15
  import { createNodeStoragePlugin, createRuntimeStoragePlugin, createUniversalStoragePlugin } from "./createStoragePlugin.mjs";
16
16
  import { generateMinBundleId } from "./generateMinBundleId.mjs";
17
- import { parseStorageUri } from "./parseStorageUri.mjs";
17
+ import { decodeStorageObjectKey, parseStorageUri } from "./parseStorageUri.mjs";
18
18
  import { assertNodeStoragePlugin, assertRuntimeStoragePlugin, isNodeStoragePlugin, isRuntimeStoragePlugin } from "./storageProfile.mjs";
19
19
  import { supportedIosPlatforms } from "./types/index.mjs";
20
20
  import { createUUIDv7, createUUIDv7WithSameTimestamp, extractTimestampFromUUIDv7 } from "./uuidv7.mjs";
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 };
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, decodeStorageObjectKey, detectCompressionFormat, extractTimestampFromUUIDv7, filterCompatibleAppVersions, generateMinBundleId, getAssetStorageLayout, getCompressionMimeType, getContentAddressedAssetStoragePath, getContentType, getManifestAssetDownloadPath, getManifestAssetStoragePath, getRequestUpdateBundleSeeds, isBrotliManifestAssetPath, isContentAddressedAssetBaseStorageUri, isNodeStoragePlugin, isRuntimeStoragePlugin, paginateBundles, parseStorageUri, resolveManifestAssetStorageUri, resolveUpdateInfoFromBundles, semverSatisfies, sortBundles, supportedIosPlatforms };
@@ -1,4 +1,11 @@
1
1
  //#region src/parseStorageUri.ts
2
+ const decodeStorageObjectKey = (key) => {
3
+ try {
4
+ return decodeURIComponent(key);
5
+ } catch {
6
+ return key;
7
+ }
8
+ };
2
9
  /**
3
10
  * Parses a storage URI and validates the protocol.
4
11
  *
@@ -22,7 +29,7 @@ function parseStorageUri(storageUri, expectedProtocol) {
22
29
  return {
23
30
  protocol,
24
31
  bucket: url.hostname,
25
- key: url.pathname.slice(1)
32
+ key: decodeStorageObjectKey(url.pathname.slice(1))
26
33
  };
27
34
  } catch (error) {
28
35
  if (error instanceof TypeError) throw new Error(`Invalid storage URI format: ${storageUri}`);
@@ -30,4 +37,5 @@ function parseStorageUri(storageUri, expectedProtocol) {
30
37
  }
31
38
  }
32
39
  //#endregion
40
+ exports.decodeStorageObjectKey = decodeStorageObjectKey;
33
41
  exports.parseStorageUri = parseStorageUri;
@@ -4,6 +4,7 @@ interface ParsedStorageUri {
4
4
  bucket: string;
5
5
  key: string;
6
6
  }
7
+ declare const decodeStorageObjectKey: (key: string) => string;
7
8
  /**
8
9
  * Parses a storage URI and validates the protocol.
9
10
  *
@@ -21,4 +22,4 @@ interface ParsedStorageUri {
21
22
  */
22
23
  declare function parseStorageUri(storageUri: string, expectedProtocol: string): ParsedStorageUri;
23
24
  //#endregion
24
- export { ParsedStorageUri, parseStorageUri };
25
+ export { ParsedStorageUri, decodeStorageObjectKey, parseStorageUri };
@@ -4,6 +4,7 @@ interface ParsedStorageUri {
4
4
  bucket: string;
5
5
  key: string;
6
6
  }
7
+ declare const decodeStorageObjectKey: (key: string) => string;
7
8
  /**
8
9
  * Parses a storage URI and validates the protocol.
9
10
  *
@@ -21,4 +22,4 @@ interface ParsedStorageUri {
21
22
  */
22
23
  declare function parseStorageUri(storageUri: string, expectedProtocol: string): ParsedStorageUri;
23
24
  //#endregion
24
- export { ParsedStorageUri, parseStorageUri };
25
+ export { ParsedStorageUri, decodeStorageObjectKey, parseStorageUri };
@@ -1,4 +1,11 @@
1
1
  //#region src/parseStorageUri.ts
2
+ const decodeStorageObjectKey = (key) => {
3
+ try {
4
+ return decodeURIComponent(key);
5
+ } catch {
6
+ return key;
7
+ }
8
+ };
2
9
  /**
3
10
  * Parses a storage URI and validates the protocol.
4
11
  *
@@ -22,7 +29,7 @@ function parseStorageUri(storageUri, expectedProtocol) {
22
29
  return {
23
30
  protocol,
24
31
  bucket: url.hostname,
25
- key: url.pathname.slice(1)
32
+ key: decodeStorageObjectKey(url.pathname.slice(1))
26
33
  };
27
34
  } catch (error) {
28
35
  if (error instanceof TypeError) throw new Error(`Invalid storage URI format: ${storageUri}`);
@@ -30,4 +37,4 @@ function parseStorageUri(storageUri, expectedProtocol) {
30
37
  }
31
38
  }
32
39
  //#endregion
33
- export { parseStorageUri };
40
+ export { decodeStorageObjectKey, parseStorageUri };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/plugin-core",
3
- "version": "0.36.1",
3
+ "version": "0.36.3",
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/core": "0.36.1",
49
- "@hot-updater/js": "0.36.1"
48
+ "@hot-updater/core": "0.36.3",
49
+ "@hot-updater/js": "0.36.3"
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.36.1"
55
+ "@hot-updater/test-utils": "0.36.3"
56
56
  },
57
57
  "scripts": {
58
58
  "build": "tsdown",