@common-stack/server-stack 7.2.1-alpha.5 → 7.2.1-alpha.51
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/lib/MainStackServer.cjs +30 -12
- package/lib/MainStackServer.cjs.map +1 -1
- package/lib/MainStackServer.mjs +31 -13
- package/lib/MainStackServer.mjs.map +1 -1
- package/lib/config/env-config.cjs +2 -2
- package/lib/config/env-config.cjs.map +1 -1
- package/lib/config/env-config.mjs +2 -2
- package/lib/config/env-config.mjs.map +1 -1
- package/lib/infrastructure/infrastructure-factory.cjs +59 -14
- package/lib/infrastructure/infrastructure-factory.cjs.map +1 -1
- package/lib/infrastructure/infrastructure-factory.d.ts +3 -0
- package/lib/infrastructure/infrastructure-factory.mjs +59 -14
- package/lib/infrastructure/infrastructure-factory.mjs.map +1 -1
- package/lib/infrastructure/inngest-factory.cjs +23 -2
- package/lib/infrastructure/inngest-factory.cjs.map +1 -1
- package/lib/infrastructure/inngest-factory.mjs +23 -2
- package/lib/infrastructure/inngest-factory.mjs.map +1 -1
- package/lib/inngest/handler-factory.d.ts +6 -0
- package/lib/inngest/middleware/auto-resolve-invoke.middleware.cjs +275 -0
- package/lib/inngest/middleware/auto-resolve-invoke.middleware.cjs.map +1 -0
- package/lib/inngest/middleware/auto-resolve-invoke.middleware.d.ts +111 -0
- package/lib/inngest/middleware/auto-resolve-invoke.middleware.mjs +275 -0
- package/lib/inngest/middleware/auto-resolve-invoke.middleware.mjs.map +1 -0
- package/lib/inngest/middleware/function-reference-helper.cjs +363 -0
- package/lib/inngest/middleware/function-reference-helper.cjs.map +1 -0
- package/lib/inngest/middleware/function-reference-helper.d.ts +211 -0
- package/lib/inngest/middleware/function-reference-helper.mjs +363 -0
- package/lib/inngest/middleware/function-reference-helper.mjs.map +1 -0
- package/lib/inngest/middleware/index.d.ts +31 -0
- package/lib/inngest/middleware/types.d.ts +162 -0
- package/lib/inngest/setup.cjs +30 -13
- package/lib/inngest/setup.cjs.map +1 -1
- package/lib/inngest/setup.mjs +30 -13
- package/lib/inngest/setup.mjs.map +1 -1
- package/lib/servers/ExpressApp.cjs +1 -1
- package/lib/servers/ExpressApp.cjs.map +1 -1
- package/lib/servers/ExpressApp.mjs +1 -1
- package/lib/servers/ExpressApp.mjs.map +1 -1
- package/package.json +7 -6
- package/lib/plugins/invalidateCachePlugin.test.d.ts +0 -1
- package/lib/plugins/response-cache-plugin.test.d.ts +0 -1
- package/lib/utils/add-shareable-directive-to-schema.test.d.ts +0 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript type extensions for Inngest middleware-injected helpers
|
|
3
|
+
*
|
|
4
|
+
* These types extend the Inngest Step and Context objects with our custom helpers
|
|
5
|
+
* that are injected by the function-reference middleware.
|
|
6
|
+
*
|
|
7
|
+
* Usage in your code:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import type { ExtendedStep, ExtendedContext } from '@common-stack/server-stack';
|
|
10
|
+
*
|
|
11
|
+
* const myFn = inngest.createFunction(..., async ({ event, ctx, step }: {
|
|
12
|
+
* event: any;
|
|
13
|
+
* ctx: ExtendedContext;
|
|
14
|
+
* step: ExtendedStep;
|
|
15
|
+
* }) => {
|
|
16
|
+
* // Now you get autocomplete for ctx.resolveFunctionId and step.resolveFunctionId!
|
|
17
|
+
* const userFn = ctx.resolveFunctionId('USER.Create/trigger');
|
|
18
|
+
* await step.invoke('create-user', { function: userFn, data: {...} });
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
import type { InngestFunction } from 'inngest';
|
|
23
|
+
/**
|
|
24
|
+
* Extended Context with injected function reference helpers
|
|
25
|
+
*/
|
|
26
|
+
export interface ExtendedContext {
|
|
27
|
+
/**
|
|
28
|
+
* Reference a function by its exact ID
|
|
29
|
+
* @param functionId - The exact function ID (e.g., 'user-create')
|
|
30
|
+
*/
|
|
31
|
+
resolveFunction<T extends InngestFunction.Any = InngestFunction.Any>(functionId: string | {
|
|
32
|
+
functionId: string;
|
|
33
|
+
}): T;
|
|
34
|
+
/**
|
|
35
|
+
* Resolve a function reference from a workflow-style string or plain ID
|
|
36
|
+
* Normalizes strings like "WORKFLOWNAME.Function/trigger" to "workflowname-function-trigger"
|
|
37
|
+
* @param functionRef - Workflow-style string or plain function ID
|
|
38
|
+
*/
|
|
39
|
+
resolveFunctionId<T extends InngestFunction.Any = InngestFunction.Any>(functionRef: string | {
|
|
40
|
+
functionId: string;
|
|
41
|
+
}): T;
|
|
42
|
+
/**
|
|
43
|
+
* Batch reference multiple functions at once
|
|
44
|
+
* @param functionIds - Array of function IDs to reference
|
|
45
|
+
*/
|
|
46
|
+
resolveFunctions<T extends readonly string[]>(functionIds: T): {
|
|
47
|
+
[K in T[number]]: InngestFunction.Any;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Check if a function is registered in the global registry
|
|
51
|
+
* @param functionId - The function ID to check
|
|
52
|
+
*/
|
|
53
|
+
hasFunction(functionId: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Get all available function IDs from the registry
|
|
56
|
+
*/
|
|
57
|
+
getAvailableFunctions(): string[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Extended Step with injected function reference helpers
|
|
61
|
+
*
|
|
62
|
+
* These are available on the step object for inline editors that can't import modules.
|
|
63
|
+
*/
|
|
64
|
+
export interface ExtendedStep {
|
|
65
|
+
/**
|
|
66
|
+
* Reference a function by its exact ID
|
|
67
|
+
* Available on step object for inline editor support (no imports needed)
|
|
68
|
+
* @param functionId - The exact function ID (e.g., 'user-create')
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* const step_159 = async (event, step) => {
|
|
73
|
+
* const userFn = step.referenceFunction('user-create');
|
|
74
|
+
* await step.invoke('create-user', { function: userFn, data: {...} });
|
|
75
|
+
* };
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
referenceFunction<T extends InngestFunction.Any = InngestFunction.Any>(functionId: string | {
|
|
79
|
+
functionId: string;
|
|
80
|
+
}): T;
|
|
81
|
+
/**
|
|
82
|
+
* Resolve a function reference from a workflow-style string or plain ID
|
|
83
|
+
* Available on step object for inline editor support (no imports needed)
|
|
84
|
+
* Normalizes strings like "WORKFLOWNAME.Function/trigger" to "workflowname-function-trigger"
|
|
85
|
+
* @param functionRef - Workflow-style string or plain function ID
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const step_159 = async (event, step) => {
|
|
90
|
+
* // Workflow-style reference
|
|
91
|
+
* const paymentFn = step.resolveFunctionId('BILLING.ProcessPayment/trigger');
|
|
92
|
+
* await step.invoke('process-payment', { function: paymentFn, data: {...} });
|
|
93
|
+
* };
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
resolveFunctionId<T extends InngestFunction.Any = InngestFunction.Any>(functionRef: string | {
|
|
97
|
+
functionId: string;
|
|
98
|
+
}): T;
|
|
99
|
+
/**
|
|
100
|
+
* Check if a function is registered in the global registry
|
|
101
|
+
* Available on step object for inline editor support (no imports needed)
|
|
102
|
+
* @param functionId - The function ID to check
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```typescript
|
|
106
|
+
* const step_159 = async (event, step) => {
|
|
107
|
+
* if (step.hasFunction('email-send')) {
|
|
108
|
+
* const emailFn = step.referenceFunction('email-send');
|
|
109
|
+
* await step.invoke('send-email', { function: emailFn, data: {...} });
|
|
110
|
+
* }
|
|
111
|
+
* };
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
hasFunction(functionId: string): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Get all available function IDs from the registry
|
|
117
|
+
* Available on step object for inline editor support (no imports needed)
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```typescript
|
|
121
|
+
* const step_159 = async (event, step) => {
|
|
122
|
+
* console.log('Available functions:', step.getAvailableFunctions());
|
|
123
|
+
* };
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
getAvailableFunctions(): string[];
|
|
127
|
+
invoke: any;
|
|
128
|
+
run: any;
|
|
129
|
+
sleep: any;
|
|
130
|
+
sleepUntil: any;
|
|
131
|
+
waitForEvent: any;
|
|
132
|
+
sendEvent: any;
|
|
133
|
+
[key: string]: any;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Helper type for inline editor function handlers
|
|
137
|
+
* Use this for your inline editor functions to get full autocomplete
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* const step_159: InlineEditorHandler = async (event, step) => {
|
|
142
|
+
* // Full autocomplete for step.resolveFunctionId, step.referenceFunction, etc!
|
|
143
|
+
* const userFn = step.resolveFunctionId('USER.Create/trigger');
|
|
144
|
+
* await step.invoke('create-user', { function: userFn, data: {...} });
|
|
145
|
+
* return { success: true };
|
|
146
|
+
* };
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
export type InlineEditorHandler = (event: any, step: ExtendedStep) => Promise<any>;
|
|
150
|
+
/**
|
|
151
|
+
* Full context handler with both ctx and step extended
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* const myHandler: FullContextHandler = async (event, ctx, step) => {
|
|
156
|
+
* const userFn = ctx.resolveFunctionId('USER.Create/trigger');
|
|
157
|
+
* await step.invoke('create-user', { function: userFn, data: {...} });
|
|
158
|
+
* return { success: true };
|
|
159
|
+
* };
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
export type FullContextHandler = (event: any, ctx: ExtendedContext, step: ExtendedStep) => Promise<any>;
|
package/lib/inngest/setup.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var express=require('inngest/express');/**
|
|
1
|
+
'use strict';var express=require('inngest/express'),functionReferenceHelper=require('./middleware/function-reference-helper.cjs');/**
|
|
2
2
|
* Sets up Inngest functions from the Feature system and registers the handler
|
|
3
3
|
*/
|
|
4
4
|
async function setupInngestFunctions(modules, app, serviceContainer, logger) {
|
|
@@ -6,33 +6,50 @@ async function setupInngestFunctions(modules, app, serviceContainer, logger) {
|
|
|
6
6
|
// Get Inngest client from the container (already bound in infraModule)
|
|
7
7
|
const inngestClient = serviceContainer.get('INNGEST_CLIENT');
|
|
8
8
|
logger.info('✅ Retrieved Inngest client from service container');
|
|
9
|
+
// Load Inngest functions from all modules
|
|
10
|
+
// The improved loadInngestFunctions now handles both array and object returns
|
|
9
11
|
const inngestFunctions = modules.loadInngestFunctions({
|
|
10
12
|
container: serviceContainer,
|
|
11
13
|
inngest: inngestClient,
|
|
12
14
|
settings: {},
|
|
13
15
|
});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
if (inngestFunctions.length > 0) {
|
|
17
|
+
logger.info(`✅ Loaded ${inngestFunctions.length} Inngest functions from Feature system`);
|
|
18
|
+
// Log function IDs for debugging
|
|
19
|
+
const functionIds = inngestFunctions
|
|
20
|
+
.filter((fn) => fn && fn.id)
|
|
21
|
+
.map((fn) => (typeof fn.id === 'function' ? fn.id() : fn.id))
|
|
22
|
+
.join(', ');
|
|
23
|
+
logger.debug(`Registering Inngest functions: ${functionIds}`);
|
|
24
|
+
// ✨ Register functions with global registry for referenceFunction() helper
|
|
25
|
+
logger.info('📝 Registering functions with global function registry...');
|
|
26
|
+
try {
|
|
27
|
+
functionReferenceHelper.globalFunctionRegistry.register(inngestFunctions);
|
|
28
|
+
logger.info(`✅ Registered ${functionReferenceHelper.globalFunctionRegistry.count} functions for referenceFunction() helper`);
|
|
29
|
+
logger.info('💡 You can now use: referenceFunction("function-id") or auto-invoke in step.invoke()');
|
|
17
30
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (flatFunctions.length > 0) {
|
|
31
|
+
catch (registryError) {
|
|
32
|
+
logger.error('❌ Error registering functions with global registry:', registryError);
|
|
33
|
+
}
|
|
34
|
+
// Register Inngest handler
|
|
35
|
+
logger.info('📞 Calling serve() to register Inngest handler...');
|
|
24
36
|
const inngestHandler = express.serve({
|
|
25
37
|
client: inngestClient,
|
|
26
|
-
functions:
|
|
38
|
+
functions: inngestFunctions,
|
|
27
39
|
});
|
|
40
|
+
logger.info('✅ serve() completed successfully');
|
|
28
41
|
app.use('/api/inngest', inngestHandler);
|
|
29
|
-
logger.info(`✅ Inngest handler registered with ${
|
|
42
|
+
logger.info(`✅ Inngest handler registered at /api/inngest with ${inngestFunctions.length} functions`);
|
|
30
43
|
}
|
|
31
44
|
else {
|
|
32
45
|
logger.info('No Inngest functions found - handler not registered');
|
|
33
46
|
}
|
|
34
47
|
}
|
|
35
48
|
catch (error) {
|
|
36
|
-
logger.warn('Inngest handler registration failed:', error
|
|
49
|
+
logger.warn('Inngest handler registration failed:', error?.message || String(error));
|
|
50
|
+
logger.debug('Full error stack:', error?.stack || error);
|
|
51
|
+
if (error && typeof error === 'object') {
|
|
52
|
+
logger.debug('Error keys:', Object.keys(error));
|
|
53
|
+
}
|
|
37
54
|
}
|
|
38
55
|
}exports.setupInngestFunctions=setupInngestFunctions;//# sourceMappingURL=setup.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.cjs","sources":["../../src/inngest/setup.ts"],"sourcesContent":[null],"names":["serve"],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup.cjs","sources":["../../src/inngest/setup.ts"],"sourcesContent":[null],"names":["globalFunctionRegistry","serve"],"mappings":"kIAWA;;AAEG;AACI,eAAe,qBAAqB,CACvC,OAAgB,EAChB,GAAY,EACZ,gBAA2B,EAC3B,MAAe,EAAA;AAEf,IAAA,IAAI;;QAEA,MAAM,aAAa,GAAG,gBAAgB,CAAC,GAAG,CAAU,gBAAgB,CAAC,CAAC;AACtE,QAAA,MAAM,CAAC,IAAI,CAAC,mDAAmD,CAAC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AAE,aAAa;AACrB,gBAAA,SAAS,EAAE,gBAAgB;AAC9B,aAAA,CAAC,CAAC;AACH,YAAA,MAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;AAEhD,YAAA,GAAG,CAAC,GAAG,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;YACxC,MAAM,CAAC,IAAI,CAAC,CAAA,kDAAA,EAAqD,gBAAgB,CAAC,MAAM,CAAY,UAAA,CAAA,CAAC,CAAC;SACzG;aAAM;AACH,YAAA,MAAM,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAC;SACtE;KACJ;IAAC,OAAO,KAAK,EAAE;AACZ,QAAA,MAAM,CAAC,IAAI,CAAC,sCAAsC,EAAE,KAAK,EAAE,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACrF,MAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,EAAE,KAAK,IAAI,KAAK,CAAC,CAAC;AACzD,QAAA,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACpC,YAAA,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SACnD;KACJ;AACL"}
|
package/lib/inngest/setup.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {serve}from'inngest/express';/**
|
|
1
|
+
import {serve}from'inngest/express';import {globalFunctionRegistry}from'./middleware/function-reference-helper.mjs';/**
|
|
2
2
|
* Sets up Inngest functions from the Feature system and registers the handler
|
|
3
3
|
*/
|
|
4
4
|
async function setupInngestFunctions(modules, app, serviceContainer, logger) {
|
|
@@ -6,33 +6,50 @@ async function setupInngestFunctions(modules, app, serviceContainer, logger) {
|
|
|
6
6
|
// Get Inngest client from the container (already bound in infraModule)
|
|
7
7
|
const inngestClient = serviceContainer.get('INNGEST_CLIENT');
|
|
8
8
|
logger.info('✅ Retrieved Inngest client from service container');
|
|
9
|
+
// Load Inngest functions from all modules
|
|
10
|
+
// The improved loadInngestFunctions now handles both array and object returns
|
|
9
11
|
const inngestFunctions = modules.loadInngestFunctions({
|
|
10
12
|
container: serviceContainer,
|
|
11
13
|
inngest: inngestClient,
|
|
12
14
|
settings: {},
|
|
13
15
|
});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
if (inngestFunctions.length > 0) {
|
|
17
|
+
logger.info(`✅ Loaded ${inngestFunctions.length} Inngest functions from Feature system`);
|
|
18
|
+
// Log function IDs for debugging
|
|
19
|
+
const functionIds = inngestFunctions
|
|
20
|
+
.filter((fn) => fn && fn.id)
|
|
21
|
+
.map((fn) => (typeof fn.id === 'function' ? fn.id() : fn.id))
|
|
22
|
+
.join(', ');
|
|
23
|
+
logger.debug(`Registering Inngest functions: ${functionIds}`);
|
|
24
|
+
// ✨ Register functions with global registry for referenceFunction() helper
|
|
25
|
+
logger.info('📝 Registering functions with global function registry...');
|
|
26
|
+
try {
|
|
27
|
+
globalFunctionRegistry.register(inngestFunctions);
|
|
28
|
+
logger.info(`✅ Registered ${globalFunctionRegistry.count} functions for referenceFunction() helper`);
|
|
29
|
+
logger.info('💡 You can now use: referenceFunction("function-id") or auto-invoke in step.invoke()');
|
|
17
30
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (flatFunctions.length > 0) {
|
|
31
|
+
catch (registryError) {
|
|
32
|
+
logger.error('❌ Error registering functions with global registry:', registryError);
|
|
33
|
+
}
|
|
34
|
+
// Register Inngest handler
|
|
35
|
+
logger.info('📞 Calling serve() to register Inngest handler...');
|
|
24
36
|
const inngestHandler = serve({
|
|
25
37
|
client: inngestClient,
|
|
26
|
-
functions:
|
|
38
|
+
functions: inngestFunctions,
|
|
27
39
|
});
|
|
40
|
+
logger.info('✅ serve() completed successfully');
|
|
28
41
|
app.use('/api/inngest', inngestHandler);
|
|
29
|
-
logger.info(`✅ Inngest handler registered with ${
|
|
42
|
+
logger.info(`✅ Inngest handler registered at /api/inngest with ${inngestFunctions.length} functions`);
|
|
30
43
|
}
|
|
31
44
|
else {
|
|
32
45
|
logger.info('No Inngest functions found - handler not registered');
|
|
33
46
|
}
|
|
34
47
|
}
|
|
35
48
|
catch (error) {
|
|
36
|
-
logger.warn('Inngest handler registration failed:', error
|
|
49
|
+
logger.warn('Inngest handler registration failed:', error?.message || String(error));
|
|
50
|
+
logger.debug('Full error stack:', error?.stack || error);
|
|
51
|
+
if (error && typeof error === 'object') {
|
|
52
|
+
logger.debug('Error keys:', Object.keys(error));
|
|
53
|
+
}
|
|
37
54
|
}
|
|
38
55
|
}export{setupInngestFunctions};//# sourceMappingURL=setup.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.mjs","sources":["../../src/inngest/setup.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup.mjs","sources":["../../src/inngest/setup.ts"],"sourcesContent":[null],"names":[],"mappings":"oHAWA;;AAEG;AACI,eAAe,qBAAqB,CACvC,OAAgB,EAChB,GAAY,EACZ,gBAA2B,EAC3B,MAAe,EAAA;AAEf,IAAA,IAAI;;QAEA,MAAM,aAAa,GAAG,gBAAgB,CAAC,GAAG,CAAU,gBAAgB,CAAC,CAAC;AACtE,QAAA,MAAM,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;;;AAIjE,QAAA,MAAM,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC;AAClD,YAAA,SAAS,EAAE,gBAAgB;AAC3B,YAAA,OAAO,EAAE,aAAa;AACtB,YAAA,QAAQ,EAAE,EAAE;AACf,SAAA,CAAC,CAAC;AAEH,QAAA,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;YAC7B,MAAM,CAAC,IAAI,CAAC,CAAA,SAAA,EAAY,gBAAgB,CAAC,MAAM,CAAwC,sCAAA,CAAA,CAAC,CAAC;;YAGzF,MAAM,WAAW,GAA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AAC,OAAO,KAAK,EAAE;AACZ,QAAA,MAAM,CAAC,IAAI,CAAC,sCAAsC,EAAE,KAAK,EAAE,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACrF,MAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,EAAE,KAAK,IAAI,KAAK,CAAC,CAAC;AACzD,QAAA,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACpC,YAAA,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SACnD;KACJ;AACL"}
|
|
@@ -6,10 +6,10 @@ function expressApp(modules, options, middlewares, http, redisClient$1) {
|
|
|
6
6
|
if (redisClient$1) {
|
|
7
7
|
app.use(redisClient.redisClientMiddleware(redisClient$1));
|
|
8
8
|
}
|
|
9
|
+
app.use(services.contextServicesMiddleware(options.createContext, options.serviceContext));
|
|
9
10
|
for (const applyBeforeware of modules.beforewares) {
|
|
10
11
|
applyBeforeware(app);
|
|
11
12
|
}
|
|
12
|
-
app.use(services.contextServicesMiddleware(options.createContext, options.serviceContext));
|
|
13
13
|
// Don't rate limit heroku
|
|
14
14
|
app.enable('trust proxy');
|
|
15
15
|
app.use(sentry.sentryMiddleware);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressApp.cjs","sources":["../../src/servers/ExpressApp.ts"],"sourcesContent":[null],"names":["redisClient","redisClientMiddleware","contextServicesMiddleware","sentryMiddleware","corsMiddleware","bodyParser","errorMiddleware","sentryErrorHandlerMiddleware"],"mappings":"wpBAAA;AAWM,SAAU,UAAU,CAAC,OAAgB,EAAE,OAAuB,EAAE,WAAW,EAAE,IAAK,EAAEA,aAAY,EAAA;AAClG,IAAA,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;;;IAItB,IAAIA,aAAW,EAAE;QACb,GAAG,CAAC,GAAG,CAACC,iCAAqB,CAACD,aAAW,CAAC,CAAC,CAAC;KAC/C;AAED,IAAA,
|
|
1
|
+
{"version":3,"file":"ExpressApp.cjs","sources":["../../src/servers/ExpressApp.ts"],"sourcesContent":[null],"names":["redisClient","redisClientMiddleware","contextServicesMiddleware","sentryMiddleware","corsMiddleware","bodyParser","errorMiddleware","sentryErrorHandlerMiddleware"],"mappings":"wpBAAA;AAWM,SAAU,UAAU,CAAC,OAAgB,EAAE,OAAuB,EAAE,WAAW,EAAE,IAAK,EAAEA,aAAY,EAAA;AAClG,IAAA,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;;;IAItB,IAAIA,aAAW,EAAE;QACb,GAAG,CAAC,GAAG,CAACC,iCAAqB,CAACD,aAAW,CAAC,CAAC,CAAC;KAC/C;AAED,IAAA,GAAG,CAAC,GAAG,CAACE,kCAAyB,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;AAClF,IAAA,KAAK,MAAM,eAAe,IAAI,OAAO,CAAC,WAAW,EAAE;QAC/C,eAAe,CAAC,GAAG,CAAC,CAAC;KACxB;;AAGD,IAAA,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AAE1B,IAAA,GAAG,CAAC,GAAG,CAACC,uBAAgB,CAAC,CAAC;AAE1B,IAAA,IAAI,WAAW,KAAK,IAAI,EAAE;AACtB,QAAA,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;KACxB;AAED,IAAA,GAAG,CAAC,GAAG,CAACC,mBAAc,CAAC,CAAC;IACxB,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,KAAI;AACvB,QAAA,GAAG,CAAC,MAAM,CAAC,kCAAkC,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AACrE,QAAA,GAAG,CAAC,MAAM,CAAC,8BAA8B,EAAE,qBAAqB,CAAC,CAAC;AAClE,QAAA,GAAG,CAAC,MAAM,CACN,8BAA8B,EAC9B,6EAA6E,CAChF,CAAC;AACF,QAAA,IAAI,EAAE,CAAC;AACX,KAAC,CAAC,CAAC;AAEH,IAAA,GAAG,CAAC,GAAG,CACHC,qBAAU,CAAC,IAAI,CAAC;AACZ,QAAA,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,KAAI;;AAErB,YAAA,GAAW,CAAC,OAAO,GAAG,GAAG,CAAC;SAC9B;AACJ,KAAA,CAAC,CACL,CAAC;IACF,GAAG,CAAC,GAAG,CAACA,qBAAU,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAEzF,IAAA,KAAK,MAAM,eAAe,IAAI,OAAO,CAAC,WAAW,EAAE;QAC/C,eAAe,CAAC,GAAG,CAAC,CAAC;KACxB;IAED,IAAI,OAAO,EAAE;AACT,QAAA,GAAG,CAAC,GAAG,CAACC,qBAAe,CAAC,CAAC;KAC5B;AAED,IAAA,GAAG,CAAC,GAAG,CAACC,mCAA4B,CAAC,CAAC;AAEtC,IAAA,OAAO,GAAG,CAAC;AACf"}
|
|
@@ -6,10 +6,10 @@ function expressApp(modules, options, middlewares, http, redisClient) {
|
|
|
6
6
|
if (redisClient) {
|
|
7
7
|
app.use(redisClientMiddleware(redisClient));
|
|
8
8
|
}
|
|
9
|
+
app.use(contextServicesMiddleware(options.createContext, options.serviceContext));
|
|
9
10
|
for (const applyBeforeware of modules.beforewares) {
|
|
10
11
|
applyBeforeware(app);
|
|
11
12
|
}
|
|
12
|
-
app.use(contextServicesMiddleware(options.createContext, options.serviceContext));
|
|
13
13
|
// Don't rate limit heroku
|
|
14
14
|
app.enable('trust proxy');
|
|
15
15
|
app.use(sentryMiddleware);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressApp.mjs","sources":["../../src/servers/ExpressApp.ts"],"sourcesContent":[null],"names":[],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AAC,CAAC,CAAC;AACrE,QAAA,GAAG,CAAC,MAAM,CAAC,8BAA8B,EAAE,qBAAqB,CAAC,CAAC;AAClE,QAAA,GAAG,CAAC,MAAM,CACN,8BAA8B,EAC9B,6EAA6E,CAChF,CAAC;AACF,QAAA,IAAI,EAAE,CAAC;AACX,KAAC,CAAC,CAAC;AAEH,IAAA,GAAG,CAAC,GAAG,CACH,UAAU,CAAC,IAAI,CAAC;AACZ,QAAA,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,KAAI;;AAErB,YAAA,GAAW,CAAC,OAAO,GAAG,GAAG,CAAC;SAC9B;AACJ,KAAA,CAAC,CACL,CAAC;IACF,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAEzF,IAAA,KAAK,MAAM,eAAe,IAAI,OAAO,CAAC,WAAW,EAAE;QAC/C,eAAe,CAAC,GAAG,CAAC,CAAC;KACxB;IAED,IAAI,OAAO,EAAE;AACT,QAAA,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;KAC5B;AAED,IAAA,GAAG,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAEtC,IAAA,OAAO,GAAG,CAAC;AACf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/server-stack",
|
|
3
|
-
"version": "7.2.1-alpha.
|
|
3
|
+
"version": "7.2.1-alpha.51",
|
|
4
4
|
"description": "common core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@cdm-logger/client": "^9.0.8",
|
|
33
33
|
"@cdm-logger/server": "^9.0.15",
|
|
34
34
|
"@cdmbase/graphql-type-uri": "^4.0.0",
|
|
35
|
-
"@common-stack/graphql-api": "7.2.1-alpha.
|
|
35
|
+
"@common-stack/graphql-api": "7.2.1-alpha.51",
|
|
36
36
|
"@graphql-tools/links": "~9.0.1",
|
|
37
37
|
"@graphql-tools/schema": "~10.0.6",
|
|
38
38
|
"@graphql-tools/stitch": "~9.2.10",
|
|
@@ -76,11 +76,12 @@
|
|
|
76
76
|
"rxjs": "^7.8.1",
|
|
77
77
|
"subscriptions-transport-ws": "^0.11.0",
|
|
78
78
|
"universal-cookie-express": "^4.0.1",
|
|
79
|
-
"ws": "^8.11.0"
|
|
79
|
+
"ws": "^8.11.0",
|
|
80
|
+
"zod": "^4.0.0"
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
82
|
-
"@common-stack/server-core": "7.2.1-alpha.
|
|
83
|
-
"common": "7.2.1-alpha.
|
|
83
|
+
"@common-stack/server-core": "7.2.1-alpha.50",
|
|
84
|
+
"common": "7.2.1-alpha.49"
|
|
84
85
|
},
|
|
85
86
|
"peerDependencies": {
|
|
86
87
|
"@cdm-logger/core": ">=7.0.12",
|
|
@@ -90,7 +91,7 @@
|
|
|
90
91
|
"publishConfig": {
|
|
91
92
|
"access": "public"
|
|
92
93
|
},
|
|
93
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "7e302a64ca7eeec54f1f621ee85da2ea3b4c6b6c",
|
|
94
95
|
"typescript": {
|
|
95
96
|
"definition": "lib/index.d.ts"
|
|
96
97
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|