@hot-updater/supabase 0.35.8 → 0.35.10

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,4 +1,4 @@
1
- import { BuildType } from "@hot-updater/cli-tools";
1
+ import { RunInitOptions } from "@hot-updater/cli-tools";
2
2
 
3
3
  //#region iac/supabaseApi.d.ts
4
4
  interface SupabaseApi {
@@ -13,6 +13,35 @@ interface SupabaseApi {
13
13
  }) => Promise<{
14
14
  name: string;
15
15
  }>;
16
+ updateBucket: (bucketId: string, options: {
17
+ public: boolean;
18
+ }) => Promise<void>;
19
+ }
20
+ //#endregion
21
+ //#region iac/init/index.d.ts
22
+ declare const SUPABASE_REGION_VALUES: readonly ["ap-east-1", "ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ca-central-1", "eu-central-1", "eu-central-2", "eu-north-1", "eu-west-1", "eu-west-2", "eu-west-3", "sa-east-1", "us-east-1", "us-east-2", "us-west-1", "us-west-2"];
23
+ type SupabaseRegion = (typeof SUPABASE_REGION_VALUES)[number];
24
+ //#endregion
25
+ //#region iac/supabaseManagementApi.d.ts
26
+ type SupabaseOrganization = {
27
+ readonly id: string;
28
+ readonly name: string;
29
+ readonly slug: string;
30
+ };
31
+ type SupabaseProject = {
32
+ readonly id: string;
33
+ readonly name: string;
34
+ readonly region: string;
35
+ };
36
+ interface SupabaseManagementApi {
37
+ createProject: (input: {
38
+ readonly databasePassword: string;
39
+ readonly name: string;
40
+ readonly organizationSlug: string;
41
+ readonly region: SupabaseRegion;
42
+ }) => Promise<SupabaseProject>;
43
+ getProjectStatus: (projectId: string) => Promise<string>;
44
+ listOrganizations: () => Promise<readonly SupabaseOrganization[]>;
16
45
  }
17
46
  //#endregion
18
47
  //#region iac/index.d.ts
@@ -20,19 +49,55 @@ declare const getLegacySupabaseConfigReference: (configText: string) => "HOT_UPD
20
49
  declare const resolveEdgeFunctionDenoConfig: (targetDir: string) => Promise<{
21
50
  imports: Record<string, string>;
22
51
  }>;
23
- declare const selectProject: () => Promise<{
24
- id: string;
25
- name: string;
26
- region: string;
27
- }>;
28
- declare const selectBucket: (api: SupabaseApi) => Promise<{
29
- id: string;
30
- name: string;
52
+ type SupabaseProjectSelection = {
53
+ readonly create: false;
54
+ readonly project: SupabaseProject;
55
+ } | {
56
+ readonly create: true;
57
+ };
58
+ declare const selectProject: (preferredProjectId?: string, nonInteractive?: boolean, accessToken?: string) => Promise<SupabaseProjectSelection>;
59
+ type SupabaseBucketSelection = {
60
+ readonly create: false;
61
+ readonly id: string;
62
+ readonly isPublic: boolean;
63
+ readonly name: string;
64
+ } | {
65
+ readonly create: true;
66
+ readonly name: string;
67
+ };
68
+ declare const selectBucket: (api: SupabaseApi, preferredBucketName?: string, nonInteractive?: boolean) => Promise<SupabaseBucketSelection>;
69
+ declare const createSelectedBucket: (api: SupabaseApi, selection: SupabaseBucketSelection) => Promise<{
70
+ readonly id: string;
71
+ readonly name: string;
31
72
  }>;
32
- declare const runInit: ({
33
- build
73
+ declare const waitForSupabaseProjectReady: ({
74
+ getProjectStatus,
75
+ maxAttempts,
76
+ onLongWait,
77
+ pollIntervalMs
34
78
  }: {
35
- build: BuildType;
79
+ readonly getProjectStatus: () => Promise<string>;
80
+ readonly maxAttempts?: number;
81
+ readonly onLongWait: () => void;
82
+ readonly pollIntervalMs?: number;
36
83
  }) => Promise<void>;
84
+ declare const getSupabaseProjectAccess: ({
85
+ accessToken,
86
+ managementApi,
87
+ project,
88
+ waitForProject
89
+ }: {
90
+ readonly accessToken?: string;
91
+ readonly managementApi: SupabaseManagementApi;
92
+ readonly project: SupabaseProject;
93
+ readonly waitForProject: boolean;
94
+ }) => Promise<{
95
+ readonly api: SupabaseApi;
96
+ readonly serviceRoleApiKey: string;
97
+ }>;
98
+ declare const runInit: ({
99
+ build,
100
+ envFile
101
+ }: RunInitOptions) => Promise<void>;
37
102
  //#endregion
38
- export { getLegacySupabaseConfigReference, resolveEdgeFunctionDenoConfig, runInit, selectBucket, selectProject };
103
+ export { SupabaseBucketSelection, SupabaseProjectSelection, createSelectedBucket, getLegacySupabaseConfigReference, getSupabaseProjectAccess, resolveEdgeFunctionDenoConfig, runInit, selectBucket, selectProject, waitForSupabaseProjectReady };
@@ -1,4 +1,4 @@
1
- import { BuildType } from "@hot-updater/cli-tools";
1
+ import { RunInitOptions } from "@hot-updater/cli-tools";
2
2
 
3
3
  //#region iac/supabaseApi.d.ts
4
4
  interface SupabaseApi {
@@ -13,6 +13,35 @@ interface SupabaseApi {
13
13
  }) => Promise<{
14
14
  name: string;
15
15
  }>;
16
+ updateBucket: (bucketId: string, options: {
17
+ public: boolean;
18
+ }) => Promise<void>;
19
+ }
20
+ //#endregion
21
+ //#region iac/init/index.d.ts
22
+ declare const SUPABASE_REGION_VALUES: readonly ["ap-east-1", "ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ca-central-1", "eu-central-1", "eu-central-2", "eu-north-1", "eu-west-1", "eu-west-2", "eu-west-3", "sa-east-1", "us-east-1", "us-east-2", "us-west-1", "us-west-2"];
23
+ type SupabaseRegion = (typeof SUPABASE_REGION_VALUES)[number];
24
+ //#endregion
25
+ //#region iac/supabaseManagementApi.d.ts
26
+ type SupabaseOrganization = {
27
+ readonly id: string;
28
+ readonly name: string;
29
+ readonly slug: string;
30
+ };
31
+ type SupabaseProject = {
32
+ readonly id: string;
33
+ readonly name: string;
34
+ readonly region: string;
35
+ };
36
+ interface SupabaseManagementApi {
37
+ createProject: (input: {
38
+ readonly databasePassword: string;
39
+ readonly name: string;
40
+ readonly organizationSlug: string;
41
+ readonly region: SupabaseRegion;
42
+ }) => Promise<SupabaseProject>;
43
+ getProjectStatus: (projectId: string) => Promise<string>;
44
+ listOrganizations: () => Promise<readonly SupabaseOrganization[]>;
16
45
  }
17
46
  //#endregion
18
47
  //#region iac/index.d.ts
@@ -20,19 +49,55 @@ declare const getLegacySupabaseConfigReference: (configText: string) => "HOT_UPD
20
49
  declare const resolveEdgeFunctionDenoConfig: (targetDir: string) => Promise<{
21
50
  imports: Record<string, string>;
22
51
  }>;
23
- declare const selectProject: () => Promise<{
24
- id: string;
25
- name: string;
26
- region: string;
27
- }>;
28
- declare const selectBucket: (api: SupabaseApi) => Promise<{
29
- id: string;
30
- name: string;
52
+ type SupabaseProjectSelection = {
53
+ readonly create: false;
54
+ readonly project: SupabaseProject;
55
+ } | {
56
+ readonly create: true;
57
+ };
58
+ declare const selectProject: (preferredProjectId?: string, nonInteractive?: boolean, accessToken?: string) => Promise<SupabaseProjectSelection>;
59
+ type SupabaseBucketSelection = {
60
+ readonly create: false;
61
+ readonly id: string;
62
+ readonly isPublic: boolean;
63
+ readonly name: string;
64
+ } | {
65
+ readonly create: true;
66
+ readonly name: string;
67
+ };
68
+ declare const selectBucket: (api: SupabaseApi, preferredBucketName?: string, nonInteractive?: boolean) => Promise<SupabaseBucketSelection>;
69
+ declare const createSelectedBucket: (api: SupabaseApi, selection: SupabaseBucketSelection) => Promise<{
70
+ readonly id: string;
71
+ readonly name: string;
31
72
  }>;
32
- declare const runInit: ({
33
- build
73
+ declare const waitForSupabaseProjectReady: ({
74
+ getProjectStatus,
75
+ maxAttempts,
76
+ onLongWait,
77
+ pollIntervalMs
34
78
  }: {
35
- build: BuildType;
79
+ readonly getProjectStatus: () => Promise<string>;
80
+ readonly maxAttempts?: number;
81
+ readonly onLongWait: () => void;
82
+ readonly pollIntervalMs?: number;
36
83
  }) => Promise<void>;
84
+ declare const getSupabaseProjectAccess: ({
85
+ accessToken,
86
+ managementApi,
87
+ project,
88
+ waitForProject
89
+ }: {
90
+ readonly accessToken?: string;
91
+ readonly managementApi: SupabaseManagementApi;
92
+ readonly project: SupabaseProject;
93
+ readonly waitForProject: boolean;
94
+ }) => Promise<{
95
+ readonly api: SupabaseApi;
96
+ readonly serviceRoleApiKey: string;
97
+ }>;
98
+ declare const runInit: ({
99
+ build,
100
+ envFile
101
+ }: RunInitOptions) => Promise<void>;
37
102
  //#endregion
38
- export { getLegacySupabaseConfigReference, resolveEdgeFunctionDenoConfig, runInit, selectBucket, selectProject };
103
+ export { SupabaseBucketSelection, SupabaseProjectSelection, createSelectedBucket, getLegacySupabaseConfigReference, getSupabaseProjectAccess, resolveEdgeFunctionDenoConfig, runInit, selectBucket, selectProject, waitForSupabaseProjectReady };