@hot-updater/postgres 0.20.14 → 0.21.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/index.cjs CHANGED
@@ -1875,7 +1875,7 @@ var require_lib = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pg-mi
1875
1875
  var import_lib = /* @__PURE__ */ __toESM$1(require_lib(), 1);
1876
1876
  const appVersionStrategy = async (pool, { platform, appVersion, bundleId, minBundleId = __hot_updater_core.NIL_UUID, channel = "production" }) => {
1877
1877
  const sqlGetTargetAppVersionList = (0, import_lib.default)(`
1878
- SELECT target_app_version
1878
+ SELECT target_app_version
1879
1879
  FROM get_target_app_version_list($1, $2);
1880
1880
  `);
1881
1881
  const { rows: appVersionList } = await pool.query(sqlGetTargetAppVersionList, [platform, minBundleId]);
package/dist/index.js CHANGED
@@ -1873,7 +1873,7 @@ var require_lib = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pg-mi
1873
1873
  var import_lib = /* @__PURE__ */ __toESM$1(require_lib(), 1);
1874
1874
  const appVersionStrategy = async (pool, { platform, appVersion, bundleId, minBundleId = NIL_UUID, channel = "production" }) => {
1875
1875
  const sqlGetTargetAppVersionList = (0, import_lib.default)(`
1876
- SELECT target_app_version
1876
+ SELECT target_app_version
1877
1877
  FROM get_target_app_version_list($1, $2);
1878
1878
  `);
1879
1879
  const { rows: appVersionList } = await pool.query(sqlGetTargetAppVersionList, [platform, minBundleId]);
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@hot-updater/postgres",
3
3
  "type": "module",
4
- "version": "0.20.14",
4
+ "version": "0.21.0",
5
5
  "description": "React Native OTA solution for self-hosted",
6
- "main": "dist/index.cjs",
7
- "module": "dist/index.js",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
8
  "exports": {
9
9
  ".": {
10
10
  "import": "./dist/index.js",
11
11
  "require": "./dist/index.cjs"
12
12
  },
13
- "./sql": "./sql"
13
+ "./package.json": "./package.json"
14
14
  },
15
- "types": "dist/index.d.ts",
15
+ "types": "./dist/index.d.cts",
16
16
  "license": "MIT",
17
17
  "repository": "https://github.com/gronxb/hot-updater",
18
18
  "author": "gronxb <gron1gh1@gmail.com> (https://github.com/gronxb)",
@@ -29,17 +29,18 @@
29
29
  "package.json"
30
30
  ],
31
31
  "dependencies": {
32
- "kysely": "^0.27.5",
32
+ "kysely": "^0.28.5",
33
33
  "pg": "^8.13.1",
34
- "@hot-updater/plugin-core": "0.20.14",
35
- "@hot-updater/core": "0.20.14"
34
+ "@hot-updater/core": "0.21.0",
35
+ "@hot-updater/plugin-core": "0.21.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@electric-sql/pglite": "^0.2.15",
39
39
  "@types/pg": "^8.11.10",
40
40
  "camelcase-keys": "^9.1.3",
41
41
  "pg-minify": "^1.6.5",
42
- "@hot-updater/js": "0.20.14"
42
+ "@hot-updater/test-utils": "0.21.0",
43
+ "@hot-updater/js": "0.21.0"
43
44
  },
44
45
  "scripts": {
45
46
  "build": "tsdown",
@@ -5,8 +5,8 @@ import {
5
5
  NIL_UUID,
6
6
  type UpdateInfo,
7
7
  } from "@hot-updater/core";
8
- import { setupGetUpdateInfoTestSuite } from "@hot-updater/core/test-utils";
9
8
  import { filterCompatibleAppVersions } from "@hot-updater/js";
9
+ import { setupGetUpdateInfoTestSuite } from "@hot-updater/test-utils";
10
10
  import camelcaseKeys from "camelcase-keys";
11
11
  import { afterAll, beforeEach, describe } from "vitest";
12
12
  import { prepareSql } from "./prepareSql";
@@ -13,7 +13,8 @@ RETURNS TABLE (
13
13
  should_force_update boolean,
14
14
  message text,
15
15
  status text,
16
- storage_uri text
16
+ storage_uri text,
17
+ file_hash text
17
18
  )
18
19
  LANGUAGE plpgsql
19
20
  AS
@@ -28,7 +29,8 @@ BEGIN
28
29
  b.should_force_update,
29
30
  b.message,
30
31
  'UPDATE' AS status,
31
- b.storage_uri
32
+ b.storage_uri,
33
+ b.file_hash
32
34
  FROM bundles b
33
35
  WHERE b.enabled = TRUE
34
36
  AND b.platform = app_platform
@@ -45,7 +47,8 @@ BEGIN
45
47
  TRUE AS should_force_update,
46
48
  b.message,
47
49
  'ROLLBACK' AS status,
48
- b.storage_uri
50
+ b.storage_uri,
51
+ b.file_hash
49
52
  FROM bundles b
50
53
  WHERE b.enabled = TRUE
51
54
  AND b.platform = app_platform
@@ -71,7 +74,8 @@ BEGIN
71
74
  TRUE AS should_force_update,
72
75
  NULL AS message,
73
76
  'ROLLBACK' AS status,
74
- NULL AS storage_uri
77
+ NULL AS storage_uri,
78
+ NULL AS file_hash
75
79
  WHERE (SELECT COUNT(*) FROM final_result) = 0
76
80
  AND bundle_id != NIL_UUID
77
81
  AND bundle_id > min_bundle_id
@@ -83,4 +87,4 @@ BEGIN
83
87
  AND b.platform = app_platform
84
88
  );
85
89
  END;
86
- $$;
90
+ $$;
@@ -12,7 +12,8 @@ RETURNS TABLE (
12
12
  should_force_update boolean,
13
13
  message text,
14
14
  status text,
15
- storage_uri text
15
+ storage_uri text,
16
+ file_hash text
16
17
  )
17
18
  LANGUAGE plpgsql
18
19
  AS
@@ -27,7 +28,8 @@ BEGIN
27
28
  b.should_force_update,
28
29
  b.message,
29
30
  'UPDATE' AS status,
30
- b.storage_uri
31
+ b.storage_uri,
32
+ b.file_hash
31
33
  FROM bundles b
32
34
  WHERE b.enabled = TRUE
33
35
  AND b.platform = app_platform
@@ -44,7 +46,8 @@ BEGIN
44
46
  TRUE AS should_force_update,
45
47
  b.message,
46
48
  'ROLLBACK' AS status,
47
- b.storage_uri
49
+ b.storage_uri,
50
+ b.file_hash
48
51
  FROM bundles b
49
52
  WHERE b.enabled = TRUE
50
53
  AND b.platform = app_platform
@@ -72,7 +75,8 @@ BEGIN
72
75
  TRUE AS should_force_update,
73
76
  NULL AS message,
74
77
  'ROLLBACK' AS status,
75
- NULL AS storage_uri
78
+ NULL AS storage_uri,
79
+ NULL AS file_hash
76
80
  WHERE (SELECT COUNT(*) FROM final_result) = 0
77
81
  AND bundle_id != NIL_UUID
78
82
  AND bundle_id > min_bundle_id
@@ -84,4 +88,4 @@ BEGIN
84
88
  AND b.platform = app_platform
85
89
  );
86
90
  END;
87
- $$;
91
+ $$;