effect 4.0.0-beta.47 → 4.0.0-beta.49
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/unstable/cli/Completions.d.ts +83 -2
- package/dist/unstable/cli/Completions.d.ts.map +1 -1
- package/dist/unstable/cli/Completions.js +2 -0
- package/dist/unstable/cli/Completions.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +1 -1
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.d.ts +2 -0
- package/dist/unstable/cli/internal/completions/descriptor.d.ts.map +1 -0
- package/dist/unstable/cli/internal/completions/{CommandDescriptor.js → descriptor.js} +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -0
- package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
- package/dist/unstable/cli/internal/completions/zsh.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +4 -1
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +1 -1
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +1 -0
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +3 -2
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +1 -0
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +76 -0
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +66 -9
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +1 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +1 -1
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +6 -0
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +10 -0
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +1 -1
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/package.json +10 -10
- package/src/unstable/cli/Completions.ts +73 -2
- package/src/unstable/cli/GlobalFlag.ts +1 -1
- package/src/unstable/cli/internal/completions/bash.ts +7 -7
- package/src/unstable/cli/internal/completions/{CommandDescriptor.ts → descriptor.ts} +7 -55
- package/src/unstable/cli/internal/completions/fish.ts +7 -7
- package/src/unstable/cli/internal/completions/zsh.ts +8 -14
- package/src/unstable/eventlog/EventLog.ts +7 -2
- package/src/unstable/eventlog/EventLogRemote.ts +1 -0
- package/src/unstable/httpapi/HttpApiBuilder.ts +11 -3
- package/src/unstable/httpapi/HttpApiClient.ts +2 -2
- package/src/unstable/httpapi/HttpApiMiddleware.ts +1 -0
- package/src/unstable/httpapi/HttpApiSchema.ts +81 -2
- package/src/unstable/observability/OtlpExporter.ts +1 -0
- package/src/unstable/reactivity/Atom.ts +1 -1
- package/src/unstable/reactivity/AtomRpc.ts +4 -4
- package/src/unstable/rpc/RpcGroup.ts +17 -0
- package/src/unstable/socket/Socket.ts +1 -1
- package/src/unstable/workflow/Workflow.ts +5 -2
- package/dist/unstable/cli/internal/completions/CommandDescriptor.d.ts +0 -2
- package/dist/unstable/cli/internal/completions/CommandDescriptor.d.ts.map +0 -1
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js.map +0 -1
|
@@ -6,13 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
import type
|
|
10
|
-
ArgumentDescriptor,
|
|
11
|
-
ArgumentType,
|
|
12
|
-
CommandDescriptor,
|
|
13
|
-
FlagDescriptor,
|
|
14
|
-
FlagType
|
|
15
|
-
} from "./CommandDescriptor.ts"
|
|
9
|
+
import type * as Completions from "../../Completions.ts"
|
|
16
10
|
|
|
17
11
|
// ---------------------------------------------------------------------------
|
|
18
12
|
// Helpers
|
|
@@ -25,7 +19,7 @@ const sanitize = (s: string): string => s.replace(/[^a-zA-Z0-9_]/g, "_")
|
|
|
25
19
|
/**
|
|
26
20
|
* All forms of a flag (--name, -alias, --no-name) for the exclusion group.
|
|
27
21
|
*/
|
|
28
|
-
const allForms = (flag: FlagDescriptor): Array<string> => {
|
|
22
|
+
const allForms = (flag: Completions.FlagDescriptor): Array<string> => {
|
|
29
23
|
const forms: Array<string> = [`--${flag.name}`]
|
|
30
24
|
for (const alias of flag.aliases) {
|
|
31
25
|
forms.push(alias.length === 1 ? `-${alias}` : `--${alias}`)
|
|
@@ -36,7 +30,7 @@ const allForms = (flag: FlagDescriptor): Array<string> => {
|
|
|
36
30
|
return forms
|
|
37
31
|
}
|
|
38
32
|
|
|
39
|
-
const valueAction = (type: FlagType): string => {
|
|
33
|
+
const valueAction = (type: Completions.FlagType): string => {
|
|
40
34
|
switch (type._tag) {
|
|
41
35
|
case "Boolean":
|
|
42
36
|
return ""
|
|
@@ -55,7 +49,7 @@ const valueAction = (type: FlagType): string => {
|
|
|
55
49
|
}
|
|
56
50
|
}
|
|
57
51
|
|
|
58
|
-
const argAction = (type: ArgumentType): string => {
|
|
52
|
+
const argAction = (type: Completions.ArgumentType): string => {
|
|
59
53
|
switch (type._tag) {
|
|
60
54
|
case "Choice":
|
|
61
55
|
return `(${type.values.join(" ")})`
|
|
@@ -70,7 +64,7 @@ const argAction = (type: ArgumentType): string => {
|
|
|
70
64
|
* Produce _arguments optspecs for a single flag. Each spec is a complete,
|
|
71
65
|
* single-quoted string — no brace expansion, no line continuations.
|
|
72
66
|
*/
|
|
73
|
-
const flagSpecs = (flag: FlagDescriptor): Array<string> => {
|
|
67
|
+
const flagSpecs = (flag: Completions.FlagDescriptor): Array<string> => {
|
|
74
68
|
const specs: Array<string> = []
|
|
75
69
|
const desc = flag.description ? `[${escapeZsh(flag.description)}]` : ""
|
|
76
70
|
const action = valueAction(flag.type)
|
|
@@ -94,7 +88,7 @@ const flagSpecs = (flag: FlagDescriptor): Array<string> => {
|
|
|
94
88
|
return specs
|
|
95
89
|
}
|
|
96
90
|
|
|
97
|
-
const argSpec = (arg: ArgumentDescriptor): string => {
|
|
91
|
+
const argSpec = (arg: Completions.ArgumentDescriptor): string => {
|
|
98
92
|
const desc = arg.description ? escapeZsh(arg.description) : arg.name
|
|
99
93
|
const action = argAction(arg.type)
|
|
100
94
|
const prefix = arg.variadic ? "*" : ""
|
|
@@ -106,7 +100,7 @@ const argSpec = (arg: ArgumentDescriptor): string => {
|
|
|
106
100
|
// ---------------------------------------------------------------------------
|
|
107
101
|
|
|
108
102
|
const generateFunction = (
|
|
109
|
-
descriptor: CommandDescriptor,
|
|
103
|
+
descriptor: Completions.CommandDescriptor,
|
|
110
104
|
parentPath: ReadonlyArray<string>,
|
|
111
105
|
lines: Array<string>
|
|
112
106
|
): void => {
|
|
@@ -196,7 +190,7 @@ const generateFunction = (
|
|
|
196
190
|
/** @internal */
|
|
197
191
|
export const generate = (
|
|
198
192
|
executableName: string,
|
|
199
|
-
descriptor: CommandDescriptor
|
|
193
|
+
descriptor: Completions.CommandDescriptor
|
|
200
194
|
): string => {
|
|
201
195
|
const lines: Array<string> = []
|
|
202
196
|
const safeName = sanitize(executableName)
|
|
@@ -358,7 +358,9 @@ const IdentityEncodedSchema = Schema.Struct({
|
|
|
358
358
|
privateKey: Schema.Uint8ArrayFromBase64
|
|
359
359
|
})
|
|
360
360
|
|
|
361
|
-
const IdentityStringSchema = Schema.
|
|
361
|
+
const IdentityStringSchema = Schema.StringFromBase64Url.pipe(
|
|
362
|
+
Schema.decodeTo(Schema.fromJsonString(IdentityEncodedSchema))
|
|
363
|
+
)
|
|
362
364
|
|
|
363
365
|
/**
|
|
364
366
|
* @since 4.0.0
|
|
@@ -584,7 +586,10 @@ export const makeReplayFromRemote = (options: {
|
|
|
584
586
|
}
|
|
585
587
|
}) =>
|
|
586
588
|
Effect.fnUntraced(
|
|
587
|
-
function*({ conflicts, entry }
|
|
589
|
+
function*({ conflicts, entry }: {
|
|
590
|
+
readonly entry: Entry
|
|
591
|
+
readonly conflicts: ReadonlyArray<Entry>
|
|
592
|
+
}): Effect.fn.Return<void, Schema.SchemaError> {
|
|
588
593
|
const handler = options.handlers.get(entry.event) as Handlers.Item<any> | undefined
|
|
589
594
|
if (!handler) {
|
|
590
595
|
return yield* Effect.logDebug(`Event handler not found for: "${entry.event}"`)
|
|
@@ -245,6 +245,7 @@ export const makeWith = Effect.fnUntraced(function*({ encodeWrite, decodeChanges
|
|
|
245
245
|
return remote
|
|
246
246
|
})
|
|
247
247
|
|
|
248
|
+
/** @effect-diagnostics-next-line classSelfMismatch:off */
|
|
248
249
|
class IdentityService extends Context.Service<Identity, Identity["Service"]>()(
|
|
249
250
|
"effect/eventlog/EventLog/Identity" satisfies Identity["key"]
|
|
250
251
|
) {}
|
|
@@ -18,7 +18,7 @@ import * as Schema from "../../Schema.ts"
|
|
|
18
18
|
import type * as AST from "../../SchemaAST.ts"
|
|
19
19
|
import * as Issue from "../../SchemaIssue.ts"
|
|
20
20
|
import * as Transformation from "../../SchemaTransformation.ts"
|
|
21
|
-
import
|
|
21
|
+
import * as Scope from "../../Scope.ts"
|
|
22
22
|
import * as Stream from "../../Stream.ts"
|
|
23
23
|
import type { Covariant, NoInfer } from "../../Types.ts"
|
|
24
24
|
import * as UndefinedOr from "../../UndefinedOr.ts"
|
|
@@ -120,7 +120,9 @@ export const group = <
|
|
|
120
120
|
Exclude<Handlers.Context<Return>, Scope.Scope>
|
|
121
121
|
> =>
|
|
122
122
|
Layer.effectContext(Effect.gen(function*() {
|
|
123
|
-
const services = yield* Effect.context<any>()
|
|
123
|
+
const services = (yield* Effect.context<any>()).pipe(
|
|
124
|
+
Context.omit(Scope.Scope)
|
|
125
|
+
)
|
|
124
126
|
const group = api.groups[groupName]!
|
|
125
127
|
const result = build(makeHandlers(group))
|
|
126
128
|
const handlers: Handlers<any, any> = Effect.isEffect(result)
|
|
@@ -333,7 +335,13 @@ export const endpoint = <
|
|
|
333
335
|
Effect.contextWith((context: Context.Context<any>) => {
|
|
334
336
|
const group = api.groups[groupName] as unknown as HttpApiGroup.AnyWithProps
|
|
335
337
|
const endpoint = group.endpoints[endpointName] as unknown as HttpApiEndpoint.AnyWithProps
|
|
336
|
-
return Effect.succeed(handlerToHttpEffect(
|
|
338
|
+
return Effect.succeed(handlerToHttpEffect(
|
|
339
|
+
group,
|
|
340
|
+
endpoint,
|
|
341
|
+
Context.omit(Scope.Scope)(context),
|
|
342
|
+
handler as any,
|
|
343
|
+
false
|
|
344
|
+
))
|
|
337
345
|
})
|
|
338
346
|
|
|
339
347
|
/**
|
|
@@ -715,11 +715,11 @@ function getEncodePayloadSchemaFromBody(
|
|
|
715
715
|
const encoding = HttpApiSchema.getPayloadEncoding(ast, method)
|
|
716
716
|
const out = $HttpBody.pipe(Schema.decodeTo(
|
|
717
717
|
schema,
|
|
718
|
-
Transformation.transformOrFail({
|
|
718
|
+
Transformation.transformOrFail<unknown, HttpBody.HttpBody>({
|
|
719
719
|
decode(httpBody) {
|
|
720
720
|
return Effect.fail(new Issue.Forbidden(Option.some(httpBody), { message: "Encode only schema" }))
|
|
721
721
|
},
|
|
722
|
-
encode(t
|
|
722
|
+
encode(t) {
|
|
723
723
|
switch (encoding._tag) {
|
|
724
724
|
case "Multipart":
|
|
725
725
|
return Effect.fail(new Issue.Forbidden(Option.some(t), { message: "Payload must be a FormData" }))
|
|
@@ -279,6 +279,7 @@ export const Service = <
|
|
|
279
279
|
const creationError = new Err()
|
|
280
280
|
Err.stackTraceLimit = limit
|
|
281
281
|
|
|
282
|
+
/** @effect-diagnostics-next-line classSelfMismatch:off */
|
|
282
283
|
class Service extends Context.Service<Self, any>()(id) {}
|
|
283
284
|
const self = Service as any
|
|
284
285
|
Object.defineProperty(Service, "stack", {
|
|
@@ -78,17 +78,96 @@ export type ResponseEncoding = {
|
|
|
78
78
|
readonly contentType: string
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
const statusCodeByLiteral = {
|
|
82
|
+
Continue: 100,
|
|
83
|
+
SwitchingProtocols: 101,
|
|
84
|
+
Processing: 102,
|
|
85
|
+
EarlyHints: 103,
|
|
86
|
+
OK: 200,
|
|
87
|
+
Ok: 200,
|
|
88
|
+
Created: 201,
|
|
89
|
+
Accepted: 202,
|
|
90
|
+
NonAuthoritativeInformation: 203,
|
|
91
|
+
NoContent: 204,
|
|
92
|
+
ResetContent: 205,
|
|
93
|
+
PartialContent: 206,
|
|
94
|
+
MultiStatus: 207,
|
|
95
|
+
AlreadyReported: 208,
|
|
96
|
+
ImUsed: 226,
|
|
97
|
+
MultipleChoices: 300,
|
|
98
|
+
MovedPermanently: 301,
|
|
99
|
+
Found: 302,
|
|
100
|
+
SeeOther: 303,
|
|
101
|
+
NotModified: 304,
|
|
102
|
+
TemporaryRedirect: 307,
|
|
103
|
+
PermanentRedirect: 308,
|
|
104
|
+
BadRequest: 400,
|
|
105
|
+
Unauthorized: 401,
|
|
106
|
+
PaymentRequired: 402,
|
|
107
|
+
Forbidden: 403,
|
|
108
|
+
NotFound: 404,
|
|
109
|
+
MethodNotAllowed: 405,
|
|
110
|
+
NotAcceptable: 406,
|
|
111
|
+
ProxyAuthenticationRequired: 407,
|
|
112
|
+
RequestTimeout: 408,
|
|
113
|
+
Conflict: 409,
|
|
114
|
+
Gone: 410,
|
|
115
|
+
LengthRequired: 411,
|
|
116
|
+
PreconditionFailed: 412,
|
|
117
|
+
PayloadTooLarge: 413,
|
|
118
|
+
UriTooLong: 414,
|
|
119
|
+
UnsupportedMediaType: 415,
|
|
120
|
+
RangeNotSatisfiable: 416,
|
|
121
|
+
ExpectationFailed: 417,
|
|
122
|
+
ImATeapot: 418,
|
|
123
|
+
MisdirectedRequest: 421,
|
|
124
|
+
UnprocessableEntity: 422,
|
|
125
|
+
Locked: 423,
|
|
126
|
+
FailedDependency: 424,
|
|
127
|
+
TooEarly: 425,
|
|
128
|
+
UpgradeRequired: 426,
|
|
129
|
+
PreconditionRequired: 428,
|
|
130
|
+
TooManyRequests: 429,
|
|
131
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
132
|
+
UnavailableForLegalReasons: 451,
|
|
133
|
+
InternalServerError: 500,
|
|
134
|
+
NotImplemented: 501,
|
|
135
|
+
BadGateway: 502,
|
|
136
|
+
ServiceUnavailable: 503,
|
|
137
|
+
GatewayTimeout: 504,
|
|
138
|
+
HttpVersionNotSupported: 505,
|
|
139
|
+
VariantAlsoNegotiates: 506,
|
|
140
|
+
InsufficientStorage: 507,
|
|
141
|
+
LoopDetected: 508,
|
|
142
|
+
NotExtended: 510,
|
|
143
|
+
NetworkAuthenticationRequired: 511
|
|
144
|
+
} as const
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Common HTTP status code literals accepted by {@link status}.
|
|
148
|
+
*
|
|
149
|
+
* @category status
|
|
150
|
+
* @since 4.0.0
|
|
151
|
+
*/
|
|
152
|
+
export type StatusLiteral = keyof typeof statusCodeByLiteral
|
|
153
|
+
|
|
81
154
|
/**
|
|
82
155
|
* A convenience function to set the HTTP status code of a schema.
|
|
83
156
|
*
|
|
84
157
|
* This is equivalent to calling `.annotate({ httpApiStatus: code })` on the schema.
|
|
85
158
|
*
|
|
159
|
+
* You can pass either a numeric status code (for example, `201`) or a common
|
|
160
|
+
* literal name (for example, `"Created"`).
|
|
161
|
+
*
|
|
86
162
|
* @category status
|
|
87
163
|
* @since 4.0.0
|
|
88
164
|
*/
|
|
89
|
-
export function status(code: number)
|
|
165
|
+
export function status(code: number): <S extends Schema.Top>(self: S) => S["Rebuild"]
|
|
166
|
+
export function status(code: StatusLiteral): <S extends Schema.Top>(self: S) => S["Rebuild"]
|
|
167
|
+
export function status(code: number | StatusLiteral) {
|
|
168
|
+
const statusCode = typeof code === "string" ? statusCodeByLiteral[code] : code
|
|
90
169
|
return <S extends Schema.Top>(self: S): S["Rebuild"] => {
|
|
91
|
-
return self.annotate({ httpApiStatus:
|
|
170
|
+
return self.annotate({ httpApiStatus: statusCode })
|
|
92
171
|
}
|
|
93
172
|
}
|
|
94
173
|
|
|
@@ -61,6 +61,7 @@ export const make: (
|
|
|
61
61
|
let disabledUntil: number | undefined = undefined
|
|
62
62
|
|
|
63
63
|
const client = HttpClient.filterStatusOk(Context.get(services, HttpClient.HttpClient)).pipe(
|
|
64
|
+
HttpClient.transformResponse(Effect.provideService(HttpClient.TracerPropagationEnabled, false)),
|
|
64
65
|
HttpClient.retryTransient({ schedule: policy, times: 3 })
|
|
65
66
|
)
|
|
66
67
|
|
|
@@ -2201,7 +2201,7 @@ export const kvs = <S extends Schema.Codec<any, any>, const Mode extends "sync"
|
|
|
2201
2201
|
*/
|
|
2202
2202
|
export const searchParam = <S extends Schema.Codec<any, string> = never>(name: string, options?: {
|
|
2203
2203
|
readonly schema?: S | undefined
|
|
2204
|
-
}): Writable<S extends never ? string : Option.Option<S["Type"]>> => {
|
|
2204
|
+
}): Writable<[S] extends [never] ? string : Option.Option<S["Type"]>> => {
|
|
2205
2205
|
const decode = options?.schema && Schema.decodeExit(options.schema)
|
|
2206
2206
|
const encode = options?.schema && Schema.encodeExit(options.schema)
|
|
2207
2207
|
return writable(
|
|
@@ -179,10 +179,10 @@ export const Service = <Self>() =>
|
|
|
179
179
|
Effect.fnUntraced(function*({ headers, payload, reactivityKeys }) {
|
|
180
180
|
const client = yield* self
|
|
181
181
|
const effect = client(tag, payload, { headers } as any)
|
|
182
|
-
return yield* reactivityKeys
|
|
183
|
-
? Reactivity.mutation(effect, reactivityKeys)
|
|
184
|
-
: effect
|
|
185
|
-
})
|
|
182
|
+
return yield* (reactivityKeys
|
|
183
|
+
? Reactivity.mutation(effect, reactivityKeys) as Effect.Effect<any>
|
|
184
|
+
: effect as any as Effect.Effect<any>)
|
|
185
|
+
})
|
|
186
186
|
).pipe(
|
|
187
187
|
Atom.serializable({
|
|
188
188
|
key: `AtomRpc:mutation:${tag}`,
|
|
@@ -43,6 +43,13 @@ export interface RpcGroup<in out R extends Rpc.Any> extends Pipeable {
|
|
|
43
43
|
...groups: Groups
|
|
44
44
|
): RpcGroup<R | Rpcs<Groups[number]>>
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Omit one or more procedures from the group.
|
|
48
|
+
*/
|
|
49
|
+
omit<const Tags extends ReadonlyArray<R["_tag"]>>(
|
|
50
|
+
...tags: Tags
|
|
51
|
+
): RpcGroup<Exclude<R, { readonly _tag: Tags[number] }>>
|
|
52
|
+
|
|
46
53
|
/**
|
|
47
54
|
* Add middleware to all the procedures added to the group until this point.
|
|
48
55
|
*/
|
|
@@ -242,6 +249,16 @@ const RpcGroupProto = {
|
|
|
242
249
|
annotations: Context.makeUnsafe(annotations)
|
|
243
250
|
})
|
|
244
251
|
},
|
|
252
|
+
omit(this: RpcGroup<any>, ...tags: Array<string>) {
|
|
253
|
+
const requests = new Map(this.requests)
|
|
254
|
+
for (const tag of tags) {
|
|
255
|
+
requests.delete(tag)
|
|
256
|
+
}
|
|
257
|
+
return makeProto({
|
|
258
|
+
requests,
|
|
259
|
+
annotations: this.annotations
|
|
260
|
+
})
|
|
261
|
+
},
|
|
245
262
|
middleware(this: RpcGroup<any>, middleware: RpcMiddleware.AnyService) {
|
|
246
263
|
const requests = new Map<string, any>()
|
|
247
264
|
for (const [tag, rpc] of this.requests) {
|
|
@@ -316,7 +316,10 @@ export const make = <
|
|
|
316
316
|
})
|
|
317
317
|
},
|
|
318
318
|
execute: Effect.fnUntraced(
|
|
319
|
-
function
|
|
319
|
+
function*<const Discard extends boolean = false>(
|
|
320
|
+
fields: any,
|
|
321
|
+
opts?: { readonly discard?: Discard } | undefined
|
|
322
|
+
) {
|
|
320
323
|
const payload = self.payloadSchema.make(fields)
|
|
321
324
|
const engine = yield* EngineTag
|
|
322
325
|
const executionId = yield* makeExecutionId(payload)
|
|
@@ -376,7 +379,7 @@ export const make = <
|
|
|
376
379
|
),
|
|
377
380
|
executionId: (payload) =>
|
|
378
381
|
Effect.flatMap(
|
|
379
|
-
Effect.
|
|
382
|
+
Effect.orDie(self.payloadSchema.makeEffect(payload)),
|
|
380
383
|
makeExecutionId
|
|
381
384
|
),
|
|
382
385
|
withCompensation
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommandDescriptor.d.ts","sourceRoot":"","sources":["../../../../../src/unstable/cli/internal/completions/CommandDescriptor.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommandDescriptor.js","names":["Option","Param","Primitive","toImpl","toFlagType","single","tag","primitiveType","_tag","keys","getChoiceKeys","values","typeName","pathType","toArgumentType","fromCommand","cmd","impl","config","flags","flag","singles","extractSingleParams","kind","push","name","aliases","description","getOrUndefined","type","args","arg","arguments","metadata","getParamMetadata","required","isOptional","variadic","isVariadic","subcommands","group","subcommand","commands","shortDescription"],"sources":["../../../../../src/unstable/cli/internal/completions/CommandDescriptor.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;AAMA,OAAO,KAAKA,MAAM,MAAM,uBAAuB;AAE/C,OAAO,KAAKC,KAAK,MAAM,gBAAgB;AACvC,OAAO,KAAKC,SAAS,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