@effect-app/infra 0.133.0-next.3 → 0.133.0-next.31
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/CHANGELOG.md +250 -0
- package/_cjs/RequestContext.cjs +8 -10
- package/_cjs/RequestContext.cjs.map +1 -1
- package/_cjs/_global.ext.cjs +1 -25
- package/_cjs/_global.ext.cjs.map +1 -1
- package/_cjs/_global.schema.cjs +1 -1
- package/_cjs/api/codec.cjs +1 -1
- package/_cjs/api/codec.cjs.map +1 -1
- package/_cjs/api/express/schema/jwt.cjs +1 -1
- package/_cjs/api/express/schema/routing.cjs +23 -0
- package/_cjs/api/express/schema/routing.cjs.map +1 -0
- package/_cjs/api/setupRequest.cjs +2 -2
- package/_cjs/api/setupRequest.cjs.map +1 -1
- package/_cjs/errors.cjs +5 -1
- package/_cjs/errors.cjs.map +1 -1
- package/_cjs/services/Operations/live.cjs +11 -12
- package/_cjs/services/Operations/live.cjs.map +1 -1
- package/_cjs/services/QueueMaker/memQueue.cjs +10 -11
- package/_cjs/services/QueueMaker/memQueue.cjs.map +1 -1
- package/_cjs/services/QueueMaker/sbqueue.cjs +4 -4
- package/_cjs/services/QueueMaker/sbqueue.cjs.map +1 -1
- package/_cjs/services/QueueMaker/service.cjs +1 -1
- package/_cjs/services/Repository.cjs +2 -2
- package/_cjs/services/Repository.cjs.map +1 -1
- package/_cjs/services/RepositoryBase.cjs.map +1 -1
- package/_cjs/services/RequestContextContainer.cjs +3 -3
- package/_cjs/services/RequestContextContainer.cjs.map +1 -1
- package/_cjs/services/simpledb/redisdb.cjs +1 -1
- package/_cjs/services/simpledb/shared.cjs +1 -1
- package/_cjs/services/simpledb/shared.cjs.map +1 -1
- package/_cjs/test.arbs.cjs +9 -0
- package/_cjs/test.arbs.cjs.map +1 -0
- package/_src/RequestContext.ts +8 -12
- package/_src/_global.ext.ts +2 -27
- package/_src/_global.schema.ts +1 -1
- package/_src/api/codec.ts +1 -1
- package/_src/api/express/schema/jwt.ts +1 -1
- package/_src/api/express/schema/routing.ts +236 -0
- package/_src/errors.ts +5 -1
- package/_src/services/QueueMaker/memQueue.ts +3 -3
- package/_src/services/QueueMaker/sbqueue.ts +3 -3
- package/_src/services/RepositoryBase.ts +5 -5
- package/_src/services/simpledb/redisdb.ts +1 -1
- package/_src/services/simpledb/shared.ts +1 -1
- package/_src/test.arbs.ts +23 -0
- package/dist/RequestContext.d.ts +72 -24
- package/dist/RequestContext.d.ts.map +1 -1
- package/dist/RequestContext.js +10 -12
- package/dist/_global.ext.d.ts +1 -22
- package/dist/_global.ext.d.ts.map +1 -1
- package/dist/_global.ext.js +2 -18
- package/dist/_global.schema.d.ts +1 -1
- package/dist/_global.schema.d.ts.map +1 -1
- package/dist/_global.schema.js +2 -2
- package/dist/api/codec.d.ts +1 -1
- package/dist/api/codec.d.ts.map +1 -1
- package/dist/api/codec.js +2 -2
- package/dist/api/express/schema/jwt.d.ts +1 -1
- package/dist/api/express/schema/jwt.d.ts.map +1 -1
- package/dist/api/express/schema/jwt.js +2 -2
- package/dist/api/express/schema/routing.d.ts +31 -0
- package/dist/api/express/schema/routing.d.ts.map +1 -0
- package/dist/api/express/schema/routing.js +10 -0
- package/dist/api/setupRequest.js +3 -3
- package/dist/errors.d.ts +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +4 -1
- package/dist/services/Emailer/service.d.ts +1 -1
- package/dist/services/Operations/live.js +16 -17
- package/dist/services/Operations/service.d.ts +4 -4
- package/dist/services/Operations/service.d.ts.map +1 -1
- package/dist/services/QueueMaker/memQueue.d.ts +3 -3
- package/dist/services/QueueMaker/memQueue.d.ts.map +1 -1
- package/dist/services/QueueMaker/memQueue.js +10 -11
- package/dist/services/QueueMaker/sbqueue.d.ts +3 -3
- package/dist/services/QueueMaker/sbqueue.d.ts.map +1 -1
- package/dist/services/QueueMaker/sbqueue.js +4 -4
- package/dist/services/QueueMaker/service.d.ts +1 -1
- package/dist/services/QueueMaker/service.js +1 -1
- package/dist/services/Repository.d.ts +1 -1
- package/dist/services/Repository.d.ts.map +1 -1
- package/dist/services/Repository.js +3 -3
- package/dist/services/RepositoryBase.d.ts +6 -6
- package/dist/services/RepositoryBase.d.ts.map +1 -1
- package/dist/services/RepositoryBase.js +1 -1
- package/dist/services/RequestContextContainer.d.ts +3 -3
- package/dist/services/RequestContextContainer.js +3 -3
- package/dist/services/simpledb/cosmosdb.d.ts +2 -2
- package/dist/services/simpledb/diskdb.d.ts +2 -2
- package/dist/services/simpledb/memdb.d.ts +2 -2
- package/dist/services/simpledb/mongodb.d.ts +2 -2
- package/dist/services/simpledb/redisdb.d.ts +8 -4
- package/dist/services/simpledb/redisdb.d.ts.map +1 -1
- package/dist/services/simpledb/redisdb.js +2 -2
- package/dist/services/simpledb/shared.d.ts +7 -3
- package/dist/services/simpledb/shared.d.ts.map +1 -1
- package/dist/services/simpledb/shared.js +2 -2
- package/dist/services/simpledb/simpledb.d.ts +3 -3
- package/dist/test.arbs.d.ts +2 -0
- package/dist/test.arbs.d.ts.map +1 -0
- package/dist/test.arbs.js +6 -0
- package/package.json +26 -6
- package/_src/api/express/schema/routing.ts.bak +0 -241
- package/_src/test.arbs.ts.bak +0 -27
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
import type { REST } from "@effect-app/schema"
|
|
4
|
+
|
|
5
|
+
export type Request<
|
|
6
|
+
M,
|
|
7
|
+
PathA,
|
|
8
|
+
CookieA,
|
|
9
|
+
QueryA,
|
|
10
|
+
BodyA,
|
|
11
|
+
HeaderA,
|
|
12
|
+
ReqA extends PathA & QueryA & BodyA,
|
|
13
|
+
PPath extends `/${string}`
|
|
14
|
+
> = REST.ReqRes<unknown, ReqA> & {
|
|
15
|
+
method: REST.Methods.Rest
|
|
16
|
+
path: PPath
|
|
17
|
+
Cookie?: REST.ReqRes<Record<string, string>, CookieA>
|
|
18
|
+
Path?: REST.ReqRes<Record<string, string>, PathA>
|
|
19
|
+
Body?: REST.ReqRes<unknown, BodyA>
|
|
20
|
+
Query?: REST.ReqRes<Record<string, string>, QueryA>
|
|
21
|
+
Headers?: REST.ReqRes<Record<string, string>, HeaderA>
|
|
22
|
+
Tag: Tag<M, M>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface RouteRequestHandler<
|
|
26
|
+
M,
|
|
27
|
+
PathA,
|
|
28
|
+
CookieA,
|
|
29
|
+
QueryA,
|
|
30
|
+
BodyA,
|
|
31
|
+
HeaderA,
|
|
32
|
+
ReqA extends PathA & QueryA & BodyA,
|
|
33
|
+
ResA,
|
|
34
|
+
PPath extends `/${string}`
|
|
35
|
+
> {
|
|
36
|
+
Request: Request<M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA, PPath>
|
|
37
|
+
Response?: REST.ReqRes<unknown, ResA> // | REST.ReqResSchemed<unknown, ResA>
|
|
38
|
+
ResponseOpenApi?: any
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function asRouteDescriptionAny<R extends RouteDescriptorAny>(i: R) {
|
|
42
|
+
return i as RouteDescriptorAny
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function arrAsRouteDescriptionAny<R extends RouteDescriptorAny>(
|
|
46
|
+
arr: ReadonlyArray<R>
|
|
47
|
+
) {
|
|
48
|
+
return arr.map(asRouteDescriptionAny)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface RouteDescriptor<
|
|
52
|
+
M,
|
|
53
|
+
PathA,
|
|
54
|
+
CookieA,
|
|
55
|
+
QueryA,
|
|
56
|
+
BodyA,
|
|
57
|
+
HeaderA,
|
|
58
|
+
ReqA extends PathA & QueryA & BodyA,
|
|
59
|
+
ResA,
|
|
60
|
+
METHOD extends REST.Methods.Rest = REST.Methods.Rest
|
|
61
|
+
> {
|
|
62
|
+
_tag: "Schema"
|
|
63
|
+
path: `/${string}`
|
|
64
|
+
method: METHOD
|
|
65
|
+
handler: RouteRequestHandler<M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA, ResA, `/${string}`>
|
|
66
|
+
info?: {
|
|
67
|
+
tags: ReadonlyArray<string>
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type RouteDescriptorAny = RouteDescriptor<
|
|
72
|
+
any,
|
|
73
|
+
any,
|
|
74
|
+
any,
|
|
75
|
+
any,
|
|
76
|
+
any,
|
|
77
|
+
any,
|
|
78
|
+
any,
|
|
79
|
+
any
|
|
80
|
+
>
|
|
81
|
+
|
|
82
|
+
export function makeRouteDescriptor<
|
|
83
|
+
M,
|
|
84
|
+
PathA,
|
|
85
|
+
CookieA,
|
|
86
|
+
QueryA,
|
|
87
|
+
BodyA,
|
|
88
|
+
HeaderA,
|
|
89
|
+
ReqA extends PathA & QueryA & BodyA,
|
|
90
|
+
ResA = void,
|
|
91
|
+
METHOD extends REST.Methods.Rest = REST.Methods.Rest
|
|
92
|
+
>(
|
|
93
|
+
path: `/${string}`,
|
|
94
|
+
method: METHOD,
|
|
95
|
+
handler: RouteRequestHandler<
|
|
96
|
+
M,
|
|
97
|
+
PathA,
|
|
98
|
+
CookieA,
|
|
99
|
+
QueryA,
|
|
100
|
+
BodyA,
|
|
101
|
+
HeaderA,
|
|
102
|
+
ReqA,
|
|
103
|
+
ResA,
|
|
104
|
+
`/${string}`
|
|
105
|
+
>
|
|
106
|
+
): RouteDescriptor<
|
|
107
|
+
M,
|
|
108
|
+
PathA,
|
|
109
|
+
CookieA,
|
|
110
|
+
QueryA,
|
|
111
|
+
BodyA,
|
|
112
|
+
HeaderA,
|
|
113
|
+
ReqA,
|
|
114
|
+
ResA,
|
|
115
|
+
METHOD
|
|
116
|
+
> {
|
|
117
|
+
return { path, handler, method, _tag: "Schema" }
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// export function makeFromSchema<ResA>(
|
|
121
|
+
// e: RouteDescriptor<any, any, any, any, any, any, ResA, any>
|
|
122
|
+
// ) {
|
|
123
|
+
// const jsonSchema_ = OpenApi.for
|
|
124
|
+
// const jsonSchema = <E, A>(r: REST.ReqRes<E, A>) => jsonSchema_(r)
|
|
125
|
+
// const { Request: Req, Response: Res_, ResponseOpenApi } = e.handler
|
|
126
|
+
// const r = ResponseOpenApi ?? Res_
|
|
127
|
+
// const Res = r ? S.extractSchema(r) : S.Void
|
|
128
|
+
// // TODO EffectOption.fromNullable(Req.Headers).flatMapOpt(jsonSchema)
|
|
129
|
+
// // TODO: use the path vs body etc serialisation also in the Client.
|
|
130
|
+
// const makeReqQuerySchema = Effect(Option.fromNullable(Req.Query)).flatMap((_) =>
|
|
131
|
+
// _.match({
|
|
132
|
+
// onNone: () => Effect(Option.none),
|
|
133
|
+
// onSome: (_) => jsonSchema(_).map(Option.some)
|
|
134
|
+
// })
|
|
135
|
+
// )
|
|
136
|
+
// const makeReqHeadersSchema = Effect(Option.fromNullable(Req.Headers)).flatMap((_) =>
|
|
137
|
+
// _.match({
|
|
138
|
+
// onNone: () => Effect(Option.none),
|
|
139
|
+
// onSome: (_) => jsonSchema(_).map(Option.some)
|
|
140
|
+
// })
|
|
141
|
+
// )
|
|
142
|
+
// const makeReqCookieSchema = Effect(Option.fromNullable(Req.Cookie)).flatMap((_) =>
|
|
143
|
+
// _.match({
|
|
144
|
+
// onNone: () => Effect(Option.none),
|
|
145
|
+
// onSome: (_) => jsonSchema(_).map(Option.some)
|
|
146
|
+
// })
|
|
147
|
+
// )
|
|
148
|
+
// const makeReqPathSchema = Effect(Option.fromNullable(Req.Path)).flatMap((_) =>
|
|
149
|
+
// _.match({
|
|
150
|
+
// onNone: () => Effect(Option.none),
|
|
151
|
+
// onSome: (_) => jsonSchema(_).map(Option.some)
|
|
152
|
+
// })
|
|
153
|
+
// )
|
|
154
|
+
// const makeReqBodySchema = Effect(Option.fromNullable(Req.Body)).flatMap((_) =>
|
|
155
|
+
// _.match({
|
|
156
|
+
// onNone: () => Effect(Option.none),
|
|
157
|
+
// onSome: (_) => jsonSchema(_).map(Option.some)
|
|
158
|
+
// })
|
|
159
|
+
// )
|
|
160
|
+
// // const makeReqSchema = schema(Req)
|
|
161
|
+
|
|
162
|
+
// const makeResSchema = jsonSchema_(Res)
|
|
163
|
+
|
|
164
|
+
// function makeParameters(inn: ParameterLocation) {
|
|
165
|
+
// return (a: Option<JSONSchema | SubSchema>) => {
|
|
166
|
+
// return a
|
|
167
|
+
// .flatMap((o) => (isObjectSchema(o) ? Option(o) : Option.none))
|
|
168
|
+
// .map((x) => {
|
|
169
|
+
// // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
170
|
+
// return Object.keys(x.properties!).map((p) => {
|
|
171
|
+
// // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
172
|
+
// const schema = x.properties![p]
|
|
173
|
+
// const required = Boolean(x.required?.includes(p))
|
|
174
|
+
// return { name: p, in: inn, required, schema }
|
|
175
|
+
// })
|
|
176
|
+
// })
|
|
177
|
+
// .getOrElse(() => [])
|
|
178
|
+
// }
|
|
179
|
+
// }
|
|
180
|
+
|
|
181
|
+
// return Effect
|
|
182
|
+
// .all({
|
|
183
|
+
// req: jsonSchema(Req.Model),
|
|
184
|
+
// reqQuery: makeReqQuerySchema,
|
|
185
|
+
// reqHeaders: makeReqHeadersSchema,
|
|
186
|
+
// reqBody: makeReqBodySchema,
|
|
187
|
+
// reqPath: makeReqPathSchema,
|
|
188
|
+
// reqCookie: makeReqCookieSchema,
|
|
189
|
+
// res: makeResSchema
|
|
190
|
+
// })
|
|
191
|
+
// .map((_) => {
|
|
192
|
+
// // console.log("$$$ REQ", _.req)
|
|
193
|
+
// const isEmpty = !e.handler.Response || e.handler.Response === S.Void
|
|
194
|
+
// return {
|
|
195
|
+
// path: e.path,
|
|
196
|
+
// method: e.method.toLowerCase(),
|
|
197
|
+
// tags: e.info?.tags,
|
|
198
|
+
// description: _.req?.description,
|
|
199
|
+
// summary: _.req?.summary,
|
|
200
|
+
// operationId: _.req?.title,
|
|
201
|
+
// parameters: [
|
|
202
|
+
// ...makeParameters("path")(_.reqPath),
|
|
203
|
+
// ...makeParameters("query")(_.reqQuery),
|
|
204
|
+
// ...makeParameters("header")(_.reqHeaders),
|
|
205
|
+
// ...makeParameters("cookie")(_.reqCookie)
|
|
206
|
+
// ],
|
|
207
|
+
// requestBody: _
|
|
208
|
+
// .reqBody
|
|
209
|
+
// .map((schema) => ({
|
|
210
|
+
// content: { "application/json": { schema } }
|
|
211
|
+
// }))
|
|
212
|
+
// .value,
|
|
213
|
+
// responses: [
|
|
214
|
+
// isEmpty
|
|
215
|
+
// ? new Response(204, { description: "Empty" })
|
|
216
|
+
// : new Response(200, {
|
|
217
|
+
// description: "OK",
|
|
218
|
+
// content: { "application/json": { schema: _.res } }
|
|
219
|
+
// }),
|
|
220
|
+
// new Response(400, { description: "ValidationError" })
|
|
221
|
+
// ]
|
|
222
|
+
// .concat(
|
|
223
|
+
// e.path.includes(":") && isEmpty
|
|
224
|
+
// ? [new Response(404, { description: "NotFoundError" })]
|
|
225
|
+
// : []
|
|
226
|
+
// )
|
|
227
|
+
// }
|
|
228
|
+
// })
|
|
229
|
+
// }
|
|
230
|
+
|
|
231
|
+
// class Response {
|
|
232
|
+
// constructor(
|
|
233
|
+
// public readonly statusCode: number,
|
|
234
|
+
// public readonly type: any // string | JSONSchema | SubSchema
|
|
235
|
+
// ) {}
|
|
236
|
+
// }
|
package/_src/errors.ts
CHANGED
|
@@ -11,7 +11,11 @@ export class NotFoundError<T extends string = string>
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/** @tsplus type ValidationError */
|
|
14
|
-
export class ValidationError extends Data.TaggedError("ValidationError")<{ errors: ReadonlyArray<unknown> }> {
|
|
14
|
+
export class ValidationError extends Data.TaggedError("ValidationError")<{ errors: ReadonlyArray<unknown> }> {
|
|
15
|
+
override get message() {
|
|
16
|
+
return `Validation failed: ${this.errors.map((e) => JSON.stringify(e)).join(", ")}`
|
|
17
|
+
}
|
|
18
|
+
}
|
|
15
19
|
|
|
16
20
|
/** @tsplus type NotLoggedInError */
|
|
17
21
|
export class NotLoggedInError extends Data.TaggedError("NotLoggedInError")<{ message?: string | undefined }> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MemQueue } from "@effect-app/infra-adapters/memQueue"
|
|
2
2
|
import { RequestContext } from "@effect-app/infra/RequestContext"
|
|
3
|
-
import type {
|
|
3
|
+
import type { S } from "@effect-app/prelude"
|
|
4
4
|
import { RequestId } from "@effect-app/prelude/ids"
|
|
5
5
|
import { Tracer } from "effect"
|
|
6
6
|
import { RequestContextContainer } from "../RequestContextContainer.js"
|
|
@@ -17,8 +17,8 @@ export function makeMemQueue<
|
|
|
17
17
|
>(
|
|
18
18
|
queueName: string,
|
|
19
19
|
queueDrainName: string,
|
|
20
|
-
schema:
|
|
21
|
-
drainSchema:
|
|
20
|
+
schema: S.Schema<EvtE, Evt>,
|
|
21
|
+
drainSchema: S.Schema<unknown, DrainEvt>
|
|
22
22
|
) {
|
|
23
23
|
return Effect.gen(function*($) {
|
|
24
24
|
const mem = yield* $(MemQueue)
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import type {} from "@azure/service-bus"
|
|
10
10
|
import { captureException } from "@effect-app/infra/errorReporter"
|
|
11
11
|
import { RequestContext } from "@effect-app/infra/RequestContext"
|
|
12
|
-
import type {
|
|
12
|
+
import type { S } from "@effect-app/prelude"
|
|
13
13
|
import { RequestId } from "@effect-app/prelude/ids"
|
|
14
14
|
import { struct } from "@effect-app/schema"
|
|
15
15
|
import { Tracer } from "effect"
|
|
@@ -27,8 +27,8 @@ export function makeServiceBusQueue<
|
|
|
27
27
|
>(
|
|
28
28
|
_queueName: string,
|
|
29
29
|
queueDrainName: string,
|
|
30
|
-
schema:
|
|
31
|
-
drainSchema:
|
|
30
|
+
schema: S.Schema<EvtE, Evt>,
|
|
31
|
+
drainSchema: S.Schema<unknown, DrainEvt>
|
|
32
32
|
) {
|
|
33
33
|
const wireSchema = struct({
|
|
34
34
|
body: schema,
|
|
@@ -9,7 +9,7 @@ import type {} from "effect/Hash"
|
|
|
9
9
|
import type { Opt } from "@effect-app/core/Option"
|
|
10
10
|
import { makeCodec } from "@effect-app/infra/api/codec"
|
|
11
11
|
import { makeFilters } from "@effect-app/infra/filter"
|
|
12
|
-
import type {
|
|
12
|
+
import type { S } from "@effect-app/prelude"
|
|
13
13
|
import type { InvalidStateError, OptimisticConcurrencyException } from "../errors.js"
|
|
14
14
|
import { ContextMapContainer } from "./Store/ContextMapContainer.js"
|
|
15
15
|
import { QueryBuilder } from "./Store/filterApi/query.js"
|
|
@@ -91,7 +91,7 @@ export function makeRepo<
|
|
|
91
91
|
From extends { id: string }
|
|
92
92
|
>(
|
|
93
93
|
name: ItemType,
|
|
94
|
-
schema:
|
|
94
|
+
schema: S.Schema<From, T>,
|
|
95
95
|
mapFrom: (pm: Omit<PM, "_etag">) => From,
|
|
96
96
|
mapTo: (e: From, etag: string | undefined) => PM
|
|
97
97
|
) => {
|
|
@@ -301,7 +301,7 @@ export function makeStore<
|
|
|
301
301
|
E extends { id: string }
|
|
302
302
|
>(
|
|
303
303
|
name: ItemType,
|
|
304
|
-
schema:
|
|
304
|
+
schema: S.Schema<E, T>,
|
|
305
305
|
mapTo: (e: E, etag: string | undefined) => PM
|
|
306
306
|
) => {
|
|
307
307
|
const [_dec, encode] = makeCodec(schema)
|
|
@@ -411,7 +411,7 @@ export const RepositoryBaseImpl = <Service>() => {
|
|
|
411
411
|
>() =>
|
|
412
412
|
<ItemType extends string, T extends { id: string }, From extends { id: string }>(
|
|
413
413
|
itemType: ItemType,
|
|
414
|
-
schema:
|
|
414
|
+
schema: S.Schema<From, T>,
|
|
415
415
|
jitM?: (pm: From) => From
|
|
416
416
|
): Exact<PM, From & { _etag: string | undefined }> extends true ?
|
|
417
417
|
& (abstract new() => RepositoryBaseC1<T, PM, Evt, ItemType>)
|
|
@@ -452,7 +452,7 @@ export const RepositoryDefaultImpl = <Service>() => {
|
|
|
452
452
|
>() =>
|
|
453
453
|
<ItemType extends string, T extends { id: string }, From extends { id: string }>(
|
|
454
454
|
itemType: ItemType,
|
|
455
|
-
schema:
|
|
455
|
+
schema: S.Schema<From, T>,
|
|
456
456
|
jitM?: (pm: From) => From
|
|
457
457
|
): Exact<PM, From & { _etag: string | undefined }> extends true ?
|
|
458
458
|
& (abstract new(
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { flow } from "@effect-app/core/Function"
|
|
4
4
|
import { RedisClient } from "@effect-app/infra-adapters/redis-client"
|
|
5
|
-
import * as S from "@effect-app/
|
|
5
|
+
import * as S from "@effect-app/schema"
|
|
6
6
|
import type { Lock } from "redlock"
|
|
7
7
|
import type { CachedRecord, DBRecord, Index } from "./shared.js"
|
|
8
8
|
import { ConnectionException, CouldNotAquireDbLockException, getIndexName, getRecordName } from "./shared.js"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Do not import to frontend
|
|
2
|
+
|
|
3
|
+
import { setFaker } from "@effect-app/prelude/faker"
|
|
4
|
+
import { faker } from "@faker-js/faker"
|
|
5
|
+
|
|
6
|
+
// const rnd = new Random(rand.congruential32(5))
|
|
7
|
+
|
|
8
|
+
setFaker(faker)
|
|
9
|
+
|
|
10
|
+
// /**
|
|
11
|
+
// * @tsplus getter FastCheck generate
|
|
12
|
+
// */
|
|
13
|
+
// export function generate<T>(arb: fc.Arbitrary<T>) {
|
|
14
|
+
// return arb.generate(rnd, undefined)
|
|
15
|
+
// }
|
|
16
|
+
|
|
17
|
+
// /**
|
|
18
|
+
// * @tsplus getter ets/Schema/Arbitrary/Gen generate
|
|
19
|
+
// */
|
|
20
|
+
|
|
21
|
+
// export function generateFromArbitrary<T>(arb: Arbitrary.Gen<T>) {
|
|
22
|
+
// return generate(arb(fc))
|
|
23
|
+
// }
|
package/dist/RequestContext.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useClassFeaturesForSchema, TaggedClass, NonEmptyString255, FromClass } from "@effect-app/
|
|
2
|
-
import {
|
|
3
|
-
declare const RequestContextParent_base:
|
|
1
|
+
import { useClassFeaturesForSchema, TaggedClass, NonEmptyString255, struct, literal, FromClass } from "@effect-app/schema";
|
|
2
|
+
import { S } from "@effect-app/prelude";
|
|
3
|
+
declare const RequestContextParent_base: S.Class<{
|
|
4
4
|
readonly _tag: "RequestContext";
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly name: string;
|
|
@@ -11,31 +11,49 @@ declare const RequestContextParent_base: Schema2.Class<{
|
|
|
11
11
|
} | undefined;
|
|
12
12
|
}, {
|
|
13
13
|
readonly _tag: "RequestContext";
|
|
14
|
-
readonly id:
|
|
15
|
-
readonly name: string &
|
|
14
|
+
readonly id: S.NonEmptyString255;
|
|
15
|
+
readonly name: string & S.NonEmptyString255Brand;
|
|
16
16
|
readonly locale: "en" | "de";
|
|
17
17
|
readonly createdAt: Date;
|
|
18
18
|
readonly userProfile?: {
|
|
19
19
|
readonly sub: string & import("@effect-app/prelude/ids").UserProfileIdBrand;
|
|
20
20
|
} | undefined;
|
|
21
21
|
}, {
|
|
22
|
-
readonly name: string &
|
|
22
|
+
readonly name: string & S.NonEmptyString255Brand;
|
|
23
23
|
readonly locale: "en" | "de";
|
|
24
24
|
readonly userProfile?: {
|
|
25
25
|
readonly sub: string & import("@effect-app/prelude/ids").UserProfileIdBrand;
|
|
26
26
|
} | undefined;
|
|
27
|
-
readonly id?:
|
|
27
|
+
readonly id?: S.NonEmptyString255;
|
|
28
28
|
readonly createdAt?: Date;
|
|
29
|
-
}, RequestContextParent,
|
|
29
|
+
}, RequestContextParent, {
|
|
30
|
+
id: S.WithDefaults<S.Schema<string, S.NonEmptyString255> & {
|
|
31
|
+
make: () => S.NonEmptyString255;
|
|
32
|
+
withDefault: () => S.Schema<string, S.NonEmptyString255> & S.ConstructorPropertyDescriptor<string, S.NonEmptyString255>;
|
|
33
|
+
}> & S.Schema<string, S.NonEmptyString255> & {
|
|
34
|
+
make: () => S.NonEmptyString255;
|
|
35
|
+
withDefault: () => S.Schema<string, S.NonEmptyString255> & S.ConstructorPropertyDescriptor<string, S.NonEmptyString255>;
|
|
36
|
+
};
|
|
37
|
+
name: S.WithDefaults<S.Schema<string, string & S.NonEmptyString255Brand>> & S.Schema<string, string & S.NonEmptyString255Brand>;
|
|
38
|
+
userProfile: S.PropertySignature<{
|
|
39
|
+
readonly sub: string;
|
|
40
|
+
} | undefined, true, {
|
|
41
|
+
readonly sub: string & import("@effect-app/prelude/ids").UserProfileIdBrand;
|
|
42
|
+
} | undefined, true>;
|
|
43
|
+
locale: S.Schema<"en" | "de", "en" | "de"> & {
|
|
44
|
+
literals: ["en", "de"];
|
|
45
|
+
};
|
|
46
|
+
createdAt: S.Schema<string, Date> & S.ConstructorPropertyDescriptor<string, Date>;
|
|
47
|
+
}, import("effect/Data").Case>;
|
|
30
48
|
export declare class RequestContextParent extends RequestContextParent_base {
|
|
31
49
|
}
|
|
32
|
-
declare const RequestContext_base:
|
|
50
|
+
declare const RequestContext_base: S.Class<{
|
|
33
51
|
readonly _tag: "RequestContext";
|
|
34
52
|
readonly id: string;
|
|
35
|
-
readonly rootId: string;
|
|
36
53
|
readonly name: string;
|
|
37
54
|
readonly locale: "en" | "de";
|
|
38
55
|
readonly createdAt: string;
|
|
56
|
+
readonly rootId: string;
|
|
39
57
|
readonly userProfile?: {
|
|
40
58
|
readonly sub: string;
|
|
41
59
|
} | undefined;
|
|
@@ -52,28 +70,58 @@ declare const RequestContext_base: Schema2.Class<{
|
|
|
52
70
|
readonly namespace?: string | undefined;
|
|
53
71
|
}, {
|
|
54
72
|
readonly _tag: "RequestContext";
|
|
55
|
-
readonly id:
|
|
56
|
-
readonly
|
|
57
|
-
readonly name: string & Schema2.NonEmptyString255Brand;
|
|
73
|
+
readonly id: S.NonEmptyString255;
|
|
74
|
+
readonly name: string & S.NonEmptyString255Brand;
|
|
58
75
|
readonly locale: "en" | "de";
|
|
59
76
|
readonly createdAt: Date;
|
|
77
|
+
readonly rootId: S.NonEmptyString255;
|
|
60
78
|
readonly userProfile?: {
|
|
61
79
|
readonly sub: string & import("@effect-app/prelude/ids").UserProfileIdBrand;
|
|
62
80
|
} | undefined;
|
|
63
81
|
readonly parent?: RequestContextParent | undefined;
|
|
64
|
-
readonly namespace?: (string &
|
|
82
|
+
readonly namespace?: (string & S.NonEmptyString255Brand) | undefined;
|
|
65
83
|
}, {
|
|
66
|
-
readonly name: string &
|
|
84
|
+
readonly name: string & S.NonEmptyString255Brand;
|
|
67
85
|
readonly locale: "en" | "de";
|
|
68
86
|
readonly userProfile?: {
|
|
69
87
|
readonly sub: string & import("@effect-app/prelude/ids").UserProfileIdBrand;
|
|
70
88
|
} | undefined;
|
|
71
89
|
readonly parent?: RequestContextParent | undefined;
|
|
72
|
-
readonly namespace?: (string &
|
|
73
|
-
readonly id?:
|
|
74
|
-
readonly rootId?: string & Schema2.StringIdBrand;
|
|
90
|
+
readonly namespace?: (string & S.NonEmptyString255Brand) | undefined;
|
|
91
|
+
readonly id?: S.NonEmptyString255;
|
|
75
92
|
readonly createdAt?: Date;
|
|
76
|
-
|
|
93
|
+
readonly rootId?: S.NonEmptyString255;
|
|
94
|
+
}, RequestContext, {
|
|
95
|
+
id: S.Schema<string, S.NonEmptyString255> & S.ConstructorPropertyDescriptor<string, S.NonEmptyString255>;
|
|
96
|
+
rootId: S.WithDefaults<S.Schema<string, S.NonEmptyString255> & {
|
|
97
|
+
make: () => S.NonEmptyString255;
|
|
98
|
+
withDefault: () => S.Schema<string, S.NonEmptyString255> & S.ConstructorPropertyDescriptor<string, S.NonEmptyString255>;
|
|
99
|
+
}> & S.Schema<string, S.NonEmptyString255> & {
|
|
100
|
+
make: () => S.NonEmptyString255;
|
|
101
|
+
withDefault: () => S.Schema<string, S.NonEmptyString255> & S.ConstructorPropertyDescriptor<string, S.NonEmptyString255>;
|
|
102
|
+
};
|
|
103
|
+
parent: S.PropertySignature<{
|
|
104
|
+
readonly _tag: "RequestContext";
|
|
105
|
+
readonly id: string;
|
|
106
|
+
readonly name: string;
|
|
107
|
+
readonly locale: "en" | "de";
|
|
108
|
+
readonly createdAt: string;
|
|
109
|
+
readonly userProfile?: {
|
|
110
|
+
readonly sub: string;
|
|
111
|
+
} | undefined;
|
|
112
|
+
} | undefined, true, RequestContextParent | undefined, true>;
|
|
113
|
+
namespace: S.PropertySignature<string | undefined, true, (string & S.NonEmptyString255Brand) | undefined, true>;
|
|
114
|
+
name: S.WithDefaults<S.Schema<string, string & S.NonEmptyString255Brand>> & S.Schema<string, string & S.NonEmptyString255Brand>;
|
|
115
|
+
userProfile: S.PropertySignature<{
|
|
116
|
+
readonly sub: string;
|
|
117
|
+
} | undefined, true, {
|
|
118
|
+
readonly sub: string & import("@effect-app/prelude/ids").UserProfileIdBrand;
|
|
119
|
+
} | undefined, true>;
|
|
120
|
+
locale: S.Schema<"en" | "de", "en" | "de"> & {
|
|
121
|
+
literals: ["en", "de"];
|
|
122
|
+
};
|
|
123
|
+
createdAt: S.Schema<string, Date> & S.ConstructorPropertyDescriptor<string, Date>;
|
|
124
|
+
}, import("effect/Data").Case>;
|
|
77
125
|
/**
|
|
78
126
|
* @tsplus type RequestContext
|
|
79
127
|
* @tsplus companion RequestContext.Ops
|
|
@@ -81,14 +129,14 @@ declare const RequestContext_base: Schema2.Class<{
|
|
|
81
129
|
export declare class RequestContext extends RequestContext_base {
|
|
82
130
|
static inherit(this: void, parent: RequestContext, newSelf: ConstructorParameters<typeof RequestContextParent>[0]): RequestContext;
|
|
83
131
|
static toMonitoring(this: void, self: RequestContext): {
|
|
84
|
-
parentOperationName?: string &
|
|
132
|
+
parentOperationName?: string & S.NonEmptyString255Brand;
|
|
85
133
|
parentLocale?: "en" | "de";
|
|
86
|
-
operationName: string &
|
|
134
|
+
operationName: string & S.NonEmptyString255Brand;
|
|
87
135
|
locale: "en" | "de";
|
|
88
136
|
};
|
|
89
137
|
}
|
|
90
138
|
export declare namespace RequestContextParent {
|
|
91
|
-
const From_base:
|
|
139
|
+
const From_base: S.FromClass<{
|
|
92
140
|
readonly _tag: "RequestContext";
|
|
93
141
|
readonly id: string;
|
|
94
142
|
readonly name: string;
|
|
@@ -107,13 +155,13 @@ export declare namespace RequestContextParent {
|
|
|
107
155
|
export {};
|
|
108
156
|
}
|
|
109
157
|
export declare namespace RequestContext {
|
|
110
|
-
const From_base_1:
|
|
158
|
+
const From_base_1: S.FromClass<{
|
|
111
159
|
readonly _tag: "RequestContext";
|
|
112
160
|
readonly id: string;
|
|
113
|
-
readonly rootId: string;
|
|
114
161
|
readonly name: string;
|
|
115
162
|
readonly locale: "en" | "de";
|
|
116
163
|
readonly createdAt: string;
|
|
164
|
+
readonly rootId: string;
|
|
117
165
|
readonly userProfile?: {
|
|
118
166
|
readonly sub: string;
|
|
119
167
|
} | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestContext.d.ts","sourceRoot":"","sources":["../_src/RequestContext.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"RequestContext.d.ts","sourceRoot":"","sources":["../_src/RequestContext.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGvC,qBACa,oBAAqB,SAAQ,yBAQxC;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEL;;;GAGG;AACH,qBACa,cAAe,SAAQ,mBAclC;IACA,MAAM,CAAC,OAAO,CACZ,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,qBAAqB,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAUhE,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc;;;;;;CASrD;AAKD,yBAAiB,oBAAoB,CAAC;;;;;;;;;;;IACpC;;;OAGG;IACH,MAAM,OAAO,IAAK,SAAQ,SAAwC;KAAG;;CACtE;AACD,yBAAiB,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;IAC9B;;;OAGG;IACH,MAAM,OAAO,IAAK,SAAQ,WAAkC;KAAG;;CAChE"}
|
package/dist/RequestContext.js
CHANGED
|
@@ -5,19 +5,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
var RequestContext_1;
|
|
8
|
-
import * as tsplus_module_1 from "@effect-app/
|
|
8
|
+
import * as tsplus_module_1 from "@effect-app/schema";
|
|
9
9
|
import * as tsplus_module_2 from "@effect/schema/Schema";
|
|
10
|
-
import
|
|
10
|
+
import * as tsplus_module_3 from "@effect-app/prelude/utils";
|
|
11
|
+
import { S } from "@effect-app/prelude";
|
|
11
12
|
import { RequestId, UserProfileId } from "@effect-app/prelude/ids";
|
|
12
|
-
|
|
13
|
+
let RequestContextParent = class RequestContextParent extends tsplus_module_1.TaggedClass()("RequestContext", {
|
|
14
|
+
id: RequestId,
|
|
13
15
|
name: tsplus_module_1.NonEmptyString255,
|
|
14
16
|
userProfile: tsplus_module_2.optional(tsplus_module_1.struct({ sub: UserProfileId })),
|
|
15
17
|
locale: tsplus_module_1.literal("en", "de"),
|
|
16
|
-
createdAt: tsplus_module_2.withDefaultConstructor(
|
|
17
|
-
};
|
|
18
|
-
let RequestContextParent = class RequestContextParent extends tsplus_module_1.TaggedClass()("RequestContext", {
|
|
19
|
-
id: RequestId,
|
|
20
|
-
...fields
|
|
18
|
+
createdAt: tsplus_module_2.withDefaultConstructor(S.Date, () => new Date()) // TODO
|
|
21
19
|
}) {
|
|
22
20
|
};
|
|
23
21
|
RequestContextParent = __decorate([
|
|
@@ -28,12 +26,12 @@ export { RequestContextParent };
|
|
|
28
26
|
* @tsplus type RequestContext
|
|
29
27
|
* @tsplus companion RequestContext.Ops
|
|
30
28
|
*/
|
|
31
|
-
let RequestContext = RequestContext_1 = class RequestContext extends
|
|
29
|
+
let RequestContext = RequestContext_1 = class RequestContext extends S.TaggedClass()("RequestContext", {
|
|
30
|
+
...tsplus_module_3.RecordOmitold(tsplus_module_3.object$(RequestContextParent.fields), "id"),
|
|
32
31
|
id: RequestId.withDefault(),
|
|
33
32
|
rootId: RequestId,
|
|
34
33
|
parent: tsplus_module_2.optional(RequestContextParent),
|
|
35
|
-
namespace: tsplus_module_2.optional(tsplus_module_1.NonEmptyString255)
|
|
36
|
-
...fields
|
|
34
|
+
namespace: tsplus_module_2.optional(tsplus_module_1.NonEmptyString255)
|
|
37
35
|
// ...RequestContextParent.omit("id").extend({
|
|
38
36
|
// id: RequestId.withDefault(),
|
|
39
37
|
// rootId: RequestId,
|
|
@@ -84,4 +82,4 @@ export { RequestContext };
|
|
|
84
82
|
}
|
|
85
83
|
RequestContext.From = From;
|
|
86
84
|
})(RequestContext || (RequestContext = {}));
|
|
87
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
85
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVxdWVzdENvbnRleHQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9fc3JjL1JlcXVlc3RDb250ZXh0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSxPQUFPLEVBQUUsQ0FBQyxFQUFFLE1BQU0scUJBQXFCLENBQUE7QUFDdkMsT0FBTyxFQUFFLFNBQVMsRUFBRSxhQUFhLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQTtBQUczRCxJQUFNLG9CQUFvQixHQUExQixNQUFNLG9CQUFxQixTQUFRLGdCQUFBLFdBQVcsRUFFbEQsQ0FBQyxnQkFBZ0IsRUFBRTtJQUNwQixFQUFFLEVBQUUsU0FBUztJQUNiLElBQUksa0JBQUUsaUJBQWlCO0lBQ3ZCLFdBQVcsRUFBRSx5QkFBQSxnQkFBQSxNQUFNLENBQUMsRUFBRSxHQUFHLEVBQUUsYUFBYSxFQUFFLENBQUMsQ0FBVztJQUN0RCxNQUFNLEVBQUUsZ0JBQUEsT0FBTyxDQUFDLElBQUksRUFBRSxJQUFJLENBQUM7SUFDM0IsU0FBUyxFQUFFLHVDQUFBLENBQUMsQ0FBQyxJQUFJLEVBQWlCLEdBQUcsRUFBRSxDQUFDLElBQUksSUFBSSxFQUFFLENBQUMsQ0FBQyxPQUFPO0NBQzVELENBQUM7Q0FBRyxDQUFBO0FBUlEsb0JBQW9CO29CQURoQyx5QkFBeUI7R0FDYixvQkFBb0IsQ0FRNUI7O0FBRUw7OztHQUdHO0FBRUksSUFBTSxjQUFjLHNCQUFwQixNQUFNLGNBQWUsU0FBUSxDQUFDLENBQUMsV0FBVyxFQUU5QyxDQUFDLGdCQUFnQixFQUFFO0lBQ3BCLEdBQUcsc0RBQUEsb0JBQW9CLENBQUMsTUFBTSxHQUFTLElBQUksQ0FBQztJQUM1QyxFQUFFLEVBQUUsU0FBUyxDQUFDLFdBQVcsRUFBRTtJQUMzQixNQUFNLEVBQUUsU0FBUztJQUNqQixNQUFNLEVBQUUseUJBQUEsb0JBQW9CLENBQVc7SUFDdkMsU0FBUyxFQUFFLHlDQUFBLGlCQUFpQixDQUFXO0lBQ3ZDLDhDQUE4QztJQUM5QyxpQ0FBaUM7SUFDakMsdUJBQXVCO0lBQ3ZCLDZDQUE2QztJQUM3Qyw0Q0FBNEM7SUFDNUMsS0FBSztDQUNOLENBQUM7SUFDQSxNQUFNLENBQUMsT0FBTyxDQUVaLE1BQXNCLEVBQ3RCLE9BQThEO1FBRTlELE9BQU8sSUFBSSxnQkFBYyxDQUFDO1lBQ3hCLFNBQVMsRUFBRSxNQUFNLEVBQUUsU0FBUztZQUM1QixHQUFHLE9BQU87WUFDVixNQUFNLEVBQUUsTUFBTSxDQUFDLE1BQU07WUFDckIsTUFBTTtTQUNQLENBQUMsQ0FBQTtJQUNKLENBQUM7SUFFRCxNQUFNLENBQUMsWUFBWSxDQUFhLElBQW9CO1FBQ2xELE9BQU87WUFDTCxhQUFhLEVBQUUsSUFBSSxDQUFDLElBQUk7WUFDeEIsTUFBTSxFQUFFLElBQUksQ0FBQyxNQUFNO1lBQ25CLEdBQUcsQ0FBQyxJQUFJLENBQUMsTUFBTTtnQkFDYixDQUFDLENBQUMsRUFBRSxtQkFBbUIsRUFBRSxJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxZQUFZLEVBQUUsSUFBSSxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUU7Z0JBQzdFLENBQUMsQ0FBQyxFQUFFLENBQUM7U0FDUixDQUFBO0lBQ0gsQ0FBQztDQUNGLENBQUE7QUFyQ1ksY0FBYztvQkFEMUIseUJBQXlCO0dBQ2IsY0FBYyxDQXFDMUI7O0FBRUQsZ0NBQWdDO0FBQ2hDLEVBQUU7QUFDRixvQkFBb0I7QUFDcEIsV0FBaUIsb0JBQW9CO0lBQ25DOzs7T0FHRztJQUNILE1BQWEsSUFBSyxTQUFRLGdCQUFBLFNBQVMsRUFBK0I7S0FBRztJQUF4RCx5QkFBSSxPQUFvRCxDQUFBO0FBQ3ZFLENBQUMsRUFOZ0Isb0JBQW9CLEtBQXBCLG9CQUFvQixRQU1wQztBQUNELFdBQWlCLGNBQWM7SUFDN0I7OztPQUdHO0lBQ0gsTUFBYSxJQUFLLFNBQVEsZ0JBQUEsU0FBUyxFQUF5QjtLQUFHO0lBQWxELG1CQUFJLE9BQThDLENBQUE7QUFDakUsQ0FBQyxFQU5nQixjQUFjLEtBQWQsY0FBYyxRQU05QiJ9
|
package/dist/_global.ext.d.ts
CHANGED
|
@@ -30,26 +30,5 @@ import type {} from "@effect-app/infra/api/setupRequest";
|
|
|
30
30
|
* @tsplus global
|
|
31
31
|
*/
|
|
32
32
|
import {} from "@effect-app/infra/api/reportError";
|
|
33
|
-
import
|
|
34
|
-
import type { ParseOptions } from "@effect/schema/AST";
|
|
35
|
-
/**
|
|
36
|
-
* @tsplus fluent effect/schema/Schema withDefault
|
|
37
|
-
* @tsplus location "@effect-app/infra/_global.ext"
|
|
38
|
-
*/
|
|
39
|
-
export declare const defaultDate: <From>(s: S.Schema<From, Date>) => S.ConstructorPropertyDescriptor<From, Date>;
|
|
40
|
-
/**
|
|
41
|
-
* @tsplus fluent effect/schema/Schema withDefault
|
|
42
|
-
* @tsplus location "@effect-app/infra/_global.ext"
|
|
43
|
-
*/
|
|
44
|
-
export declare const defaultNullable: <From, To>(s: S.Schema<From, To | null>) => S.ConstructorPropertyDescriptor<From, To | null>;
|
|
45
|
-
/**
|
|
46
|
-
* @tsplus fluent effect/schema/Schema withDefault
|
|
47
|
-
* @tsplus location "@effect-app/infra/_global.ext"
|
|
48
|
-
*/
|
|
49
|
-
export declare const defaultArray: <From, T>(s: S.Schema<From, ReadonlyArray<T>>) => S.ConstructorPropertyDescriptor<From, readonly T[]>;
|
|
50
|
-
/**
|
|
51
|
-
* @tsplus fluent effect/schema/Schema __call
|
|
52
|
-
* @tsplus location "@effect-app/infra/_global.ext"
|
|
53
|
-
*/
|
|
54
|
-
export declare const parseSync: <I, A>(self: S.Schema<I, A>, u: I, options?: ParseOptions | undefined) => A;
|
|
33
|
+
import "@effect-app/infra/test.arbs";
|
|
55
34
|
//# sourceMappingURL=_global.ext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_global.ext.d.ts","sourceRoot":"","sources":["../_src/_global.ext.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,yCAAyC,CAAA;AAC7D;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,6CAA6C,CAAA;AACjE;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,4CAA4C,CAAA;AAChE;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,8CAA8C,CAAA;
|
|
1
|
+
{"version":3,"file":"_global.ext.d.ts","sourceRoot":"","sources":["../_src/_global.ext.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,yCAAyC,CAAA;AAC7D;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,6CAA6C,CAAA;AACjE;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,4CAA4C,CAAA;AAChE;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,8CAA8C,CAAA;AAGlE;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAClD;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,6BAA6B,CAAA;AAEjD;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,oCAAoC,CAAA;AAExD;;GAEG;AACH,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAlBlD,OAAO,6BAA6B,CAAA"}
|