effect-app 4.0.0-beta.266 → 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.
Files changed (91) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/Model/Repository/Registry.d.ts +5 -4
  3. package/dist/Model/Repository/Registry.d.ts.map +1 -1
  4. package/dist/Model/Repository/Registry.js +1 -1
  5. package/dist/Model/Repository/ext.d.ts +3 -3
  6. package/dist/Model/Repository/legacy.d.ts +6 -6
  7. package/dist/Model/Repository/legacy.d.ts.map +1 -1
  8. package/dist/Model/Repository/service.d.ts +30 -30
  9. package/dist/Model/Repository/service.d.ts.map +1 -1
  10. package/dist/Model/filter/types.d.ts +4 -4
  11. package/dist/Schema/Class.js +2 -2
  12. package/dist/Schema/SpecialOpenApi.js +1 -1
  13. package/dist/Store.d.ts +11 -11
  14. package/dist/Store.d.ts.map +1 -1
  15. package/dist/client/errors.d.ts +35 -4
  16. package/dist/client/errors.d.ts.map +1 -1
  17. package/dist/client/errors.js +32 -2
  18. package/dist/client.d.ts +5 -5
  19. package/dist/rpc/Invalidation.js +3 -3
  20. package/dist/utils.d.ts +5 -5
  21. package/package.json +3 -3
  22. package/src/Array.ts +2 -2
  23. package/src/Chunk.ts +3 -3
  24. package/src/Config/SecretURL.ts +1 -1
  25. package/src/Config/internal/configSecretURL.ts +1 -1
  26. package/src/Config.ts +1 -1
  27. package/src/Effect.ts +3 -3
  28. package/src/Emailer.ts +4 -4
  29. package/src/Inputify.type.ts +1 -1
  30. package/src/Layer.ts +2 -2
  31. package/src/Model/Repository/Registry.ts +5 -4
  32. package/src/Model/Repository/ext.ts +11 -11
  33. package/src/Model/Repository/internal/internal.ts +16 -16
  34. package/src/Model/Repository/legacy.ts +8 -8
  35. package/src/Model/Repository/makeRepo.ts +11 -11
  36. package/src/Model/Repository/service.ts +47 -37
  37. package/src/Model/Repository/validation.ts +2 -2
  38. package/src/Model/Repository.ts +6 -6
  39. package/src/Model/dsl.ts +4 -4
  40. package/src/Model/filter/filterApi.ts +1 -1
  41. package/src/Model/filter/types/errors.ts +3 -3
  42. package/src/Model/filter/types/fields.ts +2 -2
  43. package/src/Model/filter/types/path/common.ts +1 -1
  44. package/src/Model/filter/types/path/eager.ts +3 -3
  45. package/src/Model/filter/types/path/index.ts +2 -2
  46. package/src/Model/filter/types/validator.ts +3 -3
  47. package/src/Model/query/dsl.ts +6 -6
  48. package/src/Model/query/new-kid-interpreter.ts +9 -9
  49. package/src/Model/query.ts +2 -2
  50. package/src/Model.ts +4 -4
  51. package/src/NonEmptySet.ts +3 -3
  52. package/src/Option.ts +1 -1
  53. package/src/Pure.ts +2 -2
  54. package/src/QueueMaker.ts +3 -3
  55. package/src/RequestContext.ts +4 -4
  56. package/src/Schema/Class.ts +5 -5
  57. package/src/Schema/SchemaParser.ts +1 -1
  58. package/src/Schema/SpecialOpenApi.ts +2 -2
  59. package/src/Schema/email.ts +2 -2
  60. package/src/Schema/ext.ts +4 -4
  61. package/src/Schema/moreStrings.ts +4 -4
  62. package/src/Schema/numbers.ts +3 -3
  63. package/src/Schema/phoneNumber.ts +4 -4
  64. package/src/Schema/strings.ts +2 -2
  65. package/src/Schema.ts +23 -23
  66. package/src/Set.ts +1 -1
  67. package/src/Store.ts +20 -20
  68. package/src/_ext/Array.ts +1 -1
  69. package/src/client/InvalidationKeys.ts +3 -3
  70. package/src/client/apiClientFactory.ts +9 -9
  71. package/src/client/clientFor.ts +3 -3
  72. package/src/client/errors.ts +42 -2
  73. package/src/client/makeClient.ts +4 -4
  74. package/src/http/Request.ts +2 -2
  75. package/src/http.ts +1 -1
  76. package/src/ids.ts +2 -2
  77. package/src/index.ts +19 -19
  78. package/src/middleware.ts +1 -1
  79. package/src/rpc/Invalidation.ts +7 -7
  80. package/src/rpc/MiddlewareMaker.ts +6 -6
  81. package/src/rpc/RpcContextMap.ts +2 -2
  82. package/src/rpc/RpcMiddleware.ts +2 -2
  83. package/src/rpc.ts +4 -4
  84. package/src/runtime.ts +4 -4
  85. package/src/setupRequest.ts +6 -6
  86. package/src/toast.ts +4 -4
  87. package/src/transform.ts +1 -1
  88. package/src/utils/logger.ts +1 -1
  89. package/src/utils.ts +2 -2
  90. package/src/validation.ts +2 -2
  91. package/src/withToast.ts +7 -7
@@ -4,19 +4,19 @@
4
4
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
5
5
  /* eslint-disable @typescript-eslint/no-explicit-any */
6
6
 
7
- // import type { ParserEnv } from "../../Schema/custom/Parser.js"
7
+ // import type { ParserEnv } from "../../Schema/custom/Parser.ts"
8
8
 
9
9
  import type * as Scope from "effect/Scope"
10
- import type { NonEmptyReadonlyArray } from "../../Array.js"
11
- import type * as Context from "../../Context.js"
12
- import * as Effect from "../../Effect.js"
13
- import type * as S from "../../Schema.js"
14
- import type { StoreConfig, StoreMaker } from "../../Store.js"
15
- import type { FieldValues } from "../filter/types.js"
16
- import { type ExtendedRepository, extendRepo } from "./ext.js"
17
- import { makeRepoInternal } from "./internal/internal.js"
18
- import { RepositoryRegistry } from "./Registry.js"
19
- import type { Repository } from "./service.js"
10
+ import type { NonEmptyReadonlyArray } from "../../Array.ts"
11
+ import type * as Context from "../../Context.ts"
12
+ import * as Effect from "../../Effect.ts"
13
+ import type * as S from "../../Schema.ts"
14
+ import type { StoreConfig, StoreMaker } from "../../Store.ts"
15
+ import type { FieldValues } from "../filter/types.ts"
16
+ import { type ExtendedRepository, extendRepo } from "./ext.ts"
17
+ import { makeRepoInternal } from "./internal/internal.ts"
18
+ import { RepositoryRegistry } from "./Registry.ts"
19
+ import type { Repository } from "./service.ts"
20
20
 
21
21
  export interface RepositoryOptions<
22
22
  IdKey extends keyof T & keyof Encoded,
@@ -1,14 +1,14 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import type * as Scope from "effect/Scope"
3
- import type { InvalidStateError, NotFoundError, OptimisticConcurrencyException } from "../../client/errors.js"
4
- import type * as Effect from "../../Effect.js"
5
- import type * as Option from "../../Option.js"
6
- import type * as S from "../../Schema.js"
7
- import type { NonNegativeInt } from "../../Schema/numbers.js"
8
- import type { FieldValues, IsNever, ResolveFirstLevel } from "../filter/types.js"
9
- import type { QAll, Query, QueryProjection, RawQuery } from "../query.js"
10
- import type { Mapped } from "./legacy.js"
11
- import type { ValidationResult } from "./validation.js"
3
+ import type { DatabaseError, InvalidStateError, NotFoundError, OptimisticConcurrencyException } from "../../client/errors.ts"
4
+ import type * as Effect from "../../Effect.ts"
5
+ import type * as Option from "../../Option.ts"
6
+ import type * as S from "../../Schema.ts"
7
+ import type { NonNegativeInt } from "../../Schema/numbers.ts"
8
+ import type { FieldValues, IsNever, ResolveFirstLevel } from "../filter/types.ts"
9
+ import type { QAll, Query, QueryProjection, RawQuery } from "../query.ts"
10
+ import type { Mapped } from "./legacy.ts"
11
+ import type { ValidationResult } from "./validation.ts"
12
12
 
13
13
  /**
14
14
  * Event emitted by a repository's ChangeFeed.
@@ -49,32 +49,32 @@ export interface Repository<
49
49
  > {
50
50
  readonly itemType: ItemType
51
51
  readonly idKey: IdKey
52
- readonly find: (id: T[IdKey]) => Effect.Effect<Option.Option<T>, never, RSchema>
53
- readonly all: Effect.Effect<T[], never, RSchema>
52
+ readonly find: (id: T[IdKey]) => Effect.Effect<Option.Option<T>, DatabaseError, RSchema>
53
+ readonly all: Effect.Effect<T[], DatabaseError, RSchema>
54
54
  readonly saveAndPublish: (
55
55
  items: Iterable<T>,
56
56
  events?: Iterable<Evt>
57
- ) => Effect.Effect<void, InvalidStateError | OptimisticConcurrencyException, RSchema | RPublish>
57
+ ) => Effect.Effect<void, InvalidStateError | OptimisticConcurrencyException | DatabaseError, RSchema | RPublish>
58
58
  readonly changeFeed: ChangeFeed<T>
59
59
  readonly removeAndPublish: (
60
60
  items: Iterable<T>,
61
61
  events?: Iterable<Evt>
62
- ) => Effect.Effect<void, never, RSchema | RPublish>
62
+ ) => Effect.Effect<void, DatabaseError, RSchema | RPublish>
63
63
 
64
64
  readonly removeById: (
65
65
  idOrIds: T[IdKey] | ReadonlyArray<T[IdKey]>
66
- ) => Effect.Effect<void, never, RSchema>
66
+ ) => Effect.Effect<void, DatabaseError, RSchema>
67
67
 
68
68
  readonly queryRaw: <T, Out, R>(
69
69
  schema: S.Codec<T, Out, R>,
70
70
  raw: RawQuery<Encoded, Out>
71
- ) => Effect.Effect<readonly T[], S.SchemaError, R>
71
+ ) => Effect.Effect<readonly T[], S.SchemaError | DatabaseError, R>
72
72
 
73
73
  /**
74
74
  * Explicitly seed a namespace. Primary is seeded eagerly on initialization.
75
75
  * Non-primary namespaces must be seeded explicitly before use.
76
76
  */
77
- readonly seedNamespace: (namespace: string) => Effect.Effect<void>
77
+ readonly seedNamespace: (namespace: string) => Effect.Effect<void, DatabaseError>
78
78
 
79
79
  readonly query: {
80
80
  // ending with projection
@@ -91,7 +91,8 @@ export interface Repository<
91
91
  ): Effect.Effect<
92
92
  TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
93
93
  | (TType extends "many" ? never : NotFoundError<ItemType>)
94
- | (TType extends "count" ? never : S.SchemaError),
94
+ | (TType extends "count" ? never : S.SchemaError)
95
+ | DatabaseError,
95
96
  Exclude<R, RProvided> | RSchema
96
97
  >
97
98
  <
@@ -111,7 +112,8 @@ export interface Repository<
111
112
  ): Effect.Effect<
112
113
  TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
113
114
  | (TType extends "many" ? never : NotFoundError<ItemType>)
114
- | (TType extends "count" ? never : S.SchemaError),
115
+ | (TType extends "count" ? never : S.SchemaError)
116
+ | DatabaseError,
115
117
  Exclude<R, RProvided> | RSchema
116
118
  >
117
119
  <
@@ -133,7 +135,8 @@ export interface Repository<
133
135
  ): Effect.Effect<
134
136
  TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
135
137
  | (TType extends "many" ? never : NotFoundError<ItemType>)
136
- | (TType extends "count" ? never : S.SchemaError),
138
+ | (TType extends "count" ? never : S.SchemaError)
139
+ | DatabaseError,
137
140
  Exclude<R, RProvided> | RSchema
138
141
  >
139
142
  <
@@ -157,7 +160,8 @@ export interface Repository<
157
160
  ): Effect.Effect<
158
161
  TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
159
162
  | (TType extends "many" ? never : NotFoundError<ItemType>)
160
- | (TType extends "count" ? never : S.SchemaError),
163
+ | (TType extends "count" ? never : S.SchemaError)
164
+ | DatabaseError,
161
165
  Exclude<R, RProvided> | RSchema
162
166
  >
163
167
  <
@@ -183,7 +187,8 @@ export interface Repository<
183
187
  ): Effect.Effect<
184
188
  TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
185
189
  | (TType extends "many" ? never : NotFoundError<ItemType>)
186
- | (TType extends "count" ? never : S.SchemaError),
190
+ | (TType extends "count" ? never : S.SchemaError)
191
+ | DatabaseError,
187
192
  Exclude<R, RProvided> | RSchema
188
193
  >
189
194
  <
@@ -209,7 +214,8 @@ export interface Repository<
209
214
  ): Effect.Effect<
210
215
  TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
211
216
  | (TType extends "many" ? never : NotFoundError<ItemType>)
212
- | (TType extends "count" ? never : S.SchemaError),
217
+ | (TType extends "count" ? never : S.SchemaError)
218
+ | DatabaseError,
213
219
  Exclude<R, RProvided> | RSchema
214
220
  >
215
221
  <
@@ -237,7 +243,8 @@ export interface Repository<
237
243
  ): Effect.Effect<
238
244
  TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
239
245
  | (TType extends "many" ? never : NotFoundError<ItemType>)
240
- | (TType extends "count" ? never : S.SchemaError),
246
+ | (TType extends "count" ? never : S.SchemaError)
247
+ | DatabaseError,
241
248
  Exclude<R, RProvided> | RSchema
242
249
  >
243
250
  <
@@ -267,7 +274,8 @@ export interface Repository<
267
274
  ): Effect.Effect<
268
275
  TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
269
276
  | (TType extends "many" ? never : NotFoundError<ItemType>)
270
- | (TType extends "count" ? never : S.SchemaError),
277
+ | (TType extends "count" ? never : S.SchemaError)
278
+ | DatabaseError,
271
279
  Exclude<R, RProvided> | RSchema
272
280
  >
273
281
  <
@@ -299,7 +307,8 @@ export interface Repository<
299
307
  ): Effect.Effect<
300
308
  TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
301
309
  | (TType extends "many" ? never : NotFoundError<ItemType>)
302
- | (TType extends "count" ? never : S.SchemaError),
310
+ | (TType extends "count" ? never : S.SchemaError)
311
+ | DatabaseError,
303
312
  Exclude<R, RProvided> | RSchema
304
313
  >
305
314
  <
@@ -333,7 +342,8 @@ export interface Repository<
333
342
  ): Effect.Effect<
334
343
  TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
335
344
  | (TType extends "many" ? never : NotFoundError<ItemType>)
336
- | (TType extends "count" ? never : S.SchemaError),
345
+ | (TType extends "count" ? never : S.SchemaError)
346
+ | DatabaseError,
337
347
  Exclude<R, RProvided> | RSchema
338
348
  >
339
349
 
@@ -347,7 +357,7 @@ export interface Repository<
347
357
  q: (initial: Query<Encoded>) => QAll<Encoded, EncodedRefined, RefineTHelper<T, EncodedRefined>, R, TType, E>
348
358
  ): Effect.Effect<
349
359
  TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined> : RefineTHelper<T, EncodedRefined>,
350
- TType extends "many" ? never : NotFoundError<ItemType>,
360
+ (TType extends "many" ? never : NotFoundError<ItemType>) | DatabaseError,
351
361
  Exclude<R, RProvided> | RSchema
352
362
  >
353
363
  <
@@ -363,7 +373,7 @@ export interface Repository<
363
373
  ) => QAll<Encoded, EncodedRefined, RefineTHelper<T, EncodedRefined>, R, TType, E>
364
374
  ): Effect.Effect<
365
375
  TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined> : RefineTHelper<T, EncodedRefined>,
366
- TType extends "many" ? never : NotFoundError<ItemType>,
376
+ (TType extends "many" ? never : NotFoundError<ItemType>) | DatabaseError,
367
377
  Exclude<R, RProvided> | RSchema
368
378
  >
369
379
  <
@@ -383,7 +393,7 @@ export interface Repository<
383
393
  ) => QAll<Encoded, EncodedRefined, RefineTHelper<T, EncodedRefined>, R, TType, E>
384
394
  ): Effect.Effect<
385
395
  TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined> : RefineTHelper<T, EncodedRefined>,
386
- TType extends "many" ? never : NotFoundError<ItemType>,
396
+ (TType extends "many" ? never : NotFoundError<ItemType>) | DatabaseError,
387
397
  Exclude<R, RProvided> | RSchema
388
398
  >
389
399
  <
@@ -403,7 +413,7 @@ export interface Repository<
403
413
  ) => QAll<Encoded, EncodedRefined, RefineTHelper<T, EncodedRefined>, R, TType, E>
404
414
  ): Effect.Effect<
405
415
  TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined> : RefineTHelper<T, EncodedRefined>,
406
- TType extends "many" ? never : NotFoundError<ItemType>,
416
+ (TType extends "many" ? never : NotFoundError<ItemType>) | DatabaseError,
407
417
  Exclude<R, RProvided> | RSchema
408
418
  >
409
419
  <
@@ -425,7 +435,7 @@ export interface Repository<
425
435
  ) => QAll<Encoded, EncodedRefined, RefineTHelper<T, EncodedRefined>, R, TType, E>
426
436
  ): Effect.Effect<
427
437
  TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined> : RefineTHelper<T, EncodedRefined>,
428
- TType extends "many" ? never : NotFoundError<ItemType>,
438
+ (TType extends "many" ? never : NotFoundError<ItemType>) | DatabaseError,
429
439
  Exclude<R, RProvided> | RSchema
430
440
  >
431
441
  <
@@ -449,7 +459,7 @@ export interface Repository<
449
459
  ) => QAll<Encoded, EncodedRefined, RefineTHelper<T, EncodedRefined>, R, TType, E>
450
460
  ): Effect.Effect<
451
461
  TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined> : RefineTHelper<T, EncodedRefined>,
452
- TType extends "many" ? never : NotFoundError<ItemType>,
462
+ (TType extends "many" ? never : NotFoundError<ItemType>) | DatabaseError,
453
463
  Exclude<R, RProvided> | RSchema
454
464
  >
455
465
  <
@@ -475,7 +485,7 @@ export interface Repository<
475
485
  ) => QAll<Encoded, EncodedRefined, RefineTHelper<T, EncodedRefined>, R, TType, E>
476
486
  ): Effect.Effect<
477
487
  TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined> : RefineTHelper<T, EncodedRefined>,
478
- TType extends "many" ? never : NotFoundError<ItemType>,
488
+ (TType extends "many" ? never : NotFoundError<ItemType>) | DatabaseError,
479
489
  Exclude<R, RProvided> | RSchema
480
490
  >
481
491
  <
@@ -504,7 +514,7 @@ export interface Repository<
504
514
  ): Effect.Effect<
505
515
  TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined>
506
516
  : RefineTHelper<T, EncodedRefined>,
507
- TType extends "many" ? never : NotFoundError<ItemType>,
517
+ (TType extends "many" ? never : NotFoundError<ItemType>) | DatabaseError,
508
518
  Exclude<R, RProvided> | RSchema
509
519
  >
510
520
  <
@@ -535,7 +545,7 @@ export interface Repository<
535
545
  ): Effect.Effect<
536
546
  TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined>
537
547
  : RefineTHelper<T, EncodedRefined>,
538
- TType extends "many" ? never : NotFoundError<ItemType>,
548
+ (TType extends "many" ? never : NotFoundError<ItemType>) | DatabaseError,
539
549
  Exclude<R, RProvided> | RSchema
540
550
  >
541
551
  <
@@ -568,7 +578,7 @@ export interface Repository<
568
578
  ): Effect.Effect<
569
579
  TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined>
570
580
  : RefineTHelper<T, EncodedRefined>,
571
- TType extends "many" ? never : NotFoundError<ItemType>,
581
+ (TType extends "many" ? never : NotFoundError<ItemType>) | DatabaseError,
572
582
  Exclude<R, RProvided> | RSchema
573
583
  >
574
584
  }
@@ -585,7 +595,7 @@ export interface Repository<
585
595
  percentage?: number
586
596
  /** optional maximum number of items to sample */
587
597
  maxItems?: number
588
- }) => Effect.Effect<ValidationResult, never, RSchema>
598
+ }) => Effect.Effect<ValidationResult, DatabaseError, RSchema>
589
599
  }
590
600
 
591
601
  type DistributeQueryIfExclusiveOnArray<Exclusive extends boolean, T, EncodedRefined> = [Exclusive] extends [true]
@@ -1,5 +1,5 @@
1
- import * as S from "../../Schema.js"
2
- import { NonNegativeInt } from "../../Schema.js"
1
+ import * as S from "../../Schema.ts"
2
+ import { NonNegativeInt } from "../../Schema.ts"
3
3
 
4
4
  /**
5
5
  * Represents a single validation error when decoding a repository item.
@@ -1,6 +1,6 @@
1
- export * from "./Repository/ext.js"
2
- export * from "./Repository/legacy.js"
3
- export { makeRepo } from "./Repository/makeRepo.js"
4
- export * from "./Repository/Registry.js"
5
- export * from "./Repository/service.js"
6
- export * from "./Repository/validation.js"
1
+ export * from "./Repository/ext.ts"
2
+ export * from "./Repository/legacy.ts"
3
+ export { makeRepo } from "./Repository/makeRepo.ts"
4
+ export * from "./Repository/Registry.ts"
5
+ export * from "./Repository/service.ts"
6
+ export * from "./Repository/validation.ts"
package/src/Model/dsl.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import type { NonEmptyReadonlyArray } from "../Array.js"
3
- import { toNonEmptyArray } from "../Array.js"
4
- import * as Effect from "../Effect.js"
5
- import { type FixEnv, get, logMany, type Pure, type PureEnvEnv, type PureLogT, set } from "../Pure.js"
2
+ import type { NonEmptyReadonlyArray } from "../Array.ts"
3
+ import { toNonEmptyArray } from "../Array.ts"
4
+ import * as Effect from "../Effect.ts"
5
+ import { type FixEnv, get, logMany, type Pure, type PureEnvEnv, type PureLogT, set } from "../Pure.ts"
6
6
 
7
7
  export interface PureDSL<S, S2, W> {
8
8
  get: Pure<never, S, S, never, never, S>
@@ -1,4 +1,4 @@
1
- import { type RelationDirection } from "../query.js"
1
+ import { type RelationDirection } from "../query.ts"
2
2
 
3
3
  export type InOps =
4
4
  | "in"
@@ -1,6 +1,6 @@
1
- import type { FieldValues, InternalFieldName } from "./fields.js"
2
- import type { BrowserNativeObject, IsAny, LiteralUnion, Merge } from "./utils.js"
3
- import type { RegisterOptions, ValidateResult } from "./validator.js"
1
+ import type { FieldValues, InternalFieldName } from "./fields.ts"
2
+ import type { BrowserNativeObject, IsAny, LiteralUnion, Merge } from "./utils.ts"
3
+ import type { RegisterOptions, ValidateResult } from "./validator.ts"
4
4
 
5
5
  export type Message = string
6
6
 
@@ -1,5 +1,5 @@
1
- import type { IsFlatObject } from "./utils.js"
2
- import type { RegisterOptions } from "./validator.js"
1
+ import type { IsFlatObject } from "./utils.ts"
2
+ import type { RegisterOptions } from "./validator.ts"
3
3
 
4
4
  export type InternalFieldName = string
5
5
 
@@ -1,4 +1,4 @@
1
- import type { IsAny, IsNever } from "../utils.js"
1
+ import type { IsAny, IsNever } from "../utils.ts"
2
2
 
3
3
  /**
4
4
  * Type alias to `string` which describes a lodash-like path through an object.
@@ -1,9 +1,9 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import { expectTypeOf } from "@effect/vitest"
3
- import type { FieldValues } from "../fields.js"
4
- import type { BrowserNativeObject, Equals, IsLiteral, IsNever, Primitive } from "../utils.js"
3
+ import type { FieldValues } from "../fields.ts"
4
+ import type { BrowserNativeObject, Equals, IsLiteral, IsNever, Primitive } from "../utils.ts"
5
5
 
6
- import type { ArrayKey, IsTuple, TupleKeys } from "./common.js"
6
+ import type { ArrayKey, IsTuple, TupleKeys } from "./common.ts"
7
7
 
8
8
  /**
9
9
  * Helper type for recursively constructing paths through a type.
@@ -1,4 +1,4 @@
1
1
  /** Re-export public API */
2
2
 
3
- export type { PathString } from "./common.js"
4
- export type { FieldPath, FieldPathByValue, FieldPathValue, FieldPathValues, Path, PathValue } from "./eager.js"
3
+ export type { PathString } from "./common.ts"
4
+ export type { FieldPath, FieldPathByValue, FieldPathValue, FieldPathValues, Path, PathValue } from "./eager.ts"
@@ -1,6 +1,6 @@
1
- import type { Message } from "./errors.js"
2
- import type { FieldValues, InternalFieldName } from "./fields.js"
3
- import type { FieldPath, FieldPathValue } from "./path/index.js"
1
+ import type { Message } from "./errors.ts"
2
+ import type { FieldValues, InternalFieldName } from "./fields.ts"
3
+ import type { FieldPath, FieldPathValue } from "./path/index.ts"
4
4
 
5
5
  export type ValidationValue = boolean | number | string | RegExp
6
6
 
@@ -5,12 +5,12 @@ import * as Data from "effect/Data"
5
5
  import { flow } from "effect/Function"
6
6
  import * as Pipeable from "effect/Pipeable"
7
7
  import type { Covariant } from "effect/Types"
8
- import type * as Option from "../../Option.js"
9
- import type * as S from "../../Schema.js"
10
- import type { NonNegativeInt } from "../../Schema.js"
11
- import type { Ops } from "../filter/filterApi.js"
12
- import type { FieldValues } from "../filter/types.js"
13
- import type { FieldPath, FieldPathValue, RefineFieldPathValue } from "../filter/types/path/eager.js"
8
+ import type * as Option from "../../Option.ts"
9
+ import type * as S from "../../Schema.ts"
10
+ import type { NonNegativeInt } from "../../Schema.ts"
11
+ import type { Ops } from "../filter/filterApi.ts"
12
+ import type { FieldValues } from "../filter/types.ts"
13
+ import type { FieldPath, FieldPathValue, RefineFieldPathValue } from "../filter/types/path/eager.ts"
14
14
 
15
15
  export type QAll<
16
16
  TFieldValues extends FieldValues,
@@ -3,15 +3,15 @@
3
3
  import { identity, pipe } from "effect/Function"
4
4
  import * as Match from "effect/Match"
5
5
  import * as SchemaAST from "effect/SchemaAST"
6
- import * as Array from "../../Array.js"
7
- import { toNonEmptyArray } from "../../Array.js"
8
- import * as Option from "../../Option.js"
9
- import * as S from "../../Schema.js"
10
- import { dropUndefinedT } from "../../utils.js"
11
- import type { FilterResult } from "../filter/filterApi.js"
12
- import type { FieldValues } from "../filter/types.js"
13
- import type { FieldPath } from "../filter/types/path/eager.js"
14
- import { make, type Q, type QAll } from "../query/dsl.js"
6
+ import * as Array from "../../Array.ts"
7
+ import { toNonEmptyArray } from "../../Array.ts"
8
+ import * as Option from "../../Option.ts"
9
+ import * as S from "../../Schema.ts"
10
+ import { dropUndefinedT } from "../../utils.ts"
11
+ import type { FilterResult } from "../filter/filterApi.ts"
12
+ import type { FieldValues } from "../filter/types.ts"
13
+ import type { FieldPath } from "../filter/types/path/eager.ts"
14
+ import { make, type Q, type QAll } from "../query/dsl.ts"
15
15
 
16
16
  export type AggregateIrExpression =
17
17
  | { readonly _tag: "agg-count" }
@@ -1,5 +1,5 @@
1
- export * from "./query/dsl.js"
2
- export * from "./query/new-kid-interpreter.js"
1
+ export * from "./query/dsl.ts"
2
+ export * from "./query/new-kid-interpreter.ts"
3
3
 
4
4
  export interface RawQuery<Encoded, Out> {
5
5
  cosmos: (vals: { name: string }) => {
package/src/Model.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from "./Model/dsl.js"
2
- export * as Q from "./Model/query.js"
3
- export { makeRepo } from "./Model/Repository.js"
4
- export { type RegisteredRepository, RepositoryRegistry, RepositoryRegistryLive } from "./Model/Repository.js"
1
+ export * from "./Model/dsl.ts"
2
+ export * as Q from "./Model/query.ts"
3
+ export { makeRepo } from "./Model/Repository.ts"
4
+ export { type RegisteredRepository, RepositoryRegistry, RepositoryRegistryLive } from "./Model/Repository.ts"
@@ -2,8 +2,8 @@ import type { NonEmptyReadonlyArray } from "effect/Array"
2
2
  import type * as Equivalence from "effect/Equivalence"
3
3
  import * as Option from "effect/Option"
4
4
  import type * as Order from "effect/Order"
5
- import { flow, pipe } from "./Function.js"
6
- import { filter_, filterMap, filterMap_, fromArray as fromArrayOriginal, insert as insertOriginal, insert_ as insert_Original, map, map_, reduce, reduce_, remove, remove_, type Set, toArray as toArrayOriginal } from "./Set.js"
5
+ import { flow, pipe } from "./Function.ts"
6
+ import { filter_, filterMap, filterMap_, fromArray as fromArrayOriginal, insert as insertOriginal, insert_ as insert_Original, map, map_, reduce, reduce_, remove, remove_, type Set, toArray as toArrayOriginal } from "./Set.ts"
7
7
 
8
8
  export interface NonEmptyBrand {
9
9
  readonly NonEmpty: unique symbol
@@ -89,4 +89,4 @@ export function fromSet<A>(set: Set<A>) {
89
89
  }
90
90
 
91
91
  // TODO
92
- export * from "./Set.js"
92
+ export * from "./Set.ts"
package/src/Option.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  /* eslint-disable @typescript-eslint/no-unsafe-return */
4
4
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
5
5
  // eslint-disable-next-line import/no-unassigned-import
6
- import "./builtin.js"
6
+ import "./builtin.ts"
7
7
  import { getOrUndefined as value, type Some } from "effect/Option"
8
8
  import * as Option from "effect/Option"
9
9
 
package/src/Pure.ts CHANGED
@@ -3,8 +3,8 @@ import * as Chunk from "effect/Chunk"
3
3
  import * as Effect from "effect/Effect"
4
4
  import * as Layer from "effect/Layer"
5
5
  import * as Result from "effect/Result"
6
- import * as Context from "./Context.js"
7
- import { tuple } from "./Function.js"
6
+ import * as Context from "./Context.ts"
7
+ import { tuple } from "./Function.ts"
8
8
 
9
9
  const S1 = Symbol()
10
10
  const S2 = Symbol()
package/src/QueueMaker.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type * as Scope from "effect/Scope"
2
- import type { NonEmptyReadonlyArray } from "./Array.js"
3
- import type * as Effect from "./Effect.js"
4
- import { RequestContext } from "./RequestContext.js"
2
+ import type { NonEmptyReadonlyArray } from "./Array.ts"
3
+ import type * as Effect from "./Effect.ts"
4
+ import { RequestContext } from "./RequestContext.ts"
5
5
 
6
6
  export interface QueueBase<Evt, DrainEvt> {
7
7
  drain: <DrainE, DrainR>(
@@ -1,7 +1,7 @@
1
- import * as Context from "./Context.js"
2
- import { UserProfileId } from "./ids.js"
3
- import * as S from "./Schema.js"
4
- import { NonEmptyString255 } from "./Schema.js"
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
@@ -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.js"
9
- import { concurrencyUnbounded } from "./ext.js"
10
- import * as SchemaParser from "./SchemaParser.js"
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.js"
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.js"
163
+ * import { TaggedClass } from "./Class.ts"
164
164
  *
165
165
  * class Circle extends TaggedClass<Circle>()("Circle", {
166
166
  * radius: Schema.Number
@@ -1,5 +1,5 @@
1
1
  import * as SchemaParser from "effect/SchemaParser"
2
- import { withDefaultParseOptions } from "./ext.js"
2
+ import { withDefaultParseOptions } from "./ext.ts"
3
3
 
4
4
  export * from "effect/SchemaParser"
5
5
 
@@ -12,14 +12,14 @@
12
12
  *
13
13
  * ```ts
14
14
  * import { OpenApi } from "effect/unstable"
15
- * import { deduplicateOpenApiSchemas } from "./SpecialOpenApi.js"
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.js"
22
+ import { postProcessJsonSchema } from "./SpecialJsonSchema.ts"
23
23
 
24
24
  /**
25
25
  * Deduplicates `components.schemas` entries in an OpenAPI spec.
@@ -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.js"
6
- import type { NonEmptyStringBrand } from "./strings.js"
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.js"
44
- import * as Context from "../Context.js"
45
- import { extendM, typedKeysOf } from "../utils.js"
46
- import { type AST } from "./schema.js"
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.js"
22
- import { withDefaultMake } from "./ext.js"
23
- import { type B as SchemaB } from "./schema.js"
24
- import type { NonEmptyString255Brand, NonEmptyStringBrand } from "./strings.js"
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