@cloudbase/storage 3.1.1 → 3.1.3-alpha.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.
- package/dist/cjs/index.d.ts +193 -0
- package/dist/cjs/index.js +1364 -8
- package/dist/esm/index.d.ts +193 -0
- package/dist/esm/index.js +1359 -3
- package/package.json +4 -4
- package/src/index.ts +1424 -2
- package/dist/cjs/storage.d.ts +0 -49
- package/dist/cjs/storage.js +0 -698
- package/dist/cjs/supabase/index.d.ts +0 -145
- package/dist/cjs/supabase/index.js +0 -706
- package/dist/esm/storage.d.ts +0 -49
- package/dist/esm/storage.js +0 -695
- package/dist/esm/supabase/index.d.ts +0 -145
- package/dist/esm/supabase/index.js +0 -703
- package/src/storage.ts +0 -683
- package/src/supabase/index.ts +0 -746
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { CloudbaseStorage, ICloudbaseContext } from '../storage';
|
|
2
|
-
import { Camelize, FileBody, FileObject, FileObjectV2, FileOptions, TransformOptions } from './types';
|
|
3
|
-
import { StorageError } from './errors';
|
|
4
|
-
export declare class SupabaseFileAPILikeStorage extends CloudbaseStorage {
|
|
5
|
-
private shouldThrowOnError;
|
|
6
|
-
private bucketId;
|
|
7
|
-
private context;
|
|
8
|
-
constructor(context?: ICloudbaseContext);
|
|
9
|
-
get config(): any;
|
|
10
|
-
get request(): any;
|
|
11
|
-
throwOnError(): this;
|
|
12
|
-
from(bucket?: string): this;
|
|
13
|
-
upload(path: string, fileBody: FileBody, fileOptions?: FileOptions): Promise<{
|
|
14
|
-
data: {
|
|
15
|
-
id: string;
|
|
16
|
-
path: string;
|
|
17
|
-
fullPath: string;
|
|
18
|
-
};
|
|
19
|
-
error: null;
|
|
20
|
-
} | {
|
|
21
|
-
data: null;
|
|
22
|
-
error: StorageError;
|
|
23
|
-
}>;
|
|
24
|
-
uploadToSignedUrl(path: string, _token: string, fileBody: FileBody, fileOptions?: FileOptions): Promise<{
|
|
25
|
-
data: {
|
|
26
|
-
id: string;
|
|
27
|
-
path: string;
|
|
28
|
-
fullPath: string;
|
|
29
|
-
};
|
|
30
|
-
error: null;
|
|
31
|
-
} | {
|
|
32
|
-
data: null;
|
|
33
|
-
error: StorageError;
|
|
34
|
-
}>;
|
|
35
|
-
createSignedUploadUrl(path: string): Promise<{
|
|
36
|
-
data: {
|
|
37
|
-
signedUrl: string;
|
|
38
|
-
token: string;
|
|
39
|
-
path: string;
|
|
40
|
-
authorization?: string;
|
|
41
|
-
id?: string;
|
|
42
|
-
cosFileId?: string;
|
|
43
|
-
downloadUrl?: string;
|
|
44
|
-
};
|
|
45
|
-
error: null;
|
|
46
|
-
} | {
|
|
47
|
-
data: null;
|
|
48
|
-
error: StorageError;
|
|
49
|
-
}>;
|
|
50
|
-
update(path: string, fileBody: FileBody, fileOptions?: FileOptions): Promise<{
|
|
51
|
-
data: {
|
|
52
|
-
id: string;
|
|
53
|
-
path: string;
|
|
54
|
-
fullPath: string;
|
|
55
|
-
};
|
|
56
|
-
error: null;
|
|
57
|
-
} | {
|
|
58
|
-
data: null;
|
|
59
|
-
error: StorageError;
|
|
60
|
-
}>;
|
|
61
|
-
move(fromPath: string, toPath: string): Promise<{
|
|
62
|
-
data: {
|
|
63
|
-
message: string;
|
|
64
|
-
};
|
|
65
|
-
error: null;
|
|
66
|
-
} | {
|
|
67
|
-
data: null;
|
|
68
|
-
error: StorageError;
|
|
69
|
-
}>;
|
|
70
|
-
copy(fromPath: string, toPath: string): Promise<{
|
|
71
|
-
data: {
|
|
72
|
-
path: string;
|
|
73
|
-
};
|
|
74
|
-
error: null;
|
|
75
|
-
} | {
|
|
76
|
-
data: null;
|
|
77
|
-
error: StorageError;
|
|
78
|
-
}>;
|
|
79
|
-
createSignedUrl(path: string, expiresIn: number, options?: {
|
|
80
|
-
download?: string | boolean;
|
|
81
|
-
transform?: TransformOptions;
|
|
82
|
-
}): Promise<{
|
|
83
|
-
data: {
|
|
84
|
-
signedUrl: string;
|
|
85
|
-
};
|
|
86
|
-
error: null;
|
|
87
|
-
} | {
|
|
88
|
-
data: null;
|
|
89
|
-
error: StorageError;
|
|
90
|
-
}>;
|
|
91
|
-
createSignedUrls(paths: string[], expiresIn: number): Promise<{
|
|
92
|
-
data: Array<{
|
|
93
|
-
path: string;
|
|
94
|
-
signedUrl: string;
|
|
95
|
-
error: string | null;
|
|
96
|
-
}>;
|
|
97
|
-
error: null;
|
|
98
|
-
} | {
|
|
99
|
-
data: null;
|
|
100
|
-
error: StorageError;
|
|
101
|
-
}>;
|
|
102
|
-
download(path: string, options?: TransformOptions): Promise<{
|
|
103
|
-
data: Blob;
|
|
104
|
-
error: StorageError | null;
|
|
105
|
-
}>;
|
|
106
|
-
info(pathOrFileId: string): Promise<{
|
|
107
|
-
data: Camelize<FileObjectV2>;
|
|
108
|
-
error: null;
|
|
109
|
-
} | {
|
|
110
|
-
data: null;
|
|
111
|
-
error: StorageError;
|
|
112
|
-
}>;
|
|
113
|
-
exists(pathOrFileId: string): Promise<{
|
|
114
|
-
data: boolean;
|
|
115
|
-
error: null;
|
|
116
|
-
} | {
|
|
117
|
-
data: null;
|
|
118
|
-
error: StorageError;
|
|
119
|
-
}>;
|
|
120
|
-
getPublicUrl(path: string, options?: {
|
|
121
|
-
download?: string | boolean;
|
|
122
|
-
transform?: TransformOptions;
|
|
123
|
-
}): Promise<{
|
|
124
|
-
data: {
|
|
125
|
-
publicUrl: string;
|
|
126
|
-
};
|
|
127
|
-
} | {
|
|
128
|
-
data: null;
|
|
129
|
-
error: StorageError;
|
|
130
|
-
}>;
|
|
131
|
-
remove(paths: string[]): Promise<{
|
|
132
|
-
data: FileObject[];
|
|
133
|
-
error: null;
|
|
134
|
-
} | {
|
|
135
|
-
data: null;
|
|
136
|
-
error: StorageError;
|
|
137
|
-
}>;
|
|
138
|
-
list(): Promise<void>;
|
|
139
|
-
private _getCloudPath;
|
|
140
|
-
private _normalizeCloudId;
|
|
141
|
-
private toBase64;
|
|
142
|
-
private _transformOptsToQueryString;
|
|
143
|
-
private _extractPathFromFileId;
|
|
144
|
-
private _extractBucketFromFileId;
|
|
145
|
-
}
|