manage-storage 0.0.5 → 0.0.8

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "manage-storage",
3
- "version": "0.0.5",
4
- "description": "Storage manager supporting AWS S3, Cloudflare R2, and Backblaze B2 with automatic provider detection",
3
+ "version": "0.0.8",
4
+ "description": "Storage manager supporting AWS S3, Backblaze B2, and Cloudflare R2 with automatic provider detection",
5
5
  "main": "./dist/manage-storage.js",
6
6
  "module": "./dist/manage-storage.js",
7
7
  "types": "./dist/manage-storage.d.ts",
@@ -9,26 +9,24 @@
9
9
  "keywords": [
10
10
  "s3",
11
11
  "r2",
12
+ "b2",
12
13
  "cloudflare",
13
14
  "backblaze",
14
- "b2",
15
+ "aws",
16
+ "amazon",
15
17
  "storage",
16
18
  "cloud",
17
- "aws",
18
- "object-storage",
19
+ "cloud-storage",
20
+ "file-storage",
19
21
  "multi-cloud"
20
22
  ],
21
23
  "author": "vtempest",
22
24
  "license": "MIT",
23
25
  "repository": {
24
26
  "type": "git",
25
- "url": "https://github.com/vtempest/Starter-DOCS.git",
26
- "directory": "storage"
27
- },
28
- "bugs": {
29
- "url": "https://github.com/vtempest/Starter-DOCS/issues"
27
+ "url": "https://github.com/OpenSourceAGI/appdemo-dev-tools/tree/master/packages/manage-storage"
30
28
  },
31
- "homepage": "https://github.com/vtempest/Starter-DOCS#readme",
29
+ "homepage": "https://github.com/OpenSourceAGI/appdemo-dev-tools/tree/master/packages/manage-storage",
32
30
  "dependencies": {
33
31
  "@aws-sdk/client-s3": "^3.965.0",
34
32
  "dotenv": "^17.2.3"
@@ -1 +0,0 @@
1
- import{t as e,f as t}from"./manage-storage-B0amn6is.js";class r{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:e,serializer:t,deserializer:r,serdeContext:i,defaultContentType:s}){this.marshaller=e,this.serializer=t,this.deserializer=r,this.serdeContext=i,this.defaultContentType=s}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:r}){const i=this.marshaller,s=t.getEventStreamMember(),n=t.getMemberSchema(s),a=this.serializer,o=this.defaultContentType,l=/* @__PURE__ */Symbol("initialRequestMarker"),c={async*[Symbol.asyncIterator](){if(r){const e={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:o}};a.write(t,r);const i=a.flush();yield{[l]:!0,headers:e,body:i}}for await(const t of e)yield t}};return i.serialize(c,e=>{if(e[l])return{headers:e.headers,body:e.body};const t=Object.keys(e).find(e=>"__type"!==e)??"",{additionalHeaders:r,body:i,eventType:s,explicitPayloadContentType:a}=this.writeEventBody(t,n,e);return{headers:{":event-type":{type:"string",value:s},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:a??o},...r},body:i}})}async deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:i}){const s=this.marshaller,n=r.getEventStreamMember(),a=r.getMemberSchema(n).getMemberSchemas(),o=/* @__PURE__ */Symbol("initialResponseMarker"),l=s.deserialize(t.body,async t=>{const i=Object.keys(t).find(e=>"__type"!==e)??"",s=t[i].body;if("initial-response"===i){const e=await this.deserializer.read(r,s);return delete e[n],{[o]:!0,...e}}if(i in a){const r=a[i];if(r.isStructSchema()){const n={};let a=!1;for(const[o,l]of r.structIterator()){const{eventHeader:r,eventPayload:c}=l.getMergedTraits();if(a=a||Boolean(r||c),c)l.isBlobSchema()?n[o]=s:l.isStringSchema()?n[o]=(this.serdeContext?.utf8Encoder??e)(s):l.isStructSchema()&&(n[o]=await this.deserializer.read(l,s));else if(r){const e=t[i].headers[o]?.value;null!=e&&(l.isNumericSchema()?n[o]=e&&"object"==typeof e&&"bytes"in e?BigInt(e.toString()):Number(e):n[o]=e)}}if(a)return{[i]:n}}return{[i]:await this.deserializer.read(r,s)}}return{$unknown:t}}),c=l[Symbol.asyncIterator](),d=await c.next();if(d.done)return l;if(d.value?.[o]){if(!r)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(const[e,t]of Object.entries(d.value))i[e]=t}return{async*[Symbol.asyncIterator](){for(d?.value?.[o]||(yield d.value);;){const{done:e,value:t}=await c.next();if(e)break;yield t}}}}writeEventBody(e,r,i){const s=this.serializer;let n,a=e,o=null;const l={};if(r.getSchema()[4].includes(e)){const t=r.getMemberSchema(e);if(!t.isStructSchema())throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.");for(const[r,s]of t.structIterator()){const{eventHeader:t,eventPayload:n}=s.getMergedTraits();if(n)o=r;else if(t){const t=i[e][r];let n="binary";s.isNumericSchema()?n=(-2)**31<=t&&t<=2**31-1?"integer":"long":s.isTimestampSchema()?n="timestamp":s.isStringSchema()?n="string":s.isBooleanSchema()&&(n="boolean"),null!=t&&(l[r]={type:n,value:t},delete i[e][r])}}if(null!==o){const r=t.getMemberSchema(o);r.isBlobSchema()?n="application/octet-stream":r.isStringSchema()&&(n="text/plain"),s.write(r,i[e][o])}else s.write(t,i[e])}else{const[t,r]=i[e];a=t,s.write(15,r)}const c=s.flush();return{body:"string"==typeof c?(this.serdeContext?.utf8Decoder??t)(c):c,eventType:a,explicitPayloadContentType:n,additionalHeaders:l}}}export{r as EventStreamSerde};