@effect-app/infra 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.
- package/CHANGELOG.md +22 -0
- package/dist/ClusterCosmos.d.ts +16 -16
- package/dist/Store/Cosmos.d.ts +1 -1
- package/dist/Store/Cosmos.d.ts.map +1 -1
- package/dist/Store/Cosmos.js +64 -31
- package/dist/Store/Disk.d.ts +2 -2
- package/dist/Store/Disk.d.ts.map +1 -1
- package/dist/Store/Disk.js +2 -2
- package/dist/Store/Memory.d.ts +2 -3
- package/dist/Store/Memory.d.ts.map +1 -1
- package/dist/Store/Memory.js +3 -6
- package/dist/Store/SQL.d.ts +1 -1
- package/dist/Store/SQL.d.ts.map +1 -1
- package/dist/Store/SQL.js +14 -7
- package/dist/Store/codeFilter.d.ts +1 -1
- package/dist/Store/codeFilter.d.ts.map +1 -1
- package/dist/Store/codeFilter.js +2 -3
- package/dist/Store/index.js +1 -1
- package/dist/Store/utils.d.ts +3 -1
- package/dist/Store/utils.d.ts.map +1 -1
- package/dist/Store/utils.js +5 -1
- package/dist/WorkflowEngineCosmos.d.ts +1 -1
- package/dist/routing/middleware.d.ts +2 -2
- package/package.json +3 -3
- package/src/CUPS.ts +1 -1
- package/src/ClusterCosmos.ts +2 -2
- package/src/ContextProvider.ts +1 -1
- package/src/Emailer/Sendgrid.ts +1 -1
- package/src/Emailer/fake.ts +1 -1
- package/src/MainFiberSet.ts +3 -3
- package/src/QueueMaker/SQLQueue.ts +3 -3
- package/src/QueueMaker/memQueue.ts +4 -4
- package/src/QueueMaker/sbqueue.ts +4 -4
- package/src/RequestFiberSet.ts +2 -2
- package/src/SQL/Model.ts +1 -1
- package/src/SQL.ts +1 -1
- package/src/ServiceBus.ts +1 -1
- package/src/Store/Cosmos/query.ts +2 -2
- package/src/Store/Cosmos.ts +88 -64
- package/src/Store/Disk.ts +6 -4
- package/src/Store/Memory.ts +5 -8
- package/src/Store/SQL/Pg.ts +5 -5
- package/src/Store/SQL/query.ts +2 -2
- package/src/Store/SQL.ts +23 -12
- package/src/Store/codeFilter.ts +1 -2
- package/src/Store/index.test.ts.bak +2 -2
- package/src/Store/index.ts +6 -6
- package/src/Store/utils.ts +6 -1
- package/src/WorkflowEngineCosmos.ts +3 -3
- package/src/WorkflowEngineSqlite.ts +2 -2
- package/src/errorReporter.ts +2 -2
- package/src/index.ts +2 -2
- package/src/internal/events.ts +1 -1
- package/src/layerUtils.ts +1 -1
- package/src/logger/jsonLogger.ts +1 -1
- package/src/logger/logFmtLogger.ts +1 -1
- package/src/middlewares.ts +4 -4
- package/src/reportError.ts +1 -1
- package/src/routing/middleware/middleware.ts +3 -3
- package/src/routing.ts +3 -3
- package/src/test.ts +2 -2
- package/src/vitest.ts +1 -1
|
@@ -47,8 +47,8 @@ import { SqlClient } from "effect/unstable/sql"
|
|
|
47
47
|
import * as Workflow from "effect/unstable/workflow/Workflow"
|
|
48
48
|
import { type Encoded, makeUnsafe, WorkflowEngine, WorkflowInstance } from "effect/unstable/workflow/WorkflowEngine"
|
|
49
49
|
import { randomUUID } from "node:crypto"
|
|
50
|
-
import { OptimisticConcurrencyException } from "./errors.
|
|
51
|
-
import { annotateDb } from "./otel.
|
|
50
|
+
import { OptimisticConcurrencyException } from "./errors.ts"
|
|
51
|
+
import { annotateDb } from "./otel.ts"
|
|
52
52
|
|
|
53
53
|
export interface WorkflowEngineSqliteConfig {
|
|
54
54
|
/** Optional prefix for table names (e.g. `tenant_`). */
|
package/src/errorReporter.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { getRC } from "effect-app/setupRequest"
|
|
|
4
4
|
import { dropUndefined, LogLevelToSentry } from "effect-app/utils"
|
|
5
5
|
import * as Cause from "effect/Cause"
|
|
6
6
|
import type * as LogLevel from "effect/LogLevel"
|
|
7
|
-
import { CauseException, tryToJson, tryToReport } from "./errors.
|
|
8
|
-
import { InfraLogger } from "./logger.
|
|
7
|
+
import { CauseException, tryToJson, tryToReport } from "./errors.ts"
|
|
8
|
+
import { InfraLogger } from "./logger.ts"
|
|
9
9
|
|
|
10
10
|
const tryCauseException = <E>(cause: Cause.Cause<E>, name: string): CauseException<E> => {
|
|
11
11
|
try {
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./logger.
|
|
2
|
-
export * from "./Store/index.
|
|
1
|
+
export * from "./logger.ts"
|
|
2
|
+
export * from "./Store/index.ts"
|
package/src/internal/events.ts
CHANGED
|
@@ -7,7 +7,7 @@ import * as Duration from "effect/Duration"
|
|
|
7
7
|
import { pipe } from "effect/Function"
|
|
8
8
|
import * as Schedule from "effect/Schedule"
|
|
9
9
|
import * as Stream from "effect/Stream"
|
|
10
|
-
import { reportError } from "../errorReporter.
|
|
10
|
+
import { reportError } from "../errorReporter.ts"
|
|
11
11
|
|
|
12
12
|
// Tell the client to retry every 10 seconds if connectivity is lost
|
|
13
13
|
const setRetry = Stream.succeed("retry: 10000")
|
package/src/layerUtils.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as Context from "effect-app/Context"
|
|
|
4
4
|
import * as Effect from "effect-app/Effect"
|
|
5
5
|
import type * as Layer from "effect-app/Layer"
|
|
6
6
|
import * as Option from "effect-app/Option"
|
|
7
|
-
import { InfraLogger } from "./logger.
|
|
7
|
+
import { InfraLogger } from "./logger.ts"
|
|
8
8
|
|
|
9
9
|
// TODO: These LayerUtils are flaky, like in dependencies as a readonly array, it breaks when there are two entries
|
|
10
10
|
// we should look at Service.MakeDeps[E/RIn/ROut] etc.
|
package/src/logger/jsonLogger.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { spanAttributes } from "effect-app/RequestContext"
|
|
|
3
3
|
import * as Cause from "effect/Cause"
|
|
4
4
|
import * as Logger from "effect/Logger"
|
|
5
5
|
import { CurrentLogAnnotations, CurrentLogSpans } from "effect/References"
|
|
6
|
-
import { getRequestContextFromFiber } from "./shared.
|
|
6
|
+
import { getRequestContextFromFiber } from "./shared.ts"
|
|
7
7
|
|
|
8
8
|
export const jsonLogger = Logger.make<unknown, void>(
|
|
9
9
|
({ cause, date, fiber, logLevel, message }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spanAttributes } from "effect-app/RequestContext"
|
|
2
2
|
import * as Logger from "effect/Logger"
|
|
3
|
-
import { getRequestContextFromFiber } from "./shared.
|
|
3
|
+
import { getRequestContextFromFiber } from "./shared.ts"
|
|
4
4
|
|
|
5
5
|
export const logfmtLogger = Logger.make<unknown, void>(
|
|
6
6
|
(options) => {
|
package/src/middlewares.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @since 1.0.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export * from "./internal/auth.
|
|
8
|
-
export * from "./internal/events.
|
|
9
|
-
export * from "./internal/health.
|
|
10
|
-
export * from "./internal/RequestContextMiddleware.
|
|
7
|
+
export * from "./internal/auth.ts"
|
|
8
|
+
export * from "./internal/events.ts"
|
|
9
|
+
export * from "./internal/health.ts"
|
|
10
|
+
export * from "./internal/RequestContextMiddleware.ts"
|
package/src/reportError.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Effect from "effect-app/Effect"
|
|
2
2
|
import * as Cause from "effect/Cause"
|
|
3
|
-
import { logError, reportError } from "./errorReporter.
|
|
3
|
+
import { logError, reportError } from "./errorReporter.ts"
|
|
4
4
|
|
|
5
5
|
// const onExitReportError = (name: string, unknownOnly?: boolean) => {
|
|
6
6
|
// const report = reportError(name)
|
|
@@ -10,9 +10,9 @@ import * as Effect from "effect/Effect"
|
|
|
10
10
|
import * as Layer from "effect/Layer"
|
|
11
11
|
import * as Schema from "effect/Schema"
|
|
12
12
|
import { type Rpc } from "effect/unstable/rpc"
|
|
13
|
-
import { logError, reportError } from "../../errorReporter.
|
|
14
|
-
import { InfraLogger } from "../../logger.
|
|
15
|
-
import { WithNsTransaction } from "../../Store/SQL.
|
|
13
|
+
import { logError, reportError } from "../../errorReporter.ts"
|
|
14
|
+
import { InfraLogger } from "../../logger.ts"
|
|
15
|
+
import { WithNsTransaction } from "../../Store/SQL.ts"
|
|
16
16
|
|
|
17
17
|
const logRequestError = logError("Request")
|
|
18
18
|
const reportRequestError = reportError("Request")
|
package/src/routing.ts
CHANGED
|
@@ -18,10 +18,10 @@ import * as Ref from "effect/Ref"
|
|
|
18
18
|
import type * as Scope from "effect/Scope"
|
|
19
19
|
import * as Stream from "effect/Stream"
|
|
20
20
|
import { Rpc, RpcGroup, type RpcSerialization, RpcServer } from "effect/unstable/rpc"
|
|
21
|
-
import { type LayerUtils } from "./layerUtils.
|
|
22
|
-
import { RequestType as RequestTypeAnnotation } from "./routing/middleware.
|
|
21
|
+
import { type LayerUtils } from "./layerUtils.ts"
|
|
22
|
+
import { RequestType as RequestTypeAnnotation } from "./routing/middleware.ts"
|
|
23
23
|
|
|
24
|
-
export * from "./routing/middleware.
|
|
24
|
+
export * from "./routing/middleware.ts"
|
|
25
25
|
|
|
26
26
|
export const applyRequestTypeInterruptibility = <A, E, R>(
|
|
27
27
|
requestType: "command" | "query",
|
package/src/test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as S from "effect-app/Schema"
|
|
2
2
|
import { copy } from "effect-app/utils"
|
|
3
|
-
import { generate } from "./arbs.
|
|
3
|
+
import { generate } from "./arbs.ts"
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Given the schema for an object-like structure, creates a function that generates random instances of that object with some values provided.
|
|
@@ -27,4 +27,4 @@ export const createRandomInstanceI = <A extends object, I>(s: S.Codec<A, I> & {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export * from "./arbs.
|
|
30
|
+
export * from "./arbs.ts"
|
package/src/vitest.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "@effect/vitest"
|
|
2
|
-
export * from "./test.
|
|
2
|
+
export * from "./test.ts"
|