@healthzkit/s3 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- function e(e,t){return{status:`ok`,metadata:{...t,latencyMs:e}}}function t(e){return{status:`fail`,error:e instanceof Error?e:Error(String(e))}}export{e as n,t};
1
+ function e(e,t){return{status:`ok`,metadata:{...t,latencyMs:e}}}function t(e){return{status:`fail`,error:e instanceof Error?e:Error(String(e))}}export{t as n,e as t};
@@ -1,7 +1,10 @@
1
1
  import { HealthAdapter } from "healthzkit";
2
2
 
3
- //#region src/shared.d.ts
3
+ //#region ../../tools/shared/dist/index.d.mts
4
+ //#region src/index.d.ts
4
5
  type MetadataFn<TClient> = (client: TClient) => Promise<Record<string, unknown>> | Record<string, unknown>;
6
+ //#endregion
7
+ //#region src/shared.d.ts
5
8
  interface BaseS3Options<TClient> {
6
9
  /**
7
10
  * Optional function to populate metadata in the check result.
package/dist/v2.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as HealthAdapter, t as BaseS3Options } from "./shared-B3WTV2_N.mjs";
1
+ import { n as HealthAdapter, t as BaseS3Options } from "./shared-B_GiMpA1.mjs";
2
2
  import AWS from "aws-sdk";
3
3
 
4
4
  //#region src/v2.d.ts
package/dist/v2.mjs CHANGED
@@ -1 +1 @@
1
- import{n as e,t}from"./shared-B-1hAtzF.mjs";function n(n){let r=null;async function i(){if(`client`in n&&n.client)return n.client;if(!r){let{default:e}=await import(`aws-sdk`);r=new e.S3(n.config??{})}return r}return{async check(){try{let t=await i(),r=Date.now(),a=await new Promise((e,n)=>{t.listBuckets((t,r)=>{t?n(t):e(r)})}),o=Date.now()-r,s=n.metadata?n.metadata(t):void 0,c=s instanceof Promise?await s:s,l=a.Buckets?.length??0;return e(o,{...c,bucketCount:l})}catch(e){return t(e)}}}}export{n as s3V2Adapter};
1
+ import{n as e,t}from"./dist-iC8gGE1z.mjs";function n(n){let r=null;async function i(){if(`client`in n&&n.client)return n.client;if(!r){let{default:e}=await import(`aws-sdk`);r=new e.S3(n.config??{})}return r}return{async check(){try{let e=await i(),r=Date.now(),a=await new Promise((t,n)=>{e.listBuckets((e,r)=>{e?n(e):t(r)})}),o=Date.now()-r,s=n.metadata?n.metadata(e):void 0,c=s instanceof Promise?await s:s,l=a.Buckets?.length??0;return t(o,{...c,bucketCount:l})}catch(t){return e(t)}}}}export{n as s3V2Adapter};
package/dist/v3.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as HealthAdapter, t as BaseS3Options } from "./shared-B3WTV2_N.mjs";
1
+ import { n as HealthAdapter, t as BaseS3Options } from "./shared-B_GiMpA1.mjs";
2
2
  import { S3Client, S3ClientConfig } from "@aws-sdk/client-s3";
3
3
 
4
4
  //#region src/v3.d.ts
package/dist/v3.mjs CHANGED
@@ -1 +1 @@
1
- import{n as e,t}from"./shared-B-1hAtzF.mjs";function n(n){let r=null;async function i(){if(`client`in n&&n.client)return n.client;if(!r){let{S3Client:e}=await import(`@aws-sdk/client-s3`);r=new e(n.config??{})}return r}return{async check(){try{let t=await i(),r=Date.now(),{ListBucketsCommand:a}=await import(`@aws-sdk/client-s3`),o=await t.send(new a({})),s=Date.now()-r,c=n.metadata?n.metadata(t):void 0,l=c instanceof Promise?await c:c,u=o.Buckets?.length??0;return e(s,{...l,bucketCount:u})}catch(e){return t(e)}}}}export{n as s3V3Adapter};
1
+ import{n as e,t}from"./dist-iC8gGE1z.mjs";function n(n){let r=null;async function i(){if(`client`in n&&n.client)return n.client;if(!r){let{S3Client:e}=await import(`@aws-sdk/client-s3`);r=new e(n.config??{})}return r}return{async check(){try{let e=await i(),r=Date.now(),{ListBucketsCommand:a}=await import(`@aws-sdk/client-s3`),o=await e.send(new a({})),s=Date.now()-r,c=n.metadata?n.metadata(e):void 0,l=c instanceof Promise?await c:c,u=o.Buckets?.length??0;return t(s,{...l,bucketCount:u})}catch(t){return e(t)}}}}export{n as s3V3Adapter};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@healthzkit/s3",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "license": "AGPL-3.0-only",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,13 +22,14 @@
22
22
  },
23
23
  "devDependencies": {
24
24
  "@aws-sdk/client-s3": "^3.1053.0",
25
- "@types/node": "^25.6.2",
25
+ "@types/node": "^24",
26
26
  "@typescript/native-preview": "7.0.0-dev.20260509.2",
27
27
  "aws-sdk": "2.1693.0",
28
28
  "bumpp": "^11.1.0",
29
- "typescript": "^6.0.3",
30
- "vite-plus": "^0.1.20",
31
- "healthzkit": "0.0.2"
29
+ "typescript": "^5",
30
+ "vite-plus": "latest",
31
+ "@healthzkit/shared": "0.0.0",
32
+ "healthzkit": "0.0.3"
32
33
  },
33
34
  "peerDependencies": {
34
35
  "@aws-sdk/client-s3": ">=3.0.0",