@effect-app/infra 0.133.0-next.4 → 0.133.0-next.41
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 +330 -0
- package/_cjs/RequestContext.cjs +9 -10
- package/_cjs/RequestContext.cjs.map +1 -1
- package/_cjs/_ext/Array.cjs +4 -3
- package/_cjs/_ext/Array.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/setupRequest.cjs +31 -30
- package/_cjs/api/setupRequest.cjs.map +1 -1
- package/_cjs/errors.cjs +6 -2
- 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 +13 -5
- 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 +9 -12
- package/_src/_ext/Array.ts +3 -3
- 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 +1 -1
- package/_src/api/setupRequest.ts +39 -34
- package/_src/errors.ts +9 -5
- package/_src/services/QueueMaker/memQueue.ts +3 -3
- package/_src/services/QueueMaker/sbqueue.ts +3 -3
- package/_src/services/Repository.ts +37 -40
- package/_src/services/RepositoryBase.ts +25 -19
- package/_src/services/Store/service.ts +4 -4
- 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 +11 -12
- package/dist/_ext/Array.d.ts +2 -2
- package/dist/_ext/Array.d.ts.map +1 -1
- package/dist/_ext/Array.js +5 -4
- 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 +1 -1
- package/dist/api/express/schema/routing.d.ts.map +1 -1
- package/dist/api/setupRequest.d.ts +4 -4
- package/dist/api/setupRequest.d.ts.map +1 -1
- package/dist/api/setupRequest.js +31 -37
- package/dist/errors.d.ts +4 -3
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +5 -2
- 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 +4 -4
- 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 +4 -4
- 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 +39 -39
- package/dist/services/Repository.d.ts.map +1 -1
- package/dist/services/Repository.js +3 -3
- package/dist/services/RepositoryBase.d.ts +16 -16
- package/dist/services/RepositoryBase.d.ts.map +1 -1
- package/dist/services/RepositoryBase.js +11 -6
- package/dist/services/RequestContextContainer.d.ts +3 -3
- package/dist/services/RequestContextContainer.js +3 -3
- package/dist/services/Store/service.d.ts +4 -4
- package/dist/services/Store/service.d.ts.map +1 -1
- 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 +19 -9
- package/_src/test.arbs.ts.bak +0 -27
|
@@ -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
|
|
12
|
+
import { 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"
|
|
@@ -18,7 +18,7 @@ import { QueryBuilder } from "./Store/filterApi/query.js"
|
|
|
18
18
|
* @tsplus type Repository
|
|
19
19
|
*/
|
|
20
20
|
export abstract class RepositoryBaseC<
|
|
21
|
-
T extends { id:
|
|
21
|
+
T extends { id: unknown },
|
|
22
22
|
PM extends PersistenceModelType<string>,
|
|
23
23
|
Evt,
|
|
24
24
|
ItemType extends string
|
|
@@ -44,7 +44,7 @@ export abstract class RepositoryBaseC<
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
export abstract class RepositoryBaseC1<
|
|
47
|
-
T extends { id:
|
|
47
|
+
T extends { id: unknown },
|
|
48
48
|
PM extends PersistenceModelType<string>,
|
|
49
49
|
Evt,
|
|
50
50
|
ItemType extends string
|
|
@@ -57,7 +57,7 @@ export abstract class RepositoryBaseC1<
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export class RepositoryBaseC2<
|
|
60
|
-
T extends { id:
|
|
60
|
+
T extends { id: unknown },
|
|
61
61
|
PM extends PersistenceModelType<string>,
|
|
62
62
|
Evt,
|
|
63
63
|
ItemType extends string
|
|
@@ -87,11 +87,11 @@ export function makeRepo<
|
|
|
87
87
|
>() {
|
|
88
88
|
return <
|
|
89
89
|
ItemType extends string,
|
|
90
|
-
T extends { id:
|
|
90
|
+
T extends { id: unknown },
|
|
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
|
) => {
|
|
@@ -147,7 +147,10 @@ export function makeRepo<
|
|
|
147
147
|
|
|
148
148
|
const all = allE.flatMap((_) => _.forEachEffect((_) => parse(_)))
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
const structSchema = schema as unknown as { struct: typeof schema }
|
|
151
|
+
const i = ("struct" in structSchema ? structSchema["struct"] : schema).pipe(S.pick("id"))
|
|
152
|
+
function findE(_id: T["id"]) {
|
|
153
|
+
const { id } = i.encodeSync({ id: _id })
|
|
151
154
|
return store
|
|
152
155
|
.find(id)
|
|
153
156
|
.flatMap((items) =>
|
|
@@ -172,6 +175,7 @@ export function makeRepo<
|
|
|
172
175
|
ret.forEach((_) => set(_.id, _._etag))
|
|
173
176
|
})
|
|
174
177
|
)
|
|
178
|
+
.asUnit
|
|
175
179
|
const encode = (i: T) => schema.encodeSync(i)
|
|
176
180
|
|
|
177
181
|
const saveAll = (a: Iterable<T>) => saveAllE(a.toChunk.map(encode))
|
|
@@ -179,10 +183,12 @@ export function makeRepo<
|
|
|
179
183
|
const saveAndPublish = (items: Iterable<T>, events: Iterable<Evt> = []) => {
|
|
180
184
|
const it = items.toChunk
|
|
181
185
|
return saveAll(it)
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
.andThen(Effect(events.toNonEmptyArray))
|
|
187
|
+
// TODO: for full consistency the events should be stored within the same database transaction, and then picked up.
|
|
188
|
+
.flatMapOpt(pub)
|
|
189
|
+
.andThen(changeFeed
|
|
190
|
+
.publish([it.toArray, "save"]))
|
|
191
|
+
.asUnit
|
|
186
192
|
}
|
|
187
193
|
|
|
188
194
|
function removeAndPublish(a: Iterable<T>, events: Iterable<Evt> = []) {
|
|
@@ -249,7 +255,7 @@ export function makeRepo<
|
|
|
249
255
|
* @tsplus fluent Repository removeById
|
|
250
256
|
*/
|
|
251
257
|
export function removeById<
|
|
252
|
-
T extends { id:
|
|
258
|
+
T extends { id: unknown },
|
|
253
259
|
PM extends PersistenceModelType<string>,
|
|
254
260
|
Evt,
|
|
255
261
|
ItemType extends string
|
|
@@ -297,11 +303,11 @@ export function makeStore<
|
|
|
297
303
|
>() {
|
|
298
304
|
return <
|
|
299
305
|
ItemType extends string,
|
|
300
|
-
T extends { id:
|
|
306
|
+
T extends { id: unknown },
|
|
301
307
|
E extends { id: string }
|
|
302
308
|
>(
|
|
303
309
|
name: ItemType,
|
|
304
|
-
schema:
|
|
310
|
+
schema: S.Schema<E, T>,
|
|
305
311
|
mapTo: (e: E, etag: string | undefined) => PM
|
|
306
312
|
) => {
|
|
307
313
|
const [_dec, encode] = makeCodec(schema)
|
|
@@ -352,7 +358,7 @@ export function makeStore<
|
|
|
352
358
|
}
|
|
353
359
|
|
|
354
360
|
export interface Repos<
|
|
355
|
-
T extends { id:
|
|
361
|
+
T extends { id: unknown },
|
|
356
362
|
PM extends { id: string; _etag: string | undefined },
|
|
357
363
|
Evt,
|
|
358
364
|
ItemType extends string
|
|
@@ -409,9 +415,9 @@ export const RepositoryBaseImpl = <Service>() => {
|
|
|
409
415
|
PM extends { id: string; _etag: string | undefined },
|
|
410
416
|
Evt = never
|
|
411
417
|
>() =>
|
|
412
|
-
<ItemType extends string, T extends { id:
|
|
418
|
+
<ItemType extends string, T extends { id: unknown }, From extends { id: string }>(
|
|
413
419
|
itemType: ItemType,
|
|
414
|
-
schema:
|
|
420
|
+
schema: S.Schema<From, T>,
|
|
415
421
|
jitM?: (pm: From) => From
|
|
416
422
|
): Exact<PM, From & { _etag: string | undefined }> extends true ?
|
|
417
423
|
& (abstract new() => RepositoryBaseC1<T, PM, Evt, ItemType>)
|
|
@@ -450,9 +456,9 @@ export const RepositoryDefaultImpl = <Service>() => {
|
|
|
450
456
|
PM extends { id: string; _etag: string | undefined },
|
|
451
457
|
Evt = never
|
|
452
458
|
>() =>
|
|
453
|
-
<ItemType extends string, T extends { id:
|
|
459
|
+
<ItemType extends string, T extends { id: unknown }, From extends { id: string }>(
|
|
454
460
|
itemType: ItemType,
|
|
455
|
-
schema:
|
|
461
|
+
schema: S.Schema<From, T>,
|
|
456
462
|
jitM?: (pm: From) => From
|
|
457
463
|
): Exact<PM, From & { _etag: string | undefined }> extends true ?
|
|
458
464
|
& (abstract new(
|
|
@@ -63,18 +63,18 @@ export type FilterJoinSelect = {
|
|
|
63
63
|
value: any /* value path[valueKey] of E */
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export interface FilterArgs<PM extends PersistenceModelType<
|
|
66
|
+
export interface FilterArgs<PM extends PersistenceModelType<unknown>, U extends keyof PM = never> {
|
|
67
67
|
filter?: Filter<PM> | undefined
|
|
68
68
|
select?: NonEmptyReadonlyArray<U> | undefined
|
|
69
69
|
limit?: number | undefined
|
|
70
70
|
skip?: number | undefined
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
export type FilterFunc<PM extends PersistenceModelType<
|
|
73
|
+
export type FilterFunc<PM extends PersistenceModelType<unknown>> = <U extends keyof PM = never>(
|
|
74
74
|
args: FilterArgs<PM, U>
|
|
75
75
|
) => Effect<never, never, (U extends undefined ? PM : Pick<PM, U>)[]>
|
|
76
76
|
|
|
77
|
-
export interface Store<PM extends PersistenceModelType<Id>, Id
|
|
77
|
+
export interface Store<PM extends PersistenceModelType<Id>, Id> {
|
|
78
78
|
all: Effect<never, never, PM[]>
|
|
79
79
|
filter: FilterFunc<PM>
|
|
80
80
|
/** @deprecated */
|
|
@@ -189,7 +189,7 @@ export class ContextMap extends TagClass<ContextMap, {
|
|
|
189
189
|
}>() {
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
export interface PersistenceModelType<Id
|
|
192
|
+
export interface PersistenceModelType<Id> {
|
|
193
193
|
id: Id
|
|
194
194
|
_etag: string | undefined
|
|
195
195
|
}
|
|
@@ -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;IAEA,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,
|
|
@@ -41,6 +39,7 @@ let RequestContext = RequestContext_1 = class RequestContext extends Schema2.Tag
|
|
|
41
39
|
// namespace: NonEmptyString255.optional()
|
|
42
40
|
// })
|
|
43
41
|
}) {
|
|
42
|
+
// static Tag = Context.Tag<RequestContext>()
|
|
44
43
|
static inherit(parent, newSelf) {
|
|
45
44
|
return new RequestContext_1({
|
|
46
45
|
namespace: parent?.namespace,
|
|
@@ -84,4 +83,4 @@ export { RequestContext };
|
|
|
84
83
|
}
|
|
85
84
|
RequestContext.From = From;
|
|
86
85
|
})(RequestContext || (RequestContext = {}));
|
|
87
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
86
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVxdWVzdENvbnRleHQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9fc3JjL1JlcXVlc3RDb250ZXh0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSxPQUFPLEVBQUUsQ0FBQyxFQUFFLE1BQU0scUJBQXFCLENBQUE7QUFDdkMsT0FBTyxFQUFFLFNBQVMsRUFBRSxhQUFhLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQTtBQUczRCxJQUFNLG9CQUFvQixHQUExQixNQUFNLG9CQUFxQixTQUFRLGdCQUFBLFdBQVcsRUFFbEQsQ0FBQyxnQkFBZ0IsRUFBRTtJQUNwQixFQUFFLEVBQUUsU0FBUztJQUNiLElBQUksa0JBQUUsaUJBQWlCO0lBQ3ZCLFdBQVcsRUFBRSx5QkFBQSxnQkFBQSxNQUFNLENBQUMsRUFBRSxHQUFHLEVBQUUsYUFBYSxFQUFFLENBQUMsQ0FBVztJQUN0RCxNQUFNLEVBQUUsZ0JBQUEsT0FBTyxDQUFDLElBQUksRUFBRSxJQUFJLENBQUM7SUFDM0IsU0FBUyxFQUFFLHVDQUFBLENBQUMsQ0FBQyxJQUFJLEVBQWlCLEdBQUcsRUFBRSxDQUFDLElBQUksSUFBSSxFQUFFLENBQUMsQ0FBQyxPQUFPO0NBQzVELENBQUM7Q0FBRyxDQUFBO0FBUlEsb0JBQW9CO29CQURoQyx5QkFBeUI7R0FDYixvQkFBb0IsQ0FRNUI7O0FBRUw7OztHQUdHO0FBRUksSUFBTSxjQUFjLHNCQUFwQixNQUFNLGNBQWUsU0FBUSxDQUFDLENBQUMsV0FBVyxFQUU5QyxDQUFDLGdCQUFnQixFQUFFO0lBQ3BCLEdBQUcsc0RBQUEsb0JBQW9CLENBQUMsTUFBTSxHQUFTLElBQUksQ0FBQztJQUM1QyxFQUFFLEVBQUUsU0FBUyxDQUFDLFdBQVcsRUFBRTtJQUMzQixNQUFNLEVBQUUsU0FBUztJQUNqQixNQUFNLEVBQUUseUJBQUEsb0JBQW9CLENBQVc7SUFDdkMsU0FBUyxFQUFFLHlDQUFBLGlCQUFpQixDQUFXO0lBQ3ZDLDhDQUE4QztJQUM5QyxpQ0FBaUM7SUFDakMsdUJBQXVCO0lBQ3ZCLDZDQUE2QztJQUM3Qyw0Q0FBNEM7SUFDNUMsS0FBSztDQUNOLENBQUM7SUFDQSw2Q0FBNkM7SUFDN0MsTUFBTSxDQUFDLE9BQU8sQ0FFWixNQUFzQixFQUN0QixPQUE4RDtRQUU5RCxPQUFPLElBQUksZ0JBQWMsQ0FBQztZQUN4QixTQUFTLEVBQUUsTUFBTSxFQUFFLFNBQVM7WUFDNUIsR0FBRyxPQUFPO1lBQ1YsTUFBTSxFQUFFLE1BQU0sQ0FBQyxNQUFNO1lBQ3JCLE1BQU07U0FDUCxDQUFDLENBQUE7SUFDSixDQUFDO0lBRUQsTUFBTSxDQUFDLFlBQVksQ0FBYSxJQUFvQjtRQUNsRCxPQUFPO1lBQ0wsYUFBYSxFQUFFLElBQUksQ0FBQyxJQUFJO1lBQ3hCLE1BQU0sRUFBRSxJQUFJLENBQUMsTUFBTTtZQUNuQixHQUFHLENBQUMsSUFBSSxDQUFDLE1BQU07Z0JBQ2IsQ0FBQyxDQUFDLEVBQUUsbUJBQW1CLEVBQUUsSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLEVBQUUsWUFBWSxFQUFFLElBQUksQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFO2dCQUM3RSxDQUFDLENBQUMsRUFBRSxDQUFDO1NBQ1IsQ0FBQTtJQUNILENBQUM7Q0FDRixDQUFBO0FBdENZLGNBQWM7b0JBRDFCLHlCQUF5QjtHQUNiLGNBQWMsQ0FzQzFCOztBQUVELGdDQUFnQztBQUNoQyxFQUFFO0FBQ0Ysb0JBQW9CO0FBQ3BCLFdBQWlCLG9CQUFvQjtJQUNuQzs7O09BR0c7SUFDSCxNQUFhLElBQUssU0FBUSxnQkFBQSxTQUFTLEVBQStCO0tBQUc7SUFBeEQseUJBQUksT0FBb0QsQ0FBQTtBQUN2RSxDQUFDLEVBTmdCLG9CQUFvQixLQUFwQixvQkFBb0IsUUFNcEM7QUFDRCxXQUFpQixjQUFjO0lBQzdCOzs7T0FHRztJQUNILE1BQWEsSUFBSyxTQUFRLGdCQUFBLFNBQVMsRUFBeUI7S0FBRztJQUFsRCxtQkFBSSxPQUE4QyxDQUFBO0FBQ2pFLENBQUMsRUFOZ0IsY0FBYyxLQUFkLGNBQWMsUUFNOUIifQ==
|
package/dist/_ext/Array.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ import { NotFoundError } from "../errors.js";
|
|
|
9
9
|
* @tsplus location "@effect-app/infra/_ext/Array"
|
|
10
10
|
*/
|
|
11
11
|
export declare function getFirstById_<A extends {
|
|
12
|
-
id:
|
|
13
|
-
},
|
|
12
|
+
id: unknown;
|
|
13
|
+
}, Type extends string>(a: Iterable<A>, id: A["id"], type: Type): import("effect/Effect").Effect<never, NotFoundError<A["id"], Type>, A>;
|
|
14
14
|
/**
|
|
15
15
|
* @tsplus fluent Object.Ops inspect
|
|
16
16
|
* @tsplus location "@effect-app/infra/_ext/Array"
|
package/dist/_ext/Array.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Array.d.ts","sourceRoot":"","sources":["../../_src/_ext/Array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;;;;;;;;;AAS5C,wBAAgB,aAAa,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"Array.d.ts","sourceRoot":"","sources":["../../_src/_ext/Array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;;;;;;;;;AAS5C,wBAAgB,aAAa,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,OAAO,CAAA;CAAE,EAAE,IAAI,SAAS,MAAM,EAC1E,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EACd,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EACX,IAAI,EAAE,IAAI,0EAMX;;;;;AAKD,wBAAgB,aAAa,CAAC,EAAE,SAAS,MAAM,EAC7C,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,EAChB,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,EAChC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,UAG5B"}
|
package/dist/_ext/Array.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "effect/
|
|
2
|
-
import * as tsplus_module_2 from "
|
|
1
|
+
import * as tsplus_module_1 from "effect/Equal";
|
|
2
|
+
import * as tsplus_module_2 from "effect/Chunk";
|
|
3
|
+
import * as tsplus_module_3 from "@effect-app/prelude/_ext/misc";
|
|
3
4
|
import { inspect } from "util";
|
|
4
5
|
import { NotFoundError } from "../errors.js";
|
|
5
6
|
/**
|
|
@@ -10,7 +11,7 @@ import { NotFoundError } from "../errors.js";
|
|
|
10
11
|
* @tsplus fluent ReadonlyArray getFirstById
|
|
11
12
|
*/
|
|
12
13
|
export function getFirstById_(a, id, type) {
|
|
13
|
-
return
|
|
14
|
+
return tsplus_module_3.encaseMaybeInEffect_(tsplus_module_2.findFirst(tsplus_module_2.fromIterable(a), (_) => tsplus_module_1.equals(_.id, id)), () => new NotFoundError({ type, id }));
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* @tsplus fluent Object.Ops inspect
|
|
@@ -18,4 +19,4 @@ export function getFirstById_(a, id, type) {
|
|
|
18
19
|
export function RecordInspect(o, showHidden, depth, color) {
|
|
19
20
|
return inspect(o.subject, showHidden, depth, color);
|
|
20
21
|
}
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXJyYXkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9fc3JjL19leHQvQXJyYXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLE1BQU0sQ0FBQTtBQUM5QixPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sY0FBYyxDQUFBO0FBRTVDOzs7Ozs7R0FNRztBQUNILE1BQU0sVUFBVSxhQUFhLENBQzNCLENBQWMsRUFDZCxFQUFXLEVBQ1gsSUFBVTtJQUVWLE9BQU8scUNBQUEsMEJBQUEsNkJBQ1MsQ0FBQyxDQUFDLEVBQ0wsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLHVCQUFhLENBQUMsQ0FBQyxFQUFFLEVBQUUsRUFBRSxDQUFDLENBQUMsRUFDekIsR0FBRyxFQUFFLENBQUMsSUFBSSxhQUFhLENBQUMsRUFBRSxJQUFJLEVBQUUsRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFBO0FBQzFELENBQUM7QUFFRDs7R0FFRztBQUNILE1BQU0sVUFBVSxhQUFhLENBQzNCLENBQWdCLEVBQ2hCLFVBQWdDLEVBQ2hDLEtBQWlDLEVBQ2pDLEtBQTJCO0lBRTNCLE9BQU8sT0FBTyxDQUFDLENBQUMsQ0FBQyxPQUFPLEVBQUUsVUFBVSxFQUFFLEtBQUssRUFBRSxLQUFLLENBQUMsQ0FBQTtBQUNyRCxDQUFDIn0=
|
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"}
|
package/dist/_global.ext.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
* @tsplus fluent effect/schema/Schema withDefault
|
|
4
|
-
*/
|
|
5
|
-
export const defaultDate = (s) => S.withDefaultConstructor(s, () => new Date());
|
|
6
|
-
/**
|
|
7
|
-
* @tsplus fluent effect/schema/Schema withDefault
|
|
8
|
-
*/
|
|
9
|
-
export const defaultNullable = (s) => S.withDefaultConstructor(s, () => null);
|
|
10
|
-
/**
|
|
11
|
-
* @tsplus fluent effect/schema/Schema withDefault
|
|
12
|
-
*/
|
|
13
|
-
export const defaultArray = (s) => S.withDefaultConstructor(s, () => []);
|
|
14
|
-
/**
|
|
15
|
-
* @tsplus fluent effect/schema/Schema __call
|
|
16
|
-
*/
|
|
17
|
-
export const parseSync = (self, u, options) => S.parseSync(self)(u, options);
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiX2dsb2JhbC5leHQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9fc3JjL19nbG9iYWwuZXh0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNDQSxPQUFPLEVBQUUsQ0FBQyxFQUFFLE1BQU0sMkJBQTJCLENBQUE7QUFHN0M7O0dBRUc7QUFDSCxNQUFNLENBQUMsTUFBTSxXQUFXLEdBQUcsQ0FBTyxDQUF1QixFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsc0JBQXNCLENBQUMsQ0FBQyxFQUFFLEdBQUcsRUFBRSxDQUFDLElBQUksSUFBSSxFQUFFLENBQUMsQ0FBQTtBQUUzRzs7R0FFRztBQUNILE1BQU0sQ0FBQyxNQUFNLGVBQWUsR0FBRyxDQUFXLENBQTRCLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxzQkFBc0IsQ0FBQyxDQUFDLEVBQUUsR0FBRyxFQUFFLENBQUMsSUFBSSxDQUFDLENBQUE7QUFFbEg7O0dBRUc7QUFDSCxNQUFNLENBQUMsTUFBTSxZQUFZLEdBQUcsQ0FBVSxDQUFtQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsc0JBQXNCLENBQUMsQ0FBQyxFQUFFLEdBQUcsRUFBRSxDQUFDLEVBQUUsQ0FBQyxDQUFBO0FBRW5IOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sU0FBUyxHQUFHLENBQU8sSUFBb0IsRUFBRSxDQUFJLEVBQUUsT0FBa0MsRUFBRSxFQUFFLENBQ2hHLENBQUMsQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUFFLE9BQU8sQ0FBQyxDQUFBIn0=
|
|
1
|
+
import "@effect-app/infra/test.arbs";
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiX2dsb2JhbC5leHQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9fc3JjL19nbG9iYWwuZXh0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWlCQSxPQUFPLDZCQUE2QixDQUFBIn0=
|
package/dist/_global.schema.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @tsplus global
|
|
3
3
|
*/
|
|
4
|
-
import { Delete, Get, Patch, Post, Put } from "@effect-app/
|
|
4
|
+
import { Delete, Get, Patch, Post, Put } from "@effect-app/schema";
|
|
5
5
|
import "@effect-app/prelude/_global.schema";
|
|
6
6
|
//# sourceMappingURL=_global.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_global.schema.d.ts","sourceRoot":"","sources":["../_src/_global.schema.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"_global.schema.d.ts","sourceRoot":"","sources":["../_src/_global.schema.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAElE,OAAO,oCAAoC,CAAA"}
|
package/dist/_global.schema.js
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @tsplus global
|
|
6
6
|
*/
|
|
7
|
-
import "@effect-app/
|
|
7
|
+
import "@effect-app/schema";
|
|
8
8
|
import "@effect-app/prelude/_global.schema";
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiX2dsb2JhbC5zY2hlbWEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9fc3JjL19nbG9iYWwuc2NoZW1hLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHlDQUF5QztBQUN6QyxxREFBcUQ7QUFDckQsMERBQTBEO0FBRTFEOztHQUVHO0FBQ0gsT0FBOEMsb0JBQW9CLENBQUE7QUFFbEUsT0FBTyxvQ0FBb0MsQ0FBQSJ9
|
package/dist/api/codec.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as S from "@effect-app/
|
|
1
|
+
import * as S from "@effect-app/schema";
|
|
2
2
|
export declare function makeCodec<To extends {
|
|
3
3
|
id: Id;
|
|
4
4
|
}, From, Id>(self: S.Schema<From, To>): readonly [(i: unknown, options?: S.AST.ParseOptions | undefined) => To, (a: To, options?: S.AST.ParseOptions | undefined) => From];
|
package/dist/api/codec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../_src/api/codec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../_src/api/codec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAA;AAEvC,wBAAgB,SAAS,CACvB,EAAE,SAAS;IAAE,EAAE,EAAE,EAAE,CAAA;CAAE,EACrB,IAAI,EACJ,EAAE,EACF,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,sIAEzB"}
|
package/dist/api/codec.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as S from "@effect-app/
|
|
1
|
+
import * as S from "@effect-app/schema";
|
|
2
2
|
export function makeCodec(self) {
|
|
3
3
|
return [S.parseSync(self), S.encodeSync(self)];
|
|
4
4
|
}
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29kZWMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9fc3JjL2FwaS9jb2RlYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssQ0FBQyxNQUFNLG9CQUFvQixDQUFBO0FBRXZDLE1BQU0sVUFBVSxTQUFTLENBSXZCLElBQXdCO0lBQ3hCLE9BQU8sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLENBQVUsQ0FBQTtBQUN6RCxDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../../../_src/api/express/schema/jwt.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../../../_src/api/express/schema/jwt.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAA;AAIvC,eAAO,MAAM,GAAG,2BAEd,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
3
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
4
|
-
import * as S from "@effect-app/
|
|
4
|
+
import * as S from "@effect-app/schema";
|
|
5
5
|
import { jwtDecode } from "jwt-decode";
|
|
6
6
|
export const jwt = S.transform(S.string, S.unknown, (_) => jwtDecode(_), (_) => {
|
|
7
7
|
throw new Error("not implemented");
|
|
8
8
|
});
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiand0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vX3NyYy9hcGkvZXhwcmVzcy9zY2hlbWEvand0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDREQUE0RDtBQUM1RCx1REFBdUQ7QUFDdkQsaURBQWlEO0FBQ2pELE9BQU8sS0FBSyxDQUFDLE1BQU0sb0JBQW9CLENBQUE7QUFFdkMsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLFlBQVksQ0FBQTtBQUV0QyxNQUFNLENBQUMsTUFBTSxHQUFHLEdBQUcsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsTUFBTSxFQUFFLENBQUMsQ0FBQyxPQUFPLEVBQUUsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBVSxFQUFFO0lBQ3JGLE1BQU0sSUFBSSxLQUFLLENBQUMsaUJBQWlCLENBQUMsQ0FBQTtBQUNwQyxDQUFDLENBQUMsQ0FBQSJ9
|