create-sailor 1.3.3 → 1.3.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/README.md +18 -28
- package/dist/aws-kms-BRGZLC2X.js +1 -0
- package/dist/chunk-2VIWVVHK.js +1 -0
- package/dist/chunk-4F23MJOI.js +1 -0
- package/dist/chunk-6EI2BXXZ.js +1 -0
- package/dist/chunk-7DCGNQSQ.js +5 -0
- package/dist/chunk-7HOF72FC.js +1 -0
- package/dist/chunk-7VJYOZUP.js +2 -0
- package/dist/chunk-7Z3O7WJM.js +49 -0
- package/dist/chunk-B35GFLVZ.js +5 -0
- package/dist/chunk-BAI5W3AB.js +1 -0
- package/dist/chunk-DGJUBN33.js +1 -0
- package/dist/chunk-DIXI4M5O.js +1 -0
- package/dist/chunk-EA5HU2X4.js +9 -0
- package/dist/chunk-EXLRPVEX.js +1 -0
- package/dist/chunk-FGJ5K4WM.js +1 -0
- package/dist/chunk-HC3S5NWW.js +1 -0
- package/dist/chunk-KIX47M2V.js +40 -0
- package/dist/chunk-LOPYJ44X.js +31 -0
- package/dist/chunk-O3WYNHSC.js +20 -0
- package/dist/chunk-OJM5Y4UT.js +1 -0
- package/dist/chunk-PXU2OOBT.js +1 -0
- package/dist/chunk-QEIMNOY2.js +1 -0
- package/dist/chunk-QMKVUKS6.js +1 -0
- package/dist/chunk-RR5R4AKJ.js +1 -0
- package/dist/chunk-XSSPJU77.js +1 -0
- package/dist/chunk-YW4FFW47.js +1 -0
- package/dist/chunk-ZEEOYOWD.js +1 -0
- package/dist/credits-L2HL2UEU.js +1787 -0
- package/dist/dist-XS6SQF6X.js +5 -0
- package/dist/dist-Z6UUHTH2.js +8 -0
- package/dist/dist-es-M3FWVZJF.js +1 -0
- package/dist/dist-es-NDZJSZR3.js +2 -0
- package/dist/dist-es-NVFYVK4E.js +1 -0
- package/dist/dist-es-OUTR3NFA.js +5 -0
- package/dist/dist-es-UGE2JJUB.js +1 -0
- package/dist/dist-es-VHZAJVLW.js +1 -0
- package/dist/dist-es-WTYBIVJ2.js +2 -0
- package/dist/event-streams-WTP73PI5.js +1 -0
- package/dist/getMachineId-bsd-DVN24SFH.js +1 -0
- package/dist/getMachineId-darwin-LMU6AYNV.js +2 -0
- package/dist/getMachineId-linux-BHWLMOUW.js +1 -0
- package/dist/getMachineId-unsupported-G5LY7Y3J.js +1 -0
- package/dist/getMachineId-win-CWK62SDK.js +1 -0
- package/dist/index.js +2 -2
- package/dist/loadSso-O5OGD76B.js +1 -0
- package/dist/local-V5XPOCXA.js +1 -0
- package/dist/multipart-parser-73SROTP5.js +2 -0
- package/dist/query_compiler_fast_bg.postgresql-7BFUBDOL.js +2 -0
- package/dist/query_compiler_fast_bg.postgresql.wasm-base64-I4FAC6EL.js +1 -0
- package/dist/signin-DZIPNQBV.js +1 -0
- package/dist/src-BFSJ5KFS.js +3 -0
- package/dist/src-ERQKJBBE.js +1 -0
- package/dist/sso-oidc-SYBBWZG3.js +1 -0
- package/dist/sts-DREA5KZD.js +6 -0
- package/package.json +12 -14
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# create-sailor
|
|
2
2
|
|
|
3
|
-
> AI-native SaaS
|
|
3
|
+
> Governed scaffolding for AI-native SaaS. Bootstrap the Nebutra Sailor platform baseline with multi-tenant foundations, region-aware defaults, and production-ready AI integrations.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/create-sailor)
|
|
6
6
|
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
7
|
-
[](https://nebutra.com/licensing)
|
|
8
8
|
|
|
9
9
|
## Quick Start
|
|
10
10
|
|
|
@@ -24,19 +24,11 @@ bunx create-sailor@latest
|
|
|
24
24
|
|
|
25
25
|
## What You Get
|
|
26
26
|
|
|
27
|
-
- **
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- **Monitoring**: Sentry / Datadog / 阿里云 ARMS / 听云
|
|
33
|
-
- **Analytics**: PostHog / Plausible / Umami / 百度统计 / 神策 / GrowingIO
|
|
34
|
-
- **SMS**: Twilio / 阿里云短信 / 腾讯云短信 / 云片
|
|
35
|
-
- **Payment**: Stripe / Lemon Squeezy / 微信支付 / 支付宝
|
|
36
|
-
- **Social login (CN)**: 微信开放平台 · QQ · 钉钉 · 企业微信 · 飞书 · 微博
|
|
37
|
-
- **中国合规套件**: ICP 备案 · 公安备案 · Cookie 弹窗 · AIGC 算法备案声明 · 隐私政策模板
|
|
38
|
-
- **White-label**: `brand.config.ts` 一键换品牌(colors · domains · logos · SEO)
|
|
39
|
-
- **AGPL-3.0 + Commercial Exception**(Individual / OPC 免费)
|
|
27
|
+
- **Governed platform baseline** — web app, marketing site, API gateway, docs, Storybook, studio, and supporting infra packages scaffolded as one coherent monorepo
|
|
28
|
+
- **Verified scaffolding path** — region-aware defaults, template checks, and reproducible project bootstrap instead of hand-assembling a starter stack
|
|
29
|
+
- **AI runtime foundation** — provider registry, Vercel AI SDK v5, OpenAI-compatible endpoints, and agent-ready packages wired into the platform baseline
|
|
30
|
+
- **Global + China delivery surface** — email, storage, monitoring, analytics, SMS, payments, and CN social login options selected through one scaffolding flow
|
|
31
|
+
- **Brand, tenant, and compliance primitives** — white-label branding, multi-tenant foundations, and China-market compliance scaffolding already wired in
|
|
40
32
|
|
|
41
33
|
## Usage
|
|
42
34
|
|
|
@@ -133,19 +125,17 @@ pnpm generate:api-types
|
|
|
133
125
|
|
|
134
126
|
## Why Sailor?
|
|
135
127
|
|
|
136
|
-
|
|
137
|
-
for
|
|
138
|
-
|
|
139
|
-
scratch.
|
|
128
|
+
Sailor is not a thin starter with a long feature checklist. It is the governed
|
|
129
|
+
platform baseline Nebutra uses for AI-native SaaS: auth, billing, branding,
|
|
130
|
+
docs, tenant-aware app structure, and AI integration are scaffolded into a
|
|
131
|
+
single monorepo you can extend instead of re-assembling from scratch.
|
|
140
132
|
|
|
141
133
|
## Roadmap
|
|
142
134
|
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
- 🔜 **v1.4** — `nebutra add <feature>` with remote registry
|
|
148
|
-
- 🔜 **v1.5** — Interactive AI Welcome page with onboarding assistant
|
|
135
|
+
- **Verified scaffolding** — immutable template delivery, scaffold smoke validation, and safer bootstrap defaults
|
|
136
|
+
- **Remote feature registry** — `nebutra add` with compatibility checks, provider awareness, and controlled file application
|
|
137
|
+
- **Harness runtime** — stronger MCP, agent, and automation primitives for AI-native SaaS workflows
|
|
138
|
+
- **Upgrade path** — version-aware migrations, diagnostics, and guided adoption of new platform capabilities
|
|
149
139
|
|
|
150
140
|
## Documentation
|
|
151
141
|
|
|
@@ -156,10 +146,10 @@ scratch.
|
|
|
156
146
|
|
|
157
147
|
## License
|
|
158
148
|
|
|
159
|
-
AGPL-3.0 with
|
|
149
|
+
AGPL-3.0 with a commercial license exception.
|
|
160
150
|
See [LICENSE-COMMERCIAL.md](https://github.com/nebutra/nebutra-sailor/blob/main/LICENSE-COMMERCIAL.md) for details.
|
|
161
|
-
|
|
151
|
+
Commercial and individual licensing details: [get-license](https://nebutra.com/get-license).
|
|
162
152
|
|
|
163
153
|
---
|
|
164
154
|
|
|
165
|
-
**
|
|
155
|
+
**Built by [Nebutra](https://nebutra.com)** for teams shipping AI-native products.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-EA5HU2X4.js";import"./chunk-RR5R4AKJ.js";import"./chunk-7Z3O7WJM.js";import"./chunk-6EI2BXXZ.js";import"./chunk-7HOF72FC.js";import"./chunk-2VIWVVHK.js";import"./chunk-O3WYNHSC.js";import"./chunk-PXU2OOBT.js";import"./chunk-DIXI4M5O.js";import"./chunk-FGJ5K4WM.js";import"./chunk-7DCGNQSQ.js";import"./chunk-XSSPJU77.js";import"./chunk-QEIMNOY2.js";import"./chunk-QMKVUKS6.js";import"./chunk-EXLRPVEX.js";import"./chunk-YW4FFW47.js";import"./chunk-B35GFLVZ.js";import"./chunk-DGJUBN33.js";export{a as AWSKMSProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as S,P as I,j as T,n as y,p as E,q as b,r as p,u as l}from"./chunk-O3WYNHSC.js";import{b as j,c as x,i as O,k as M,l as R,m as k}from"./chunk-7DCGNQSQ.js";import{e as C}from"./chunk-QEIMNOY2.js";var J=(h,r)=>T(h,r).then(e=>(r?.utf8Encoder??C)(e));var B=(h,r)=>J(h,r).then(e=>{if(e.length)try{return JSON.parse(e)}catch(n){throw n?.name==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:e}),n}return{}});var W=(h,r)=>{let e=(s,t)=>Object.keys(s).find(i=>i.toLowerCase()===t.toLowerCase()),n=s=>{let t=s;return typeof t=="number"&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},o=e(h.headers,"x-amzn-errortype");if(o!==void 0)return n(h.headers[o]);if(r&&typeof r=="object"){let s=e(r,"code");if(s&&r[s]!==void 0)return n(r[s]);if(r.__type!==void 0)return n(r.__type)}};function D(h,r,e){if(e?.source){let n=e.source;if(typeof r=="number"&&(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER||n!==String(r)))return n.includes(".")?new p(n,"bigDecimal"):BigInt(n)}return r}var w=class extends S{settings;constructor(r){super(),this.settings=r}async read(r,e){return this._read(r,typeof e=="string"?JSON.parse(e,D):await B(e,this.serdeContext))}readObject(r,e){return this._read(r,e)}_read(r,e){let n=e!==null&&typeof e=="object",o=y.of(r);if(n){if(o.isStructSchema()){let t=e,i=o.isUnionSchema(),c={},a,{jsonName:f}=this.settings;f&&(a={});let u;i&&(u=new I(t,c));for(let[m,g]of o.structIterator()){let d=m;f&&(d=g.getMergedTraits().jsonName??d,a[d]=m),i&&u.mark(d),t[d]!=null&&(c[m]=this._read(g,t[d]))}if(i)u.writeUnknown();else if(typeof t.__type=="string")for(let[m,g]of Object.entries(t)){let d=f?a[m]??m:m;d in c||(c[d]=g)}return c}if(Array.isArray(e)&&o.isListSchema()){let t=o.getValueSchema(),i=[];for(let c of e)i.push(this._read(t,c));return i}if(o.isMapSchema()){let t=o.getValueSchema(),i={};for(let[c,a]of Object.entries(e))i[c]=this._read(t,a);return i}}if(o.isBlobSchema()&&typeof e=="string")return j(e);let s=o.getMergedTraits().mediaType;if(o.isStringSchema()&&typeof e=="string"&&s)return s==="application/json"||s.endsWith("+json")?b.from(e):e;if(o.isTimestampSchema()&&e!=null)switch(l(o,this.settings)){case 5:return M(e);case 6:return R(e);case 7:return k(e);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",e),new Date(e)}if(o.isBigIntegerSchema()&&(typeof e=="number"||typeof e=="string"))return BigInt(e);if(o.isBigDecimalSchema()&&e!=null){if(e instanceof p)return e;let t=e;return t.type==="bigDecimal"&&"string"in t?new p(t.string,t.type):new p(String(e),"bigDecimal")}if(o.isNumericSchema()&&typeof e=="string"){switch(e){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return e}if(o.isDocumentSchema())if(n){let t=Array.isArray(e)?[]:{};for(let[i,c]of Object.entries(e))c instanceof p?t[i]=c:t[i]=this._read(o,c);return t}else return structuredClone(e);return e}};var A="\u039D",_=class{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(r,e)=>{if(e instanceof p){let n=`${A+"nv"+this.counter++}_`+e.string;return this.values.set(`"${n}"`,e.string),n}if(typeof e=="bigint"){let n=e.toString(),o=`${A+"b"+this.counter++}_`+n;return this.values.set(`"${o}"`,n),o}return e}}replaceInJson(r){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return r;for(let[e,n]of this.values)r=r.replace(e,n);return r}};var N=class extends S{settings;buffer;useReplacer=!1;rootSchema;constructor(r){super(),this.settings=r}write(r,e){this.rootSchema=y.of(r),this.buffer=this._write(this.rootSchema,e)}writeDiscriminatedDocument(r,e){this.write(r,e),typeof this.buffer=="object"&&(this.buffer.__type=y.of(r).getName(!0))}flush(){let{rootSchema:r,useReplacer:e}=this;if(this.rootSchema=void 0,this.useReplacer=!1,r?.isStructSchema()||r?.isDocumentSchema()){if(!e)return JSON.stringify(this.buffer);let n=new _;return n.replaceInJson(JSON.stringify(this.buffer,n.createReplacer(),0))}return this.buffer}_write(r,e,n){let o=e!==null&&typeof e=="object",s=y.of(r);if(o){if(s.isStructSchema()){let t=e,i={},{jsonName:c}=this.settings,a;c&&(a={});for(let[f,u]of s.structIterator()){let m=this._write(u,t[f],s);if(m!==void 0){let g=f;c&&(g=u.getMergedTraits().jsonName??f,a[f]=g),i[g]=m}}if(s.isUnionSchema()&&Object.keys(i).length===0){let{$unknown:f}=t;if(Array.isArray(f)){let[u,m]=f;i[u]=this._write(15,m)}}else if(typeof t.__type=="string")for(let[f,u]of Object.entries(t)){let m=c?a[f]??f:f;m in i||(i[m]=this._write(15,u))}return i}if(Array.isArray(e)&&s.isListSchema()){let t=s.getValueSchema(),i=[],c=!!s.getMergedTraits().sparse;for(let a of e)(c||a!=null)&&i.push(this._write(t,a));return i}if(s.isMapSchema()){let t=s.getValueSchema(),i={},c=!!s.getMergedTraits().sparse;for(let[a,f]of Object.entries(e))(c||f!=null)&&(i[a]=this._write(t,f));return i}if(e instanceof Uint8Array&&(s.isBlobSchema()||s.isDocumentSchema()))return s===this.rootSchema?e:(this.serdeContext?.base64Encoder??x)(e);if(e instanceof Date&&(s.isTimestampSchema()||s.isDocumentSchema()))switch(l(s,this.settings)){case 5:return e.toISOString().replace(".000Z","Z");case 6:return O(e);case 7:return e.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",e),e.getTime()/1e3}e instanceof p&&(this.useReplacer=!0)}if(!(e===null&&n?.isStructSchema())){if(s.isStringSchema()){if(typeof e>"u"&&s.isIdempotencyToken())return E();let t=s.getMergedTraits().mediaType;return e!=null&&t&&(t==="application/json"||t.endsWith("+json"))?b.from(e):e}if(typeof e=="number"&&s.isNumericSchema())return Math.abs(e)===1/0||isNaN(e)?String(e):e;if(typeof e=="string"&&s.isBlobSchema())return s===this.rootSchema?e:(this.serdeContext?.base64Encoder??x)(e);if(typeof e=="bigint"&&(this.useReplacer=!0),s.isDocumentSchema())if(o){let t=Array.isArray(e)?[]:{};for(let[i,c]of Object.entries(e))c instanceof p?(this.useReplacer=!0,t[i]=c):t[i]=this._write(s,c);return t}else return structuredClone(e);return e}}};var z=class extends S{settings;constructor(r){super(),this.settings=r}createSerializer(){let r=new N(this.settings);return r.setSerdeContext(this.serdeContext),r}createDeserializer(){let r=new w(this.settings);return r.setSerdeContext(this.serdeContext),r}};export{W as a,z as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as H,b as q,c as O}from"./chunk-ZEEOYOWD.js";import{a as J,b as F}from"./chunk-2VIWVVHK.js";import{N as U,j as z,m as I,n as g,p as $,q as Q,s as T,t as V,u as v}from"./chunk-O3WYNHSC.js";import{a as D}from"./chunk-7VJYOZUP.js";import{c as B,i as j}from"./chunk-7DCGNQSQ.js";import{a as N}from"./chunk-XSSPJU77.js";import{d as R,e as k}from"./chunk-QEIMNOY2.js";function W(b){return(b.includes(",")||b.includes('"'))&&(b=`"${b.replace(/"/g,'\\"')}"`),b}function Z(b,i,t){if(t<=0||!Number.isInteger(t))throw new Error("Invalid number of delimiters ("+t+") for splitEvery.");let e=b.split(i);if(t===1)return e;let r=[],o="";for(let s=0;s<e.length;s++)o===""?o=e[s]:o+=i+e[s],(s+1)%t===0&&(r.push(o),o="");return o!==""&&r.push(o),r}var x=class extends V{async serializeRequest(i,t,e){let r={...t??{}},o=this.serializer,s={},h={},c=await e.endpoint(),d=g.of(i?.input),S=[],p=[],y=!1,m,n=new N({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:s,headers:h,body:void 0});if(c){this.updateServiceEndpoint(n,c),this.setHostPrefix(n,i,r);let a=I(i.traits);if(a.http){n.method=a.http[0];let[f,l]=a.http[1].split("?");n.path=="/"?n.path=f:n.path+=f;let u=new URLSearchParams(l??"");Object.assign(s,Object.fromEntries(u))}}for(let[a,f]of d.structIterator()){let l=f.getMergedTraits()??{},u=r[a];if(u==null&&!f.isIdempotencyToken()){if(l.httpLabel&&(n.path.includes(`{${a}+}`)||n.path.includes(`{${a}}`)))throw new Error(`No value provided for input HTTP label: ${a}.`);continue}if(l.httpPayload)f.isStreaming()?f.isStructSchema()?r[a]&&(m=await this.serializeEventStream({eventStream:r[a],requestSchema:d})):m=u:(o.write(f,u),m=o.flush()),delete r[a];else if(l.httpLabel){o.write(f,u);let w=o.flush();n.path.includes(`{${a}+}`)?n.path=n.path.replace(`{${a}+}`,w.split("/").map(H).join("/")):n.path.includes(`{${a}}`)&&(n.path=n.path.replace(`{${a}}`,H(w))),delete r[a]}else if(l.httpHeader)o.write(f,u),h[l.httpHeader.toLowerCase()]=String(o.flush()),delete r[a];else if(typeof l.httpPrefixHeaders=="string"){for(let[w,P]of Object.entries(u)){let L=l.httpPrefixHeaders+w;o.write([f.getValueSchema(),{httpHeader:L}],P),h[L.toLowerCase()]=o.flush()}delete r[a]}else l.httpQuery||l.httpQueryParams?(this.serializeQuery(f,u,s),delete r[a]):(y=!0,S.push(a),p.push(f))}if(y&&r){let[a,f]=(d.getName(!0)??"#Unknown").split("#"),l=d.getSchema()[6],u=[3,a,f,d.getMergedTraits(),S,p,void 0];l?u[6]=l:u.pop(),o.write(u,r),m=o.flush()}return n.headers=h,n.query=s,n.body=m,n}serializeQuery(i,t,e){let r=this.serializer,o=i.getMergedTraits();if(o.httpQueryParams){for(let[s,h]of Object.entries(t))if(!(s in e)){let c=i.getValueSchema();Object.assign(c.getMergedTraits(),{...o,httpQuery:s,httpQueryParams:void 0}),this.serializeQuery(c,h,e)}return}if(i.isListSchema()){let s=!!i.getMergedTraits().sparse,h=[];for(let c of t){r.write([i.getValueSchema(),o],c);let d=r.flush();(s||d!==void 0)&&h.push(d)}e[o.httpQuery]=h}else r.write([i,o],t),e[o.httpQuery]=r.flush()}async deserializeResponse(i,t,e){let r=this.deserializer,o=g.of(i.output),s={};if(e.statusCode>=300){let c=await z(e.body,t);throw c.byteLength>0&&Object.assign(s,await r.read(15,c)),await this.handleError(i,t,e,s,this.deserializeMetadata(e)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(let c in e.headers){let d=e.headers[c];delete e.headers[c],e.headers[c.toLowerCase()]=d}let h=await this.deserializeHttpMessage(o,t,e,s);if(h.length){let c=await z(e.body,t);if(c.byteLength>0){let d=await r.read(o,c);for(let S of h)d[S]!=null&&(s[S]=d[S])}}else h.discardResponseBody&&await z(e.body,t);return s.$metadata=this.deserializeMetadata(e),s}async deserializeHttpMessage(i,t,e,r,o){let s;r instanceof Set?s=o:s=r;let h=!0,c=this.deserializer,d=g.of(i),S=[];for(let[p,y]of d.structIterator()){let m=y.getMemberTraits();if(m.httpPayload){if(h=!1,y.isStreaming())y.isStructSchema()?s[p]=await this.deserializeEventStream({response:e,responseSchema:d}):s[p]=D(e.body);else if(e.body){let a=await z(e.body,t);a.byteLength>0&&(s[p]=await c.read(y,a))}}else if(m.httpHeader){let n=String(m.httpHeader).toLowerCase(),a=e.headers[n];if(a!=null)if(y.isListSchema()){let f=y.getValueSchema();f.getMergedTraits().httpHeader=n;let l;f.isTimestampSchema()&&f.getSchema()===4?l=Z(a,",",2):l=q(a);let u=[];for(let w of l)u.push(await c.read(f,w.trim()));s[p]=u}else s[p]=await c.read(y,a)}else if(m.httpPrefixHeaders!==void 0){s[p]={};for(let[n,a]of Object.entries(e.headers))if(n.startsWith(m.httpPrefixHeaders)){let f=y.getValueSchema();f.getMergedTraits().httpHeader=n,s[p][n.slice(m.httpPrefixHeaders.length)]=await c.read(f,a)}}else m.httpResponseCode?s[p]=e.statusCode:S.push(p)}return S.discardResponseBody=h,S}};var M=class extends T{codecDeserializer;stringDeserializer;constructor(i,t){super(),this.codecDeserializer=i,this.stringDeserializer=new O(t)}setSerdeContext(i){this.stringDeserializer.setSerdeContext(i),this.codecDeserializer.setSerdeContext(i),this.serdeContext=i}read(i,t){let e=g.of(i),r=e.getMergedTraits(),o=this.serdeContext?.utf8Encoder??k;if(r.httpHeader||r.httpResponseCode)return this.stringDeserializer.read(e,o(t));if(r.httpPayload){if(e.isBlobSchema()){let s=this.serdeContext?.utf8Decoder??R;return typeof t=="string"?s(t):t}else if(e.isStringSchema())return"byteLength"in t?o(t):t}return this.codecDeserializer.read(e,t)}};var E=class extends T{settings;stringBuffer="";constructor(i){super(),this.settings=i}write(i,t){let e=g.of(i);switch(typeof t){case"object":if(t===null){this.stringBuffer="null";return}if(e.isTimestampSchema()){if(!(t instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${e.getName(!0)}`);switch(v(e,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=j(t);break;case 7:this.stringBuffer=String(t.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",t),this.stringBuffer=String(t.getTime()/1e3)}return}if(e.isBlobSchema()&&"byteLength"in t){this.stringBuffer=(this.serdeContext?.base64Encoder??B)(t);return}if(e.isListSchema()&&Array.isArray(t)){let s="";for(let h of t){this.write([e.getValueSchema(),e.getMergedTraits()],h);let c=this.flush(),d=e.getValueSchema().isTimestampSchema()?c:W(c);s!==""&&(s+=", "),s+=d}this.stringBuffer=s;return}this.stringBuffer=JSON.stringify(t,null,2);break;case"string":let r=e.getMergedTraits().mediaType,o=t;if(r&&((r==="application/json"||r.endsWith("+json"))&&(o=Q.from(o)),e.getMergedTraits().httpHeader)){this.stringBuffer=(this.serdeContext?.base64Encoder??B)(o.toString());return}this.stringBuffer=t;break;default:e.isIdempotencyToken()?this.stringBuffer=$():this.stringBuffer=String(t)}}flush(){let i=this.stringBuffer;return this.stringBuffer="",i}};var C=class{codecSerializer;stringSerializer;buffer;constructor(i,t,e=new E(t)){this.codecSerializer=i,this.stringSerializer=e}setSerdeContext(i){this.codecSerializer.setSerdeContext(i),this.stringSerializer.setSerdeContext(i)}write(i,t){let e=g.of(i),r=e.getMergedTraits();if(r.httpHeader||r.httpLabel||r.httpQuery){this.stringSerializer.write(e,t),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(e,t)}flush(){if(this.buffer!==void 0){let i=this.buffer;return this.buffer=void 0,i}return this.codecSerializer.flush()}};var A=class extends x{serializer;deserializer;codec;mixin=new U;constructor({defaultNamespace:i,errorTypeRegistries:t}){super({defaultNamespace:i,errorTypeRegistries:t});let e={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=new F(e),this.serializer=new C(this.codec.createSerializer(),e),this.deserializer=new M(this.codec.createDeserializer(),e)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(i){this.codec.setSerdeContext(i),super.setSerdeContext(i)}async serializeRequest(i,t,e){let r=await super.serializeRequest(i,t,e),o=g.of(i.input);if(!r.headers["content-type"]){let s=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);s&&(r.headers["content-type"]=s)}return r.body==null&&r.headers["content-type"]===this.getDefaultContentType()&&(r.body="{}"),r}async deserializeResponse(i,t,e){let r=await super.deserializeResponse(i,t,e),o=g.of(i.output);for(let[s,h]of o.structIterator())h.getMemberTraits().httpPayload&&!(s in r)&&(r[s]=null);return r}async handleError(i,t,e,r,o){let s=J(e,r)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,s,this.options.defaultNamespace);let{errorSchema:h,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(s,this.options.defaultNamespace,e,r,o),d=g.of(h),S=r.message??r.Message??"UnknownError",p=this.compositeErrorRegistry.getErrorCtor(h)??Error,y=new p(S);await this.deserializeHttpMessage(h,t,e,r);let m={};for(let[n,a]of d.structIterator()){let f=a.getMergedTraits().jsonName??n;m[n]=this.codec.createDeserializer().readObject(a,r[f])}throw this.mixin.decorateServiceException(Object.assign(y,c,{$fault:d.getMergedTraits().error,message:S},m),r)}getDefaultContentType(){return"application/json"}};export{A as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as u,n as b,t as S}from"./chunk-O3WYNHSC.js";import{a as w}from"./chunk-XSSPJU77.js";var z=class extends S{async serializeRequest(n,i,t){let s=this.serializer,o={},a={},d=await t.endpoint(),e=b.of(n?.input),l=e.getSchema(),f,r=new w({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:o,headers:a,body:void 0});d&&(this.updateServiceEndpoint(r,d),this.setHostPrefix(r,n,i));let c={...i};if(i){let h=e.getEventStreamMember();if(h){if(c[h]){let y={};for(let[m,g]of e.structIterator())m!==h&&c[m]&&(s.write(g,c[m]),y[m]=s.flush());f=await this.serializeEventStream({eventStream:c[h],requestSchema:e,initialRequest:y})}}else s.write(l,c),f=s.flush()}return r.headers=Object.assign(r.headers,a),r.query=o,r.body=f,r.method="POST",r}async deserializeResponse(n,i,t){let s=this.deserializer,o=b.of(n.output),a={};if(t.statusCode>=300){let e=await u(t.body,i);throw e.byteLength>0&&Object.assign(a,await s.read(15,e)),await this.handleError(n,i,t,a,this.deserializeMetadata(t)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(let e in t.headers){let l=t.headers[e];delete t.headers[e],t.headers[e.toLowerCase()]=l}let d=o.getEventStreamMember();if(d)a[d]=await this.deserializeEventStream({response:t,responseSchema:o,initialResponseContainer:a});else{let e=await u(t.body,i);e.byteLength>0&&Object.assign(a,await s.read(o,e))}return a.$metadata=this.deserializeMetadata(t),a}};export{z as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{b as H,c as W,d as J}from"./chunk-QEIMNOY2.js";var $=class{statusCode;reason;headers;body;constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;let r=t;return typeof r.statusCode=="number"&&typeof r.headers=="object"}};var I=e=>encodeURIComponent(e).replace(/[!'()*]/g,ue),ue=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function Y(e){let t=[];for(let r of Object.keys(e).sort()){let o=e[r];if(r=I(r),Array.isArray(o))for(let n=0,i=o.length;n<i;n++)t.push(`${r}=${I(o[n])}`);else{let n=r;(o||typeof o=="string")&&(n+=`=${I(o)}`),t.push(n)}}return t.join("&")}import{Agent as O,request as ge}from"https";function D(e){let t=e&&typeof e=="object"&&"reason"in e?e.reason:void 0;if(t){if(t instanceof Error){let n=new Error("Request aborted");return n.name="AbortError",n.cause=t,n}let o=new Error(String(t));return o.name="AbortError",o}let r=new Error("Request aborted");return r.name="AbortError",r}var K=["ECONNRESET","EPIPE","ETIMEDOUT"];var V=e=>{let t={};for(let r of Object.keys(e)){let o=e[r];t[r]=Array.isArray(o)?o.join(","):o}return t};var u={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)};var X=1e3,z=(e,t,r=0)=>{if(!r)return-1;let o=n=>{let i=u.setTimeout(()=>{e.destroy(),t(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${r} ms.`),{name:"TimeoutError"}))},r-n),s=c=>{c?.connecting?c.on("connect",()=>{u.clearTimeout(i)}):u.clearTimeout(i)};e.socket?s(e.socket):e.on("socket",s)};return r<2e3?(o(0),0):u.setTimeout(o.bind(null,X),X)};var G=(e,t,r=0,o,n)=>r?u.setTimeout(()=>{let i=`@smithy/node-http-handler - [${o?"ERROR":"WARN"}] a request has exceeded the configured ${r} ms requestTimeout.`;if(o){let s=Object.assign(new Error(i),{name:"TimeoutError",code:"ETIMEDOUT"});e.destroy(s),t(s)}else i+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",n?.warn?.(i)},r):-1;var pe=3e3,Z=(e,{keepAlive:t,keepAliveMsecs:r},o=pe)=>{if(t!==!0)return-1;let n=()=>{e.socket?e.socket.setKeepAlive(t,r||0):e.on("socket",i=>{i.setKeepAlive(t,r||0)})};return o===0?(n(),0):u.setTimeout(n,o)};var Q=3e3,q=(e,t,r=0)=>{let o=n=>{let i=r-n,s=()=>{e.destroy(),t(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${r} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};e.socket?(e.socket.setTimeout(i,s),e.on("close",()=>e.socket?.removeListener("timeout",s))):e.setTimeout(i,s)};return 0<r&&r<6e3?(o(0),0):u.setTimeout(o.bind(null,r===0?0:Q),Q)};import{Readable as me}from"stream";var v=6e3;async function ee(e,t,r=v,o=!1){let n=t.headers??{},i=n.Expect||n.expect,s=-1,c=!0;!o&&i==="100-continue"&&(c=await Promise.race([new Promise(f=>{s=Number(u.setTimeout(()=>f(!0),Math.max(v,r)))}),new Promise(f=>{e.on("continue",()=>{u.clearTimeout(s),f(!0)}),e.on("response",()=>{u.clearTimeout(s),f(!1)}),e.on("error",()=>{u.clearTimeout(s),f(!1)})})])),c&&he(e,t.body)}function he(e,t){if(t instanceof me){t.pipe(e);return}if(t){let r=Buffer.isBuffer(t);if(r||typeof t=="string"){r&&t.byteLength===0?e.end():e.end(t);return}let n=t;if(typeof n=="object"&&n.buffer&&typeof n.byteOffset=="number"&&typeof n.byteLength=="number"){e.end(Buffer.from(n.buffer,n.byteOffset,n.byteLength));return}e.end(Buffer.from(t));return}e.end()}var C,te,re=class e{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(t){return typeof t?.handle=="function"?t:new e(t)}static checkSocketUsage(t,r,o=console){let{sockets:n,requests:i,maxSockets:s}=t;if(typeof s!="number"||s===1/0||Date.now()-15e3<r)return r;if(n&&i)for(let f in n){let a=n[f]?.length??0,m=i[f]?.length??0;if(a>=s&&m>=2*s)return o?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${a} and ${m} additional requests are enqueued.
|
|
2
|
+
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
3
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return r}constructor(t){this.configProvider=new Promise((r,o)=>{typeof t=="function"?t().then(n=>{r(this.resolveDefaultConfig(n))}).catch(o):r(this.resolveDefaultConfig(t))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(t,{abortSignal:r,requestTimeout:o}={}){this.config||(this.config=await this.configProvider);let n=this.config,i=t.protocol==="https:";return!i&&!this.config.httpAgent&&(this.config.httpAgent=await this.config.httpAgentProvider()),new Promise((s,c)=>{let f,a=[],m=async d=>{await f,a.forEach(u.clearTimeout),s(d)},p=async d=>{await f,a.forEach(u.clearTimeout),c(d)};if(r?.aborted){let d=D(r);p(d);return}let g=t.headers??{},x=(g.Expect??g.expect)==="100-continue",T=i?n.httpsAgent:n.httpAgent;x&&!this.externalAgent&&(T=new(i?O:C)({keepAlive:!1,maxSockets:1/0})),a.push(u.setTimeout(()=>{this.socketWarningTimestamp=e.checkSocketUsage(T,this.socketWarningTimestamp,n.logger)},n.socketAcquisitionWarningTimeout??(n.requestTimeout??2e3)+(n.connectionTimeout??1e3)));let P=Y(t.query||{}),L;if(t.username!=null||t.password!=null){let d=t.username??"",y=t.password??"";L=`${d}:${y}`}let M=t.path;P&&(M+=`?${P}`),t.fragment&&(M+=`#${t.fragment}`);let b=t.hostname??"";b[0]==="["&&b.endsWith("]")?b=t.hostname.slice(1,-1):b=t.hostname;let B={headers:t.headers,host:b,method:t.method,path:M,port:t.port,agent:T,auth:L},l=(i?ge:te)(B,d=>{let y=new $({statusCode:d.statusCode||-1,reason:d.statusMessage,headers:V(d.headers),body:d});m({response:y})});if(l.on("error",d=>{K.includes(d.code)?p(Object.assign(d,{name:"TimeoutError"})):p(d)}),r){let d=()=>{l.destroy();let y=D(r);p(y)};if(typeof r.addEventListener=="function"){let y=r;y.addEventListener("abort",d,{once:!0}),l.once("close",()=>y.removeEventListener("abort",d))}else r.onabort=d}let j=o??n.requestTimeout;a.push(z(l,p,n.connectionTimeout)),a.push(G(l,p,j,n.throwOnRequestTimeout,n.logger??console)),a.push(q(l,p,n.socketTimeout));let A=B.agent;typeof A=="object"&&"keepAlive"in A&&a.push(Z(l,{keepAlive:A.keepAlive,keepAliveMsecs:A.keepAliveMsecs})),f=ee(l,t,j,this.externalAgent).catch(d=>(a.forEach(u.clearTimeout),c(d)))})}updateHttpClientConfig(t,r){this.config=void 0,this.configProvider=this.configProvider.then(o=>({...o,[t]:r}))}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(t){let{requestTimeout:r,connectionTimeout:o,socketTimeout:n,socketAcquisitionWarningTimeout:i,httpAgent:s,httpsAgent:c,throwOnRequestTimeout:f,logger:a}=t||{},m=!0,p=50;return{connectionTimeout:o,requestTimeout:r,socketTimeout:n,socketAcquisitionWarningTimeout:i,throwOnRequestTimeout:f,httpAgentProvider:async()=>{let{Agent:g,request:x}=await import("http");return te=x,C=g,s instanceof C||typeof s?.destroy=="function"?(this.externalAgent=!0,s):new C({keepAlive:m,maxSockets:p,...s})},httpsAgent:c instanceof O||typeof c?.destroy=="function"?(this.externalAgent=!0,c):new O({keepAlive:m,maxSockets:p,...c}),logger:a}}};import{Writable as le}from"stream";var R=class extends le{bufferedBytes=[];_write(t,r,o){this.bufferedBytes.push(t),o()}};var bt=e=>ye(e)?Te(e):new Promise((t,r)=>{let o=new R;e.pipe(o),e.on("error",n=>{o.end(),r(n)}),o.on("error",r),o.on("finish",function(){let n=new Uint8Array(Buffer.concat(this.bufferedBytes));t(n)})}),ye=e=>typeof ReadableStream=="function"&&e instanceof ReadableStream;async function Te(e){let t=[],r=e.getReader(),o=!1,n=0;for(;!o;){let{done:c,value:f}=await r.read();f&&(t.push(f),n+=f.length),o=c}let i=new Uint8Array(n),s=0;for(let c of t)i.set(c,s),s+=c.length;return i}var k=e=>{if(e!=null){if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&Ae.warn(Se(`Expected number but observed string: ${e}`)),t}if(typeof e=="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},Ee=Math.ceil(34028234663852886e22),ne=e=>{let t=k(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>Ee)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},we=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}};var oe=e=>ie(e,16),se=e=>ie(e,8),ie=(e,t)=>{let r=we(e);if(r!==void 0&&xe(r,t)!==r)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return r},xe=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}};var ce=e=>k(typeof e=="string"?N(e):e);var fe=e=>ne(typeof e=="string"?N(e):e),be=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,N=e=>{let t=e.match(be);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)};var E=e=>oe(typeof e=="string"?N(e):e),ae=e=>se(typeof e=="string"?N(e):e),Se=e=>String(new TypeError(e).stack||e).split(`
|
|
4
|
+
`).slice(0,5).filter(t=>!t.includes("stackTraceWarning")).join(`
|
|
5
|
+
`),Ae={warn:console.warn};var $e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],F=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function It(e){let t=e.getUTCFullYear(),r=e.getUTCMonth(),o=e.getUTCDay(),n=e.getUTCDate(),i=e.getUTCHours(),s=e.getUTCMinutes(),c=e.getUTCSeconds(),f=n<10?`0${n}`:`${n}`,a=i<10?`0${i}`:`${i}`,m=s<10?`0${s}`:`${s}`,p=c<10?`0${c}`:`${c}`;return`${$e[o]}, ${f} ${F[r]} ${t} ${a}:${m}:${p} GMT`}var Ie=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Ct=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let t=Ie.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");let[r,o,n,i,s,c,f,a]=t,m=E(w(o)),p=h(n,"month",1,12),g=h(i,"day",1,31);return S(m,p,g,{hours:s,minutes:c,seconds:f,fractionalMilliseconds:a})},Ce=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Rt=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let t=Ce.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");let[r,o,n,i,s,c,f,a,m]=t,p=E(w(o)),g=h(n,"month",1,12),x=h(i,"day",1,31),T=S(p,g,x,{hours:s,minutes:c,seconds:f,fractionalMilliseconds:a});return m.toUpperCase()!="Z"&&T.setTime(T.getTime()-Le(m)),T},Re=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Ne=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Me=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),Nt=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=Re.exec(e);if(t){let[r,o,n,i,s,c,f,a]=t;return S(E(w(i)),U(n),h(o,"day",1,31),{hours:s,minutes:c,seconds:f,fractionalMilliseconds:a})}if(t=Ne.exec(e),t){let[r,o,n,i,s,c,f,a]=t;return ke(S(De(i),U(n),h(o,"day",1,31),{hours:s,minutes:c,seconds:f,fractionalMilliseconds:a}))}if(t=Me.exec(e),t){let[r,o,n,i,s,c,f,a]=t;return S(E(w(a)),U(o),h(n.trimLeft(),"day",1,31),{hours:i,minutes:s,seconds:c,fractionalMilliseconds:f})}throw new TypeError("Invalid RFC-7231 date-time value")},Mt=e=>{if(e==null)return;let t;if(typeof e=="number")t=e;else if(typeof e=="string")t=ce(e);else if(typeof e=="object"&&e.tag===1)t=e.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(t*1e3))},S=(e,t,r,o)=>{let n=t-1;return Fe(e,n,r),new Date(Date.UTC(e,n,r,h(o.hours,"hour",0,23),h(o.minutes,"minute",0,59),h(o.seconds,"seconds",0,60),Pe(o.fractionalMilliseconds)))},De=e=>{let t=new Date().getUTCFullYear(),r=Math.floor(t/100)*100+E(w(e));return r<t?r+100:r},Oe=50*365*24*60*60*1e3,ke=e=>e.getTime()-new Date().getTime()>Oe?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,U=e=>{let t=F.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},Ue=[31,28,31,30,31,30,31,31,30,31,30,31],Fe=(e,t,r)=>{let o=Ue[t];if(t===1&&_e(e)&&(o=29),r>o)throw new TypeError(`Invalid day for ${F[t]} in ${e}: ${r}`)},_e=e=>e%4===0&&(e%100!==0||e%400===0),h=(e,t,r,o)=>{let n=ae(w(e));if(n<r||n>o)throw new TypeError(`${t} must be between ${r} and ${o}, inclusive`);return n},Pe=e=>e==null?0:fe("0."+e)*1e3,Le=e=>{let t=e[0],r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);let o=Number(e.substring(1,3)),n=Number(e.substring(4,6));return r*(o*60+n)*60*1e3},w=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)==="0";)t++;return t===0?e:e.slice(t)};var Be=/^[A-Za-z0-9+/]*={0,2}$/,kt=e=>{if(e.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Be.exec(e))throw new TypeError("Invalid base64 string.");let t=W(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)};var Pt=e=>{let t;if(typeof e=="string"?t=J(e):t=e,typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return H(t.buffer,t.byteOffset,t.byteLength).toString("base64")};var de={},_={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),de[e]=t,_[t]=e}function Bt(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2){let o=e.slice(r,r+2).toLowerCase();if(o in _)t[r/2]=_[o];else throw new Error(`Cannot decode unrecognized sequence ${o} as hexadecimal`)}return t}function jt(e){let t="";for(let r=0;r<e.byteLength;r++)t+=de[e[r]];return t}export{$ as a,kt as b,Pt as c,I as d,re as e,bt as f,Bt as g,jt as h,It as i,Ct as j,Rt as k,Nt as l,Mt as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as _}from"./chunk-QMKVUKS6.js";import{b as S}from"./chunk-EXLRPVEX.js";var p="AWS_ACCESS_KEY_ID",A="AWS_SECRET_ACCESS_KEY",C="AWS_SESSION_TOKEN",N="AWS_CREDENTIAL_EXPIRATION",a="AWS_CREDENTIAL_SCOPE",i="AWS_ACCOUNT_ID",v=e=>async()=>{e?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");let o=process.env[p],r=process.env[A],n=process.env[C],s=process.env[N],t=process.env[a],E=process.env[i];if(o&&r){let c={accessKeyId:o,secretAccessKey:r,...n&&{sessionToken:n},...s&&{expiration:new Date(s)},...t&&{credentialScope:t},...E&&{accountId:E}};return _(c,"CREDENTIALS_ENV_VARS","g"),c}throw new S("Unable to find environment variable credentials.",{logger:e?.logger})};export{p as a,A as b,C as c,N as d,a as e,i as f,v as g};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as d,c as b,f as p,h as y}from"./chunk-7DCGNQSQ.js";import{b as u,e as m}from"./chunk-QEIMNOY2.js";import{Readable as c}from"stream";var w=async e=>typeof Blob=="function"&&e instanceof Blob||e.constructor?.name==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await e.arrayBuffer()):E(e):x(e);async function E(e){let o=await T(e),n=d(o);return new Uint8Array(n)}async function x(e){let o=[],n=e.getReader(),t=!1,r=0;for(;!t;){let{done:f,value:i}=await n.read();i&&(o.push(i),r+=i.length),t=f}let a=new Uint8Array(r),s=0;for(let f of o)a.set(f,s),s+=f.length;return a}function T(e){return new Promise((o,n)=>{let t=new FileReader;t.onloadend=()=>{if(t.readyState!==2)return n(new Error("Reader aborted too early"));let r=t.result??"",a=r.indexOf(","),s=a>-1?a+1:r.length;o(r.substring(s))},t.onabort=()=>n(new Error("Read aborted")),t.onerror=()=>n(t.error),t.readAsDataURL(e)})}var l=e=>typeof ReadableStream=="function"&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream);var h="The stream has already been transformed.",S=e=>{if(!B(e)&&!l(e)){let r=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${r}`)}let o=!1,n=async()=>{if(o)throw new Error(h);return o=!0,await w(e)},t=r=>{if(typeof r.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
|
|
2
|
+
If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return r.stream()};return Object.assign(e,{transformToByteArray:n,transformToString:async r=>{let a=await n();if(r==="base64")return b(a);if(r==="hex")return y(a);if(r===void 0||r==="utf8"||r==="utf-8")return m(a);if(typeof TextDecoder=="function")return new TextDecoder(r).decode(a);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(o)throw new Error(h);if(o=!0,B(e))return t(e);if(l(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},B=e=>typeof Blob=="function"&&e instanceof Blob;var R="The stream has already been transformed.",I=e=>{if(!(e instanceof c))try{return S(e)}catch{let r=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${r}`)}let o=!1,n=async()=>{if(o)throw new Error(R);return o=!0,await p(e)};return Object.assign(e,{transformToByteArray:n,transformToString:async t=>{let r=await n();return t===void 0||Buffer.isEncoding(t)?u(r.buffer,r.byteOffset,r.byteLength).toString(t):new TextDecoder(t).decode(r)},transformToWebStream:()=>{if(o)throw new Error(R);if(e.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof c.toWeb!="function")throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return o=!0,c.toWeb(e)}})};export{I as a};
|