@distilled.cloud/stripe 1.0.0-rc.16 → 1.0.0-rc.17
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/lib/.lazy.json +1 -0
- package/lib/_bundle/lazy.js +4 -0
- package/lib/_bundle/sdk.js +2 -0
- package/lib/_bundle/sdk.js.map +1 -0
- package/lib/credentials.js +1 -34
- package/lib/errors.js +1 -130
- package/lib/index.js +1 -14
- package/lib/index.lazy.js +8 -0
- package/lib/pagination.js +1 -28
- package/lib/protocol.js +1 -471
- package/lib/retry.js +1 -33
- package/lib/services/index.js +0 -2
- package/lib/services/stripe.js +919 -2188
- package/lib/services/stripe.js.map +1 -0
- package/lib/services.lazy/index.js +3 -0
- package/lib/services.lazy/stripe.js +4 -0
- package/lib/traits.js +1 -16
- package/lib/webhooks.js +1 -160
- package/lib/webhooks.js.map +1 -1
- package/package.json +6 -8
- package/lib/credentials.js.map +0 -1
- package/lib/errors.js.map +0 -1
- package/lib/pagination.js.map +0 -1
- package/lib/protocol.js.map +0 -1
- package/lib/retry.js.map +0 -1
- package/lib/services/index.js.map +0 -1
- package/lib/traits.js.map +0 -1
- /package/lib/{index.js.map → index.lazy.js.map} +0 -0
package/lib/.lazy.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"serviceDirs":["services"],"twins":["index.js"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{api$D as e,api$Protocol as t,api$call as n,api$error as r,api$named as i,api$newError as a,api$op as o,api$opPaginated as s,api$withValue as c,category$withAuthError as l,category$withBadRequestError as u,category$withConflictError as d,category$withParseError as f,category$withRetryable as p,category$withServerError as m,config$String as h,config$all as g,pagination$paginateCursor as _,pagination$paginateSingle as v,pagination$paginateWithDefaults as ee,response_validation$checkResponse as te,response_validation$withholdActual as ne,retry$capped as re,retry$jittered as y,retry$makeDefault as b,retry$throttlingFactory as x,retry$throttlingOptions as ie,retry$transientFactory as S,retry$transientOptions as ae,trait$Body as oe,trait$FormDataFile as se,trait$Header as ce,trait$Http as le,trait$HttpBody as ue,trait$KeyDictionary as de,trait$Label as fe,trait$Query as pe,trait$ResponseCode as me,trait$UnionCases as he,trait$applyErrorMatchers as ge,trait$bodySymbol as C,trait$formDataFileSymbol as _e,trait$getErrorMatchers as ve,trait$headerSymbol as w,trait$httpBodySymbol as ye,trait$httpSymbol as T,trait$keyDictionarySymbol as E,trait$labelSymbol as D,trait$querySymbol as O,trait$responseCodeSymbol as k,trait$unionCasesSymbol as A}from"@distilled.cloud/core/_bundle/base";import{debug$debugHttp as j,errors$API_ERRORS as M,errors$BadGateway as N,errors$BadRequest as P,errors$ConfigError as F,errors$Conflict as be,errors$DEFAULT_ERRORS as xe,errors$Forbidden as Se,errors$GatewayTimeout as Ce,errors$HTTP_STATUS_MAP as I,errors$InternalServerError as L,errors$Locked as we,errors$NotFound as Te,errors$ServiceUnavailable as Ee,errors$TooManyRequests as De,errors$Unauthorized as Oe,errors$UnprocessableEntity as ke,protocol_http$buildRequest as Ae,protocol_http$getAnn as je,protocol_http$getProps as Me,protocol_http$hasPropAnn as R,protocol_http$makeRequest as Ne,protocol_http$mapKeys as z,protocol_http$mapsVerbatim as B,protocol_http$matchTypedError as Pe,protocol_http$nameOf as V,protocol_rest$RawResponse as Fe,protocol_rest$RawResponseRoot as Ie,protocol_rest$SensitiveValue as Le,protocol_rest$hasSensitive as Re,protocol_rest$hasSensitiveMember as ze,protocol_rest$rawResponseRootSymbol as Be,protocol_rest$rawResponseSymbol as Ve,protocol_rest$sensitiveValueSymbol as He,protocol_rest$unwrapRedactedDeep as H,protocol_rest$wrapSensitive as Ue,retry_after$parseRetryAfterForStatus as U,schema_lite$Array as We,schema_lite$Boolean as Ge,schema_lite$NullOr as Ke,schema_lite$Number as qe,schema_lite$Record as Je,schema_lite$String as Ye,schema_lite$Struct as Xe,schema_lite$TaggedError as Ze,schema_lite$Unknown as Qe,schema_lite$at as $e,schema_lite$optional as et,schema_lite$suspend as tt}from"@distilled.cloud/core/_bundle/rest";import*as W from"effect/Context";import*as G from"effect/Effect";import*as K from"effect/Layer";import*as q from"effect/Redacted";import*as J from"@distilled.cloud/core/schema-lite-typed";import*as Y from"effect/http/HttpBody";import*as nt from"effect/http/HttpClient";import*as rt from"effect/http/HttpClientRequest";const X=`https://api.stripe.com`;var Credentials=class extends (/*@__PURE__*/ W.Service()(`StripeCredentials`)){};const it=/*@__PURE__*/ g({apiKey:/*@__PURE__*/ h(`STRIPE_API_KEY`)});const at=/*@__PURE__*/ K.succeed(Credentials,/*@__PURE__*/ it.pipe(/*@__PURE__*/ G.mapError(()=>new F({message:`STRIPE_API_KEY environment variable is required`})),/*@__PURE__*/ G.map(({apiKey:e})=>({apiKey:q.make(e),apiBaseUrl:X})),G.orDie));const credentials=e=>K.succeed(Credentials,G.succeed({apiKey:e.apiKey,apiBaseUrl:e.apiBaseUrl??`https://api.stripe.com`}));var PaymentError=class extends (/*@__PURE__*/ J.TaggedError()(`PaymentError`,{message:/*@__PURE__*/ J.optional(J.String),code:/*@__PURE__*/ J.optional(J.String),decline_code:/*@__PURE__*/ J.optional(J.String),charge:/*@__PURE__*/ J.optional(J.String),param:/*@__PURE__*/ J.optional(J.String),doc_url:/*@__PURE__*/ J.optional(J.String),request_log_url:/*@__PURE__*/ J.optional(J.String)}).pipe(u)){};var CardError=class extends (/*@__PURE__*/ J.TaggedError()(`CardError`,{message:/*@__PURE__*/ J.optional(J.String),code:/*@__PURE__*/ J.optional(J.String),decline_code:/*@__PURE__*/ J.optional(J.String),charge:/*@__PURE__*/ J.optional(J.String),param:/*@__PURE__*/ J.optional(J.String),doc_url:/*@__PURE__*/ J.optional(J.String),advice_code:/*@__PURE__*/ J.optional(J.String),network_advice_code:/*@__PURE__*/ J.optional(J.String),network_decline_code:/*@__PURE__*/ J.optional(J.String),payment_method_type:/*@__PURE__*/ J.optional(J.String),request_log_url:/*@__PURE__*/ J.optional(J.String)}).pipe(u)){};var IdempotencyError=class extends (/*@__PURE__*/ J.TaggedError()(`IdempotencyError`,{message:/*@__PURE__*/ J.optional(J.String),code:/*@__PURE__*/ J.optional(J.String),doc_url:/*@__PURE__*/ J.optional(J.String),request_log_url:/*@__PURE__*/ J.optional(J.String)}).pipe(d)){};var InvalidRequestError=class extends (/*@__PURE__*/ J.TaggedError()(`InvalidRequestError`,{message:/*@__PURE__*/ J.optional(J.String),code:/*@__PURE__*/ J.optional(J.String),param:/*@__PURE__*/ J.optional(J.String),doc_url:/*@__PURE__*/ J.optional(J.String),request_log_url:/*@__PURE__*/ J.optional(J.String)}).pipe(u)){};var ApiError=class extends (/*@__PURE__*/ J.TaggedError()(`ApiError`,{message:/*@__PURE__*/ J.optional(J.String),code:/*@__PURE__*/ J.optional(J.String),param:/*@__PURE__*/ J.optional(J.String),doc_url:/*@__PURE__*/ J.optional(J.String),request_log_url:/*@__PURE__*/ J.optional(J.String)}).pipe(m,/*@__PURE__*/ p())){};var ExternalDependencyFailed=class extends (/*@__PURE__*/ J.TaggedError()(`ExternalDependencyFailed`,{message:/*@__PURE__*/ J.optional(J.String),code:/*@__PURE__*/ J.optional(J.String),doc_url:/*@__PURE__*/ J.optional(J.String)}).pipe(m,/*@__PURE__*/ p())){};const Z={402:PaymentError,424:ExternalDependencyFailed};var UnknownStripeError=class extends (/*@__PURE__*/ J.TaggedError()(`UnknownStripeError`,{type:/*@__PURE__*/ J.optional(J.String),code:/*@__PURE__*/ J.optional(J.String),message:/*@__PURE__*/ J.optional(J.String),param:/*@__PURE__*/ J.optional(J.String),body:J.Unknown}).pipe(m)){};var StripeParseError=class extends (/*@__PURE__*/ J.TaggedError()(`StripeParseError`,{body:J.Unknown,cause:J.Unknown}).pipe(f)){};var StripeWebhookSignatureError=class extends (/*@__PURE__*/ J.TaggedError()(`StripeWebhookSignatureError`,{message:J.String,cause:/*@__PURE__*/ J.optional(J.Unknown)}).pipe(l)){};var StripeWebhookPayloadParseError=class extends (/*@__PURE__*/ J.TaggedError()(`StripeWebhookPayloadParseError`,{message:J.String,cause:/*@__PURE__*/ J.optional(J.Unknown)}).pipe(f)){};const stripeSearchPaginate=(e,t,n)=>{switch(n.mode){case`page`:return _(e,t,n);case`single`:return v(e,t,n);default:return ee(e,t,n)}};const Http=e=>le(e);var RequestOptions=class extends (/*@__PURE__*/ W.Service()(`StripeRequestOptions`)){};const withRequestOptions=e=>G.provide(K.succeed(RequestOptions,e));const stripeRequestHeaders=e=>{const t={};if(e?.idempotencyKey!==void 0)t[`Idempotency-Key`]=e.idempotencyKey;if(e?.stripeAccount!==void 0)t[`Stripe-Account`]=e.stripeAccount;if(e?.stripeContext!==void 0)t[`Stripe-Context`]=e.stripeContext;if(e?.apiVersion!==void 0)t[`Stripe-Version`]=e.apiVersion;return t};const fail=e=>G.fail(e);const Q=/*@__PURE__*/ new Set([`GET`,`HEAD`]);const appendQueryValue=(e,t,n)=>{if(n===void 0||n===null)return;e.append(t,typeof n===`boolean`?n?`true`:`false`:String(n))};const appendStripeQuery=(e,t,n)=>{if(n===void 0||n===null)return;if(Array.isArray(n)){for(const r of n)appendQueryValue(e,`${t}[]`,r);return}if(typeof n===`object`&&!(n instanceof Date)){for(const[r,i]of Object.entries(n))appendStripeQuery(e,`${t}[${r}]`,i);return}appendQueryValue(e,t,n)};const flattenToFormPairs=(e,t=``)=>{const n=[];for(const[r,i]of Object.entries(e)){if(i===void 0||i===null)continue;const e=t?`${t}[${r}]`:r;if(Array.isArray(i))for(let t=0;t<i.length;t++){const r=i[t];if(r!==null&&r!==void 0&&typeof r===`object`&&!Array.isArray(r))n.push(...flattenToFormPairs(r,`${e}[${t}]`));else if(r!==void 0&&r!==null)n.push([`${e}[${t}]`,String(r)])}else if(typeof i===`object`)n.push(...flattenToFormPairs(i,e));else if(typeof i===`boolean`)n.push([e,i?`true`:`false`]);else n.push([e,String(i)])}return n};const buildFormUrlEncoded=e=>{const t=new URLSearchParams;for(const[n,r]of flattenToFormPairs(e))t.append(n,r);return t.toString()};const $=/*@__PURE__*/ new WeakMap;const requestPlanFor=e=>{let t=$.get(e);if(t!==void 0)return t;const n=je(e,T);if(!n)throw new Error(`operation input is missing the Http() trait`);const r=Me(e).map(e=>{const t=String(e.name);if(R(e,D))return{key:t,bind:`label`,name:V(e,D),type:e.type,verbatim:true};if(R(e,w))return{key:t,bind:`header`,name:V(e,w).toLowerCase(),type:e.type,verbatim:true};if(R(e,O))return{key:t,bind:`query`,name:V(e,O),type:e.type,verbatim:true};return{key:t,bind:`body`,name:V(e,C),type:e.type,verbatim:B(e.type,`encode`)}});t={http:n,members:r,known:new Set(r.map(e=>e.key))};$.set(e,t);return t};const requestFor=(e,t,n,r)=>{const{http:i,members:a,known:o}=requestPlanFor(r);const s={Authorization:`Bearer ${q.value(e.apiKey)}`,...stripeRequestHeaders(t),Accept:`application/json`};if(i.contentType===`multipart`)return Ae({input:H(n),inputAst:r,baseUrl:e.apiBaseUrl,headers:s});const c=H(n)??{};const l=s;const u={};let d=0;let f;let p=i.uri;for(let e=0;e<a.length;e++){const t=a[e];const n=c[t.key];if(n===void 0)continue;switch(t.bind){case`label`:p=p.replace(`{${t.name}}`,encodeURIComponent(String(n)));break;case`header`:l[t.name]=String(n);break;case`query`:appendStripeQuery(f??=new URLSearchParams,t.name,n);break;default:u[t.name]=t.verbatim?n:z(t.type,n,`encode`);d++}}for(const e in c){if(o.has(e)||!Object.hasOwn(c,e))continue;const t=c[e];if(t===void 0)continue;u[e]=t;d++}const m=Q.has(i.method);if(m&&d>0)for(const[e,t]of Object.entries(u))appendStripeQuery(f??=new URLSearchParams,e,t);const h=f===void 0?``:f.toString();const g=h?`${e.apiBaseUrl}${p}?${h}`:`${e.apiBaseUrl}${p}`;if(j())console.error(`[distilled] ${i.method} ${g}`+(d&&!m?` body=${JSON.stringify(u).slice(0,400)}`:``));const _=Ne(i.method,g,l);if(m||d===0)return _;return rt.setBody(_,i.contentType===`form-urlencoded`?Y.text(buildFormUrlEncoded(u),`application/x-www-form-urlencoded`):Y.jsonUnsafe(u))};const withCredentials=(e,t)=>c(W.get(e,Credentials),t);const encode=({input:e,inputAst:t})=>G.withFiber(n=>{const r=n.context;return withCredentials(r,n=>G.succeed(requestFor(n,W.getOrUndefined(r,RequestOptions),e,t)))});const str=e=>typeof e===`string`?e:void 0;const ot=Z;const st=I;const stripeErrorEnvelope=e=>{const t=e!==null&&typeof e===`object`?e.error:void 0;return t!==null&&typeof t===`object`?t:void 0};const stripeErrorMessage=e=>{const t=stripeErrorEnvelope(e)?.message;return typeof t===`string`?t:void 0};const matchStripeError=(e,t,n)=>{const r=stripeErrorEnvelope(t);if(!r||typeof r.type!==`string`)return new UnknownStripeError({body:t});const i={message:str(r.message),code:str(r.code),doc_url:str(r.doc_url),request_log_url:str(r.request_log_url)};switch(r.type){case`card_error`:return new CardError({...i,decline_code:str(r.decline_code),charge:str(r.charge),param:str(r.param),advice_code:str(r.advice_code),network_advice_code:str(r.network_advice_code),network_decline_code:str(r.network_decline_code),payment_method_type:str(r.payment_method_type)});case`idempotency_error`:return new IdempotencyError(i);case`invalid_request_error`:return new InvalidRequestError({...i,param:str(r.param)});case`api_error`:return new ApiError({...i,param:str(r.param)})}const a=ot[e];if(a)return new a({message:i.message,code:i.code,...str(r.decline_code)!==void 0?{decline_code:str(r.decline_code)}:{},...str(r.charge)!==void 0?{charge:str(r.charge)}:{},...str(r.param)!==void 0?{param:str(r.param)}:{},...i.doc_url!==void 0?{doc_url:i.doc_url}:{},...i.request_log_url!==void 0?{request_log_url:i.request_log_url}:{}});const o=st[e];if(o)return new o({message:i.message??``,retryAfter:U(e,n)});if(e>=500)return new L({message:i.message??`HTTP ${e}`,retryAfter:U(e,n)});return new UnknownStripeError({type:str(r.type),code:i.code,message:i.message,param:str(r.param),body:t})};const decodeResponse=(e,t,n,r)=>G.matchEffect(t.text,{onFailure:G.die,onSuccess:i=>{const a=i??``;if(j())console.error(`[distilled] <- ${t.status} ${a.slice(0,400)}`);let o;let s=false;if(a.trim().length>0)try{o=JSON.parse(a)}catch{s=true}const c=t.status;const l=t.headers;if(c>=400){const e=s?a:o;const t=stripeErrorMessage(e)??(s&&a.trim()?a.trim():`HTTP ${c}`);const n=Pe(r,c,[{message:t}],{body:s?a:o,headers:l});if(n!==void 0)return fail(n);return fail(matchStripeError(c,e,l))}const u=ze(n);if(s&&u)return fail(new StripeParseError({body:`[REDACTED]`,cause:`Invalid JSON response`}));const d=s?a:o??{};const f=B(n,`decode`)?d:z(n,d,`decode`);const p=te(e,n,f);if(p!==void 0)return fail(new StripeParseError({body:u?`[REDACTED]`:s?a:o,cause:u?ne(p):p}));return G.succeed(Re(n)?Ue(n,f):f)}});const call=(e,t)=>G.withFiber(n=>{const r=n.context;return withCredentials(r,n=>{const i=requestFor(n,W.getOrUndefined(r,RequestOptions),t,e.inputAst);const a=W.get(r,nt.HttpClient);return G.flatMap(a.execute(i),t=>decodeResponse(r,t,e.outputAst,e.errors))})});const ct=/*@__PURE__*/ K.succeed(t,/*@__PURE__*/ t.of({encode:e=>encode(e),decode:({response:e,outputAst:t,errors:n})=>G.withFiber(r=>decodeResponse(r.context,e,t,n)),call}));var Retry=class extends (/*@__PURE__*/ W.Service()(`StripeRetry`)){};const policy=e=>G.provide(K.succeed(Retry,e));const lt=/*@__PURE__*/ G.provide(/*@__PURE__*/ K.succeed(Retry,{while:()=>false}));const ut=/*@__PURE__*/ policy(x);const dt=/*@__PURE__*/ policy(S);export{a as _,Je as a,u as b,Ze as c,Credentials as credentials$Credentials,at as credentials$CredentialsFromEnv,X as credentials$DEFAULT_API_BASE_URL,credentials as credentials$credentials,et as d,M as errors$API_ERRORS,ApiError as errors$ApiError,N as errors$BadGateway,P as errors$BadRequest,CardError as errors$CardError,F as errors$ConfigError,be as errors$Conflict,xe as errors$DEFAULT_ERRORS,ExternalDependencyFailed as errors$ExternalDependencyFailed,Se as errors$Forbidden,Ce as errors$GatewayTimeout,I as errors$HTTP_STATUS_MAP,IdempotencyError as errors$IdempotencyError,L as errors$InternalServerError,InvalidRequestError as errors$InvalidRequestError,we as errors$Locked,Te as errors$NotFound,PaymentError as errors$PaymentError,Z as errors$STRIPE_HTTP_STATUS_MAP,Ee as errors$ServiceUnavailable,StripeParseError as errors$StripeParseError,StripeWebhookPayloadParseError as errors$StripeWebhookPayloadParseError,StripeWebhookSignatureError as errors$StripeWebhookSignatureError,De as errors$TooManyRequests,Oe as errors$Unauthorized,UnknownStripeError as errors$UnknownStripeError,ke as errors$UnprocessableEntity,tt as f,i as g,r as h,qe as i,Qe as l,n as m,Ge as n,Ye as o,e as p,stripeSearchPaginate as pagination$stripeSearchPaginate,RequestOptions as protocol$RequestOptions,ct as protocol$StripeProtocol,withRequestOptions as protocol$withRequestOptions,Ke as r,Retry as retry$Retry,re as retry$capped,y as retry$jittered,b as retry$makeDefault,lt as retry$none,policy as retry$policy,ut as retry$throttling,x as retry$throttlingFactory,ie as retry$throttlingOptions,dt as retry$transient,S as retry$transientFactory,ae as retry$transientOptions,Xe as s,We as t,oe as traits$Body,se as traits$FormDataFile,ce as traits$Header,Http as traits$Http,ue as traits$HttpBody,de as traits$KeyDictionary,fe as traits$Label,pe as traits$Query,Fe as traits$RawResponse,Ie as traits$RawResponseRoot,me as traits$ResponseCode,Le as traits$SensitiveValue,he as traits$UnionCases,ge as traits$applyErrorMatchers,C as traits$bodySymbol,_e as traits$formDataFileSymbol,ve as traits$getErrorMatchers,w as traits$headerSymbol,ye as traits$httpBodySymbol,T as traits$httpSymbol,E as traits$keyDictionarySymbol,D as traits$labelSymbol,O as traits$querySymbol,Be as traits$rawResponseRootSymbol,Ve as traits$rawResponseSymbol,k as traits$responseCodeSymbol,He as traits$sensitiveValueSymbol,A as traits$unionCasesSymbol,$e as u,o as v,s as y};
|
|
2
|
+
//# sourceMappingURL=sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.js","names":["Category.withBadRequestError","Category.withConflictError","Category.withServerError","Category.withParseError","Category.withAuthError","Pagination.paginateCursor","Pagination.paginateSingle","Pagination.paginateWithDefaults","CoreHttp","HttpBody","API.withValue","API.Protocol","D","Protocol","call$1","error","named","newError","op","opPaginated","withValue","withAuthError","withBadRequestError","withConflictError","withParseError","withRetryable","withServerError","String$2","all$1","paginateCursor","paginateSingle","paginateWithDefaults","checkResponse","withholdActual","capped","jittered","makeDefault","throttlingFactory","throttlingOptions","transientFactory","transientOptions","Body","FormDataFile","Header","Http$1","HttpBody","KeyDictionary","Label","Query","ResponseCode","UnionCases","applyErrorMatchers","bodySymbol","formDataFileSymbol","getErrorMatchers","headerSymbol","httpBodySymbol","httpSymbol","keyDictionarySymbol","labelSymbol","querySymbol","responseCodeSymbol","unionCasesSymbol","debugHttp","API_ERRORS","BadGateway","BadRequest","ConfigError","Conflict","DEFAULT_ERRORS","Forbidden","GatewayTimeout","HTTP_STATUS_MAP","InternalServerError","Locked","NotFound","ServiceUnavailable","TooManyRequests","Unauthorized","UnprocessableEntity","buildRequest","getAnn","getProps","hasPropAnn","makeRequest","mapKeys","mapsVerbatim","matchTypedError","nameOf","RawResponse","RawResponseRoot","SensitiveValue","hasSensitive","hasSensitiveMember","rawResponseRootSymbol","rawResponseSymbol","sensitiveValueSymbol","unwrapRedactedDeep","wrapSensitive","parseRetryAfterForStatus","Array$1","Boolean","NullOr","Number","Record","String$1","Struct","TaggedError","Unknown","at","optional","suspend","Context","Effect","Layer","Redacted","Schema","HttpBody$1","HttpClient","HttpClientRequest","DEFAULT_API_BASE_URL","envConfig","CredentialsFromEnv","apiKey","config","STRIPE_HTTP_STATUS_MAP","pagination","operation","input","trait","options","headers","BODYLESS","value","query","key","item","nestedKey","nestedValue","pairs","obj","fullKey","prefix","i","params","body","requestPlans","plan","inputAst","http","members","prop","m","baseHeaders","creds","inputObj","bodyKeys","uri","known","bodyless","qs","url","request","context","f","fiber","v","stripeStatusMap","coreStatusMap","envelope","errorBody","message","err","common","StripeErrorClass","status","CoreErrorClass","response","text","read","json","nonJson","typed","errorClasses","withholdBody","outputAst","mapped","cause","client","StripeProtocol","args","errors","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/pagination.ts","../../src/traits.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"8gGAcA,MAAawH,EAAuB,yBAOpC,IAAa,YAAb,eACwB,gBAAQ,QAA4C,CAAC,CACzE,mBACF,EAAA,AAAE,CAAC,EAEL,MAAMC,GAA0B,gBAAiB,CAC/C,OAAsB,gBAAoB,gBAAgB,CAC5D,CAAC,EAED,MAAaC,GAAmC,gBAAM,QACpD,YACc,iBAAU,KACR,gBAAO,aAEjB,IAAIvD,EAAY,CACd,QAAS,iDACX,CAAC,CACL,EACc,gBAAO,KAAK,CAAE,aAAc,CACxC,OAAQgD,EAAS,KAAKQ,CAAM,EAC5B,WAAYH,CACd,EAAE,EACFP,EAAO,KACT,CACF,EAGA,MAAa,YAAe,GAI1BC,EAAM,QACJ,YACAD,EAAO,QAAQ,CACb,OAAQW,EAAO,OACf,WAAYA,EAAO,YAAA,wBACrB,CAAC,CACH,ECxBF,IAAa,aAAb,eACwB,gBAAO,YAA0B,CAAC,CAAC,eAAgB,CACvE,QAAuB,gBAAO,SAASR,EAAO,MAAM,EACpD,KAAoB,gBAAO,SAASA,EAAO,MAAM,EACjD,aAA4B,gBAAO,SAASA,EAAO,MAAM,EACzD,OAAsB,gBAAO,SAASA,EAAO,MAAM,EACnD,MAAqB,gBAAO,SAASA,EAAO,MAAM,EAClD,QAAuB,gBAAO,SAASA,EAAO,MAAM,EACpD,gBAA+B,gBAAO,SAASA,EAAO,MAAM,CAC9D,CAAC,CAAC,CAAC,KAAKpH,CAA4B,EAAA,AAAE,CAAC,EAMzC,IAAa,UAAb,eACwB,gBAAO,YAAuB,CAAC,CAAC,YAAa,CACjE,QAAuB,gBAAO,SAASoH,EAAO,MAAM,EACpD,KAAoB,gBAAO,SAASA,EAAO,MAAM,EACjD,aAA4B,gBAAO,SAASA,EAAO,MAAM,EACzD,OAAsB,gBAAO,SAASA,EAAO,MAAM,EACnD,MAA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EH,MAAa2K,GAA0D,gBAAM,QAC3ElL,EACc,gBAAa,GAAG,CAE5B,OAAS,GAAS,OAAOmL,CAAI,EAC7B,QAAS,CAAE,WAAU,YAAW,YAC9B7E,EAAO,UAAW,GAChB,eAAeoD,EAAM,QAAiCY,EAAUQ,EAAWM,CAAM,CACnF,EACF,IACF,CAAC,CACH,EC/nBA,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,aAAa,EAAA,AAAE,CAAC,EAG1F,MAAa,OAAU,GACrB9E,EAAO,QAAQC,EAAM,QAAQ,MAAO8E,CAAgB,CAAC,EAGvD,MAAaC,GAAqB,gBAAO,QACzB,gBAAM,QAAQ,MAAO,CAAE,UAAa,KAAM,CAAC,CAC3D,EAGA,MAAaC,GAA2B,qBAAO7J,CAAiB,EAGhE,MAAa8J,GAA0B,qBAAO5J,CAAgB"}
|
package/lib/credentials.js
CHANGED
|
@@ -1,34 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
10
|
-
import * as Context from "effect/Context";
|
|
11
|
-
import * as Effect from "effect/Effect";
|
|
12
|
-
import * as Layer from "effect/Layer";
|
|
13
|
-
import * as Redacted from "effect/Redacted";
|
|
14
|
-
export const DEFAULT_API_BASE_URL = "https://api.stripe.com";
|
|
15
|
-
export class Credentials extends /*@__PURE__*/ /*@__PURE__*/ Context.Service()("StripeCredentials") {
|
|
16
|
-
}
|
|
17
|
-
const envConfig = /*@__PURE__*/ EffectConfig.all({
|
|
18
|
-
apiKey: /*@__PURE__*/ EffectConfig.String("STRIPE_API_KEY"),
|
|
19
|
-
});
|
|
20
|
-
export const CredentialsFromEnv = /*@__PURE__*/ Layer.succeed(Credentials,
|
|
21
|
-
/*@__PURE__*/ envConfig.pipe(
|
|
22
|
-
/*@__PURE__*/ Effect.mapError(() => new ConfigError({
|
|
23
|
-
message: "STRIPE_API_KEY environment variable is required",
|
|
24
|
-
})),
|
|
25
|
-
/*@__PURE__*/ Effect.map(({ apiKey }) => ({
|
|
26
|
-
apiKey: Redacted.make(apiKey),
|
|
27
|
-
apiBaseUrl: DEFAULT_API_BASE_URL,
|
|
28
|
-
})), Effect.orDie));
|
|
29
|
-
|
|
30
|
-
export const credentials = (config) => Layer.succeed(Credentials, Effect.succeed({
|
|
31
|
-
apiKey: config.apiKey,
|
|
32
|
-
apiBaseUrl: config.apiBaseUrl ?? DEFAULT_API_BASE_URL,
|
|
33
|
-
}));
|
|
34
|
-
//# sourceMappingURL=credentials.js.map
|
|
1
|
+
export { credentials$Credentials as Credentials, credentials$CredentialsFromEnv as CredentialsFromEnv, credentials$DEFAULT_API_BASE_URL as DEFAULT_API_BASE_URL, credentials$credentials as credentials } from "./_bundle/sdk.js";
|
package/lib/errors.js
CHANGED
|
@@ -1,130 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
|
|
9
|
-
import * as Category from "@distilled.cloud/core/category";
|
|
10
|
-
import * as Schema from "@distilled.cloud/core/schema-lite-typed";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export class PaymentError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("PaymentError", {
|
|
16
|
-
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
17
|
-
code: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
18
|
-
decline_code: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
19
|
-
charge: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
20
|
-
param: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
21
|
-
doc_url: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
22
|
-
request_log_url: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
23
|
-
}).pipe(Category.withBadRequestError) {
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export class CardError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("CardError", {
|
|
30
|
-
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
31
|
-
code: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
32
|
-
decline_code: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
33
|
-
charge: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
34
|
-
param: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
35
|
-
doc_url: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
36
|
-
advice_code: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
37
|
-
network_advice_code: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
38
|
-
network_decline_code: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
39
|
-
payment_method_type: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
40
|
-
request_log_url: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
41
|
-
}).pipe(Category.withBadRequestError) {
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export class IdempotencyError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("IdempotencyError", {
|
|
49
|
-
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
50
|
-
code: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
51
|
-
doc_url: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
52
|
-
request_log_url: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
53
|
-
}).pipe(Category.withConflictError) {
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
export class InvalidRequestError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("InvalidRequestError", {
|
|
60
|
-
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
61
|
-
code: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
62
|
-
param: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
63
|
-
doc_url: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
64
|
-
request_log_url: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
65
|
-
}).pipe(Category.withBadRequestError) {
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
export class ApiError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("ApiError", {
|
|
72
|
-
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
73
|
-
code: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
74
|
-
param: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
75
|
-
doc_url: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
76
|
-
request_log_url: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
77
|
-
}).pipe(Category.withServerError, /*@__PURE__*/ Category.withRetryable()) {
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
export class ExternalDependencyFailed extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("ExternalDependencyFailed", {
|
|
83
|
-
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
84
|
-
code: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
85
|
-
doc_url: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
86
|
-
}).pipe(Category.withServerError, /*@__PURE__*/ Category.withRetryable()) {
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
export const STRIPE_HTTP_STATUS_MAP = {
|
|
93
|
-
402: PaymentError,
|
|
94
|
-
424: ExternalDependencyFailed,
|
|
95
|
-
};
|
|
96
|
-
// Unknown Stripe error -- returned when an error type is not recognized
|
|
97
|
-
export class UnknownStripeError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("UnknownStripeError", {
|
|
98
|
-
type: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
99
|
-
code: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
100
|
-
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
101
|
-
param: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
102
|
-
body: Schema.Unknown,
|
|
103
|
-
}).pipe(Category.withServerError) {
|
|
104
|
-
}
|
|
105
|
-
// Schema parse error wrapper
|
|
106
|
-
export class StripeParseError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("StripeParseError", {
|
|
107
|
-
body: Schema.Unknown,
|
|
108
|
-
cause: Schema.Unknown,
|
|
109
|
-
}).pipe(Category.withParseError) {
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
export class StripeWebhookSignatureError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("StripeWebhookSignatureError", {
|
|
118
|
-
message: Schema.String,
|
|
119
|
-
cause: /*@__PURE__*/ Schema.optional(Schema.Unknown),
|
|
120
|
-
}).pipe(Category.withAuthError) {
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
export class StripeWebhookPayloadParseError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("StripeWebhookPayloadParseError", {
|
|
126
|
-
message: Schema.String,
|
|
127
|
-
cause: /*@__PURE__*/ Schema.optional(Schema.Unknown),
|
|
128
|
-
}).pipe(Category.withParseError) {
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=errors.js.map
|
|
1
|
+
export { errors$API_ERRORS as API_ERRORS, errors$ApiError as ApiError, errors$BadGateway as BadGateway, errors$BadRequest as BadRequest, errors$CardError as CardError, errors$ConfigError as ConfigError, errors$Conflict as Conflict, errors$DEFAULT_ERRORS as DEFAULT_ERRORS, errors$ExternalDependencyFailed as ExternalDependencyFailed, errors$Forbidden as Forbidden, errors$GatewayTimeout as GatewayTimeout, errors$HTTP_STATUS_MAP as HTTP_STATUS_MAP, errors$IdempotencyError as IdempotencyError, errors$InternalServerError as InternalServerError, errors$InvalidRequestError as InvalidRequestError, errors$Locked as Locked, errors$NotFound as NotFound, errors$PaymentError as PaymentError, errors$STRIPE_HTTP_STATUS_MAP as STRIPE_HTTP_STATUS_MAP, errors$ServiceUnavailable as ServiceUnavailable, errors$StripeParseError as StripeParseError, errors$StripeWebhookPayloadParseError as StripeWebhookPayloadParseError, errors$StripeWebhookSignatureError as StripeWebhookSignatureError, errors$TooManyRequests as TooManyRequests, errors$Unauthorized as Unauthorized, errors$UnknownStripeError as UnknownStripeError, errors$UnprocessableEntity as UnprocessableEntity } from "./_bundle/sdk.js";
|
package/lib/index.js
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
1
|
export * from "./credentials.js";
|
|
14
2
|
export * from "./errors.js";
|
|
15
3
|
export * as T from "./traits.js";
|
|
16
|
-
export { StripeProtocol, RequestOptions, withRequestOptions
|
|
4
|
+
export { StripeProtocol, RequestOptions, withRequestOptions } from "./protocol.js";
|
|
17
5
|
export { stripeSearchPaginate } from "./pagination.js";
|
|
18
6
|
export * as Retry from "./retry.js";
|
|
19
7
|
export * as Webhooks from "./webhooks.js";
|
|
20
8
|
export * as Services from "./services/index.js";
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./credentials.js";
|
|
2
|
+
export * from "./errors.js";
|
|
3
|
+
export * as T from "./traits.js";
|
|
4
|
+
export { StripeProtocol, RequestOptions, withRequestOptions } from "./protocol.js";
|
|
5
|
+
export { stripeSearchPaginate } from "./pagination.js";
|
|
6
|
+
export * as Retry from "./retry.js";
|
|
7
|
+
export * as Webhooks from "./webhooks.js";
|
|
8
|
+
export * as Services from "./services.lazy/index.js";
|
package/lib/pagination.js
CHANGED
|
@@ -1,28 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import * as Pagination from "@distilled.cloud/core/pagination";
|
|
16
|
-
|
|
17
|
-
export const stripeSearchPaginate = (operation, input, pagination) => {
|
|
18
|
-
switch (pagination.mode) {
|
|
19
|
-
case "page":
|
|
20
|
-
// Stripe search: `page` is a cursor, `next_page` the next cursor.
|
|
21
|
-
return Pagination.paginateCursor(operation, input, pagination);
|
|
22
|
-
case "single":
|
|
23
|
-
return Pagination.paginateSingle(operation, input, pagination);
|
|
24
|
-
default:
|
|
25
|
-
return Pagination.paginateWithDefaults(operation, input, pagination);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=pagination.js.map
|
|
1
|
+
export { pagination$stripeSearchPaginate as stripeSearchPaginate } from "./_bundle/sdk.js";
|