@ontemper/sdk 0.9.1-tem2274.1 → 0.9.1-tem2274.2
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/dist/Manifest.d.ts +1 -1
- package/dist/Manifest.js +1 -1
- package/dist/RequestBody.d.ts +7 -6
- package/dist/RequestBody.d.ts.map +1 -1
- package/dist/RequestBody.js +12 -8
- package/dist/RequestBody.js.map +1 -1
- package/package.json +2 -2
package/dist/Manifest.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpApi, type HttpApiGroup } from 'effect/http-api';
|
|
2
2
|
import { type BuiltWorkflowManifest } from './Contract/Manifest.js';
|
|
3
|
-
export declare const SDK_VERSION = "0.9.1-tem2274.
|
|
3
|
+
export declare const SDK_VERSION = "0.9.1-tem2274.2";
|
|
4
4
|
export declare const RUNTIME_API_VERSION = 1;
|
|
5
5
|
/** The route the SDK serves for platform probes; an API declaring `GET` on it collides with it on every request. */
|
|
6
6
|
export declare const HEALTHCHECK_PATH = "/healthcheck";
|
package/dist/Manifest.js
CHANGED
|
@@ -8,7 +8,7 @@ const decodeTrigger = Schema.decodeUnknownSync(TriggerMetadata, { onExcessProper
|
|
|
8
8
|
const isFlowStep = Schema.is(FlowStep);
|
|
9
9
|
const isStepKind = Schema.is(FlowStepKind);
|
|
10
10
|
const identityOf = (resource) => `${resource.kind}:${resource.kind === 'resourceType' ? resource.type : resource.key}`;
|
|
11
|
-
export const SDK_VERSION = '0.9.1-tem2274.
|
|
11
|
+
export const SDK_VERSION = '0.9.1-tem2274.2';
|
|
12
12
|
export const RUNTIME_API_VERSION = 1;
|
|
13
13
|
/** The route the SDK serves for platform probes; an API declaring `GET` on it collides with it on every request. */
|
|
14
14
|
export const HEALTHCHECK_PATH = '/healthcheck';
|
package/dist/RequestBody.d.ts
CHANGED
|
@@ -2,16 +2,17 @@ import { type HttpServerRequest } from 'effect/http';
|
|
|
2
2
|
/** One buffer of a body's chunks, in order. */
|
|
3
3
|
export declare const joinChunks: (chunks: ReadonlyArray<Uint8Array>, byteLength: number) => Uint8Array<ArrayBuffer>;
|
|
4
4
|
/**
|
|
5
|
-
* Makes
|
|
6
|
-
* read (
|
|
5
|
+
* Makes `source`, whose body the SDK read into `bytes`, answer its own body reads from those bytes. The first
|
|
6
|
+
* read (`text`, `json`, `arrayBuffer`, `bytes`, `blob`, `formData`, or `body`) takes them without a copy and
|
|
7
7
|
* the request keeps no reference to them; a later read fails as a used web body does. The request stays the
|
|
8
|
-
* object the SDK routed, so code that keys on
|
|
8
|
+
* object the SDK routed, so code that keys on `HttpServerRequest.source` still finds it.
|
|
9
9
|
*/
|
|
10
10
|
export declare const serveReadBody: (source: Request, bytes: Uint8Array<ArrayBuffer>) => void;
|
|
11
11
|
/**
|
|
12
|
-
* The routed request without Effect's cached
|
|
13
|
-
* the handler ends. Each read is the web request's own, so a second read fails with
|
|
14
|
-
* Effect's other body reads (
|
|
12
|
+
* The routed request without Effect's cached `text` and `arrayBuffer`, which keep a whole copy of the body until
|
|
13
|
+
* the handler ends. Each read is the web request's own, so a second read fails with `RequestParseError`.
|
|
14
|
+
* Effect's other body reads (`json`, `urlParamsBody`, `stream`, `multipart`) read through these and `source`.
|
|
15
|
+
* `modify` returns Effect's own request again, whose cached reads keep a copy of what they read.
|
|
15
16
|
*/
|
|
16
17
|
export declare const withUncachedBody: (request: HttpServerRequest.HttpServerRequest, source: Request) => HttpServerRequest.HttpServerRequest;
|
|
17
18
|
//# sourceMappingURL=RequestBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestBody.d.ts","sourceRoot":"","sources":["../src/RequestBody.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEtE,+CAA+C;AAC/C,eAAO,MAAM,UAAU,WAAY,aAAa,CAAC,UAAU,CAAC,cAAc,MAAM,KAAG,UAAU,CAAC,WAAW,CAQxG,CAAC;AAMF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,WAAY,OAAO,SAAS,UAAU,CAAC,WAAW,CAAC,KAAG,
|
|
1
|
+
{"version":3,"file":"RequestBody.d.ts","sourceRoot":"","sources":["../src/RequestBody.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEtE,+CAA+C;AAC/C,eAAO,MAAM,UAAU,WAAY,aAAa,CAAC,UAAU,CAAC,cAAc,MAAM,KAAG,UAAU,CAAC,WAAW,CAQxG,CAAC;AAMF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,WAAY,OAAO,SAAS,UAAU,CAAC,WAAW,CAAC,KAAG,IAwD/E,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,YAClB,iBAAiB,CAAC,iBAAiB,UACpC,OAAO,KACd,iBAAiB,CAAC,iBAepB,CAAC"}
|
package/dist/RequestBody.js
CHANGED
|
@@ -13,10 +13,10 @@ export const joinChunks = (chunks, byteLength) => {
|
|
|
13
13
|
const decoder = new TextDecoder();
|
|
14
14
|
const used = () => new TypeError('Body already used');
|
|
15
15
|
/**
|
|
16
|
-
* Makes
|
|
17
|
-
* read (
|
|
16
|
+
* Makes `source`, whose body the SDK read into `bytes`, answer its own body reads from those bytes. The first
|
|
17
|
+
* read (`text`, `json`, `arrayBuffer`, `bytes`, `blob`, `formData`, or `body`) takes them without a copy and
|
|
18
18
|
* the request keeps no reference to them; a later read fails as a used web body does. The request stays the
|
|
19
|
-
* object the SDK routed, so code that keys on
|
|
19
|
+
* object the SDK routed, so code that keys on `HttpServerRequest.source` still finds it.
|
|
20
20
|
*/
|
|
21
21
|
export const serveReadBody = (source, bytes) => {
|
|
22
22
|
let unread = bytes;
|
|
@@ -47,12 +47,15 @@ export const serveReadBody = (source, bytes) => {
|
|
|
47
47
|
bodyUsed: { get: () => unread === undefined },
|
|
48
48
|
body: {
|
|
49
49
|
get: () => {
|
|
50
|
+
// A high-water mark of 0 pulls only on a read, so a presence check such as `body !== null` takes nothing.
|
|
50
51
|
stream ??= new ReadableStream({
|
|
51
52
|
pull: (controller) => {
|
|
53
|
+
if (unread === undefined)
|
|
54
|
+
return controller.error(used());
|
|
52
55
|
controller.enqueue(take());
|
|
53
56
|
controller.close();
|
|
54
57
|
},
|
|
55
|
-
});
|
|
58
|
+
}, { highWaterMark: 0 });
|
|
56
59
|
return stream;
|
|
57
60
|
},
|
|
58
61
|
},
|
|
@@ -68,9 +71,10 @@ export const serveReadBody = (source, bytes) => {
|
|
|
68
71
|
});
|
|
69
72
|
};
|
|
70
73
|
/**
|
|
71
|
-
* The routed request without Effect's cached
|
|
72
|
-
* the handler ends. Each read is the web request's own, so a second read fails with
|
|
73
|
-
* Effect's other body reads (
|
|
74
|
+
* The routed request without Effect's cached `text` and `arrayBuffer`, which keep a whole copy of the body until
|
|
75
|
+
* the handler ends. Each read is the web request's own, so a second read fails with `RequestParseError`.
|
|
76
|
+
* Effect's other body reads (`json`, `urlParamsBody`, `stream`, `multipart`) read through these and `source`.
|
|
77
|
+
* `modify` returns Effect's own request again, whose cached reads keep a copy of what they read.
|
|
74
78
|
*/
|
|
75
79
|
export const withUncachedBody = (request, source) => {
|
|
76
80
|
const read = (evaluate) => Effect.tryPromise({
|
|
@@ -79,7 +83,7 @@ export const withUncachedBody = (request, source) => {
|
|
|
79
83
|
reason: new HttpServerError.RequestParseError({ request: served, cause }),
|
|
80
84
|
}),
|
|
81
85
|
});
|
|
82
|
-
// SAFETY: the object inherits every other member of
|
|
86
|
+
// SAFETY: the object inherits every other member of `request`.
|
|
83
87
|
const served = Object.create(request, {
|
|
84
88
|
text: { get: () => read(() => source.text()) },
|
|
85
89
|
arrayBuffer: { get: () => read(() => source.arrayBuffer()) },
|
package/dist/RequestBody.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestBody.js","sourceRoot":"","sources":["../src/RequestBody.ts"],"names":[],"mappings":"AAA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AE,cAAc,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,CACxG;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,OAA4C,EAC5C,MAAe,EACsB,EAAE;IACvC,MAAM,IAAI,GAAG,CAAI,QAA0B,EAAE,EAAE,CAC7C,MAAM,CAAC,UAAU,CAAC;QAChB,GAAG,EAAE,QAAQ;QACb,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CACf,IAAI,eAAe,CAAC,eAAe,CAAC;YAClC,MAAM,EAAE,IAAI,eAAe,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;SAC1E,CAAC;KACL,CAAC,CAAC;IACL,+DAA+D;IAC/D,MAAM,MAAM,GAAwC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;QACzE,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE;QAC9C,WAAW,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,EAAE;KAC7D,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ontemper/sdk",
|
|
3
|
-
"version": "0.9.1-tem2274.
|
|
3
|
+
"version": "0.9.1-tem2274.2",
|
|
4
4
|
"description": "Effect workflow SDK for Temper.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
},
|
|
107
107
|
"license": "SEE LICENSE IN LICENSE",
|
|
108
108
|
"sideEffects": false,
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "10cf2487dbcf50978f078c008306d0bac658f174",
|
|
110
110
|
"scripts": {
|
|
111
111
|
"build": "tsc -p tsconfig.json",
|
|
112
112
|
"test": "vitest run",
|