@hot-updater/plugin-core 1.0.5 → 1.0.6

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,6 +1,6 @@
1
1
  import { BundlePatchRow, ChannelRow, ReleaseCatalogRow, ReleaseRow } from "../types/databaseRows.cjs";
2
2
  import { BundleDetail, KeysetInput, ReleaseFilter } from "../coreApi.cjs";
3
- import { ArtifactInfo, ReleaseCatalog } from "@hot-updater/protocol";
3
+ import { ArtifactFiles, ArtifactInfo, ArtifactInfoV2, ReleaseCatalog } from "@hot-updater/protocol";
4
4
  //#region src/serverPlugin/coreReads.d.ts
5
5
  /** The scope of a device's update check, by its update strategy. */
6
6
  type ReleaseCatalogRequest = {
@@ -21,8 +21,18 @@ type ReleaseCatalogRequest = {
21
21
  interface CoreReads {
22
22
  /** The Release Catalog a device's update check receives, or null when its scope has none. */
23
23
  getReleaseCatalog(input: ReleaseCatalogRequest): Promise<ReleaseCatalog | null>;
24
- /** How a device on `currentBundleId` downloads `targetBundleId`. */
24
+ /**
25
+ * How a device on `currentBundleId` downloads `targetBundleId`.
26
+ * Legacy: artifact protocol v1 (`1`): a URL per file, for apps whose SDK predates v2.
27
+ */
25
28
  getArtifactInfo(targetBundleId: string, currentBundleId: string, artifactProtocolVersion: 1): Promise<ArtifactInfo | null>;
29
+ /** The same in artifact protocol v2, which carries no URL per file. */
30
+ getArtifactInfo(targetBundleId: string, currentBundleId: string, artifactProtocolVersion: 2): Promise<ArtifactInfoV2 | null>;
31
+ /**
32
+ * Download URLs for the manifest files of `bundleId` that a device downloads
33
+ * one by one; null when the Bundle or any path is unknown.
34
+ */
35
+ getArtifactFiles(bundleId: string, paths: readonly string[]): Promise<ArtifactFiles | null>;
26
36
  getBundle(id: string): Promise<BundleDetail | null>;
27
37
  /** Each base bundle's reference counter: one batch read of the bundle rows, and no patches. */
28
38
  countBundleChildren(baseBundleIds: readonly string[]): Promise<Record<string, number>>;
@@ -1,6 +1,6 @@
1
1
  import { BundlePatchRow, ChannelRow, ReleaseCatalogRow, ReleaseRow } from "../types/databaseRows.mjs";
2
2
  import { BundleDetail, KeysetInput, ReleaseFilter } from "../coreApi.mjs";
3
- import { ArtifactInfo, ReleaseCatalog } from "@hot-updater/protocol";
3
+ import { ArtifactFiles, ArtifactInfo, ArtifactInfoV2, ReleaseCatalog } from "@hot-updater/protocol";
4
4
  //#region src/serverPlugin/coreReads.d.ts
5
5
  /** The scope of a device's update check, by its update strategy. */
6
6
  type ReleaseCatalogRequest = {
@@ -21,8 +21,18 @@ type ReleaseCatalogRequest = {
21
21
  interface CoreReads {
22
22
  /** The Release Catalog a device's update check receives, or null when its scope has none. */
23
23
  getReleaseCatalog(input: ReleaseCatalogRequest): Promise<ReleaseCatalog | null>;
24
- /** How a device on `currentBundleId` downloads `targetBundleId`. */
24
+ /**
25
+ * How a device on `currentBundleId` downloads `targetBundleId`.
26
+ * Legacy: artifact protocol v1 (`1`): a URL per file, for apps whose SDK predates v2.
27
+ */
25
28
  getArtifactInfo(targetBundleId: string, currentBundleId: string, artifactProtocolVersion: 1): Promise<ArtifactInfo | null>;
29
+ /** The same in artifact protocol v2, which carries no URL per file. */
30
+ getArtifactInfo(targetBundleId: string, currentBundleId: string, artifactProtocolVersion: 2): Promise<ArtifactInfoV2 | null>;
31
+ /**
32
+ * Download URLs for the manifest files of `bundleId` that a device downloads
33
+ * one by one; null when the Bundle or any path is unknown.
34
+ */
35
+ getArtifactFiles(bundleId: string, paths: readonly string[]): Promise<ArtifactFiles | null>;
26
36
  getBundle(id: string): Promise<BundleDetail | null>;
27
37
  /** Each base bundle's reference counter: one batch read of the bundle rows, and no patches. */
28
38
  countBundleChildren(baseBundleIds: readonly string[]): Promise<Record<string, number>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/plugin-core",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
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.4.0",
48
- "@hot-updater/protocol": "1.0.5"
48
+ "@hot-updater/protocol": "1.0.6"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@electric-sql/pglite": "0.4.1",
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": "1.0.5"
55
+ "@hot-updater/test-utils": "1.0.6"
56
56
  },
57
57
  "nx": {
58
58
  "implicitDependencies": [