@giaeulate/baas-sdk 1.1.0 → 1.1.1

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.d.cts DELETED
@@ -1,891 +0,0 @@
1
- /**
2
- * SDK Shared Types
3
- */
4
- /** HTTP method types */
5
- type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
6
- /** Request options for the HTTP client */
7
- interface RequestOptions {
8
- method?: HttpMethod;
9
- body?: unknown;
10
- headers?: Record<string, string>;
11
- skipAuth?: boolean;
12
- }
13
- /** Query filter for data operations */
14
- type QueryFilter = {
15
- column: string;
16
- operator: string;
17
- value: any;
18
- };
19
- /** Pagination options */
20
- interface PaginationOptions {
21
- limit?: number;
22
- offset?: number;
23
- }
24
- /** Generic API response with error */
25
- interface ApiResponse<T = any> {
26
- data?: T;
27
- error?: string;
28
- success?: boolean;
29
- }
30
- /** Realtime Event types */
31
- type RealtimeAction = 'INSERT' | 'UPDATE' | 'DELETE' | '*';
32
- /** Structure of a Realtime event payload */
33
- interface RealtimePayload<T = any> {
34
- table: string;
35
- action: 'insert' | 'update' | 'delete';
36
- record: T;
37
- old_record?: T;
38
- timestamp: string;
39
- }
40
- /** Callback function for realtime subscriptions */
41
- type RealtimeCallback<T = any> = (payload: RealtimePayload<T>) => void;
42
-
43
- /**
44
- * Core HTTP Client
45
- * Base class providing HTTP request infrastructure for all SDK modules
46
- */
47
-
48
- declare class HttpClient {
49
- url: string;
50
- apiKey: string;
51
- token: string | null;
52
- private environment;
53
- private _onForceLogout;
54
- constructor(url?: string, apiKey?: string);
55
- /**
56
- * Set the auth token manually (e.g. restoring from SecureStore in React Native).
57
- * Persists to both the in-memory property and localStorage so getDynamicToken() works.
58
- */
59
- setToken(token: string | null): void;
60
- /**
61
- * Register a callback invoked on forced logout (401).
62
- * Use this in React Native instead of the default window.location redirect.
63
- */
64
- onForceLogout(callback: () => void): void;
65
- protected cleanValue(val: string | null): string | null;
66
- /**
67
- * Public header generator for adapters
68
- */
69
- getHeaders(contentType?: string): Record<string, string>;
70
- getDynamicToken(): string | null;
71
- /**
72
- * Core HTTP request method - DRY principle
73
- */
74
- protected request<T = any>(endpoint: string, options?: RequestOptions): Promise<T>;
75
- protected get<T = any>(endpoint: string): Promise<T>;
76
- protected post<T = any>(endpoint: string, body?: unknown): Promise<T>;
77
- protected put<T = any>(endpoint: string, body?: unknown): Promise<T>;
78
- protected patch<T = any>(endpoint: string, body?: unknown): Promise<T>;
79
- protected delete<T = any>(endpoint: string): Promise<T>;
80
- setEnvironment(env: string): void;
81
- getEnvironment(): string;
82
- logout(): void;
83
- forceLogout(): void;
84
- handleIPBlocked(ip?: string): void;
85
- }
86
-
87
- /**
88
- * Environments Module - Test/Prod environment management
89
- */
90
-
91
- interface EnvironmentStatus {
92
- test_exists: boolean;
93
- test_status?: string;
94
- test_created_at?: string;
95
- test_schema_name?: string;
96
- prod_schema_name: string;
97
- table_count: number;
98
- }
99
- interface PromoteResult {
100
- tables_promoted: number;
101
- status: string;
102
- }
103
- interface EnvironmentsModule {
104
- status(): Promise<EnvironmentStatus>;
105
- init(): Promise<any>;
106
- promote(): Promise<PromoteResult>;
107
- revert(): Promise<any>;
108
- setActive(env: 'test' | 'prod'): void;
109
- getActive(): string;
110
- }
111
-
112
- /**
113
- * QueryBuilder - Fluent API for data queries
114
- */
115
-
116
- declare class QueryBuilder {
117
- private table;
118
- private url;
119
- private client;
120
- private queryParams;
121
- private filters;
122
- constructor(table: string, url: string, client: HttpClient);
123
- select(columns?: string): this;
124
- eq(column: string, value: any): this;
125
- neq(column: string, value: any): this;
126
- gt(column: string, value: any): this;
127
- gte(column: string, value: any): this;
128
- lt(column: string, value: any): this;
129
- lte(column: string, value: any): this;
130
- like(column: string, value: any): this;
131
- ilike(column: string, value: any): this;
132
- is(column: string, value: any): this;
133
- in(column: string, values: any[]): this;
134
- not(column: string, operator: string, value: any): this;
135
- or(filters: string): this;
136
- order(column: string, { ascending }?: {
137
- ascending?: boolean | undefined;
138
- }): this;
139
- limit(count: number): this;
140
- offset(count: number): this;
141
- get(): Promise<{
142
- data: null;
143
- error: any;
144
- status: number;
145
- } | {
146
- data: any;
147
- error: null;
148
- status: number;
149
- }>;
150
- insert(data: any): Promise<{
151
- data: null;
152
- error: any;
153
- status: number;
154
- } | {
155
- data: any;
156
- error: null;
157
- status: number;
158
- }>;
159
- update(id: string | number, data: any): Promise<{
160
- data: null;
161
- error: any;
162
- status: number;
163
- } | {
164
- data: any;
165
- error: null;
166
- status: number;
167
- }>;
168
- delete(id: string | number): Promise<{
169
- data: null;
170
- error: any;
171
- status: number;
172
- } | {
173
- data: any;
174
- error: null;
175
- status: number;
176
- } | {
177
- success: boolean;
178
- }>;
179
- private getHeaders;
180
- private handleResponse;
181
- }
182
-
183
- /**
184
- * Auth Module - Authentication operations
185
- */
186
-
187
- interface MFASetupResponse {
188
- secret: string;
189
- qr_code_url: string;
190
- recovery_codes: string[];
191
- }
192
- interface AuthModule {
193
- login(email: string, password: string): Promise<any>;
194
- logout(): Promise<void>;
195
- verifyMFA(mfaToken: string, code: string): Promise<any>;
196
- verifyMFAWithRecoveryCode(mfaToken: string, recoveryCode: string): Promise<any>;
197
- setupMFA(): Promise<MFASetupResponse>;
198
- enableMFA(secret: string, code: string, recoveryCodes?: string[]): Promise<any>;
199
- disableMFA(code: string): Promise<any>;
200
- getProfile(): Promise<any>;
201
- register(email: string, password: string): Promise<any>;
202
- forgotPassword(email: string): Promise<any>;
203
- resetPassword(token: string, newPassword: string): Promise<any>;
204
- validateResetToken(token: string): Promise<any>;
205
- verifyEmail(token: string): Promise<any>;
206
- requestEmailVerification(): Promise<any>;
207
- getAuthProviders(): Promise<any>;
208
- getAuthProvider(provider: string): Promise<any>;
209
- configureAuthProvider(provider: string, clientID: string, clientSecret: string, enabled: boolean): Promise<any>;
210
- }
211
-
212
- /**
213
- * Users Module - User management operations
214
- */
215
-
216
- interface UsersModule {
217
- list(limit?: number, offset?: number): Promise<any>;
218
- update(id: string, updates: {
219
- email?: string;
220
- role?: string;
221
- email_verified?: boolean;
222
- }): Promise<any>;
223
- delete(id: string): Promise<any>;
224
- }
225
-
226
- /**
227
- * Database Module - Schema, table, and column operations
228
- */
229
-
230
- interface DatabaseModule {
231
- getSchemas(options?: {
232
- search?: string;
233
- limit?: number;
234
- offset?: number;
235
- }): Promise<any>;
236
- getSchema(name: string): Promise<any>;
237
- saveSchemas(data: {
238
- table_name: string;
239
- definition: any;
240
- }): Promise<any>;
241
- createTable(tableName: string, definition: Record<string, string | {
242
- type: string;
243
- nullable?: boolean;
244
- unique?: boolean;
245
- default?: string;
246
- }>): Promise<any>;
247
- dropTable(tableName: string): Promise<any>;
248
- renameTable(tableName: string, newName: string): Promise<any>;
249
- addColumn(tableName: string, column: {
250
- name: string;
251
- type: string;
252
- nullable?: boolean;
253
- default_value?: string;
254
- }): Promise<any>;
255
- dropColumn(tableName: string, columnName: string): Promise<any>;
256
- modifyColumn(tableName: string, columnName: string, changes: {
257
- type: string;
258
- nullable?: boolean;
259
- }): Promise<any>;
260
- renameColumn(tableName: string, columnName: string, newName: string): Promise<any>;
261
- setColumnDefault(tableName: string, columnName: string, defaultValue: string | null): Promise<any>;
262
- addForeignKey(tableName: string, fk: {
263
- column: string;
264
- ref_table: string;
265
- ref_column: string;
266
- on_delete?: string;
267
- on_update?: string;
268
- }): Promise<any>;
269
- listForeignKeys(tableName: string): Promise<any>;
270
- dropForeignKey(tableName: string, constraintName: string): Promise<any>;
271
- addUniqueConstraint(tableName: string, columnName: string): Promise<any>;
272
- dropConstraint(tableName: string, constraintName: string): Promise<any>;
273
- raw(query: string): Promise<any>;
274
- queryData(tableName: string, options: {
275
- page?: number;
276
- limit?: number;
277
- filters?: any[];
278
- }): Promise<any>;
279
- downloadExport(tableName: string, format: 'sql' | 'csv' | 'backup', filters?: any[]): Promise<any>;
280
- }
281
-
282
- /**
283
- * Storage Module - File & bucket operations (MinIO-backed)
284
- *
285
- * Files: upload, list, get (metadata + presigned URL), delete
286
- * Buckets: create, list, get, delete, listFiles
287
- */
288
-
289
- interface StorageFile {
290
- id: string;
291
- bucket_id: string;
292
- name: string;
293
- mime_type: string;
294
- size: number;
295
- created_at: string;
296
- }
297
- interface StorageFileWithUrl {
298
- metadata: StorageFile;
299
- url: string;
300
- }
301
- interface StorageBucket {
302
- id: string;
303
- name: string;
304
- is_public: boolean;
305
- created_at: string;
306
- }
307
- interface StorageModule {
308
- /** Upload a file. Optionally target a specific bucket by ID. */
309
- upload(file: File, bucketId?: string): Promise<StorageFile>;
310
- /** List all files across buckets. */
311
- listFiles(): Promise<StorageFile[]>;
312
- /** Get file metadata + a 15-min presigned download URL. */
313
- getFile(fileId: string): Promise<StorageFileWithUrl>;
314
- /** Delete a file by ID. */
315
- deleteFile(fileId: string): Promise<void>;
316
- /** Create a new bucket. */
317
- createBucket(name: string, isPublic?: boolean): Promise<StorageBucket>;
318
- /** List all buckets. */
319
- listBuckets(): Promise<StorageBucket[]>;
320
- /** Get bucket info by ID. */
321
- getBucket(bucketId: string): Promise<StorageBucket>;
322
- /** Delete an empty bucket. */
323
- deleteBucket(bucketId: string): Promise<void>;
324
- /** List files inside a specific bucket. */
325
- listBucketFiles(bucketId: string): Promise<StorageFile[]>;
326
- /** @deprecated Use upload(file, bucketId?) instead. */
327
- upload(table: string, file: File): Promise<any>;
328
- }
329
-
330
- /**
331
- * Backups Module - Database backup operations
332
- */
333
-
334
- interface BackupsModule {
335
- create(options?: {
336
- name?: string;
337
- tables?: string[];
338
- }): Promise<any>;
339
- list(): Promise<any>;
340
- get(backupId: string): Promise<any>;
341
- restore(backupId: string): Promise<any>;
342
- delete(backupId: string): Promise<any>;
343
- getDownloadUrl(backupId: string): string;
344
- listTables(): Promise<any>;
345
- importFile(formData: FormData): Promise<any>;
346
- }
347
-
348
- /**
349
- * Migrations Module - Database migration operations
350
- */
351
-
352
- interface MigrationsModule {
353
- create(input: {
354
- name: string;
355
- description?: string;
356
- up_sql: string;
357
- down_sql?: string;
358
- }): Promise<any>;
359
- list(): Promise<any>;
360
- get(id: string): Promise<any>;
361
- apply(id: string): Promise<any>;
362
- rollback(id: string): Promise<any>;
363
- delete(id: string): Promise<any>;
364
- generate(tableName: string, changes: any[]): Promise<any>;
365
- }
366
-
367
- /**
368
- * Functions Module - Edge function operations
369
- */
370
-
371
- interface FunctionsModule {
372
- invoke(id: string, data?: any): Promise<any>;
373
- get(id: string): Promise<any>;
374
- list(): Promise<any>;
375
- create(name: string, code: string, options?: {
376
- runtime?: 'wazero' | 'deno';
377
- timeout_ms?: number;
378
- }): Promise<any>;
379
- delete(id: string): Promise<any>;
380
- update(id: string, code: string, options?: {
381
- runtime?: 'wazero' | 'deno';
382
- timeout_ms?: number;
383
- }): Promise<any>;
384
- executeCode(code: string, options?: {
385
- data?: any;
386
- runtime?: 'wazero' | 'deno';
387
- timeout_ms?: number;
388
- }): Promise<any>;
389
- listHooks(): Promise<any>;
390
- createHook(data: {
391
- event_type: string;
392
- function_id: string;
393
- table_name?: string;
394
- config?: any;
395
- }): Promise<any>;
396
- deleteHook(id: string): Promise<any>;
397
- }
398
-
399
- /**
400
- * Jobs Module - Scheduled jobs (CRON) operations
401
- */
402
-
403
- interface JobInput {
404
- name: string;
405
- schedule: string;
406
- function_id: string;
407
- description?: string;
408
- payload?: Record<string, any>;
409
- timezone?: string;
410
- }
411
- interface JobUpdateInput {
412
- name?: string;
413
- schedule?: string;
414
- function_id?: string;
415
- description?: string;
416
- payload?: Record<string, any>;
417
- timezone?: string;
418
- enabled?: boolean;
419
- }
420
- interface JobsModule {
421
- create(input: JobInput): Promise<any>;
422
- list(): Promise<any>;
423
- get(id: string): Promise<any>;
424
- update(id: string, input: JobUpdateInput): Promise<any>;
425
- delete(id: string): Promise<any>;
426
- toggle(id: string, enabled: boolean): Promise<any>;
427
- runNow(id: string): Promise<any>;
428
- getExecutions(id: string, limit?: number): Promise<any>;
429
- }
430
-
431
- /**
432
- * Environment Variables Module
433
- */
434
-
435
- interface EnvVarsModule {
436
- create(input: {
437
- key: string;
438
- value: string;
439
- is_secret?: boolean;
440
- }): Promise<any>;
441
- list(): Promise<any>;
442
- get(id: string): Promise<any>;
443
- update(id: string, value: string): Promise<any>;
444
- delete(id: string): Promise<any>;
445
- }
446
-
447
- /**
448
- * Email Module - Email service operations
449
- */
450
-
451
- interface EmailConfig {
452
- provider: string;
453
- smtp_host?: string;
454
- smtp_port?: number;
455
- smtp_user?: string;
456
- smtp_password?: string;
457
- sendgrid_api_key?: string;
458
- resend_api_key?: string;
459
- from_email: string;
460
- from_name?: string;
461
- }
462
- interface EmailTemplate {
463
- name: string;
464
- subject: string;
465
- text_body?: string;
466
- html_body?: string;
467
- }
468
- interface SendEmailInput {
469
- to: string[];
470
- subject: string;
471
- text_body?: string;
472
- html_body?: string;
473
- template_id?: string;
474
- template_data?: Record<string, any>;
475
- }
476
- interface EmailModule {
477
- send(input: SendEmailInput): Promise<any>;
478
- getConfig(): Promise<any>;
479
- saveConfig(config: EmailConfig): Promise<any>;
480
- createTemplate(template: EmailTemplate): Promise<any>;
481
- listTemplates(): Promise<any>;
482
- getTemplate(id: string): Promise<any>;
483
- updateTemplate(id: string, template: Partial<EmailTemplate>): Promise<any>;
484
- deleteTemplate(id: string): Promise<any>;
485
- getLogs(options?: {
486
- limit?: number;
487
- offset?: number;
488
- }): Promise<any>;
489
- }
490
-
491
- /**
492
- * Search Module - Full-text search operations
493
- */
494
-
495
- interface SearchOptions {
496
- tables?: string[];
497
- columns?: string[];
498
- limit?: number;
499
- offset?: number;
500
- }
501
- interface SearchModule {
502
- search(query: string, options?: SearchOptions): Promise<any>;
503
- createIndex(table: string, columns: string[]): Promise<any>;
504
- }
505
-
506
- /**
507
- * GraphQL Module
508
- */
509
-
510
- interface GraphQLModule {
511
- query(query: string, variables?: Record<string, any>): Promise<any>;
512
- getSchema(): Promise<any>;
513
- getPlaygroundUrl(): string;
514
- }
515
-
516
- /**
517
- * Metrics Module - Monitoring and metrics operations
518
- */
519
-
520
- interface RequestLogsOptions {
521
- limit?: number;
522
- offset?: number;
523
- method?: string;
524
- status?: string;
525
- path?: string;
526
- }
527
- interface ApplicationLogsOptions {
528
- limit?: number;
529
- offset?: number;
530
- level?: string;
531
- source?: string;
532
- search?: string;
533
- }
534
- interface TimeseriesOptions {
535
- interval?: string;
536
- start?: string;
537
- end?: string;
538
- }
539
- interface MetricsModule {
540
- getDashboardStats(): Promise<any>;
541
- getRequestLogs(options?: RequestLogsOptions): Promise<any>;
542
- getApplicationLogs(options?: ApplicationLogsOptions): Promise<any>;
543
- getTimeseries(metric: string, options?: TimeseriesOptions): Promise<any>;
544
- }
545
-
546
- /**
547
- * Audit Module - Audit log operations
548
- */
549
-
550
- interface AuditLogsOptions {
551
- limit?: number;
552
- offset?: number;
553
- action?: string;
554
- user_id?: string;
555
- method?: string;
556
- path?: string;
557
- status_code?: number;
558
- start_date?: string;
559
- end_date?: string;
560
- }
561
- interface AuditModule {
562
- list(options?: AuditLogsOptions): Promise<any>;
563
- getActions(): Promise<any>;
564
- }
565
-
566
- /**
567
- * Webhooks Module
568
- */
569
-
570
- interface WebhookInput {
571
- url: string;
572
- event_types: string[];
573
- }
574
- interface WebhookUpdateInput {
575
- url: string;
576
- event_types: string[];
577
- is_active: boolean;
578
- }
579
- interface WebhooksModule {
580
- list(): Promise<any>;
581
- get(id: string): Promise<any>;
582
- create(input: WebhookInput): Promise<any>;
583
- update(id: string, input: WebhookUpdateInput): Promise<any>;
584
- delete(id: string): Promise<any>;
585
- test(id: string): Promise<any>;
586
- }
587
-
588
- /**
589
- * Log Drains Module
590
- */
591
-
592
- interface LogDrainInput {
593
- name: string;
594
- type: string;
595
- url: string;
596
- token?: string;
597
- headers?: Record<string, string>;
598
- filters?: {
599
- levels?: string[];
600
- sources?: string[];
601
- };
602
- }
603
- interface LogDrainUpdateInput {
604
- name?: string;
605
- url?: string;
606
- token?: string;
607
- headers?: Record<string, string>;
608
- filters?: {
609
- levels?: string[];
610
- sources?: string[];
611
- };
612
- enabled?: boolean;
613
- }
614
- interface LogDrainsModule {
615
- create(input: LogDrainInput): Promise<any>;
616
- list(): Promise<any>;
617
- get(id: string): Promise<any>;
618
- update(id: string, input: LogDrainUpdateInput): Promise<any>;
619
- delete(id: string): Promise<any>;
620
- toggle(id: string, enabled: boolean): Promise<any>;
621
- test(id: string): Promise<any>;
622
- }
623
-
624
- /**
625
- * Branches Module - Database branches operations
626
- */
627
-
628
- interface BranchesModule {
629
- create(input: {
630
- name: string;
631
- source_branch?: string;
632
- }): Promise<any>;
633
- list(): Promise<any>;
634
- get(id: string): Promise<any>;
635
- delete(id: string): Promise<any>;
636
- merge(id: string, targetBranchId: string): Promise<any>;
637
- reset(id: string): Promise<any>;
638
- }
639
-
640
- /**
641
- * Realtime Module - WebSocket subscriptions
642
- */
643
-
644
- interface Subscription {
645
- unsubscribe: () => void;
646
- }
647
- interface RealtimeModule {
648
- subscribe<T = any>(table: string, action: RealtimeAction, callback: RealtimeCallback<T>): Promise<Subscription>;
649
- }
650
-
651
- /**
652
- * API Keys Module
653
- */
654
-
655
- interface ApiKeysModule {
656
- create(name: string, permissions?: string[], expiresAt?: string): Promise<any>;
657
- list(): Promise<any>;
658
- revoke(keyId: string): Promise<any>;
659
- delete(keyId: string): Promise<any>;
660
- getInstanceToken(): Promise<any>;
661
- regenerateInstanceToken(): Promise<any>;
662
- }
663
-
664
- /**
665
- * CORS Origins Module
666
- */
667
-
668
- interface CorsOriginsModule {
669
- list(): Promise<any>;
670
- create(origin: string, description?: string): Promise<any>;
671
- delete(id: string): Promise<any>;
672
- }
673
-
674
- /**
675
- * Policies Module - Row-Level Security policy management
676
- */
677
-
678
- interface Policy {
679
- id: string;
680
- table_name: string;
681
- action: 'select' | 'insert' | 'update' | 'delete';
682
- role: string;
683
- condition: string;
684
- created_at?: string;
685
- }
686
- interface CreatePolicyInput {
687
- table_name: string;
688
- action: 'select' | 'insert' | 'update' | 'delete';
689
- role: string;
690
- condition: string;
691
- }
692
- interface PoliciesModule {
693
- create(input: CreatePolicyInput): Promise<Policy>;
694
- list(): Promise<Policy[]>;
695
- delete(id: string): Promise<any>;
696
- }
697
-
698
- /**
699
- * IP Whitelist Module - IP-based access control
700
- */
701
-
702
- interface IPWhitelistEntry {
703
- id: string;
704
- ip_address: string;
705
- description: string;
706
- created_at?: string;
707
- }
708
- interface IPWhitelistModule {
709
- list(): Promise<IPWhitelistEntry[]>;
710
- create(ipAddress: string, description?: string): Promise<IPWhitelistEntry>;
711
- delete(id: string): Promise<any>;
712
- }
713
-
714
- /**
715
- * Main BaaS Client - Composes all feature modules
716
- *
717
- * Usage:
718
- * ```ts
719
- * const client = new BaasClient();
720
- *
721
- * // Authentication
722
- * await client.auth.login('user@example.com', 'password');
723
- *
724
- * // Database operations
725
- * const schemas = await client.database.getSchemas();
726
- *
727
- * // Query builder (fluent API)
728
- * const users = await client.from('users').select('*').limit(10).get();
729
- * ```
730
- */
731
- declare class BaasClient extends HttpClient {
732
- readonly auth: AuthModule;
733
- readonly users: UsersModule;
734
- readonly database: DatabaseModule;
735
- readonly storage: StorageModule;
736
- readonly backups: BackupsModule;
737
- readonly migrations: MigrationsModule;
738
- readonly functions: FunctionsModule;
739
- readonly jobs: JobsModule;
740
- readonly envVars: EnvVarsModule;
741
- readonly email: EmailModule;
742
- readonly searchService: SearchModule;
743
- readonly graphqlService: GraphQLModule;
744
- readonly metrics: MetricsModule;
745
- readonly audit: AuditModule;
746
- readonly webhooks: WebhooksModule;
747
- readonly logDrains: LogDrainsModule;
748
- readonly branches: BranchesModule;
749
- readonly realtime: RealtimeModule;
750
- readonly apiKeys: ApiKeysModule;
751
- readonly environments: EnvironmentsModule;
752
- readonly corsOrigins: CorsOriginsModule;
753
- readonly policies: PoliciesModule;
754
- readonly ipWhitelist: IPWhitelistModule;
755
- constructor(url?: string, apiKey?: string);
756
- /**
757
- * Create a query builder for fluent data queries
758
- */
759
- from(table: string): QueryBuilder;
760
- login(email: string, password: string): Promise<any>;
761
- verifyMFA(mfaToken: string, code: string): Promise<any>;
762
- getProfile(): Promise<any>;
763
- register(email: string, password: string): Promise<any>;
764
- forgotPassword(email: string): Promise<any>;
765
- resetPassword(token: string, newPassword: string): Promise<any>;
766
- validateResetToken(token: string): Promise<any>;
767
- verifyEmail(token: string): Promise<any>;
768
- requestEmailVerification(): Promise<any>;
769
- getAuthProviders(): Promise<any>;
770
- getAuthProvider(provider: string): Promise<any>;
771
- configureAuthProvider(provider: string, clientID: string, clientSecret: string, enabled: boolean): Promise<any>;
772
- listUsers(limit?: number, offset?: number): Promise<any>;
773
- updateUser(id: string, updates: any): Promise<any>;
774
- deleteUser(id: string): Promise<any>;
775
- raw(query: string): Promise<any>;
776
- getSchemas(options?: any): Promise<any>;
777
- getSchema(name: string): Promise<any>;
778
- createTable(tableName: string, definition: any): Promise<any>;
779
- dropTable(tableName: string): Promise<any>;
780
- renameTable(tableName: string, newName: string): Promise<any>;
781
- addColumn(tableName: string, column: any): Promise<any>;
782
- dropColumn(tableName: string, columnName: string): Promise<any>;
783
- modifyColumn(tableName: string, columnName: string, changes: any): Promise<any>;
784
- renameColumn(tableName: string, columnName: string, newName: string): Promise<any>;
785
- setColumnDefault(tableName: string, columnName: string, defaultValue: string | null): Promise<any>;
786
- addForeignKey(tableName: string, fk: any): Promise<any>;
787
- listForeignKeys(tableName: string): Promise<any>;
788
- dropForeignKey(tableName: string, constraintName: string): Promise<any>;
789
- addUniqueConstraint(tableName: string, columnName: string): Promise<any>;
790
- dropConstraint(tableName: string, constraintName: string): Promise<any>;
791
- queryData(tableName: string, options: any): Promise<any>;
792
- downloadExport(tableName: string, format: 'sql' | 'csv' | 'backup', filters?: any[]): Promise<any>;
793
- upload(file: File, bucketId?: string): Promise<StorageFile>;
794
- listStorageFiles(): Promise<StorageFile[]>;
795
- getStorageFile(fileId: string): Promise<StorageFileWithUrl>;
796
- deleteStorageFile(fileId: string): Promise<void>;
797
- createStorageBucket(name: string, isPublic?: boolean): Promise<StorageBucket>;
798
- listStorageBuckets(): Promise<StorageBucket[]>;
799
- getStorageBucket(bucketId: string): Promise<StorageBucket>;
800
- deleteStorageBucket(bucketId: string): Promise<void>;
801
- listStorageBucketFiles(bucketId: string): Promise<StorageFile[]>;
802
- invokeFunction(id: string, data?: any): Promise<any>;
803
- createApiKey(name: string, permissions?: string[], expiresAt?: string): Promise<any>;
804
- listApiKeys(): Promise<any>;
805
- revokeApiKey(keyId: string): Promise<any>;
806
- deleteApiKey(keyId: string): Promise<any>;
807
- getInstanceToken(): Promise<any>;
808
- regenerateInstanceToken(): Promise<any>;
809
- createBackup(options?: any): Promise<any>;
810
- listBackups(): Promise<any>;
811
- getBackup(backupId: string): Promise<any>;
812
- restoreBackup(backupId: string): Promise<any>;
813
- deleteBackup(backupId: string): Promise<any>;
814
- getBackupDownloadUrl(backupId: string): string;
815
- listBackupTables(): Promise<any>;
816
- importFile(formData: FormData): Promise<any>;
817
- search(query: string, options?: any): Promise<any>;
818
- createSearchIndex(table: string, columns: string[]): Promise<any>;
819
- graphql(query: string, variables?: Record<string, any>): Promise<any>;
820
- getGraphQLPlaygroundUrl(): string;
821
- createMigration(input: any): Promise<any>;
822
- listMigrations(): Promise<any>;
823
- getMigration(id: string): Promise<any>;
824
- applyMigration(id: string): Promise<any>;
825
- rollbackMigration(id: string): Promise<any>;
826
- deleteMigration(id: string): Promise<any>;
827
- generateMigration(tableName: string, changes: any[]): Promise<any>;
828
- sendEmail(input: any): Promise<any>;
829
- getEmailConfig(): Promise<any>;
830
- saveEmailConfig(config: any): Promise<any>;
831
- createEmailTemplate(template: any): Promise<any>;
832
- listEmailTemplates(): Promise<any>;
833
- getEmailTemplate(id: string): Promise<any>;
834
- updateEmailTemplate(id: string, template: any): Promise<any>;
835
- deleteEmailTemplate(id: string): Promise<any>;
836
- getEmailLogs(options?: any): Promise<any>;
837
- getDashboardStats(): Promise<any>;
838
- getRequestLogs(options?: any): Promise<any>;
839
- getApplicationLogs(options?: any): Promise<any>;
840
- getMetricTimeseries(metric: string, options?: any): Promise<any>;
841
- createJob(input: any): Promise<any>;
842
- listJobs(): Promise<any>;
843
- getJob(id: string): Promise<any>;
844
- updateJob(id: string, input: any): Promise<any>;
845
- deleteJob(id: string): Promise<any>;
846
- toggleJob(id: string, enabled: boolean): Promise<any>;
847
- runJobNow(id: string): Promise<any>;
848
- getJobExecutions(id: string, limit?: number): Promise<any>;
849
- createEnvVar(input: any): Promise<any>;
850
- listEnvVars(): Promise<any>;
851
- getEnvVar(id: string): Promise<any>;
852
- updateEnvVar(id: string, value: string): Promise<any>;
853
- deleteEnvVar(id: string): Promise<any>;
854
- createBranch(input: any): Promise<any>;
855
- listBranches(): Promise<any>;
856
- getBranch(id: string): Promise<any>;
857
- deleteBranch(id: string): Promise<any>;
858
- mergeBranch(id: string, targetBranchId: string): Promise<any>;
859
- resetBranch(id: string): Promise<any>;
860
- createLogDrain(input: any): Promise<any>;
861
- listLogDrains(): Promise<any>;
862
- getLogDrain(id: string): Promise<any>;
863
- updateLogDrain(id: string, input: any): Promise<any>;
864
- deleteLogDrain(id: string): Promise<any>;
865
- toggleLogDrain(id: string, enabled: boolean): Promise<any>;
866
- testLogDrain(id: string): Promise<any>;
867
- listWebhooks(): Promise<any>;
868
- getWebhook(id: string): Promise<any>;
869
- createWebhook(input: any): Promise<any>;
870
- updateWebhook(id: string, input: any): Promise<any>;
871
- deleteWebhook(id: string): Promise<any>;
872
- testWebhook(id: string): Promise<any>;
873
- listAuditLogs(options?: any): Promise<any>;
874
- getAuditActions(): Promise<any>;
875
- subscribe<T = any>(table: string, action: RealtimeAction, callback: RealtimeCallback<T>): Promise<Subscription>;
876
- getEnvironmentStatus(): Promise<EnvironmentStatus>;
877
- initTestEnvironment(): Promise<any>;
878
- promoteTestToProd(): Promise<PromoteResult>;
879
- revertTestEnvironment(): Promise<any>;
880
- listCorsOrigins(): Promise<any>;
881
- addCorsOrigin(origin: string, description?: string): Promise<any>;
882
- deleteCorsOrigin(id: string): Promise<any>;
883
- listPolicies(): Promise<Policy[]>;
884
- createPolicy(input: any): Promise<Policy>;
885
- deletePolicy(id: string): Promise<any>;
886
- listIPWhitelist(): Promise<IPWhitelistEntry[]>;
887
- addIPWhitelistEntry(ipAddress: string, description?: string): Promise<IPWhitelistEntry>;
888
- deleteIPWhitelistEntry(id: string): Promise<any>;
889
- }
890
-
891
- export { type ApiKeysModule, type ApiResponse, type ApplicationLogsOptions, type AuditLogsOptions, type AuditModule, type AuthModule, BaasClient, type BackupsModule, type BranchesModule, type CorsOriginsModule, type CreatePolicyInput, type DatabaseModule, type EmailConfig, type EmailModule, type EmailTemplate, type EnvVarsModule, type EnvironmentsModule, type FunctionsModule, type GraphQLModule, HttpClient, type HttpMethod, type IPWhitelistEntry, type IPWhitelistModule, type JobInput, type JobUpdateInput, type JobsModule, type LogDrainInput, type LogDrainUpdateInput, type LogDrainsModule, type MetricsModule, type MigrationsModule, type PaginationOptions, type PoliciesModule, type Policy, QueryBuilder, type QueryFilter, type RealtimeModule, type RequestLogsOptions, type RequestOptions, type SearchModule, type SearchOptions, type SendEmailInput, type StorageBucket, type StorageFile, type StorageFileWithUrl, type StorageModule, type Subscription, type TimeseriesOptions, type UsersModule, type WebhookInput, type WebhookUpdateInput, type WebhooksModule };