@e-techsolutions/e-baas-sdk 1.0.4 → 1.0.6
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.ts +42 -42
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { HttpClient as HttpClient$1, EBaaSError as EBaaSError$1 } from 'infra';
|
|
2
1
|
import { AxiosRequestConfig } from 'axios';
|
|
3
|
-
import { SelectOptions as SelectOptions$1, InsertOptions as InsertOptions$1, UpdateOptions as UpdateOptions$1, DeleteOptions as DeleteOptions$1 } from 'infra/types/common';
|
|
4
2
|
import { Socket } from 'socket.io-client';
|
|
5
3
|
import { EventEmitter } from 'eventemitter3';
|
|
6
4
|
|
|
@@ -139,6 +137,8 @@ interface AuthSession {
|
|
|
139
137
|
expires_at: number;
|
|
140
138
|
token_type: string;
|
|
141
139
|
user: AuthUser;
|
|
140
|
+
created_at?: number;
|
|
141
|
+
client_fingerprint?: string;
|
|
142
142
|
}
|
|
143
143
|
interface AuthResponse {
|
|
144
144
|
user?: AuthUser;
|
|
@@ -165,7 +165,7 @@ interface OAuthProvider {
|
|
|
165
165
|
declare class AuthClient {
|
|
166
166
|
private httpClient;
|
|
167
167
|
private currentSession;
|
|
168
|
-
constructor(httpClient: HttpClient
|
|
168
|
+
constructor(httpClient: HttpClient);
|
|
169
169
|
signUp(data: SignUpData): Promise<AuthResponse>;
|
|
170
170
|
signIn(data: SignInData): Promise<AuthResponse>;
|
|
171
171
|
signOut(): Promise<void>;
|
|
@@ -263,23 +263,23 @@ declare class QueryBuilder<T = any> {
|
|
|
263
263
|
private table;
|
|
264
264
|
private schema?;
|
|
265
265
|
private query;
|
|
266
|
-
constructor(httpClient: HttpClient
|
|
267
|
-
select(columns?: string, options?: SelectOptions
|
|
268
|
-
insert(data: Partial<T> | Partial<T>[], options?: InsertOptions
|
|
266
|
+
constructor(httpClient: HttpClient, table: string, schema?: string);
|
|
267
|
+
select(columns?: string, options?: SelectOptions): this;
|
|
268
|
+
insert(data: Partial<T> | Partial<T>[], options?: InsertOptions): Promise<{
|
|
269
269
|
data: T[] | null;
|
|
270
|
-
error: EBaaSError
|
|
270
|
+
error: EBaaSError | null;
|
|
271
271
|
}>;
|
|
272
|
-
update(data: Partial<T>, options?: UpdateOptions
|
|
272
|
+
update(data: Partial<T>, options?: UpdateOptions): Promise<{
|
|
273
273
|
data: T[] | null;
|
|
274
|
-
error: EBaaSError
|
|
274
|
+
error: EBaaSError | null;
|
|
275
275
|
}>;
|
|
276
|
-
upsert(data: Partial<T> | Partial<T>[], options?: InsertOptions
|
|
276
|
+
upsert(data: Partial<T> | Partial<T>[], options?: InsertOptions): Promise<{
|
|
277
277
|
data: T[] | null;
|
|
278
|
-
error: EBaaSError
|
|
278
|
+
error: EBaaSError | null;
|
|
279
279
|
}>;
|
|
280
|
-
delete(options?: DeleteOptions
|
|
280
|
+
delete(options?: DeleteOptions): Promise<{
|
|
281
281
|
data: T[] | null;
|
|
282
|
-
error: EBaaSError
|
|
282
|
+
error: EBaaSError | null;
|
|
283
283
|
}>;
|
|
284
284
|
eq(column: string, value: any): this;
|
|
285
285
|
neq(column: string, value: any): this;
|
|
@@ -300,12 +300,12 @@ declare class QueryBuilder<T = any> {
|
|
|
300
300
|
range(from: number, to: number): this;
|
|
301
301
|
execute(): Promise<{
|
|
302
302
|
data: T[] | null;
|
|
303
|
-
error: EBaaSError
|
|
303
|
+
error: EBaaSError | null;
|
|
304
304
|
count?: number;
|
|
305
305
|
}>;
|
|
306
306
|
single(): Promise<{
|
|
307
307
|
data: T | null;
|
|
308
|
-
error: EBaaSError
|
|
308
|
+
error: EBaaSError | null;
|
|
309
309
|
}>;
|
|
310
310
|
private executeQuery;
|
|
311
311
|
}
|
|
@@ -314,7 +314,7 @@ declare class DatabaseClient {
|
|
|
314
314
|
private httpClient;
|
|
315
315
|
private customDatabaseManager;
|
|
316
316
|
private currentSchema?;
|
|
317
|
-
constructor(httpClient: HttpClient
|
|
317
|
+
constructor(httpClient: HttpClient, workspaceId?: string);
|
|
318
318
|
from(table: string): QueryBuilder;
|
|
319
319
|
rpc(fn: string, args?: Record<string, any>): Promise<any>;
|
|
320
320
|
schema(schema: string): DatabaseClient;
|
|
@@ -470,83 +470,83 @@ interface StorageUsage {
|
|
|
470
470
|
declare class StorageBucket {
|
|
471
471
|
private httpClient;
|
|
472
472
|
private bucketId;
|
|
473
|
-
constructor(httpClient: HttpClient
|
|
473
|
+
constructor(httpClient: HttpClient, bucketId: string);
|
|
474
474
|
upload(path: string, file: File | Blob | ArrayBuffer | string, options?: StorageUploadOptions): Promise<{
|
|
475
475
|
data: FileUploadResponse | null;
|
|
476
|
-
error: EBaaSError
|
|
476
|
+
error: EBaaSError | null;
|
|
477
477
|
}>;
|
|
478
478
|
download(path: string, options?: StorageDownloadOptions): Promise<{
|
|
479
479
|
data: Blob | null;
|
|
480
|
-
error: EBaaSError
|
|
480
|
+
error: EBaaSError | null;
|
|
481
481
|
}>;
|
|
482
482
|
list(prefix?: string, options?: StorageListOptions): Promise<{
|
|
483
483
|
data: FileListResponse | null;
|
|
484
|
-
error: EBaaSError
|
|
484
|
+
error: EBaaSError | null;
|
|
485
485
|
}>;
|
|
486
486
|
remove(paths: string[]): Promise<{
|
|
487
487
|
data: {
|
|
488
488
|
message: string;
|
|
489
489
|
} | null;
|
|
490
|
-
error: EBaaSError
|
|
490
|
+
error: EBaaSError | null;
|
|
491
491
|
}>;
|
|
492
492
|
move(fromPath: string, toPath: string): Promise<{
|
|
493
493
|
data: {
|
|
494
494
|
message: string;
|
|
495
495
|
} | null;
|
|
496
|
-
error: EBaaSError
|
|
496
|
+
error: EBaaSError | null;
|
|
497
497
|
}>;
|
|
498
498
|
copy(fromPath: string, toPath: string): Promise<{
|
|
499
499
|
data: {
|
|
500
500
|
message: string;
|
|
501
501
|
} | null;
|
|
502
|
-
error: EBaaSError
|
|
502
|
+
error: EBaaSError | null;
|
|
503
503
|
}>;
|
|
504
504
|
createSignedUrl(path: string, expiresIn: number, options?: StorageSignedUrlOptions): Promise<{
|
|
505
505
|
data: SignedUrlResponse | null;
|
|
506
|
-
error: EBaaSError
|
|
506
|
+
error: EBaaSError | null;
|
|
507
507
|
}>;
|
|
508
508
|
getPublicUrl(path: string, options?: {
|
|
509
509
|
transform?: Record<string, any>;
|
|
510
510
|
}): PublicUrlResponse;
|
|
511
511
|
getFileInfo(path: string): Promise<{
|
|
512
512
|
data: StorageFile | null;
|
|
513
|
-
error: EBaaSError
|
|
513
|
+
error: EBaaSError | null;
|
|
514
514
|
}>;
|
|
515
515
|
updateFileMetadata(path: string, metadata: Record<string, any>): Promise<{
|
|
516
516
|
data: StorageFile | null;
|
|
517
|
-
error: EBaaSError
|
|
517
|
+
error: EBaaSError | null;
|
|
518
518
|
}>;
|
|
519
519
|
}
|
|
520
520
|
|
|
521
521
|
declare class StorageClient {
|
|
522
522
|
private httpClient;
|
|
523
|
-
constructor(httpClient: HttpClient
|
|
523
|
+
constructor(httpClient: HttpClient);
|
|
524
524
|
from(bucketId: string): StorageBucket;
|
|
525
525
|
createBucket(id: string, options?: BucketOptions): Promise<{
|
|
526
526
|
data: Bucket | null;
|
|
527
|
-
error: EBaaSError
|
|
527
|
+
error: EBaaSError | null;
|
|
528
528
|
}>;
|
|
529
529
|
getBucket(id: string): Promise<{
|
|
530
530
|
data: Bucket | null;
|
|
531
|
-
error: EBaaSError
|
|
531
|
+
error: EBaaSError | null;
|
|
532
532
|
}>;
|
|
533
533
|
listBuckets(): Promise<{
|
|
534
534
|
data: Bucket[] | null;
|
|
535
|
-
error: EBaaSError
|
|
535
|
+
error: EBaaSError | null;
|
|
536
536
|
}>;
|
|
537
537
|
updateBucket(id: string, options: Partial<BucketOptions>): Promise<{
|
|
538
538
|
data: Bucket | null;
|
|
539
|
-
error: EBaaSError
|
|
539
|
+
error: EBaaSError | null;
|
|
540
540
|
}>;
|
|
541
541
|
deleteBucket(id: string): Promise<{
|
|
542
542
|
data: {
|
|
543
543
|
message: string;
|
|
544
544
|
} | null;
|
|
545
|
-
error: EBaaSError
|
|
545
|
+
error: EBaaSError | null;
|
|
546
546
|
}>;
|
|
547
547
|
getUsage(): Promise<{
|
|
548
548
|
data: StorageUsage | null;
|
|
549
|
-
error: EBaaSError
|
|
549
|
+
error: EBaaSError | null;
|
|
550
550
|
}>;
|
|
551
551
|
}
|
|
552
552
|
|
|
@@ -695,32 +695,32 @@ interface FunctionDeployResponse {
|
|
|
695
695
|
|
|
696
696
|
declare class FunctionsClient {
|
|
697
697
|
private httpClient;
|
|
698
|
-
constructor(httpClient: HttpClient
|
|
698
|
+
constructor(httpClient: HttpClient);
|
|
699
699
|
invoke<T = any>(functionName: string, options?: FunctionInvokeOptions): Promise<{
|
|
700
700
|
data: T | null;
|
|
701
|
-
error: EBaaSError
|
|
701
|
+
error: EBaaSError | null;
|
|
702
702
|
}>;
|
|
703
703
|
list(): Promise<{
|
|
704
704
|
data: FunctionListResponse | null;
|
|
705
|
-
error: EBaaSError
|
|
705
|
+
error: EBaaSError | null;
|
|
706
706
|
}>;
|
|
707
707
|
get(functionName: string): Promise<{
|
|
708
708
|
data: EdgeFunction | null;
|
|
709
|
-
error: EBaaSError
|
|
709
|
+
error: EBaaSError | null;
|
|
710
710
|
}>;
|
|
711
711
|
deploy(functionName: string, options: FunctionDeployOptions): Promise<{
|
|
712
712
|
data: FunctionDeployResponse | null;
|
|
713
|
-
error: EBaaSError
|
|
713
|
+
error: EBaaSError | null;
|
|
714
714
|
}>;
|
|
715
715
|
delete(functionName: string): Promise<{
|
|
716
716
|
data: {
|
|
717
717
|
message: string;
|
|
718
718
|
} | null;
|
|
719
|
-
error: EBaaSError
|
|
719
|
+
error: EBaaSError | null;
|
|
720
720
|
}>;
|
|
721
721
|
updateEnv(functionName: string, env: Record<string, string>): Promise<{
|
|
722
722
|
data: EdgeFunction | null;
|
|
723
|
-
error: EBaaSError
|
|
723
|
+
error: EBaaSError | null;
|
|
724
724
|
}>;
|
|
725
725
|
getLogs(functionName: string, options?: {
|
|
726
726
|
limit?: number;
|
|
@@ -728,13 +728,13 @@ declare class FunctionsClient {
|
|
|
728
728
|
level?: 'info' | 'warn' | 'error' | 'debug';
|
|
729
729
|
}): Promise<{
|
|
730
730
|
data: any[] | null;
|
|
731
|
-
error: EBaaSError
|
|
731
|
+
error: EBaaSError | null;
|
|
732
732
|
}>;
|
|
733
733
|
getMetrics(functionName: string, options?: {
|
|
734
734
|
period?: '1h' | '24h' | '7d' | '30d';
|
|
735
735
|
}): Promise<{
|
|
736
736
|
data: any | null;
|
|
737
|
-
error: EBaaSError
|
|
737
|
+
error: EBaaSError | null;
|
|
738
738
|
}>;
|
|
739
739
|
}
|
|
740
740
|
|