@hot-updater/supabase 0.36.7 → 1.0.0-rc.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.
Files changed (37) hide show
  1. package/dist/edge.cjs +6 -3
  2. package/dist/edge.d.cts +14 -2
  3. package/dist/edge.d.mts +14 -2
  4. package/dist/edge.mjs +5 -2
  5. package/dist/iac/index.cjs +607 -50
  6. package/dist/iac/index.d.cts +26 -8
  7. package/dist/iac/index.d.mts +26 -8
  8. package/dist/iac/index.mjs +604 -52
  9. package/dist/index.cjs +3 -145
  10. package/dist/index.d.cts +7 -24
  11. package/dist/index.d.mts +7 -24
  12. package/dist/index.mjs +2 -117
  13. package/dist/init/index.cjs +5 -2
  14. package/dist/init/index.d.cts +2 -2
  15. package/dist/init/index.d.mts +2 -2
  16. package/dist/init/index.mjs +5 -2
  17. package/dist/supabaseDatabase-BDIBsXpz.d.cts +13 -0
  18. package/dist/supabaseDatabase-CP9WalBi.d.mts +13 -0
  19. package/dist/supabaseStorage-Cw294tR4.mjs +557 -0
  20. package/dist/supabaseStorage-yP7u4m7E.cjs +568 -0
  21. package/package.json +9 -9
  22. package/supabase/edge-functions/index.ts +9 -13
  23. package/supabase/edge-functions/runtime.docker.integration.spec.ts +417 -202
  24. package/supabase/migrations/20260818000000_hot-updater_1.0.0.sql +583 -0
  25. package/supabase/migrations.spec.ts +127 -46
  26. package/dist/supabaseEdgeFunctionStorage-BRxGvt-r.d.mts +0 -19
  27. package/dist/supabaseEdgeFunctionStorage-BSLlUeqi.cjs +0 -386
  28. package/dist/supabaseEdgeFunctionStorage-CU396KO3.d.cts +0 -19
  29. package/dist/supabaseEdgeFunctionStorage-pV0s_mTF.mjs +0 -356
  30. package/supabase/migrations/20250103114225_init.sql +0 -228
  31. package/supabase/migrations/20250314000000_hot-updater_0.13.0.sql +0 -134
  32. package/supabase/migrations/20250516000000_hot-updater_0.18.0.sql +0 -194
  33. package/supabase/migrations/20251014000000_hot-updater_0.21.0.sql +0 -184
  34. package/supabase/migrations/20260401000000_hot-updater_0.29.0.sql +0 -503
  35. package/supabase/migrations/20260414000000_hot-updater_0.30.0.sql +0 -50
  36. package/supabase/migrations/20260422000000_hot-updater_0.31.0.sql +0 -20
  37. package/supabase/migrations/20260520014100_hot-updater_rls.sql +0 -48
@@ -1,7 +1,9 @@
1
1
  import { RunInitOptions } from "@hot-updater/cli-tools";
2
2
 
3
3
  //#region iac/supabaseApi.d.ts
4
+ type SupabaseInfrastructureState = "fresh" | "incompatible" | "v1";
4
5
  interface SupabaseApi {
6
+ getInfrastructureState: () => Promise<SupabaseInfrastructureState>;
5
7
  listBuckets: () => Promise<{
6
8
  id: string;
7
9
  name: string;
@@ -13,9 +15,6 @@ interface SupabaseApi {
13
15
  }) => Promise<{
14
16
  name: string;
15
17
  }>;
16
- updateBucket: (bucketId: string, options: {
17
- public: boolean;
18
- }) => Promise<void>;
19
18
  }
20
19
  //#endregion
21
20
  //#region iac/init/index.d.ts
@@ -41,11 +40,23 @@ interface SupabaseManagementApi {
41
40
  readonly region: SupabaseRegion;
42
41
  }) => Promise<SupabaseProject>;
43
42
  getProjectStatus: (projectId: string) => Promise<string>;
43
+ listFunctions: (projectId: string) => Promise<readonly string[]>;
44
44
  listOrganizations: () => Promise<readonly SupabaseOrganization[]>;
45
45
  }
46
46
  //#endregion
47
47
  //#region iac/index.d.ts
48
48
  declare const getLegacySupabaseConfigReference: (configText: string) => "HOT_UPDATER_SUPABASE_ANON_KEY" | "supabaseAnonKey" | null;
49
+ declare const getSupabaseReactNativeSource: ({
50
+ apiKey,
51
+ functionName,
52
+ projectId
53
+ }: {
54
+ readonly apiKey: string;
55
+ readonly functionName: string;
56
+ readonly projectId: string;
57
+ }) => string;
58
+ declare const reportSupabaseOriginCatalogReady: () => void;
59
+ declare const reportSupabaseApiKey: (apiKey: string) => void;
49
60
  declare const resolveEdgeFunctionDenoConfig: (targetDir: string) => Promise<{
50
61
  imports: Record<string, string>;
51
62
  }>;
@@ -81,6 +92,15 @@ declare const waitForSupabaseProjectReady: ({
81
92
  readonly onLongWait: () => void;
82
93
  readonly pollIntervalMs?: number;
83
94
  }) => Promise<void>;
95
+ declare const waitForSupabaseSchemaReady: ({
96
+ getInfrastructureState,
97
+ maxAttempts,
98
+ pollIntervalMs
99
+ }: {
100
+ readonly getInfrastructureState: SupabaseApi["getInfrastructureState"];
101
+ readonly maxAttempts?: number;
102
+ readonly pollIntervalMs?: number;
103
+ }) => Promise<void>;
84
104
  declare const getSupabaseProjectAccess: ({
85
105
  accessToken,
86
106
  managementApi,
@@ -95,9 +115,7 @@ declare const getSupabaseProjectAccess: ({
95
115
  readonly api: SupabaseApi;
96
116
  readonly serviceRoleApiKey: string;
97
117
  }>;
98
- declare const runInit: ({
99
- build,
100
- envFile
101
- }: RunInitOptions) => Promise<void>;
118
+ declare const withSupabaseCliMetadataCleanup: <Result>(cwd: string, operation: () => Promise<Result>) => Promise<Result>;
119
+ declare const runInit: (options: RunInitOptions) => Promise<void>;
102
120
  //#endregion
103
- export { SupabaseBucketSelection, SupabaseProjectSelection, createSelectedBucket, getLegacySupabaseConfigReference, getSupabaseProjectAccess, resolveEdgeFunctionDenoConfig, runInit, selectBucket, selectProject, waitForSupabaseProjectReady };
121
+ export { SupabaseBucketSelection, SupabaseProjectSelection, createSelectedBucket, getLegacySupabaseConfigReference, getSupabaseProjectAccess, getSupabaseReactNativeSource, reportSupabaseApiKey, reportSupabaseOriginCatalogReady, resolveEdgeFunctionDenoConfig, runInit, selectBucket, selectProject, waitForSupabaseProjectReady, waitForSupabaseSchemaReady, withSupabaseCliMetadataCleanup };
@@ -1,7 +1,9 @@
1
1
  import { RunInitOptions } from "@hot-updater/cli-tools";
2
2
 
3
3
  //#region iac/supabaseApi.d.ts
4
+ type SupabaseInfrastructureState = "fresh" | "incompatible" | "v1";
4
5
  interface SupabaseApi {
6
+ getInfrastructureState: () => Promise<SupabaseInfrastructureState>;
5
7
  listBuckets: () => Promise<{
6
8
  id: string;
7
9
  name: string;
@@ -13,9 +15,6 @@ interface SupabaseApi {
13
15
  }) => Promise<{
14
16
  name: string;
15
17
  }>;
16
- updateBucket: (bucketId: string, options: {
17
- public: boolean;
18
- }) => Promise<void>;
19
18
  }
20
19
  //#endregion
21
20
  //#region iac/init/index.d.ts
@@ -41,11 +40,23 @@ interface SupabaseManagementApi {
41
40
  readonly region: SupabaseRegion;
42
41
  }) => Promise<SupabaseProject>;
43
42
  getProjectStatus: (projectId: string) => Promise<string>;
43
+ listFunctions: (projectId: string) => Promise<readonly string[]>;
44
44
  listOrganizations: () => Promise<readonly SupabaseOrganization[]>;
45
45
  }
46
46
  //#endregion
47
47
  //#region iac/index.d.ts
48
48
  declare const getLegacySupabaseConfigReference: (configText: string) => "HOT_UPDATER_SUPABASE_ANON_KEY" | "supabaseAnonKey" | null;
49
+ declare const getSupabaseReactNativeSource: ({
50
+ apiKey,
51
+ functionName,
52
+ projectId
53
+ }: {
54
+ readonly apiKey: string;
55
+ readonly functionName: string;
56
+ readonly projectId: string;
57
+ }) => string;
58
+ declare const reportSupabaseOriginCatalogReady: () => void;
59
+ declare const reportSupabaseApiKey: (apiKey: string) => void;
49
60
  declare const resolveEdgeFunctionDenoConfig: (targetDir: string) => Promise<{
50
61
  imports: Record<string, string>;
51
62
  }>;
@@ -81,6 +92,15 @@ declare const waitForSupabaseProjectReady: ({
81
92
  readonly onLongWait: () => void;
82
93
  readonly pollIntervalMs?: number;
83
94
  }) => Promise<void>;
95
+ declare const waitForSupabaseSchemaReady: ({
96
+ getInfrastructureState,
97
+ maxAttempts,
98
+ pollIntervalMs
99
+ }: {
100
+ readonly getInfrastructureState: SupabaseApi["getInfrastructureState"];
101
+ readonly maxAttempts?: number;
102
+ readonly pollIntervalMs?: number;
103
+ }) => Promise<void>;
84
104
  declare const getSupabaseProjectAccess: ({
85
105
  accessToken,
86
106
  managementApi,
@@ -95,9 +115,7 @@ declare const getSupabaseProjectAccess: ({
95
115
  readonly api: SupabaseApi;
96
116
  readonly serviceRoleApiKey: string;
97
117
  }>;
98
- declare const runInit: ({
99
- build,
100
- envFile
101
- }: RunInitOptions) => Promise<void>;
118
+ declare const withSupabaseCliMetadataCleanup: <Result>(cwd: string, operation: () => Promise<Result>) => Promise<Result>;
119
+ declare const runInit: (options: RunInitOptions) => Promise<void>;
102
120
  //#endregion
103
- export { SupabaseBucketSelection, SupabaseProjectSelection, createSelectedBucket, getLegacySupabaseConfigReference, getSupabaseProjectAccess, resolveEdgeFunctionDenoConfig, runInit, selectBucket, selectProject, waitForSupabaseProjectReady };
121
+ export { SupabaseBucketSelection, SupabaseProjectSelection, createSelectedBucket, getLegacySupabaseConfigReference, getSupabaseProjectAccess, getSupabaseReactNativeSource, reportSupabaseApiKey, reportSupabaseOriginCatalogReady, resolveEdgeFunctionDenoConfig, runInit, selectBucket, selectProject, waitForSupabaseProjectReady, waitForSupabaseSchemaReady, withSupabaseCliMetadataCleanup };