@hot-updater/supabase 1.0.0-rc.36 → 1.0.0-rc.37

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.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as plugins, n as supabaseDatabase, t as SupabaseDatabaseConfig } from "./supabaseDatabase-CAsYCkXB.cjs";
1
+ import { i as plugins, n as supabaseDatabase, t as SupabaseDatabaseConfig } from "./supabaseDatabase-D7HZjWap.cjs";
2
2
  import { StorageAdapterWith } from "@hot-updater/plugin-core";
3
3
  //#region src/supabaseEdgeFunctionStorage.d.ts
4
4
  interface SupabaseEdgeFunctionStorageConfig {
package/dist/edge.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as plugins, n as supabaseDatabase, t as SupabaseDatabaseConfig } from "./supabaseDatabase-CAsYCkXB.mjs";
1
+ import { i as plugins, n as supabaseDatabase, t as SupabaseDatabaseConfig } from "./supabaseDatabase-D7HZjWap.mjs";
2
2
  import { StorageAdapterWith } from "@hot-updater/plugin-core";
3
3
  //#region src/supabaseEdgeFunctionStorage.d.ts
4
4
  interface SupabaseEdgeFunctionStorageConfig {
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as plugins, r as SupabaseServiceRoleConfig, t as SupabaseDatabaseConfig } from "./supabaseDatabase-CAsYCkXB.cjs";
1
+ import { i as plugins, r as SupabaseServiceRoleConfig, t as SupabaseDatabaseConfig } from "./supabaseDatabase-D7HZjWap.cjs";
2
2
  import { StorageAdapterWith, ToolingDatabase } from "@hot-updater/plugin-core";
3
3
  //#region src/supabaseMigration.d.ts
4
4
  /**
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as plugins, r as SupabaseServiceRoleConfig, t as SupabaseDatabaseConfig } from "./supabaseDatabase-CAsYCkXB.mjs";
1
+ import { i as plugins, r as SupabaseServiceRoleConfig, t as SupabaseDatabaseConfig } from "./supabaseDatabase-D7HZjWap.mjs";
2
2
  import { StorageAdapterWith, ToolingDatabase } from "@hot-updater/plugin-core";
3
3
  //#region src/supabaseMigration.d.ts
4
4
  /**
@@ -27,6 +27,25 @@ type DatabaseHttpResponse = DatabaseJsonObject & {
27
27
  readonly body_truncated: boolean;
28
28
  readonly received_at_ms: number;
29
29
  };
30
+ /** What a kept UNCHANGED row changed against its installation's head. */
31
+ type BundleEventChangeKind = "first_seen" | "bundle" | "release" | "app_version" | "channel" | "native_build";
32
+ /**
33
+ * An UNCHANGED report the server keeps: what it changed against its
34
+ * installation's head, and the running values the head held before it. A
35
+ * report from an installation without a head is `first_seen` alone, with no
36
+ * previous values: the installation is new to this server, not necessarily
37
+ * to its device.
38
+ */
39
+ type BundleEventChange = DatabaseJsonObject & {
40
+ readonly kinds: BundleEventChangeKind[];
41
+ readonly previous: (DatabaseJsonObject & {
42
+ readonly bundle_id: string;
43
+ readonly release_id: string | null;
44
+ readonly app_version: string;
45
+ readonly channel: string;
46
+ readonly min_bundle_id?: string;
47
+ }) | null;
48
+ };
30
49
  /** Ancillary report data; queryable identity and lifecycle fields stay on the row. */
31
50
  type DatabaseBundleEventMetadata = DatabaseJsonObject & {
32
51
  readonly cohort: string;
@@ -42,6 +61,19 @@ type DatabaseBundleEventMetadata = DatabaseJsonObject & {
42
61
  readonly delivery?: "patch" | "manifest" | "archive" | "unknown";
43
62
  /** `UPDATE_DOWNLOADED`: a patch failed and the full files came instead. */
44
63
  readonly patch_fallback?: boolean;
64
+ /** A kept `UNCHANGED` row: what it changed, which the server sets. */
65
+ readonly change?: BundleEventChange;
66
+ /**
67
+ * A download or apply that arrived after its installation already ran its
68
+ * target, as when a reload cut the first runtime's report short: the
69
+ * server keeps it in history, but it moves and counts nothing.
70
+ */
71
+ readonly late?: true;
72
+ /**
73
+ * A launch or crash of a bundle whose download report never arrived: the
74
+ * server counted that download with it.
75
+ */
76
+ readonly implied_download?: true;
45
77
  };
46
78
  type BundleEventRowBase = {
47
79
  readonly id: string;
@@ -84,13 +116,14 @@ interface InsightsScope {
84
116
  }
85
117
  /**
86
118
  * Raw event predicates; recovery is attributed to the source bundle. An
87
- * UNCHANGED report is kept as no event, so no filter names it.
119
+ * UNCHANGED filter matches the kept rows that moved an installation to the
120
+ * bundle without an apply report.
88
121
  */
89
122
  type InsightsBundleEventFilter = InsightsScope & ({
90
123
  readonly type: "RECOVERED";
91
124
  readonly fromBundleId: string;
92
125
  } | {
93
- readonly type: "UPDATE_DOWNLOADED" | "UPDATE_APPLIED" | "UPDATE_FAILED";
126
+ readonly type: "UPDATE_DOWNLOADED" | "UPDATE_APPLIED" | "UPDATE_FAILED" | "UNCHANGED";
94
127
  readonly toBundleId: string;
95
128
  });
96
129
  type InsightsEventFilter = {
@@ -27,6 +27,25 @@ type DatabaseHttpResponse = DatabaseJsonObject & {
27
27
  readonly body_truncated: boolean;
28
28
  readonly received_at_ms: number;
29
29
  };
30
+ /** What a kept UNCHANGED row changed against its installation's head. */
31
+ type BundleEventChangeKind = "first_seen" | "bundle" | "release" | "app_version" | "channel" | "native_build";
32
+ /**
33
+ * An UNCHANGED report the server keeps: what it changed against its
34
+ * installation's head, and the running values the head held before it. A
35
+ * report from an installation without a head is `first_seen` alone, with no
36
+ * previous values: the installation is new to this server, not necessarily
37
+ * to its device.
38
+ */
39
+ type BundleEventChange = DatabaseJsonObject & {
40
+ readonly kinds: BundleEventChangeKind[];
41
+ readonly previous: (DatabaseJsonObject & {
42
+ readonly bundle_id: string;
43
+ readonly release_id: string | null;
44
+ readonly app_version: string;
45
+ readonly channel: string;
46
+ readonly min_bundle_id?: string;
47
+ }) | null;
48
+ };
30
49
  /** Ancillary report data; queryable identity and lifecycle fields stay on the row. */
31
50
  type DatabaseBundleEventMetadata = DatabaseJsonObject & {
32
51
  readonly cohort: string;
@@ -42,6 +61,19 @@ type DatabaseBundleEventMetadata = DatabaseJsonObject & {
42
61
  readonly delivery?: "patch" | "manifest" | "archive" | "unknown";
43
62
  /** `UPDATE_DOWNLOADED`: a patch failed and the full files came instead. */
44
63
  readonly patch_fallback?: boolean;
64
+ /** A kept `UNCHANGED` row: what it changed, which the server sets. */
65
+ readonly change?: BundleEventChange;
66
+ /**
67
+ * A download or apply that arrived after its installation already ran its
68
+ * target, as when a reload cut the first runtime's report short: the
69
+ * server keeps it in history, but it moves and counts nothing.
70
+ */
71
+ readonly late?: true;
72
+ /**
73
+ * A launch or crash of a bundle whose download report never arrived: the
74
+ * server counted that download with it.
75
+ */
76
+ readonly implied_download?: true;
45
77
  };
46
78
  type BundleEventRowBase = {
47
79
  readonly id: string;
@@ -84,13 +116,14 @@ interface InsightsScope {
84
116
  }
85
117
  /**
86
118
  * Raw event predicates; recovery is attributed to the source bundle. An
87
- * UNCHANGED report is kept as no event, so no filter names it.
119
+ * UNCHANGED filter matches the kept rows that moved an installation to the
120
+ * bundle without an apply report.
88
121
  */
89
122
  type InsightsBundleEventFilter = InsightsScope & ({
90
123
  readonly type: "RECOVERED";
91
124
  readonly fromBundleId: string;
92
125
  } | {
93
- readonly type: "UPDATE_DOWNLOADED" | "UPDATE_APPLIED" | "UPDATE_FAILED";
126
+ readonly type: "UPDATE_DOWNLOADED" | "UPDATE_APPLIED" | "UPDATE_FAILED" | "UNCHANGED";
94
127
  readonly toBundleId: string;
95
128
  });
96
129
  type InsightsEventFilter = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/supabase",
3
3
  "type": "module",
4
- "version": "1.0.0-rc.36",
4
+ "version": "1.0.0-rc.37",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.mjs",
@@ -51,10 +51,10 @@
51
51
  "@supabase/supabase-js": "2.76.1",
52
52
  "hono": "4.12.34",
53
53
  "uuidv7": "^1.0.2",
54
- "@hot-updater/cli-tools": "1.0.0-rc.36",
55
- "@hot-updater/server": "1.0.0-rc.36",
56
- "@hot-updater/plugin-core": "1.0.0-rc.36",
57
- "@hot-updater/protocol": "1.0.0-rc.36"
54
+ "@hot-updater/protocol": "1.0.0-rc.37",
55
+ "@hot-updater/plugin-core": "1.0.0-rc.37",
56
+ "@hot-updater/cli-tools": "1.0.0-rc.37",
57
+ "@hot-updater/server": "1.0.0-rc.37"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@electric-sql/pglite": "0.4.1",
@@ -64,9 +64,9 @@
64
64
  "execa": "9.5.2",
65
65
  "@types/node": "^20",
66
66
  "mime": "^4.0.4",
67
- "@hot-updater/mock": "1.0.0-rc.36",
68
- "@hot-updater/test-utils": "1.0.0-rc.36",
69
- "@hot-updater/postgres": "1.0.0-rc.36"
67
+ "@hot-updater/test-utils": "1.0.0-rc.37",
68
+ "@hot-updater/mock": "1.0.0-rc.37",
69
+ "@hot-updater/postgres": "1.0.0-rc.37"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "tsdown",