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

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-8UJoPfkM.cjs";
1
+ import { i as plugins, n as supabaseDatabase, t as SupabaseDatabaseConfig } from "./supabaseDatabase-CAsYCkXB.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-8UJoPfkM.mjs";
1
+ import { i as plugins, n as supabaseDatabase, t as SupabaseDatabaseConfig } from "./supabaseDatabase-CAsYCkXB.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-8UJoPfkM.cjs";
1
+ import { i as plugins, r as SupabaseServiceRoleConfig, t as SupabaseDatabaseConfig } from "./supabaseDatabase-CAsYCkXB.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-8UJoPfkM.mjs";
1
+ import { i as plugins, r as SupabaseServiceRoleConfig, t as SupabaseDatabaseConfig } from "./supabaseDatabase-CAsYCkXB.mjs";
2
2
  import { StorageAdapterWith, ToolingDatabase } from "@hot-updater/plugin-core";
3
3
  //#region src/supabaseMigration.d.ts
4
4
  /**
@@ -33,6 +33,8 @@ type DatabaseBundleEventMetadata = DatabaseJsonObject & {
33
33
  readonly update_strategy: "fingerprint" | "appVersion" | null;
34
34
  readonly fingerprint_hash: string | null;
35
35
  readonly sdk_version: string | null;
36
+ /** The native build's built-in bundle ID, when the SDK reports it. */
37
+ readonly min_bundle_id?: string;
36
38
  /** `UPDATE_FAILED`: what failed. */
37
39
  readonly failure?: BundleEventFailure;
38
40
  readonly http_response?: DatabaseHttpResponse;
@@ -208,7 +210,10 @@ interface InsightsGetAppUsageResult {
208
210
  readonly bundleDistribution: readonly {
209
211
  readonly appVersion: string;
210
212
  readonly platform: "ios" | "android";
213
+ /** The release the installations run; null for none. */
211
214
  readonly releaseId: string | null;
215
+ /** The native build's built-in bundle, when they run it. */
216
+ readonly builtinBundleId: string | null;
212
217
  readonly installations: number;
213
218
  }[];
214
219
  readonly measuredAtMs: number;
@@ -539,6 +544,38 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
539
544
  readonly sort: readonly ["bucket_start_ms"];
540
545
  };
541
546
  }, never, readonly ["channel", "platform", "app_version", "release_id", "bucket_start_ms"]>;
547
+ readonly insights_builtin_distribution: import("@hot-updater/plugin-core").AggregateDefinition<{
548
+ readonly channel: {
549
+ readonly type: "string";
550
+ };
551
+ readonly platform: {
552
+ readonly type: "string";
553
+ readonly maxLength: 16;
554
+ };
555
+ readonly app_version: {
556
+ readonly type: "string";
557
+ };
558
+ readonly release_id: {
559
+ readonly type: "string";
560
+ readonly maxLength: 36;
561
+ };
562
+ readonly builtin_bundle_id: {
563
+ readonly type: "string";
564
+ readonly maxLength: 36;
565
+ };
566
+ readonly bucket_start_ms: {
567
+ readonly type: "integer";
568
+ };
569
+ }, "latest_installations", {
570
+ readonly byScope: {
571
+ readonly eq: readonly ["channel", "platform"];
572
+ readonly sort: readonly ["bucket_start_ms"];
573
+ };
574
+ readonly byVersion: {
575
+ readonly eq: readonly ["channel", "platform", "app_version"];
576
+ readonly sort: readonly ["bucket_start_ms"];
577
+ };
578
+ }, never, readonly ["channel", "platform", "app_version", "release_id", "builtin_bundle_id", "bucket_start_ms"]>;
542
579
  readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
543
580
  readonly platform: {
544
581
  readonly type: "string";
@@ -33,6 +33,8 @@ type DatabaseBundleEventMetadata = DatabaseJsonObject & {
33
33
  readonly update_strategy: "fingerprint" | "appVersion" | null;
34
34
  readonly fingerprint_hash: string | null;
35
35
  readonly sdk_version: string | null;
36
+ /** The native build's built-in bundle ID, when the SDK reports it. */
37
+ readonly min_bundle_id?: string;
36
38
  /** `UPDATE_FAILED`: what failed. */
37
39
  readonly failure?: BundleEventFailure;
38
40
  readonly http_response?: DatabaseHttpResponse;
@@ -208,7 +210,10 @@ interface InsightsGetAppUsageResult {
208
210
  readonly bundleDistribution: readonly {
209
211
  readonly appVersion: string;
210
212
  readonly platform: "ios" | "android";
213
+ /** The release the installations run; null for none. */
211
214
  readonly releaseId: string | null;
215
+ /** The native build's built-in bundle, when they run it. */
216
+ readonly builtinBundleId: string | null;
212
217
  readonly installations: number;
213
218
  }[];
214
219
  readonly measuredAtMs: number;
@@ -539,6 +544,38 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
539
544
  readonly sort: readonly ["bucket_start_ms"];
540
545
  };
541
546
  }, never, readonly ["channel", "platform", "app_version", "release_id", "bucket_start_ms"]>;
547
+ readonly insights_builtin_distribution: import("@hot-updater/plugin-core").AggregateDefinition<{
548
+ readonly channel: {
549
+ readonly type: "string";
550
+ };
551
+ readonly platform: {
552
+ readonly type: "string";
553
+ readonly maxLength: 16;
554
+ };
555
+ readonly app_version: {
556
+ readonly type: "string";
557
+ };
558
+ readonly release_id: {
559
+ readonly type: "string";
560
+ readonly maxLength: 36;
561
+ };
562
+ readonly builtin_bundle_id: {
563
+ readonly type: "string";
564
+ readonly maxLength: 36;
565
+ };
566
+ readonly bucket_start_ms: {
567
+ readonly type: "integer";
568
+ };
569
+ }, "latest_installations", {
570
+ readonly byScope: {
571
+ readonly eq: readonly ["channel", "platform"];
572
+ readonly sort: readonly ["bucket_start_ms"];
573
+ };
574
+ readonly byVersion: {
575
+ readonly eq: readonly ["channel", "platform", "app_version"];
576
+ readonly sort: readonly ["bucket_start_ms"];
577
+ };
578
+ }, never, readonly ["channel", "platform", "app_version", "release_id", "builtin_bundle_id", "bucket_start_ms"]>;
542
579
  readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
543
580
  readonly platform: {
544
581
  readonly type: "string";
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.35",
4
+ "version": "1.0.0-rc.36",
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/protocol": "1.0.0-rc.35",
55
- "@hot-updater/server": "1.0.0-rc.35",
56
- "@hot-updater/plugin-core": "1.0.0-rc.35",
57
- "@hot-updater/cli-tools": "1.0.0-rc.35"
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"
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.35",
68
- "@hot-updater/test-utils": "1.0.0-rc.35",
69
- "@hot-updater/postgres": "1.0.0-rc.35"
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"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "tsdown",
@@ -78,6 +78,14 @@ CREATE INDEX IF NOT EXISTS "hot_updater_v1_insights_distribution_byVersion" ON "
78
78
 
79
79
  CREATE INDEX IF NOT EXISTS "hot_updater_v1_insights_distribution__retention" ON "hot_updater_v1_insights_distribution" ("bucket_start_ms", "channel", "platform", "app_version", "release_id", "_shard");
80
80
 
81
+ CREATE TABLE IF NOT EXISTS "hot_updater_v1_insights_builtin_distribution" ("channel" text COLLATE "C" NOT NULL, "platform" varchar(16) COLLATE "C" NOT NULL, "app_version" text COLLATE "C" NOT NULL, "release_id" varchar(36) COLLATE "C" NOT NULL, "builtin_bundle_id" varchar(36) COLLATE "C" NOT NULL, "bucket_start_ms" bigint NOT NULL, "_shard" bigint NOT NULL, "latest_installations" bigint NOT NULL, "_v" bigint NOT NULL DEFAULT 0, PRIMARY KEY ("channel", "platform", "app_version", "release_id", "builtin_bundle_id", "bucket_start_ms", "_shard"));
82
+
83
+ CREATE INDEX IF NOT EXISTS "hot_updater_v1_insights_builtin_distribution_byScope" ON "hot_updater_v1_insights_builtin_distribution" ("channel", "platform", "bucket_start_ms", "app_version", "release_id", "builtin_bundle_id", "_shard");
84
+
85
+ CREATE INDEX IF NOT EXISTS "hot_updater_v1_insights_builtin_distribution_byVersion" ON "hot_updater_v1_insights_builtin_distribution" ("channel", "platform", "app_version", "bucket_start_ms", "release_id", "builtin_bundle_id", "_shard");
86
+
87
+ CREATE INDEX IF NOT EXISTS "hot_updater_v1_insights_builtin_distribution__retention" ON "hot_updater_v1_insights_builtin_distribution" ("bucket_start_ms", "channel", "platform", "app_version", "release_id", "builtin_bundle_id", "_shard");
88
+
81
89
  CREATE TABLE IF NOT EXISTS "hot_updater_v1_insights_latest_by_bundle" ("platform" varchar(16) COLLATE "C" NOT NULL, "channel" text COLLATE "C" NOT NULL, "bundle_field" varchar(16) COLLATE "C" NOT NULL, "bundle_id" varchar(36) COLLATE "C" NOT NULL, "type" varchar(32) COLLATE "C" NOT NULL, "bucket_start_ms" bigint NOT NULL, "_shard" bigint NOT NULL, "installations" bigint NOT NULL, "_v" bigint NOT NULL DEFAULT 0, PRIMARY KEY ("platform", "channel", "bundle_field", "bundle_id", "type", "bucket_start_ms", "_shard"));
82
90
 
83
91
  CREATE INDEX IF NOT EXISTS "hot_updater_v1_insights_latest_by_bundle__retention" ON "hot_updater_v1_insights_latest_by_bundle" ("bucket_start_ms", "platform", "channel", "bundle_field", "bundle_id", "type", "_shard");
@@ -130,6 +138,8 @@ ALTER TABLE "hot_updater_v1_insights_sketches_lifetime" ENABLE ROW LEVEL SECURIT
130
138
 
131
139
  ALTER TABLE "hot_updater_v1_insights_distribution" ENABLE ROW LEVEL SECURITY;
132
140
 
141
+ ALTER TABLE "hot_updater_v1_insights_builtin_distribution" ENABLE ROW LEVEL SECURITY;
142
+
133
143
  ALTER TABLE "hot_updater_v1_insights_latest_by_bundle" ENABLE ROW LEVEL SECURITY;
134
144
 
135
145
  ALTER TABLE "hot_updater_v1_insights_outcomes" ENABLE ROW LEVEL SECURITY;
@@ -161,7 +171,7 @@ BEGIN
161
171
  FOR item IN SELECT value FROM jsonb_array_elements(p_statements) LOOP
162
172
  statement := item->>'sql';
163
173
  FOR target IN SELECT (regexp_matches(statement, '(?:FROM|INTO|UPDATE|JOIN) "([^"]+)"', 'g'))[1] LOOP
164
- IF NOT target = ANY (ARRAY['hot_updater_v1_bundles', 'hot_updater_v1_bundle_patches', 'hot_updater_v1_releases', 'hot_updater_v1_release_catalogs', 'hot_updater_v1_channels', 'hot_updater_v1_bundle_totals', 'hot_updater_v1_bundle_events', 'hot_updater_v1_bundle_events__byBundle', 'hot_updater_v1_bundle_event_heads', 'hot_updater_v1_insights_overview', 'hot_updater_v1_insights_sketches', 'hot_updater_v1_insights_overview_daily', 'hot_updater_v1_insights_sketches_daily', 'hot_updater_v1_insights_overview_lifetime', 'hot_updater_v1_insights_sketches_lifetime', 'hot_updater_v1_insights_distribution', 'hot_updater_v1_insights_latest_by_bundle', 'hot_updater_v1_insights_outcomes', 'hot_updater_v1_insights_failures', 'hot_updater_v1_api_keys', 'hot_updater_v1_private_hot_updater_settings', 'hot_updater_v1__hu_write']) THEN
174
+ IF NOT target = ANY (ARRAY['hot_updater_v1_bundles', 'hot_updater_v1_bundle_patches', 'hot_updater_v1_releases', 'hot_updater_v1_release_catalogs', 'hot_updater_v1_channels', 'hot_updater_v1_bundle_totals', 'hot_updater_v1_bundle_events', 'hot_updater_v1_bundle_events__byBundle', 'hot_updater_v1_bundle_event_heads', 'hot_updater_v1_insights_overview', 'hot_updater_v1_insights_sketches', 'hot_updater_v1_insights_overview_daily', 'hot_updater_v1_insights_sketches_daily', 'hot_updater_v1_insights_overview_lifetime', 'hot_updater_v1_insights_sketches_lifetime', 'hot_updater_v1_insights_distribution', 'hot_updater_v1_insights_builtin_distribution', 'hot_updater_v1_insights_latest_by_bundle', 'hot_updater_v1_insights_outcomes', 'hot_updater_v1_insights_failures', 'hot_updater_v1_api_keys', 'hot_updater_v1_private_hot_updater_settings', 'hot_updater_v1__hu_write']) THEN
165
175
  RAISE EXCEPTION 'hot_updater_v1_apply: % is not a Hot Updater table', target USING ERRCODE = '42501';
166
176
  END IF;
167
177
  END LOOP;