@freehour/supabase-core 2.5.0 → 2.5.2
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/errors.d.ts +16 -31
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -24
- package/dist/storage-service.d.ts.map +1 -1
- package/dist/storage.d.ts +3 -3
- package/dist/storage.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/errors.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as z } from 'zod';
|
|
2
2
|
import { PostgrestError } from '@supabase/supabase-js';
|
|
3
|
+
import { FileRef } from './storage';
|
|
3
4
|
/**
|
|
4
5
|
* Automatically sets the name and captures the stack trace for the error.
|
|
5
6
|
*/
|
|
@@ -8,41 +9,25 @@ export declare class TracedError extends Error {
|
|
|
8
9
|
}
|
|
9
10
|
export interface FileNotFoundErrorOptions {
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* A reference to the file that was expected to be found.
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* The name of the bucket where the file was expected to be found.
|
|
16
|
-
*/
|
|
17
|
-
bucket?: string;
|
|
18
|
-
/**
|
|
19
|
-
* The path relative to the bucket root where the file was expected to be found.
|
|
20
|
-
*/
|
|
21
|
-
path?: string;
|
|
14
|
+
ref: FileRef;
|
|
22
15
|
}
|
|
23
16
|
/**
|
|
24
17
|
* Error indicating that a file with a specified ID could not be found in storage.
|
|
25
18
|
*/
|
|
26
19
|
export declare class FileNotFoundError extends TracedError {
|
|
27
20
|
/**
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
readonly fileId?: string;
|
|
31
|
-
/**
|
|
32
|
-
* The name of the bucket where the file was expected to be found.
|
|
33
|
-
*/
|
|
34
|
-
readonly bucket?: string;
|
|
35
|
-
/**
|
|
36
|
-
* The path relative to the bucket root where the file was expected to be found.
|
|
21
|
+
* A reference to the file that was expected to be found.
|
|
37
22
|
*/
|
|
38
|
-
readonly
|
|
39
|
-
constructor(message: string, {
|
|
23
|
+
readonly ref: FileRef;
|
|
24
|
+
constructor(message: string, { ref, }: FileNotFoundErrorOptions);
|
|
40
25
|
}
|
|
41
26
|
export interface ParseErrorOptions extends ErrorOptions {
|
|
42
27
|
/**
|
|
43
28
|
* The encountered expression that could not be parsed.
|
|
44
29
|
*/
|
|
45
|
-
expression
|
|
30
|
+
expression: string;
|
|
46
31
|
/**
|
|
47
32
|
* Additional context about the expected format or structure.
|
|
48
33
|
*/
|
|
@@ -55,26 +40,26 @@ export declare class ParseError extends TracedError {
|
|
|
55
40
|
/**
|
|
56
41
|
* The encountered expression that could not be parsed.
|
|
57
42
|
*/
|
|
58
|
-
readonly expression
|
|
43
|
+
readonly expression: string;
|
|
59
44
|
/**
|
|
60
45
|
* Additional context about the expected format or structure.
|
|
61
46
|
*/
|
|
62
47
|
readonly format?: unknown;
|
|
63
|
-
constructor(message: string, { expression, format, ...options }
|
|
48
|
+
constructor(message: string, { expression, format, ...options }: ParseErrorOptions);
|
|
64
49
|
}
|
|
65
50
|
export interface RecordNotFoundErrorOptions {
|
|
66
51
|
/**
|
|
67
52
|
* The schema where the record was expected to be found.
|
|
68
53
|
*/
|
|
69
|
-
schema
|
|
54
|
+
schema: string;
|
|
70
55
|
/**
|
|
71
56
|
* The table or view where the record was expected to be found.
|
|
72
57
|
*/
|
|
73
|
-
relation
|
|
58
|
+
relation: string;
|
|
74
59
|
/**
|
|
75
60
|
* The ID of the record that was not found.
|
|
76
61
|
*/
|
|
77
|
-
id
|
|
62
|
+
id: string | number;
|
|
78
63
|
}
|
|
79
64
|
/**
|
|
80
65
|
* Error indicating that a record with a specified ID could not be found in a database table or view.
|
|
@@ -86,16 +71,16 @@ export declare class RecordNotFoundError extends TracedError {
|
|
|
86
71
|
/**
|
|
87
72
|
* The schema where the record was expected to be found.
|
|
88
73
|
*/
|
|
89
|
-
readonly schema
|
|
74
|
+
readonly schema: string;
|
|
90
75
|
/**
|
|
91
76
|
* The table or view where the record was expected to be found.
|
|
92
77
|
*/
|
|
93
|
-
readonly relation
|
|
78
|
+
readonly relation: string;
|
|
94
79
|
/**
|
|
95
80
|
* The ID of the record that was not found.
|
|
96
81
|
*/
|
|
97
|
-
readonly id
|
|
98
|
-
constructor(message: string, { schema, relation, id, }
|
|
82
|
+
readonly id: string | number;
|
|
83
|
+
constructor(message: string, { schema, relation, id, }: RecordNotFoundErrorOptions);
|
|
99
84
|
}
|
|
100
85
|
/**
|
|
101
86
|
* PostgREST errors are sometimes returned in this format instead of the declared PostgrestError class.
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../lib/errors.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../lib/errors.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;gBACtB,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB;CAK3D;AAGD,MAAM,WAAW,wBAAwB;IAErC;;OAEG;IACH,GAAG,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAE9C;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;gBAGlB,OAAO,EAAE,MAAM,EACf,EACI,GAAG,GACN,EAAE,wBAAwB;CAKlC;AAGD,MAAM,WAAW,iBAAkB,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|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,mBAAmB,YAAY,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,mBAAmB,YAAY,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,mBAAmB,WAAW,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,23 +9,21 @@ var i = class extends Error {
|
|
|
9
9
|
super(e, t), this.name = this.constructor.name, Error.captureStackTrace(this, this.constructor);
|
|
10
10
|
}
|
|
11
11
|
}, a = class extends i {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
constructor(e, { fileId: t, bucket: n, path: r } = {}) {
|
|
16
|
-
super(e), this.fileId = t, this.bucket = n, this.path = r;
|
|
12
|
+
ref;
|
|
13
|
+
constructor(e, { ref: t }) {
|
|
14
|
+
super(e), this.ref = t;
|
|
17
15
|
}
|
|
18
16
|
}, o = class extends i {
|
|
19
17
|
expression;
|
|
20
18
|
format;
|
|
21
|
-
constructor(e, { expression: t, format: n, ...r }
|
|
19
|
+
constructor(e, { expression: t, format: n, ...r }) {
|
|
22
20
|
super(e, r), this.expression = t, this.format = n;
|
|
23
21
|
}
|
|
24
22
|
}, s = class extends i {
|
|
25
23
|
schema;
|
|
26
24
|
relation;
|
|
27
25
|
id;
|
|
28
|
-
constructor(e, { schema: t, relation: n, id: r }
|
|
26
|
+
constructor(e, { schema: t, relation: n, id: r }) {
|
|
29
27
|
super(e), this.schema = t, this.relation = n, this.id = r;
|
|
30
28
|
}
|
|
31
29
|
}, c = t.object({
|
|
@@ -448,7 +446,7 @@ function j(e) {
|
|
|
448
446
|
return e.bucket !== void 0 && e.path !== void 0;
|
|
449
447
|
}
|
|
450
448
|
function M(e) {
|
|
451
|
-
return e.
|
|
449
|
+
return e.id !== void 0 && e.bucket !== void 0;
|
|
452
450
|
}
|
|
453
451
|
//#endregion
|
|
454
452
|
//#region lib/storage-service.ts
|
|
@@ -476,21 +474,21 @@ var N = class {
|
|
|
476
474
|
if (j(t)) {
|
|
477
475
|
let { id: e } = await this.getFileObject(t);
|
|
478
476
|
return {
|
|
479
|
-
|
|
477
|
+
id: e,
|
|
480
478
|
...t
|
|
481
479
|
};
|
|
482
480
|
}
|
|
483
|
-
let {
|
|
484
|
-
if (r === void 0) throw new a(`File with ID ${n} not found`, {
|
|
481
|
+
let { id: n } = t, r = await this.files.get(n, ["bucket_id", "path_tokens"]);
|
|
482
|
+
if (r === void 0) throw new a(`File with ID ${n} not found`, { ref: t });
|
|
485
483
|
return {
|
|
486
|
-
|
|
484
|
+
id: n,
|
|
487
485
|
bucket: e.notNull(r.bucket_id, "bucket_id must not be null"),
|
|
488
486
|
path: e.notNull(r.path_tokens, "path_tokens must not be null").join("/")
|
|
489
487
|
};
|
|
490
488
|
}
|
|
491
489
|
async getFileInfo(t) {
|
|
492
490
|
let n = await this.getFileStorageLocation(t), { id: r, bucketId: i, metadata: a, ...o } = await this.getFileObject(n);
|
|
493
|
-
return e(r === n.
|
|
491
|
+
return e(r === n.id, "file ID from storage client must match file ID from database"), e(i === n.bucket, "bucketId from storage client must match bucket from database"), {
|
|
494
492
|
...o,
|
|
495
493
|
...n,
|
|
496
494
|
metadata: a,
|
|
@@ -510,35 +508,32 @@ var N = class {
|
|
|
510
508
|
return r;
|
|
511
509
|
}
|
|
512
510
|
async assertExistsFile(e) {
|
|
513
|
-
let { bucket:
|
|
514
|
-
if (
|
|
515
|
-
if (!
|
|
516
|
-
bucket: t,
|
|
517
|
-
path: n
|
|
518
|
-
});
|
|
511
|
+
let t = await this.getFileStorageLocation(e), { bucket: n, path: r } = t, { data: i, error: o } = await this.client.from(n).exists(r);
|
|
512
|
+
if (o) throw o;
|
|
513
|
+
if (!i) throw new a(`File not found in bucket '${n}' at path '${r}'`, { ref: t });
|
|
519
514
|
}
|
|
520
515
|
async uploadFile(e, { bucket: t, path: n }, { overwriteExisting: r = !1 } = {}) {
|
|
521
516
|
let { data: i, error: a } = await this.client.from(t).upload(`${n}/${e.name}`, e, { upsert: r });
|
|
522
517
|
if (a) throw a;
|
|
523
518
|
return {
|
|
524
|
-
|
|
519
|
+
id: i.id,
|
|
525
520
|
bucket: t,
|
|
526
521
|
path: i.path
|
|
527
522
|
};
|
|
528
523
|
}
|
|
529
524
|
async downloadFile(e) {
|
|
530
|
-
let {
|
|
525
|
+
let { id: t, bucket: n, path: r, properties: i } = await this.getFileInfo(e), { data: a, error: o } = await this.client.from(n).download(r);
|
|
531
526
|
if (o) throw o;
|
|
532
527
|
let [, s] = u(r);
|
|
533
528
|
return {
|
|
534
|
-
|
|
529
|
+
id: t,
|
|
535
530
|
bucket: n,
|
|
536
531
|
path: r,
|
|
537
532
|
file: new File([a], s, i)
|
|
538
533
|
};
|
|
539
534
|
}
|
|
540
535
|
async deleteFiles(t) {
|
|
541
|
-
let n = t.filter((e) => "
|
|
536
|
+
let n = t.filter((e) => "id" in e).map((e) => e.id), r = (await this.files.query.select(["bucket_id", "path_tokens"]).containedBy("id", n).throwOnError()).data.map(({ bucket_id: t, path_tokens: n }) => ({
|
|
542
537
|
bucket: e.notNull(t, "bucket_id must not be null"),
|
|
543
538
|
path: e.notNull(n, "path_tokens must not be null").join("/")
|
|
544
539
|
})), i = m(f(t.filter((e) => j(e)).concat(r), (e) => e.bucket)).map(([e, t]) => ({
|
|
@@ -548,7 +543,7 @@ var N = class {
|
|
|
548
543
|
return (await Promise.all(i.map(async ({ bucket: t, paths: n }) => this.client.from(t).remove(n).then(({ data: r, error: i }) => {
|
|
549
544
|
if (i) throw i;
|
|
550
545
|
return r.map((r, i) => ({
|
|
551
|
-
|
|
546
|
+
id: e.notNull(r.id, "file id must not be null"),
|
|
552
547
|
bucket: t,
|
|
553
548
|
path: e.defined(n[i], "path must not be null")
|
|
554
549
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-service.d.ts","sourceRoot":"","sources":["../lib/storage-service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA0B,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAIpG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAKrI,MAAM,WAAW,oBAAoB,CACjC,UAAU,SAAS,MAAM,GAAG,MAAM;IAElC,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAClC,QAAQ,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,qBAAa,cAAc,CACvB,UAAU,SAAS,MAAM,GAAG,MAAM;IAElC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4B;IACnD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;gBAE/B,EACR,MAAM,EACN,QAAQ,GACX,EAAE,oBAAoB,CAAC,UAAU,CAAC;IAKnC,OAAO,KAAK,KAAK,GAEhB;YAEa,aAAa;IAWrB,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IAYhF,sBAAsB,CAAC,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;IAuBtF,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,QA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OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;IAuBtF,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAoBxE,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;IAUvF,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAc1D,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB7D,UAAU,CACZ,IAAI,EAAE,IAAI,EACV,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,WAAW,CAAC,UAAU,CAAC,EACzC,EAAE,iBAAyB,EAAE,GAAE,iBAAsB,GACtD,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;IAsBjC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,GAAG;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC;IAoBjG,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC;CA2C7F"}
|
package/dist/storage.d.ts
CHANGED
|
@@ -6,12 +6,12 @@ export declare class StorageClient<BucketName extends string = string> extends S
|
|
|
6
6
|
}
|
|
7
7
|
export type StorageObject = Database['storage']['Tables']['objects']['Row'];
|
|
8
8
|
export interface StorageLocation<BucketName extends string = string> {
|
|
9
|
-
|
|
9
|
+
id: string;
|
|
10
10
|
bucket: BucketName;
|
|
11
11
|
path: string;
|
|
12
12
|
}
|
|
13
13
|
export interface FileID {
|
|
14
|
-
|
|
14
|
+
id: string;
|
|
15
15
|
}
|
|
16
16
|
export interface FilePointer<BucketName extends string = string> {
|
|
17
17
|
bucket: BucketName;
|
|
@@ -21,7 +21,7 @@ export type FileRef<BucketName extends string = string> = (FileID & {
|
|
|
21
21
|
bucket?: never;
|
|
22
22
|
path?: never;
|
|
23
23
|
}) | (FilePointer<BucketName> & {
|
|
24
|
-
|
|
24
|
+
id?: never;
|
|
25
25
|
}) | StorageLocation<BucketName>;
|
|
26
26
|
export interface FileInfo<BucketName extends string = string> extends OmitFrom<Camelize<FileObjectV2>, 'id' | 'bucketId'>, StorageLocation<BucketName> {
|
|
27
27
|
properties: FilePropertyBag;
|
package/dist/storage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../lib/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,MAAM,CAAC,OAAO,OAAO,aAAa,CAAC,UAAU,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,qBAAqB;IAChG,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,UAAU,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;CACtF;AAED,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC;AAE5E,MAAM,WAAW,eAAe,CAAC,UAAU,SAAS,MAAM,GAAG,MAAM;IAC/D,
|
|
1
|
+
{"version":3,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AE,KAAK,CAAA;CAAE,CAAC,GAC1C,eAAe,CAAC,UAAU,CAAC,CAAC;AAElC,MAAM,WAAW,QAAQ,CAAC,UAAU,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC;IAClJ,UAAU,EAAE,eAAe,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAEpD;AAED,wBAAgB,aAAa,CAAC,UAAU,SAAS,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,CAEjH;AAED,wBAAgB,iBAAiB,CAAC,UAAU,SAAS,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,GAAG,IAAI,eAAe,CAAC,UAAU,CAAC,CAEzH"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"private": false,
|
|
4
4
|
"displayName": "Supabase-Core",
|
|
5
5
|
"description": "Lightweight services for supabase to make it easier to work with databases, tables and storage buckets",
|
|
6
|
-
"version": "2.5.
|
|
6
|
+
"version": "2.5.2",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|