@workerstack/clients 1.0.0-rc.26 → 1.0.0-rc.28
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 +43 -43
- package/bin/{honey-clients.js → clients.js} +12 -12
- package/dist/cli.d.ts +3 -3
- package/dist/cli.js +14 -14
- package/dist/emit/cli/discovery.js +1 -1
- package/dist/emit/cli/install.js +2 -2
- package/dist/emit/cli/layout.js +1 -1
- package/dist/emit/cli/module.js +1 -1
- package/dist/emit/cli/release.js +1 -1
- package/dist/emit/csharp/errors.js +1 -1
- package/dist/emit/csharp/sdk-client.js +1 -1
- package/dist/emit/csharp/sdk-csproj.d.ts +1 -1
- package/dist/emit/csharp/sdk-csproj.js +2 -2
- package/dist/emit/csharp/sdk.d.ts +1 -1
- package/dist/emit/csharp/sdk.js +2 -2
- package/dist/emit/csharp/transport.js +2 -2
- package/dist/emit/csharp/types-record.d.ts +1 -1
- package/dist/emit/go/sdk-client.js +1 -1
- package/dist/emit/go/sdk.js +1 -1
- package/dist/emit/java/sdk-errors.js +5 -5
- package/dist/emit/java/sdk-op.d.ts +1 -1
- package/dist/emit/java/sdk.js +3 -3
- package/dist/emit/mcp/files.d.ts +1 -1
- package/dist/emit/mcp/mounted.js +2 -2
- package/dist/emit/mcp/runtime.js +1 -1
- package/dist/emit/mcp/server.js +1 -1
- package/dist/emit/python/errors.js +1 -1
- package/dist/emit/python/sdk-client.js +2 -2
- package/dist/emit/python/sdk-pyproject.js +4 -4
- package/dist/emit/python/sdk.d.ts +1 -1
- package/dist/emit/python/sdk.js +11 -11
- package/dist/emit/python/transport.js +1 -1
- package/dist/emit/rust/errors.js +2 -2
- package/dist/emit/rust/sdk-cargo.js +3 -3
- package/dist/emit/rust/sdk.d.ts +1 -1
- package/dist/emit/rust/sdk.js +2 -2
- package/dist/emit/shared/format.d.ts +1 -1
- package/dist/emit/shared/metadata.d.ts +1 -1
- package/dist/emit/shared/status-keys.d.ts +1 -1
- package/dist/emit/shared/status-keys.js +1 -1
- package/dist/emit/ts/app-client.js +2 -2
- package/dist/emit/ts/route-tree.d.ts +1 -1
- package/dist/emit/ts/route-tree.js +1 -12
- package/dist/emit/ts/sdk-types-preamble.js +16 -16
- package/dist/emit/ts/sdk-types.js +6 -6
- package/dist/emit/ts/tanstack-query.js +5 -5
- package/dist/emit/ts/type-gen.d.ts +4 -3
- package/dist/emit/ts/type-gen.js +86 -45
- package/dist/extract/chain.d.ts +10 -6
- package/dist/extract/chain.js +5 -19
- package/dist/extract/extract.d.ts +2 -2
- package/dist/extract/extract.js +40 -26
- package/dist/extract/serialize.js +1 -1
- package/dist/extract/walk.d.ts +15 -4
- package/dist/extract/walk.js +159 -15
- package/dist/gen/args.js +3 -3
- package/dist/gen/formatters.d.ts +6 -6
- package/dist/gen/formatters.js +7 -7
- package/dist/gen/process.d.ts +3 -3
- package/dist/gen/process.js +7 -7
- package/dist/gen/targets.d.ts +3 -3
- package/dist/gen/targets.js +3 -3
- package/dist/gen/write.d.ts +1 -1
- package/dist/gen/write.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/ir/load.js +10 -10
- package/dist/ir/model.d.ts +6 -4
- package/dist/ir/sdk-model.d.ts +1 -1
- package/dist/ir/sdk-model.js +1 -1
- package/dist/ir/slots.d.ts +3 -3
- package/dist/ir/slots.js +12 -10
- package/dist/release/bootstrap.js +1 -1
- package/dist/release/bump-command.js +1 -1
- package/dist/release/cli.d.ts +4 -4
- package/dist/release/cli.js +6 -6
- package/dist/release/context.d.ts +1 -1
- package/dist/release/context.js +1 -1
- package/dist/release/digest.d.ts +1 -1
- package/dist/release/digest.js +2 -2
- package/dist/release/index.d.ts +1 -1
- package/dist/release/load.js +1 -1
- package/dist/release/manifest.js +1 -1
- package/dist/release/registries.js +3 -3
- package/dist/release/release-workflow.js +1 -1
- package/dist/release/spec-gate.d.ts +2 -2
- package/dist/release/spec-gate.js +2 -2
- package/dist/release/sync-command.d.ts +1 -1
- package/dist/release/sync-command.js +1 -1
- package/dist/release/sync-tree.js +1 -1
- package/dist/release/types.d.ts +6 -6
- package/dist/runtime/cli/body.go +1 -1
- package/dist/runtime/cli/config.go +3 -3
- package/dist/runtime/cli/discovery.go +1 -1
- package/dist/runtime/cli/format.go +1 -1
- package/dist/runtime/cli/log.go +1 -1
- package/dist/runtime/cli/output.go +1 -1
- package/dist/runtime/cli/params.go +1 -1
- package/dist/runtime/cli/run.go +1 -1
- package/dist/runtime/cli/socket.go +1 -1
- package/dist/runtime/cli/stream.go +1 -1
- package/dist/runtime/cli/target.go +1 -1
- package/dist/runtime/csharp/Adapters.cs +2 -2
- package/dist/runtime/csharp/Auth.cs +2 -2
- package/dist/runtime/csharp/Body.cs +3 -3
- package/dist/runtime/csharp/Config.cs +2 -2
- package/dist/runtime/csharp/Envelope.cs +3 -3
- package/dist/runtime/csharp/Errors.cs +10 -10
- package/dist/runtime/csharp/Events.cs +2 -2
- package/dist/runtime/csharp/Exchange.cs +4 -4
- package/dist/runtime/csharp/Handler.cs +3 -3
- package/dist/runtime/csharp/Hooks.cs +3 -3
- package/dist/runtime/csharp/Invalidation.cs +2 -2
- package/dist/runtime/csharp/Json.cs +2 -2
- package/dist/runtime/csharp/Log.cs +2 -2
- package/dist/runtime/csharp/Operation.cs +2 -2
- package/dist/runtime/csharp/Path.cs +2 -2
- package/dist/runtime/csharp/Query.cs +2 -2
- package/dist/runtime/csharp/Realtime.cs +2 -2
- package/dist/runtime/csharp/RealtimeLoop.cs +3 -3
- package/dist/runtime/csharp/Redirect.cs +2 -2
- package/dist/runtime/csharp/Result.cs +2 -2
- package/dist/runtime/csharp/Sse.cs +2 -2
- package/dist/runtime/csharp/Stale.cs +2 -2
- package/dist/runtime/csharp/Transport.cs +2 -2
- package/dist/runtime/csharp/TransportLongPoll.cs +2 -2
- package/dist/runtime/csharp/TransportSse.cs +2 -2
- package/dist/runtime/csharp/TransportWs.cs +2 -2
- package/dist/runtime/csharp/Wire.cs +2 -2
- package/dist/runtime/csharp/Ws.cs +2 -2
- package/dist/runtime/csharp/WsDial.cs +2 -2
- package/dist/runtime/go/auth.go +1 -1
- package/dist/runtime/go/body.go +2 -2
- package/dist/runtime/go/config.go +1 -1
- package/dist/runtime/go/errors.go +5 -5
- package/dist/runtime/go/export.go +10 -10
- package/dist/runtime/go/hooks.go +2 -2
- package/dist/runtime/go/invalidation.go +2 -2
- package/dist/runtime/go/log.go +1 -1
- package/dist/runtime/go/nullable.go +1 -1
- package/dist/runtime/go/options.go +1 -1
- package/dist/runtime/go/path.go +1 -1
- package/dist/runtime/go/query.go +2 -2
- package/dist/runtime/go/realtime.go +4 -4
- package/dist/runtime/go/realtime_loop.go +1 -1
- package/dist/runtime/go/redirect.go +2 -2
- package/dist/runtime/go/request.go +9 -9
- package/dist/runtime/go/result.go +2 -2
- package/dist/runtime/go/sse.go +3 -3
- package/dist/runtime/go/stale.go +1 -1
- package/dist/runtime/go/stream.go +2 -2
- package/dist/runtime/go/transport.go +2 -2
- package/dist/runtime/go/transport_longpoll.go +1 -1
- package/dist/runtime/go/transport_sse.go +2 -2
- package/dist/runtime/go/ws.go +1 -1
- package/dist/runtime/java/Answer.java +2 -2
- package/dist/runtime/java/ApiException.java +2 -2
- package/dist/runtime/java/BinaryBody.java +2 -2
- package/dist/runtime/java/Body.java +4 -4
- package/dist/runtime/java/Call.java +2 -2
- package/dist/runtime/java/CallLog.java +2 -2
- package/dist/runtime/java/ClientConfig.java +2 -2
- package/dist/runtime/java/ConnectionState.java +2 -2
- package/dist/runtime/java/Credential.java +2 -2
- package/dist/runtime/java/Deadline.java +2 -2
- package/dist/runtime/java/Decode.java +2 -2
- package/dist/runtime/java/Envelope.java +2 -2
- package/dist/runtime/java/ErrorEnvelope.java +3 -3
- package/dist/runtime/java/EventStream.java +2 -2
- package/dist/runtime/java/Exchange.java +2 -2
- package/dist/runtime/java/FilePart.java +2 -2
- package/dist/runtime/java/Flight.java +3 -3
- package/dist/runtime/java/Hooks.java +3 -3
- package/dist/runtime/java/Hops.java +2 -2
- package/dist/runtime/java/{HoneyException.java → HttpException.java} +4 -4
- package/dist/runtime/java/InvalidationConfig.java +2 -2
- package/dist/runtime/java/Json.java +3 -3
- package/dist/runtime/java/Keepalive.java +2 -2
- package/dist/runtime/java/LogEntry.java +2 -2
- package/dist/runtime/java/LongPollAdapter.java +2 -2
- package/dist/runtime/java/Operation.java +2 -2
- package/dist/runtime/java/Opt.java +2 -2
- package/dist/runtime/java/Pump.java +2 -2
- package/dist/runtime/java/RawResponse.java +2 -2
- package/dist/runtime/java/Realtime.java +2 -2
- package/dist/runtime/java/RealtimeLoop.java +4 -4
- package/dist/runtime/java/RedirectPolicy.java +2 -2
- package/dist/runtime/java/Redirects.java +2 -2
- package/dist/runtime/java/RequestContext.java +2 -2
- package/dist/runtime/java/RequestHook.java +2 -2
- package/dist/runtime/java/RequestOptions.java +2 -2
- package/dist/runtime/java/ResponseContext.java +2 -2
- package/dist/runtime/java/ResponseHook.java +2 -2
- package/dist/runtime/java/Result.java +2 -2
- package/dist/runtime/java/ResumableConnection.java +2 -2
- package/dist/runtime/java/SdkException.java +3 -3
- package/dist/runtime/java/Socket.java +2 -2
- package/dist/runtime/java/Sse.java +2 -2
- package/dist/runtime/java/SseAdapter.java +2 -2
- package/dist/runtime/java/SseEvent.java +2 -2
- package/dist/runtime/java/StaleMeta.java +2 -2
- package/dist/runtime/java/StaleTracker.java +2 -2
- package/dist/runtime/java/Transport.java +2 -2
- package/dist/runtime/java/TransportAdapter.java +2 -2
- package/dist/runtime/java/TransportConnection.java +2 -2
- package/dist/runtime/java/TransportKind.java +2 -2
- package/dist/runtime/java/TransportMessage.java +2 -2
- package/dist/runtime/java/TransportOptions.java +2 -2
- package/dist/runtime/java/TypedWebSocket.java +2 -2
- package/dist/runtime/java/UrlPath.java +2 -2
- package/dist/runtime/java/UrlQuery.java +2 -2
- package/dist/runtime/java/WsAdapter.java +2 -2
- package/dist/runtime/java/WsClose.java +2 -2
- package/dist/runtime/java/WsDial.java +2 -2
- package/dist/runtime/java/WsMessage.java +2 -2
- package/dist/runtime/mcp/call.ts +3 -3
- package/dist/runtime/mcp/result.ts +2 -2
- package/dist/runtime/python/__init__.py +1 -1
- package/dist/runtime/python/auth.py +1 -1
- package/dist/runtime/python/body.py +1 -1
- package/dist/runtime/python/config.py +1 -1
- package/dist/runtime/python/errors.py +11 -11
- package/dist/runtime/python/events.py +4 -4
- package/dist/runtime/python/exchange.py +1 -1
- package/dist/runtime/python/hooks.py +4 -4
- package/dist/runtime/python/invalidation.py +1 -1
- package/dist/runtime/python/log.py +1 -1
- package/dist/runtime/python/operation.py +1 -1
- package/dist/runtime/python/path.py +1 -1
- package/dist/runtime/python/query.py +1 -1
- package/dist/runtime/python/realtime.py +5 -5
- package/dist/runtime/python/redirect.py +1 -1
- package/dist/runtime/python/result.py +1 -1
- package/dist/runtime/python/send_async.py +4 -4
- package/dist/runtime/python/send_sync.py +3 -3
- package/dist/runtime/python/sse.py +1 -1
- package/dist/runtime/python/stale.py +1 -1
- package/dist/runtime/python/transport.py +1 -1
- package/dist/runtime/python/transport_longpoll.py +1 -1
- package/dist/runtime/python/transport_sse.py +1 -1
- package/dist/runtime/python/transport_ws.py +1 -1
- package/dist/runtime/python/ws.py +3 -3
- package/dist/runtime/rust/Cargo.lock +1 -1
- package/dist/runtime/rust/answer.rs +1 -1
- package/dist/runtime/rust/auth.rs +1 -1
- package/dist/runtime/rust/body.rs +2 -2
- package/dist/runtime/rust/call.rs +1 -1
- package/dist/runtime/rust/config.rs +1 -1
- package/dist/runtime/rust/envelope.rs +3 -3
- package/dist/runtime/rust/errors.rs +3 -3
- package/dist/runtime/rust/events.rs +1 -1
- package/dist/runtime/rust/exchange.rs +1 -1
- package/dist/runtime/rust/hooks.rs +1 -1
- package/dist/runtime/rust/invalidation.rs +1 -1
- package/dist/runtime/rust/log.rs +1 -1
- package/dist/runtime/rust/nullable.rs +1 -1
- package/dist/runtime/rust/path.rs +1 -1
- package/dist/runtime/rust/query.rs +1 -1
- package/dist/runtime/rust/realtime.rs +1 -1
- package/dist/runtime/rust/realtime_loop.rs +1 -1
- package/dist/runtime/rust/redirect.rs +1 -1
- package/dist/runtime/rust/request.rs +1 -1
- package/dist/runtime/rust/result.rs +1 -1
- package/dist/runtime/rust/sse.rs +1 -1
- package/dist/runtime/rust/stale.rs +1 -1
- package/dist/runtime/rust/transport.rs +1 -1
- package/dist/runtime/rust/transport_longpoll.rs +1 -1
- package/dist/runtime/rust/transport_sse.rs +1 -1
- package/dist/runtime/rust/transport_ws.rs +1 -1
- package/dist/runtime/rust/ws.rs +1 -1
- package/dist/runtime/ts/app-types.ts +5 -5
- package/dist/runtime/ts/app.ts +5 -5
- package/dist/runtime/ts/http.ts +3 -3
- package/dist/runtime/ts/path.ts +1 -1
- package/dist/runtime/ts/request.ts +1 -1
- package/dist/runtime/ts/sdk.ts +1 -1
- package/package.json +2 -29
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Code generated by
|
|
1
|
+
// Code generated by clients. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
package sdk
|
|
4
4
|
|
|
@@ -47,7 +47,7 @@ type exchange struct {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
// ErrResponseTooLarge is a *DecodeError's cause when a 2xx body exceeds Config.MaxResponseBytes.
|
|
50
|
-
var ErrResponseTooLarge = errors.New("
|
|
50
|
+
var ErrResponseTooLarge = errors.New("httpsdk: response body exceeds MaxResponseBytes")
|
|
51
51
|
|
|
52
52
|
// doRequest sends c and buffers its answer (run), honoring the call's timeout and the stale
|
|
53
53
|
// tracker. A ctx already done sends nothing: OnLog sees only its error. A 2xx past the cap is a
|
|
@@ -113,7 +113,7 @@ func (x *exchange) sendWithAuth(ctx context.Context) (*requestResult, error) {
|
|
|
113
113
|
}
|
|
114
114
|
fresh, err := x.cfg.auth.refresh(ctx, x.cfg, token)
|
|
115
115
|
if err != nil {
|
|
116
|
-
return nil, fmt.Errorf("
|
|
116
|
+
return nil, fmt.Errorf("httpsdk: OnAuthExpired failed: %w", err)
|
|
117
117
|
}
|
|
118
118
|
if fresh == "" {
|
|
119
119
|
return result, nil
|
|
@@ -165,7 +165,7 @@ func (x *exchange) newRequest(ctx context.Context, token string, retry bool) (*h
|
|
|
165
165
|
c := x.c
|
|
166
166
|
fullURL, err := buildURL(x.rc.baseURL, c.path, c.query)
|
|
167
167
|
if err != nil {
|
|
168
|
-
return nil, fmt.Errorf("
|
|
168
|
+
return nil, fmt.Errorf("httpsdk: build URL: %w", err)
|
|
169
169
|
}
|
|
170
170
|
/* a Reader body streams as is; RequestContext.Body stays nil so no hook reads a one-shot reader */
|
|
171
171
|
payload, err := c.body.bytes()
|
|
@@ -186,7 +186,7 @@ func (x *exchange) newRequest(ctx context.Context, token string, retry bool) (*h
|
|
|
186
186
|
}
|
|
187
187
|
req, err := http.NewRequestWithContext(ctx, rc.Method, rc.URL, reader)
|
|
188
188
|
if err != nil {
|
|
189
|
-
return nil, fmt.Errorf("
|
|
189
|
+
return nil, fmt.Errorf("httpsdk: build request: %w", err)
|
|
190
190
|
}
|
|
191
191
|
req.Header = rc.Headers
|
|
192
192
|
return req, nil
|
|
@@ -197,13 +197,13 @@ func (x *exchange) newRequest(ctx context.Context, token string, retry bool) (*h
|
|
|
197
197
|
func wrapTransportError(ctx context.Context, err error) error {
|
|
198
198
|
switch ctxErr := context.Cause(ctx); {
|
|
199
199
|
case errors.Is(ctxErr, context.DeadlineExceeded):
|
|
200
|
-
return fmt.Errorf("
|
|
200
|
+
return fmt.Errorf("httpsdk: request timed out: %w", ctxErr)
|
|
201
201
|
case errors.Is(ctxErr, context.Canceled):
|
|
202
|
-
return fmt.Errorf("
|
|
202
|
+
return fmt.Errorf("httpsdk: request canceled: %w", ctxErr)
|
|
203
203
|
case ctxErr != nil:
|
|
204
|
-
return fmt.Errorf("
|
|
204
|
+
return fmt.Errorf("httpsdk: context error: %w", ctxErr)
|
|
205
205
|
}
|
|
206
|
-
return fmt.Errorf("
|
|
206
|
+
return fmt.Errorf("httpsdk: http do: %w", redactURL(err))
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
// readBody reads r up to limit bytes; a negative limit reads all.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Code generated by
|
|
1
|
+
// Code generated by clients. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
package sdk
|
|
4
4
|
|
|
@@ -29,7 +29,7 @@ type DecodeError struct {
|
|
|
29
29
|
Err error
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
func (e *DecodeError) Error() string { return "
|
|
32
|
+
func (e *DecodeError) Error() string { return "httpsdk: decode response: " + e.Err.Error() }
|
|
33
33
|
|
|
34
34
|
// Unwrap returns the parse error, or ErrResponseTooLarge.
|
|
35
35
|
func (e *DecodeError) Unwrap() error { return e.Err }
|
package/dist/runtime/go/sse.go
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Code generated by
|
|
1
|
+
// Code generated by clients. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
package sdk
|
|
4
4
|
|
|
@@ -31,10 +31,10 @@ const (
|
|
|
31
31
|
)
|
|
32
32
|
|
|
33
33
|
// ErrSSELineTooLong is returned when a single SSE line exceeds 1 MiB.
|
|
34
|
-
var ErrSSELineTooLong = errors.New("
|
|
34
|
+
var ErrSSELineTooLong = errors.New("httpsdk: sse line exceeds 1 MiB")
|
|
35
35
|
|
|
36
36
|
// ErrSSEEventTooLarge is returned when one event's data exceeds 8 MiB.
|
|
37
|
-
var ErrSSEEventTooLarge = errors.New("
|
|
37
|
+
var ErrSSEEventTooLarge = errors.New("httpsdk: sse event exceeds 8 MiB")
|
|
38
38
|
|
|
39
39
|
// parseSSEStream yields the events of resp and closes its body when done. A non-2xx response
|
|
40
40
|
// yields its typed error and ends; a canceled ctx ends the stream quietly.
|
package/dist/runtime/go/stale.go
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Code generated by
|
|
1
|
+
// Code generated by clients. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
package sdk
|
|
4
4
|
|
|
@@ -87,7 +87,7 @@ func streamJSON[T any](ctx context.Context, cfg Config, c *call, opts []RequestO
|
|
|
87
87
|
}
|
|
88
88
|
ev := SSEEvent[T]{Event: raw.Event, ID: raw.ID, Retry: raw.Retry}
|
|
89
89
|
if err := json.Unmarshal([]byte(raw.Data), &ev.Data); err != nil {
|
|
90
|
-
yield(SSEEvent[T]{}, fmt.Errorf("
|
|
90
|
+
yield(SSEEvent[T]{}, fmt.Errorf("httpsdk: decode sse event: %w", err))
|
|
91
91
|
return
|
|
92
92
|
}
|
|
93
93
|
if !yield(ev, nil) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Code generated by
|
|
1
|
+
// Code generated by clients. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
package sdk
|
|
4
4
|
|
|
@@ -236,7 +236,7 @@ func (c *wsConn) Close() error {
|
|
|
236
236
|
// posted is an SSE or long-poll send: a realtime method's POST, else receive-only.
|
|
237
237
|
func posted(ctx context.Context, send func(context.Context, any) error, name string, data any) error {
|
|
238
238
|
if send == nil {
|
|
239
|
-
return fmt.Errorf("
|
|
239
|
+
return fmt.Errorf("httpsdk: %s transport is receive-only", name)
|
|
240
240
|
}
|
|
241
241
|
return send(ctx, data)
|
|
242
242
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Code generated by
|
|
1
|
+
// Code generated by clients. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
package sdk
|
|
4
4
|
|
|
@@ -89,7 +89,7 @@ func checkEventStream(resp *http.Response) error {
|
|
|
89
89
|
}
|
|
90
90
|
if ct := resp.Header.Get("Content-Type"); !strings.HasPrefix(strings.ToLower(ct), "text/event-stream") {
|
|
91
91
|
resp.Body.Close()
|
|
92
|
-
return fmt.Errorf("
|
|
92
|
+
return fmt.Errorf("httpsdk: sse transport: unexpected content type %q", ct)
|
|
93
93
|
}
|
|
94
94
|
return nil
|
|
95
95
|
}
|
package/dist/runtime/go/ws.go
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// @generated by
|
|
2
|
-
package
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
|
+
package http.runtime;
|
|
3
3
|
|
|
4
4
|
import java.io.ByteArrayOutputStream;
|
|
5
5
|
import java.io.InputStream;
|
|
@@ -47,12 +47,12 @@ record Body(byte[] bytes, InputStream stream, String mediaType) {
|
|
|
47
47
|
return new Body(bytes, null, "application/x-www-form-urlencoded");
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
/** The multipart body of {@code parts} under a fresh {@code
|
|
50
|
+
/** The multipart body of {@code parts} under a fresh {@code clients-<uuid>} boundary. */
|
|
51
51
|
static Body multipart(List<Part> parts) {
|
|
52
52
|
if (parts == null) {
|
|
53
53
|
return null;
|
|
54
54
|
}
|
|
55
|
-
String mark = "
|
|
55
|
+
String mark = "clients-" + UUID.randomUUID();
|
|
56
56
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
57
57
|
for (Part part : parts) {
|
|
58
58
|
for (Object item : part.items()) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
// @generated by
|
|
2
|
-
package
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
|
+
package http.runtime;
|
|
3
3
|
|
|
4
4
|
import java.util.List;
|
|
5
5
|
import java.util.Map;
|
|
6
6
|
import tools.jackson.databind.JsonNode;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* backend's error envelope, read from an error body's JSON object (empty for any other body): each
|
|
10
10
|
* member it names when the server sent it with its type, and every other member, a mistyped one
|
|
11
11
|
* included, in {@code extra}.
|
|
12
12
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// @generated by
|
|
2
|
-
package
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
|
+
package http.runtime;
|
|
3
3
|
|
|
4
4
|
/** One file of a multipart body: its name, its bytes and its media type. */
|
|
5
5
|
public record FilePart(String fileName, byte[] data, String contentType) {}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// @generated by
|
|
2
|
-
package
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
|
+
package http.runtime;
|
|
3
3
|
|
|
4
4
|
import java.io.IOException;
|
|
5
5
|
import java.io.InputStream;
|
|
@@ -114,7 +114,7 @@ final class Flight {
|
|
|
114
114
|
} catch (CancellationException e) {
|
|
115
115
|
log.canceled();
|
|
116
116
|
throw e;
|
|
117
|
-
} catch (
|
|
117
|
+
} catch (HttpException e) {
|
|
118
118
|
log.failed(e, null);
|
|
119
119
|
throw e;
|
|
120
120
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// @generated by
|
|
2
|
-
package
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
|
+
package http.runtime;
|
|
3
3
|
|
|
4
4
|
import java.util.List;
|
|
5
5
|
import java.util.concurrent.CancellationException;
|
|
@@ -24,7 +24,7 @@ final class Hooks {
|
|
|
24
24
|
* failure wrapped as the call's {@link HookException}.
|
|
25
25
|
*/
|
|
26
26
|
static RuntimeException failure(String label, java.lang.Exception e) {
|
|
27
|
-
if (e instanceof
|
|
27
|
+
if (e instanceof HttpException || e instanceof CancellationException) {
|
|
28
28
|
return (RuntimeException) e;
|
|
29
29
|
}
|
|
30
30
|
return new HookException(label + ": " + e.getMessage(), e);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
// @generated by
|
|
2
|
-
package
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
|
+
package http.runtime;
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Every error the SDK throws; the caller's own cancellation is a {@link
|
|
6
6
|
* java.util.concurrent.CancellationException}.
|
|
7
7
|
*/
|
|
8
|
-
public abstract class
|
|
8
|
+
public abstract class HttpException extends RuntimeException {
|
|
9
9
|
private static final long serialVersionUID = 1L;
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
HttpException(String message, Throwable cause) {
|
|
12
12
|
super(message, cause);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// @generated by
|
|
2
|
-
package
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
|
+
package http.runtime;
|
|
3
3
|
|
|
4
4
|
import tools.jackson.databind.DeserializationFeature;
|
|
5
5
|
import tools.jackson.databind.json.JsonMapper;
|
|
@@ -13,7 +13,7 @@ final class Json {
|
|
|
13
13
|
static final JsonMapper MAPPER =
|
|
14
14
|
JsonMapper.builder()
|
|
15
15
|
.addModule(
|
|
16
|
-
new SimpleModule("
|
|
16
|
+
new SimpleModule("clients-opt")
|
|
17
17
|
.addDeserializer(Opt.class, new Opt.Reader(null))
|
|
18
18
|
.addSerializer(new Opt.Writer()))
|
|
19
19
|
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// @generated by
|
|
2
|
-
package
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
|
+
package http.runtime;
|
|
3
3
|
|
|
4
4
|
import java.io.UncheckedIOException;
|
|
5
5
|
import java.time.Duration;
|
|
@@ -291,7 +291,7 @@ final class RealtimeLoop {
|
|
|
291
291
|
try {
|
|
292
292
|
open();
|
|
293
293
|
return;
|
|
294
|
-
} catch (
|
|
294
|
+
} catch (HttpException e) {
|
|
295
295
|
failure = e;
|
|
296
296
|
if (refused) {
|
|
297
297
|
break;
|
|
@@ -366,6 +366,6 @@ final class RealtimeLoop {
|
|
|
366
366
|
* caller's.
|
|
367
367
|
*/
|
|
368
368
|
private static boolean fails(RuntimeException e) {
|
|
369
|
-
return e instanceof
|
|
369
|
+
return e instanceof HttpException || e instanceof UncheckedIOException;
|
|
370
370
|
}
|
|
371
371
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
// @generated by
|
|
2
|
-
package
|
|
1
|
+
// @generated by clients. DO NOT EDIT.
|
|
2
|
+
package http.runtime;
|
|
3
3
|
|
|
4
4
|
/** An answer: an error status or a 2xx that does not decode; a {@link Result.Err} holds it. */
|
|
5
|
-
public abstract class SdkException extends
|
|
5
|
+
public abstract class SdkException extends HttpException {
|
|
6
6
|
private static final long serialVersionUID = 1L;
|
|
7
7
|
|
|
8
8
|
SdkException(String message, Throwable cause) {
|