@uploadista/data-store-gcs 0.0.3
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/.turbo/turbo-build.log +5 -0
- package/.turbo/turbo-check.log +5 -0
- package/LICENSE +21 -0
- package/README.md +479 -0
- package/dist/examples.d.ts +44 -0
- package/dist/examples.d.ts.map +1 -0
- package/dist/examples.js +82 -0
- package/dist/gcs-store-rest.d.ts +16 -0
- package/dist/gcs-store-rest.d.ts.map +1 -0
- package/dist/gcs-store-rest.js +188 -0
- package/dist/gcs-store-v2.d.ts +13 -0
- package/dist/gcs-store-v2.d.ts.map +1 -0
- package/dist/gcs-store-v2.js +190 -0
- package/dist/gcs-store.d.ts +12 -0
- package/dist/gcs-store.d.ts.map +1 -0
- package/dist/gcs-store.js +282 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/services/gcs-client-nodejs.service.d.ts +4 -0
- package/dist/services/gcs-client-nodejs.service.d.ts.map +1 -0
- package/dist/services/gcs-client-nodejs.service.js +312 -0
- package/dist/services/gcs-client-rest.service.d.ts +4 -0
- package/dist/services/gcs-client-rest.service.d.ts.map +1 -0
- package/dist/services/gcs-client-rest.service.js +299 -0
- package/dist/services/gcs-client.service.d.ts +56 -0
- package/dist/services/gcs-client.service.d.ts.map +1 -0
- package/dist/services/gcs-client.service.js +3 -0
- package/dist/services/index.d.ts +4 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +3 -0
- package/package.json +31 -0
- package/src/gcs-store-v2.ts +286 -0
- package/src/gcs-store.ts +398 -0
- package/src/index.ts +6 -0
- package/src/services/gcs-client-nodejs.service.ts +435 -0
- package/src/services/gcs-client-rest.service.ts +406 -0
- package/src/services/gcs-client.service.ts +117 -0
- package/src/services/index.ts +3 -0
- package/tsconfig.json +12 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { UploadistaError } from "@uploadista/core/errors";
|
|
2
|
+
import { Effect, Layer } from "effect";
|
|
3
|
+
import { GCSClientService, } from "./gcs-client.service";
|
|
4
|
+
function createRESTGCSClient(config) {
|
|
5
|
+
if (!config.accessToken) {
|
|
6
|
+
throw new Error("accessToken is required for REST API implementation");
|
|
7
|
+
}
|
|
8
|
+
const baseUrl = `https://storage.googleapis.com/storage/v1/b/${config.bucket}`;
|
|
9
|
+
const uploadUrl = `https://storage.googleapis.com/upload/storage/v1/b/${config.bucket}/o`;
|
|
10
|
+
const accessToken = config.accessToken;
|
|
11
|
+
const getAuthHeaders = () => ({
|
|
12
|
+
Authorization: `Bearer ${accessToken}`,
|
|
13
|
+
"Content-Type": "application/json",
|
|
14
|
+
});
|
|
15
|
+
const getObject = (key) => Effect.tryPromise({
|
|
16
|
+
try: async () => {
|
|
17
|
+
const response = await fetch(`${baseUrl}/o/${encodeURIComponent(key)}?alt=media`, {
|
|
18
|
+
headers: {
|
|
19
|
+
Authorization: `Bearer ${accessToken}`,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
if (!response.ok) {
|
|
23
|
+
if (response.status === 404) {
|
|
24
|
+
throw new Error("File not found");
|
|
25
|
+
}
|
|
26
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
27
|
+
}
|
|
28
|
+
if (!response.body) {
|
|
29
|
+
throw new Error("body not found");
|
|
30
|
+
}
|
|
31
|
+
return response.body;
|
|
32
|
+
},
|
|
33
|
+
catch: (error) => {
|
|
34
|
+
if (error instanceof Error && error.message.includes("not found")) {
|
|
35
|
+
return UploadistaError.fromCode("FILE_NOT_FOUND");
|
|
36
|
+
}
|
|
37
|
+
return UploadistaError.fromCode("UNKNOWN_ERROR", { cause: error });
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const getObjectMetadata = (key) => Effect.tryPromise({
|
|
41
|
+
try: async () => {
|
|
42
|
+
const response = await fetch(`${baseUrl}/o/${encodeURIComponent(key)}`, {
|
|
43
|
+
headers: getAuthHeaders(),
|
|
44
|
+
});
|
|
45
|
+
if (!response.ok) {
|
|
46
|
+
if (response.status === 404) {
|
|
47
|
+
throw new Error("File not found");
|
|
48
|
+
}
|
|
49
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
50
|
+
}
|
|
51
|
+
const data = (await response.json());
|
|
52
|
+
return {
|
|
53
|
+
name: data.name,
|
|
54
|
+
bucket: data.bucket,
|
|
55
|
+
size: data.size ? Number.parseInt(data.size, 10) : undefined,
|
|
56
|
+
contentType: data.contentType,
|
|
57
|
+
metadata: data.metadata || {},
|
|
58
|
+
generation: data.generation,
|
|
59
|
+
timeCreated: data.timeCreated,
|
|
60
|
+
updated: data.updated,
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
catch: (error) => {
|
|
64
|
+
if (error instanceof Error && error.message.includes("not found")) {
|
|
65
|
+
return UploadistaError.fromCode("FILE_NOT_FOUND");
|
|
66
|
+
}
|
|
67
|
+
return UploadistaError.fromCode("UNKNOWN_ERROR", { cause: error });
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
const objectExists = (key) => Effect.tryPromise({
|
|
71
|
+
try: async () => {
|
|
72
|
+
const response = await fetch(`${baseUrl}/o/${encodeURIComponent(key)}`, {
|
|
73
|
+
method: "HEAD",
|
|
74
|
+
headers: {
|
|
75
|
+
Authorization: `Bearer ${accessToken}`,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
return response.ok;
|
|
79
|
+
},
|
|
80
|
+
catch: (error) => {
|
|
81
|
+
return UploadistaError.fromCode("UNKNOWN_ERROR", { cause: error });
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
const putObject = (key, body, context) => Effect.tryPromise({
|
|
85
|
+
try: async () => {
|
|
86
|
+
const metadata = {
|
|
87
|
+
name: key,
|
|
88
|
+
contentType: context?.contentType || "application/octet-stream",
|
|
89
|
+
metadata: context?.metadata || {},
|
|
90
|
+
};
|
|
91
|
+
const response = await fetch(`${uploadUrl}?uploadType=media&name=${encodeURIComponent(key)}`, {
|
|
92
|
+
method: "POST",
|
|
93
|
+
headers: {
|
|
94
|
+
Authorization: `Bearer ${accessToken}`,
|
|
95
|
+
"Content-Type": metadata.contentType,
|
|
96
|
+
"Content-Length": body.length.toString(),
|
|
97
|
+
},
|
|
98
|
+
body: body,
|
|
99
|
+
});
|
|
100
|
+
if (!response.ok) {
|
|
101
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
102
|
+
}
|
|
103
|
+
return key;
|
|
104
|
+
},
|
|
105
|
+
catch: (error) => {
|
|
106
|
+
return UploadistaError.fromCode("FILE_WRITE_ERROR", { cause: error });
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
const deleteObject = (key) => Effect.tryPromise({
|
|
110
|
+
try: async () => {
|
|
111
|
+
const response = await fetch(`${baseUrl}/o/${encodeURIComponent(key)}`, {
|
|
112
|
+
method: "DELETE",
|
|
113
|
+
headers: {
|
|
114
|
+
Authorization: `Bearer ${accessToken}`,
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
// 404 is OK - object didn't exist
|
|
118
|
+
if (!response.ok && response.status !== 404) {
|
|
119
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
catch: (error) => {
|
|
123
|
+
return UploadistaError.fromCode("UNKNOWN_ERROR", { cause: error });
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
const createResumableUpload = (context) => Effect.tryPromise({
|
|
127
|
+
try: async () => {
|
|
128
|
+
const metadata = {
|
|
129
|
+
name: context.key,
|
|
130
|
+
contentType: context.contentType || "application/octet-stream",
|
|
131
|
+
metadata: context.metadata || {},
|
|
132
|
+
};
|
|
133
|
+
const response = await fetch(`${uploadUrl}?uploadType=resumable&name=${encodeURIComponent(context.key)}`, {
|
|
134
|
+
method: "POST",
|
|
135
|
+
headers: {
|
|
136
|
+
Authorization: `Bearer ${accessToken}`,
|
|
137
|
+
"Content-Type": "application/json",
|
|
138
|
+
},
|
|
139
|
+
body: JSON.stringify(metadata),
|
|
140
|
+
});
|
|
141
|
+
if (!response.ok) {
|
|
142
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
143
|
+
}
|
|
144
|
+
const resumableUploadUrl = response.headers.get("Location");
|
|
145
|
+
if (!resumableUploadUrl) {
|
|
146
|
+
throw new Error("No upload URL returned");
|
|
147
|
+
}
|
|
148
|
+
return resumableUploadUrl;
|
|
149
|
+
},
|
|
150
|
+
catch: (error) => {
|
|
151
|
+
return UploadistaError.fromCode("FILE_WRITE_ERROR", { cause: error });
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
const uploadChunk = (uploadUrl, chunk, start, total) => Effect.tryPromise({
|
|
155
|
+
try: async () => {
|
|
156
|
+
const end = start + chunk.length - 1;
|
|
157
|
+
const contentRange = total
|
|
158
|
+
? `bytes ${start}-${end}/${total}`
|
|
159
|
+
: `bytes ${start}-${end}/*`;
|
|
160
|
+
const response = await fetch(uploadUrl, {
|
|
161
|
+
method: "PUT",
|
|
162
|
+
headers: {
|
|
163
|
+
"Content-Length": chunk.length.toString(),
|
|
164
|
+
"Content-Range": contentRange,
|
|
165
|
+
},
|
|
166
|
+
body: chunk,
|
|
167
|
+
});
|
|
168
|
+
// 308 means more data needed, 200/201 means complete
|
|
169
|
+
const completed = response.status === 200 || response.status === 201;
|
|
170
|
+
if (!completed && response.status !== 308) {
|
|
171
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
completed,
|
|
175
|
+
bytesUploaded: end + 1,
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
catch: (error) => {
|
|
179
|
+
return UploadistaError.fromCode("FILE_WRITE_ERROR", { cause: error });
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
const getUploadStatus = (uploadUrl) => Effect.tryPromise({
|
|
183
|
+
try: async () => {
|
|
184
|
+
const response = await fetch(uploadUrl, {
|
|
185
|
+
method: "PUT",
|
|
186
|
+
headers: {
|
|
187
|
+
"Content-Range": "bytes */*",
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
if (response.status === 308) {
|
|
191
|
+
// Upload incomplete
|
|
192
|
+
const range = response.headers.get("Range");
|
|
193
|
+
const bytesUploaded = range
|
|
194
|
+
? Number.parseInt(range.split("-")[1], 10) + 1
|
|
195
|
+
: 0;
|
|
196
|
+
return {
|
|
197
|
+
bytesUploaded,
|
|
198
|
+
completed: false,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
else if (response.status === 200 || response.status === 201) {
|
|
202
|
+
// Upload complete
|
|
203
|
+
return {
|
|
204
|
+
bytesUploaded: 0, // We don't know the exact size
|
|
205
|
+
completed: true,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
catch: (error) => {
|
|
213
|
+
return UploadistaError.fromCode("UNKNOWN_ERROR", { cause: error });
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
const cancelUpload = (uploadUrl) => Effect.tryPromise({
|
|
217
|
+
try: async () => {
|
|
218
|
+
// Cancel by sending DELETE to upload URL
|
|
219
|
+
await fetch(uploadUrl, {
|
|
220
|
+
method: "DELETE",
|
|
221
|
+
});
|
|
222
|
+
},
|
|
223
|
+
catch: (error) => {
|
|
224
|
+
return UploadistaError.fromCode("UNKNOWN_ERROR", { cause: error });
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
const composeObjects = (sourceKeys, destinationKey, context) => Effect.tryPromise({
|
|
228
|
+
try: async () => {
|
|
229
|
+
const composeRequest = {
|
|
230
|
+
kind: "storage#composeRequest",
|
|
231
|
+
sourceObjects: sourceKeys.map((key) => ({ name: key })),
|
|
232
|
+
destination: {
|
|
233
|
+
name: destinationKey,
|
|
234
|
+
contentType: context?.contentType || "application/octet-stream",
|
|
235
|
+
metadata: context?.metadata || {},
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
const response = await fetch(`${baseUrl}/o/${encodeURIComponent(destinationKey)}/compose`, {
|
|
239
|
+
method: "POST",
|
|
240
|
+
headers: getAuthHeaders(),
|
|
241
|
+
body: JSON.stringify(composeRequest),
|
|
242
|
+
});
|
|
243
|
+
if (!response.ok) {
|
|
244
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
245
|
+
}
|
|
246
|
+
return destinationKey;
|
|
247
|
+
},
|
|
248
|
+
catch: (error) => {
|
|
249
|
+
return UploadistaError.fromCode("FILE_WRITE_ERROR", { cause: error });
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
const putTemporaryObject = (key, body, context) => putObject(`${key}_tmp`, body, context);
|
|
253
|
+
const getTemporaryObject = (key) => Effect.tryPromise({
|
|
254
|
+
try: async () => {
|
|
255
|
+
try {
|
|
256
|
+
return await getObject(`${key}_tmp`).pipe(Effect.runPromise);
|
|
257
|
+
}
|
|
258
|
+
catch {
|
|
259
|
+
return undefined;
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
catch: () => {
|
|
263
|
+
return UploadistaError.fromCode("UNKNOWN_ERROR");
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
const deleteTemporaryObject = (key) => deleteObject(`${key}_tmp`);
|
|
267
|
+
const getObjectBuffer = (key) => Effect.tryPromise({
|
|
268
|
+
try: async () => {
|
|
269
|
+
const response = await fetch(`${baseUrl}/o/${encodeURIComponent(key)}?alt=media`, {
|
|
270
|
+
headers: getAuthHeaders(),
|
|
271
|
+
});
|
|
272
|
+
if (!response.ok) {
|
|
273
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
274
|
+
}
|
|
275
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
276
|
+
},
|
|
277
|
+
catch: (error) => {
|
|
278
|
+
return UploadistaError.fromCode("FILE_READ_ERROR", { cause: error });
|
|
279
|
+
},
|
|
280
|
+
});
|
|
281
|
+
return {
|
|
282
|
+
bucket: config.bucket,
|
|
283
|
+
getObject,
|
|
284
|
+
getObjectBuffer,
|
|
285
|
+
getObjectMetadata,
|
|
286
|
+
objectExists,
|
|
287
|
+
putObject,
|
|
288
|
+
deleteObject,
|
|
289
|
+
createResumableUpload,
|
|
290
|
+
uploadChunk,
|
|
291
|
+
getUploadStatus,
|
|
292
|
+
cancelUpload,
|
|
293
|
+
composeObjects,
|
|
294
|
+
putTemporaryObject,
|
|
295
|
+
getTemporaryObject,
|
|
296
|
+
deleteTemporaryObject,
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
export const GCSClientRESTLayer = (config) => Layer.succeed(GCSClientService, createRESTGCSClient(config));
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { UploadistaError } from "@uploadista/core/errors";
|
|
2
|
+
import { Context, type Effect } from "effect";
|
|
3
|
+
export interface GCSOperationContext {
|
|
4
|
+
bucket: string;
|
|
5
|
+
key: string;
|
|
6
|
+
contentType?: string;
|
|
7
|
+
metadata?: Record<string, string | null>;
|
|
8
|
+
}
|
|
9
|
+
export interface GCSObjectMetadata {
|
|
10
|
+
name: string;
|
|
11
|
+
bucket: string;
|
|
12
|
+
size?: number;
|
|
13
|
+
contentType?: string;
|
|
14
|
+
metadata?: Record<string, string | null>;
|
|
15
|
+
generation?: string;
|
|
16
|
+
timeCreated?: string;
|
|
17
|
+
updated?: string;
|
|
18
|
+
}
|
|
19
|
+
export type GCSClient = {
|
|
20
|
+
readonly bucket: string;
|
|
21
|
+
readonly getObject: (key: string) => Effect.Effect<ReadableStream, UploadistaError>;
|
|
22
|
+
readonly getObjectMetadata: (key: string) => Effect.Effect<GCSObjectMetadata, UploadistaError>;
|
|
23
|
+
readonly getObjectBuffer: (key: string) => Effect.Effect<Uint8Array, UploadistaError>;
|
|
24
|
+
readonly objectExists: (key: string) => Effect.Effect<boolean, UploadistaError>;
|
|
25
|
+
readonly putObject: (key: string, body: Uint8Array, context?: Partial<GCSOperationContext>) => Effect.Effect<string, UploadistaError>;
|
|
26
|
+
readonly putObjectFromStream?: (key: string, offset: number, readableStream: ReadableStream, context?: Partial<GCSOperationContext>, onProgress?: (chunkSize: number) => void) => Effect.Effect<number, UploadistaError>;
|
|
27
|
+
readonly putObjectFromStreamWithPatching?: (key: string, offset: number, readableStream: ReadableStream, context?: Partial<GCSOperationContext>, onProgress?: (chunkSize: number) => void, // Called with incremental bytes per chunk
|
|
28
|
+
isAppend?: boolean) => Effect.Effect<number, UploadistaError>;
|
|
29
|
+
readonly deleteObject: (key: string) => Effect.Effect<void, UploadistaError>;
|
|
30
|
+
readonly createResumableUpload: (context: GCSOperationContext) => Effect.Effect<string, UploadistaError>;
|
|
31
|
+
readonly uploadChunk: (uploadUrl: string, chunk: Uint8Array, start: number, total?: number) => Effect.Effect<{
|
|
32
|
+
completed: boolean;
|
|
33
|
+
bytesUploaded: number;
|
|
34
|
+
}, UploadistaError>;
|
|
35
|
+
readonly getUploadStatus: (uploadUrl: string) => Effect.Effect<{
|
|
36
|
+
bytesUploaded: number;
|
|
37
|
+
completed: boolean;
|
|
38
|
+
}, UploadistaError>;
|
|
39
|
+
readonly cancelUpload: (uploadUrl: string) => Effect.Effect<void, UploadistaError>;
|
|
40
|
+
readonly composeObjects: (sourceKeys: string[], destinationKey: string, context?: Partial<GCSOperationContext>) => Effect.Effect<string, UploadistaError>;
|
|
41
|
+
readonly putTemporaryObject: (key: string, body: Uint8Array, context?: Partial<GCSOperationContext>) => Effect.Effect<string, UploadistaError>;
|
|
42
|
+
readonly getTemporaryObject: (key: string) => Effect.Effect<ReadableStream | undefined, UploadistaError>;
|
|
43
|
+
readonly deleteTemporaryObject: (key: string) => Effect.Effect<void, UploadistaError>;
|
|
44
|
+
};
|
|
45
|
+
declare const GCSClientService_base: Context.TagClass<GCSClientService, "GCSClientService", GCSClient>;
|
|
46
|
+
export declare class GCSClientService extends GCSClientService_base {
|
|
47
|
+
}
|
|
48
|
+
export interface GCSClientConfig {
|
|
49
|
+
bucket: string;
|
|
50
|
+
keyFilename?: string;
|
|
51
|
+
credentials?: object;
|
|
52
|
+
projectId?: string;
|
|
53
|
+
accessToken?: string;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=gcs-client.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcs-client.service.d.ts","sourceRoot":"","sources":["../../src/services/gcs-client.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAGxB,QAAQ,CAAC,SAAS,EAAE,CAClB,GAAG,EAAE,MAAM,KACR,MAAM,CAAC,MAAM,CAAC,cAAc,E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CAAC,CAAC;IAChE,QAAQ,CAAC,qBAAqB,EAAE,CAC9B,GAAG,EAAE,MAAM,KACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;CAC3C,CAAC;;AAEF,qBAAa,gBAAiB,SAAQ,qBAGnC;CAAG;AAEN,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IAEf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@uploadista/data-store-gcs",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.3",
|
|
5
|
+
"description": "Google Cloud Storage data store for Uploadista",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Uploadista",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@google-cloud/storage": "7.17.2",
|
|
17
|
+
"effect": "3.18.4",
|
|
18
|
+
"@uploadista/observability": "0.0.3",
|
|
19
|
+
"@uploadista/core": "0.0.3"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@uploadista/typescript-config": "0.0.3"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc -b",
|
|
26
|
+
"format": "biome format --write ./src",
|
|
27
|
+
"lint": "biome lint --write ./src",
|
|
28
|
+
"check": "biome check --write ./src",
|
|
29
|
+
"typecheck": "tsc --noEmit"
|
|
30
|
+
}
|
|
31
|
+
}
|