@supabase/storage-js 2.79.1-canary.1 → 2.80.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.
Files changed (197) hide show
  1. package/README.md +920 -12
  2. package/dist/main/StorageClient.d.ts +28 -0
  3. package/dist/main/StorageClient.d.ts.map +1 -1
  4. package/dist/main/StorageClient.js +38 -5
  5. package/dist/main/StorageClient.js.map +1 -1
  6. package/dist/main/index.d.ts +2 -0
  7. package/dist/main/index.d.ts.map +1 -1
  8. package/dist/main/index.js +7 -17
  9. package/dist/main/index.js.map +1 -1
  10. package/dist/main/lib/constants.d.ts.map +1 -1
  11. package/dist/main/lib/constants.js +3 -1
  12. package/dist/main/lib/constants.js.map +1 -1
  13. package/dist/main/lib/fetch.d.ts.map +1 -1
  14. package/dist/main/lib/fetch.js +16 -17
  15. package/dist/main/lib/fetch.js.map +1 -1
  16. package/dist/main/lib/helpers.d.ts +1 -1
  17. package/dist/main/lib/helpers.d.ts.map +1 -1
  18. package/dist/main/lib/helpers.js +4 -57
  19. package/dist/main/lib/helpers.js.map +1 -1
  20. package/dist/main/lib/index.d.ts +1 -0
  21. package/dist/main/lib/index.d.ts.map +1 -1
  22. package/dist/main/lib/index.js +6 -18
  23. package/dist/main/lib/index.js.map +1 -1
  24. package/dist/main/lib/types.d.ts +74 -4
  25. package/dist/main/lib/types.d.ts.map +1 -1
  26. package/dist/main/lib/vectors/StorageVectorsClient.d.ts +310 -0
  27. package/dist/main/lib/vectors/StorageVectorsClient.d.ts.map +1 -0
  28. package/dist/main/lib/vectors/StorageVectorsClient.js +366 -0
  29. package/dist/main/lib/vectors/StorageVectorsClient.js.map +1 -0
  30. package/dist/main/lib/vectors/VectorBucketApi.d.ts +129 -0
  31. package/dist/main/lib/vectors/VectorBucketApi.d.ts.map +1 -0
  32. package/dist/main/lib/vectors/VectorBucketApi.js +199 -0
  33. package/dist/main/lib/vectors/VectorBucketApi.js.map +1 -0
  34. package/dist/main/lib/vectors/VectorDataApi.d.ts +221 -0
  35. package/dist/main/lib/vectors/VectorDataApi.d.ts.map +1 -0
  36. package/dist/main/lib/vectors/VectorDataApi.js +336 -0
  37. package/dist/main/lib/vectors/VectorDataApi.js.map +1 -0
  38. package/dist/main/lib/vectors/VectorIndexApi.d.ts +157 -0
  39. package/dist/main/lib/vectors/VectorIndexApi.d.ts.map +1 -0
  40. package/dist/main/lib/vectors/VectorIndexApi.js +218 -0
  41. package/dist/main/lib/vectors/VectorIndexApi.js.map +1 -0
  42. package/dist/main/lib/vectors/constants.d.ts +5 -0
  43. package/dist/main/lib/vectors/constants.d.ts.map +1 -0
  44. package/dist/main/lib/vectors/constants.js +9 -0
  45. package/dist/main/lib/vectors/constants.js.map +1 -0
  46. package/dist/main/lib/vectors/errors.d.ts +55 -0
  47. package/dist/main/lib/vectors/errors.d.ts.map +1 -0
  48. package/dist/main/lib/vectors/errors.js +76 -0
  49. package/dist/main/lib/vectors/errors.js.map +1 -0
  50. package/dist/main/lib/vectors/fetch.d.ts +57 -0
  51. package/dist/main/lib/vectors/fetch.d.ts.map +1 -0
  52. package/dist/main/lib/vectors/fetch.js +167 -0
  53. package/dist/main/lib/vectors/fetch.js.map +1 -0
  54. package/dist/main/lib/vectors/helpers.d.ts +46 -0
  55. package/dist/main/lib/vectors/helpers.d.ts.map +1 -0
  56. package/dist/main/lib/vectors/helpers.js +74 -0
  57. package/dist/main/lib/vectors/helpers.js.map +1 -0
  58. package/dist/main/lib/vectors/index.d.ts +11 -0
  59. package/dist/main/lib/vectors/index.d.ts.map +1 -0
  60. package/dist/main/lib/vectors/index.js +31 -0
  61. package/dist/main/lib/vectors/index.js.map +1 -0
  62. package/dist/main/lib/vectors/types.d.ts +277 -0
  63. package/dist/main/lib/vectors/types.d.ts.map +1 -0
  64. package/dist/main/lib/vectors/types.js +3 -0
  65. package/dist/main/lib/vectors/types.js.map +1 -0
  66. package/dist/main/lib/version.d.ts +1 -1
  67. package/dist/main/lib/version.d.ts.map +1 -1
  68. package/dist/main/lib/version.js +1 -1
  69. package/dist/main/lib/version.js.map +1 -1
  70. package/dist/main/packages/BlobDownloadBuilder.d.ts +6 -1
  71. package/dist/main/packages/BlobDownloadBuilder.d.ts.map +1 -1
  72. package/dist/main/packages/BlobDownloadBuilder.js +20 -15
  73. package/dist/main/packages/BlobDownloadBuilder.js.map +1 -1
  74. package/dist/main/packages/StorageAnalyticsApi.d.ts +123 -0
  75. package/dist/main/packages/StorageAnalyticsApi.d.ts.map +1 -0
  76. package/dist/main/packages/StorageAnalyticsApi.js +164 -0
  77. package/dist/main/packages/StorageAnalyticsApi.js.map +1 -0
  78. package/dist/main/packages/StorageBucketApi.d.ts +3 -2
  79. package/dist/main/packages/StorageBucketApi.d.ts.map +1 -1
  80. package/dist/main/packages/StorageBucketApi.js +34 -18
  81. package/dist/main/packages/StorageBucketApi.js.map +1 -1
  82. package/dist/main/packages/StorageFileApi.d.ts.map +1 -1
  83. package/dist/main/packages/StorageFileApi.js +28 -29
  84. package/dist/main/packages/StorageFileApi.js.map +1 -1
  85. package/dist/main/packages/StreamDownloadBuilder.js +2 -10
  86. package/dist/main/packages/StreamDownloadBuilder.js.map +1 -1
  87. package/dist/module/StorageClient.d.ts +28 -0
  88. package/dist/module/StorageClient.d.ts.map +1 -1
  89. package/dist/module/StorageClient.js +35 -0
  90. package/dist/module/StorageClient.js.map +1 -1
  91. package/dist/module/index.d.ts +2 -0
  92. package/dist/module/index.d.ts.map +1 -1
  93. package/dist/module/index.js +2 -0
  94. package/dist/module/index.js.map +1 -1
  95. package/dist/module/lib/constants.d.ts.map +1 -1
  96. package/dist/module/lib/constants.js +3 -1
  97. package/dist/module/lib/constants.js.map +1 -1
  98. package/dist/module/lib/fetch.d.ts.map +1 -1
  99. package/dist/module/lib/fetch.js +9 -10
  100. package/dist/module/lib/fetch.js.map +1 -1
  101. package/dist/module/lib/helpers.d.ts +1 -1
  102. package/dist/module/lib/helpers.d.ts.map +1 -1
  103. package/dist/module/lib/helpers.js +4 -24
  104. package/dist/module/lib/helpers.js.map +1 -1
  105. package/dist/module/lib/index.d.ts +1 -0
  106. package/dist/module/lib/index.d.ts.map +1 -1
  107. package/dist/module/lib/index.js +1 -0
  108. package/dist/module/lib/index.js.map +1 -1
  109. package/dist/module/lib/types.d.ts +74 -4
  110. package/dist/module/lib/types.d.ts.map +1 -1
  111. package/dist/module/lib/vectors/StorageVectorsClient.d.ts +310 -0
  112. package/dist/module/lib/vectors/StorageVectorsClient.d.ts.map +1 -0
  113. package/dist/module/lib/vectors/StorageVectorsClient.js +360 -0
  114. package/dist/module/lib/vectors/StorageVectorsClient.js.map +1 -0
  115. package/dist/module/lib/vectors/VectorBucketApi.d.ts +129 -0
  116. package/dist/module/lib/vectors/VectorBucketApi.d.ts.map +1 -0
  117. package/dist/module/lib/vectors/VectorBucketApi.js +196 -0
  118. package/dist/module/lib/vectors/VectorBucketApi.js.map +1 -0
  119. package/dist/module/lib/vectors/VectorDataApi.d.ts +221 -0
  120. package/dist/module/lib/vectors/VectorDataApi.d.ts.map +1 -0
  121. package/dist/module/lib/vectors/VectorDataApi.js +333 -0
  122. package/dist/module/lib/vectors/VectorDataApi.js.map +1 -0
  123. package/dist/module/lib/vectors/VectorIndexApi.d.ts +157 -0
  124. package/dist/module/lib/vectors/VectorIndexApi.d.ts.map +1 -0
  125. package/dist/module/lib/vectors/VectorIndexApi.js +215 -0
  126. package/dist/module/lib/vectors/VectorIndexApi.js.map +1 -0
  127. package/dist/module/lib/vectors/constants.d.ts +5 -0
  128. package/dist/module/lib/vectors/constants.d.ts.map +1 -0
  129. package/dist/module/lib/vectors/constants.js +6 -0
  130. package/dist/module/lib/vectors/constants.js.map +1 -0
  131. package/dist/module/lib/vectors/errors.d.ts +55 -0
  132. package/dist/module/lib/vectors/errors.d.ts.map +1 -0
  133. package/dist/module/lib/vectors/errors.js +69 -0
  134. package/dist/module/lib/vectors/errors.js.map +1 -0
  135. package/dist/module/lib/vectors/fetch.d.ts +57 -0
  136. package/dist/module/lib/vectors/fetch.d.ts.map +1 -0
  137. package/dist/module/lib/vectors/fetch.js +161 -0
  138. package/dist/module/lib/vectors/fetch.js.map +1 -0
  139. package/dist/module/lib/vectors/helpers.d.ts +46 -0
  140. package/dist/module/lib/vectors/helpers.d.ts.map +1 -0
  141. package/dist/module/lib/vectors/helpers.js +66 -0
  142. package/dist/module/lib/vectors/helpers.js.map +1 -0
  143. package/dist/module/lib/vectors/index.d.ts +11 -0
  144. package/dist/module/lib/vectors/index.d.ts.map +1 -0
  145. package/dist/module/lib/vectors/index.js +11 -0
  146. package/dist/module/lib/vectors/index.js.map +1 -0
  147. package/dist/module/lib/vectors/types.d.ts +277 -0
  148. package/dist/module/lib/vectors/types.d.ts.map +1 -0
  149. package/dist/module/lib/vectors/types.js +2 -0
  150. package/dist/module/lib/vectors/types.js.map +1 -0
  151. package/dist/module/lib/version.d.ts +1 -1
  152. package/dist/module/lib/version.d.ts.map +1 -1
  153. package/dist/module/lib/version.js +1 -1
  154. package/dist/module/lib/version.js.map +1 -1
  155. package/dist/module/packages/BlobDownloadBuilder.d.ts +6 -1
  156. package/dist/module/packages/BlobDownloadBuilder.d.ts.map +1 -1
  157. package/dist/module/packages/BlobDownloadBuilder.js +20 -11
  158. package/dist/module/packages/BlobDownloadBuilder.js.map +1 -1
  159. package/dist/module/packages/StorageAnalyticsApi.d.ts +123 -0
  160. package/dist/module/packages/StorageAnalyticsApi.d.ts.map +1 -0
  161. package/dist/module/packages/StorageAnalyticsApi.js +161 -0
  162. package/dist/module/packages/StorageAnalyticsApi.js.map +1 -0
  163. package/dist/module/packages/StorageBucketApi.d.ts +3 -2
  164. package/dist/module/packages/StorageBucketApi.d.ts.map +1 -1
  165. package/dist/module/packages/StorageBucketApi.js +28 -12
  166. package/dist/module/packages/StorageBucketApi.js.map +1 -1
  167. package/dist/module/packages/StorageFileApi.d.ts.map +1 -1
  168. package/dist/module/packages/StorageFileApi.js +13 -11
  169. package/dist/module/packages/StorageFileApi.js.map +1 -1
  170. package/dist/module/packages/StreamDownloadBuilder.js +1 -9
  171. package/dist/module/packages/StreamDownloadBuilder.js.map +1 -1
  172. package/dist/tsconfig.module.tsbuildinfo +1 -0
  173. package/dist/tsconfig.tsbuildinfo +1 -0
  174. package/dist/umd/supabase.js +1 -1
  175. package/package.json +6 -13
  176. package/src/StorageClient.ts +37 -0
  177. package/src/index.ts +2 -0
  178. package/src/lib/constants.ts +3 -1
  179. package/src/lib/fetch.ts +5 -1
  180. package/src/lib/helpers.ts +3 -14
  181. package/src/lib/index.ts +1 -0
  182. package/src/lib/types.ts +83 -2
  183. package/src/lib/vectors/StorageVectorsClient.ts +405 -0
  184. package/src/lib/vectors/VectorBucketApi.ts +217 -0
  185. package/src/lib/vectors/VectorDataApi.ts +341 -0
  186. package/src/lib/vectors/VectorIndexApi.ts +245 -0
  187. package/src/lib/vectors/constants.ts +5 -0
  188. package/src/lib/vectors/errors.ts +78 -0
  189. package/src/lib/vectors/fetch.ts +218 -0
  190. package/src/lib/vectors/helpers.ts +79 -0
  191. package/src/lib/vectors/index.ts +66 -0
  192. package/src/lib/vectors/types.ts +299 -0
  193. package/src/lib/version.ts +1 -1
  194. package/src/packages/BlobDownloadBuilder.ts +22 -2
  195. package/src/packages/StorageAnalyticsApi.ts +199 -0
  196. package/src/packages/StorageBucketApi.ts +29 -4
  197. package/src/packages/StorageFileApi.ts +15 -2
@@ -0,0 +1,46 @@
1
+ type Fetch = typeof fetch;
2
+ /**
3
+ * Resolves the fetch implementation to use
4
+ * Uses custom fetch if provided, otherwise uses native fetch
5
+ *
6
+ * @param customFetch - Optional custom fetch implementation
7
+ * @returns Resolved fetch function
8
+ */
9
+ export declare const resolveFetch: (customFetch?: Fetch) => Fetch;
10
+ /**
11
+ * Resolves the Response constructor to use
12
+ * Returns native Response constructor
13
+ *
14
+ * @returns Response constructor
15
+ */
16
+ export declare const resolveResponse: () => typeof Response;
17
+ /**
18
+ * Determine if input is a plain object
19
+ * An object is plain if it's created by either {}, new Object(), or Object.create(null)
20
+ *
21
+ * @param value - Value to check
22
+ * @returns True if value is a plain object
23
+ * @source https://github.com/sindresorhus/is-plain-obj
24
+ */
25
+ export declare const isPlainObject: (value: object) => boolean;
26
+ /**
27
+ * Normalizes a number array to float32 format
28
+ * Ensures all vector values are valid 32-bit floats
29
+ *
30
+ * @param values - Array of numbers to normalize
31
+ * @returns Normalized float32 array
32
+ */
33
+ export declare const normalizeToFloat32: (values: number[]) => number[];
34
+ /**
35
+ * Validates vector dimensions match expected dimension
36
+ * Throws error if dimensions don't match
37
+ *
38
+ * @param vector - Vector data to validate
39
+ * @param expectedDimension - Expected vector dimension
40
+ * @throws Error if dimensions don't match
41
+ */
42
+ export declare const validateVectorDimension: (vector: {
43
+ float32: number[];
44
+ }, expectedDimension?: number) => void;
45
+ export {};
46
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/vectors/helpers.ts"],"names":[],"mappings":"AAAA,KAAK,KAAK,GAAG,OAAO,KAAK,CAAA;AAEzB;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,cAAc,KAAK,KAAG,KAKlD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAO,OAAO,QAEzC,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,KAAG,OAa7C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,EAAE,KAAG,MAAM,EAG3D,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAClC,QAAQ;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,EAC7B,oBAAoB,MAAM,KACzB,IAMF,CAAA"}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateVectorDimension = exports.normalizeToFloat32 = exports.isPlainObject = exports.resolveResponse = exports.resolveFetch = void 0;
4
+ /**
5
+ * Resolves the fetch implementation to use
6
+ * Uses custom fetch if provided, otherwise uses native fetch
7
+ *
8
+ * @param customFetch - Optional custom fetch implementation
9
+ * @returns Resolved fetch function
10
+ */
11
+ const resolveFetch = (customFetch) => {
12
+ if (customFetch) {
13
+ return (...args) => customFetch(...args);
14
+ }
15
+ return (...args) => fetch(...args);
16
+ };
17
+ exports.resolveFetch = resolveFetch;
18
+ /**
19
+ * Resolves the Response constructor to use
20
+ * Returns native Response constructor
21
+ *
22
+ * @returns Response constructor
23
+ */
24
+ const resolveResponse = () => {
25
+ return Response;
26
+ };
27
+ exports.resolveResponse = resolveResponse;
28
+ /**
29
+ * Determine if input is a plain object
30
+ * An object is plain if it's created by either {}, new Object(), or Object.create(null)
31
+ *
32
+ * @param value - Value to check
33
+ * @returns True if value is a plain object
34
+ * @source https://github.com/sindresorhus/is-plain-obj
35
+ */
36
+ const isPlainObject = (value) => {
37
+ if (typeof value !== 'object' || value === null) {
38
+ return false;
39
+ }
40
+ const prototype = Object.getPrototypeOf(value);
41
+ return ((prototype === null ||
42
+ prototype === Object.prototype ||
43
+ Object.getPrototypeOf(prototype) === null) &&
44
+ !(Symbol.toStringTag in value) &&
45
+ !(Symbol.iterator in value));
46
+ };
47
+ exports.isPlainObject = isPlainObject;
48
+ /**
49
+ * Normalizes a number array to float32 format
50
+ * Ensures all vector values are valid 32-bit floats
51
+ *
52
+ * @param values - Array of numbers to normalize
53
+ * @returns Normalized float32 array
54
+ */
55
+ const normalizeToFloat32 = (values) => {
56
+ // Use Float32Array to ensure proper precision
57
+ return Array.from(new Float32Array(values));
58
+ };
59
+ exports.normalizeToFloat32 = normalizeToFloat32;
60
+ /**
61
+ * Validates vector dimensions match expected dimension
62
+ * Throws error if dimensions don't match
63
+ *
64
+ * @param vector - Vector data to validate
65
+ * @param expectedDimension - Expected vector dimension
66
+ * @throws Error if dimensions don't match
67
+ */
68
+ const validateVectorDimension = (vector, expectedDimension) => {
69
+ if (expectedDimension !== undefined && vector.float32.length !== expectedDimension) {
70
+ throw new Error(`Vector dimension mismatch: expected ${expectedDimension}, got ${vector.float32.length}`);
71
+ }
72
+ };
73
+ exports.validateVectorDimension = validateVectorDimension;
74
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/lib/vectors/helpers.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACI,MAAM,YAAY,GAAG,CAAC,WAAmB,EAAS,EAAE;IACzD,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,CAAA;IAC1C,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;AACpC,CAAC,CAAA;AALY,QAAA,YAAY,gBAKxB;AAED;;;;;GAKG;AACI,MAAM,eAAe,GAAG,GAAoB,EAAE;IACnD,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAFY,QAAA,eAAe,mBAE3B;AAED;;;;;;;GAOG;AACI,MAAM,aAAa,GAAG,CAAC,KAAa,EAAW,EAAE;IACtD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;IAC9C,OAAO,CACL,CAAC,SAAS,KAAK,IAAI;QACjB,SAAS,KAAK,MAAM,CAAC,SAAS;QAC9B,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;QAC5C,CAAC,CAAC,MAAM,CAAC,WAAW,IAAI,KAAK,CAAC;QAC9B,CAAC,CAAC,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC,CAC5B,CAAA;AACH,CAAC,CAAA;AAbY,QAAA,aAAa,iBAazB;AAED;;;;;;GAMG;AACI,MAAM,kBAAkB,GAAG,CAAC,MAAgB,EAAY,EAAE;IAC/D,8CAA8C;IAC9C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC,CAAA;AAC7C,CAAC,CAAA;AAHY,QAAA,kBAAkB,sBAG9B;AAED;;;;;;;GAOG;AACI,MAAM,uBAAuB,GAAG,CACrC,MAA6B,EAC7B,iBAA0B,EACpB,EAAE;IACR,IAAI,iBAAiB,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,iBAAiB,EAAE,CAAC;QACnF,MAAM,IAAI,KAAK,CACb,uCAAuC,iBAAiB,SAAS,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CACzF,CAAA;IACH,CAAC;AACH,CAAC,CAAA;AATY,QAAA,uBAAuB,2BASnC"}
@@ -0,0 +1,11 @@
1
+ export { StorageVectorsClient, VectorBucketScope, VectorIndexScope } from './StorageVectorsClient';
2
+ export type { StorageVectorsClientOptions } from './StorageVectorsClient';
3
+ export { default as VectorBucketApi } from './VectorBucketApi';
4
+ export { default as VectorIndexApi } from './VectorIndexApi';
5
+ export { default as VectorDataApi } from './VectorDataApi';
6
+ export type { CreateIndexOptions } from './VectorIndexApi';
7
+ export type { VectorBucket, VectorIndex, VectorData, VectorMetadata, VectorObject, VectorMatch, EncryptionConfiguration, MetadataConfiguration, VectorDataType, DistanceMetric, VectorFilter, ListVectorBucketsOptions, ListVectorBucketsResponse, ListIndexesOptions, ListIndexesResponse, PutVectorsOptions, GetVectorsOptions, GetVectorsResponse, DeleteVectorsOptions, ListVectorsOptions, ListVectorsResponse, QueryVectorsOptions, QueryVectorsResponse, ApiResponse, SuccessResponse, ErrorResponse, VectorFetchParameters, } from './types';
8
+ export { StorageVectorsError, StorageVectorsApiError, StorageVectorsUnknownError, StorageVectorsErrorCode, isStorageVectorsError, } from './errors';
9
+ export type { Fetch, FetchOptions, RequestMethodType } from './fetch';
10
+ export { resolveFetch, resolveResponse, isPlainObject, normalizeToFloat32, validateVectorDimension, } from './helpers';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/vectors/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAClG,YAAY,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAA;AAGzE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC9D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC1D,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAG1D,YAAY,EAEV,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,YAAY,EACZ,WAAW,EACX,uBAAuB,EACvB,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,YAAY,EAGZ,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EAGpB,WAAW,EACX,eAAe,EACf,aAAa,EACb,qBAAqB,GACtB,MAAM,SAAS,CAAA;AAGhB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,UAAU,CAAA;AAGjB,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAGrE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,WAAW,CAAA"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateVectorDimension = exports.normalizeToFloat32 = exports.isPlainObject = exports.resolveResponse = exports.resolveFetch = exports.isStorageVectorsError = exports.StorageVectorsErrorCode = exports.StorageVectorsUnknownError = exports.StorageVectorsApiError = exports.StorageVectorsError = exports.VectorDataApi = exports.VectorIndexApi = exports.VectorBucketApi = exports.VectorIndexScope = exports.VectorBucketScope = exports.StorageVectorsClient = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Main client
6
+ var StorageVectorsClient_1 = require("./StorageVectorsClient");
7
+ Object.defineProperty(exports, "StorageVectorsClient", { enumerable: true, get: function () { return StorageVectorsClient_1.StorageVectorsClient; } });
8
+ Object.defineProperty(exports, "VectorBucketScope", { enumerable: true, get: function () { return StorageVectorsClient_1.VectorBucketScope; } });
9
+ Object.defineProperty(exports, "VectorIndexScope", { enumerable: true, get: function () { return StorageVectorsClient_1.VectorIndexScope; } });
10
+ // API classes (for advanced usage)
11
+ var VectorBucketApi_1 = require("./VectorBucketApi");
12
+ Object.defineProperty(exports, "VectorBucketApi", { enumerable: true, get: function () { return tslib_1.__importDefault(VectorBucketApi_1).default; } });
13
+ var VectorIndexApi_1 = require("./VectorIndexApi");
14
+ Object.defineProperty(exports, "VectorIndexApi", { enumerable: true, get: function () { return tslib_1.__importDefault(VectorIndexApi_1).default; } });
15
+ var VectorDataApi_1 = require("./VectorDataApi");
16
+ Object.defineProperty(exports, "VectorDataApi", { enumerable: true, get: function () { return tslib_1.__importDefault(VectorDataApi_1).default; } });
17
+ // Errors
18
+ var errors_1 = require("./errors");
19
+ Object.defineProperty(exports, "StorageVectorsError", { enumerable: true, get: function () { return errors_1.StorageVectorsError; } });
20
+ Object.defineProperty(exports, "StorageVectorsApiError", { enumerable: true, get: function () { return errors_1.StorageVectorsApiError; } });
21
+ Object.defineProperty(exports, "StorageVectorsUnknownError", { enumerable: true, get: function () { return errors_1.StorageVectorsUnknownError; } });
22
+ Object.defineProperty(exports, "StorageVectorsErrorCode", { enumerable: true, get: function () { return errors_1.StorageVectorsErrorCode; } });
23
+ Object.defineProperty(exports, "isStorageVectorsError", { enumerable: true, get: function () { return errors_1.isStorageVectorsError; } });
24
+ // Helper utilities
25
+ var helpers_1 = require("./helpers");
26
+ Object.defineProperty(exports, "resolveFetch", { enumerable: true, get: function () { return helpers_1.resolveFetch; } });
27
+ Object.defineProperty(exports, "resolveResponse", { enumerable: true, get: function () { return helpers_1.resolveResponse; } });
28
+ Object.defineProperty(exports, "isPlainObject", { enumerable: true, get: function () { return helpers_1.isPlainObject; } });
29
+ Object.defineProperty(exports, "normalizeToFloat32", { enumerable: true, get: function () { return helpers_1.normalizeToFloat32; } });
30
+ Object.defineProperty(exports, "validateVectorDimension", { enumerable: true, get: function () { return helpers_1.validateVectorDimension; } });
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/vectors/index.ts"],"names":[],"mappings":";;;;AAAA,cAAc;AACd,+DAAkG;AAAzF,4HAAA,oBAAoB,OAAA;AAAE,yHAAA,iBAAiB,OAAA;AAAE,wHAAA,gBAAgB,OAAA;AAGlE,mCAAmC;AACnC,qDAA8D;AAArD,2IAAA,OAAO,OAAmB;AACnC,mDAA4D;AAAnD,yIAAA,OAAO,OAAkB;AAClC,iDAA0D;AAAjD,uIAAA,OAAO,OAAiB;AAuCjC,SAAS;AACT,mCAMiB;AALf,6GAAA,mBAAmB,OAAA;AACnB,gHAAA,sBAAsB,OAAA;AACtB,oHAAA,0BAA0B,OAAA;AAC1B,iHAAA,uBAAuB,OAAA;AACvB,+GAAA,qBAAqB,OAAA;AAMvB,mBAAmB;AACnB,qCAMkB;AALhB,uGAAA,YAAY,OAAA;AACZ,0GAAA,eAAe,OAAA;AACf,wGAAA,aAAa,OAAA;AACb,6GAAA,kBAAkB,OAAA;AAClB,kHAAA,uBAAuB,OAAA"}
@@ -0,0 +1,277 @@
1
+ import { StorageVectorsError } from './errors';
2
+ /**
3
+ * Configuration for encryption at rest
4
+ * @property kmsKeyArn - ARN of the KMS key used for encryption
5
+ * @property sseType - Server-side encryption type (e.g., 'KMS')
6
+ */
7
+ export interface EncryptionConfiguration {
8
+ kmsKeyArn?: string;
9
+ sseType?: string;
10
+ }
11
+ /**
12
+ * Vector bucket metadata
13
+ * @property vectorBucketName - Unique name of the vector bucket
14
+ * @property creationTime - Unix timestamp of when the bucket was created
15
+ * @property encryptionConfiguration - Optional encryption settings
16
+ */
17
+ export interface VectorBucket {
18
+ vectorBucketName: string;
19
+ creationTime?: number;
20
+ encryptionConfiguration?: EncryptionConfiguration;
21
+ }
22
+ /**
23
+ * Metadata configuration for vector index
24
+ * Defines which metadata keys should not be indexed for filtering
25
+ * @property nonFilterableMetadataKeys - Array of metadata keys that cannot be used in filters
26
+ */
27
+ export interface MetadataConfiguration {
28
+ nonFilterableMetadataKeys?: string[];
29
+ }
30
+ /**
31
+ * Supported data types for vectors
32
+ * Currently only float32 is supported
33
+ */
34
+ export type VectorDataType = 'float32';
35
+ /**
36
+ * Distance metrics for vector similarity search
37
+ */
38
+ export type DistanceMetric = 'cosine' | 'euclidean' | 'dotproduct';
39
+ /**
40
+ * Vector index configuration and metadata
41
+ * @property indexName - Unique name of the index within the bucket
42
+ * @property vectorBucketName - Name of the parent vector bucket
43
+ * @property dataType - Data type of vector components (currently only 'float32')
44
+ * @property dimension - Dimensionality of vectors (e.g., 384, 768, 1536)
45
+ * @property distanceMetric - Similarity metric used for queries
46
+ * @property metadataConfiguration - Configuration for metadata filtering
47
+ * @property creationTime - Unix timestamp of when the index was created
48
+ */
49
+ export interface VectorIndex {
50
+ indexName: string;
51
+ vectorBucketName: string;
52
+ dataType: VectorDataType;
53
+ dimension: number;
54
+ distanceMetric: DistanceMetric;
55
+ metadataConfiguration?: MetadataConfiguration;
56
+ creationTime?: number;
57
+ }
58
+ /**
59
+ * Vector data representation
60
+ * Vectors must be float32 arrays with dimensions matching the index
61
+ * @property float32 - Array of 32-bit floating point numbers
62
+ */
63
+ export interface VectorData {
64
+ float32: number[];
65
+ }
66
+ /**
67
+ * Arbitrary JSON metadata attached to vectors
68
+ * Keys configured as non-filterable in the index can be stored but not queried
69
+ */
70
+ export type VectorMetadata = Record<string, any>;
71
+ /**
72
+ * Single vector object for insertion/update
73
+ * @property key - Unique identifier for the vector
74
+ * @property data - Vector embedding data
75
+ * @property metadata - Optional arbitrary metadata
76
+ */
77
+ export interface VectorObject {
78
+ key: string;
79
+ data: VectorData;
80
+ metadata?: VectorMetadata;
81
+ }
82
+ /**
83
+ * Vector object returned from queries with optional distance
84
+ * @property key - Unique identifier for the vector
85
+ * @property data - Vector embedding data (if requested)
86
+ * @property metadata - Arbitrary metadata (if requested)
87
+ * @property distance - Similarity distance from query vector (if requested)
88
+ */
89
+ export interface VectorMatch {
90
+ key: string;
91
+ data?: VectorData;
92
+ metadata?: VectorMetadata;
93
+ distance?: number;
94
+ }
95
+ /**
96
+ * Options for fetching vector buckets
97
+ * @property prefix - Filter buckets by name prefix
98
+ * @property maxResults - Maximum number of results to return (default: 100)
99
+ * @property nextToken - Token for pagination from previous response
100
+ */
101
+ export interface ListVectorBucketsOptions {
102
+ prefix?: string;
103
+ maxResults?: number;
104
+ nextToken?: string;
105
+ }
106
+ /**
107
+ * Response from listing vector buckets
108
+ * @property vectorBuckets - Array of bucket names
109
+ * @property nextToken - Token for fetching next page (if more results exist)
110
+ */
111
+ export interface ListVectorBucketsResponse {
112
+ vectorBuckets: {
113
+ vectorBucketName: string;
114
+ }[];
115
+ nextToken?: string;
116
+ }
117
+ /**
118
+ * Options for listing indexes within a bucket
119
+ * @property vectorBucketName - Name of the parent vector bucket
120
+ * @property prefix - Filter indexes by name prefix
121
+ * @property maxResults - Maximum number of results to return (default: 100)
122
+ * @property nextToken - Token for pagination from previous response
123
+ */
124
+ export interface ListIndexesOptions {
125
+ vectorBucketName: string;
126
+ prefix?: string;
127
+ maxResults?: number;
128
+ nextToken?: string;
129
+ }
130
+ /**
131
+ * Response from listing indexes
132
+ * @property indexes - Array of index names
133
+ * @property nextToken - Token for fetching next page (if more results exist)
134
+ */
135
+ export interface ListIndexesResponse {
136
+ indexes: {
137
+ indexName: string;
138
+ }[];
139
+ nextToken?: string;
140
+ }
141
+ /**
142
+ * Options for batch reading vectors
143
+ * @property vectorBucketName - Name of the vector bucket
144
+ * @property indexName - Name of the index
145
+ * @property keys - Array of vector keys to retrieve
146
+ * @property returnData - Whether to include vector data in response
147
+ * @property returnMetadata - Whether to include metadata in response
148
+ */
149
+ export interface GetVectorsOptions {
150
+ vectorBucketName: string;
151
+ indexName: string;
152
+ keys: string[];
153
+ returnData?: boolean;
154
+ returnMetadata?: boolean;
155
+ }
156
+ /**
157
+ * Response from getting vectors
158
+ * @property vectors - Array of retrieved vector objects
159
+ */
160
+ export interface GetVectorsResponse {
161
+ vectors: VectorMatch[];
162
+ }
163
+ /**
164
+ * Options for batch inserting/updating vectors
165
+ * @property vectorBucketName - Name of the vector bucket
166
+ * @property indexName - Name of the index
167
+ * @property vectors - Array of vectors to insert/upsert (1-500 items)
168
+ */
169
+ export interface PutVectorsOptions {
170
+ vectorBucketName: string;
171
+ indexName: string;
172
+ vectors: VectorObject[];
173
+ }
174
+ /**
175
+ * Options for batch deleting vectors
176
+ * @property vectorBucketName - Name of the vector bucket
177
+ * @property indexName - Name of the index
178
+ * @property keys - Array of vector keys to delete (1-500 items)
179
+ */
180
+ export interface DeleteVectorsOptions {
181
+ vectorBucketName: string;
182
+ indexName: string;
183
+ keys: string[];
184
+ }
185
+ /**
186
+ * Options for listing/scanning vectors in an index
187
+ * Supports parallel scanning via segment configuration
188
+ * @property vectorBucketName - Name of the vector bucket
189
+ * @property indexName - Name of the index
190
+ * @property maxResults - Maximum number of results to return (default: 500, max: 1000)
191
+ * @property nextToken - Token for pagination from previous response
192
+ * @property returnData - Whether to include vector data in response
193
+ * @property returnMetadata - Whether to include metadata in response
194
+ * @property segmentCount - Total number of parallel segments (1-16)
195
+ * @property segmentIndex - Zero-based index of this segment (0 to segmentCount-1)
196
+ */
197
+ export interface ListVectorsOptions {
198
+ vectorBucketName: string;
199
+ indexName: string;
200
+ maxResults?: number;
201
+ nextToken?: string;
202
+ returnData?: boolean;
203
+ returnMetadata?: boolean;
204
+ segmentCount?: number;
205
+ segmentIndex?: number;
206
+ }
207
+ /**
208
+ * Response from listing vectors
209
+ * @property vectors - Array of vector objects
210
+ * @property nextToken - Token for fetching next page (if more results exist)
211
+ */
212
+ export interface ListVectorsResponse {
213
+ vectors: VectorMatch[];
214
+ nextToken?: string;
215
+ }
216
+ /**
217
+ * JSON filter expression for metadata filtering
218
+ * Format and syntax depend on the S3 Vectors service implementation
219
+ */
220
+ export type VectorFilter = Record<string, any>;
221
+ /**
222
+ * Options for querying similar vectors (ANN search)
223
+ * @property vectorBucketName - Name of the vector bucket
224
+ * @property indexName - Name of the index
225
+ * @property queryVector - Query vector to find similar vectors
226
+ * @property topK - Number of nearest neighbors to return (default: 10)
227
+ * @property filter - Optional JSON filter for metadata
228
+ * @property returnDistance - Whether to include distance scores
229
+ * @property returnMetadata - Whether to include metadata in results
230
+ */
231
+ export interface QueryVectorsOptions {
232
+ vectorBucketName: string;
233
+ indexName: string;
234
+ queryVector: VectorData;
235
+ topK?: number;
236
+ filter?: VectorFilter;
237
+ returnDistance?: boolean;
238
+ returnMetadata?: boolean;
239
+ }
240
+ /**
241
+ * Response from vector similarity query
242
+ * @property matches - Array of similar vectors ordered by distance
243
+ */
244
+ export interface QueryVectorsResponse {
245
+ matches: VectorMatch[];
246
+ }
247
+ /**
248
+ * Fetch-specific parameters like abort signals
249
+ * @property signal - AbortSignal for cancelling requests
250
+ */
251
+ export interface VectorFetchParameters {
252
+ signal?: AbortSignal;
253
+ }
254
+ /**
255
+ * Standard response wrapper for successful operations
256
+ * @property data - Response data of type T
257
+ * @property error - Null on success
258
+ */
259
+ export interface SuccessResponse<T> {
260
+ data: T;
261
+ error: null;
262
+ }
263
+ /**
264
+ * Standard response wrapper for failed operations
265
+ * @property data - Null on error
266
+ * @property error - StorageVectorsError with details
267
+ */
268
+ export interface ErrorResponse {
269
+ data: null;
270
+ error: StorageVectorsError;
271
+ }
272
+ /**
273
+ * Union type for all API responses
274
+ * Follows the pattern: { data: T, error: null } | { data: null, error: Error }
275
+ */
276
+ export type ApiResponse<T> = SuccessResponse<T> | ErrorResponse;
277
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/vectors/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAE9C;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,gBAAgB,EAAE,MAAM,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;CAClD;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAA;CACrC;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,CAAA;AAEtC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,WAAW,GAAG,YAAY,CAAA;AAElE;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,cAAc,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,cAAc,CAAA;IAC9B,qBAAqB,CAAC,EAAE,qBAAq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,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,WAAW,EAAE,CAAA;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,IAAI,EAAE,CAAC,CAAA;IACP,KAAK,EAAE,IAAI,CAAA;CACZ;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,IAAI,CAAA;IACV,KAAK,EAAE,mBAAmB,CAAA;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG,aAAa,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/lib/vectors/types.ts"],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- export declare const version = "2.79.1-canary.1";
1
+ export declare const version = "2.80.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/lib/version.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,OAAO,oBAAoB,CAAA"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/lib/version.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,OAAO,WAAW,CAAA"}
@@ -7,5 +7,5 @@ exports.version = void 0;
7
7
  // - Debugging and support (identifying which version is running)
8
8
  // - Telemetry and logging (version reporting in errors/analytics)
9
9
  // - Ensuring build artifacts match the published package version
10
- exports.version = '2.79.1-canary.1';
10
+ exports.version = '2.80.0';
11
11
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/lib/version.ts"],"names":[],"mappings":";;;AAAA,6EAA6E;AAC7E,gEAAgE;AAChE,uEAAuE;AACvE,iEAAiE;AACjE,kEAAkE;AAClE,iEAAiE;AACpD,QAAA,OAAO,GAAG,iBAAiB,CAAA"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/lib/version.ts"],"names":[],"mappings":";;;AAAA,6EAA6E;AAC7E,gEAAgE;AAChE,uEAAuE;AACvE,iEAAiE;AACjE,kEAAkE;AAClE,iEAAiE;AACpD,QAAA,OAAO,GAAG,QAAQ,CAAA"}
@@ -1,11 +1,16 @@
1
1
  import { DownloadResult } from '../lib/types';
2
2
  import StreamDownloadBuilder from './StreamDownloadBuilder';
3
- export default class BlobDownloadBuilder implements PromiseLike<DownloadResult<Blob>> {
3
+ export default class BlobDownloadBuilder implements Promise<DownloadResult<Blob>> {
4
4
  private downloadFn;
5
5
  private shouldThrowOnError;
6
+ readonly [Symbol.toStringTag]: string;
7
+ private promise;
6
8
  constructor(downloadFn: () => Promise<Response>, shouldThrowOnError: boolean);
7
9
  asStream(): StreamDownloadBuilder;
8
10
  then<TResult1 = DownloadResult<Blob>, TResult2 = never>(onfulfilled?: ((value: DownloadResult<Blob>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
11
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<DownloadResult<Blob> | TResult>;
12
+ finally(onfinally?: (() => void) | null): Promise<DownloadResult<Blob>>;
13
+ private getPromise;
9
14
  private execute;
10
15
  }
11
16
  //# sourceMappingURL=BlobDownloadBuilder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlobDownloadBuilder.d.ts","sourceRoot":"","sources":["../../../src/packages/BlobDownloadBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,qBAAqB,MAAM,yBAAyB,CAAA;AAE3D,MAAM,CAAC,OAAO,OAAO,mBAAoB,YAAW,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAEjF,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,kBAAkB;gBADlB,UAAU,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,EACnC,kBAAkB,EAAE,OAAO;IAGrC,QAAQ,IAAI,qBAAqB;IAIjC,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,EACpD,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,EACxF,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,GACtE,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAIjB,OAAO;CAoBtB"}
1
+ {"version":3,"file":"BlobDownloadBuilder.d.ts","sourceRoot":"","sources":["../../../src/packages/BlobDownloadBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,qBAAqB,MAAM,yBAAyB,CAAA;AAE3D,MAAM,CAAC,OAAO,OAAO,mBAAoB,YAAW,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAK7E,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,kBAAkB;IAL5B,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAwB;IAC7D,OAAO,CAAC,OAAO,CAA6C;gBAGlD,UAAU,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,EACnC,kBAAkB,EAAE,OAAO;IAGrC,QAAQ,IAAI,qBAAqB;IAIjC,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,EACpD,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,EACxF,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,GACtE,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAI/B,KAAK,CAAC,OAAO,GAAG,KAAK,EACnB,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,GACpE,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;IAI1C,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAIvE,OAAO,CAAC,UAAU;YAOJ,OAAO;CAoBtB"}
@@ -1,32 +1,36 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
2
+ var _a;
14
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("tslib");
15
5
  const errors_1 = require("../lib/errors");
16
- const StreamDownloadBuilder_1 = __importDefault(require("./StreamDownloadBuilder"));
6
+ const StreamDownloadBuilder_1 = tslib_1.__importDefault(require("./StreamDownloadBuilder"));
17
7
  class BlobDownloadBuilder {
18
8
  constructor(downloadFn, shouldThrowOnError) {
19
9
  this.downloadFn = downloadFn;
20
10
  this.shouldThrowOnError = shouldThrowOnError;
11
+ this[_a] = 'BlobDownloadBuilder';
12
+ this.promise = null;
21
13
  }
22
14
  asStream() {
23
15
  return new StreamDownloadBuilder_1.default(this.downloadFn, this.shouldThrowOnError);
24
16
  }
25
17
  then(onfulfilled, onrejected) {
26
- return this.execute().then(onfulfilled, onrejected);
18
+ return this.getPromise().then(onfulfilled, onrejected);
19
+ }
20
+ catch(onrejected) {
21
+ return this.getPromise().catch(onrejected);
22
+ }
23
+ finally(onfinally) {
24
+ return this.getPromise().finally(onfinally);
25
+ }
26
+ getPromise() {
27
+ if (!this.promise) {
28
+ this.promise = this.execute();
29
+ }
30
+ return this.promise;
27
31
  }
28
32
  execute() {
29
- return __awaiter(this, void 0, void 0, function* () {
33
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
30
34
  try {
31
35
  const result = yield this.downloadFn();
32
36
  return {
@@ -46,5 +50,6 @@ class BlobDownloadBuilder {
46
50
  });
47
51
  }
48
52
  }
53
+ _a = Symbol.toStringTag;
49
54
  exports.default = BlobDownloadBuilder;
50
55
  //# sourceMappingURL=BlobDownloadBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlobDownloadBuilder.js","sourceRoot":"","sources":["../../../src/packages/BlobDownloadBuilder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,0CAA8C;AAE9C,oFAA2D;AAE3D,MAA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