@geekmidas/services 10.0.0-alpha.4 → 10.0.0-alpha.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/dist/{ServiceDiscovery-WHikQSQv.mjs → ServiceDiscovery-5LlW7BgD.mjs} +5 -5
- package/dist/ServiceDiscovery-5LlW7BgD.mjs.map +1 -0
- package/dist/{ServiceDiscovery-BrCUabG_.cjs → ServiceDiscovery-C1bAv6vY.cjs} +9 -9
- package/dist/ServiceDiscovery-C1bAv6vY.cjs.map +1 -0
- package/dist/{ServiceDiscovery-BO8W-RY8.d.cts → ServiceDiscovery-I7GKGDgi.d.mts} +5 -8
- package/dist/ServiceDiscovery-I7GKGDgi.d.mts.map +1 -0
- package/dist/{ServiceDiscovery-CRq_bGbi.d.mts → ServiceDiscovery-YbZxbSHi.d.cts} +5 -8
- package/dist/ServiceDiscovery-YbZxbSHi.d.cts.map +1 -0
- package/dist/context.cjs +145 -5
- package/dist/context.cjs.map +1 -0
- package/dist/context.d.cts +60 -3
- package/dist/context.d.cts.map +1 -0
- package/dist/context.d.mts +60 -3
- package/dist/context.d.mts.map +1 -0
- package/dist/context.mjs +142 -2
- package/dist/context.mjs.map +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +3 -4
- package/dist/middy.cjs +4 -4
- package/dist/middy.cjs.map +1 -1
- package/dist/middy.d.cts +9 -13
- package/dist/middy.d.cts.map +1 -1
- package/dist/middy.d.mts +9 -13
- package/dist/middy.d.mts.map +1 -1
- package/dist/middy.mjs +3 -4
- package/dist/middy.mjs.map +1 -1
- package/dist/trpc.cjs +7 -7
- package/dist/trpc.cjs.map +1 -1
- package/dist/trpc.d.cts +8 -11
- package/dist/trpc.d.cts.map +1 -1
- package/dist/trpc.d.mts +8 -11
- package/dist/trpc.d.mts.map +1 -1
- package/dist/trpc.mjs +5 -6
- package/dist/trpc.mjs.map +1 -1
- package/dist/{types-Bgk-0NOO.d.cts → types-DDxt5Kcu.d.cts} +2 -5
- package/dist/types-DDxt5Kcu.d.cts.map +1 -0
- package/dist/{types-BoyOCa57.d.mts → types-DDxt5Kcu.d.mts} +2 -5
- package/dist/types-DDxt5Kcu.d.mts.map +1 -0
- package/package.json +5 -5
- package/dist/ServiceDiscovery-BO8W-RY8.d.cts.map +0 -1
- package/dist/ServiceDiscovery-BrCUabG_.cjs.map +0 -1
- package/dist/ServiceDiscovery-CRq_bGbi.d.mts.map +0 -1
- package/dist/ServiceDiscovery-WHikQSQv.mjs.map +0 -1
- package/dist/context-1ROj3zvL.cjs +0 -197
- package/dist/context-1ROj3zvL.cjs.map +0 -1
- package/dist/context-CH2c0ftq.mjs +0 -145
- package/dist/context-CH2c0ftq.mjs.map +0 -1
- package/dist/context-CU-87vsM.d.mts +0 -64
- package/dist/context-CU-87vsM.d.mts.map +0 -1
- package/dist/context-D2owD3ac.d.cts +0 -64
- package/dist/context-D2owD3ac.d.cts.map +0 -1
- package/dist/types-Bgk-0NOO.d.cts.map +0 -1
- package/dist/types-BoyOCa57.d.mts.map +0 -1
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { ServiceContext } from "./types-BoyOCa57.mjs";
|
|
2
|
-
import { Logger } from "@geekmidas/logger";
|
|
3
|
-
|
|
4
|
-
//#region src/context.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal storage for request context data.
|
|
8
|
-
* Not exported - services use ServiceContext interface.
|
|
9
|
-
*/
|
|
10
|
-
interface RequestContextData {
|
|
11
|
-
logger: Logger;
|
|
12
|
-
requestId: string;
|
|
13
|
-
startTime: number;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* ServiceContext implementation.
|
|
17
|
-
* Singleton that reads from AsyncLocalStorage.
|
|
18
|
-
* Methods throw if called outside a request context (catches bugs early).
|
|
19
|
-
*/
|
|
20
|
-
declare const serviceContext: ServiceContext;
|
|
21
|
-
/**
|
|
22
|
-
* Run a function with request context.
|
|
23
|
-
* Used by endpoint/function/subscriber adaptors.
|
|
24
|
-
*
|
|
25
|
-
* @param data - Request context data (logger, requestId, startTime)
|
|
26
|
-
* @param fn - Function to run with context
|
|
27
|
-
* @returns Result of the function
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* const result = await runWithRequestContext(
|
|
32
|
-
* { logger, requestId, startTime: Date.now() },
|
|
33
|
-
* async () => {
|
|
34
|
-
* // Inside here, serviceContext.getLogger() returns `logger`
|
|
35
|
-
* // serviceContext.getRequestId() returns `requestId`
|
|
36
|
-
* return await handleRequest();
|
|
37
|
-
* }
|
|
38
|
-
* );
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
declare function runWithRequestContext<T>(data: RequestContextData, fn: () => T | Promise<T>): T | Promise<T>;
|
|
42
|
-
/**
|
|
43
|
-
* Mutate the current async task's store so that subsequent code in this task
|
|
44
|
-
* (and any descendants) sees the supplied request context.
|
|
45
|
-
*
|
|
46
|
-
* Unlike `runWithRequestContext`, this does not scope the context to a
|
|
47
|
-
* callback — useful when the caller can't wrap a function, for example in a
|
|
48
|
-
* Vitest fixture that suspends on `use()` and yields control to the test
|
|
49
|
-
* runner before the test body executes.
|
|
50
|
-
*
|
|
51
|
-
* **Test setup only.** In production handlers, prefer `runWithRequestContext`
|
|
52
|
-
* so the frame is automatically cleaned up.
|
|
53
|
-
*/
|
|
54
|
-
declare function enterRequestContext(data: RequestContextData): void;
|
|
55
|
-
/**
|
|
56
|
-
* Clear the request context for the current async task. Pairs with
|
|
57
|
-
* `enterRequestContext`. After calling, `serviceContext.hasContext()` returns
|
|
58
|
-
* false for the remainder of the current async resource.
|
|
59
|
-
*/
|
|
60
|
-
declare function exitRequestContext(): void;
|
|
61
|
-
//# sourceMappingURL=context.d.ts.map
|
|
62
|
-
//#endregion
|
|
63
|
-
export { RequestContextData, enterRequestContext, exitRequestContext, runWithRequestContext, serviceContext };
|
|
64
|
-
//# sourceMappingURL=context-CU-87vsM.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-CU-87vsM.d.mts","names":[],"sources":["../src/context.ts"],"sourcesContent":[],"mappings":";;;;;;;AAQA;AAyHA;AA0DgB,UAnLC,kBAAA,CAmLoB;EAAA,MAAA,EAlL5B,MAkL4B;EAAA,SAC9B,EAAA,MAAA;EAAkB,SACd,EAAA,MAAA;;;;;;AACG;AAgBE,cA7EH,cA6EsB,EA7EN,cA6Ea;AAS1C;;;;;;;;;;;;;;;;;;;;iBA5BgB,+BACT,8BACI,IAAI,QAAQ,KACpB,IAAI,QAAQ;;;;;;;;;;;;;iBAgBC,mBAAA,OAA0B;;;;;;iBAS1B,kBAAA,CAAA"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { ServiceContext } from "./types-Bgk-0NOO.cjs";
|
|
2
|
-
import { Logger } from "@geekmidas/logger";
|
|
3
|
-
|
|
4
|
-
//#region src/context.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal storage for request context data.
|
|
8
|
-
* Not exported - services use ServiceContext interface.
|
|
9
|
-
*/
|
|
10
|
-
interface RequestContextData {
|
|
11
|
-
logger: Logger;
|
|
12
|
-
requestId: string;
|
|
13
|
-
startTime: number;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* ServiceContext implementation.
|
|
17
|
-
* Singleton that reads from AsyncLocalStorage.
|
|
18
|
-
* Methods throw if called outside a request context (catches bugs early).
|
|
19
|
-
*/
|
|
20
|
-
declare const serviceContext: ServiceContext;
|
|
21
|
-
/**
|
|
22
|
-
* Run a function with request context.
|
|
23
|
-
* Used by endpoint/function/subscriber adaptors.
|
|
24
|
-
*
|
|
25
|
-
* @param data - Request context data (logger, requestId, startTime)
|
|
26
|
-
* @param fn - Function to run with context
|
|
27
|
-
* @returns Result of the function
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* const result = await runWithRequestContext(
|
|
32
|
-
* { logger, requestId, startTime: Date.now() },
|
|
33
|
-
* async () => {
|
|
34
|
-
* // Inside here, serviceContext.getLogger() returns `logger`
|
|
35
|
-
* // serviceContext.getRequestId() returns `requestId`
|
|
36
|
-
* return await handleRequest();
|
|
37
|
-
* }
|
|
38
|
-
* );
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
declare function runWithRequestContext<T>(data: RequestContextData, fn: () => T | Promise<T>): T | Promise<T>;
|
|
42
|
-
/**
|
|
43
|
-
* Mutate the current async task's store so that subsequent code in this task
|
|
44
|
-
* (and any descendants) sees the supplied request context.
|
|
45
|
-
*
|
|
46
|
-
* Unlike `runWithRequestContext`, this does not scope the context to a
|
|
47
|
-
* callback — useful when the caller can't wrap a function, for example in a
|
|
48
|
-
* Vitest fixture that suspends on `use()` and yields control to the test
|
|
49
|
-
* runner before the test body executes.
|
|
50
|
-
*
|
|
51
|
-
* **Test setup only.** In production handlers, prefer `runWithRequestContext`
|
|
52
|
-
* so the frame is automatically cleaned up.
|
|
53
|
-
*/
|
|
54
|
-
declare function enterRequestContext(data: RequestContextData): void;
|
|
55
|
-
/**
|
|
56
|
-
* Clear the request context for the current async task. Pairs with
|
|
57
|
-
* `enterRequestContext`. After calling, `serviceContext.hasContext()` returns
|
|
58
|
-
* false for the remainder of the current async resource.
|
|
59
|
-
*/
|
|
60
|
-
declare function exitRequestContext(): void;
|
|
61
|
-
//# sourceMappingURL=context.d.ts.map
|
|
62
|
-
//#endregion
|
|
63
|
-
export { RequestContextData, enterRequestContext, exitRequestContext, runWithRequestContext, serviceContext };
|
|
64
|
-
//# sourceMappingURL=context-D2owD3ac.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-D2owD3ac.d.cts","names":[],"sources":["../src/context.ts"],"sourcesContent":[],"mappings":";;;;;;;AAQA;AAyHA;AA0DgB,UAnLC,kBAAA,CAmLoB;EAAA,MAAA,EAlL5B,MAkL4B;EAAA,SAC9B,EAAA,MAAA;EAAkB,SACd,EAAA,MAAA;;;;;;AACG;AAgBE,cA7EH,cA6EsB,EA7EN,cA6Ea;AAS1C;;;;;;;;;;;;;;;;;;;;iBA5BgB,+BACT,8BACI,IAAI,QAAQ,KACpB,IAAI,QAAQ;;;;;;;;;;;;;iBAgBC,mBAAA,OAA0B;;;;;;iBAS1B,kBAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-Bgk-0NOO.d.cts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAQA;AAqCA;;AAEY,UAvCK,cAAA,CAuCL;EAAiB;AAEL;AA8BxB;;;;;;;AAW+D;;eAtEjD;;;;;;;;;;;;;;;;;;;;;UAyBG,sBAAA;;aAEL;;WAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BO;;;;eAIH;;;;;;;oBAOK,yBAAyB,YAAY,QAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-BoyOCa57.d.mts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAQA;AAqCA;;AAEY,UAvCK,cAAA,CAuCL;EAAiB;AAEL;AA8BxB;;;;;;;AAW+D;;eAtEjD;;;;;;;;;;;;;;;;;;;;;UAyBG,sBAAA;;aAEL;;WAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BO;;;;eAIH;;;;;;;oBAOK,yBAAyB,YAAY,QAAQ"}
|