@giaeulate/baas-sdk 1.0.2 → 1.0.4

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.
@@ -0,0 +1,749 @@
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
+ constructor(url?: string, apiKey?: string);
54
+ protected cleanValue(val: string | null): string | null;
55
+ /**
56
+ * Public header generator for adapters
57
+ */
58
+ getHeaders(contentType?: string): Record<string, string>;
59
+ getDynamicToken(): string | null;
60
+ /**
61
+ * Core HTTP request method - DRY principle
62
+ */
63
+ protected request<T = any>(endpoint: string, options?: RequestOptions): Promise<T>;
64
+ protected get<T = any>(endpoint: string): Promise<T>;
65
+ protected post<T = any>(endpoint: string, body?: unknown): Promise<T>;
66
+ protected put<T = any>(endpoint: string, body?: unknown): Promise<T>;
67
+ protected patch<T = any>(endpoint: string, body?: unknown): Promise<T>;
68
+ protected delete<T = any>(endpoint: string): Promise<T>;
69
+ setEnvironment(env: string): void;
70
+ getEnvironment(): string;
71
+ logout(): void;
72
+ forceLogout(): void;
73
+ handleIPBlocked(ip?: string): void;
74
+ }
75
+
76
+ /**
77
+ * Environments Module - Test/Prod environment management
78
+ */
79
+
80
+ interface EnvironmentStatus {
81
+ test_exists: boolean;
82
+ test_status?: string;
83
+ test_created_at?: string;
84
+ test_schema_name?: string;
85
+ prod_schema_name: string;
86
+ table_count: number;
87
+ }
88
+ interface PromoteResult {
89
+ tables_promoted: number;
90
+ status: string;
91
+ }
92
+ interface EnvironmentsModule {
93
+ status(): Promise<EnvironmentStatus>;
94
+ init(): Promise<any>;
95
+ promote(): Promise<PromoteResult>;
96
+ revert(): Promise<any>;
97
+ setActive(env: 'test' | 'prod'): void;
98
+ getActive(): string;
99
+ }
100
+
101
+ /**
102
+ * QueryBuilder - Fluent API for data queries
103
+ */
104
+
105
+ declare class QueryBuilder {
106
+ private table;
107
+ private url;
108
+ private client;
109
+ private queryParams;
110
+ private filters;
111
+ constructor(table: string, url: string, client: HttpClient);
112
+ select(columns?: string): this;
113
+ eq(column: string, value: any): this;
114
+ neq(column: string, value: any): this;
115
+ gt(column: string, value: any): this;
116
+ gte(column: string, value: any): this;
117
+ lt(column: string, value: any): this;
118
+ lte(column: string, value: any): this;
119
+ like(column: string, value: any): this;
120
+ ilike(column: string, value: any): this;
121
+ is(column: string, value: any): this;
122
+ in(column: string, values: any[]): this;
123
+ not(column: string, operator: string, value: any): this;
124
+ or(filters: string): this;
125
+ order(column: string, { ascending }?: {
126
+ ascending?: boolean | undefined;
127
+ }): this;
128
+ limit(count: number): this;
129
+ offset(count: number): this;
130
+ get(): Promise<{
131
+ data: null;
132
+ error: any;
133
+ status: number;
134
+ } | {
135
+ data: any;
136
+ error: null;
137
+ status: number;
138
+ }>;
139
+ insert(data: any): Promise<{
140
+ data: null;
141
+ error: any;
142
+ status: number;
143
+ } | {
144
+ data: any;
145
+ error: null;
146
+ status: number;
147
+ }>;
148
+ update(id: string | number, data: any): Promise<{
149
+ data: null;
150
+ error: any;
151
+ status: number;
152
+ } | {
153
+ data: any;
154
+ error: null;
155
+ status: number;
156
+ }>;
157
+ delete(id: string | number): Promise<{
158
+ data: null;
159
+ error: any;
160
+ status: number;
161
+ } | {
162
+ data: any;
163
+ error: null;
164
+ status: number;
165
+ } | {
166
+ success: boolean;
167
+ }>;
168
+ private getHeaders;
169
+ private handleResponse;
170
+ }
171
+
172
+ /**
173
+ * Auth Module - Authentication operations
174
+ */
175
+
176
+ interface MFASetupResponse {
177
+ secret: string;
178
+ qr_code_url: string;
179
+ recovery_codes: string[];
180
+ }
181
+ interface AuthModule {
182
+ login(email: string, password: string): Promise<any>;
183
+ logout(): Promise<void>;
184
+ verifyMFA(mfaToken: string, code: string): Promise<any>;
185
+ verifyMFAWithRecoveryCode(mfaToken: string, recoveryCode: string): Promise<any>;
186
+ setupMFA(): Promise<MFASetupResponse>;
187
+ enableMFA(secret: string, code: string, recoveryCodes?: string[]): Promise<any>;
188
+ disableMFA(code: string): Promise<any>;
189
+ getProfile(): Promise<any>;
190
+ register(email: string, password: string): Promise<any>;
191
+ forgotPassword(email: string): Promise<any>;
192
+ resetPassword(token: string, newPassword: string): Promise<any>;
193
+ validateResetToken(token: string): Promise<any>;
194
+ verifyEmail(token: string): Promise<any>;
195
+ requestEmailVerification(): Promise<any>;
196
+ getAuthProviders(): Promise<any>;
197
+ getAuthProvider(provider: string): Promise<any>;
198
+ configureAuthProvider(provider: string, clientID: string, clientSecret: string, enabled: boolean): Promise<any>;
199
+ }
200
+
201
+ /**
202
+ * Users Module - User management operations
203
+ */
204
+
205
+ interface UsersModule {
206
+ list(limit?: number, offset?: number): Promise<any>;
207
+ update(id: string, updates: {
208
+ email?: string;
209
+ role?: string;
210
+ email_verified?: boolean;
211
+ }): Promise<any>;
212
+ delete(id: string): Promise<any>;
213
+ }
214
+
215
+ /**
216
+ * Database Module - Schema, table, and column operations
217
+ */
218
+
219
+ interface DatabaseModule {
220
+ getSchemas(options?: {
221
+ search?: string;
222
+ limit?: number;
223
+ offset?: number;
224
+ }): Promise<any>;
225
+ getSchema(name: string): Promise<any>;
226
+ createTable(tableName: string, definition: Record<string, string | {
227
+ type: string;
228
+ nullable?: boolean;
229
+ unique?: boolean;
230
+ default?: string;
231
+ }>): Promise<any>;
232
+ dropTable(tableName: string): Promise<any>;
233
+ renameTable(tableName: string, newName: string): Promise<any>;
234
+ addColumn(tableName: string, column: {
235
+ name: string;
236
+ type: string;
237
+ nullable?: boolean;
238
+ default_value?: string;
239
+ }): Promise<any>;
240
+ dropColumn(tableName: string, columnName: string): Promise<any>;
241
+ modifyColumn(tableName: string, columnName: string, changes: {
242
+ type: string;
243
+ nullable?: boolean;
244
+ }): Promise<any>;
245
+ renameColumn(tableName: string, columnName: string, newName: string): Promise<any>;
246
+ setColumnDefault(tableName: string, columnName: string, defaultValue: string | null): Promise<any>;
247
+ addForeignKey(tableName: string, fk: {
248
+ column: string;
249
+ ref_table: string;
250
+ ref_column: string;
251
+ on_delete?: string;
252
+ on_update?: string;
253
+ }): Promise<any>;
254
+ listForeignKeys(tableName: string): Promise<any>;
255
+ dropForeignKey(tableName: string, constraintName: string): Promise<any>;
256
+ addUniqueConstraint(tableName: string, columnName: string): Promise<any>;
257
+ dropConstraint(tableName: string, constraintName: string): Promise<any>;
258
+ raw(query: string): Promise<any>;
259
+ queryData(tableName: string, options: {
260
+ page?: number;
261
+ limit?: number;
262
+ filters?: any[];
263
+ }): Promise<any>;
264
+ downloadExport(tableName: string, format: 'sql' | 'csv' | 'backup', filters?: any[]): Promise<any>;
265
+ }
266
+
267
+ /**
268
+ * Storage Module - File storage operations
269
+ */
270
+
271
+ interface StorageModule {
272
+ upload(table: string, file: File): Promise<any>;
273
+ }
274
+
275
+ /**
276
+ * Backups Module - Database backup operations
277
+ */
278
+
279
+ interface BackupsModule {
280
+ create(options?: {
281
+ name?: string;
282
+ tables?: string[];
283
+ }): Promise<any>;
284
+ list(): Promise<any>;
285
+ get(backupId: string): Promise<any>;
286
+ restore(backupId: string): Promise<any>;
287
+ delete(backupId: string): Promise<any>;
288
+ getDownloadUrl(backupId: string): string;
289
+ listTables(): Promise<any>;
290
+ importFile(formData: FormData): Promise<any>;
291
+ }
292
+
293
+ /**
294
+ * Migrations Module - Database migration operations
295
+ */
296
+
297
+ interface MigrationsModule {
298
+ create(input: {
299
+ name: string;
300
+ description?: string;
301
+ up_sql: string;
302
+ down_sql?: string;
303
+ }): Promise<any>;
304
+ list(): Promise<any>;
305
+ get(id: string): Promise<any>;
306
+ apply(id: string): Promise<any>;
307
+ rollback(id: string): Promise<any>;
308
+ delete(id: string): Promise<any>;
309
+ generate(tableName: string, changes: any[]): Promise<any>;
310
+ }
311
+
312
+ /**
313
+ * Functions Module - Edge function operations
314
+ */
315
+
316
+ interface FunctionsModule {
317
+ invoke(id: string, data?: any): Promise<any>;
318
+ list(): Promise<any>;
319
+ create(name: string, code: string): Promise<any>;
320
+ delete(id: string): Promise<any>;
321
+ update(id: string, code: string): Promise<any>;
322
+ listHooks(): Promise<any>;
323
+ createHook(data: {
324
+ event_type: string;
325
+ function_id: string;
326
+ table_name?: string;
327
+ config?: any;
328
+ }): Promise<any>;
329
+ deleteHook(id: string): Promise<any>;
330
+ }
331
+
332
+ /**
333
+ * Jobs Module - Scheduled jobs (CRON) operations
334
+ */
335
+
336
+ interface JobInput {
337
+ name: string;
338
+ schedule: string;
339
+ function_id: string;
340
+ description?: string;
341
+ payload?: Record<string, any>;
342
+ timezone?: string;
343
+ }
344
+ interface JobUpdateInput {
345
+ name?: string;
346
+ schedule?: string;
347
+ function_id?: string;
348
+ description?: string;
349
+ payload?: Record<string, any>;
350
+ timezone?: string;
351
+ enabled?: boolean;
352
+ }
353
+ interface JobsModule {
354
+ create(input: JobInput): Promise<any>;
355
+ list(): Promise<any>;
356
+ get(id: string): Promise<any>;
357
+ update(id: string, input: JobUpdateInput): Promise<any>;
358
+ delete(id: string): Promise<any>;
359
+ toggle(id: string, enabled: boolean): Promise<any>;
360
+ runNow(id: string): Promise<any>;
361
+ getExecutions(id: string, limit?: number): Promise<any>;
362
+ }
363
+
364
+ /**
365
+ * Environment Variables Module
366
+ */
367
+
368
+ interface EnvVarsModule {
369
+ create(input: {
370
+ key: string;
371
+ value: string;
372
+ is_secret?: boolean;
373
+ }): Promise<any>;
374
+ list(): Promise<any>;
375
+ get(id: string): Promise<any>;
376
+ update(id: string, value: string): Promise<any>;
377
+ delete(id: string): Promise<any>;
378
+ }
379
+
380
+ /**
381
+ * Email Module - Email service operations
382
+ */
383
+
384
+ interface EmailConfig {
385
+ provider: string;
386
+ smtp_host?: string;
387
+ smtp_port?: number;
388
+ smtp_user?: string;
389
+ smtp_password?: string;
390
+ sendgrid_api_key?: string;
391
+ resend_api_key?: string;
392
+ from_email: string;
393
+ from_name?: string;
394
+ }
395
+ interface EmailTemplate {
396
+ name: string;
397
+ subject: string;
398
+ text_body?: string;
399
+ html_body?: string;
400
+ }
401
+ interface SendEmailInput {
402
+ to: string[];
403
+ subject: string;
404
+ text_body?: string;
405
+ html_body?: string;
406
+ template_id?: string;
407
+ template_data?: Record<string, any>;
408
+ }
409
+ interface EmailModule {
410
+ send(input: SendEmailInput): Promise<any>;
411
+ getConfig(): Promise<any>;
412
+ saveConfig(config: EmailConfig): Promise<any>;
413
+ createTemplate(template: EmailTemplate): Promise<any>;
414
+ listTemplates(): Promise<any>;
415
+ getTemplate(id: string): Promise<any>;
416
+ updateTemplate(id: string, template: Partial<EmailTemplate>): Promise<any>;
417
+ deleteTemplate(id: string): Promise<any>;
418
+ getLogs(options?: {
419
+ limit?: number;
420
+ offset?: number;
421
+ }): Promise<any>;
422
+ }
423
+
424
+ /**
425
+ * Search Module - Full-text search operations
426
+ */
427
+
428
+ interface SearchOptions {
429
+ tables?: string[];
430
+ columns?: string[];
431
+ limit?: number;
432
+ offset?: number;
433
+ }
434
+ interface SearchModule {
435
+ search(query: string, options?: SearchOptions): Promise<any>;
436
+ createIndex(table: string, columns: string[]): Promise<any>;
437
+ }
438
+
439
+ /**
440
+ * GraphQL Module
441
+ */
442
+
443
+ interface GraphQLModule {
444
+ query(query: string, variables?: Record<string, any>): Promise<any>;
445
+ getPlaygroundUrl(): string;
446
+ }
447
+
448
+ /**
449
+ * Metrics Module - Monitoring and metrics operations
450
+ */
451
+
452
+ interface RequestLogsOptions {
453
+ limit?: number;
454
+ offset?: number;
455
+ method?: string;
456
+ status?: string;
457
+ path?: string;
458
+ }
459
+ interface ApplicationLogsOptions {
460
+ limit?: number;
461
+ offset?: number;
462
+ level?: string;
463
+ source?: string;
464
+ search?: string;
465
+ }
466
+ interface TimeseriesOptions {
467
+ interval?: string;
468
+ start?: string;
469
+ end?: string;
470
+ }
471
+ interface MetricsModule {
472
+ getDashboardStats(): Promise<any>;
473
+ getRequestLogs(options?: RequestLogsOptions): Promise<any>;
474
+ getApplicationLogs(options?: ApplicationLogsOptions): Promise<any>;
475
+ getTimeseries(metric: string, options?: TimeseriesOptions): Promise<any>;
476
+ }
477
+
478
+ /**
479
+ * Audit Module - Audit log operations
480
+ */
481
+
482
+ interface AuditLogsOptions {
483
+ limit?: number;
484
+ offset?: number;
485
+ action?: string;
486
+ user_id?: string;
487
+ method?: string;
488
+ path?: string;
489
+ status_code?: number;
490
+ start_date?: string;
491
+ end_date?: string;
492
+ }
493
+ interface AuditModule {
494
+ list(options?: AuditLogsOptions): Promise<any>;
495
+ getActions(): Promise<any>;
496
+ }
497
+
498
+ /**
499
+ * Webhooks Module
500
+ */
501
+
502
+ interface WebhookInput {
503
+ url: string;
504
+ event_types: string[];
505
+ }
506
+ interface WebhookUpdateInput {
507
+ url: string;
508
+ event_types: string[];
509
+ is_active: boolean;
510
+ }
511
+ interface WebhooksModule {
512
+ list(): Promise<any>;
513
+ get(id: string): Promise<any>;
514
+ create(input: WebhookInput): Promise<any>;
515
+ update(id: string, input: WebhookUpdateInput): Promise<any>;
516
+ delete(id: string): Promise<any>;
517
+ test(id: string): Promise<any>;
518
+ }
519
+
520
+ /**
521
+ * Log Drains Module
522
+ */
523
+
524
+ interface LogDrainInput {
525
+ name: string;
526
+ type: string;
527
+ url: string;
528
+ token?: string;
529
+ headers?: Record<string, string>;
530
+ filters?: {
531
+ levels?: string[];
532
+ sources?: string[];
533
+ };
534
+ }
535
+ interface LogDrainUpdateInput {
536
+ name?: string;
537
+ url?: string;
538
+ token?: string;
539
+ headers?: Record<string, string>;
540
+ filters?: {
541
+ levels?: string[];
542
+ sources?: string[];
543
+ };
544
+ enabled?: boolean;
545
+ }
546
+ interface LogDrainsModule {
547
+ create(input: LogDrainInput): Promise<any>;
548
+ list(): Promise<any>;
549
+ get(id: string): Promise<any>;
550
+ update(id: string, input: LogDrainUpdateInput): Promise<any>;
551
+ delete(id: string): Promise<any>;
552
+ toggle(id: string, enabled: boolean): Promise<any>;
553
+ test(id: string): Promise<any>;
554
+ }
555
+
556
+ /**
557
+ * Branches Module - Database branches operations
558
+ */
559
+
560
+ interface BranchesModule {
561
+ create(input: {
562
+ name: string;
563
+ source_branch?: string;
564
+ }): Promise<any>;
565
+ list(): Promise<any>;
566
+ get(id: string): Promise<any>;
567
+ delete(id: string): Promise<any>;
568
+ merge(id: string, targetBranchId: string): Promise<any>;
569
+ reset(id: string): Promise<any>;
570
+ }
571
+
572
+ /**
573
+ * Realtime Module - WebSocket subscriptions
574
+ */
575
+
576
+ interface Subscription {
577
+ unsubscribe: () => void;
578
+ }
579
+ interface RealtimeModule {
580
+ subscribe<T = any>(table: string, action: RealtimeAction, callback: RealtimeCallback<T>): Promise<Subscription>;
581
+ }
582
+
583
+ /**
584
+ * API Keys Module
585
+ */
586
+
587
+ interface ApiKeysModule {
588
+ create(name: string, permissions?: string[], expiresAt?: string): Promise<any>;
589
+ list(): Promise<any>;
590
+ revoke(keyId: string): Promise<any>;
591
+ delete(keyId: string): Promise<any>;
592
+ }
593
+
594
+ /**
595
+ * Main BaaS Client - Composes all feature modules
596
+ *
597
+ * Usage:
598
+ * ```ts
599
+ * const client = new BaasClient();
600
+ *
601
+ * // Authentication
602
+ * await client.auth.login('user@example.com', 'password');
603
+ *
604
+ * // Database operations
605
+ * const schemas = await client.database.getSchemas();
606
+ *
607
+ * // Query builder (fluent API)
608
+ * const users = await client.from('users').select('*').limit(10).get();
609
+ * ```
610
+ */
611
+ declare class BaasClient extends HttpClient {
612
+ readonly auth: AuthModule;
613
+ readonly users: UsersModule;
614
+ readonly database: DatabaseModule;
615
+ readonly storage: StorageModule;
616
+ readonly backups: BackupsModule;
617
+ readonly migrations: MigrationsModule;
618
+ readonly functions: FunctionsModule;
619
+ readonly jobs: JobsModule;
620
+ readonly envVars: EnvVarsModule;
621
+ readonly email: EmailModule;
622
+ readonly searchService: SearchModule;
623
+ readonly graphqlService: GraphQLModule;
624
+ readonly metrics: MetricsModule;
625
+ readonly audit: AuditModule;
626
+ readonly webhooks: WebhooksModule;
627
+ readonly logDrains: LogDrainsModule;
628
+ readonly branches: BranchesModule;
629
+ readonly realtime: RealtimeModule;
630
+ readonly apiKeys: ApiKeysModule;
631
+ readonly environments: EnvironmentsModule;
632
+ constructor(url?: string, apiKey?: string);
633
+ /**
634
+ * Create a query builder for fluent data queries
635
+ */
636
+ from(table: string): QueryBuilder;
637
+ login(email: string, password: string): Promise<any>;
638
+ verifyMFA(mfaToken: string, code: string): Promise<any>;
639
+ getProfile(): Promise<any>;
640
+ register(email: string, password: string): Promise<any>;
641
+ forgotPassword(email: string): Promise<any>;
642
+ resetPassword(token: string, newPassword: string): Promise<any>;
643
+ validateResetToken(token: string): Promise<any>;
644
+ verifyEmail(token: string): Promise<any>;
645
+ requestEmailVerification(): Promise<any>;
646
+ getAuthProviders(): Promise<any>;
647
+ getAuthProvider(provider: string): Promise<any>;
648
+ configureAuthProvider(provider: string, clientID: string, clientSecret: string, enabled: boolean): Promise<any>;
649
+ listUsers(limit?: number, offset?: number): Promise<any>;
650
+ updateUser(id: string, updates: any): Promise<any>;
651
+ deleteUser(id: string): Promise<any>;
652
+ raw(query: string): Promise<any>;
653
+ getSchemas(options?: any): Promise<any>;
654
+ getSchema(name: string): Promise<any>;
655
+ createTable(tableName: string, definition: any): Promise<any>;
656
+ dropTable(tableName: string): Promise<any>;
657
+ renameTable(tableName: string, newName: string): Promise<any>;
658
+ addColumn(tableName: string, column: any): Promise<any>;
659
+ dropColumn(tableName: string, columnName: string): Promise<any>;
660
+ modifyColumn(tableName: string, columnName: string, changes: any): Promise<any>;
661
+ renameColumn(tableName: string, columnName: string, newName: string): Promise<any>;
662
+ setColumnDefault(tableName: string, columnName: string, defaultValue: string | null): Promise<any>;
663
+ addForeignKey(tableName: string, fk: any): Promise<any>;
664
+ listForeignKeys(tableName: string): Promise<any>;
665
+ dropForeignKey(tableName: string, constraintName: string): Promise<any>;
666
+ addUniqueConstraint(tableName: string, columnName: string): Promise<any>;
667
+ dropConstraint(tableName: string, constraintName: string): Promise<any>;
668
+ queryData(tableName: string, options: any): Promise<any>;
669
+ downloadExport(tableName: string, format: 'sql' | 'csv' | 'backup', filters?: any[]): Promise<any>;
670
+ upload(table: string, file: File): Promise<any>;
671
+ invokeFunction(id: string, data?: any): Promise<any>;
672
+ createApiKey(name: string, permissions?: string[], expiresAt?: string): Promise<any>;
673
+ listApiKeys(): Promise<any>;
674
+ revokeApiKey(keyId: string): Promise<any>;
675
+ deleteApiKey(keyId: string): Promise<any>;
676
+ createBackup(options?: any): Promise<any>;
677
+ listBackups(): Promise<any>;
678
+ getBackup(backupId: string): Promise<any>;
679
+ restoreBackup(backupId: string): Promise<any>;
680
+ deleteBackup(backupId: string): Promise<any>;
681
+ getBackupDownloadUrl(backupId: string): string;
682
+ listBackupTables(): Promise<any>;
683
+ importFile(formData: FormData): Promise<any>;
684
+ search(query: string, options?: any): Promise<any>;
685
+ createSearchIndex(table: string, columns: string[]): Promise<any>;
686
+ graphql(query: string, variables?: Record<string, any>): Promise<any>;
687
+ getGraphQLPlaygroundUrl(): string;
688
+ createMigration(input: any): Promise<any>;
689
+ listMigrations(): Promise<any>;
690
+ getMigration(id: string): Promise<any>;
691
+ applyMigration(id: string): Promise<any>;
692
+ rollbackMigration(id: string): Promise<any>;
693
+ deleteMigration(id: string): Promise<any>;
694
+ generateMigration(tableName: string, changes: any[]): Promise<any>;
695
+ sendEmail(input: any): Promise<any>;
696
+ getEmailConfig(): Promise<any>;
697
+ saveEmailConfig(config: any): Promise<any>;
698
+ createEmailTemplate(template: any): Promise<any>;
699
+ listEmailTemplates(): Promise<any>;
700
+ getEmailTemplate(id: string): Promise<any>;
701
+ updateEmailTemplate(id: string, template: any): Promise<any>;
702
+ deleteEmailTemplate(id: string): Promise<any>;
703
+ getEmailLogs(options?: any): Promise<any>;
704
+ getDashboardStats(): Promise<any>;
705
+ getRequestLogs(options?: any): Promise<any>;
706
+ getApplicationLogs(options?: any): Promise<any>;
707
+ getMetricTimeseries(metric: string, options?: any): Promise<any>;
708
+ createJob(input: any): Promise<any>;
709
+ listJobs(): Promise<any>;
710
+ getJob(id: string): Promise<any>;
711
+ updateJob(id: string, input: any): Promise<any>;
712
+ deleteJob(id: string): Promise<any>;
713
+ toggleJob(id: string, enabled: boolean): Promise<any>;
714
+ runJobNow(id: string): Promise<any>;
715
+ getJobExecutions(id: string, limit?: number): Promise<any>;
716
+ createEnvVar(input: any): Promise<any>;
717
+ listEnvVars(): Promise<any>;
718
+ getEnvVar(id: string): Promise<any>;
719
+ updateEnvVar(id: string, value: string): Promise<any>;
720
+ deleteEnvVar(id: string): Promise<any>;
721
+ createBranch(input: any): Promise<any>;
722
+ listBranches(): Promise<any>;
723
+ getBranch(id: string): Promise<any>;
724
+ deleteBranch(id: string): Promise<any>;
725
+ mergeBranch(id: string, targetBranchId: string): Promise<any>;
726
+ resetBranch(id: string): Promise<any>;
727
+ createLogDrain(input: any): Promise<any>;
728
+ listLogDrains(): Promise<any>;
729
+ getLogDrain(id: string): Promise<any>;
730
+ updateLogDrain(id: string, input: any): Promise<any>;
731
+ deleteLogDrain(id: string): Promise<any>;
732
+ toggleLogDrain(id: string, enabled: boolean): Promise<any>;
733
+ testLogDrain(id: string): Promise<any>;
734
+ listWebhooks(): Promise<any>;
735
+ getWebhook(id: string): Promise<any>;
736
+ createWebhook(input: any): Promise<any>;
737
+ updateWebhook(id: string, input: any): Promise<any>;
738
+ deleteWebhook(id: string): Promise<any>;
739
+ testWebhook(id: string): Promise<any>;
740
+ listAuditLogs(options?: any): Promise<any>;
741
+ getAuditActions(): Promise<any>;
742
+ subscribe<T = any>(table: string, action: RealtimeAction, callback: RealtimeCallback<T>): Promise<Subscription>;
743
+ getEnvironmentStatus(): Promise<EnvironmentStatus>;
744
+ initTestEnvironment(): Promise<any>;
745
+ promoteTestToProd(): Promise<PromoteResult>;
746
+ revertTestEnvironment(): Promise<any>;
747
+ }
748
+
749
+ export { type ApiKeysModule, type ApiResponse, type ApplicationLogsOptions, type AuditLogsOptions, type AuditModule, type AuthModule, BaasClient, type BackupsModule, type BranchesModule, type DatabaseModule, type EmailConfig, type EmailModule, type EmailTemplate, type EnvVarsModule, type FunctionsModule, type GraphQLModule, HttpClient, type HttpMethod, type JobInput, type JobUpdateInput, type JobsModule, type LogDrainInput, type LogDrainUpdateInput, type LogDrainsModule, type MetricsModule, type MigrationsModule, type PaginationOptions, QueryBuilder, type QueryFilter, type RealtimeModule, type RequestLogsOptions, type RequestOptions, type SearchModule, type SearchOptions, type SendEmailInput, type StorageModule, type Subscription, type TimeseriesOptions, type UsersModule, type WebhookInput, type WebhookUpdateInput, type WebhooksModule };