@geekmidas/storage 10.0.0-alpha.14 → 10.0.0-alpha.141

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 (44) hide show
  1. package/README.md +49 -13
  2. package/dist/aws.cjs +88 -10
  3. package/dist/aws.cjs.map +1 -1
  4. package/dist/aws.d.cts +5 -2
  5. package/dist/aws.d.cts.map +1 -1
  6. package/dist/aws.d.mts +5 -2
  7. package/dist/aws.d.mts.map +1 -1
  8. package/dist/aws.mjs +88 -10
  9. package/dist/aws.mjs.map +1 -1
  10. package/dist/{errors-Bexjg-j-.cjs → errors-BB8jdHif.cjs} +52 -3
  11. package/dist/errors-BB8jdHif.cjs.map +1 -0
  12. package/dist/{errors-CpYcpJCY.mjs → errors-COXs1iNg.mjs} +41 -4
  13. package/dist/errors-COXs1iNg.mjs.map +1 -0
  14. package/dist/events.cjs +98 -0
  15. package/dist/events.cjs.map +1 -0
  16. package/dist/events.d.cts +58 -0
  17. package/dist/events.d.cts.map +1 -0
  18. package/dist/events.d.mts +58 -0
  19. package/dist/events.d.mts.map +1 -0
  20. package/dist/events.mjs +94 -0
  21. package/dist/events.mjs.map +1 -0
  22. package/dist/index.cjs +3 -1
  23. package/dist/index.d.cts +27 -3
  24. package/dist/index.d.cts.map +1 -1
  25. package/dist/index.d.mts +27 -3
  26. package/dist/index.d.mts.map +1 -1
  27. package/dist/index.mjs +2 -2
  28. package/dist/{registry-ClEvHGpM.d.cts → registry-DyBOtv6n.d.cts} +44 -2
  29. package/dist/registry-DyBOtv6n.d.cts.map +1 -0
  30. package/dist/{registry-ClEvHGpM.d.mts → registry-DyBOtv6n.d.mts} +44 -2
  31. package/dist/registry-DyBOtv6n.d.mts.map +1 -0
  32. package/dist/s3Url.cjs +37 -8
  33. package/dist/s3Url.cjs.map +1 -1
  34. package/dist/s3Url.d.cts +20 -6
  35. package/dist/s3Url.d.cts.map +1 -1
  36. package/dist/s3Url.d.mts +20 -6
  37. package/dist/s3Url.d.mts.map +1 -1
  38. package/dist/s3Url.mjs +37 -8
  39. package/dist/s3Url.mjs.map +1 -1
  40. package/package.json +20 -5
  41. package/dist/errors-Bexjg-j-.cjs.map +0 -1
  42. package/dist/errors-CpYcpJCY.mjs.map +0 -1
  43. package/dist/registry-ClEvHGpM.d.cts.map +0 -1
  44. package/dist/registry-ClEvHGpM.d.mts.map +0 -1
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as registeredStorageSchemes, l as StorageClient, n as createStorageClient, r as registerStorageDriver, t as StorageDriver } from "./registry-ClEvHGpM.mjs";
1
+ import { d as UploadPost, f as UploadPostParams, i as registeredStorageSchemes, l as StorageClient, n as createStorageClient, r as registerStorageDriver, t as StorageDriver } from "./registry-DyBOtv6n.mjs";
2
2
  //#region src/errors.d.ts
3
3
  /**
4
4
  * Storage errors — shared by every implementation, not just S3.
@@ -14,10 +14,23 @@ import { i as registeredStorageSchemes, l as StorageClient, n as createStorageCl
14
14
  */
15
15
  /** Base for anything wrong with a storage URL, so callers may catch broadly. */
16
16
  export declare abstract class StorageUrlError extends Error {
17
- /** The URL that could not be used. */
17
+ /**
18
+ * The URL that could not be used, with any credentials it carried replaced
19
+ * by `REDACTED` — an error is logged, and a key in its userinfo would be
20
+ * logged with it.
21
+ */
18
22
  readonly url: string;
19
23
  constructor(url: string, message: string);
20
24
  }
25
+ /**
26
+ * Replace a URL's userinfo with `REDACTED`, so `s3://KEY:SECRET@uploads` can be
27
+ * logged as `s3://REDACTED@uploads`. A URL without userinfo comes back as is.
28
+ *
29
+ * A string the URL parser rejects is still redacted, up to its last `@`: an
30
+ * unencoded `/` in a secret is the commonest way to write a malformed one, and
31
+ * that string is exactly the one that ends up in an error.
32
+ */
33
+ export declare function redactStorageUrl(url: string): string;
21
34
  /** The string is not a URL at all. */
22
35
  export declare class MalformedStorageUrl extends StorageUrlError {
23
36
  constructor(url: string);
@@ -44,6 +57,17 @@ export declare class UnexpectedStorageScheme extends StorageUrlError {
44
57
  export declare class MissingStorageBucket extends StorageUrlError {
45
58
  constructor(url: string);
46
59
  }
60
+ /**
61
+ * The URL's userinfo carries one half of a key pair: an access key with no
62
+ * secret, or a secret with no access key. Either both are in the URL, or
63
+ * neither is and the provider's default credential chain applies — half a pair
64
+ * is never silently completed from the environment.
65
+ */
66
+ export declare class IncompleteStorageCredentials extends StorageUrlError {
67
+ /** Which half is missing: `'accessKeyId'` or `'secretAccessKey'`. */
68
+ readonly missing: 'accessKeyId' | 'secretAccessKey';
69
+ constructor(url: string, missing: 'accessKeyId' | 'secretAccessKey');
70
+ }
47
71
  /**
48
72
  * No driver is registered for the URL's scheme.
49
73
  *
@@ -59,5 +83,5 @@ export declare class UnregisteredStorageScheme extends StorageUrlError {
59
83
  constructor(url: string, scheme: string, registered: readonly string[]);
60
84
  }
61
85
  //#endregion
62
- export { type StorageClient, type StorageDriver, createStorageClient, registerStorageDriver, registeredStorageSchemes };
86
+ export { type StorageClient, type StorageDriver, type UploadPost, type UploadPostParams, createStorageClient, registerStorageDriver, registeredStorageSchemes };
63
87
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/errors.ts"],"mappings":";;;;;;;;;;;;;;;8BAcsB,wBAAwB;;WAEpC;EAEG,YAAA,aAAa;;;qBAQb,4BAA4B;EAC5B,YAAA;;;;;;;qBAUA,gCAAgC;;WAEnC;;WAEA;EAEG,YAAA,aAAa,kBAAkB;;;;;;;;;qBAc/B,6BAA6B;EAC7B,YAAA;;;;;;;;;qBAYA,kCAAkC;;WAErC;;WAEA;EAEG,YAAA,aAAa,gBAAgB"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/errors.ts"],"mappings":";;;;;;;;;;;;;;;8BAcsB,wBAAwB;;;;;;WAMpC;EAET,YAAY,aAAa;;;;;;;;;;wBAeV,iBAAiB;;qBAapB,4BAA4B;EACxC,YAAY;;;;;;;qBAUA,gCAAgC;;WAEnC;;WAEA;EAET,YAAY,aAAa,kBAAkB;;;;;;;;;qBAc/B,6BAA6B;EACzC,YAAY;;;;;;;;qBAWA,qCAAqC;;WAExC;EAET,YAAY,aAAa;;;;;;;;;qBAgBb,kCAAkC;;WAErC;;WAEA;EAET,YAAY,aAAa,gBAAgB"}
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as UnregisteredStorageScheme, i as UnexpectedStorageScheme, n as MissingStorageBucket, r as StorageUrlError, t as MalformedStorageUrl } from "./errors-CpYcpJCY.mjs";
1
+ import { a as UnexpectedStorageScheme, i as StorageUrlError, n as MalformedStorageUrl, o as UnregisteredStorageScheme, r as MissingStorageBucket, s as redactStorageUrl, t as IncompleteStorageCredentials } from "./errors-COXs1iNg.mjs";
2
2
  //#region src/registry.ts
3
3
  /**
4
4
  * Driver registry — how a storage URL becomes a client without the caller
@@ -40,6 +40,6 @@ function schemeOf(url) {
40
40
  return separator === -1 ? "" : url.slice(0, separator + 1);
41
41
  }
42
42
  //#endregion
43
- export { MalformedStorageUrl, MissingStorageBucket, StorageUrlError, UnexpectedStorageScheme, UnregisteredStorageScheme, createStorageClient, registerStorageDriver, registeredStorageSchemes };
43
+ export { IncompleteStorageCredentials, MalformedStorageUrl, MissingStorageBucket, StorageUrlError, UnexpectedStorageScheme, UnregisteredStorageScheme, createStorageClient, redactStorageUrl, registerStorageDriver, registeredStorageSchemes };
44
44
 
45
45
  //# sourceMappingURL=index.mjs.map
@@ -57,6 +57,17 @@ interface StorageClient {
57
57
  * @param expiresIn - The number of minutes the URL should be valid for.
58
58
  */
59
59
  getUpload(params: GetUploadParams, expiresIn?: number): Promise<GetUploadResponse>;
60
+ /**
61
+ * A signed form a browser posts one file to, straight into the bucket.
62
+ *
63
+ * The policy is the guard: the storage refuses a file larger than
64
+ * `maxSize`, or of a type the policy does not allow, so nothing the client
65
+ * sends past this call is trusted to the server that issued it.
66
+ *
67
+ * @param params - What may be uploaded, and where.
68
+ * @returns The form's action and fields, the key, and when it expires.
69
+ */
70
+ getUploadPost(params: UploadPostParams): Promise<UploadPost>;
60
71
  /**
61
72
  * Delete a file from storage.
62
73
  *
@@ -64,6 +75,37 @@ interface StorageClient {
64
75
  */
65
76
  delete(key: string): Promise<void>;
66
77
  }
78
+ /** What a signed upload form allows. */
79
+ interface UploadPostParams {
80
+ /** Where the object lands. */
81
+ key: string;
82
+ /** The largest file the storage accepts, in bytes. */
83
+ maxSize: number;
84
+ /**
85
+ * The type the file must be sent as: an exact `Content-Type`, fixed in the
86
+ * form's fields — or `{ startsWith }`, which the client sets itself
87
+ * (`image/` for any image). Absent, any type is accepted.
88
+ */
89
+ contentType?: string | {
90
+ startsWith: string;
91
+ };
92
+ /** How long the form is valid, in seconds. Defaults to 300. */
93
+ expiresIn?: number;
94
+ }
95
+ /**
96
+ * A signed upload form. Post it as `multipart/form-data`: every field, then
97
+ * the file last, as `file`.
98
+ */
99
+ interface UploadPost {
100
+ /** The form's action — where the browser posts. */
101
+ url: string;
102
+ /** Every field the post must carry, as signed. */
103
+ fields: Record<string, string>;
104
+ /** Where the object lands. */
105
+ key: string;
106
+ /** When the signature stops being accepted, as an ISO timestamp. */
107
+ expiresAt: string;
108
+ }
67
109
  interface GetUploadParams {
68
110
  path: string;
69
111
  contentType: string;
@@ -117,5 +159,5 @@ declare function registeredStorageSchemes(): string[];
117
159
  */
118
160
  declare function createStorageClient(url: string): StorageClient;
119
161
  //#endregion
120
- export { DocumentVersion as a, GetUploadResponse as c, registeredStorageSchemes as i, StorageClient as l, createStorageClient as n, File as o, registerStorageDriver as r, GetUploadParams as s, StorageDriver as t, StorageProvider as u };
121
- //# sourceMappingURL=registry-ClEvHGpM.d.cts.map
162
+ export { DocumentVersion as a, GetUploadResponse as c, UploadPost as d, UploadPostParams as f, registeredStorageSchemes as i, StorageClient as l, createStorageClient as n, File as o, registerStorageDriver as r, GetUploadParams as s, StorageDriver as t, StorageProvider as u };
163
+ //# sourceMappingURL=registry-DyBOtv6n.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-DyBOtv6n.d.cts","names":[],"sources":["../src/StorageClient.ts","../src/registry.ts"],"mappings":";;UACiB;EAChB;EACA,WAAW;;aAGA;EACX;EACA;EACA;;UAGgB;WACP,UAAU;WACV,QAAQ;;;;;;;;;EASjB,aAAa,QAAQ,iBAAiB,qBAAqB;;;;;;;;;EAU3D,eAAe,MAAM,MAAM,qBAAqB;;;;;;EAMhD,YAAY,cAAc,QAAQ;;;;;;;EAQlC,sBAAsB,MAAM,MAAM,oBAAoB;;;;;;;EAOtD,OACC,aACA,eAAe,QACf,sBACE;;;;;;;EAOH,UACC,QAAQ,iBACR,qBACE,QAAQ;;;;;;;;;;;EAWX,cAAc,QAAQ,mBAAmB,QAAQ;;;;;;EAMjD,OAAO,cAAc;;;UAIL;;EAEhB;;EAEA;;;;;;EAMA;IAAyB;;;EAEzB;;;;;;UAOgB;;EAEhB;;EAEA,QAAQ;;EAER;;EAEA;;UAGgB;EAChB;EACA;EACA;;KAGW;EACX;EACA;;KAGW;EACX;EACA,QAAQ;;UAGQ;EAChB;EACA;;;;;EAKA;;;;;;EAMA;;;;;;;;;;UC5HgB;;WAEP;EACT,OAAO,cAAc;;;iBAMN,sBAAsB,QAAQ;;iBAK9B;;;;;;;iBAUA,oBAAoB,cAAc"}
@@ -57,6 +57,17 @@ interface StorageClient {
57
57
  * @param expiresIn - The number of minutes the URL should be valid for.
58
58
  */
59
59
  getUpload(params: GetUploadParams, expiresIn?: number): Promise<GetUploadResponse>;
60
+ /**
61
+ * A signed form a browser posts one file to, straight into the bucket.
62
+ *
63
+ * The policy is the guard: the storage refuses a file larger than
64
+ * `maxSize`, or of a type the policy does not allow, so nothing the client
65
+ * sends past this call is trusted to the server that issued it.
66
+ *
67
+ * @param params - What may be uploaded, and where.
68
+ * @returns The form's action and fields, the key, and when it expires.
69
+ */
70
+ getUploadPost(params: UploadPostParams): Promise<UploadPost>;
60
71
  /**
61
72
  * Delete a file from storage.
62
73
  *
@@ -64,6 +75,37 @@ interface StorageClient {
64
75
  */
65
76
  delete(key: string): Promise<void>;
66
77
  }
78
+ /** What a signed upload form allows. */
79
+ interface UploadPostParams {
80
+ /** Where the object lands. */
81
+ key: string;
82
+ /** The largest file the storage accepts, in bytes. */
83
+ maxSize: number;
84
+ /**
85
+ * The type the file must be sent as: an exact `Content-Type`, fixed in the
86
+ * form's fields — or `{ startsWith }`, which the client sets itself
87
+ * (`image/` for any image). Absent, any type is accepted.
88
+ */
89
+ contentType?: string | {
90
+ startsWith: string;
91
+ };
92
+ /** How long the form is valid, in seconds. Defaults to 300. */
93
+ expiresIn?: number;
94
+ }
95
+ /**
96
+ * A signed upload form. Post it as `multipart/form-data`: every field, then
97
+ * the file last, as `file`.
98
+ */
99
+ interface UploadPost {
100
+ /** The form's action — where the browser posts. */
101
+ url: string;
102
+ /** Every field the post must carry, as signed. */
103
+ fields: Record<string, string>;
104
+ /** Where the object lands. */
105
+ key: string;
106
+ /** When the signature stops being accepted, as an ISO timestamp. */
107
+ expiresAt: string;
108
+ }
67
109
  interface GetUploadParams {
68
110
  path: string;
69
111
  contentType: string;
@@ -117,5 +159,5 @@ declare function registeredStorageSchemes(): string[];
117
159
  */
118
160
  declare function createStorageClient(url: string): StorageClient;
119
161
  //#endregion
120
- export { DocumentVersion as a, GetUploadResponse as c, registeredStorageSchemes as i, StorageClient as l, createStorageClient as n, File as o, registerStorageDriver as r, GetUploadParams as s, StorageDriver as t, StorageProvider as u };
121
- //# sourceMappingURL=registry-ClEvHGpM.d.mts.map
162
+ export { DocumentVersion as a, GetUploadResponse as c, UploadPost as d, UploadPostParams as f, registeredStorageSchemes as i, StorageClient as l, createStorageClient as n, File as o, registerStorageDriver as r, GetUploadParams as s, StorageDriver as t, StorageProvider as u };
163
+ //# sourceMappingURL=registry-DyBOtv6n.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-DyBOtv6n.d.mts","names":[],"sources":["../src/StorageClient.ts","../src/registry.ts"],"mappings":";;UACiB;EAChB;EACA,WAAW;;aAGA;EACX;EACA;EACA;;UAGgB;WACP,UAAU;WACV,QAAQ;;;;;;;;;EASjB,aAAa,QAAQ,iBAAiB,qBAAqB;;;;;;;;;EAU3D,eAAe,MAAM,MAAM,qBAAqB;;;;;;EAMhD,YAAY,cAAc,QAAQ;;;;;;;EAQlC,sBAAsB,MAAM,MAAM,oBAAoB;;;;;;;EAOtD,OACC,aACA,eAAe,QACf,sBACE;;;;;;;EAOH,UACC,QAAQ,iBACR,qBACE,QAAQ;;;;;;;;;;;EAWX,cAAc,QAAQ,mBAAmB,QAAQ;;;;;;EAMjD,OAAO,cAAc;;;UAIL;;EAEhB;;EAEA;;;;;;EAMA;IAAyB;;;EAEzB;;;;;;UAOgB;;EAEhB;;EAEA,QAAQ;;EAER;;EAEA;;UAGgB;EAChB;EACA;EACA;;KAGW;EACX;EACA;;KAGW;EACX;EACA,QAAQ;;UAGQ;EAChB;EACA;;;;;EAKA;;;;;;EAMA;;;;;;;;;;UC5HgB;;WAEP;EACT,OAAO,cAAc;;;iBAMN,sBAAsB,QAAQ;;iBAK9B;;;;;;;iBAUA,oBAAoB,cAAc"}
package/dist/s3Url.cjs CHANGED
@@ -11,7 +11,7 @@ var __exportAll = (all, no_symbols) => {
11
11
  return target;
12
12
  };
13
13
  //#endregion
14
- const require_errors = require("./errors-Bexjg-j-.cjs");
14
+ const require_errors = require("./errors-BB8jdHif.cjs");
15
15
  //#region src/s3Url.ts
16
16
  /**
17
17
  * The `s3://` URL codec — how an S3 bucket is addressed as a single string.
@@ -32,21 +32,29 @@ const SCHEME = "s3:";
32
32
  /**
33
33
  * Compose an address into a URL.
34
34
  *
35
- * Credentials never appear. The AWS SDK resolves them from its own chain — an
36
- * execution role when deployed, `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY`
37
- * locally — so the URL stays safe to log and identical across environments that
38
- * differ only in who is calling.
35
+ * Credentials appear only when the address carries them, percent-encoded —
36
+ * AWS secrets routinely contain `/` and `+`. An address without them builds a
37
+ * URL with no userinfo, which leaves the caller to the SDK's own chain.
39
38
  */
40
39
  function build(address) {
41
- const { bucket, region, endpoint, forcePathStyle } = address;
40
+ const { bucket, region, endpoint, forcePathStyle, accessKeyId, secretAccessKey } = address;
42
41
  if (!bucket) throw new require_errors.MissingStorageBucket("");
43
42
  const url = new URL(`${SCHEME}//${bucket}`);
43
+ if (accessKeyId || secretAccessKey) {
44
+ if (!accessKeyId) throw new require_errors.IncompleteStorageCredentials(url.toString(), "accessKeyId");
45
+ if (!secretAccessKey) throw new require_errors.IncompleteStorageCredentials(url.toString(), "secretAccessKey");
46
+ url.username = encodeURIComponent(accessKeyId);
47
+ url.password = encodeURIComponent(secretAccessKey);
48
+ }
44
49
  if (region) url.searchParams.set("region", region);
45
50
  if (endpoint) url.searchParams.set("endpoint", endpoint);
46
51
  if (forcePathStyle) url.searchParams.set("forcePathStyle", "true");
47
52
  return url.toString();
48
53
  }
49
- /** Parse a URL back into an address. Throws if it is not an `s3://` URL. */
54
+ /**
55
+ * Parse a URL back into an address. Throws if it is not an `s3://` URL, or if
56
+ * its userinfo carries only one half of a key pair.
57
+ */
50
58
  function parse(url) {
51
59
  let parsed;
52
60
  try {
@@ -60,13 +68,34 @@ function parse(url) {
60
68
  const region = parsed.searchParams.get("region") ?? void 0;
61
69
  const endpoint = parsed.searchParams.get("endpoint") ?? void 0;
62
70
  const forcePathStyle = parsed.searchParams.get("forcePathStyle") === "true" ? true : void 0;
71
+ const credentials = credentialsOf(url, parsed);
63
72
  return {
64
73
  bucket,
65
74
  ...region ? { region } : {},
66
75
  ...endpoint ? { endpoint } : {},
67
- ...forcePathStyle ? { forcePathStyle } : {}
76
+ ...forcePathStyle ? { forcePathStyle } : {},
77
+ ...credentials
78
+ };
79
+ }
80
+ /** The URL's userinfo as a key pair: both halves, or nothing. */
81
+ function credentialsOf(url, parsed) {
82
+ const accessKeyId = decode(url, parsed.username);
83
+ const secretAccessKey = decode(url, parsed.password);
84
+ if (!accessKeyId && !secretAccessKey) return {};
85
+ if (!accessKeyId) throw new require_errors.IncompleteStorageCredentials(url, "accessKeyId");
86
+ if (!secretAccessKey) throw new require_errors.IncompleteStorageCredentials(url, "secretAccessKey");
87
+ return {
88
+ accessKeyId,
89
+ secretAccessKey
68
90
  };
69
91
  }
92
+ function decode(url, value) {
93
+ try {
94
+ return decodeURIComponent(value);
95
+ } catch {
96
+ throw new require_errors.MalformedStorageUrl(url);
97
+ }
98
+ }
70
99
  //#endregion
71
100
  exports.build = build;
72
101
  exports.parse = parse;
@@ -1 +1 @@
1
- {"version":3,"file":"s3Url.cjs","names":["MissingStorageBucket","MalformedStorageUrl","UnexpectedStorageScheme"],"sources":["../src/s3Url.ts"],"sourcesContent":["/**\n * The `s3://` URL codec — how an S3 bucket is addressed as a single string.\n *\n * It lives beside the client rather than in a neutral package because `bucket`,\n * `region`, and `forcePathStyle` are S3's vocabulary. The neutral layer only\n * knows that a construct provides *one URL*; what that URL says is between the\n * component that composes it and the client that parses it. A `gs://` codec\n * would sit beside its own client and share nothing with this one.\n *\n * Both directions live here so they cannot drift: `parse(build(x))` is `x`.\n */\n\nimport {\n\tMalformedStorageUrl,\n\tMissingStorageBucket,\n\tUnexpectedStorageScheme,\n} from './errors';\n\n/** What an S3 URL addresses. Credentials are deliberately absent — see below. */\nexport interface S3Address {\n\tbucket: string;\n\t/** Read off the bucket, never inherited: a bucket may live in another region. */\n\tregion?: string;\n\t/** Set for S3-compatible backends such as MinIO. */\n\tendpoint?: string;\n\t/** MinIO and most S3-compatible servers need path-style addressing. */\n\tforcePathStyle?: boolean;\n}\n\nconst SCHEME = 's3:';\n\n/**\n * Compose an address into a URL.\n *\n * Credentials never appear. The AWS SDK resolves them from its own chain — an\n * execution role when deployed, `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY`\n * locally — so the URL stays safe to log and identical across environments that\n * differ only in who is calling.\n */\nexport function build(address: S3Address): string {\n\tconst { bucket, region, endpoint, forcePathStyle } = address;\n\tif (!bucket) throw new MissingStorageBucket('');\n\n\tconst url = new URL(`${SCHEME}//${bucket}`);\n\tif (region) url.searchParams.set('region', region);\n\tif (endpoint) url.searchParams.set('endpoint', endpoint);\n\tif (forcePathStyle) url.searchParams.set('forcePathStyle', 'true');\n\treturn url.toString();\n}\n\n/** Parse a URL back into an address. Throws if it is not an `s3://` URL. */\nexport function parse(url: string): S3Address {\n\tlet parsed: URL;\n\ttry {\n\t\tparsed = new URL(url);\n\t} catch {\n\t\tthrow new MalformedStorageUrl(url);\n\t}\n\n\tif (parsed.protocol !== SCHEME) {\n\t\tthrow new UnexpectedStorageScheme(url, SCHEME, parsed.protocol);\n\t}\n\n\tconst bucket = parsed.hostname;\n\tif (!bucket) throw new MissingStorageBucket(url);\n\n\tconst region = parsed.searchParams.get('region') ?? undefined;\n\tconst endpoint = parsed.searchParams.get('endpoint') ?? undefined;\n\tconst forcePathStyle =\n\t\tparsed.searchParams.get('forcePathStyle') === 'true' ? true : undefined;\n\n\treturn {\n\t\tbucket,\n\t\t...(region ? { region } : {}),\n\t\t...(endpoint ? { endpoint } : {}),\n\t\t...(forcePathStyle ? { forcePathStyle } : {}),\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,SAAS;;;;;;;;;AAUf,SAAgB,MAAM,SAA4B;CACjD,MAAM,EAAE,QAAQ,QAAQ,UAAU,mBAAmB;CACrD,IAAI,CAAC,QAAQ,MAAM,IAAIA,eAAAA,qBAAqB,EAAE;CAE9C,MAAM,MAAM,IAAI,IAAI,GAAG,OAAO,IAAI,QAAQ;CAC1C,IAAI,QAAQ,IAAI,aAAa,IAAI,UAAU,MAAM;CACjD,IAAI,UAAU,IAAI,aAAa,IAAI,YAAY,QAAQ;CACvD,IAAI,gBAAgB,IAAI,aAAa,IAAI,kBAAkB,MAAM;CACjE,OAAO,IAAI,SAAS;AACrB;;AAGA,SAAgB,MAAM,KAAwB;CAC7C,IAAI;CACJ,IAAI;EACH,SAAS,IAAI,IAAI,GAAG;CACrB,QAAQ;EACP,MAAM,IAAIC,eAAAA,oBAAoB,GAAG;CAClC;CAEA,IAAI,OAAO,aAAa,QACvB,MAAM,IAAIC,eAAAA,wBAAwB,KAAK,QAAQ,OAAO,QAAQ;CAG/D,MAAM,SAAS,OAAO;CACtB,IAAI,CAAC,QAAQ,MAAM,IAAIF,eAAAA,qBAAqB,GAAG;CAE/C,MAAM,SAAS,OAAO,aAAa,IAAI,QAAQ,KAAK,KAAA;CACpD,MAAM,WAAW,OAAO,aAAa,IAAI,UAAU,KAAK,KAAA;CACxD,MAAM,iBACL,OAAO,aAAa,IAAI,gBAAgB,MAAM,SAAS,OAAO,KAAA;CAE/D,OAAO;EACN;EACA,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;EAC3B,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;EAC/B,GAAI,iBAAiB,EAAE,eAAe,IAAI,CAAC;CAC5C;AACD"}
1
+ {"version":3,"file":"s3Url.cjs","names":["MissingStorageBucket","IncompleteStorageCredentials","MalformedStorageUrl","UnexpectedStorageScheme"],"sources":["../src/s3Url.ts"],"sourcesContent":["/**\n * The `s3://` URL codec — how an S3 bucket is addressed as a single string.\n *\n * It lives beside the client rather than in a neutral package because `bucket`,\n * `region`, and `forcePathStyle` are S3's vocabulary. The neutral layer only\n * knows that a construct provides *one URL*; what that URL says is between the\n * component that composes it and the client that parses it. A `gs://` codec\n * would sit beside its own client and share nothing with this one.\n *\n * Both directions live here so they cannot drift: `parse(build(x))` is `x`.\n */\n\nimport {\n\tIncompleteStorageCredentials,\n\tMalformedStorageUrl,\n\tMissingStorageBucket,\n\tUnexpectedStorageScheme,\n} from './errors';\n\n/**\n * What an S3 URL addresses, and optionally who it calls as.\n *\n * Credentials are optional and come as a pair. With them, the URL is a key\n * scoped to this one bucket (`s3://KEY:SECRET@uploads`); without them the AWS\n * SDK resolves its own chain — an execution role when deployed,\n * `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY` otherwise. The URL's pair wins\n * over that chain.\n */\nexport interface S3Address {\n\tbucket: string;\n\t/** Read off the bucket, never inherited: a bucket may live in another region. */\n\tregion?: string;\n\t/** Set for S3-compatible backends such as MinIO. */\n\tendpoint?: string;\n\t/** MinIO and most S3-compatible servers need path-style addressing. */\n\tforcePathStyle?: boolean;\n\t/** The URL's own access key; always paired with `secretAccessKey`. */\n\taccessKeyId?: string;\n\t/** The URL's own secret; always paired with `accessKeyId`. */\n\tsecretAccessKey?: string;\n}\n\nconst SCHEME = 's3:';\n\n/**\n * Compose an address into a URL.\n *\n * Credentials appear only when the address carries them, percent-encoded —\n * AWS secrets routinely contain `/` and `+`. An address without them builds a\n * URL with no userinfo, which leaves the caller to the SDK's own chain.\n */\nexport function build(address: S3Address): string {\n\tconst {\n\t\tbucket,\n\t\tregion,\n\t\tendpoint,\n\t\tforcePathStyle,\n\t\taccessKeyId,\n\t\tsecretAccessKey,\n\t} = address;\n\tif (!bucket) throw new MissingStorageBucket('');\n\n\tconst url = new URL(`${SCHEME}//${bucket}`);\n\tif (accessKeyId || secretAccessKey) {\n\t\tif (!accessKeyId) {\n\t\t\tthrow new IncompleteStorageCredentials(url.toString(), 'accessKeyId');\n\t\t}\n\t\tif (!secretAccessKey) {\n\t\t\tthrow new IncompleteStorageCredentials(url.toString(), 'secretAccessKey');\n\t\t}\n\t\turl.username = encodeURIComponent(accessKeyId);\n\t\turl.password = encodeURIComponent(secretAccessKey);\n\t}\n\tif (region) url.searchParams.set('region', region);\n\tif (endpoint) url.searchParams.set('endpoint', endpoint);\n\tif (forcePathStyle) url.searchParams.set('forcePathStyle', 'true');\n\treturn url.toString();\n}\n\n/**\n * Parse a URL back into an address. Throws if it is not an `s3://` URL, or if\n * its userinfo carries only one half of a key pair.\n */\nexport function parse(url: string): S3Address {\n\tlet parsed: URL;\n\ttry {\n\t\tparsed = new URL(url);\n\t} catch {\n\t\tthrow new MalformedStorageUrl(url);\n\t}\n\n\tif (parsed.protocol !== SCHEME) {\n\t\tthrow new UnexpectedStorageScheme(url, SCHEME, parsed.protocol);\n\t}\n\n\tconst bucket = parsed.hostname;\n\tif (!bucket) throw new MissingStorageBucket(url);\n\n\tconst region = parsed.searchParams.get('region') ?? undefined;\n\tconst endpoint = parsed.searchParams.get('endpoint') ?? undefined;\n\tconst forcePathStyle =\n\t\tparsed.searchParams.get('forcePathStyle') === 'true' ? true : undefined;\n\tconst credentials = credentialsOf(url, parsed);\n\n\treturn {\n\t\tbucket,\n\t\t...(region ? { region } : {}),\n\t\t...(endpoint ? { endpoint } : {}),\n\t\t...(forcePathStyle ? { forcePathStyle } : {}),\n\t\t...credentials,\n\t};\n}\n\n/** The URL's userinfo as a key pair: both halves, or nothing. */\nfunction credentialsOf(\n\turl: string,\n\tparsed: URL,\n): Pick<S3Address, 'accessKeyId' | 'secretAccessKey'> {\n\tconst accessKeyId = decode(url, parsed.username);\n\tconst secretAccessKey = decode(url, parsed.password);\n\tif (!accessKeyId && !secretAccessKey) return {};\n\tif (!accessKeyId) {\n\t\tthrow new IncompleteStorageCredentials(url, 'accessKeyId');\n\t}\n\tif (!secretAccessKey) {\n\t\tthrow new IncompleteStorageCredentials(url, 'secretAccessKey');\n\t}\n\treturn { accessKeyId, secretAccessKey };\n}\n\nfunction decode(url: string, value: string): string {\n\ttry {\n\t\treturn decodeURIComponent(value);\n\t} catch {\n\t\tthrow new MalformedStorageUrl(url);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAM,SAAS;;;;;;;;AASf,SAAgB,MAAM,SAA4B;CACjD,MAAM,EACL,QACA,QACA,UACA,gBACA,aACA,oBACG;CACJ,IAAI,CAAC,QAAQ,MAAM,IAAIA,eAAAA,qBAAqB,EAAE;CAE9C,MAAM,MAAM,IAAI,IAAI,GAAG,OAAO,IAAI,QAAQ;CAC1C,IAAI,eAAe,iBAAiB;EACnC,IAAI,CAAC,aACJ,MAAM,IAAIC,eAAAA,6BAA6B,IAAI,SAAS,GAAG,aAAa;EAErE,IAAI,CAAC,iBACJ,MAAM,IAAIA,eAAAA,6BAA6B,IAAI,SAAS,GAAG,iBAAiB;EAEzE,IAAI,WAAW,mBAAmB,WAAW;EAC7C,IAAI,WAAW,mBAAmB,eAAe;CAClD;CACA,IAAI,QAAQ,IAAI,aAAa,IAAI,UAAU,MAAM;CACjD,IAAI,UAAU,IAAI,aAAa,IAAI,YAAY,QAAQ;CACvD,IAAI,gBAAgB,IAAI,aAAa,IAAI,kBAAkB,MAAM;CACjE,OAAO,IAAI,SAAS;AACrB;;;;;AAMA,SAAgB,MAAM,KAAwB;CAC7C,IAAI;CACJ,IAAI;EACH,SAAS,IAAI,IAAI,GAAG;CACrB,QAAQ;EACP,MAAM,IAAIC,eAAAA,oBAAoB,GAAG;CAClC;CAEA,IAAI,OAAO,aAAa,QACvB,MAAM,IAAIC,eAAAA,wBAAwB,KAAK,QAAQ,OAAO,QAAQ;CAG/D,MAAM,SAAS,OAAO;CACtB,IAAI,CAAC,QAAQ,MAAM,IAAIH,eAAAA,qBAAqB,GAAG;CAE/C,MAAM,SAAS,OAAO,aAAa,IAAI,QAAQ,KAAK,KAAA;CACpD,MAAM,WAAW,OAAO,aAAa,IAAI,UAAU,KAAK,KAAA;CACxD,MAAM,iBACL,OAAO,aAAa,IAAI,gBAAgB,MAAM,SAAS,OAAO,KAAA;CAC/D,MAAM,cAAc,cAAc,KAAK,MAAM;CAE7C,OAAO;EACN;EACA,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;EAC3B,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;EAC/B,GAAI,iBAAiB,EAAE,eAAe,IAAI,CAAC;EAC3C,GAAG;CACJ;AACD;;AAGA,SAAS,cACR,KACA,QACqD;CACrD,MAAM,cAAc,OAAO,KAAK,OAAO,QAAQ;CAC/C,MAAM,kBAAkB,OAAO,KAAK,OAAO,QAAQ;CACnD,IAAI,CAAC,eAAe,CAAC,iBAAiB,OAAO,CAAC;CAC9C,IAAI,CAAC,aACJ,MAAM,IAAIC,eAAAA,6BAA6B,KAAK,aAAa;CAE1D,IAAI,CAAC,iBACJ,MAAM,IAAIA,eAAAA,6BAA6B,KAAK,iBAAiB;CAE9D,OAAO;EAAE;EAAa;CAAgB;AACvC;AAEA,SAAS,OAAO,KAAa,OAAuB;CACnD,IAAI;EACH,OAAO,mBAAmB,KAAK;CAChC,QAAQ;EACP,MAAM,IAAIC,eAAAA,oBAAoB,GAAG;CAClC;AACD"}
package/dist/s3Url.d.cts CHANGED
@@ -12,7 +12,15 @@ declare namespace s3Url_d_exports {
12
12
  *
13
13
  * Both directions live here so they cannot drift: `parse(build(x))` is `x`.
14
14
  */
15
- /** What an S3 URL addresses. Credentials are deliberately absent — see below. */
15
+ /**
16
+ * What an S3 URL addresses, and optionally who it calls as.
17
+ *
18
+ * Credentials are optional and come as a pair. With them, the URL is a key
19
+ * scoped to this one bucket (`s3://KEY:SECRET@uploads`); without them the AWS
20
+ * SDK resolves its own chain — an execution role when deployed,
21
+ * `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY` otherwise. The URL's pair wins
22
+ * over that chain.
23
+ */
16
24
  export interface S3Address {
17
25
  bucket: string;
18
26
  /** Read off the bucket, never inherited: a bucket may live in another region. */
@@ -21,17 +29,23 @@ export interface S3Address {
21
29
  endpoint?: string;
22
30
  /** MinIO and most S3-compatible servers need path-style addressing. */
23
31
  forcePathStyle?: boolean;
32
+ /** The URL's own access key; always paired with `secretAccessKey`. */
33
+ accessKeyId?: string;
34
+ /** The URL's own secret; always paired with `accessKeyId`. */
35
+ secretAccessKey?: string;
24
36
  }
25
37
  /**
26
38
  * Compose an address into a URL.
27
39
  *
28
- * Credentials never appear. The AWS SDK resolves them from its own chain — an
29
- * execution role when deployed, `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY`
30
- * locally — so the URL stays safe to log and identical across environments that
31
- * differ only in who is calling.
40
+ * Credentials appear only when the address carries them, percent-encoded —
41
+ * AWS secrets routinely contain `/` and `+`. An address without them builds a
42
+ * URL with no userinfo, which leaves the caller to the SDK's own chain.
32
43
  */
33
44
  export declare function build(address: S3Address): string;
34
- /** Parse a URL back into an address. Throws if it is not an `s3://` URL. */
45
+ /**
46
+ * Parse a URL back into an address. Throws if it is not an `s3://` URL, or if
47
+ * its userinfo carries only one half of a key pair.
48
+ */
35
49
  export declare function parse(url: string): S3Address;
36
50
  //#endregion
37
51
  export { s3Url_d_exports as t };
@@ -1 +1 @@
1
- {"version":3,"file":"s3Url.d.cts","names":[],"sources":["../src/s3Url.ts"],"mappings":";;;;;;;;;;;;;;;iBAmBiB;EAChB;;EAEA;;EAEA;;EAEA;;;;;;;;;;wBAae,MAAM,SAAS;;wBAYf,MAAM,cAAc"}
1
+ {"version":3,"file":"s3Url.d.cts","names":[],"sources":["../src/s3Url.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;iBA4BiB;EAChB;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;wBAYe,MAAM,SAAS;;;;;wBAgCf,MAAM,cAAc"}
package/dist/s3Url.d.mts CHANGED
@@ -12,7 +12,15 @@ declare namespace s3Url_d_exports {
12
12
  *
13
13
  * Both directions live here so they cannot drift: `parse(build(x))` is `x`.
14
14
  */
15
- /** What an S3 URL addresses. Credentials are deliberately absent — see below. */
15
+ /**
16
+ * What an S3 URL addresses, and optionally who it calls as.
17
+ *
18
+ * Credentials are optional and come as a pair. With them, the URL is a key
19
+ * scoped to this one bucket (`s3://KEY:SECRET@uploads`); without them the AWS
20
+ * SDK resolves its own chain — an execution role when deployed,
21
+ * `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY` otherwise. The URL's pair wins
22
+ * over that chain.
23
+ */
16
24
  export interface S3Address {
17
25
  bucket: string;
18
26
  /** Read off the bucket, never inherited: a bucket may live in another region. */
@@ -21,17 +29,23 @@ export interface S3Address {
21
29
  endpoint?: string;
22
30
  /** MinIO and most S3-compatible servers need path-style addressing. */
23
31
  forcePathStyle?: boolean;
32
+ /** The URL's own access key; always paired with `secretAccessKey`. */
33
+ accessKeyId?: string;
34
+ /** The URL's own secret; always paired with `accessKeyId`. */
35
+ secretAccessKey?: string;
24
36
  }
25
37
  /**
26
38
  * Compose an address into a URL.
27
39
  *
28
- * Credentials never appear. The AWS SDK resolves them from its own chain — an
29
- * execution role when deployed, `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY`
30
- * locally — so the URL stays safe to log and identical across environments that
31
- * differ only in who is calling.
40
+ * Credentials appear only when the address carries them, percent-encoded —
41
+ * AWS secrets routinely contain `/` and `+`. An address without them builds a
42
+ * URL with no userinfo, which leaves the caller to the SDK's own chain.
32
43
  */
33
44
  export declare function build(address: S3Address): string;
34
- /** Parse a URL back into an address. Throws if it is not an `s3://` URL. */
45
+ /**
46
+ * Parse a URL back into an address. Throws if it is not an `s3://` URL, or if
47
+ * its userinfo carries only one half of a key pair.
48
+ */
35
49
  export declare function parse(url: string): S3Address;
36
50
  //#endregion
37
51
  export { s3Url_d_exports as t };
@@ -1 +1 @@
1
- {"version":3,"file":"s3Url.d.mts","names":[],"sources":["../src/s3Url.ts"],"mappings":";;;;;;;;;;;;;;;iBAmBiB;EAChB;;EAEA;;EAEA;;EAEA;;;;;;;;;;wBAae,MAAM,SAAS;;wBAYf,MAAM,cAAc"}
1
+ {"version":3,"file":"s3Url.d.mts","names":[],"sources":["../src/s3Url.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;iBA4BiB;EAChB;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;wBAYe,MAAM,SAAS;;;;;wBAgCf,MAAM,cAAc"}
package/dist/s3Url.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
- import { i as UnexpectedStorageScheme, n as MissingStorageBucket, t as MalformedStorageUrl } from "./errors-CpYcpJCY.mjs";
2
+ import { a as UnexpectedStorageScheme, n as MalformedStorageUrl, r as MissingStorageBucket, t as IncompleteStorageCredentials } from "./errors-COXs1iNg.mjs";
3
3
  //#region src/s3Url.ts
4
4
  /**
5
5
  * The `s3://` URL codec — how an S3 bucket is addressed as a single string.
@@ -20,21 +20,29 @@ const SCHEME = "s3:";
20
20
  /**
21
21
  * Compose an address into a URL.
22
22
  *
23
- * Credentials never appear. The AWS SDK resolves them from its own chain — an
24
- * execution role when deployed, `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY`
25
- * locally — so the URL stays safe to log and identical across environments that
26
- * differ only in who is calling.
23
+ * Credentials appear only when the address carries them, percent-encoded —
24
+ * AWS secrets routinely contain `/` and `+`. An address without them builds a
25
+ * URL with no userinfo, which leaves the caller to the SDK's own chain.
27
26
  */
28
27
  function build(address) {
29
- const { bucket, region, endpoint, forcePathStyle } = address;
28
+ const { bucket, region, endpoint, forcePathStyle, accessKeyId, secretAccessKey } = address;
30
29
  if (!bucket) throw new MissingStorageBucket("");
31
30
  const url = new URL(`${SCHEME}//${bucket}`);
31
+ if (accessKeyId || secretAccessKey) {
32
+ if (!accessKeyId) throw new IncompleteStorageCredentials(url.toString(), "accessKeyId");
33
+ if (!secretAccessKey) throw new IncompleteStorageCredentials(url.toString(), "secretAccessKey");
34
+ url.username = encodeURIComponent(accessKeyId);
35
+ url.password = encodeURIComponent(secretAccessKey);
36
+ }
32
37
  if (region) url.searchParams.set("region", region);
33
38
  if (endpoint) url.searchParams.set("endpoint", endpoint);
34
39
  if (forcePathStyle) url.searchParams.set("forcePathStyle", "true");
35
40
  return url.toString();
36
41
  }
37
- /** Parse a URL back into an address. Throws if it is not an `s3://` URL. */
42
+ /**
43
+ * Parse a URL back into an address. Throws if it is not an `s3://` URL, or if
44
+ * its userinfo carries only one half of a key pair.
45
+ */
38
46
  function parse(url) {
39
47
  let parsed;
40
48
  try {
@@ -48,13 +56,34 @@ function parse(url) {
48
56
  const region = parsed.searchParams.get("region") ?? void 0;
49
57
  const endpoint = parsed.searchParams.get("endpoint") ?? void 0;
50
58
  const forcePathStyle = parsed.searchParams.get("forcePathStyle") === "true" ? true : void 0;
59
+ const credentials = credentialsOf(url, parsed);
51
60
  return {
52
61
  bucket,
53
62
  ...region ? { region } : {},
54
63
  ...endpoint ? { endpoint } : {},
55
- ...forcePathStyle ? { forcePathStyle } : {}
64
+ ...forcePathStyle ? { forcePathStyle } : {},
65
+ ...credentials
66
+ };
67
+ }
68
+ /** The URL's userinfo as a key pair: both halves, or nothing. */
69
+ function credentialsOf(url, parsed) {
70
+ const accessKeyId = decode(url, parsed.username);
71
+ const secretAccessKey = decode(url, parsed.password);
72
+ if (!accessKeyId && !secretAccessKey) return {};
73
+ if (!accessKeyId) throw new IncompleteStorageCredentials(url, "accessKeyId");
74
+ if (!secretAccessKey) throw new IncompleteStorageCredentials(url, "secretAccessKey");
75
+ return {
76
+ accessKeyId,
77
+ secretAccessKey
56
78
  };
57
79
  }
80
+ function decode(url, value) {
81
+ try {
82
+ return decodeURIComponent(value);
83
+ } catch {
84
+ throw new MalformedStorageUrl(url);
85
+ }
86
+ }
58
87
  //#endregion
59
88
  export { build, parse, s3Url_exports as t };
60
89
 
@@ -1 +1 @@
1
- {"version":3,"file":"s3Url.mjs","names":[],"sources":["../src/s3Url.ts"],"sourcesContent":["/**\n * The `s3://` URL codec — how an S3 bucket is addressed as a single string.\n *\n * It lives beside the client rather than in a neutral package because `bucket`,\n * `region`, and `forcePathStyle` are S3's vocabulary. The neutral layer only\n * knows that a construct provides *one URL*; what that URL says is between the\n * component that composes it and the client that parses it. A `gs://` codec\n * would sit beside its own client and share nothing with this one.\n *\n * Both directions live here so they cannot drift: `parse(build(x))` is `x`.\n */\n\nimport {\n\tMalformedStorageUrl,\n\tMissingStorageBucket,\n\tUnexpectedStorageScheme,\n} from './errors';\n\n/** What an S3 URL addresses. Credentials are deliberately absent — see below. */\nexport interface S3Address {\n\tbucket: string;\n\t/** Read off the bucket, never inherited: a bucket may live in another region. */\n\tregion?: string;\n\t/** Set for S3-compatible backends such as MinIO. */\n\tendpoint?: string;\n\t/** MinIO and most S3-compatible servers need path-style addressing. */\n\tforcePathStyle?: boolean;\n}\n\nconst SCHEME = 's3:';\n\n/**\n * Compose an address into a URL.\n *\n * Credentials never appear. The AWS SDK resolves them from its own chain — an\n * execution role when deployed, `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY`\n * locally — so the URL stays safe to log and identical across environments that\n * differ only in who is calling.\n */\nexport function build(address: S3Address): string {\n\tconst { bucket, region, endpoint, forcePathStyle } = address;\n\tif (!bucket) throw new MissingStorageBucket('');\n\n\tconst url = new URL(`${SCHEME}//${bucket}`);\n\tif (region) url.searchParams.set('region', region);\n\tif (endpoint) url.searchParams.set('endpoint', endpoint);\n\tif (forcePathStyle) url.searchParams.set('forcePathStyle', 'true');\n\treturn url.toString();\n}\n\n/** Parse a URL back into an address. Throws if it is not an `s3://` URL. */\nexport function parse(url: string): S3Address {\n\tlet parsed: URL;\n\ttry {\n\t\tparsed = new URL(url);\n\t} catch {\n\t\tthrow new MalformedStorageUrl(url);\n\t}\n\n\tif (parsed.protocol !== SCHEME) {\n\t\tthrow new UnexpectedStorageScheme(url, SCHEME, parsed.protocol);\n\t}\n\n\tconst bucket = parsed.hostname;\n\tif (!bucket) throw new MissingStorageBucket(url);\n\n\tconst region = parsed.searchParams.get('region') ?? undefined;\n\tconst endpoint = parsed.searchParams.get('endpoint') ?? undefined;\n\tconst forcePathStyle =\n\t\tparsed.searchParams.get('forcePathStyle') === 'true' ? true : undefined;\n\n\treturn {\n\t\tbucket,\n\t\t...(region ? { region } : {}),\n\t\t...(endpoint ? { endpoint } : {}),\n\t\t...(forcePathStyle ? { forcePathStyle } : {}),\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,MAAM,SAAS;;;;;;;;;AAUf,SAAgB,MAAM,SAA4B;CACjD,MAAM,EAAE,QAAQ,QAAQ,UAAU,mBAAmB;CACrD,IAAI,CAAC,QAAQ,MAAM,IAAI,qBAAqB,EAAE;CAE9C,MAAM,MAAM,IAAI,IAAI,GAAG,OAAO,IAAI,QAAQ;CAC1C,IAAI,QAAQ,IAAI,aAAa,IAAI,UAAU,MAAM;CACjD,IAAI,UAAU,IAAI,aAAa,IAAI,YAAY,QAAQ;CACvD,IAAI,gBAAgB,IAAI,aAAa,IAAI,kBAAkB,MAAM;CACjE,OAAO,IAAI,SAAS;AACrB;;AAGA,SAAgB,MAAM,KAAwB;CAC7C,IAAI;CACJ,IAAI;EACH,SAAS,IAAI,IAAI,GAAG;CACrB,QAAQ;EACP,MAAM,IAAI,oBAAoB,GAAG;CAClC;CAEA,IAAI,OAAO,aAAa,QACvB,MAAM,IAAI,wBAAwB,KAAK,QAAQ,OAAO,QAAQ;CAG/D,MAAM,SAAS,OAAO;CACtB,IAAI,CAAC,QAAQ,MAAM,IAAI,qBAAqB,GAAG;CAE/C,MAAM,SAAS,OAAO,aAAa,IAAI,QAAQ,KAAK,KAAA;CACpD,MAAM,WAAW,OAAO,aAAa,IAAI,UAAU,KAAK,KAAA;CACxD,MAAM,iBACL,OAAO,aAAa,IAAI,gBAAgB,MAAM,SAAS,OAAO,KAAA;CAE/D,OAAO;EACN;EACA,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;EAC3B,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;EAC/B,GAAI,iBAAiB,EAAE,eAAe,IAAI,CAAC;CAC5C;AACD"}
1
+ {"version":3,"file":"s3Url.mjs","names":[],"sources":["../src/s3Url.ts"],"sourcesContent":["/**\n * The `s3://` URL codec — how an S3 bucket is addressed as a single string.\n *\n * It lives beside the client rather than in a neutral package because `bucket`,\n * `region`, and `forcePathStyle` are S3's vocabulary. The neutral layer only\n * knows that a construct provides *one URL*; what that URL says is between the\n * component that composes it and the client that parses it. A `gs://` codec\n * would sit beside its own client and share nothing with this one.\n *\n * Both directions live here so they cannot drift: `parse(build(x))` is `x`.\n */\n\nimport {\n\tIncompleteStorageCredentials,\n\tMalformedStorageUrl,\n\tMissingStorageBucket,\n\tUnexpectedStorageScheme,\n} from './errors';\n\n/**\n * What an S3 URL addresses, and optionally who it calls as.\n *\n * Credentials are optional and come as a pair. With them, the URL is a key\n * scoped to this one bucket (`s3://KEY:SECRET@uploads`); without them the AWS\n * SDK resolves its own chain — an execution role when deployed,\n * `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY` otherwise. The URL's pair wins\n * over that chain.\n */\nexport interface S3Address {\n\tbucket: string;\n\t/** Read off the bucket, never inherited: a bucket may live in another region. */\n\tregion?: string;\n\t/** Set for S3-compatible backends such as MinIO. */\n\tendpoint?: string;\n\t/** MinIO and most S3-compatible servers need path-style addressing. */\n\tforcePathStyle?: boolean;\n\t/** The URL's own access key; always paired with `secretAccessKey`. */\n\taccessKeyId?: string;\n\t/** The URL's own secret; always paired with `accessKeyId`. */\n\tsecretAccessKey?: string;\n}\n\nconst SCHEME = 's3:';\n\n/**\n * Compose an address into a URL.\n *\n * Credentials appear only when the address carries them, percent-encoded —\n * AWS secrets routinely contain `/` and `+`. An address without them builds a\n * URL with no userinfo, which leaves the caller to the SDK's own chain.\n */\nexport function build(address: S3Address): string {\n\tconst {\n\t\tbucket,\n\t\tregion,\n\t\tendpoint,\n\t\tforcePathStyle,\n\t\taccessKeyId,\n\t\tsecretAccessKey,\n\t} = address;\n\tif (!bucket) throw new MissingStorageBucket('');\n\n\tconst url = new URL(`${SCHEME}//${bucket}`);\n\tif (accessKeyId || secretAccessKey) {\n\t\tif (!accessKeyId) {\n\t\t\tthrow new IncompleteStorageCredentials(url.toString(), 'accessKeyId');\n\t\t}\n\t\tif (!secretAccessKey) {\n\t\t\tthrow new IncompleteStorageCredentials(url.toString(), 'secretAccessKey');\n\t\t}\n\t\turl.username = encodeURIComponent(accessKeyId);\n\t\turl.password = encodeURIComponent(secretAccessKey);\n\t}\n\tif (region) url.searchParams.set('region', region);\n\tif (endpoint) url.searchParams.set('endpoint', endpoint);\n\tif (forcePathStyle) url.searchParams.set('forcePathStyle', 'true');\n\treturn url.toString();\n}\n\n/**\n * Parse a URL back into an address. Throws if it is not an `s3://` URL, or if\n * its userinfo carries only one half of a key pair.\n */\nexport function parse(url: string): S3Address {\n\tlet parsed: URL;\n\ttry {\n\t\tparsed = new URL(url);\n\t} catch {\n\t\tthrow new MalformedStorageUrl(url);\n\t}\n\n\tif (parsed.protocol !== SCHEME) {\n\t\tthrow new UnexpectedStorageScheme(url, SCHEME, parsed.protocol);\n\t}\n\n\tconst bucket = parsed.hostname;\n\tif (!bucket) throw new MissingStorageBucket(url);\n\n\tconst region = parsed.searchParams.get('region') ?? undefined;\n\tconst endpoint = parsed.searchParams.get('endpoint') ?? undefined;\n\tconst forcePathStyle =\n\t\tparsed.searchParams.get('forcePathStyle') === 'true' ? true : undefined;\n\tconst credentials = credentialsOf(url, parsed);\n\n\treturn {\n\t\tbucket,\n\t\t...(region ? { region } : {}),\n\t\t...(endpoint ? { endpoint } : {}),\n\t\t...(forcePathStyle ? { forcePathStyle } : {}),\n\t\t...credentials,\n\t};\n}\n\n/** The URL's userinfo as a key pair: both halves, or nothing. */\nfunction credentialsOf(\n\turl: string,\n\tparsed: URL,\n): Pick<S3Address, 'accessKeyId' | 'secretAccessKey'> {\n\tconst accessKeyId = decode(url, parsed.username);\n\tconst secretAccessKey = decode(url, parsed.password);\n\tif (!accessKeyId && !secretAccessKey) return {};\n\tif (!accessKeyId) {\n\t\tthrow new IncompleteStorageCredentials(url, 'accessKeyId');\n\t}\n\tif (!secretAccessKey) {\n\t\tthrow new IncompleteStorageCredentials(url, 'secretAccessKey');\n\t}\n\treturn { accessKeyId, secretAccessKey };\n}\n\nfunction decode(url: string, value: string): string {\n\ttry {\n\t\treturn decodeURIComponent(value);\n\t} catch {\n\t\tthrow new MalformedStorageUrl(url);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0CA,MAAM,SAAS;;;;;;;;AASf,SAAgB,MAAM,SAA4B;CACjD,MAAM,EACL,QACA,QACA,UACA,gBACA,aACA,oBACG;CACJ,IAAI,CAAC,QAAQ,MAAM,IAAI,qBAAqB,EAAE;CAE9C,MAAM,MAAM,IAAI,IAAI,GAAG,OAAO,IAAI,QAAQ;CAC1C,IAAI,eAAe,iBAAiB;EACnC,IAAI,CAAC,aACJ,MAAM,IAAI,6BAA6B,IAAI,SAAS,GAAG,aAAa;EAErE,IAAI,CAAC,iBACJ,MAAM,IAAI,6BAA6B,IAAI,SAAS,GAAG,iBAAiB;EAEzE,IAAI,WAAW,mBAAmB,WAAW;EAC7C,IAAI,WAAW,mBAAmB,eAAe;CAClD;CACA,IAAI,QAAQ,IAAI,aAAa,IAAI,UAAU,MAAM;CACjD,IAAI,UAAU,IAAI,aAAa,IAAI,YAAY,QAAQ;CACvD,IAAI,gBAAgB,IAAI,aAAa,IAAI,kBAAkB,MAAM;CACjE,OAAO,IAAI,SAAS;AACrB;;;;;AAMA,SAAgB,MAAM,KAAwB;CAC7C,IAAI;CACJ,IAAI;EACH,SAAS,IAAI,IAAI,GAAG;CACrB,QAAQ;EACP,MAAM,IAAI,oBAAoB,GAAG;CAClC;CAEA,IAAI,OAAO,aAAa,QACvB,MAAM,IAAI,wBAAwB,KAAK,QAAQ,OAAO,QAAQ;CAG/D,MAAM,SAAS,OAAO;CACtB,IAAI,CAAC,QAAQ,MAAM,IAAI,qBAAqB,GAAG;CAE/C,MAAM,SAAS,OAAO,aAAa,IAAI,QAAQ,KAAK,KAAA;CACpD,MAAM,WAAW,OAAO,aAAa,IAAI,UAAU,KAAK,KAAA;CACxD,MAAM,iBACL,OAAO,aAAa,IAAI,gBAAgB,MAAM,SAAS,OAAO,KAAA;CAC/D,MAAM,cAAc,cAAc,KAAK,MAAM;CAE7C,OAAO;EACN;EACA,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;EAC3B,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;EAC/B,GAAI,iBAAiB,EAAE,eAAe,IAAI,CAAC;EAC3C,GAAG;CACJ;AACD;;AAGA,SAAS,cACR,KACA,QACqD;CACrD,MAAM,cAAc,OAAO,KAAK,OAAO,QAAQ;CAC/C,MAAM,kBAAkB,OAAO,KAAK,OAAO,QAAQ;CACnD,IAAI,CAAC,eAAe,CAAC,iBAAiB,OAAO,CAAC;CAC9C,IAAI,CAAC,aACJ,MAAM,IAAI,6BAA6B,KAAK,aAAa;CAE1D,IAAI,CAAC,iBACJ,MAAM,IAAI,6BAA6B,KAAK,iBAAiB;CAE9D,OAAO;EAAE;EAAa;CAAgB;AACvC;AAEA,SAAS,OAAO,KAAa,OAAuB;CACnD,IAAI;EACH,OAAO,mBAAmB,KAAK;CAChC,QAAQ;EACP,MAAM,IAAI,oBAAoB,GAAG;CAClC;AACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/storage",
3
- "version": "10.0.0-alpha.14",
3
+ "version": "10.0.0-alpha.141",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,6 +22,16 @@
22
22
  "default": "./dist/aws.cjs"
23
23
  }
24
24
  },
25
+ "./events": {
26
+ "import": {
27
+ "types": "./dist/events.d.mts",
28
+ "default": "./dist/events.mjs"
29
+ },
30
+ "require": {
31
+ "types": "./dist/events.d.cts",
32
+ "default": "./dist/events.cjs"
33
+ }
34
+ },
25
35
  ".": {
26
36
  "import": {
27
37
  "types": "./dist/index.d.mts",
@@ -46,13 +56,15 @@
46
56
  "files": [
47
57
  "dist"
48
58
  ],
49
- "dependencies": {},
59
+ "dependencies": {
60
+ "@opentelemetry/api": "~1.9.1"
61
+ },
50
62
  "peerDependencies": {
51
63
  "zod": ">=4.6.5",
52
64
  "@aws-sdk/client-s3": ">=3.1136.0",
53
65
  "@aws-sdk/s3-presigned-post": ">=3.1136.0",
54
66
  "@aws-sdk/s3-request-presigner": ">=3.1136.0",
55
- "@geekmidas/cache": "^10.0.0-alpha.14"
67
+ "@geekmidas/cache": "^10.0.0-alpha.141"
56
68
  },
57
69
  "peerDependenciesMeta": {
58
70
  "@geekmidas/cache": {
@@ -72,7 +84,10 @@
72
84
  }
73
85
  },
74
86
  "devDependencies": {
75
- "@geekmidas/cache": "^10.0.0-alpha.14"
87
+ "@opentelemetry/sdk-trace-node": "~2.11.0",
88
+ "@geekmidas/cache": "^10.0.0-alpha.141"
76
89
  },
77
- "scripts": {}
90
+ "scripts": {
91
+ "build": "tsdown --config ../../tsdown.config.ts --filter ."
92
+ }
78
93
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors-Bexjg-j-.cjs","names":[],"sources":["../src/errors.ts"],"sourcesContent":["/**\n * Storage errors — shared by every implementation, not just S3.\n *\n * A `gs://` or Azure client hits the same three problems as the S3 one: the\n * string is not a URL, it is a URL for a different provider, or it addresses no\n * bucket. Each carries the provider-specific detail as a field, so the type is\n * common while the specifics stay accurate.\n *\n * Messages state the rule, which is constant, and never interpolate the value.\n * An interpolated message cannot be matched on, reads differently every time it\n * is thrown, and carries user input into every log line that touches it.\n */\n\n/** Base for anything wrong with a storage URL, so callers may catch broadly. */\nexport abstract class StorageUrlError extends Error {\n\t/** The URL that could not be used. */\n\treadonly url: string;\n\n\tconstructor(url: string, message: string) {\n\t\tsuper(message);\n\t\tthis.url = url;\n\t\tthis.name = new.target.name;\n\t}\n}\n\n/** The string is not a URL at all. */\nexport class MalformedStorageUrl extends StorageUrlError {\n\tconstructor(url: string) {\n\t\tsuper(url, 'Not a valid URL');\n\t}\n}\n\n/**\n * A URL, but for a different provider — a `gs://` URL reaching the S3 client,\n * or the reverse. The usual cause is a construct resolving against the wrong\n * target, which is worth distinguishing from a malformed string.\n */\nexport class UnexpectedStorageScheme extends StorageUrlError {\n\t/** The scheme this client handles, e.g. `'s3:'`. */\n\treadonly expected: string;\n\t/** The scheme the URL actually carried, e.g. `'gs:'`. */\n\treadonly actual: string;\n\n\tconstructor(url: string, expected: string, actual: string) {\n\t\tsuper(url, 'Storage URL is for a different provider');\n\t\tthis.expected = expected;\n\t\tthis.actual = actual;\n\t}\n}\n\n/**\n * A well-formed URL that addresses no bucket.\n *\n * \"Bucket\" is the term S3 and GCS share; Azure calls the same thing a\n * container. One error covers all three — the word in the message is the\n * common one rather than a new abstraction nobody uses.\n */\nexport class MissingStorageBucket extends StorageUrlError {\n\tconstructor(url: string) {\n\t\tsuper(url, 'Storage URL must address a bucket');\n\t}\n}\n\n/**\n * No driver is registered for the URL's scheme.\n *\n * Usually means the build pinned a driver for a different target, or an entry\n * point registered nothing at all — so the registered schemes are carried\n * alongside, since \"what *is* available\" is the actionable half.\n */\nexport class UnregisteredStorageScheme extends StorageUrlError {\n\t/** The scheme that had no driver, e.g. `'gs:'`. */\n\treadonly scheme: string;\n\t/** What is registered, so the caller can see what was pinned instead. */\n\treadonly registered: readonly string[];\n\n\tconstructor(url: string, scheme: string, registered: readonly string[]) {\n\t\tsuper(url, 'No storage driver is registered for this URL scheme');\n\t\tthis.scheme = scheme;\n\t\tthis.registered = registered;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAcA,IAAsB,kBAAtB,cAA8C,MAAM;;CAEnD;CAEA,YAAY,KAAa,SAAiB;EACzC,MAAM,OAAO;EACb,KAAK,MAAM;EACX,KAAK,OAAO,WAAW;CACxB;AACD;;AAGA,IAAa,sBAAb,cAAyC,gBAAgB;CACxD,YAAY,KAAa;EACxB,MAAM,KAAK,iBAAiB;CAC7B;AACD;;;;;;AAOA,IAAa,0BAAb,cAA6C,gBAAgB;;CAE5D;;CAEA;CAEA,YAAY,KAAa,UAAkB,QAAgB;EAC1D,MAAM,KAAK,yCAAyC;EACpD,KAAK,WAAW;EAChB,KAAK,SAAS;CACf;AACD;;;;;;;;AASA,IAAa,uBAAb,cAA0C,gBAAgB;CACzD,YAAY,KAAa;EACxB,MAAM,KAAK,mCAAmC;CAC/C;AACD;;;;;;;;AASA,IAAa,4BAAb,cAA+C,gBAAgB;;CAE9D;;CAEA;CAEA,YAAY,KAAa,QAAgB,YAA+B;EACvE,MAAM,KAAK,qDAAqD;EAChE,KAAK,SAAS;EACd,KAAK,aAAa;CACnB;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors-CpYcpJCY.mjs","names":[],"sources":["../src/errors.ts"],"sourcesContent":["/**\n * Storage errors — shared by every implementation, not just S3.\n *\n * A `gs://` or Azure client hits the same three problems as the S3 one: the\n * string is not a URL, it is a URL for a different provider, or it addresses no\n * bucket. Each carries the provider-specific detail as a field, so the type is\n * common while the specifics stay accurate.\n *\n * Messages state the rule, which is constant, and never interpolate the value.\n * An interpolated message cannot be matched on, reads differently every time it\n * is thrown, and carries user input into every log line that touches it.\n */\n\n/** Base for anything wrong with a storage URL, so callers may catch broadly. */\nexport abstract class StorageUrlError extends Error {\n\t/** The URL that could not be used. */\n\treadonly url: string;\n\n\tconstructor(url: string, message: string) {\n\t\tsuper(message);\n\t\tthis.url = url;\n\t\tthis.name = new.target.name;\n\t}\n}\n\n/** The string is not a URL at all. */\nexport class MalformedStorageUrl extends StorageUrlError {\n\tconstructor(url: string) {\n\t\tsuper(url, 'Not a valid URL');\n\t}\n}\n\n/**\n * A URL, but for a different provider — a `gs://` URL reaching the S3 client,\n * or the reverse. The usual cause is a construct resolving against the wrong\n * target, which is worth distinguishing from a malformed string.\n */\nexport class UnexpectedStorageScheme extends StorageUrlError {\n\t/** The scheme this client handles, e.g. `'s3:'`. */\n\treadonly expected: string;\n\t/** The scheme the URL actually carried, e.g. `'gs:'`. */\n\treadonly actual: string;\n\n\tconstructor(url: string, expected: string, actual: string) {\n\t\tsuper(url, 'Storage URL is for a different provider');\n\t\tthis.expected = expected;\n\t\tthis.actual = actual;\n\t}\n}\n\n/**\n * A well-formed URL that addresses no bucket.\n *\n * \"Bucket\" is the term S3 and GCS share; Azure calls the same thing a\n * container. One error covers all three — the word in the message is the\n * common one rather than a new abstraction nobody uses.\n */\nexport class MissingStorageBucket extends StorageUrlError {\n\tconstructor(url: string) {\n\t\tsuper(url, 'Storage URL must address a bucket');\n\t}\n}\n\n/**\n * No driver is registered for the URL's scheme.\n *\n * Usually means the build pinned a driver for a different target, or an entry\n * point registered nothing at all — so the registered schemes are carried\n * alongside, since \"what *is* available\" is the actionable half.\n */\nexport class UnregisteredStorageScheme extends StorageUrlError {\n\t/** The scheme that had no driver, e.g. `'gs:'`. */\n\treadonly scheme: string;\n\t/** What is registered, so the caller can see what was pinned instead. */\n\treadonly registered: readonly string[];\n\n\tconstructor(url: string, scheme: string, registered: readonly string[]) {\n\t\tsuper(url, 'No storage driver is registered for this URL scheme');\n\t\tthis.scheme = scheme;\n\t\tthis.registered = registered;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAcA,IAAsB,kBAAtB,cAA8C,MAAM;;CAEnD;CAEA,YAAY,KAAa,SAAiB;EACzC,MAAM,OAAO;EACb,KAAK,MAAM;EACX,KAAK,OAAO,WAAW;CACxB;AACD;;AAGA,IAAa,sBAAb,cAAyC,gBAAgB;CACxD,YAAY,KAAa;EACxB,MAAM,KAAK,iBAAiB;CAC7B;AACD;;;;;;AAOA,IAAa,0BAAb,cAA6C,gBAAgB;;CAE5D;;CAEA;CAEA,YAAY,KAAa,UAAkB,QAAgB;EAC1D,MAAM,KAAK,yCAAyC;EACpD,KAAK,WAAW;EAChB,KAAK,SAAS;CACf;AACD;;;;;;;;AASA,IAAa,uBAAb,cAA0C,gBAAgB;CACzD,YAAY,KAAa;EACxB,MAAM,KAAK,mCAAmC;CAC/C;AACD;;;;;;;;AASA,IAAa,4BAAb,cAA+C,gBAAgB;;CAE9D;;CAEA;CAEA,YAAY,KAAa,QAAgB,YAA+B;EACvE,MAAM,KAAK,qDAAqD;EAChE,KAAK,SAAS;EACd,KAAK,aAAa;CACnB;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry-ClEvHGpM.d.cts","names":[],"sources":["../src/StorageClient.ts","../src/registry.ts"],"mappings":";;UACiB;EAChB;EACA,WAAW;;aAGA;EACX;EACA;EACA;;UAGgB;WACP,UAAU;WACV,QAAQ;;;;;;;;;EASjB,aAAa,QAAQ,iBAAiB,qBAAqB;;;;;;;;;EAU3D,eAAe,MAAM,MAAM,qBAAqB;;;;;;EAMhD,YAAY,cAAc,QAAQ;;;;;;;EAQlC,sBAAsB,MAAM,MAAM,oBAAoB;;;;;;;EAOtD,OACC,aACA,eAAe,QACf,sBACE;;;;;;;EAOH,UACC,QAAQ,iBACR,qBACE,QAAQ;;;;;;EAMX,OAAO,cAAc;;UAGL;EAChB;EACA;EACA;;KAGW;EACX;EACA;;KAGW;EACX;EACA,QAAQ;;UAGQ;EAChB;EACA;;;;;EAKA;;;;;;EAMA;;;;;;;;;;UClFgB;;WAEP;EACT,OAAO,cAAc;;;iBAMN,sBAAsB,QAAQ;;iBAK9B;;;;;;;iBAUA,oBAAoB,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry-ClEvHGpM.d.mts","names":[],"sources":["../src/StorageClient.ts","../src/registry.ts"],"mappings":";;UACiB;EAChB;EACA,WAAW;;aAGA;EACX;EACA;EACA;;UAGgB;WACP,UAAU;WACV,QAAQ;;;;;;;;;EASjB,aAAa,QAAQ,iBAAiB,qBAAqB;;;;;;;;;EAU3D,eAAe,MAAM,MAAM,qBAAqB;;;;;;EAMhD,YAAY,cAAc,QAAQ;;;;;;;EAQlC,sBAAsB,MAAM,MAAM,oBAAoB;;;;;;;EAOtD,OACC,aACA,eAAe,QACf,sBACE;;;;;;;EAOH,UACC,QAAQ,iBACR,qBACE,QAAQ;;;;;;EAMX,OAAO,cAAc;;UAGL;EAChB;EACA;EACA;;KAGW;EACX;EACA;;KAGW;EACX;EACA,QAAQ;;UAGQ;EAChB;EACA;;;;;EAKA;;;;;;EAMA;;;;;;;;;;UClFgB;;WAEP;EACT,OAAO,cAAc;;;iBAMN,sBAAsB,QAAQ;;iBAK9B;;;;;;;iBAUA,oBAAoB,cAAc"}