@distilled.cloud/core 1.0.0-rc.20 → 1.0.0-rc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/lib/_bundle/aws.js +1 -1
- package/lib/_bundle/aws.js.map +1 -1
- package/lib/_bundle/base.js +2 -2
- package/lib/_bundle/base.js.map +1 -1
- package/lib/_bundle/graphql.js +2 -2
- package/lib/_bundle/graphql.js.map +1 -1
- package/lib/_bundle/grpc.js +2 -1
- package/lib/_bundle/grpc.js.map +1 -1
- package/lib/_bundle/rest.js +1 -1
- package/lib/_bundle/rest.js.map +1 -1
- package/lib/annotations.d.ts.map +1 -1
- package/lib/api.d.ts +71 -58
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js +1 -1
- package/lib/category.d.ts +15 -12
- package/lib/category.d.ts.map +1 -1
- package/lib/chunks.d.ts.map +1 -1
- package/lib/config.d.ts +13 -0
- package/lib/config.d.ts.map +1 -1
- package/lib/crypto.d.ts.map +1 -1
- package/lib/error-category.d.ts.map +1 -1
- package/lib/errors.d.ts +35 -2
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -1
- package/lib/graphql.d.ts +21 -4
- package/lib/graphql.d.ts.map +1 -1
- package/lib/graphql.types.d.ts +0 -1
- package/lib/graphql.types.d.ts.map +1 -1
- package/lib/grpc-transport-cloudflare-http2.d.ts.map +1 -1
- package/lib/grpc-transport-cloudflare-http2.js +2 -2
- package/lib/grpc-transport-cloudflare-http2.js.map +1 -1
- package/lib/grpc-transport-cloudflare-sockets.d.ts.map +1 -1
- package/lib/grpc-transport-cloudflare-sockets.js +4 -4
- package/lib/grpc-transport-cloudflare-sockets.js.map +1 -1
- package/lib/grpc-transport-node-http2.d.ts.map +1 -1
- package/lib/grpc-transport-node-http2.js +1 -1
- package/lib/grpc-transport-node-http2.js.map +1 -1
- package/lib/grpc-transport.d.ts +53 -18
- package/lib/grpc-transport.d.ts.map +1 -1
- package/lib/grpc-transport.js +1 -1
- package/lib/hpack.d.ts.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/max-message-bytes.d.ts +42 -0
- package/lib/max-message-bytes.d.ts.map +1 -0
- package/lib/max-message-bytes.js +2 -0
- package/lib/max-message-bytes.js.map +1 -0
- package/lib/ndjson.d.ts +3 -0
- package/lib/ndjson.d.ts.map +1 -0
- package/lib/ndjson.js +2 -0
- package/lib/ndjson.js.map +1 -0
- package/lib/pagination.d.ts +4 -1
- package/lib/pagination.d.ts.map +1 -1
- package/lib/plain-values.d.ts +11 -0
- package/lib/plain-values.d.ts.map +1 -1
- package/lib/plain-values.js +1 -1
- package/lib/plain-values.js.map +1 -1
- package/lib/protobuf.d.ts +12 -19
- package/lib/protobuf.d.ts.map +1 -1
- package/lib/protobuf.js +1 -1
- package/lib/protocol-grpc.d.ts +47 -10
- package/lib/protocol-grpc.d.ts.map +1 -1
- package/lib/protocol-grpc.js +1 -1
- package/lib/protocol-http.d.ts +110 -8
- package/lib/protocol-http.d.ts.map +1 -1
- package/lib/protocol-http.js +1 -1
- package/lib/protocol-rest.d.ts +161 -37
- package/lib/protocol-rest.d.ts.map +1 -1
- package/lib/protocol-rest.js +1 -1
- package/lib/protocol.d.ts +113 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +0 -0
- package/lib/query.d.ts.map +1 -1
- package/lib/response-validation-strict.d.ts.map +1 -1
- package/lib/response-validation.d.ts.map +1 -1
- package/lib/retry-after.d.ts +1 -1
- package/lib/retry-after.d.ts.map +1 -1
- package/lib/retry-state.d.ts +26 -0
- package/lib/retry-state.d.ts.map +1 -0
- package/lib/retry-state.js +2 -0
- package/lib/retry-state.js.map +1 -0
- package/lib/retry.d.ts +100 -20
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +1 -1
- package/lib/schema-lite-impl.d.ts +25 -4
- package/lib/schema-lite-impl.d.ts.map +1 -1
- package/lib/schema-lite-impl.js +1 -1
- package/lib/schema-lite-typed.d.ts.map +1 -1
- package/lib/schema-lite.d.ts +1 -0
- package/lib/schema-lite.d.ts.map +1 -1
- package/lib/schema-lite.js +1 -1
- package/lib/schema.d.ts.map +1 -1
- package/lib/sdk-error.d.ts +4 -0
- package/lib/sdk-error.d.ts.map +1 -1
- package/lib/send.d.ts +37 -0
- package/lib/send.d.ts.map +1 -0
- package/lib/send.js +2 -0
- package/lib/send.js.map +1 -0
- package/lib/sensitive.d.ts.map +1 -1
- package/lib/sensitive.js +1 -1
- package/lib/sensitive.js.map +1 -1
- package/lib/telemetry-debug.d.ts.map +1 -1
- package/lib/telemetry-debug.js +1 -1
- package/lib/telemetry-debug.js.map +1 -1
- package/lib/telemetry-hooks.d.ts.map +1 -1
- package/lib/telemetry-host-rules.d.ts.map +1 -1
- package/lib/telemetry-lambda-context.d.ts.map +1 -1
- package/lib/telemetry-message-context.d.ts.map +1 -1
- package/lib/telemetry-metrics.d.ts.map +1 -1
- package/lib/telemetry-metrics.js +1 -1
- package/lib/telemetry-metrics.js.map +1 -1
- package/lib/telemetry-name-template.d.ts.map +1 -1
- package/lib/telemetry-stream.d.ts.map +1 -1
- package/lib/telemetry-stream.js +1 -1
- package/lib/telemetry-stream.js.map +1 -1
- package/lib/telemetry-xray.d.ts.map +1 -1
- package/lib/telemetry.d.ts +29 -0
- package/lib/telemetry.d.ts.map +1 -1
- package/lib/telemetry.js +2 -2
- package/lib/telemetry.js.map +1 -1
- package/lib/token-cache.d.ts +31 -0
- package/lib/token-cache.d.ts.map +1 -0
- package/lib/token-cache.js +2 -0
- package/lib/token-cache.js.map +1 -0
- package/lib/trait.d.ts +24 -1
- package/lib/trait.d.ts.map +1 -1
- package/lib/trait.js +1 -1
- package/lib/unknown-error.d.ts.map +1 -1
- package/lib/xml.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/api.ts +402 -209
- package/src/category.ts +21 -28
- package/src/config.ts +17 -1
- package/src/errors.ts +24 -2
- package/src/graphql.ts +65 -26
- package/src/graphql.types.ts +15 -0
- package/src/grpc-transport-cloudflare-http2.ts +374 -299
- package/src/grpc-transport-cloudflare-sockets.ts +150 -81
- package/src/grpc-transport-node-http2.ts +119 -46
- package/src/grpc-transport.ts +211 -42
- package/src/max-message-bytes.ts +58 -0
- package/src/ndjson.ts +55 -0
- package/src/pagination.ts +26 -15
- package/src/plain-values.ts +30 -1
- package/src/protobuf.ts +40 -5
- package/src/protocol-grpc.ts +518 -348
- package/src/protocol-http.ts +474 -100
- package/src/protocol-rest.ts +580 -140
- package/src/protocol.ts +150 -0
- package/src/response-validation-strict.ts +9 -3
- package/src/retry-after.ts +1 -1
- package/src/retry-state.ts +105 -0
- package/src/retry.ts +176 -47
- package/src/schema-lite-impl.ts +81 -10
- package/src/schema-lite.ts +1 -0
- package/src/sdk-error.ts +4 -0
- package/src/send.ts +156 -0
- package/src/sensitive.ts +49 -15
- package/src/telemetry.ts +2 -34
- package/src/token-cache.ts +117 -0
- package/src/trait.ts +34 -1
package/lib/grpc-transport.d.ts
CHANGED
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
*
|
|
11
11
|
* By default `protocol-grpc` sends through the caller's `HttpClient`
|
|
12
12
|
* (`fetch`), which works where a proxy bridges HTTP/1.1 to gRPC (envoy) and
|
|
13
|
-
* puts the status in the headers.
|
|
13
|
+
* puts the status in the headers. A transport built here is Effect code: the
|
|
14
|
+
* body is an Effect `Stream` read in the caller's fiber, and the trailers an
|
|
15
|
+
* `Effect` that fails when the transport can't read them, so no failure
|
|
16
|
+
* turns into an empty value on the way. Provide a different transport for one
|
|
14
17
|
* scope with {@link layer}:
|
|
15
18
|
*
|
|
16
19
|
* - `@distilled.cloud/core/grpc-transport-node-http2` speaks HTTP/2 with
|
|
@@ -29,9 +32,11 @@
|
|
|
29
32
|
import * as Context from "effect/Context";
|
|
30
33
|
import * as Effect from "effect/Effect";
|
|
31
34
|
import type * as HttpClient from "effect/http/HttpClient";
|
|
32
|
-
import
|
|
35
|
+
import * as HttpClientError from "effect/http/HttpClientError";
|
|
36
|
+
import * as HttpClientRequest from "effect/http/HttpClientRequest";
|
|
33
37
|
import * as HttpClientResponse from "effect/http/HttpClientResponse";
|
|
34
38
|
import * as Layer from "effect/Layer";
|
|
39
|
+
import * as Stream from "effect/Stream";
|
|
35
40
|
/**
|
|
36
41
|
* The `HttpClient` gRPC calls go through. `undefined` (the default) sends
|
|
37
42
|
* through the caller's `HttpClient`.
|
|
@@ -41,20 +46,17 @@ export declare const GrpcTransport: Context.Reference<HttpClient.HttpClient | un
|
|
|
41
46
|
export declare const layer: (client: HttpClient.HttpClient) => Layer.Layer<never>;
|
|
42
47
|
/** Header and trailer names are lowercase; values as received. */
|
|
43
48
|
export type Trailers = Readonly<Record<string, string>>;
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
* A transport fails the call with a transport error for any other.
|
|
47
|
-
*/
|
|
48
|
-
export declare const isResponseStatus: (status: number) => boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Build a transport's response: the status, the headers, the body as it
|
|
51
|
-
* arrives, and the trailers, which settle once the body has ended.
|
|
52
|
-
*/
|
|
53
|
-
export declare const respond: (request: HttpClientRequest.HttpClientRequest, reply: {
|
|
49
|
+
/** What a transport hands over for a response. */
|
|
50
|
+
export interface Reply {
|
|
54
51
|
readonly status: number;
|
|
55
52
|
readonly headers: Trailers;
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
/**
|
|
54
|
+
* The body as it arrives. It runs in the fiber that reads the response, so
|
|
55
|
+
* that fiber's interruption and finalizers reach the connection.
|
|
56
|
+
*/
|
|
57
|
+
readonly body: Stream.Stream<Uint8Array, unknown>;
|
|
58
|
+
/** The trailers, once the body has ended. Fails when they can't be read. */
|
|
59
|
+
readonly trailers: Effect.Effect<Trailers, unknown>;
|
|
58
60
|
/**
|
|
59
61
|
* Whether the trailers always arrive. HTTP/2 delivers them end to end;
|
|
60
62
|
* over HTTP/1.1 a bridging proxy may drop them, so the protocol then
|
|
@@ -62,15 +64,48 @@ export declare const respond: (request: HttpClientRequest.HttpClientRequest, rep
|
|
|
62
64
|
* @default true
|
|
63
65
|
*/
|
|
64
66
|
readonly reliableTrailers?: boolean;
|
|
65
|
-
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Whether `status` is a final HTTP status a response can carry (200 to 599).
|
|
70
|
+
* A transport fails the call with a transport error for any other.
|
|
71
|
+
*/
|
|
72
|
+
export declare const isResponseStatus: (status: number) => boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Whether a response with `status` has no body (RFC 9110 sections 15.3.5,
|
|
75
|
+
* 15.3.6 and 15.4.5). Its transport lets the connection go at once.
|
|
76
|
+
*/
|
|
77
|
+
export declare const hasNoBody: (status: number) => boolean;
|
|
78
|
+
/**
|
|
79
|
+
* The trailers of a stream the server reset with the HTTP/2 error `code`
|
|
80
|
+
* before it sent a status: the gRPC status the gRPC over HTTP/2 spec maps
|
|
81
|
+
* the code to (`PROTOCOL-HTTP2.md`, "Errors"), as grpc-js does. The call
|
|
82
|
+
* fails like any other gRPC error: `REFUSED_STREAM` (the server did no work)
|
|
83
|
+
* as `UNAVAILABLE`, which retries, `NO_ERROR` and unknown codes as
|
|
84
|
+
* `INTERNAL`, which doesn't.
|
|
85
|
+
*/
|
|
86
|
+
export declare const resetTrailers: (code: number) => Trailers;
|
|
87
|
+
/**
|
|
88
|
+
* The reply for a stream the server reset with the HTTP/2 error `code`
|
|
89
|
+
* before its response headers: a gRPC reply of trailers alone, carrying
|
|
90
|
+
* {@link resetTrailers}.
|
|
91
|
+
*/
|
|
92
|
+
export declare const resetReply: (code: number) => Reply;
|
|
93
|
+
/**
|
|
94
|
+
* Build a transport's response from its {@link Reply}. Fails with the
|
|
95
|
+
* `TypeError` of a head that is no valid HTTP head (a header name that is no
|
|
96
|
+
* token, a value with a line break), as `fetch` would. A response with
|
|
97
|
+
* {@link hasNoBody} has an empty body and no trailers.
|
|
98
|
+
*/
|
|
99
|
+
export declare const respond: (request: HttpClientRequest.HttpClientRequest, reply: Reply) => Effect.Effect<HttpClientResponse.HttpClientResponse, unknown>;
|
|
66
100
|
/**
|
|
67
101
|
* Whether `response` came from a transport whose trailers always arrive
|
|
68
|
-
* ({@link
|
|
102
|
+
* ({@link Reply.reliableTrailers}), so a missing status is an error.
|
|
69
103
|
*/
|
|
70
104
|
export declare const hasTrailers: (response: HttpClientResponse.HttpClientResponse) => boolean;
|
|
71
105
|
/**
|
|
72
106
|
* The trailers of a response a transport built with {@link respond}, read
|
|
73
|
-
* after its body; empty for any other response (`fetch` exposes none).
|
|
107
|
+
* after its body; empty for any other response (`fetch` exposes none). A
|
|
108
|
+
* transport that can't read them fails with a `DecodeError`.
|
|
74
109
|
*/
|
|
75
|
-
export declare const trailersOf: (response: HttpClientResponse.HttpClientResponse) => Effect.Effect<Trailers>;
|
|
110
|
+
export declare const trailersOf: (response: HttpClientResponse.HttpClientResponse) => Effect.Effect<Trailers, HttpClientError.HttpClientError>;
|
|
76
111
|
//# sourceMappingURL=grpc-transport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grpc-transport.d.ts","
|
|
1
|
+
{"version":3,"file":"grpc-transport.d.ts","sources":["../src/grpc-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,kBAAkB,MAAM,gCAAgC,CAAC;AAIrE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,aAAa,sDAGzB,CAAC;AAEF,sDAAsD;A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,EAAE,eAAe,CAAC,eAAe,CAKzD,CAAC"}
|
package/lib/grpc-transport.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { grpc_transport$GrpcTransport as GrpcTransport, grpc_transport$hasTrailers as hasTrailers, grpc_transport$isResponseStatus as isResponseStatus, grpc_transport$layer as layer, grpc_transport$respond as respond, grpc_transport$trailersOf as trailersOf } from "./_bundle/grpc.js";
|
|
1
|
+
export { grpc_transport$GrpcTransport as GrpcTransport, grpc_transport$hasNoBody as hasNoBody, grpc_transport$hasTrailers as hasTrailers, grpc_transport$isResponseStatus as isResponseStatus, grpc_transport$layer as layer, grpc_transport$resetReply as resetReply, grpc_transport$resetTrailers as resetTrailers, grpc_transport$respond as respond, grpc_transport$trailersOf as trailersOf } from "./_bundle/grpc.js";
|
package/lib/hpack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hpack.d.ts","
|
|
1
|
+
{"version":3,"file":"hpack.d.ts","sources":["../src/hpack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,mFAAmF;AACnF,qBAAa,UAAW,SAAQ,KAAK;CAAG;AAExC,sDAAsD;AACtD,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AA0HjE,4DAA4D;AAC5D,eAAO,MAAM,aAAa,UAAW,UAAU,KAAG,UA4BjD,CAAC;AAmBF,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,+CAA+C;IAC/C,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,EAAE,CAAC;CAC1C;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,6BAA0B,YAiGjD,CAAC;AAyBF;;;GAGG;AACH,eAAO,MAAM,MAAM,WAAY,aAAa,CAAC,WAAW,CAAC,KAAG,UAQ3D,CAAC"}
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,kBAAkB,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The largest message a streaming protocol accepts from the server (a gRPC
|
|
3
|
+
* frame, an e2b envd envelope). A message whose header announces more fails
|
|
4
|
+
* the call before the SDK buffers it. The first of these wins:
|
|
5
|
+
*
|
|
6
|
+
* 1. The call's own `maxMessageBytes` ({@link MaxMessageBytesInput}):
|
|
7
|
+
* `Modal.functionGet({ ..., maxMessageBytes: 200 * 1024 * 1024 })`.
|
|
8
|
+
* 2. The {@link MaxMessageBytes} layer, for every call in a scope:
|
|
9
|
+
* `Effect.provide(MaxMessageBytes.of(200 * 1024 * 1024))`.
|
|
10
|
+
* 3. The protocol's own default (e.g. Modal's 100 MiB, as its official
|
|
11
|
+
* client), else {@link DEFAULT_MAX_MESSAGE_BYTES}.
|
|
12
|
+
*
|
|
13
|
+
* `MaxMessageBytes` is an optional service: operations do not list it in
|
|
14
|
+
* their requirements.
|
|
15
|
+
*/
|
|
16
|
+
import * as Context from "effect/Context";
|
|
17
|
+
import * as Layer from "effect/Layer";
|
|
18
|
+
/** 16 MiB. */
|
|
19
|
+
export declare const DEFAULT_MAX_MESSAGE_BYTES: number;
|
|
20
|
+
declare const MaxMessageBytes_base: Context.ServiceClass<MaxMessageBytes, "@distilled.cloud/core/MaxMessageBytes", number>;
|
|
21
|
+
export declare class MaxMessageBytes extends /*@__PURE__*/ MaxMessageBytes_base {
|
|
22
|
+
}
|
|
23
|
+
/** Accept messages up to `bytes` in a scope, e.g. `MaxMessageBytes.of(64 * 1024 * 1024)`. */
|
|
24
|
+
export declare const of: (bytes: number) => Layer.Layer<MaxMessageBytes>;
|
|
25
|
+
/**
|
|
26
|
+
* The optional `maxMessageBytes` an operation input accepts. It sets the
|
|
27
|
+
* limit for one call, over the {@link MaxMessageBytes} layer. It is not sent
|
|
28
|
+
* on the wire.
|
|
29
|
+
*/
|
|
30
|
+
export interface MaxMessageBytesInput {
|
|
31
|
+
readonly maxMessageBytes?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The limit for one call: the input's `maxMessageBytes`, else the layer in
|
|
35
|
+
* `context`, else `fallback`. A value that is not a positive whole number
|
|
36
|
+
* is returned as an error message.
|
|
37
|
+
*/
|
|
38
|
+
export declare const resolve: <R>(context: Context.Context<R>, input: unknown, fallback?: number) => number | {
|
|
39
|
+
readonly invalid: string;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=max-message-bytes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"max-message-bytes.d.ts","sources":["../src/max-message-bytes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,cAAc;AACd,eAAO,MAAM,yBAAyB,QAAmB,CAAC;;AAE1D,qBAAa,eACX,SAAQ,aAAa,CAAC,oBAErB;CAAG;AAEN,6FAA6F;AAC7F,eAAO,MAAM,EAAE,UAAW,MAAM,KAAG,KAAK,CAAC,KAAK,CAAC,eAAe,CACvB,CAAC;AAExC;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACnC;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,CAAC,WACd,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SACpB,OAAO,aACJ,MAAM,KACf,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CASrC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as e from"effect/Context";import*as t from"effect/Layer";const n=16777216;var MaxMessageBytes=class extends (/*@__PURE__*/ e.Service()(`@distilled.cloud/core/MaxMessageBytes`)){};const of=e=>t.succeed(MaxMessageBytes,e);const resolve=(t,r,i=n)=>{const a=(r!==null&&typeof r===`object`?r.maxMessageBytes:void 0)??e.getOrUndefined(t,MaxMessageBytes)??i;return Number.isSafeInteger(a)&&a>0?a:{invalid:`maxMessageBytes must be a positive whole number, got ${String(a)}`}};export{n as DEFAULT_MAX_MESSAGE_BYTES,MaxMessageBytes,of,resolve};
|
|
2
|
+
//# sourceMappingURL=max-message-bytes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"max-message-bytes.js","names":["Context","Layer","DEFAULT_MAX_MESSAGE_BYTES","bytes","input","context","fallback"],"sources":["../src/max-message-bytes.ts"],"mappings":"gEAmBA,MAAaE,EAA4B,SAEzC,IAAa,gBAAb,eACwB,gBAAQ,QAAiC,CAAC,CAC9D,uCACF,EAAA,AAAE,CAAC,EAGL,MAAa,GAAM,GACjBD,EAAM,QAAQ,gBAAiBE,CAAK,EAgBtC,MAAa,SACX,EACA,EACA,EAAmBD,IACuB,CAK1C,MAAMC,GAHJC,IAAU,MAAQ,OAAOA,IAAU,SAC9BA,EAA+B,gBAChC,IAAA,KACgBJ,EAAQ,eAAeK,EAAS,eAAe,GAAKC,EAC1E,OAAO,OAAO,cAAcH,CAAK,GAAKA,EAAQ,EAC1CA,EACA,CAAE,QAAS,wDAAwD,OAAOA,CAAK,GAAI,CACzF"}
|
package/lib/ndjson.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ndjson.d.ts","sources":["../src/ndjson.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAaxD,eAAO,MAAM,MAAM,EAAE,aA4BpB,CAAC"}
|
package/lib/ndjson.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as e from"effect/Effect";import*as t from"effect/Stream";const nonEmpty=e=>e.trim().length>0;const parse=e=>{try{return{json:JSON.parse(e)}}catch{return}};const n={collect:(e,t)=>{if(t?.split(`;`)[0].trim().toLowerCase()!==`application/x-ndjson`)return;const n=[];for(const t of e.split(/\r?\n/)){if(!nonEmpty(t))continue;const e=parse(t);if(e===void 0)return{json:void 0,nonJson:true};n.push(e.json)}return{json:{items:n},nonJson:false}},stream:n=>t.unwrap(e.map(n,({body:n,item:r,invalid:i})=>n.pipe(t.decodeText(),t.splitLines,t.filter(nonEmpty),t.mapEffect(t=>{const n=parse(t);return n===void 0?e.fail(i(t)):r(n.json,t)}))))};export{n as ndjson};
|
|
2
|
+
//# sourceMappingURL=ndjson.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ndjson.js","names":["Effect","Stream","line","ndjson","contentType","items","text","parsed","open","body","invalid","item"],"sources":["../src/ndjson.ts"],"mappings":"gEAeA,MAAM,SAAY,GAA0BE,EAAK,KAAK,CAAC,CAAC,OAAS,EAGjE,MAAM,MAAS,GAAyD,CACtE,GAAI,CACF,MAAO,CAAE,KAAM,KAAK,MAAMA,CAAI,CAAE,CAClC,MAAQ,CACN,MACF,CACF,EAEA,MAAaC,EAAwB,CACnC,SAAU,EAAM,IAAgB,CAC9B,GAAIC,GAAa,MAAM,GAAG,CAAC,CAAC,EAAE,CAAE,KAAK,CAAC,CAAC,YAAY,IAAM,uBACvD,OAEF,MAAMC,EAAmB,CAAC,EAC1B,IAAK,MAAMH,KAAQI,EAAK,MAAM,OAAO,EAAG,CACtC,GAAI,CAAC,SAASJ,CAAI,EAAG,SACrB,MAAMK,EAAS,MAAML,CAAI,EACzB,GAAIK,IAAW,IAAA,GAAW,MAAO,CAAE,KAAM,IAAA,GAAW,QAAS,IAAK,EAClEF,EAAM,KAAKE,EAAO,IAAI,CACxB,CACA,MAAO,CAAE,KAAM,CAAE,OAAM,EAAG,QAAS,KAAM,CAC3C,EACA,OAAS,GACPN,EAAO,OACLD,EAAO,IAAIQ,GAAO,CAAE,OAAM,OAAM,aAC9BC,EAAK,KACHR,EAAO,WAAW,EAClBA,EAAO,WACPA,EAAO,OAAO,QAAQ,EACtBA,EAAO,UAAW,GAAS,CACzB,MAAMM,EAAS,MAAML,CAAI,EACzB,OAAOK,IAAW,IAAA,GAAYP,EAAO,KAAKU,EAAQR,CAAI,CAAC,EAAIS,EAAKJ,EAAO,KAAML,CAAI,CACnF,CAAC,CACH,CACF,CACF,CACJ"}
|
package/lib/pagination.d.ts
CHANGED
|
@@ -88,7 +88,10 @@ export declare const paginatePageNumber: <Input extends Record<string, unknown>,
|
|
|
88
88
|
export declare const paginateCursor: <Input extends Record<string, unknown>, Output, E, R>(operation: (input: Input) => Effect.Effect<Output, E, R>, input: Input, pagination: PaginatedTrait) => Stream.Stream<Output, E, R>;
|
|
89
89
|
/**
|
|
90
90
|
* Stream of pages using token-based pagination -- pass `outputToken` back as
|
|
91
|
-
* `inputToken` until it comes back absent.
|
|
91
|
+
* `inputToken` until it comes back absent or repeats a token already sent.
|
|
92
|
+
* Some APIs never omit the token: CloudWatch Logs `GetLogEvents` marks the end
|
|
93
|
+
* of a stream by echoing the `nextToken` it was sent. Empty pages still
|
|
94
|
+
* advance when they return a new token.
|
|
92
95
|
*/
|
|
93
96
|
export declare const paginateToken: <Input extends Record<string, unknown>, Output, E, R>(operation: (input: Input) => Effect.Effect<Output, E, R>, input: Input, pagination: PaginatedTrait) => Stream.Stream<Output, E, R>;
|
|
94
97
|
/**
|
package/lib/pagination.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sources":["../src/pagination.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC;;;GAGG;AACH,eAAO,MAAM,OAAO,QAAS,OAAO,QAAQ,MAAM,KAAG,OAUpD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ,QAAS,OAAO,QAAQ,MAAM,KAAG,SAAS,OAAO,EAcrE,CAAC;AAMF,iEAAiE;AACjE,MAAM,WAAW,cAAc;IAC7B,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACrF;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,KAAK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ACtB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,KACpD,IAGF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,WAAY,MAAM,GAAG,SAAS,KAAG,MAAM,GAAG,SAQ9D,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,aACnE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,SACjD,KAAK,cACA,cAAc,KACzB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAiC5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,kBAoBlC,CAAC;AAMF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,SACtC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,aACvB,MAAM,KAChB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAA6D,CAAC;AAEzF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,SAC3C,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,KACjC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAqE,CAAC"}
|
package/lib/plain-values.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether `v` is an Effect `Stream` (an upload body). Read from the
|
|
3
|
+
* prototype's type id, so this module does not load `effect/Stream`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const isEffectStream: (v: unknown) => boolean;
|
|
1
6
|
/** Binary/opaque values that must never be treated as key-value objects. */
|
|
2
7
|
export declare const isOpaqueValue: (v: unknown) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Sets `out[key] = value` as an own property. A plain assignment to a
|
|
10
|
+
* `__proto__` key replaces the object's prototype; this keeps it a key, as
|
|
11
|
+
* `JSON.parse` does.
|
|
12
|
+
*/
|
|
13
|
+
export declare const setOwnKey: (out: Record<string, unknown>, key: string, value: unknown) => void;
|
|
3
14
|
/**
|
|
4
15
|
* Deep-unwrap `Redacted` values in an input (plain objects/arrays only --
|
|
5
16
|
* class instances, files, and binary payloads pass through untouched).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plain-values.d.ts","
|
|
1
|
+
{"version":3,"file":"plain-values.d.ts","sources":["../src/plain-values.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,eAAO,MAAM,cAAc,MAAO,OAAO,KAAG,OAIE,CAAC;AAE/C,4EAA4E;AAC5E,eAAO,MAAM,aAAa,MAAO,OAAO,KAAG,OAMxB,CAAC;AASpB;;;;GAIG;AACH,eAAO,MAAM,SAAS,QAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,MAAM,SAAS,OAAO,KAAG,IAWrF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,UAAW,OAAO,KAAG,OAYnD,CAAC"}
|
package/lib/plain-values.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"effect/Redacted";const isOpaqueValue=e=>e instanceof Blob||e instanceof File||e instanceof ArrayBuffer||e instanceof Uint8Array||e instanceof Date;const isPlainObject=e=>e!==null&&typeof e===`object`&&!Array.isArray(e)&&!isOpaqueValue(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);const unwrapRedactedDeep=t=>{if(e.isRedacted(t))return e.value(t);if(Array.isArray(t))return t.map(unwrapRedactedDeep);if(isPlainObject(t)){const e={};for(const[n,r]of Object.entries(t)){if(r===void 0)continue;e[n]=unwrapRedactedDeep(r)}return e}return t};export{isOpaqueValue,unwrapRedactedDeep};
|
|
1
|
+
import*as e from"effect/Redacted";const isEffectStream=e=>e!==null&&typeof e===`object`&&Object.getPrototypeOf(e)!==null&&`~effect/Stream`in Object.getPrototypeOf(e);const isOpaqueValue=e=>e instanceof Blob||e instanceof File||e instanceof ArrayBuffer||e instanceof Uint8Array||e instanceof Date||isEffectStream(e);const isPlainObject=e=>e!==null&&typeof e===`object`&&!Array.isArray(e)&&!isOpaqueValue(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);const setOwnKey=(e,t,n)=>{if(t===`__proto__`)Object.defineProperty(e,t,{value:n,enumerable:true,writable:true,configurable:true});else e[t]=n};const unwrapRedactedDeep=t=>{if(e.isRedacted(t))return e.value(t);if(Array.isArray(t))return t.map(unwrapRedactedDeep);if(isPlainObject(t)){const e={};for(const[n,r]of Object.entries(t)){if(r===void 0)continue;e[n]=unwrapRedactedDeep(r)}return e}return t};export{isEffectStream,isOpaqueValue,setOwnKey,unwrapRedactedDeep};
|
|
2
2
|
//# sourceMappingURL=plain-values.js.map
|
package/lib/plain-values.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plain-values.js","names":["Redacted","v","
|
|
1
|
+
{"version":3,"file":"plain-values.js","names":["Redacted","v","key","out","value","k"],"sources":["../src/plain-values.ts"],"mappings":"kCAWA,MAAa,eAAkB,GAC7BC,IAAM,MACN,OAAOA,IAAM,UACb,OAAO,eAAeA,CAAC,IAAM,MAC7B,mBAAoB,OAAO,eAAeA,CAAC,EAG7C,MAAa,cAAiB,GAC5BA,aAAa,MACbA,aAAa,MACbA,aAAa,aACbA,aAAa,YACbA,aAAa,MACb,eAAeA,CAAC,EAElB,MAAM,cAAiB,GACrBA,IAAM,MACN,OAAOA,IAAM,UACb,CAAC,MAAM,QAAQA,CAAC,GAChB,CAAC,cAAcA,CAAC,IACf,OAAO,eAAeA,CAAC,IAAM,OAAO,WAAa,OAAO,eAAeA,CAAC,IAAM,MAOjF,MAAa,WAAa,EAA8B,EAAa,IAAyB,CAC5F,GAAIC,IAAQ,YACV,OAAO,eAAeC,EAAKD,EAAK,CAC9B,QACA,WAAY,KACZ,SAAU,KACV,aAAc,IAChB,CAAC,MAED,GAAIA,GAAOE,CAEf,EAQA,MAAa,mBAAsB,GAA4B,CAC7D,GAAIJ,EAAS,WAAWI,CAAK,EAAG,OAAOJ,EAAS,MAAMI,CAAK,EAC3D,GAAI,MAAM,QAAQA,CAAK,EAAG,OAAOA,EAAM,IAAI,kBAAkB,EAC7D,GAAI,cAAcA,CAAK,EAAG,CACxB,MAAMD,EAA+B,CAAC,EACtC,IAAK,KAAM,CAACE,EAAGJ,KAAM,OAAO,QAAQG,CAAK,EAAG,CAC1C,GAAIH,IAAM,IAAA,GAAW,SACrB,EAAII,GAAK,mBAAmBJ,CAAC,CAC/B,CACA,OAAOE,CACT,CACA,OAAOC,CACT"}
|
package/lib/protobuf.d.ts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Protobuf binary wire codec over generated descriptors.
|
|
3
|
-
*
|
|
4
|
-
* Proto-sourced SDKs keep their schemas in proto3 JSON shape (camelCase wire
|
|
5
|
-
* names, 64-bit integers as strings, bytes as base64, enums by name,
|
|
6
|
-
* `google.protobuf.Timestamp` as RFC 3339). Servers that only speak binary
|
|
7
|
-
* gRPC need the same values as protobuf bytes, so this module transcodes
|
|
8
|
-
* between the two using a descriptor table the converter emits next to the
|
|
9
|
-
* services (`src/descriptors.ts`): field numbers, scalar kinds, message and
|
|
10
|
-
* enum references.
|
|
11
|
-
*
|
|
12
|
-
* Decoding follows proto3: a field without presence (a plain scalar, enum,
|
|
13
|
-
* `repeated` or `map` field) reads as its default when the wire omits it
|
|
14
|
-
* (`""`, `0`, `"0"` for 64-bit integers, `false`, the enum's zero value,
|
|
15
|
-
* `[]`, `{}`), so the JSON always carries it. Fields with presence (marked
|
|
16
|
-
* `optional`, message fields and `oneof` members) are omitted when absent.
|
|
17
|
-
* Enum numbers map back to names, and unknown fields are skipped.
|
|
18
|
-
*/
|
|
19
1
|
/** A scalar or composite field kind. */
|
|
20
2
|
export type FieldKind = "double" | "float" | "int32" | "int64" | "uint32" | "uint64" | "sint32" | "sint64" | "fixed32" | "fixed64" | "sfixed32" | "sfixed64" | "bool" | "string" | "bytes" | "enum" | "message" | "map";
|
|
21
3
|
/** `[keyKind, valueKind, valueRef?]` for a `map<K, V>` field. */
|
|
@@ -57,6 +39,10 @@ export declare class ProtobufEncodeError extends Error {
|
|
|
57
39
|
export declare class ProtobufDecodeError extends Error {
|
|
58
40
|
readonly _tag: string;
|
|
59
41
|
}
|
|
42
|
+
/** A frame whose header announces more bytes than the reader accepts. */
|
|
43
|
+
export declare class FrameTooLargeError extends ProtobufDecodeError {
|
|
44
|
+
readonly _tag: string;
|
|
45
|
+
}
|
|
60
46
|
/**
|
|
61
47
|
* Valid protobuf whose value proto3 JSON can't represent: a Timestamp
|
|
62
48
|
* outside years 0001 to 9999, or a Duration beyond 10,000 years.
|
|
@@ -80,12 +66,19 @@ export declare const frame: (payload: Uint8Array) => Uint8Array;
|
|
|
80
66
|
* Reads gRPC message frames from a body that arrives in chunks: `push` each
|
|
81
67
|
* chunk and get back the messages it completed. `rest` is the number of
|
|
82
68
|
* bytes held for an incomplete frame (`0` once a body ends cleanly).
|
|
83
|
-
* Compressed frames are rejected
|
|
69
|
+
* Compressed frames are rejected. A gRPC-Web trailer frame (flag `0x80`) is
|
|
70
|
+
* not a message: its `name: value` lines are collected in `trailers`.
|
|
84
71
|
*/
|
|
85
72
|
export declare class FrameReader {
|
|
86
73
|
private buf;
|
|
74
|
+
private readonly maxBytes;
|
|
75
|
+
/** `maxBytes`: the largest frame payload accepted; a larger one throws {@link FrameTooLargeError}. */
|
|
76
|
+
constructor(maxBytes?: number);
|
|
77
|
+
/** The trailers of the gRPC-Web trailer frames read so far, names lowercase. */
|
|
78
|
+
readonly trailers: Record<string, string>;
|
|
87
79
|
get rest(): number;
|
|
88
80
|
push(chunk: Uint8Array): Uint8Array[];
|
|
81
|
+
private readTrailers;
|
|
89
82
|
}
|
|
90
83
|
/** Split a whole gRPC body into message payloads. */
|
|
91
84
|
export declare const unframe: (body: Uint8Array) => Uint8Array[];
|
package/lib/protobuf.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protobuf.d.ts","
|
|
1
|
+
{"version":3,"file":"protobuf.d.ts","sources":["../src/protobuf.ts"],"names":[],"mappings":"AAoBA,wCAAwC;AACxC,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,OAAO,GACP,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,MAAM,GACN,QAAQ,GACR,OAAO,GACP,MAAM,GACN,SAAS,GACT,KAAK,CAAC;AAEV,iEAAiE;AACjE,MAAM,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;AAE/E;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS;IACrC,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,SAAS;IACf,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM;CAClB,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAC5E,8CA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EAAE,MAAM,CAAC,CAAM;IAE/C,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,CA8BpC;IAED,OAAO,CAAC,YAAY;CAOrB;AAID,qDAAqD;AACrD,eAAO,MAAM,OAAO,SAAU,UAAU,KAAG,UAAU,EAKpD,CAAC"}
|
package/lib/protobuf.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { protobuf$FrameReader as FrameReader, protobuf$ProtobufDecodeError as ProtobufDecodeError, protobuf$ProtobufEncodeError as ProtobufEncodeError, protobuf$ProtobufJsonRangeError as ProtobufJsonRangeError, protobuf$decodeMessage as decodeMessage, protobuf$encodeMessage as encodeMessage, protobuf$frame as frame, protobuf$unframe as unframe } from "./_bundle/grpc.js";
|
|
1
|
+
export { protobuf$FrameReader as FrameReader, protobuf$FrameTooLargeError as FrameTooLargeError, protobuf$ProtobufDecodeError as ProtobufDecodeError, protobuf$ProtobufEncodeError as ProtobufEncodeError, protobuf$ProtobufJsonRangeError as ProtobufJsonRangeError, protobuf$decodeMessage as decodeMessage, protobuf$encodeMessage as encodeMessage, protobuf$frame as frame, protobuf$unframe as unframe } from "./_bundle/grpc.js";
|
package/lib/protocol-grpc.d.ts
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Proto SDKs are generated as REST-shaped operations: each RPC is
|
|
5
5
|
* `POST /<package>.<Service>/<Method>` with a proto3 JSON body. Servers that
|
|
6
|
-
* accept JSON (Connect, grpc-gateway) use {@link
|
|
6
|
+
* accept JSON (Connect, grpc-gateway) use {@link restProtocol} directly.
|
|
7
7
|
* Servers that only speak gRPC use this protocol, which builds the request
|
|
8
|
-
* with the REST protocol and speaks gRPC on the wire
|
|
8
|
+
* with the REST protocol and speaks gRPC on the wire. `grpcProtocol(options)`
|
|
9
|
+
* builds a core protocol (core/protocol):
|
|
9
10
|
*
|
|
10
11
|
* - **Request**: the proto3 JSON body is transcoded to one protobuf message
|
|
11
12
|
* ({@link encodeMessage}) in one gRPC frame, sent as `application/grpc`.
|
|
@@ -13,6 +14,10 @@
|
|
|
13
14
|
* `GrpcTransport` reference holds, or the caller's `HttpClient` when it
|
|
14
15
|
* holds none (see `@distilled.cloud/core/grpc-transport`). Plain `fetch`
|
|
15
16
|
* works where a proxy bridges HTTP/1.1 to gRPC (envoy).
|
|
17
|
+
* - **gRPC-Web**: with `web: true` the request is sent as
|
|
18
|
+
* `application/grpc-web+proto`, which servers such as `tonic-web` answer
|
|
19
|
+
* over HTTP/1.1. The reply's trailers arrive as the last frame of its body,
|
|
20
|
+
* so plain `fetch` sees every status.
|
|
16
21
|
* - **Status**: the call's `grpc-status` is read from the trailers, or from
|
|
17
22
|
* the headers of a trailers-only reply. A transport that can't see
|
|
18
23
|
* trailers (`fetch`) leaves only the headers; a reply with message frames
|
|
@@ -38,10 +43,9 @@
|
|
|
38
43
|
*/
|
|
39
44
|
import * as Context from "effect/Context";
|
|
40
45
|
import * as Duration from "effect/Duration";
|
|
41
|
-
import * as Layer from "effect/Layer";
|
|
42
|
-
import * as API from "./api.ts";
|
|
43
46
|
import { type ProtoDescriptors } from "./protobuf.ts";
|
|
44
|
-
import { type RestProtocolOptions } from "./protocol-rest.ts";
|
|
47
|
+
import { type RestProtocolError, type RestProtocolOptions } from "./protocol-rest.ts";
|
|
48
|
+
import type { Protocol } from "./protocol.ts";
|
|
45
49
|
/** gRPC status code -> name. */
|
|
46
50
|
export declare const GRPC_STATUS_NAMES: Readonly<Record<number, string>>;
|
|
47
51
|
/** gRPC status code -> HTTP status (grpc-gateway's mapping). */
|
|
@@ -55,7 +59,21 @@ export declare const GRPC_HTTP_STATUS: Readonly<Record<number, number>>;
|
|
|
55
59
|
* ```
|
|
56
60
|
*/
|
|
57
61
|
export declare const Deadline: Context.Reference<Duration.Input | undefined>;
|
|
58
|
-
|
|
62
|
+
/**
|
|
63
|
+
* What this module's own code fails with, whatever the options: the errors
|
|
64
|
+
* every gRPC protocol declares. They are the REST protocol's: a message the
|
|
65
|
+
* descriptors can't encode (`InvalidInput`), a request or reply gRPC can't
|
|
66
|
+
* use (`SdkError`), the transport, a body or its trailers
|
|
67
|
+
* (`HttpClientError`), and a 5xx status that neither the operation nor its
|
|
68
|
+
* service declares (`InternalServerError`).
|
|
69
|
+
*/
|
|
70
|
+
export type GrpcProtocolError = RestProtocolError;
|
|
71
|
+
/**
|
|
72
|
+
* Options of {@link grpcProtocol}: the REST protocol's (see
|
|
73
|
+
* {@link RestProtocolOptions} for the type parameters) and gRPC's own.
|
|
74
|
+
* `StatusError` is what `statusError` returns.
|
|
75
|
+
*/
|
|
76
|
+
export interface GrpcProtocolOptions<Credentials, CredentialsError, CredentialsRequirements, RouteError, ClassifiedError, UnknownError, ParseError, StatusError> extends RestProtocolOptions<Credentials, CredentialsError, CredentialsRequirements, RouteError, ClassifiedError, UnknownError, ParseError> {
|
|
59
77
|
/** The SDK's generated descriptors (`src/descriptors.ts`). */
|
|
60
78
|
readonly descriptors: ProtoDescriptors;
|
|
61
79
|
/**
|
|
@@ -66,7 +84,19 @@ export interface GrpcProtocolOptions<C> extends RestProtocolOptions<C> {
|
|
|
66
84
|
* (`INVALID_ARGUMENT`, `FAILED_PRECONDITION` and `OUT_OF_RANGE` are all
|
|
67
85
|
* `BadRequest`).
|
|
68
86
|
*/
|
|
69
|
-
readonly statusError?: (info: StatusInfo) =>
|
|
87
|
+
readonly statusError?: (info: StatusInfo) => StatusError;
|
|
88
|
+
/**
|
|
89
|
+
* Send gRPC-Web (`application/grpc-web+proto`) instead of gRPC, for a
|
|
90
|
+
* server that answers HTTP/1.1 only that way (`tonic-web`). The reply
|
|
91
|
+
* carries its trailers in its body, so `fetch` sees every status.
|
|
92
|
+
*/
|
|
93
|
+
readonly web?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* The largest message the server may send, when neither the call's
|
|
96
|
+
* `maxMessageBytes` nor the `MaxMessageBytes` layer sets one. Default
|
|
97
|
+
* `DEFAULT_MAX_MESSAGE_BYTES` (16 MiB). See `max-message-bytes.ts`.
|
|
98
|
+
*/
|
|
99
|
+
readonly maxMessageBytes?: number;
|
|
70
100
|
}
|
|
71
101
|
/** A non-OK gRPC status, as `statusError` receives it. */
|
|
72
102
|
export interface StatusInfo {
|
|
@@ -79,8 +109,15 @@ export interface StatusInfo {
|
|
|
79
109
|
/** gRPC's mapping of an HTTP status, for a reply that carries no gRPC status. */
|
|
80
110
|
export declare const HTTP_GRPC_STATUS: Readonly<Record<number, number>>;
|
|
81
111
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
112
|
+
* The gRPC protocol (core/protocol), over the options of
|
|
113
|
+
* {@link restProtocol}. Assign the result to a module-level const in the
|
|
114
|
+
* provider's `protocol.ts`:
|
|
115
|
+
*
|
|
116
|
+
* export const ModalProtocol = grpcProtocol({ ... });
|
|
117
|
+
*
|
|
118
|
+
* A non-zero status becomes a class the operation or its service declares,
|
|
119
|
+
* as a failed REST response does (see {@link restProtocol}). The protocol
|
|
120
|
+
* declares what the options and {@link GrpcProtocolError} fail with.
|
|
84
121
|
*/
|
|
85
|
-
export declare const
|
|
122
|
+
export declare const grpcProtocol: <Credentials, CredentialsError = never, CredentialsRequirements = never, RouteError = never, ClassifiedError = never, UnknownError = never, ParseError = never, StatusError = never>(options: GrpcProtocolOptions<Credentials, CredentialsError, CredentialsRequirements, RouteError, ClassifiedError, UnknownError, ParseError, StatusError>) => Protocol<CredentialsError | RouteError | ClassifiedError | UnknownError | ParseError | StatusError | GrpcProtocolError, CredentialsRequirements>;
|
|
86
123
|
//# sourceMappingURL=protocol-grpc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol-grpc.d.ts","
|
|
1
|
+
{"version":3,"file":"protocol-grpc.d.ts","sources":["../src/protocol-grpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,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,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yFAAyF;IACzF,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACpD;AAED,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAS7D,CAAC;AA+iBF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,GACvB,WAAW,EACX,gBAAgB,GAAG,KAAK,EACxB,uBAAuB,GAAG,KAAK,EAC/B,UAAU,GAAG,KAAK,EAClB,eAAe,GAAG,KAAK,EACvB,YAAY,GAAG,KAAK,EACpB,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,KAAK,WAEV,mBAAmB,CAC1B,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,UAAU,EACV,WAAW,CACZ,KACA,QAAQ,CACP,gBAAgB,GAChB,UAAU,GACV,eAAe,GACf,YAAY,GACZ,UAAU,GACV,WAAW,GACX,iBAAiB,EACnB,uBAAuB,CAC8B,CAAC"}
|
package/lib/protocol-grpc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { protocol_grpc$Deadline as Deadline, protocol_grpc$GRPC_HTTP_STATUS as GRPC_HTTP_STATUS, protocol_grpc$GRPC_STATUS_NAMES as GRPC_STATUS_NAMES, protocol_grpc$HTTP_GRPC_STATUS as HTTP_GRPC_STATUS, protocol_grpc$
|
|
1
|
+
export { protocol_grpc$Deadline as Deadline, protocol_grpc$GRPC_HTTP_STATUS as GRPC_HTTP_STATUS, protocol_grpc$GRPC_STATUS_NAMES as GRPC_STATUS_NAMES, protocol_grpc$HTTP_GRPC_STATUS as HTTP_GRPC_STATUS, protocol_grpc$grpcProtocol as grpcProtocol } from "./_bundle/grpc.js";
|