effect-app 4.0.0-beta.267 → 4.0.0-beta.268
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 +6 -0
- package/dist/Model/filter/types.d.ts +4 -4
- package/dist/Schema/Class.js +2 -2
- package/dist/Schema/SpecialOpenApi.js +1 -1
- package/dist/client.d.ts +5 -5
- package/dist/rpc/Invalidation.js +3 -3
- package/dist/utils.d.ts +5 -5
- package/package.json +3 -3
- package/src/Array.ts +2 -2
- package/src/Chunk.ts +3 -3
- package/src/Config/SecretURL.ts +1 -1
- package/src/Config/internal/configSecretURL.ts +1 -1
- package/src/Config.ts +1 -1
- package/src/Effect.ts +3 -3
- package/src/Emailer.ts +4 -4
- package/src/Inputify.type.ts +1 -1
- package/src/Layer.ts +2 -2
- package/src/Model/Repository/Registry.ts +3 -3
- package/src/Model/Repository/ext.ts +11 -11
- package/src/Model/Repository/internal/internal.ts +16 -16
- package/src/Model/Repository/legacy.ts +4 -4
- package/src/Model/Repository/makeRepo.ts +11 -11
- package/src/Model/Repository/service.ts +9 -9
- package/src/Model/Repository/validation.ts +2 -2
- package/src/Model/Repository.ts +6 -6
- package/src/Model/dsl.ts +4 -4
- package/src/Model/filter/filterApi.ts +1 -1
- package/src/Model/filter/types/errors.ts +3 -3
- package/src/Model/filter/types/fields.ts +2 -2
- package/src/Model/filter/types/path/common.ts +1 -1
- package/src/Model/filter/types/path/eager.ts +3 -3
- package/src/Model/filter/types/path/index.ts +2 -2
- package/src/Model/filter/types/validator.ts +3 -3
- package/src/Model/query/dsl.ts +6 -6
- package/src/Model/query/new-kid-interpreter.ts +9 -9
- package/src/Model/query.ts +2 -2
- package/src/Model.ts +4 -4
- package/src/NonEmptySet.ts +3 -3
- package/src/Option.ts +1 -1
- package/src/Pure.ts +2 -2
- package/src/QueueMaker.ts +3 -3
- package/src/RequestContext.ts +4 -4
- package/src/Schema/Class.ts +5 -5
- package/src/Schema/SchemaParser.ts +1 -1
- package/src/Schema/SpecialOpenApi.ts +2 -2
- package/src/Schema/email.ts +2 -2
- package/src/Schema/ext.ts +4 -4
- package/src/Schema/moreStrings.ts +4 -4
- package/src/Schema/numbers.ts +3 -3
- package/src/Schema/phoneNumber.ts +4 -4
- package/src/Schema/strings.ts +2 -2
- package/src/Schema.ts +23 -23
- package/src/Set.ts +1 -1
- package/src/Store.ts +11 -11
- package/src/_ext/Array.ts +1 -1
- package/src/client/InvalidationKeys.ts +3 -3
- package/src/client/apiClientFactory.ts +9 -9
- package/src/client/clientFor.ts +3 -3
- package/src/client/errors.ts +1 -1
- package/src/client/makeClient.ts +4 -4
- package/src/http/Request.ts +2 -2
- package/src/http.ts +1 -1
- package/src/ids.ts +2 -2
- package/src/index.ts +19 -19
- package/src/middleware.ts +1 -1
- package/src/rpc/Invalidation.ts +7 -7
- package/src/rpc/MiddlewareMaker.ts +6 -6
- package/src/rpc/RpcContextMap.ts +2 -2
- package/src/rpc/RpcMiddleware.ts +2 -2
- package/src/rpc.ts +4 -4
- package/src/runtime.ts +4 -4
- package/src/setupRequest.ts +6 -6
- package/src/toast.ts +4 -4
- package/src/transform.ts +1 -1
- package/src/utils/logger.ts +1 -1
- package/src/utils.ts +2 -2
- package/src/validation.ts +2 -2
- package/src/withToast.ts +7 -7
package/src/RequestContext.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as Context from "./Context.
|
|
2
|
-
import { UserProfileId } from "./ids.
|
|
3
|
-
import * as S from "./Schema.
|
|
4
|
-
import { NonEmptyString255 } from "./Schema.
|
|
1
|
+
import * as Context from "./Context.ts"
|
|
2
|
+
import { UserProfileId } from "./ids.ts"
|
|
3
|
+
import * as S from "./Schema.ts"
|
|
4
|
+
import { NonEmptyString255 } from "./Schema.ts"
|
|
5
5
|
|
|
6
6
|
export const Locale = S.Literals(["en", "de"])
|
|
7
7
|
export type Locale = typeof Locale.Type
|
package/src/Schema/Class.ts
CHANGED
|
@@ -5,9 +5,9 @@ import * as Option from "effect/Option"
|
|
|
5
5
|
import * as S from "effect/Schema"
|
|
6
6
|
import * as SchemaAST from "effect/SchemaAST"
|
|
7
7
|
import * as SchemaIssue from "effect/SchemaIssue"
|
|
8
|
-
import { copyOrigin } from "../utils.
|
|
9
|
-
import { concurrencyUnbounded } from "./ext.
|
|
10
|
-
import * as SchemaParser from "./SchemaParser.
|
|
8
|
+
import { copyOrigin } from "../utils.ts"
|
|
9
|
+
import { concurrencyUnbounded } from "./ext.ts"
|
|
10
|
+
import * as SchemaParser from "./SchemaParser.ts"
|
|
11
11
|
|
|
12
12
|
type ClassAnnotations<Self> = S.Annotations.Declaration<Self, readonly [any]>
|
|
13
13
|
|
|
@@ -91,7 +91,7 @@ function makeRelaxedDeclaration(
|
|
|
91
91
|
* @example
|
|
92
92
|
* ```ts
|
|
93
93
|
* import * as Schema from "effect/Schema"
|
|
94
|
-
* import { Class } from "./Class.
|
|
94
|
+
* import { Class } from "./Class.ts"
|
|
95
95
|
*
|
|
96
96
|
* class A extends Class<A>("A")({ a: Schema.String }) {}
|
|
97
97
|
*
|
|
@@ -160,7 +160,7 @@ export const Class: <Self = never, Encoded = ExtendedSchemaNoEncoded, Brand = {}
|
|
|
160
160
|
* @example
|
|
161
161
|
* ```ts
|
|
162
162
|
* import * as Schema from "effect/Schema"
|
|
163
|
-
* import { TaggedClass } from "./Class.
|
|
163
|
+
* import { TaggedClass } from "./Class.ts"
|
|
164
164
|
*
|
|
165
165
|
* class Circle extends TaggedClass<Circle>()("Circle", {
|
|
166
166
|
* radius: Schema.Number
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
*
|
|
13
13
|
* ```ts
|
|
14
14
|
* import { OpenApi } from "effect/unstable"
|
|
15
|
-
* import { deduplicateOpenApiSchemas } from "./SpecialOpenApi.
|
|
15
|
+
* import { deduplicateOpenApiSchemas } from "./SpecialOpenApi.ts"
|
|
16
16
|
*
|
|
17
17
|
* const api = HttpApi.make("myApi")
|
|
18
18
|
* .pipe(HttpApi.annotateContext(OpenApi.annotations({ transform: deduplicateOpenApiSchemas })))
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import { postProcessJsonSchema } from "./SpecialJsonSchema.
|
|
22
|
+
import { postProcessJsonSchema } from "./SpecialJsonSchema.ts"
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Deduplicates `components.schemas` entries in an OpenAPI spec.
|
package/src/Schema/email.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { Refinement } from "effect-app/Function"
|
|
|
2
2
|
import { isValidEmail } from "effect-app/validation"
|
|
3
3
|
import * as S from "effect/Schema"
|
|
4
4
|
import type { Simplify } from "effect/Types"
|
|
5
|
-
import type { B } from "./schema.
|
|
6
|
-
import type { NonEmptyStringBrand } from "./strings.
|
|
5
|
+
import type { B } from "./schema.ts"
|
|
6
|
+
import type { NonEmptyStringBrand } from "./strings.ts"
|
|
7
7
|
|
|
8
8
|
export interface EmailBrand extends Simplify<NonEmptyStringBrand & B.Brand<"Email">> {}
|
|
9
9
|
|
package/src/Schema/ext.ts
CHANGED
|
@@ -40,10 +40,10 @@ import { isDateValid } from "effect/Schema"
|
|
|
40
40
|
import type * as SchemaAST from "effect/SchemaAST"
|
|
41
41
|
import * as SchemaIssue from "effect/SchemaIssue"
|
|
42
42
|
import * as SchemaTransformation from "effect/SchemaTransformation"
|
|
43
|
-
import { type NonEmptyReadonlyArray } from "../Array.
|
|
44
|
-
import * as Context from "../Context.
|
|
45
|
-
import { extendM, typedKeysOf } from "../utils.
|
|
46
|
-
import { type AST } from "./schema.
|
|
43
|
+
import { type NonEmptyReadonlyArray } from "../Array.ts"
|
|
44
|
+
import * as Context from "../Context.ts"
|
|
45
|
+
import { extendM, typedKeysOf } from "../utils.ts"
|
|
46
|
+
import { type AST } from "./schema.ts"
|
|
47
47
|
|
|
48
48
|
type ProvidedCodec<Self extends S.Top, R> = S.Codec<
|
|
49
49
|
Self["Type"],
|
|
@@ -18,10 +18,10 @@ import type * as SchemaAST from "effect/SchemaAST"
|
|
|
18
18
|
import type { Simplify } from "effect/Types"
|
|
19
19
|
import { customRandom, nanoid, urlAlphabet } from "nanoid"
|
|
20
20
|
import validator from "validator"
|
|
21
|
-
import { type BrandedSchema, fromBrand, nominal } from "./brand.
|
|
22
|
-
import { withDefaultMake } from "./ext.
|
|
23
|
-
import { type B as SchemaB } from "./schema.
|
|
24
|
-
import type { NonEmptyString255Brand, NonEmptyStringBrand } from "./strings.
|
|
21
|
+
import { type BrandedSchema, fromBrand, nominal } from "./brand.ts"
|
|
22
|
+
import { withDefaultMake } from "./ext.ts"
|
|
23
|
+
import { type B as SchemaB } from "./schema.ts"
|
|
24
|
+
import type { NonEmptyString255Brand, NonEmptyStringBrand } from "./strings.ts"
|
|
25
25
|
|
|
26
26
|
const nonEmptyString = S.NonEmptyString
|
|
27
27
|
|
package/src/Schema/numbers.ts
CHANGED
|
@@ -13,9 +13,9 @@ import * as Effect from "effect/Effect"
|
|
|
13
13
|
import * as S from "effect/Schema"
|
|
14
14
|
import type * as SchemaAST from "effect/SchemaAST"
|
|
15
15
|
import type { Simplify } from "effect/Types"
|
|
16
|
-
import { type BrandedSchema, fromBrand, nominal } from "./brand.
|
|
17
|
-
import { withDefaultMake } from "./ext.
|
|
18
|
-
import { type B } from "./schema.
|
|
16
|
+
import { type BrandedSchema, fromBrand, nominal } from "./brand.ts"
|
|
17
|
+
import { withDefaultMake } from "./ext.ts"
|
|
18
|
+
import { type B } from "./schema.ts"
|
|
19
19
|
|
|
20
20
|
export interface PositiveIntBrand
|
|
21
21
|
extends Simplify<B.Brand<"PositiveInt"> & NonNegativeIntBrand & PositiveNumberBrand>
|
|
@@ -2,10 +2,10 @@ import type { Refinement } from "effect-app/Function"
|
|
|
2
2
|
import { isValidPhone } from "effect-app/validation"
|
|
3
3
|
import * as S from "effect/Schema"
|
|
4
4
|
import type { Simplify } from "effect/Types"
|
|
5
|
-
import { withDefaultMake } from "./ext.
|
|
6
|
-
import { Numbers } from "./FastCheck.
|
|
7
|
-
import type { B } from "./schema.
|
|
8
|
-
import type { NonEmptyStringBrand } from "./strings.
|
|
5
|
+
import { withDefaultMake } from "./ext.ts"
|
|
6
|
+
import { Numbers } from "./FastCheck.ts"
|
|
7
|
+
import type { B } from "./schema.ts"
|
|
8
|
+
import type { NonEmptyStringBrand } from "./strings.ts"
|
|
9
9
|
|
|
10
10
|
export interface PhoneNumberBrand extends Simplify<B.Brand<"PhoneNumber"> & NonEmptyStringBrand> {}
|
|
11
11
|
export type PhoneNumber = string & PhoneNumberBrand
|
package/src/Schema/strings.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type * as B from "effect/Brand"
|
|
|
2
2
|
import * as S from "effect/Schema"
|
|
3
3
|
import type * as SchemaAST from "effect/SchemaAST"
|
|
4
4
|
import type { Simplify } from "effect/Types"
|
|
5
|
-
import { type BrandedSchema, fromBrand, nominal } from "./brand.
|
|
6
|
-
import { withDefaultMake } from "./ext.
|
|
5
|
+
import { type BrandedSchema, fromBrand, nominal } from "./brand.ts"
|
|
6
|
+
import { withDefaultMake } from "./ext.ts"
|
|
7
7
|
|
|
8
8
|
export type NonEmptyStringBrand = B.Brand<"NonEmptyString">
|
|
9
9
|
export type NonEmptyString = string & NonEmptyStringBrand
|
package/src/Schema.ts
CHANGED
|
@@ -3,13 +3,13 @@ import * as SchemaAST from "effect/SchemaAST"
|
|
|
3
3
|
import { type Simplify } from "effect/Struct"
|
|
4
4
|
import type * as Tracer from "effect/Tracer"
|
|
5
5
|
import type { RequiredKeys } from "effect/Types"
|
|
6
|
-
import type { NonEmptyReadonlyArray } from "./Array.
|
|
7
|
-
import { fakerArb } from "./faker.
|
|
8
|
-
import { Email as EmailT, type Email as EmailType } from "./Schema/email.
|
|
9
|
-
import { concurrencyUnbounded, withDefaultMake, withDefaultParseOptions } from "./Schema/ext.
|
|
10
|
-
import { PhoneNumber as PhoneNumberT, type PhoneNumber as PhoneNumberType } from "./Schema/phoneNumber.
|
|
11
|
-
import { type AST } from "./Schema/schema.
|
|
12
|
-
import { copy, extendM, type StructuralCopyOrigin } from "./utils.
|
|
6
|
+
import type { NonEmptyReadonlyArray } from "./Array.ts"
|
|
7
|
+
import { fakerArb } from "./faker.ts"
|
|
8
|
+
import { Email as EmailT, type Email as EmailType } from "./Schema/email.ts"
|
|
9
|
+
import { concurrencyUnbounded, withDefaultMake, withDefaultParseOptions } from "./Schema/ext.ts"
|
|
10
|
+
import { PhoneNumber as PhoneNumberT, type PhoneNumber as PhoneNumberType } from "./Schema/phoneNumber.ts"
|
|
11
|
+
import { type AST } from "./Schema/schema.ts"
|
|
12
|
+
import { copy, extendM, type StructuralCopyOrigin } from "./utils.ts"
|
|
13
13
|
|
|
14
14
|
// ---------------------------------------------------------------------------
|
|
15
15
|
// Default helpers — re-exported from effect/Schema
|
|
@@ -109,23 +109,23 @@ export { withDecodingDefaultTypeKey } from "effect/Schema"
|
|
|
109
109
|
|
|
110
110
|
export * from "effect/Schema"
|
|
111
111
|
|
|
112
|
-
export * from "./Schema/Class.
|
|
113
|
-
export { Class, ErrorClass, Opaque, TaggedClass, TaggedErrorClass } from "./Schema/Class.
|
|
112
|
+
export * from "./Schema/Class.ts"
|
|
113
|
+
export { Class, ErrorClass, Opaque, TaggedClass, TaggedErrorClass } from "./Schema/Class.ts"
|
|
114
114
|
|
|
115
|
-
export { fromBrand, nominal } from "./Schema/brand.
|
|
116
|
-
export { Array, Boolean, Date, DateFromString, DateValid, Finite, Literals, NullOr, Number, ReadonlyMap, ReadonlySet } from "./Schema/ext.
|
|
117
|
-
export { Int, NonNegativeInt } from "./Schema/numbers.
|
|
115
|
+
export { fromBrand, nominal } from "./Schema/brand.ts"
|
|
116
|
+
export { Array, Boolean, Date, DateFromString, DateValid, Finite, Literals, NullOr, Number, ReadonlyMap, ReadonlySet } from "./Schema/ext.ts"
|
|
117
|
+
export { Int, NonNegativeInt } from "./Schema/numbers.ts"
|
|
118
118
|
|
|
119
|
-
export * from "./Schema/email.
|
|
120
|
-
export * from "./Schema/ext.
|
|
121
|
-
export * from "./Schema/moreStrings.
|
|
122
|
-
export * from "./Schema/numbers.
|
|
123
|
-
export * from "./Schema/phoneNumber.
|
|
124
|
-
export * from "./Schema/schema.
|
|
125
|
-
export * from "./Schema/SpecialJsonSchema.
|
|
126
|
-
export * from "./Schema/SpecialOpenApi.
|
|
127
|
-
export * from "./Schema/strings.
|
|
128
|
-
export { NonEmptyString } from "./Schema/strings.
|
|
119
|
+
export * from "./Schema/email.ts"
|
|
120
|
+
export * from "./Schema/ext.ts"
|
|
121
|
+
export * from "./Schema/moreStrings.ts"
|
|
122
|
+
export * from "./Schema/numbers.ts"
|
|
123
|
+
export * from "./Schema/phoneNumber.ts"
|
|
124
|
+
export * from "./Schema/schema.ts"
|
|
125
|
+
export * from "./Schema/SpecialJsonSchema.ts"
|
|
126
|
+
export * from "./Schema/SpecialOpenApi.ts"
|
|
127
|
+
export * from "./Schema/strings.ts"
|
|
128
|
+
export { NonEmptyString } from "./Schema/strings.ts"
|
|
129
129
|
|
|
130
130
|
export * as SchemaIssue from "effect/SchemaIssue"
|
|
131
131
|
|
|
@@ -133,7 +133,7 @@ export const decodeEffectConcurrently: typeof S.decodeEffect = withDefaultParseO
|
|
|
133
133
|
export const decodeUnknownEffectConcurrently: typeof S.decodeUnknownEffect = withDefaultParseOptions(
|
|
134
134
|
S.decodeUnknownEffect
|
|
135
135
|
)
|
|
136
|
-
export * as SchemaParser from "./Schema/SchemaParser.
|
|
136
|
+
export * as SchemaParser from "./Schema/SchemaParser.ts"
|
|
137
137
|
|
|
138
138
|
export { Void as Void_ } from "effect/Schema"
|
|
139
139
|
|
package/src/Set.ts
CHANGED
|
@@ -6,7 +6,7 @@ import * as Option from "effect/Option"
|
|
|
6
6
|
import type * as Order from "effect/Order"
|
|
7
7
|
import { not } from "effect/Predicate"
|
|
8
8
|
import type * as Result from "effect/Result"
|
|
9
|
-
import { identity, pipe, type Predicate, type Refinement, tuple } from "./Function.
|
|
9
|
+
import { identity, pipe, type Predicate, type Refinement, tuple } from "./Function.ts"
|
|
10
10
|
|
|
11
11
|
export function find_<A, B extends A>(
|
|
12
12
|
as: ReadonlySet<A>,
|
package/src/Store.ts
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import * as Data from "effect/Data"
|
|
3
3
|
import type * as Redacted from "effect/Redacted"
|
|
4
4
|
import * as Semaphore from "effect/Semaphore"
|
|
5
|
-
import type { NonEmptyReadonlyArray } from "./Array.
|
|
6
|
-
import type { DatabaseError, OptimisticConcurrencyException } from "./client/errors.
|
|
7
|
-
import * as Context from "./Context.
|
|
8
|
-
import * as Effect from "./Effect.
|
|
9
|
-
import * as Layer from "./Layer.
|
|
10
|
-
import type { FilterResult } from "./Model/filter/filterApi.
|
|
11
|
-
import type { FieldValues } from "./Model/filter/types.
|
|
12
|
-
import type { FieldPath } from "./Model/filter/types/path/index.
|
|
13
|
-
import type { AggregateIrExpression, ComputedProjectionIrExpression, RawQuery } from "./Model/query.
|
|
14
|
-
import type * as Option from "./Option.
|
|
15
|
-
import { NonEmptyString255 } from "./Schema.
|
|
5
|
+
import type { NonEmptyReadonlyArray } from "./Array.ts"
|
|
6
|
+
import type { DatabaseError, OptimisticConcurrencyException } from "./client/errors.ts"
|
|
7
|
+
import * as Context from "./Context.ts"
|
|
8
|
+
import * as Effect from "./Effect.ts"
|
|
9
|
+
import * as Layer from "./Layer.ts"
|
|
10
|
+
import type { FilterResult } from "./Model/filter/filterApi.ts"
|
|
11
|
+
import type { FieldValues } from "./Model/filter/types.ts"
|
|
12
|
+
import type { FieldPath } from "./Model/filter/types/path/index.ts"
|
|
13
|
+
import type { AggregateIrExpression, ComputedProjectionIrExpression, RawQuery } from "./Model/query.ts"
|
|
14
|
+
import type * as Option from "./Option.ts"
|
|
15
|
+
import { NonEmptyString255 } from "./Schema.ts"
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Adapter-neutral unique-key definition for stores that support unique indexes,
|
package/src/_ext/Array.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Chunk from "effect-app/Chunk"
|
|
2
2
|
import * as Effect from "effect-app/Effect"
|
|
3
3
|
import * as Equal from "effect/Equal"
|
|
4
|
-
import { NotFoundError } from "../client/errors.
|
|
4
|
+
import { NotFoundError } from "../client/errors.ts"
|
|
5
5
|
|
|
6
6
|
function getFirstBy<A, Type extends string>(
|
|
7
7
|
a: Iterable<A>,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Ref from "effect/Ref"
|
|
2
|
-
import * as Context from "../Context.
|
|
3
|
-
import * as Effect from "../Effect.
|
|
4
|
-
import type { InvalidationKey } from "../rpc/Invalidation.
|
|
2
|
+
import * as Context from "../Context.ts"
|
|
3
|
+
import * as Effect from "../Effect.ts"
|
|
4
|
+
import type { InvalidationKey } from "../rpc/Invalidation.ts"
|
|
5
5
|
|
|
6
6
|
export type { InvalidationKey }
|
|
7
7
|
/** Shape of the per-mutation service that accumulates server-provided invalidation keys. */
|
|
@@ -8,15 +8,15 @@ import * as Schema from "effect/Schema"
|
|
|
8
8
|
import * as Stream from "effect/Stream"
|
|
9
9
|
import * as Struct from "effect/Struct"
|
|
10
10
|
import { Rpc, RpcClient, RpcGroup, RpcSerialization } from "effect/unstable/rpc"
|
|
11
|
-
import * as Config from "../Config.
|
|
12
|
-
import * as Context from "../Context.
|
|
13
|
-
import * as Effect from "../Effect.
|
|
14
|
-
import { HttpClient, HttpClientRequest } from "../http.
|
|
15
|
-
import { Invalidation } from "../rpc.
|
|
16
|
-
import type * as S from "../Schema.
|
|
17
|
-
import { typedKeysOf, typedValuesOf } from "../utils.
|
|
18
|
-
import type { Client, ClientForOptions, ExtractModuleName, RequestsAny } from "./clientFor.
|
|
19
|
-
import { InvalidationKeysFromServer } from "./InvalidationKeys.
|
|
11
|
+
import * as Config from "../Config.ts"
|
|
12
|
+
import * as Context from "../Context.ts"
|
|
13
|
+
import * as Effect from "../Effect.ts"
|
|
14
|
+
import { HttpClient, HttpClientRequest } from "../http.ts"
|
|
15
|
+
import { Invalidation } from "../rpc.ts"
|
|
16
|
+
import type * as S from "../Schema.ts"
|
|
17
|
+
import { typedKeysOf, typedValuesOf } from "../utils.ts"
|
|
18
|
+
import type { Client, ClientForOptions, ExtractModuleName, RequestsAny } from "./clientFor.ts"
|
|
19
|
+
import { InvalidationKeysFromServer } from "./InvalidationKeys.ts"
|
|
20
20
|
|
|
21
21
|
export interface ApiConfig {
|
|
22
22
|
url: string
|
package/src/client/clientFor.ts
CHANGED
|
@@ -5,9 +5,9 @@ import * as Record from "effect/Record"
|
|
|
5
5
|
import type * as Stream from "effect/Stream"
|
|
6
6
|
import type { Path } from "path-parser"
|
|
7
7
|
import qs from "query-string"
|
|
8
|
-
import type * as Effect from "../Effect.
|
|
9
|
-
import type * as S from "../Schema.
|
|
10
|
-
import { type Req } from "./apiClientFactory.
|
|
8
|
+
import type * as Effect from "../Effect.ts"
|
|
9
|
+
import type * as S from "../Schema.ts"
|
|
10
|
+
import { type Req } from "./apiClientFactory.ts"
|
|
11
11
|
|
|
12
12
|
export function makePathWithQuery(
|
|
13
13
|
path: Path,
|
package/src/client/errors.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @effect-diagnostics overriddenSchemaConstructor:skip-file */
|
|
2
2
|
import { TaggedErrorClass } from "effect-app/Schema"
|
|
3
3
|
import * as Cause from "effect/Cause"
|
|
4
|
-
import * as S from "../Schema.
|
|
4
|
+
import * as S from "../Schema.ts"
|
|
5
5
|
|
|
6
6
|
export const tryToJson = (error: unknown) => {
|
|
7
7
|
try {
|
package/src/client/makeClient.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type * as Exit from "effect/Exit"
|
|
2
2
|
import * as SchemaTransformation from "effect/SchemaTransformation"
|
|
3
|
-
import { type GetContextConfig, type RpcContextMap } from "../rpc/RpcContextMap.
|
|
4
|
-
import * as S from "../Schema.
|
|
5
|
-
import { AST } from "../Schema.
|
|
6
|
-
import type { ClientForOptions } from "./clientFor.
|
|
3
|
+
import { type GetContextConfig, type RpcContextMap } from "../rpc/RpcContextMap.ts"
|
|
4
|
+
import * as S from "../Schema.ts"
|
|
5
|
+
import { AST } from "../Schema.ts"
|
|
6
|
+
import type { ClientForOptions } from "./clientFor.ts"
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Minimal structural shape for an rpc-client middleware tag.
|
package/src/http/Request.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Option from "effect/Option"
|
|
2
2
|
import type { HttpClientResponse } from "effect/unstable/http/HttpClientResponse"
|
|
3
|
-
import * as Effect from "../Effect.
|
|
4
|
-
import { HttpClient, HttpClientError, HttpClientRequest, HttpHeaders } from "./internal/lib.
|
|
3
|
+
import * as Effect from "../Effect.ts"
|
|
4
|
+
import { HttpClient, HttpClientError, HttpClientRequest, HttpHeaders } from "./internal/lib.ts"
|
|
5
5
|
|
|
6
6
|
export interface ResponseWithBody<A> extends Pick<HttpClientResponse, "headers" | "status" | "remoteAddress"> {
|
|
7
7
|
readonly body: A
|
package/src/http.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./http/internal/lib.
|
|
1
|
+
export * from "./http/internal/lib.ts"
|
package/src/ids.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { brandedStringId, type Codec, NonEmptyString255, StringId, type StringId
|
|
|
2
2
|
import type { B } from "effect-app/Schema/schema"
|
|
3
3
|
import * as Effect from "effect/Effect"
|
|
4
4
|
import type { Simplify } from "effect/Types"
|
|
5
|
-
import * as S from "./Schema.
|
|
6
|
-
import { extendM } from "./utils.
|
|
5
|
+
import * as S from "./Schema.ts"
|
|
6
|
+
import { extendM } from "./utils.ts"
|
|
7
7
|
|
|
8
8
|
export interface RequestIdBrand extends StringIdBrand {
|
|
9
9
|
readonly RequestId: unique symbol
|
package/src/index.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-unassigned-import
|
|
2
|
-
import "./builtin.
|
|
2
|
+
import "./builtin.ts"
|
|
3
3
|
|
|
4
|
-
export * as Fnc from "./Function.
|
|
5
|
-
export * as Utils from "./utils.
|
|
4
|
+
export * as Fnc from "./Function.ts"
|
|
5
|
+
export * as Utils from "./utils.ts"
|
|
6
6
|
|
|
7
|
-
export * as Array from "./Array.
|
|
8
|
-
export * as Config from "./Config.
|
|
9
|
-
export * as ConfigProvider from "./ConfigProvider.
|
|
10
|
-
export * as Context from "./Context.
|
|
11
|
-
export * as Effect from "./Effect.
|
|
12
|
-
export * as Layer from "./Layer.
|
|
13
|
-
export * as Model from "./Model.
|
|
14
|
-
export * as NonEmptySet from "./NonEmptySet.
|
|
15
|
-
export * as Set from "./Set.
|
|
16
|
-
export * as Store from "./Store.
|
|
7
|
+
export * as Array from "./Array.ts"
|
|
8
|
+
export * as Config from "./Config.ts"
|
|
9
|
+
export * as ConfigProvider from "./ConfigProvider.ts"
|
|
10
|
+
export * as Context from "./Context.ts"
|
|
11
|
+
export * as Effect from "./Effect.ts"
|
|
12
|
+
export * as Layer from "./Layer.ts"
|
|
13
|
+
export * as Model from "./Model.ts"
|
|
14
|
+
export * as NonEmptySet from "./NonEmptySet.ts"
|
|
15
|
+
export * as Set from "./Set.ts"
|
|
16
|
+
export * as Store from "./Store.ts"
|
|
17
17
|
|
|
18
|
-
export { type NonEmptyArray, type NonEmptyReadonlyArray } from "./Array.
|
|
18
|
+
export { type NonEmptyArray, type NonEmptyReadonlyArray } from "./Array.ts"
|
|
19
19
|
|
|
20
20
|
export * from "effect"
|
|
21
21
|
|
|
22
|
-
export type * as Types from "./Types.
|
|
22
|
+
export type * as Types from "./Types.ts"
|
|
23
23
|
|
|
24
|
-
export * as SecretURL from "./Config/SecretURL.
|
|
25
|
-
export * as RpcX from "./rpc.
|
|
26
|
-
export * as S from "./Schema.
|
|
27
|
-
export { copy } from "./utils.
|
|
24
|
+
export * as SecretURL from "./Config/SecretURL.ts"
|
|
25
|
+
export * as RpcX from "./rpc.ts"
|
|
26
|
+
export * as S from "./Schema.ts"
|
|
27
|
+
export { copy } from "./utils.ts"
|
package/src/middleware.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import * as Context from "effect-app/Context"
|
|
3
|
-
import { RpcMiddleware } from "./rpc.
|
|
3
|
+
import { RpcMiddleware } from "./rpc.ts"
|
|
4
4
|
|
|
5
5
|
export class DevMode extends Context.Reference("DevMode", { defaultValue: () => false }) {}
|
|
6
6
|
|
package/src/rpc/Invalidation.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as Ref from "effect/Ref"
|
|
2
2
|
import { Rpc } from "effect/unstable/rpc"
|
|
3
|
-
import { type ClientForOptions, makeQueryKey } from "../client/clientFor.
|
|
4
|
-
import * as Context from "../Context.
|
|
5
|
-
import * as Effect from "../Effect.
|
|
6
|
-
import * as S from "../Schema.
|
|
3
|
+
import { type ClientForOptions, makeQueryKey } from "../client/clientFor.ts"
|
|
4
|
+
import * as Context from "../Context.ts"
|
|
5
|
+
import * as Effect from "../Effect.ts"
|
|
6
|
+
import * as S from "../Schema.ts"
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Shorthand for a handler-derived invalidation key.
|
|
@@ -111,7 +111,7 @@ export type StreamFailureChunk<E> = { readonly _tag: "error"; readonly error: E;
|
|
|
111
111
|
* ```ts
|
|
112
112
|
* import { makeQueryKey } from "effect-app/client"
|
|
113
113
|
* import { Invalidation } from "effect-app/rpc"
|
|
114
|
-
* import * as UserRsc from "../User/index.
|
|
114
|
+
* import * as UserRsc from "../User/index.ts" // separate module to avoid circular deps
|
|
115
115
|
*
|
|
116
116
|
* class UpdateProfile extends Rpc.make("UpdateProfile", { ... })
|
|
117
117
|
* .annotate(Invalidation.Invalidates, [makeQueryKey(UserRsc.GetMe), makeQueryKey(UserRsc.GetProfile)]) {}
|
|
@@ -160,8 +160,8 @@ export interface InvalidationSetService {
|
|
|
160
160
|
* ```ts
|
|
161
161
|
* import * as Effect from "effect/Effect"
|
|
162
162
|
* import { Invalidation } from "effect-app/rpc"
|
|
163
|
-
* import * as CartRsc from "../Cart/queries.
|
|
164
|
-
* import * as UserRsc from "../User/queries.
|
|
163
|
+
* import * as CartRsc from "../Cart/queries.ts"
|
|
164
|
+
* import * as UserRsc from "../User/queries.ts"
|
|
165
165
|
*
|
|
166
166
|
* const handler = Effect.fnUntraced(function*(req: UpdateCartRequest) {
|
|
167
167
|
* const cart = yield* CartRepo.save(req.cart)
|
|
@@ -7,12 +7,12 @@ import type * as Scope from "effect/Scope"
|
|
|
7
7
|
import { type Simplify } from "effect/Types"
|
|
8
8
|
import { Rpc, type RpcGroup, type RpcSchema } from "effect/unstable/rpc"
|
|
9
9
|
import { type HandlersFrom } from "effect/unstable/rpc/RpcGroup"
|
|
10
|
-
import * as Context from "../Context.
|
|
11
|
-
import { PreludeLogger } from "../logger.
|
|
12
|
-
import { type TypeTestId } from "../TypeTest.
|
|
13
|
-
import { type GetContextConfig, type RequestContextMapTagAny, type RpcContextMap } from "./RpcContextMap.
|
|
14
|
-
import { type AddMiddleware, type AnyDynamic, type RpcDynamic, type RpcMiddlewareV4, type TagClassAny } from "./RpcMiddleware.
|
|
15
|
-
import * as RpcMiddlewareX from "./RpcMiddleware.
|
|
10
|
+
import * as Context from "../Context.ts"
|
|
11
|
+
import { PreludeLogger } from "../logger.ts"
|
|
12
|
+
import { type TypeTestId } from "../TypeTest.ts"
|
|
13
|
+
import { type GetContextConfig, type RequestContextMapTagAny, type RpcContextMap } from "./RpcContextMap.ts"
|
|
14
|
+
import { type AddMiddleware, type AnyDynamic, type RpcDynamic, type RpcMiddlewareV4, type TagClassAny } from "./RpcMiddleware.ts"
|
|
15
|
+
import * as RpcMiddlewareX from "./RpcMiddleware.ts"
|
|
16
16
|
|
|
17
17
|
// adapter for effect/rpc v3 middleware provides. (in effect-smol (v4), it's just a Service Identifier, no tags.)
|
|
18
18
|
// hm?
|
package/src/rpc/RpcContextMap.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import type * as S from "effect/Schema"
|
|
6
6
|
import { type AnyWithProps } from "effect/unstable/rpc/Rpc"
|
|
7
|
-
import * as Context from "../Context.
|
|
8
|
-
import { type RpcDynamic } from "./RpcMiddleware.
|
|
7
|
+
import * as Context from "../Context.ts"
|
|
8
|
+
import { type RpcDynamic } from "./RpcMiddleware.ts"
|
|
9
9
|
|
|
10
10
|
type Values<T extends Record<any, any>> = T[keyof T]
|
|
11
11
|
|
package/src/rpc/RpcMiddleware.ts
CHANGED
|
@@ -8,8 +8,8 @@ import type * as Scope from "effect/Scope"
|
|
|
8
8
|
import type * as Stream from "effect/Stream"
|
|
9
9
|
import { type Rpc, RpcMiddleware } from "effect/unstable/rpc"
|
|
10
10
|
import { type TypeId } from "effect/unstable/rpc/RpcMiddleware"
|
|
11
|
-
import type * as Context from "../Context.
|
|
12
|
-
import { type GetEffectContext, type RpcContextMap } from "./RpcContextMap.
|
|
11
|
+
import type * as Context from "../Context.ts"
|
|
12
|
+
import { type GetEffectContext, type RpcContextMap } from "./RpcContextMap.ts"
|
|
13
13
|
|
|
14
14
|
export type RpcMiddlewareV4<Provides, E, Requires> = RpcMiddleware.RpcMiddleware<Provides, E, Requires>
|
|
15
15
|
|
package/src/rpc.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * as Invalidation from "./rpc/Invalidation.
|
|
2
|
-
export * as MiddlewareMaker from "./rpc/MiddlewareMaker.
|
|
3
|
-
export * as RpcContextMap from "./rpc/RpcContextMap.
|
|
4
|
-
export * as RpcMiddleware from "./rpc/RpcMiddleware.
|
|
1
|
+
export * as Invalidation from "./rpc/Invalidation.ts"
|
|
2
|
+
export * as MiddlewareMaker from "./rpc/MiddlewareMaker.ts"
|
|
3
|
+
export * as RpcContextMap from "./rpc/RpcContextMap.ts"
|
|
4
|
+
export * as RpcMiddleware from "./rpc/RpcMiddleware.ts"
|
package/src/runtime.ts
CHANGED
|
@@ -2,10 +2,10 @@ import * as Exit from "effect/Exit"
|
|
|
2
2
|
import { flow } from "effect/Function"
|
|
3
3
|
import * as Logger from "effect/Logger"
|
|
4
4
|
import * as ManagedRuntime from "effect/ManagedRuntime"
|
|
5
|
-
import { CauseException } from "./client/errors.
|
|
6
|
-
import { type Context } from "./Context.
|
|
7
|
-
import * as Effect from "./Effect.
|
|
8
|
-
import * as Layer from "./Layer.
|
|
5
|
+
import { CauseException } from "./client/errors.ts"
|
|
6
|
+
import { type Context } from "./Context.ts"
|
|
7
|
+
import * as Effect from "./Effect.ts"
|
|
8
|
+
import * as Layer from "./Layer.ts"
|
|
9
9
|
|
|
10
10
|
export const makeAppRuntime = Effect.fnUntraced(function*<A, E>(layer: Layer.Layer<A, E>) {
|
|
11
11
|
const l = layer.pipe(
|
package/src/setupRequest.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as Tracer from "effect/Tracer"
|
|
2
2
|
import { SqlClient } from "effect/unstable/sql"
|
|
3
|
-
import * as Effect from "./Effect.
|
|
4
|
-
import * as Layer from "./Layer.
|
|
5
|
-
import * as Option from "./Option.
|
|
6
|
-
import { LocaleRef, RequestContext, spanAttributes } from "./RequestContext.
|
|
7
|
-
import { NonEmptyString255 } from "./Schema.
|
|
8
|
-
import { ContextMapContainer, storeId } from "./Store.
|
|
3
|
+
import * as Effect from "./Effect.ts"
|
|
4
|
+
import * as Layer from "./Layer.ts"
|
|
5
|
+
import * as Option from "./Option.ts"
|
|
6
|
+
import { LocaleRef, RequestContext, spanAttributes } from "./RequestContext.ts"
|
|
7
|
+
import { NonEmptyString255 } from "./Schema.ts"
|
|
8
|
+
import { ContextMapContainer, storeId } from "./Store.ts"
|
|
9
9
|
|
|
10
10
|
const withSqlTransaction = <R, E, A>(self: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>
|
|
11
11
|
Effect.serviceOption(SqlClient.SqlClient).pipe(
|
package/src/toast.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as Context from "./Context.
|
|
2
|
-
import { accessEffectFn } from "./Context.
|
|
3
|
-
import * as Effect from "./Effect.
|
|
4
|
-
import * as Option from "./Option.
|
|
1
|
+
import * as Context from "./Context.ts"
|
|
2
|
+
import { accessEffectFn } from "./Context.ts"
|
|
3
|
+
import * as Effect from "./Effect.ts"
|
|
4
|
+
import * as Option from "./Option.ts"
|
|
5
5
|
|
|
6
6
|
export type ToastId = string | number
|
|
7
7
|
export type ToastOpts = { id?: ToastId; timeout?: number; groupId?: string; requestId?: string }
|
package/src/transform.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { NonEmptyReadonlyArray } from "effect/Array"
|
|
3
3
|
import * as Option from "effect/Option"
|
|
4
4
|
import type { Misc, Union } from "ts-toolbelt"
|
|
5
|
-
import type * as SET from "./Set.
|
|
5
|
+
import type * as SET from "./Set.ts"
|
|
6
6
|
|
|
7
7
|
// type SomeObject = {
|
|
8
8
|
// 0: Option.Option<string>
|
package/src/utils/logger.ts
CHANGED
package/src/utils.ts
CHANGED
|
@@ -10,8 +10,8 @@ import * as Option from "effect/Option"
|
|
|
10
10
|
import { isFunction } from "effect/Predicate"
|
|
11
11
|
import * as Record from "effect/Record"
|
|
12
12
|
import * as Result from "effect/Result"
|
|
13
|
-
import { identity, pipe } from "./Function.
|
|
14
|
-
import type { DeepMutable, Equals, Mutable } from "./Types.
|
|
13
|
+
import { identity, pipe } from "./Function.ts"
|
|
14
|
+
import type { DeepMutable, Equals, Mutable } from "./Types.ts"
|
|
15
15
|
|
|
16
16
|
// codegen:start {preset: barrel, include: ./utils/*.ts, nodir: false }
|
|
17
17
|
export * from "./utils/effectify.ts"
|