@distilled.cloud/render 1.0.0-rc.15 → 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.d.ts +2 -2
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +1 -35
- package/lib/errors.d.ts +15 -15
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -26
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -19
- package/lib/index.lazy.js +9 -0
- package/lib/{index.js.map → index.lazy.js.map} +1 -1
- package/lib/pagination.js +1 -45
- package/lib/pagination.js.map +1 -1
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +1 -43
- package/lib/retry.d.ts +1 -1
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +1 -32
- package/lib/services/index.js +0 -2
- package/lib/services/render.d.ts +14 -1176
- package/lib/services/render.d.ts.map +1 -1
- package/lib/services/render.js +281 -6016
- package/lib/services/render.js.map +1 -1
- package/lib/services.lazy/index.js +3 -0
- package/lib/services.lazy/render.js +4 -0
- package/lib/traits.d.ts +1 -1
- package/lib/traits.js +1 -11
- package/package.json +9 -7
- package/src/credentials.ts +7 -6
- package/src/errors.ts +14 -15
- package/src/index.ts +2 -2
- package/src/pagination.ts +1 -1
- package/src/protocol.ts +6 -9
- package/src/retry.ts +6 -4
- package/src/services/render.ts +5249 -7671
- package/src/traits.ts +1 -1
- package/lib/credentials.js.map +0 -1
- package/lib/errors.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/.lazy.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"serviceDirs":["services"],"twins":["index.js"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{errors$API_ERRORS as e,errors$BadGateway as t,errors$BadRequest as n,errors$ConfigError as r,errors$Conflict as i,errors$DEFAULT_ERRORS as a,errors$Forbidden as o,errors$GatewayTimeout as ee,errors$HTTP_STATUS_MAP as te,errors$InternalServerError as ne,errors$Locked as re,errors$NotFound as ie,errors$ServiceUnavailable as s,errors$TooManyRequests as c,errors$Unauthorized as l,errors$UnprocessableEntity as u,protocol_rest$RawResponse as d,protocol_rest$RawResponseRoot as f,protocol_rest$SensitiveValue as p,protocol_rest$makeRestProtocol as m,protocol_rest$rawResponseRootSymbol as h,protocol_rest$rawResponseSymbol as g,protocol_rest$sensitiveValueSymbol as _,schema_lite$Array as v,schema_lite$Boolean as y,schema_lite$Number as b,schema_lite$Record as x,schema_lite$String as S,schema_lite$Struct as C,schema_lite$TaggedError as w,schema_lite$Unknown as T,schema_lite$at as E,schema_lite$optional as D,schema_lite$suspend as O}from"@distilled.cloud/core/_bundle/rest";import{api$D as k,api$call as A,api$error as j,api$named as M,api$newError as N,api$op as P,category$withAuthError as F,category$withBadRequestError as I,category$withConflictError as L,category$withParseError as R,category$withServerError as z,retry$capped as B,retry$jittered as V,retry$makeDefault as H,retry$throttlingFactory as U,retry$throttlingOptions as W,retry$transientFactory as G,retry$transientOptions as K,trait$Body as ae,trait$FormDataFile as q,trait$Header as J,trait$Http as oe,trait$HttpBody as se,trait$KeyDictionary as ce,trait$Label as le,trait$Query as ue,trait$ResponseCode as de,trait$UnionCases as fe,trait$applyErrorMatchers as pe,trait$bodySymbol as me,trait$errorMatchersSymbol as he,trait$formDataFileSymbol as ge,trait$getErrorMatchers as _e,trait$headerSymbol as ve,trait$httpBodySymbol as ye,trait$httpSymbol as be,trait$keyDictionarySymbol as xe,trait$labelSymbol as Se,trait$querySymbol as Ce,trait$responseCodeSymbol as we,trait$unionCasesSymbol as Te}from"@distilled.cloud/core/_bundle/base";import*as Y from"effect/Context";import*as X from"effect/Effect";import*as Z from"effect/Layer";import*as Q from"effect/Redacted";import*as $ from"@distilled.cloud/core/schema-lite-typed";const Ee=`https://api.render.com/v1`;var Credentials=class extends (/*@__PURE__*/ Y.Service()(`RenderCredentials`)){};const fromApiKey=e=>Z.succeed(Credentials,X.succeed({apiKey:e.apiKey,apiBaseUrl:e.apiBaseUrl??`https://api.render.com/v1`}));const De=/*@__PURE__*/ Z.succeed(Credentials,/*@__PURE__*/ X.gen(function*(){const e=process.env.RENDER_API_KEY;if(!e)return yield*new r({message:`RENDER_API_KEY environment variable is required`});return{apiKey:Q.make(e),apiBaseUrl:process.env.RENDER_API_BASE_URL??`https://api.render.com/v1`}}).pipe(X.orDie));var UnknownRenderError=class extends (/*@__PURE__*/ $.TaggedError()(`UnknownRenderError`,{code:/*@__PURE__*/ $.optional($.String),message:/*@__PURE__*/ $.optional($.String),body:$.Unknown}).pipe(z)){};var RenderParseError=class extends (/*@__PURE__*/ $.TaggedError()(`RenderParseError`,{body:$.Unknown,cause:$.Unknown}).pipe(R)){};const Oe=/*@__PURE__*/ m({credentials:/*@__PURE__*/ X.flatMap(Credentials,e=>e),baseUrl:e=>e.apiBaseUrl,headers:e=>({Authorization:`Bearer ${Q.value(e.apiKey)}`,Accept:`application/json`}),unknownError:({code:e,message:t,body:n})=>new UnknownRenderError({code:typeof e===`string`?e:e!==void 0?String(e):void 0,message:t,body:n}),parseError:({body:e,cause:t})=>new RenderParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ Y.Service()(`RenderRetry`)){};const policy=e=>X.provide(Z.succeed(Retry,e));const ke=/*@__PURE__*/ X.provide(/*@__PURE__*/ Z.succeed(Retry,{while:()=>false}));const Ae=/*@__PURE__*/ policy(U);const je=/*@__PURE__*/ policy(G);export{P as _,S as a,L as b,T as c,Credentials as credentials$Credentials,De as credentials$CredentialsFromEnv,Ee as credentials$DEFAULT_API_BASE_URL,fromApiKey as credentials$fromApiKey,O as d,e as errors$API_ERRORS,t as errors$BadGateway,n as errors$BadRequest,r as errors$ConfigError,i as errors$Conflict,a as errors$DEFAULT_ERRORS,o as errors$Forbidden,ee as errors$GatewayTimeout,te as errors$HTTP_STATUS_MAP,ne as errors$InternalServerError,re as errors$Locked,ie as errors$NotFound,RenderParseError as errors$RenderParseError,s as errors$ServiceUnavailable,c as errors$TooManyRequests,l as errors$Unauthorized,UnknownRenderError as errors$UnknownRenderError,u as errors$UnprocessableEntity,k as f,N as g,M as h,x as i,E as l,j as m,y as n,C as o,A as p,Oe as protocol$RenderProtocol,b as r,Retry as retry$Retry,B as retry$capped,V as retry$jittered,H as retry$makeDefault,ke as retry$none,policy as retry$policy,Ae as retry$throttling,U as retry$throttlingFactory,W as retry$throttlingOptions,je as retry$transient,G as retry$transientFactory,K as retry$transientOptions,w as s,v as t,ae as traits$Body,q as traits$FormDataFile,J as traits$Header,oe as traits$Http,se as traits$HttpBody,ce as traits$KeyDictionary,le as traits$Label,ue as traits$Query,d as traits$RawResponse,f as traits$RawResponseRoot,de as traits$ResponseCode,p as traits$SensitiveValue,fe as traits$UnionCases,pe as traits$applyErrorMatchers,me as traits$bodySymbol,he as traits$errorMatchersSymbol,ge as traits$formDataFileSymbol,_e as traits$getErrorMatchers,ve as traits$headerSymbol,ye as traits$httpBodySymbol,be as traits$httpSymbol,xe as traits$keyDictionarySymbol,Se as traits$labelSymbol,Ce as traits$querySymbol,h as traits$rawResponseRootSymbol,g as traits$rawResponseSymbol,we as traits$responseCodeSymbol,_ as traits$sensitiveValueSymbol,Te as traits$unionCasesSymbol,D as u,F as v,I as y};
|
|
2
|
+
//# sourceMappingURL=sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.js","names":["Category.withServerError","Category.withParseError","API_ERRORS","BadGateway","BadRequest","ConfigError","Conflict","DEFAULT_ERRORS","Forbidden","GatewayTimeout","HTTP_STATUS_MAP","InternalServerError","Locked","NotFound","ServiceUnavailable","TooManyRequests","Unauthorized","UnprocessableEntity","RawResponse","RawResponseRoot","SensitiveValue","makeRestProtocol","rawResponseRootSymbol","rawResponseSymbol","sensitiveValueSymbol","Array","Boolean","Number","Record","String$1","Struct","TaggedError","Unknown","at","optional","suspend","D","call","error","named","newError","op","withAuthError","withBadRequestError","withConflictError","withParseError","withServerError","capped","jittered","makeDefault","throttlingFactory","throttlingOptions","transientFactory","transientOptions","Body","FormDataFile","Header","Http","HttpBody","KeyDictionary","Label","Query","ResponseCode","UnionCases","applyErrorMatchers","bodySymbol","errorMatchersSymbol","formDataFileSymbol","getErrorMatchers","headerSymbol","httpBodySymbol","httpSymbol","keyDictionarySymbol","labelSymbol","querySymbol","responseCodeSymbol","unionCasesSymbol","Context","Effect","Layer","Redacted","Schema","DEFAULT_API_BASE_URL","config","CredentialsFromEnv","apiKey","RenderProtocol","resolve","creds","code","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"upEAcA,MAAakF,GAAuB,4BAOpC,IAAa,YAAb,eACwB,gBAAQ,QAA4C,CAAC,CACzE,mBACF,EAAA,AAAE,CAAC,EAGL,MAAa,WAAc,GAIzBH,EAAM,QACJ,YACAD,EAAO,QAAQ,CACb,OAAQK,EAAO,OACf,WAAYA,EAAO,YAAA,2BACrB,CAAC,CACH,EAGF,MAAaC,GAA6D,gBAAM,QAC9E,YACc,gBAAO,IAAI,WAAa,CACpC,MAAMC,EAAS,QAAQ,IAAI,eAE3B,GAAI,CAACA,EACH,OAAO,MAAO,IAAIhF,EAAY,CAC5B,QAAS,iDACX,CAAC,EAGH,MAAO,CACL,OAAQ2E,EAAS,KAAKK,CAAM,EAC5B,WAAY,QAAQ,IAAI,qBAAA,2BAC1B,CACF,CAAC,CAAC,CAAC,KAAKP,EAAO,KAAK,CACtB,ECvBA,IAAa,mBAAb,eACwB,gBAAO,YAAgC,CAAC,CAAC,qBAAsB,CACnF,KAAoB,gBAAO,SAASG,EAAO,MAAM,EACjD,QAAuB,gBAAO,SAASA,EAAO,MAAM,EACpD,KAAMA,EAAO,OACf,CAAC,CAAC,CAAC,KAAKjF,CAAwB,EAAA,AAAE,CAAC,EAGrC,IAAa,iBAAb,eACwB,gBAAO,YAA8B,CAAC,CAAC,mBAAoB,CAC/E,KAAMiF,EAAO,QACb,MAAOA,EAAO,OAChB,CAAC,CAAC,CAAC,KAAKhF,CAAuB,EAAA,AAAE,CAAC,ECFpC,MAAaqF,GAA0D,gBAAyB,CAG9F,YAA2B,gBAAO,QAAQ,YAAc,GAAYC,CAAO,EAC3E,QAAU,GAAUC,EAAM,WAC1B,QAAU,IAAW,CACnB,cAAe,UAAUR,EAAS,MAAMQ,EAAM,MAAM,IACpD,OAAQ,kBACV,GAGA,cAAe,CAAE,OAAM,UAAS,UAC9B,IAAI,mBAAmB,CACrB,KAAM,OAAOC,IAAS,SAAWA,EAAOA,IAAS,IAAA,GAAY,OAAOA,CAAI,EAAI,IAAA,GAC5E,UACA,MACF,CAAC,EACH,YAAa,CAAE,OAAM,WAAY,IAAI,iBAAiB,CAAE,OAAM,OAAM,CAAC,CACvE,CAAC,EC3BD,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,aAAa,EAAA,AAAE,CAAC,EAG1F,MAAa,OAAU,GACrBX,EAAO,QAAQC,EAAM,QAAQ,MAAOW,CAAgB,CAAC,EAGvD,MAAaC,GAAqB,gBAAO,QACzB,gBAAM,QAAQ,MAAO,CAAE,UAAa,KAAM,CAAC,CAC3D,EAGA,MAAaC,GAA2B,qBAAO1C,CAAiB,EAGhE,MAAa2C,GAA0B,qBAAOzC,CAAgB"}
|
package/lib/credentials.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Render credentials
|
|
2
|
+
* Render credentials -- hand-written.
|
|
3
3
|
*
|
|
4
4
|
* The `Credentials` service holds an *effect* that resolves the current
|
|
5
5
|
* credentials on every request (the protocol layer resolves it per request
|
|
@@ -16,7 +16,7 @@ export interface Config {
|
|
|
16
16
|
readonly apiBaseUrl: string;
|
|
17
17
|
}
|
|
18
18
|
declare const Credentials_base: Context.ServiceClass<Credentials, "RenderCredentials", Effect.Effect<Config, never, never>>;
|
|
19
|
-
export declare class Credentials extends Credentials_base {
|
|
19
|
+
export declare class Credentials extends /*@__PURE__*/ Credentials_base {
|
|
20
20
|
}
|
|
21
21
|
/** Layer from a redacted API key + optional base URL. */
|
|
22
22
|
export declare const fromApiKey: (config: {
|
package/lib/credentials.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,eAAO,MAAM,oBAAoB,8BAA8B,CAAC;AAEhE,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,eAAO,MAAM,oBAAoB,8BAA8B,CAAC;AAEhE,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WACX,SAAQ,aAAa,CAAC,gBAErB;CAAG;AAEN,yDAAyD;AACzD,eAAO,MAAM,UAAU,WAAY;IACjC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAOxB,CAAC;AAEJ,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAgBvD,CAAC"}
|
package/lib/credentials.js
CHANGED
|
@@ -1,35 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Render credentials — hand-written.
|
|
4
|
-
*
|
|
5
|
-
* The `Credentials` service holds an *effect* that resolves the current
|
|
6
|
-
* credentials on every request (the protocol layer resolves it per request
|
|
7
|
-
* on the calling fiber). Auth is a Render API key sent as
|
|
8
|
-
* `Authorization: Bearer <apiKey>`.
|
|
9
|
-
*/
|
|
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.render.com/v1";
|
|
15
|
-
export class Credentials extends Context.Service()("RenderCredentials") {
|
|
16
|
-
}
|
|
17
|
-
/** Layer from a redacted API key + optional base URL. */
|
|
18
|
-
export const fromApiKey = (config) => Layer.succeed(Credentials, Effect.succeed({
|
|
19
|
-
apiKey: config.apiKey,
|
|
20
|
-
apiBaseUrl: config.apiBaseUrl ?? DEFAULT_API_BASE_URL,
|
|
21
|
-
}));
|
|
22
|
-
/** Reads RENDER_API_KEY (required) and RENDER_API_BASE_URL (optional). */
|
|
23
|
-
export const CredentialsFromEnv = Layer.succeed(Credentials, Effect.gen(function* () {
|
|
24
|
-
const apiKey = process.env.RENDER_API_KEY;
|
|
25
|
-
if (!apiKey) {
|
|
26
|
-
return yield* new ConfigError({
|
|
27
|
-
message: "RENDER_API_KEY environment variable is required",
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
apiKey: Redacted.make(apiKey),
|
|
32
|
-
apiBaseUrl: process.env.RENDER_API_BASE_URL ?? DEFAULT_API_BASE_URL,
|
|
33
|
-
};
|
|
34
|
-
}).pipe(Effect.orDie));
|
|
35
|
-
//# 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$fromApiKey as fromApiKey } from "./_bundle/sdk.js";
|
package/lib/errors.d.ts
CHANGED
|
@@ -3,34 +3,34 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Re-exports the common HTTP errors from core and adds the Render fallback
|
|
5
5
|
* errors. Note the generated service module additionally defines its own
|
|
6
|
-
* per-status matcher classes (BadRequest/NotFound
|
|
7
|
-
* operation declares
|
|
6
|
+
* per-status matcher classes (BadRequest/NotFound/...) for the statuses each
|
|
7
|
+
* operation declares -- those share `_tag`s with the core classes here, so
|
|
8
8
|
* `catchTag` works against either.
|
|
9
9
|
*/
|
|
10
10
|
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";
|
|
11
11
|
export type { DefaultErrors } from "@distilled.cloud/core/errors";
|
|
12
|
-
import * as Schema from "
|
|
13
|
-
declare const UnknownRenderError_base: Schema.
|
|
14
|
-
readonly code: Schema.optional<Schema.String>;
|
|
15
|
-
readonly message: Schema.optional<Schema.String>;
|
|
16
|
-
readonly body: Schema.Unknown;
|
|
17
|
-
}
|
|
12
|
+
import * as Schema from "@distilled.cloud/core/schema-lite-typed";
|
|
13
|
+
declare const UnknownRenderError_base: Schema.TaggedErrorClass<"UnknownRenderError", {
|
|
14
|
+
readonly code: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
15
|
+
readonly message: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
16
|
+
readonly body: import("effect/Schema").Unknown;
|
|
17
|
+
}> & (new (...args: any[]) => {
|
|
18
18
|
"@distilled.cloud/error/categories": {
|
|
19
19
|
ServerError: true;
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
|
-
/** Unknown Render error
|
|
23
|
-
export declare class UnknownRenderError extends UnknownRenderError_base {
|
|
22
|
+
/** Unknown Render error -- returned when nothing else matches the failure. */
|
|
23
|
+
export declare class UnknownRenderError extends /*@__PURE__*/ UnknownRenderError_base {
|
|
24
24
|
}
|
|
25
|
-
declare const RenderParseError_base: Schema.
|
|
26
|
-
readonly body: Schema.Unknown;
|
|
27
|
-
readonly cause: Schema.Unknown;
|
|
28
|
-
}
|
|
25
|
+
declare const RenderParseError_base: Schema.TaggedErrorClass<"RenderParseError", {
|
|
26
|
+
readonly body: import("effect/Schema").Unknown;
|
|
27
|
+
readonly cause: import("effect/Schema").Unknown;
|
|
28
|
+
}> & (new (...args: any[]) => {
|
|
29
29
|
"@distilled.cloud/error/categories": {
|
|
30
30
|
ParseError: true;
|
|
31
31
|
};
|
|
32
32
|
});
|
|
33
33
|
/** Schema parse error wrapper. */
|
|
34
|
-
export declare class RenderParseError extends RenderParseError_base {
|
|
34
|
+
export declare class RenderParseError extends /*@__PURE__*/ RenderParseError_base {
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=errors.d.ts.map
|
package/lib/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGlE,OAAO,KAAK,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGlE,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;;;;;;;;;;AAElE,8EAA8E;AAC9E,qBAAa,kBACX,SAAQ,aAAa,CAAC,uBAIW;CAAG;;;;;;;;;AAEtC,kCAAkC;AAClC,qBAAa,gBACX,SAAQ,aAAa,CAAC,qBAGU;CAAG"}
|
package/lib/errors.js
CHANGED
|
@@ -1,26 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Render-specific error types.
|
|
3
|
-
*
|
|
4
|
-
* Re-exports the common HTTP errors from core and adds the Render fallback
|
|
5
|
-
* errors. Note the generated service module additionally defines its own
|
|
6
|
-
* per-status matcher classes (BadRequest/NotFound/…) for the statuses each
|
|
7
|
-
* operation declares — those share `_tag`s with the core classes here, so
|
|
8
|
-
* `catchTag` works against either.
|
|
9
|
-
*/
|
|
10
|
-
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";
|
|
11
|
-
import * as Category from "@distilled.cloud/core/category";
|
|
12
|
-
import * as Schema from "effect/Schema";
|
|
13
|
-
/** Unknown Render error — returned when nothing else matches the failure. */
|
|
14
|
-
export class UnknownRenderError extends Schema.TaggedError()("UnknownRenderError", {
|
|
15
|
-
code: Schema.optional(Schema.String),
|
|
16
|
-
message: Schema.optional(Schema.String),
|
|
17
|
-
body: Schema.Unknown,
|
|
18
|
-
}).pipe(Category.withServerError) {
|
|
19
|
-
}
|
|
20
|
-
/** Schema parse error wrapper. */
|
|
21
|
-
export class RenderParseError extends Schema.TaggedError()("RenderParseError", {
|
|
22
|
-
body: Schema.Unknown,
|
|
23
|
-
cause: Schema.Unknown,
|
|
24
|
-
}).pipe(Category.withParseError) {
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=errors.js.map
|
|
1
|
+
export { errors$API_ERRORS as API_ERRORS, errors$BadGateway as BadGateway, errors$BadRequest as BadRequest, errors$ConfigError as ConfigError, errors$Conflict as Conflict, errors$DEFAULT_ERRORS as DEFAULT_ERRORS, errors$Forbidden as Forbidden, errors$GatewayTimeout as GatewayTimeout, errors$HTTP_STATUS_MAP as HTTP_STATUS_MAP, errors$InternalServerError as InternalServerError, errors$Locked as Locked, errors$NotFound as NotFound, errors$RenderParseError as RenderParseError, errors$ServiceUnavailable as ServiceUnavailable, errors$TooManyRequests as TooManyRequests, errors$Unauthorized as Unauthorized, errors$UnknownRenderError as UnknownRenderError, errors$UnprocessableEntity as UnprocessableEntity } from "./_bundle/sdk.js";
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @distilled.cloud/render — Render SDK for Effect.
|
|
3
|
-
*
|
|
4
|
-
* `./services` is generated by `scripts/generate.ts` from the Smithy model
|
|
5
|
-
* in `.generated-specs` (written by `scripts/convert.ts` from the OpenAPI
|
|
6
|
-
* spec). Everything else in this folder is hand-written.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* import * as Render from "@distilled.cloud/render";
|
|
11
|
-
*
|
|
12
|
-
* const services = yield* Render.Services.render.listServices({});
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
1
|
export * from "./credentials.js";
|
|
16
2
|
export * from "./errors.js";
|
|
17
3
|
export * as T from "./traits.js";
|
|
@@ -19,10 +5,5 @@ export { RenderProtocol } from "./protocol.js";
|
|
|
19
5
|
export { paginateCursor, paginateRender } from "./pagination.js";
|
|
20
6
|
export * as Retry from "./retry.js";
|
|
21
7
|
export * as Services from "./services/index.js";
|
|
22
|
-
// Operations (and their request/response types) are importable straight off
|
|
23
|
-
// the package root. The service-local typed error classes shadow the
|
|
24
|
-
// same-named shared ones from ./errors.ts — the ops actually raise the
|
|
25
|
-
// service-local classes.
|
|
26
8
|
export * from "./services/render.js";
|
|
27
9
|
export { BadRequest, Conflict, Forbidden, NotFound } from "./services/render.js";
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./credentials.js";
|
|
2
|
+
export * from "./errors.js";
|
|
3
|
+
export * as T from "./traits.js";
|
|
4
|
+
export { RenderProtocol } from "./protocol.js";
|
|
5
|
+
export { paginateCursor, paginateRender } from "./pagination.js";
|
|
6
|
+
export * as Retry from "./retry.js";
|
|
7
|
+
export * as Services from "./services.lazy/index.js";
|
|
8
|
+
export * from "./services.lazy/render.js";
|
|
9
|
+
export { BadRequest, Conflict, Forbidden, NotFound } from "./services.lazy/render.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,cAAc,EAA4C,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,4EAA4E;AAC5E,qEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,cAAc,EAA4C,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,4EAA4E;AAC5E,qEAAqE;AACrE,wEAAwE;AACxE,yBAAyB;AACzB,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC"}
|
package/lib/pagination.js
CHANGED
|
@@ -1,46 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
/**
|
|
3
|
-
* Render pagination — hand-written.
|
|
4
|
-
*
|
|
5
|
-
* Render's list operations are cursor-mode (`cursor`/`limit` in). Most lists
|
|
6
|
-
* return a bare array of `{ cursor, <resource> }` objects; the next page is
|
|
7
|
-
* requested with the last item's `cursor`. The converter does not stamp
|
|
8
|
-
* those lists as paginated (that would un-collapse the raw-array wrapper),
|
|
9
|
-
* so {@link paginateRender} is for callers that walk the cursor by hand.
|
|
10
|
-
*/
|
|
11
|
-
import * as Effect from "effect/Effect";
|
|
12
|
-
import * as Stream from "effect/Stream";
|
|
13
|
-
export { paginateCursor } from "@distilled.cloud/core/pagination";
|
|
14
|
-
/**
|
|
15
|
-
* Walk forward with `cursor` set to the last item's `cursor` until a page
|
|
16
|
-
* comes back empty or the cursor does not advance.
|
|
17
|
-
*/
|
|
18
|
-
export const paginateRender = (operation, input, pagination) => {
|
|
19
|
-
const inputToken = pagination.inputToken;
|
|
20
|
-
if (!inputToken) {
|
|
21
|
-
return Stream.die(new Error("Render cursor pagination requires inputToken"));
|
|
22
|
-
}
|
|
23
|
-
const itemsPath = pagination.items ?? "body";
|
|
24
|
-
const startCursor = typeof input[inputToken] === "string" ? input[inputToken] : undefined;
|
|
25
|
-
return Stream.unfold({ cursor: startCursor, done: false }, (state) => Effect.gen(function* () {
|
|
26
|
-
if (state.done)
|
|
27
|
-
return undefined;
|
|
28
|
-
const requestPayload = {
|
|
29
|
-
...input,
|
|
30
|
-
...(state.cursor ? { [inputToken]: state.cursor } : {}),
|
|
31
|
-
};
|
|
32
|
-
const response = yield* operation(requestPayload);
|
|
33
|
-
const items = Array.isArray(response) ? response : Pagination.getItems(response, itemsPath);
|
|
34
|
-
const last = items.at(-1);
|
|
35
|
-
const nextCursor = typeof last?.cursor === "string" ? last.cursor : undefined;
|
|
36
|
-
const stuckCursor = state.cursor !== undefined && nextCursor === state.cursor;
|
|
37
|
-
return [
|
|
38
|
-
response,
|
|
39
|
-
{
|
|
40
|
-
cursor: nextCursor,
|
|
41
|
-
done: items.length === 0 || nextCursor === undefined || stuckCursor,
|
|
42
|
-
},
|
|
43
|
-
];
|
|
44
|
-
}));
|
|
45
|
-
};
|
|
1
|
+
import{pagination$getItems as e,pagination$paginateCursor as t}from"@distilled.cloud/core/_bundle/base";import*as n from"effect/Effect";import*as r from"effect/Stream";const paginateRender=(t,i,a)=>{const o=a.inputToken;if(!o)return r.die(/* @__PURE__ */ new Error(`Render cursor pagination requires inputToken`));const s=a.items??`body`;const c=typeof i[o]===`string`?i[o]:void 0;return r.unfold({cursor:c,done:false},r=>n.gen(function*(){if(r.done)return void 0;const n=yield*t({...i,...r.cursor?{[o]:r.cursor}:{}});const a=Array.isArray(n)?n:e(n,s);const c=a.at(-1);const l=typeof c?.cursor===`string`?c.cursor:void 0;const u=r.cursor!==void 0&&l===r.cursor;return[n,{cursor:l,done:a.length===0||l===void 0||u}]}))};export{t as paginateCursor,paginateRender};
|
|
46
2
|
//# sourceMappingURL=pagination.js.map
|
package/lib/pagination.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","
|
|
1
|
+
{"version":3,"file":"pagination.js","names":["Pagination.getItems","getItems","paginateCursor","Effect","Stream","inputToken","pagination","itemsPath","startCursor","input","state","response","operation","items","last","nextCursor","stuckCursor"],"sources":["../src/pagination.ts"],"mappings":"wKAmBA,MAAa,gBAAiD,EAAW,EAAO,IAAe,CAC7F,MAAMK,EAAaC,EAAW,WAC9B,GAAI,CAACD,EACH,OAAOD,EAAO,oBAAI,IAAI,MAAM,8CAA8C,CAAC,EAE7E,MAAMG,EAAYD,EAAW,OAAS,OAGtC,MAAME,EACJ,OAAOC,EAAMJ,KAAgB,SAAYI,EAAMJ,GAAyB,IAAA,GAE1E,OAAOD,EAAO,OAAO,CAAE,OAAQI,EAAa,KAAM,KAAM,EAAa,GACnEL,EAAO,IAAI,WAAa,CACtB,GAAIO,EAAM,KAAM,OAAO,IAAA,GAMvB,MAAMC,EAAW,MAAOC,EAAU,CAHhC,GAAGH,EACH,GAAIC,EAAM,OAAS,EAAGL,GAAaK,EAAM,MAAO,EAAI,CAAC,CAER,CAAC,EAChD,MAAMG,EAAQ,MAAM,QAAQF,CAAQ,EAAIA,EAAWX,EAAoBW,EAAUJ,CAAS,EAC1F,MAAMO,EAAOD,EAAM,GAAG,CAAA,CAAE,EACxB,MAAME,EAAa,OAAOD,GAAM,SAAW,SAAWA,EAAK,OAAS,IAAA,GACpE,MAAME,EAAcN,EAAM,SAAW,IAAA,IAAaK,IAAeL,EAAM,OAEvE,MAAO,CACLC,EACA,CACE,OAAQI,EACR,KAAMF,EAAM,SAAW,GAAKE,IAAe,IAAA,IAAaC,CAC1D,CACF,CACF,CAAC,CACH,CACF"}
|
package/lib/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAmB5E,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACrB,YAAY,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,GACzC,kBAAkB,GAClB,WAAW,GACX,eAAe,CAAC,eAAe,GAC/B,gBAAgB,CAAC;AAErB,yEAAyE;AACzE,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAElE,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAmB5E,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACrB,YAAY,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,GACzC,kBAAkB,GAClB,WAAW,GACX,eAAe,CAAC,eAAe,GAC/B,gBAAgB,CAAC;AAErB,yEAAyE;AACzE,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAElE,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAkBnD,CAAC"}
|
package/lib/protocol.js
CHANGED
|
@@ -1,43 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* RenderProtocol — hand-written.
|
|
4
|
-
*
|
|
5
|
-
* Render speaks plain bearer-authenticated JSON REST (no response envelope),
|
|
6
|
-
* so the whole protocol is one `makeRestProtocol` call from
|
|
7
|
-
* `core/protocol-rest`:
|
|
8
|
-
*
|
|
9
|
-
* request: credentials → `Authorization: Bearer <apiKey>` + base URL
|
|
10
|
-
* (default https://api.render.com/v1), resolved from the
|
|
11
|
-
* calling fiber on every request
|
|
12
|
-
*
|
|
13
|
-
* response: 2xx JSON is the payload (sensitive members delivered as
|
|
14
|
-
* `Redacted`); non-2xx `{ message }` bodies map to the
|
|
15
|
-
* operation's typed error classes by status, then the shared
|
|
16
|
-
* HTTP-status classes, then {@link UnknownRenderError}.
|
|
17
|
-
*/
|
|
18
|
-
import * as Effect from "effect/Effect";
|
|
19
|
-
import * as Redacted from "effect/Redacted";
|
|
20
|
-
import { Credentials } from "./credentials.js";
|
|
21
|
-
import { UnknownRenderError, RenderParseError } from "./errors.js";
|
|
22
|
-
export const RenderProtocol = makeRestProtocol({
|
|
23
|
-
// The Credentials service holds an effect — resolving it here (per
|
|
24
|
-
// request, on the calling fiber) picks up context-provided credentials.
|
|
25
|
-
credentials: Effect.gen(function* () {
|
|
26
|
-
const resolve = yield* Credentials;
|
|
27
|
-
return yield* resolve;
|
|
28
|
-
}),
|
|
29
|
-
baseUrl: (creds) => creds.apiBaseUrl,
|
|
30
|
-
headers: (creds) => ({
|
|
31
|
-
Authorization: `Bearer ${Redacted.value(creds.apiKey)}`,
|
|
32
|
-
Accept: "application/json",
|
|
33
|
-
}),
|
|
34
|
-
// Render's error body is `{ message: string }` — the factory's default
|
|
35
|
-
// lenient envelope covers it.
|
|
36
|
-
unknownError: ({ code, message, body }) => new UnknownRenderError({
|
|
37
|
-
code: typeof code === "string" ? code : code !== undefined ? String(code) : undefined,
|
|
38
|
-
message,
|
|
39
|
-
body,
|
|
40
|
-
}),
|
|
41
|
-
parseError: ({ body, cause }) => new RenderParseError({ body, cause }),
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=protocol.js.map
|
|
1
|
+
export { protocol$RenderProtocol as RenderProtocol } from "./_bundle/sdk.js";
|
package/lib/retry.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ import * as Effect from "effect/Effect";
|
|
|
19
19
|
export { type Options, type Factory, type Policy, makeDefault, jittered, capped, throttlingOptions, transientOptions, throttlingFactory, transientFactory, } from "@distilled.cloud/core/retry";
|
|
20
20
|
declare const Retry_base: Context.ServiceClass<Retry, "RenderRetry", Policy>;
|
|
21
21
|
/** Context tag for configuring retry behavior of Render API calls. */
|
|
22
|
-
export declare class Retry extends Retry_base {
|
|
22
|
+
export declare class Retry extends /*@__PURE__*/ Retry_base {
|
|
23
23
|
}
|
|
24
24
|
/** Provides a custom retry policy to every Render API call below it. */
|
|
25
25
|
export declare const policy: (optionsOrFactory: Policy) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
|
package/lib/retry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuC,MAAM,6BAA6B,CAAC;AAC/F;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,WAAW,EACX,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;;AAErC,sEAAsE;AACtE,qBAAa,KAAM,SAAQ,UAA+C;CAAG;
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuC,MAAM,6BAA6B,CAAC;AAC/F;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,WAAW,EACX,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;;AAErC,sEAAsE;AACtE,qBAAa,KAAM,SAAQ,aAAa,CAAC,UAA+C;CAAG;AAE3F,wEAAwE;AACxE,eAAO,MAAM,MAAM,qBAAsB,MAAM,sFACS,CAAC;AAEzD,sCAAsC;AACtC,eAAO,MAAM,IAAI,mFAEhB,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,UAAU,mFAA0C,CAAC;AAElE,oFAAoF;AACpF,eAAO,MAAM,SAAS,mFAAyC,CAAC"}
|
package/lib/retry.js
CHANGED
|
@@ -1,32 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Render retry configuration.
|
|
4
|
-
*
|
|
5
|
-
* Defines the per-SDK `Retry` Context.Service tag that generated operations
|
|
6
|
-
* wire into `API.make`. Callers can install a blanket retry policy at the
|
|
7
|
-
* layer level and have every Render API call below it pick it up:
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* import * as Render from "@distilled.cloud/render";
|
|
12
|
-
*
|
|
13
|
-
* myEffect.pipe(Render.Retry.transient);
|
|
14
|
-
* Effect.provide(myEffect, Layer.succeed(Render.Retry.Retry, customPolicy));
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
import * as Context from "effect/Context";
|
|
18
|
-
import * as Effect from "effect/Effect";
|
|
19
|
-
import * as Layer from "effect/Layer";
|
|
20
|
-
export { makeDefault, jittered, capped, throttlingOptions, transientOptions, throttlingFactory, transientFactory, } from "@distilled.cloud/core/retry";
|
|
21
|
-
/** Context tag for configuring retry behavior of Render API calls. */
|
|
22
|
-
export class Retry extends Context.Service()("RenderRetry") {
|
|
23
|
-
}
|
|
24
|
-
/** Provides a custom retry policy to every Render API call below it. */
|
|
25
|
-
export const policy = (optionsOrFactory) => Effect.provide(Layer.succeed(Retry, optionsOrFactory));
|
|
26
|
-
/** Disables all automatic retries. */
|
|
27
|
-
export const none = Effect.provide(Layer.succeed(Retry, { while: () => false }));
|
|
28
|
-
/** Apply the throttling retry policy (retries throttling errors indefinitely). */
|
|
29
|
-
export const throttling = policy(throttlingFactory);
|
|
30
|
-
/** Apply the transient retry policy (retries all transient errors indefinitely). */
|
|
31
|
-
export const transient = policy(transientFactory);
|
|
32
|
-
//# sourceMappingURL=retry.js.map
|
|
1
|
+
export { retry$Retry as Retry, retry$capped as capped, retry$jittered as jittered, retry$makeDefault as makeDefault, retry$none as none, retry$policy as policy, retry$throttling as throttling, retry$throttlingFactory as throttlingFactory, retry$throttlingOptions as throttlingOptions, retry$transient as transient, retry$transientFactory as transientFactory, retry$transientOptions as transientOptions } from "./_bundle/sdk.js";
|
package/lib/services/index.js
CHANGED