@healthzkit/s3 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared-BiUsKU63.mjs +1 -0
- package/dist/shared-Cke9Ly0-.d.mts +12 -0
- package/dist/v2.d.mts +1 -1
- package/dist/v2.mjs +1 -1
- package/dist/v3.d.mts +1 -1
- package/dist/v3.mjs +1 -1
- package/package.json +4 -2
- package/dist/dist-iC8gGE1z.mjs +0 -1
- package/dist/shared-B_GiMpA1.d.mts +0 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{buildErrorResult as e,buildResult as t}from"@healthzkit/shared";export{t as n,e as t};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HealthAdapter, MetadataFn } from "@healthzkit/shared";
|
|
2
|
+
|
|
3
|
+
//#region src/shared.d.ts
|
|
4
|
+
interface BaseS3Options<TClient> {
|
|
5
|
+
/**
|
|
6
|
+
* Optional function to populate metadata in the check result.
|
|
7
|
+
* Receives the resolved client so you can run additional operations.
|
|
8
|
+
*/
|
|
9
|
+
metadata?: MetadataFn<TClient>;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { HealthAdapter as n, BaseS3Options as t };
|
package/dist/v2.d.mts
CHANGED
package/dist/v2.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./
|
|
1
|
+
import{n as e,t}from"./shared-BiUsKU63.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};
|
package/dist/v3.d.mts
CHANGED
package/dist/v3.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./
|
|
1
|
+
import{n as e,t}from"./shared-BiUsKU63.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};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@healthzkit/s3",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@healthzkit/shared": "0.0.0"
|
|
25
|
+
},
|
|
23
26
|
"devDependencies": {
|
|
24
27
|
"@aws-sdk/client-s3": "^3.1053.0",
|
|
25
28
|
"@types/node": "^24",
|
|
@@ -28,7 +31,6 @@
|
|
|
28
31
|
"bumpp": "^11.1.0",
|
|
29
32
|
"typescript": "^5",
|
|
30
33
|
"vite-plus": "latest",
|
|
31
|
-
"@healthzkit/shared": "0.0.0",
|
|
32
34
|
"healthzkit": "0.0.3"
|
|
33
35
|
},
|
|
34
36
|
"peerDependencies": {
|
package/dist/dist-iC8gGE1z.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,16 +0,0 @@
|
|
|
1
|
-
import { HealthAdapter } from "healthzkit";
|
|
2
|
-
|
|
3
|
-
//#region ../../tools/shared/dist/index.d.mts
|
|
4
|
-
//#region src/index.d.ts
|
|
5
|
-
type MetadataFn<TClient> = (client: TClient) => Promise<Record<string, unknown>> | Record<string, unknown>;
|
|
6
|
-
//#endregion
|
|
7
|
-
//#region src/shared.d.ts
|
|
8
|
-
interface BaseS3Options<TClient> {
|
|
9
|
-
/**
|
|
10
|
-
* Optional function to populate metadata in the check result.
|
|
11
|
-
* Receives the resolved client so you can run additional operations.
|
|
12
|
-
*/
|
|
13
|
-
metadata?: MetadataFn<TClient>;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { HealthAdapter as n, BaseS3Options as t };
|