@supabase/storage-js 2.12.2 → 2.71.2-canary.1

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.
Files changed (115) hide show
  1. package/README.md +0 -15
  2. package/package.json +11 -17
  3. package/src/index.ts +1 -2
  4. package/src/lib/types.ts +0 -12
  5. package/src/lib/version.ts +2 -2
  6. package/src/packages/StorageBucketApi.ts +3 -36
  7. package/src/packages/StorageFileApi.ts +30 -64
  8. package/LICENSE +0 -201
  9. package/dist/main/StorageClient.d.ts +0 -18
  10. package/dist/main/StorageClient.d.ts.map +0 -1
  11. package/dist/main/StorageClient.js +0 -23
  12. package/dist/main/StorageClient.js.map +0 -1
  13. package/dist/main/index.d.ts +0 -5
  14. package/dist/main/index.d.ts.map +0 -1
  15. package/dist/main/index.js +0 -22
  16. package/dist/main/index.js.map +0 -1
  17. package/dist/main/lib/constants.d.ts +0 -4
  18. package/dist/main/lib/constants.d.ts.map +0 -1
  19. package/dist/main/lib/constants.js +0 -6
  20. package/dist/main/lib/constants.js.map +0 -1
  21. package/dist/main/lib/errors.d.ts +0 -21
  22. package/dist/main/lib/errors.d.ts.map +0 -1
  23. package/dist/main/lib/errors.js +0 -41
  24. package/dist/main/lib/errors.js.map +0 -1
  25. package/dist/main/lib/fetch.d.ts +0 -16
  26. package/dist/main/lib/fetch.d.ts.map +0 -1
  27. package/dist/main/lib/fetch.js +0 -97
  28. package/dist/main/lib/fetch.js.map +0 -1
  29. package/dist/main/lib/helpers.d.ts +0 -12
  30. package/dist/main/lib/helpers.d.ts.map +0 -1
  31. package/dist/main/lib/helpers.js +0 -90
  32. package/dist/main/lib/helpers.js.map +0 -1
  33. package/dist/main/lib/index.d.ts +0 -5
  34. package/dist/main/lib/index.d.ts.map +0 -1
  35. package/dist/main/lib/index.js +0 -21
  36. package/dist/main/lib/index.js.map +0 -1
  37. package/dist/main/lib/types.d.ts +0 -156
  38. package/dist/main/lib/types.d.ts.map +0 -1
  39. package/dist/main/lib/types.js +0 -3
  40. package/dist/main/lib/types.js.map +0 -1
  41. package/dist/main/lib/version.d.ts +0 -2
  42. package/dist/main/lib/version.d.ts.map +0 -1
  43. package/dist/main/lib/version.js +0 -6
  44. package/dist/main/lib/version.js.map +0 -1
  45. package/dist/main/packages/BlobDownloadBuilder.d.ts +0 -11
  46. package/dist/main/packages/BlobDownloadBuilder.d.ts.map +0 -1
  47. package/dist/main/packages/BlobDownloadBuilder.js +0 -50
  48. package/dist/main/packages/BlobDownloadBuilder.js.map +0 -1
  49. package/dist/main/packages/StorageBucketApi.d.ts +0 -123
  50. package/dist/main/packages/StorageBucketApi.d.ts.map +0 -1
  51. package/dist/main/packages/StorageBucketApi.js +0 -204
  52. package/dist/main/packages/StorageBucketApi.js.map +0 -1
  53. package/dist/main/packages/StorageFileApi.d.ts +0 -271
  54. package/dist/main/packages/StorageFileApi.d.ts.map +0 -1
  55. package/dist/main/packages/StorageFileApi.js +0 -593
  56. package/dist/main/packages/StorageFileApi.js.map +0 -1
  57. package/dist/main/packages/StreamDownloadBuilder.d.ts +0 -9
  58. package/dist/main/packages/StreamDownloadBuilder.d.ts.map +0 -1
  59. package/dist/main/packages/StreamDownloadBuilder.js +0 -43
  60. package/dist/main/packages/StreamDownloadBuilder.js.map +0 -1
  61. package/dist/module/StorageClient.d.ts +0 -18
  62. package/dist/module/StorageClient.d.ts.map +0 -1
  63. package/dist/module/StorageClient.js +0 -16
  64. package/dist/module/StorageClient.js.map +0 -1
  65. package/dist/module/index.d.ts +0 -5
  66. package/dist/module/index.d.ts.map +0 -1
  67. package/dist/module/index.js +0 -4
  68. package/dist/module/index.js.map +0 -1
  69. package/dist/module/lib/constants.d.ts +0 -4
  70. package/dist/module/lib/constants.d.ts.map +0 -1
  71. package/dist/module/lib/constants.js +0 -3
  72. package/dist/module/lib/constants.js.map +0 -1
  73. package/dist/module/lib/errors.d.ts +0 -21
  74. package/dist/module/lib/errors.d.ts.map +0 -1
  75. package/dist/module/lib/errors.js +0 -34
  76. package/dist/module/lib/errors.js.map +0 -1
  77. package/dist/module/lib/fetch.d.ts +0 -16
  78. package/dist/module/lib/fetch.d.ts.map +0 -1
  79. package/dist/module/lib/fetch.js +0 -89
  80. package/dist/module/lib/fetch.js.map +0 -1
  81. package/dist/module/lib/helpers.d.ts +0 -12
  82. package/dist/module/lib/helpers.d.ts.map +0 -1
  83. package/dist/module/lib/helpers.js +0 -60
  84. package/dist/module/lib/helpers.js.map +0 -1
  85. package/dist/module/lib/index.d.ts +0 -5
  86. package/dist/module/lib/index.d.ts.map +0 -1
  87. package/dist/module/lib/index.js +0 -5
  88. package/dist/module/lib/index.js.map +0 -1
  89. package/dist/module/lib/types.d.ts +0 -156
  90. package/dist/module/lib/types.d.ts.map +0 -1
  91. package/dist/module/lib/types.js +0 -2
  92. package/dist/module/lib/types.js.map +0 -1
  93. package/dist/module/lib/version.d.ts +0 -2
  94. package/dist/module/lib/version.d.ts.map +0 -1
  95. package/dist/module/lib/version.js +0 -3
  96. package/dist/module/lib/version.js.map +0 -1
  97. package/dist/module/packages/BlobDownloadBuilder.d.ts +0 -11
  98. package/dist/module/packages/BlobDownloadBuilder.d.ts.map +0 -1
  99. package/dist/module/packages/BlobDownloadBuilder.js +0 -44
  100. package/dist/module/packages/BlobDownloadBuilder.js.map +0 -1
  101. package/dist/module/packages/StorageBucketApi.d.ts +0 -123
  102. package/dist/module/packages/StorageBucketApi.d.ts.map +0 -1
  103. package/dist/module/packages/StorageBucketApi.js +0 -201
  104. package/dist/module/packages/StorageBucketApi.js.map +0 -1
  105. package/dist/module/packages/StorageFileApi.d.ts +0 -271
  106. package/dist/module/packages/StorageFileApi.d.ts.map +0 -1
  107. package/dist/module/packages/StorageFileApi.js +0 -587
  108. package/dist/module/packages/StorageFileApi.js.map +0 -1
  109. package/dist/module/packages/StreamDownloadBuilder.d.ts +0 -9
  110. package/dist/module/packages/StreamDownloadBuilder.d.ts.map +0 -1
  111. package/dist/module/packages/StreamDownloadBuilder.js +0 -40
  112. package/dist/module/packages/StreamDownloadBuilder.js.map +0 -1
  113. package/dist/umd/supabase.js +0 -1
  114. package/src/packages/BlobDownloadBuilder.ts +0 -39
  115. package/src/packages/StreamDownloadBuilder.ts +0 -36
@@ -1,18 +0,0 @@
1
- import StorageFileApi from './packages/StorageFileApi';
2
- import StorageBucketApi from './packages/StorageBucketApi';
3
- import { Fetch } from './lib/fetch';
4
- export interface StorageClientOptions {
5
- useNewHostname?: boolean;
6
- }
7
- export declare class StorageClient extends StorageBucketApi {
8
- constructor(url: string, headers?: {
9
- [key: string]: string;
10
- }, fetch?: Fetch, opts?: StorageClientOptions);
11
- /**
12
- * Perform file operation in a bucket.
13
- *
14
- * @param id The bucket id to operate on.
15
- */
16
- from(id: string): StorageFileApi;
17
- }
18
- //# sourceMappingURL=StorageClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StorageClient.d.ts","sourceRoot":"","sources":["../../src/StorageClient.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,2BAA2B,CAAA;AACtD,OAAO,gBAAgB,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnC,MAAM,WAAW,oBAAoB;IACnC,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,qBAAa,aAAc,SAAQ,gBAAgB;gBAE/C,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAO,EACvC,KAAK,CAAC,EAAE,KAAK,EACb,IAAI,CAAC,EAAE,oBAAoB;IAK7B;;;;OAIG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc;CAGjC"}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.StorageClient = void 0;
7
- const StorageFileApi_1 = __importDefault(require("./packages/StorageFileApi"));
8
- const StorageBucketApi_1 = __importDefault(require("./packages/StorageBucketApi"));
9
- class StorageClient extends StorageBucketApi_1.default {
10
- constructor(url, headers = {}, fetch, opts) {
11
- super(url, headers, fetch, opts);
12
- }
13
- /**
14
- * Perform file operation in a bucket.
15
- *
16
- * @param id The bucket id to operate on.
17
- */
18
- from(id) {
19
- return new StorageFileApi_1.default(this.url, this.headers, id, this.fetch);
20
- }
21
- }
22
- exports.StorageClient = StorageClient;
23
- //# sourceMappingURL=StorageClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../src/StorageClient.ts"],"names":[],"mappings":";;;;;;AAAA,+EAAsD;AACtD,mFAA0D;AAO1D,MAAa,aAAc,SAAQ,0BAAgB;IACjD,YACE,GAAW,EACX,UAAqC,EAAE,EACvC,KAAa,EACb,IAA2B;QAE3B,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAC,EAAU;QACb,OAAO,IAAI,wBAAc,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IACnE,CAAC;CACF;AAlBD,sCAkBC"}
@@ -1,5 +0,0 @@
1
- export { StorageClient } from './StorageClient';
2
- export type { StorageClientOptions } from './StorageClient';
3
- export * from './lib/types';
4
- export * from './lib/errors';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.StorageClient = void 0;
18
- var StorageClient_1 = require("./StorageClient");
19
- Object.defineProperty(exports, "StorageClient", { enumerable: true, get: function () { return StorageClient_1.StorageClient; } });
20
- __exportStar(require("./lib/types"), exports);
21
- __exportStar(require("./lib/errors"), exports);
22
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AAEtB,8CAA2B;AAC3B,+CAA4B"}
@@ -1,4 +0,0 @@
1
- export declare const DEFAULT_HEADERS: {
2
- 'X-Client-Info': string;
3
- };
4
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe;;CAA+C,CAAA"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_HEADERS = void 0;
4
- const version_1 = require("./version");
5
- exports.DEFAULT_HEADERS = { 'X-Client-Info': `storage-js/${version_1.version}` };
6
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/lib/constants.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACtB,QAAA,eAAe,GAAG,EAAE,eAAe,EAAE,cAAc,iBAAO,EAAE,EAAE,CAAA"}
@@ -1,21 +0,0 @@
1
- export declare class StorageError extends Error {
2
- protected __isStorageError: boolean;
3
- constructor(message: string);
4
- }
5
- export declare function isStorageError(error: unknown): error is StorageError;
6
- export declare class StorageApiError extends StorageError {
7
- status: number;
8
- statusCode: string;
9
- constructor(message: string, status: number, statusCode: string);
10
- toJSON(): {
11
- name: string;
12
- message: string;
13
- status: number;
14
- statusCode: string;
15
- };
16
- }
17
- export declare class StorageUnknownError extends StorageError {
18
- originalError: unknown;
19
- constructor(message: string, originalError: unknown);
20
- }
21
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/lib/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;IACrC,SAAS,CAAC,gBAAgB,UAAO;gBAErB,OAAO,EAAE,MAAM;CAI5B;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE;AAED,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;gBAEN,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAO/D,MAAM;;;;;;CAQP;AAED,qBAAa,mBAAoB,SAAQ,YAAY;IACnD,aAAa,EAAE,OAAO,CAAA;gBAEV,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO;CAKpD"}
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StorageUnknownError = exports.StorageApiError = exports.isStorageError = exports.StorageError = void 0;
4
- class StorageError extends Error {
5
- constructor(message) {
6
- super(message);
7
- this.__isStorageError = true;
8
- this.name = 'StorageError';
9
- }
10
- }
11
- exports.StorageError = StorageError;
12
- function isStorageError(error) {
13
- return typeof error === 'object' && error !== null && '__isStorageError' in error;
14
- }
15
- exports.isStorageError = isStorageError;
16
- class StorageApiError extends StorageError {
17
- constructor(message, status, statusCode) {
18
- super(message);
19
- this.name = 'StorageApiError';
20
- this.status = status;
21
- this.statusCode = statusCode;
22
- }
23
- toJSON() {
24
- return {
25
- name: this.name,
26
- message: this.message,
27
- status: this.status,
28
- statusCode: this.statusCode,
29
- };
30
- }
31
- }
32
- exports.StorageApiError = StorageApiError;
33
- class StorageUnknownError extends StorageError {
34
- constructor(message, originalError) {
35
- super(message);
36
- this.name = 'StorageUnknownError';
37
- this.originalError = originalError;
38
- }
39
- }
40
- exports.StorageUnknownError = StorageUnknownError;
41
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/lib/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAa,SAAQ,KAAK;IAGrC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QAHN,qBAAgB,GAAG,IAAI,CAAA;QAI/B,IAAI,CAAC,IAAI,GAAG,cAAc,CAAA;IAC5B,CAAC;CACF;AAPD,oCAOC;AAED,SAAgB,cAAc,CAAC,KAAc;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,kBAAkB,IAAI,KAAK,CAAA;AACnF,CAAC;AAFD,wCAEC;AAED,MAAa,eAAgB,SAAQ,YAAY;IAI/C,YAAY,OAAe,EAAE,MAAc,EAAE,UAAkB;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAA;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;IAED,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAA;IACH,CAAC;CACF;AAnBD,0CAmBC;AAED,MAAa,mBAAoB,SAAQ,YAAY;IAGnD,YAAY,OAAe,EAAE,aAAsB;QACjD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAA;QACjC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;IACpC,CAAC;CACF;AARD,kDAQC"}
@@ -1,16 +0,0 @@
1
- import { FetchParameters } from './types';
2
- export declare type Fetch = typeof fetch;
3
- export interface FetchOptions {
4
- headers?: {
5
- [key: string]: string;
6
- };
7
- duplex?: string;
8
- noResolveJson?: boolean;
9
- }
10
- export declare type RequestMethodType = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD';
11
- export declare function get(fetcher: Fetch, url: string, options?: FetchOptions, parameters?: FetchParameters): Promise<any>;
12
- export declare function post(fetcher: Fetch, url: string, body: object, options?: FetchOptions, parameters?: FetchParameters): Promise<any>;
13
- export declare function put(fetcher: Fetch, url: string, body: object, options?: FetchOptions, parameters?: FetchParameters): Promise<any>;
14
- export declare function head(fetcher: Fetch, url: string, options?: FetchOptions, parameters?: FetchParameters): Promise<any>;
15
- export declare function remove(fetcher: Fetch, url: string, body: object, options?: FetchOptions, parameters?: FetchParameters): Promise<any>;
16
- //# sourceMappingURL=fetch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/lib/fetch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC,oBAAY,KAAK,GAAG,OAAO,KAAK,CAAA;AAEhC,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ator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.remove = exports.head = exports.put = exports.post = exports.get = void 0;
13
- const errors_1 = require("./errors");
14
- const helpers_1 = require("./helpers");
15
- const _getErrorMessage = (err) => err.msg || err.message || err.error_description || err.error || JSON.stringify(err);
16
- const handleError = (error, reject, options) => __awaiter(void 0, void 0, void 0, function* () {
17
- const Res = yield (0, helpers_1.resolveResponse)();
18
- if (error instanceof Res && !(options === null || options === void 0 ? void 0 : options.noResolveJson)) {
19
- error
20
- .json()
21
- .then((err) => {
22
- const status = error.status || 500;
23
- const statusCode = (err === null || err === void 0 ? void 0 : err.statusCode) || status + '';
24
- reject(new errors_1.StorageApiError(_getErrorMessage(err), status, statusCode));
25
- })
26
- .catch((err) => {
27
- reject(new errors_1.StorageUnknownError(_getErrorMessage(err), err));
28
- });
29
- }
30
- else {
31
- reject(new errors_1.StorageUnknownError(_getErrorMessage(error), error));
32
- }
33
- });
34
- const _getRequestParams = (method, options, parameters, body) => {
35
- const params = { method, headers: (options === null || options === void 0 ? void 0 : options.headers) || {} };
36
- if (method === 'GET' || !body) {
37
- return params;
38
- }
39
- if ((0, helpers_1.isPlainObject)(body)) {
40
- params.headers = Object.assign({ 'Content-Type': 'application/json' }, options === null || options === void 0 ? void 0 : options.headers);
41
- params.body = JSON.stringify(body);
42
- }
43
- else {
44
- params.body = body;
45
- }
46
- if (options === null || options === void 0 ? void 0 : options.duplex) {
47
- params.duplex = options.duplex;
48
- }
49
- return Object.assign(Object.assign({}, params), parameters);
50
- };
51
- function _handleRequest(fetcher, method, url, options, parameters, body) {
52
- return __awaiter(this, void 0, void 0, function* () {
53
- return new Promise((resolve, reject) => {
54
- fetcher(url, _getRequestParams(method, options, parameters, body))
55
- .then((result) => {
56
- if (!result.ok)
57
- throw result;
58
- if (options === null || options === void 0 ? void 0 : options.noResolveJson)
59
- return result;
60
- return result.json();
61
- })
62
- .then((data) => resolve(data))
63
- .catch((error) => handleError(error, reject, options));
64
- });
65
- });
66
- }
67
- function get(fetcher, url, options, parameters) {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- return _handleRequest(fetcher, 'GET', url, options, parameters);
70
- });
71
- }
72
- exports.get = get;
73
- function post(fetcher, url, body, options, parameters) {
74
- return __awaiter(this, void 0, void 0, function* () {
75
- return _handleRequest(fetcher, 'POST', url, options, parameters, body);
76
- });
77
- }
78
- exports.post = post;
79
- function put(fetcher, url, body, options, parameters) {
80
- return __awaiter(this, void 0, void 0, function* () {
81
- return _handleRequest(fetcher, 'PUT', url, options, parameters, body);
82
- });
83
- }
84
- exports.put = put;
85
- function head(fetcher, url, options, parameters) {
86
- return __awaiter(this, void 0, void 0, function* () {
87
- return _handleRequest(fetcher, 'HEAD', url, Object.assign(Object.assign({}, options), { noResolveJson: true }), parameters);
88
- });
89
- }
90
- exports.head = head;
91
- function remove(fetcher, url, body, options, parameters) {
92
- return __awaiter(this, void 0, void 0, function* () {
93
- return _handleRequest(fetcher, 'DELETE', url, options, parameters, body);
94
- });
95
- }
96
- exports.remove = remove;
97
- //# sourceMappingURL=fetch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/lib/fetch.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+D;AAC/D,uCAA0D;AAe1D,MAAM,gBAAgB,GAAG,CAAC,GAAQ,EAAU,EAAE,CAC5C,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,iBAAiB,IAAI,GAAG,CAAC,KA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G,CACvB,OAAc,EACd,GAAW,EACX,OAAsB,EACtB,UAA4B;;QAE5B,OAAO,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,CAAC,CAAA;IACjE,CAAC;CAAA;AAPD,kBAOC;AAED,SAAsB,IAAI,CACxB,OAAc,EACd,GAAW,EACX,IAAY,EACZ,OAAsB,EACtB,UAA4B;;QAE5B,OAAO,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,CAAA;IACxE,CAAC;CAAA;AARD,oBAQC;AAED,SAAsB,GAAG,CACvB,OAAc,EACd,GAAW,EACX,IAAY,EACZ,OAAsB,EACtB,UAA4B;;QAE5B,OAAO,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,CAAA;IACvE,CAAC;CAAA;AARD,kBAQC;AAED,SAAsB,IAAI,CACxB,OAAc,EACd,GAAW,EACX,OAAsB,EACtB,UAA4B;;QAE5B,OAAO,cAAc,CACnB,OAAO,EACP,MAAM,EACN,GAAG,kCAEE,OAAO,KACV,aAAa,EAAE,IAAI,KAErB,UAAU,CACX,CAAA;IACH,CAAC;CAAA;AAhBD,oBAgBC;AAED,SAAsB,MAAM,CAC1B,OAAc,EACd,GAAW,EACX,IAAY,EACZ,OAAsB,EACtB,UAA4B;;QAE5B,OAAO,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,CAAA;IAC1E,CAAC;CAAA;AARD,wBAQC"}
@@ -1,12 +0,0 @@
1
- declare type Fetch = typeof fetch;
2
- export declare const resolveFetch: (customFetch?: typeof fetch | undefined) => Fetch;
3
- export declare const resolveResponse: () => Promise<typeof Response>;
4
- export declare const recursiveToCamel: (item: Record<string, any>) => unknown;
5
- /**
6
- * Determine if input is a plain object
7
- * An object is plain if it's created by either {}, new Object(), or Object.create(null)
8
- * source: https://github.com/sindresorhus/is-plain-obj
9
- */
10
- export declare const isPlainObject: (value: object) => boolean;
11
- export {};
12
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/helpers.ts"],"names":[],"mappings":"AAAA,aAAK,KAAK,GAAG,OAAO,KAAK,CAAA;AAEzB,eAAO,MAAM,YAAY,8CAA0B,KAWlD,CAAA;AAED,eAAO,MAAM,eAAe,QAAa,QAAQ,eAAe,CAO/D,CAAA;AAED,eAAO,MAAM,gBAAgB,SAAU,OAAO,MAAM,EAAE,GAAG,CAAC,KAAG,OAc5D,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,UAAW,MAAM,KAAG,OAa7C,CAAA"}
@@ -1,90 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.isPlainObject = exports.recursiveToCamel = exports.resolveResponse = exports.resolveFetch = void 0;
36
- const resolveFetch = (customFetch) => {
37
- let _fetch;
38
- if (customFetch) {
39
- _fetch = customFetch;
40
- }
41
- else if (typeof fetch === 'undefined') {
42
- _fetch = (...args) => Promise.resolve().then(() => __importStar(require('@supabase/node-fetch'))).then(({ default: fetch }) => fetch(...args));
43
- }
44
- else {
45
- _fetch = fetch;
46
- }
47
- return (...args) => _fetch(...args);
48
- };
49
- exports.resolveFetch = resolveFetch;
50
- const resolveResponse = () => __awaiter(void 0, void 0, void 0, function* () {
51
- if (typeof Response === 'undefined') {
52
- // @ts-ignore
53
- return (yield Promise.resolve().then(() => __importStar(require('@supabase/node-fetch')))).Response;
54
- }
55
- return Response;
56
- });
57
- exports.resolveResponse = resolveResponse;
58
- const recursiveToCamel = (item) => {
59
- if (Array.isArray(item)) {
60
- return item.map((el) => (0, exports.recursiveToCamel)(el));
61
- }
62
- else if (typeof item === 'function' || item !== Object(item)) {
63
- return item;
64
- }
65
- const result = {};
66
- Object.entries(item).forEach(([key, value]) => {
67
- const newKey = key.replace(/([-_][a-z])/gi, (c) => c.toUpperCase().replace(/[-_]/g, ''));
68
- result[newKey] = (0, exports.recursiveToCamel)(value);
69
- });
70
- return result;
71
- };
72
- exports.recursiveToCamel = recursiveToCamel;
73
- /**
74
- * Determine if input is a plain object
75
- * An object is plain if it's created by either {}, new Object(), or Object.create(null)
76
- * source: https://github.com/sindresorhus/is-plain-obj
77
- */
78
- const isPlainObject = (value) => {
79
- if (typeof value !== 'object' || value === null) {
80
- return false;
81
- }
82
- const prototype = Object.getPrototypeOf(value);
83
- return ((prototype === null ||
84
- prototype === Object.prototype ||
85
- Object.getPrototypeOf(prototype) === null) &&
86
- !(Symbol.toStringTag in value) &&
87
- !(Symbol.iterator in value));
88
- };
89
- exports.isPlainObject = isPlainObject;
90
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/lib/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,YAAY,GAAG,CAAC,WAAmB,EAAS,EAAE;IACzD,IAAI,MAAa,CAAA;IACjB,IAAI,WAAW,EAAE;QACf,MAAM,GAAG,WAAW,CAAA;KACrB;SAAM,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;QACvC,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,CACnB,kDAAO,sBAA6B,IAAE,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;KACrF;SAAM;QACL,MAAM,GAAG,KAAK,CAAA;KACf;IACD,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA;AAXY,QAAA,YAAY,gBAWxB;AAEM,MAAM,eAAe,GAAG,GAAmC,EAAE;IAClE,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;QACnC,aAAa;QACb,OAAO,CAAC,wDAAa,sBAA6B,GAAC,CAAC,CAAC,QAAQ,CAAA;KAC9D;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA,CAAA;AAPY,QAAA,eAAe,mBAO3B;AAEM,MAAM,gBAAgB,GAAG,CAAC,IAAyB,EAAW,EAAE;IACrE,IAAI,KAAK,CAAC,OAAO,CAAC,I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,CAAA;AAbY,QAAA,aAAa,iBAazB"}
@@ -1,5 +0,0 @@
1
- export * from '../packages/StorageBucketApi';
2
- export * from '../packages/StorageFileApi';
3
- export * from './types';
4
- export * from './constants';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("../packages/StorageBucketApi"), exports);
18
- __exportStar(require("../packages/StorageFileApi"), exports);
19
- __exportStar(require("./types"), exports);
20
- __exportStar(require("./constants"), exports);
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA4C;AAC5C,6DAA0C;AAC1C,0CAAuB;AACvB,8CAA2B"}
@@ -1,156 +0,0 @@
1
- import { StorageError } from './errors';
2
- export declare type BucketType = 'STANDARD' | 'ANALYTICS';
3
- export interface Bucket {
4
- id: string;
5
- type?: BucketType;
6
- name: string;
7
- owner: string;
8
- file_size_limit?: number;
9
- allowed_mime_types?: string[];
10
- created_at: string;
11
- updated_at: string;
12
- public: boolean;
13
- }
14
- export interface FileObject {
15
- name: string;
16
- bucket_id: string;
17
- owner: string;
18
- id: string;
19
- updated_at: string;
20
- created_at: string;
21
- last_accessed_at: string;
22
- metadata: Record<string, any>;
23
- buckets: Bucket;
24
- }
25
- export interface FileObjectV2 {
26
- id: string;
27
- version: string;
28
- name: string;
29
- bucket_id: string;
30
- updated_at: string;
31
- created_at: string;
32
- last_accessed_at: string;
33
- size?: number;
34
- cache_control?: string;
35
- content_type?: string;
36
- etag?: string;
37
- last_modified?: string;
38
- metadata?: Record<string, any>;
39
- }
40
- export interface SortBy {
41
- column?: string;
42
- order?: string;
43
- }
44
- export interface FileOptions {
45
- /**
46
- * The number of seconds the asset is cached in the browser and in the Supabase CDN. This is set in the `Cache-Control: max-age=<seconds>` header. Defaults to 3600 seconds.
47
- */
48
- cacheControl?: string;
49
- /**
50
- * the `Content-Type` header value. Should be specified if using a `fileBody` that is neither `Blob` nor `File` nor `FormData`, otherwise will default to `text/plain;charset=UTF-8`.
51
- */
52
- contentType?: string;
53
- /**
54
- * When upsert is set to true, the file is overwritten if it exists. When set to false, an error is thrown if the object already exists. Defaults to false.
55
- */
56
- upsert?: boolean;
57
- /**
58
- * The duplex option is a string parameter that enables or disables duplex streaming, allowing for both reading and writing data in the same stream. It can be passed as an option to the fetch() method.
59
- */
60
- duplex?: string;
61
- /**
62
- * The metadata option is an object that allows you to store additional information about the file. This information can be used to filter and search for files. The metadata object can contain any key-value pairs you want to store.
63
- */
64
- metadata?: Record<string, any>;
65
- /**
66
- * Optionally add extra headers
67
- */
68
- headers?: Record<string, string>;
69
- }
70
- export interface DestinationOptions {
71
- destinationBucket?: string;
72
- }
73
- export interface SearchOptions {
74
- /**
75
- * The number of files you want to be returned.
76
- * @default 100
77
- */
78
- limit?: number;
79
- /**
80
- * The starting position.
81
- */
82
- offset?: number;
83
- /**
84
- * The column to sort by. Can be any column inside a FileObject.
85
- */
86
- sortBy?: SortBy;
87
- /**
88
- * The search string to filter files by.
89
- */
90
- search?: string;
91
- }
92
- export interface SearchV2Options {
93
- limit?: number;
94
- prefix?: string;
95
- cursor?: string;
96
- with_delimiter?: boolean;
97
- }
98
- export interface SearchV2Result {
99
- hasNext: boolean;
100
- folders: {
101
- name: string;
102
- }[];
103
- objects: FileObject[];
104
- }
105
- export interface FetchParameters {
106
- /**
107
- * Pass in an AbortController's signal to cancel the request.
108
- */
109
- signal?: AbortSignal;
110
- }
111
- export interface Metadata {
112
- name: string;
113
- }
114
- export interface TransformOptions {
115
- /**
116
- * The width of the image in pixels.
117
- */
118
- width?: number;
119
- /**
120
- * The height of the image in pixels.
121
- */
122
- height?: number;
123
- /**
124
- * The resize mode can be cover, contain or fill. Defaults to cover.
125
- * Cover resizes the image to maintain it's aspect ratio while filling the entire width and height.
126
- * Contain resizes the image to maintain it's aspect ratio while fitting the entire image within the width and height.
127
- * Fill resizes the image to fill the entire width and height. If the object's aspect ratio does not match the width and height, the image will be stretched to fit.
128
- */
129
- resize?: 'cover' | 'contain' | 'fill';
130
- /**
131
- * Set the quality of the returned image.
132
- * A number from 20 to 100, with 100 being the highest quality.
133
- * Defaults to 80
134
- */
135
- quality?: number;
136
- /**
137
- * Specify the format of the image requested.
138
- *
139
- * When using 'origin' we force the format to be the same as the original image.
140
- * When this option is not passed in, images are optimized to modern image formats like Webp.
141
- */
142
- format?: 'origin';
143
- }
144
- declare type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}` ? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}` : S;
145
- export declare type Camelize<T> = {
146
- [K in keyof T as CamelCase<Extract<K, string>>]: T[K];
147
- };
148
- export declare type DownloadResult<T> = {
149
- data: T;
150
- error: null;
151
- } | {
152
- data: null;
153
- error: StorageError;
154
- };
155
- export {};
156
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0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G;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAGD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;IACrC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAA;CAClB;AAED,aAAK,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,EAAE,IAAI,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE,GAC7E,GAAG,SAAS,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE,GAClD,CAAC,CAAA;AAEL,oBAAY,QAAQ,CAAC,CAAC,IAAI;KACvB,CAAC,IAAI,MAAM,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACtD,CAAA;AAED,oBAAY,cAAc,CAAC,CAAC,IACxB;IACE,IAAI,EAAE,CAAC,CAAA;IACP,KAAK,EAAE,IAAI,CAAA;CACZ,GACD;IACE,IAAI,EAAE,IAAI,CAAA;IACV,KAAK,EAAE,YAAY,CAAA;CACpB,CAAA"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export declare const version = "2.12.2";
2
- //# sourceMappingURL=version.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/lib/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,UAAU,CAAA"}