@distilled.cloud/temporal 1.0.0-rc.16 → 1.0.0-rc.18
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 -1
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +1 -42
- package/lib/errors.js +1 -26
- package/lib/index.d.ts +3 -3
- package/lib/index.js +0 -19
- package/lib/index.lazy.js +8 -0
- package/lib/pagination.js +1 -9
- package/lib/protocol.d.ts +2 -2
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +1 -40
- package/lib/retry.js +1 -33
- package/lib/services/index.js +0 -2
- package/lib/services/temporal.d.ts.map +1 -1
- package/lib/services/temporal.js +179 -437
- package/lib/services/temporal.js.map +1 -0
- package/lib/services.lazy/index.js +3 -0
- package/lib/services.lazy/temporal.js +3 -0
- package/lib/traits.js +1 -11
- package/package.json +9 -10
- package/src/credentials.ts +2 -2
- package/src/index.ts +3 -3
- package/src/protocol.ts +3 -2
- package/src/services/temporal.ts +221 -0
- 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{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 s,errors$HTTP_STATUS_MAP as c,errors$InternalServerError as l,errors$Locked as ee,errors$NotFound as te,errors$ServiceUnavailable as ne,errors$TooManyRequests as re,errors$Unauthorized as ie,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$Unknown as w,schema_lite$at as T,schema_lite$optional as E,schema_lite$suspend as D}from"@distilled.cloud/core/_bundle/rest";import{api$D as O,api$call as k,api$named as A,api$op as j,category$withParseError as M,category$withServerError as N,retry$capped as P,retry$jittered as F,retry$makeDefault as I,retry$throttlingFactory as L,retry$throttlingOptions as R,retry$transientFactory as z,retry$transientOptions as B,schema_lite_typed$String as V,schema_lite_typed$TaggedError as H,schema_lite_typed$Unknown as U,schema_lite_typed$optional as W,trait$Body as G,trait$FormDataFile as ae,trait$Header as K,trait$Http as q,trait$HttpBody as J,trait$KeyDictionary as oe,trait$Label as se,trait$Query as ce,trait$ResponseCode as le,trait$UnionCases as ue,trait$applyErrorMatchers as de,trait$bodySymbol as fe,trait$errorMatchersSymbol as pe,trait$formDataFileSymbol as me,trait$getErrorMatchers as he,trait$headerSymbol as ge,trait$httpBodySymbol as _e,trait$httpSymbol as ve,trait$keyDictionarySymbol as ye,trait$labelSymbol as be,trait$querySymbol as xe,trait$responseCodeSymbol as Se,trait$unionCasesSymbol as Ce}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";const $=`http://localhost:7243`;var Credentials=class extends (/*@__PURE__*/ Y.Service()(`TemporalCredentials`)){};const fromApiKey=e=>Z.succeed(Credentials,X.succeed({apiKey:e.apiKey,apiBaseUrl:e.apiBaseUrl??`http://localhost:7243`}));const we=/*@__PURE__*/ Z.succeed(Credentials,/*@__PURE__*/ X.gen(function*(){const e=process.env.TEMPORAL_API_KEY;if(!e)return yield*new r({message:`TEMPORAL_API_KEY environment variable is required`});return{apiKey:Q.make(e),apiBaseUrl:process.env.TEMPORAL_API_BASE_URL??`http://localhost:7243`}}));var UnknownTemporalError=class extends (/*@__PURE__*/ H()(`UnknownTemporalError`,{code:/*@__PURE__*/ W(V),message:/*@__PURE__*/ W(V),body:U}).pipe(N)){};var TemporalParseError=class extends (/*@__PURE__*/ H()(`TemporalParseError`,{body:U,cause:U}).pipe(M)){};const Te=/*@__PURE__*/ m({credentials:/*@__PURE__*/ X.flatMap(Credentials,e=>e),baseUrl:e=>e.apiBaseUrl,headers:e=>({Authorization:`Bearer ${Q.value(e.apiKey)}`}),unknownError:({code:e,message:t,body:n})=>new UnknownTemporalError({code:typeof e===`string`?e:e!==void 0?String(e):void 0,message:t,body:n}),parseError:({body:e,cause:t})=>new TemporalParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ Y.Service()(`TemporalRetry`)){};const policy=e=>X.provide(Z.succeed(Retry,e));const Ee=/*@__PURE__*/ X.provide(/*@__PURE__*/ Z.succeed(Retry,{while:()=>false}));const De=/*@__PURE__*/ policy(L);const Oe=/*@__PURE__*/ policy(z);export{v as Jb,y as Kb,b as Sb,x as Tb,S as Vb,C as Wb,O as a,w as ac,k as c,T as cc,Credentials as credentials$Credentials,we as credentials$CredentialsFromEnv,$ as credentials$DEFAULT_API_BASE_URL,fromApiKey as credentials$fromApiKey,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,s as errors$GatewayTimeout,c as errors$HTTP_STATUS_MAP,l as errors$InternalServerError,ee as errors$Locked,te as errors$NotFound,ne as errors$ServiceUnavailable,TemporalParseError as errors$TemporalParseError,re as errors$TooManyRequests,ie as errors$Unauthorized,UnknownTemporalError as errors$UnknownTemporalError,u as errors$UnprocessableEntity,E as hc,D as ic,A as j,j as l,Te as protocol$TemporalProtocol,Retry as retry$Retry,P as retry$capped,F as retry$jittered,I as retry$makeDefault,Ee as retry$none,policy as retry$policy,De as retry$throttling,L as retry$throttlingFactory,R as retry$throttlingOptions,Oe as retry$transient,z as retry$transientFactory,B as retry$transientOptions,G as traits$Body,ae as traits$FormDataFile,K as traits$Header,q as traits$Http,J as traits$HttpBody,oe as traits$KeyDictionary,se as traits$Label,ce as traits$Query,d as traits$RawResponse,f as traits$RawResponseRoot,le as traits$ResponseCode,p as traits$SensitiveValue,ue as traits$UnionCases,de as traits$applyErrorMatchers,fe as traits$bodySymbol,pe as traits$errorMatchersSymbol,me as traits$formDataFileSymbol,he as traits$getErrorMatchers,ge as traits$headerSymbol,_e as traits$httpBodySymbol,ve as traits$httpSymbol,ye as traits$keyDictionarySymbol,be as traits$labelSymbol,xe as traits$querySymbol,h as traits$rawResponseRootSymbol,g as traits$rawResponseSymbol,Se as traits$responseCodeSymbol,_ as traits$sensitiveValueSymbol,Ce as traits$unionCasesSymbol};
|
|
2
|
+
//# sourceMappingURL=sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.js","names":["Schema.String","Schema.Unknown","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","Unknown","at","optional","suspend","D","call","named","op","withParseError","withServerError","capped","jittered","makeDefault","throttlingFactory","throttlingOptions","transientFactory","transientOptions","String$2","TaggedError$1","Unknown$1","optional$1","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","DEFAULT_API_BASE_URL","config","CredentialsFromEnv","apiKey","TemporalProtocol","resolve","creds","code","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"+jEAoBA,MAAaiF,EAAuB,wBAOpC,IAAa,YAAb,eACwB,gBAAQ,QAAyD,CAAC,CACtF,qBACF,EAAA,AAAE,CAAC,EAGL,MAAa,WAAc,GAIzBF,EAAM,QACJ,YACAD,EAAO,QAAQ,CACb,OAAQI,EAAO,OACf,WAAYA,EAAO,YAAA,uBACrB,CAAC,CACH,EAGF,MAAaC,GAA6D,gBAAM,QAC9E,YACc,gBAAO,IAAI,WAAa,CACpC,MAAMC,EAAS,QAAQ,IAAI,iBAE3B,GAAI,CAACA,EACH,OAAO,MAAO,IAAI7E,EAAY,CAC5B,QAAS,mDACX,CAAC,EAGH,MAAO,CACL,OAAQyE,EAAS,KAAKI,CAAM,EAC5B,WAAY,QAAQ,IAAI,uBAAA,uBAC1B,CACF,CAAC,CACH,EC7BA,IAAa,qBAAb,eACwB,gBAAyC,CAAC,CAAC,uBAAwB,CACvF,KAAoB,gBAAgBpF,CAAa,EACjD,QAAuB,gBAAgBA,CAAa,EACpD,KAAMC,CACR,CAAC,CAAC,CAAC,KAAKC,CAAwB,EAAA,AAAE,CAAC,EAGrC,IAAa,mBAAb,eACwB,gBAAuC,CAAC,CAAC,qBAAsB,CACnF,KAAMD,EACN,MAAOA,CACT,CAAC,CAAC,CAAC,KAAKE,CAAuB,EAAA,AAAE,CAAC,ECApC,MAAakF,GAA4D,gBAAyB,CAGhG,YAA2B,gBAAO,QAAQ,YAAc,GAAYC,CAAO,EAC3E,QAAU,GAAUC,EAAM,WAC1B,QAAU,IAAW,CACnB,cAAe,UAAUP,EAAS,MAAMO,EAAM,MAAM,GACtD,GAGA,cAAe,CAAE,OAAM,UAAS,UAC9B,IAAI,qBAAqB,CACvB,KAAM,OAAOC,IAAS,SAAWA,EAAOA,IAAS,IAAA,GAAY,OAAOA,CAAI,EAAI,IAAA,GAC5E,UACA,MACF,CAAC,EACH,YAAa,CAAE,OAAM,WAAY,IAAI,mBAAmB,CAAE,OAAM,OAAM,CAAC,CACzE,CAAC,EC5BD,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,eAAe,EAAA,AAAE,CAAC,EAG5F,MAAa,OAAU,GACrBV,EAAO,QAAQC,EAAM,QAAQ,MAAOU,CAAgB,CAAC,EAGvD,MAAaC,GAAqB,gBAAO,QACzB,gBAAM,QAAQ,MAAO,CAAE,UAAa,KAAM,CAAC,CAC3D,EAGA,MAAaC,GAA2B,qBAAO7C,CAAiB,EAGhE,MAAa8C,GAA0B,qBAAO5C,CAAgB"}
|
package/lib/credentials.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
1
2
|
/**
|
|
2
3
|
* Temporal credentials -- hand-written.
|
|
3
4
|
*
|
|
@@ -21,7 +22,7 @@ export interface Config {
|
|
|
21
22
|
readonly apiKey: Redacted.Redacted<string>;
|
|
22
23
|
readonly apiBaseUrl: string;
|
|
23
24
|
}
|
|
24
|
-
declare const Credentials_base: Context.ServiceClass<Credentials, "TemporalCredentials", Effect.Effect<Config,
|
|
25
|
+
declare const Credentials_base: Context.ServiceClass<Credentials, "TemporalCredentials", Effect.Effect<Config, ConfigError, never>>;
|
|
25
26
|
export declare class Credentials extends /*@__PURE__*/ Credentials_base {
|
|
26
27
|
}
|
|
27
28
|
/** Layer from a redacted API key + optional base URL. */
|
package/lib/credentials.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D;;;;;;;;;;;;GAYG;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,uEAAuE;AACvE,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D,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,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAgBvD,CAAC"}
|
package/lib/credentials.js
CHANGED
|
@@ -1,42 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import * as Context from "effect/Context";
|
|
16
|
-
import * as Effect from "effect/Effect";
|
|
17
|
-
import * as Layer from "effect/Layer";
|
|
18
|
-
import * as Redacted from "effect/Redacted";
|
|
19
|
-
|
|
20
|
-
export const DEFAULT_API_BASE_URL = "http://localhost:7243";
|
|
21
|
-
export class Credentials extends /*@__PURE__*/ /*@__PURE__*/ Context.Service()("TemporalCredentials") {
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const fromApiKey = (config) => Layer.succeed(Credentials, Effect.succeed({
|
|
25
|
-
apiKey: config.apiKey,
|
|
26
|
-
apiBaseUrl: config.apiBaseUrl ?? DEFAULT_API_BASE_URL,
|
|
27
|
-
}));
|
|
28
|
-
|
|
29
|
-
export const CredentialsFromEnv = /*@__PURE__*/ Layer.succeed(Credentials,
|
|
30
|
-
/*@__PURE__*/ Effect.gen(function* () {
|
|
31
|
-
const apiKey = process.env.TEMPORAL_API_KEY;
|
|
32
|
-
if (!apiKey) {
|
|
33
|
-
return yield* new ConfigError({
|
|
34
|
-
message: "TEMPORAL_API_KEY environment variable is required",
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
apiKey: Redacted.make(apiKey),
|
|
39
|
-
apiBaseUrl: process.env.TEMPORAL_API_BASE_URL ?? DEFAULT_API_BASE_URL,
|
|
40
|
-
};
|
|
41
|
-
}).pipe(Effect.orDie));
|
|
42
|
-
//# 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.js
CHANGED
|
@@ -1,26 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 "@distilled.cloud/core/schema-lite-typed";
|
|
13
|
-
|
|
14
|
-
export class UnknownTemporalError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("UnknownTemporalError", {
|
|
15
|
-
code: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
16
|
-
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
17
|
-
body: Schema.Unknown,
|
|
18
|
-
}).pipe(Category.withServerError) {
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export class TemporalParseError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("TemporalParseError", {
|
|
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$ServiceUnavailable as ServiceUnavailable, errors$TemporalParseError as TemporalParseError, errors$TooManyRequests as TooManyRequests, errors$Unauthorized as Unauthorized, errors$UnknownTemporalError as UnknownTemporalError, errors$UnprocessableEntity as UnprocessableEntity } from "./_bundle/sdk.js";
|
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @distilled.cloud/temporal -- Temporal WorkflowService HTTP SDK for Effect.
|
|
3
3
|
*
|
|
4
|
-
* `./services` is generated by `scripts/generate.ts` from the Smithy model
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* `./services` is generated by `scripts/generate.ts` from the Smithy model that
|
|
5
|
+
* `scripts/convert.ts` converts from the OpenAPI spec. Everything else in this
|
|
6
|
+
* folder is hand-written.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```ts
|
package/lib/index.js
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
1
|
export * from "./credentials.js";
|
|
16
2
|
export * from "./errors.js";
|
|
17
3
|
export * as T from "./traits.js";
|
|
@@ -19,9 +5,4 @@ export { TemporalProtocol } from "./protocol.js";
|
|
|
19
5
|
export { paginateCursor } 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/temporal.js";
|
|
27
|
-
//# 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 { TemporalProtocol } from "./protocol.js";
|
|
5
|
+
export { paginateCursor } from "./pagination.js";
|
|
6
|
+
export * as Retry from "./retry.js";
|
|
7
|
+
export * as Services from "./services.lazy/index.js";
|
|
8
|
+
export * from "./services.lazy/temporal.js";
|
package/lib/pagination.js
CHANGED
package/lib/protocol.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as API from "@distilled.cloud/core/api";
|
|
2
|
-
import type { API_ERRORS, ConfigError } from "@distilled.cloud/core/errors";
|
|
2
|
+
import type { API_ERRORS, ConfigError, InvalidInput } from "@distilled.cloud/core/errors";
|
|
3
3
|
import type * as HttpClient from "effect/http/HttpClient";
|
|
4
4
|
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
5
5
|
import type * as Layer from "effect/Layer";
|
|
@@ -11,7 +11,7 @@ import { UnknownTemporalError, TemporalParseError } from "./errors.ts";
|
|
|
11
11
|
* TemporalOpError, TemporalOpContext>` explicitly so the compiler never
|
|
12
12
|
* infers these back out of the schema generics.
|
|
13
13
|
*/
|
|
14
|
-
export type TemporalOpError = InstanceType<(typeof API_ERRORS)[number]> | UnknownTemporalError | ConfigError | HttpClientError.HttpClientError | TemporalParseError;
|
|
14
|
+
export type TemporalOpError = InstanceType<(typeof API_ERRORS)[number]> | UnknownTemporalError | ConfigError | HttpClientError.HttpClientError | TemporalParseError | InvalidInput;
|
|
15
15
|
/** Context (requirements) shared by every generated Temporal operation. */
|
|
16
16
|
export type TemporalOpContext = Credentials | HttpClient.HttpClient;
|
|
17
17
|
export declare const TemporalProtocol: Layer.Layer<API.Protocol>;
|
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;
|
|
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,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAoB1F,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,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GACvB,YAAY,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,GACzC,oBAAoB,GACpB,WAAW,GACX,eAAe,CAAC,eAAe,GAC/B,kBAAkB,GAClB,YAAY,CAAC;AAEjB,2EAA2E;AAC3E,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAEpE,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAiBrD,CAAC"}
|
package/lib/protocol.js
CHANGED
|
@@ -1,40 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import * as Effect from "effect/Effect";
|
|
20
|
-
import * as Redacted from "effect/Redacted";
|
|
21
|
-
import { Credentials } from "./credentials.js";
|
|
22
|
-
import { UnknownTemporalError, TemporalParseError } from "./errors.js";
|
|
23
|
-
export const TemporalProtocol = /*@__PURE__*/ makeRestProtocol({
|
|
24
|
-
// The Credentials service holds an effect -- resolving it here (per
|
|
25
|
-
// request, on the calling fiber) picks up context-provided credentials.
|
|
26
|
-
credentials: /*@__PURE__*/ Effect.flatMap(Credentials, (resolve) => resolve),
|
|
27
|
-
baseUrl: (creds) => creds.apiBaseUrl,
|
|
28
|
-
headers: (creds) => ({
|
|
29
|
-
Authorization: `Bearer ${Redacted.value(creds.apiKey)}`,
|
|
30
|
-
}),
|
|
31
|
-
// Temporal's google.rpc.Status error body is `{ code?, message, details? }`
|
|
32
|
-
// -- the factory's default lenient envelope covers it.
|
|
33
|
-
unknownError: ({ code, message, body }) => new UnknownTemporalError({
|
|
34
|
-
code: typeof code === "string" ? code : code !== undefined ? String(code) : undefined,
|
|
35
|
-
message,
|
|
36
|
-
body,
|
|
37
|
-
}),
|
|
38
|
-
parseError: ({ body, cause }) => new TemporalParseError({ body, cause }),
|
|
39
|
-
});
|
|
40
|
-
//# sourceMappingURL=protocol.js.map
|
|
1
|
+
export { protocol$TemporalProtocol as TemporalProtocol } from "./_bundle/sdk.js";
|
package/lib/retry.js
CHANGED
|
@@ -1,33 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
22
|
-
export class Retry extends /*@__PURE__*/ /*@__PURE__*/ Context.Service()("TemporalRetry") {
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const policy = (optionsOrFactory) => Effect.provide(Layer.succeed(Retry, optionsOrFactory));
|
|
26
|
-
|
|
27
|
-
export const none = /*@__PURE__*/ Effect.provide(
|
|
28
|
-
/*@__PURE__*/ Layer.succeed(Retry, { while: () => false }));
|
|
29
|
-
|
|
30
|
-
export const throttling = /*@__PURE__*/ policy(throttlingFactory);
|
|
31
|
-
|
|
32
|
-
export const transient = /*@__PURE__*/ policy(transientFactory);
|
|
33
|
-
//# 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