@envelop/core
Advanced tools
Comparing version 5.1.0-alpha-20250218184439-60549a8c807f873679d6aed228e4810334344231 to 5.1.0-alpha-20250219000503-0cdd4823cb59c8fb01b05a0352613389d21888be
@@ -5,3 +5,2 @@ "use strict"; | ||
const orchestrator_js_1 = require("./orchestrator.js"); | ||
const tracer_js_1 = require("./tracer.js"); | ||
function notEmpty(value) { | ||
@@ -12,16 +11,14 @@ return value != null; | ||
const plugins = options.plugins.filter(notEmpty); | ||
const tracer = (0, tracer_js_1.getTracer)(plugins); | ||
const orchestrator = (0, orchestrator_js_1.createEnvelopOrchestrator)({ | ||
plugins, | ||
}); | ||
const getEnveloped = (context = {}) => { | ||
const traced = (0, tracer_js_1.getTraced)({ context }); | ||
const getEnveloped = (initialContext = {}) => { | ||
const typedOrchestrator = orchestrator; | ||
traced.fn(tracer?.init, orchestrator.init)(context); | ||
typedOrchestrator.init(initialContext); | ||
return { | ||
parse: traced.fn(tracer?.parse, typedOrchestrator.parse(context)), | ||
validate: traced.fn(tracer?.validate, typedOrchestrator.validate(context)), | ||
contextFactory: traced.fn(tracer?.context, typedOrchestrator.contextFactory(context)), | ||
execute: traced.asyncFn(tracer?.execute, typedOrchestrator.execute), | ||
subscribe: traced.asyncFn(tracer?.subscribe, typedOrchestrator.subscribe), | ||
parse: typedOrchestrator.parse(initialContext), | ||
validate: typedOrchestrator.validate(initialContext), | ||
contextFactory: typedOrchestrator.contextFactory(initialContext), | ||
execute: typedOrchestrator.execute, | ||
subscribe: typedOrchestrator.subscribe, | ||
schema: typedOrchestrator.getCurrentSchema(), | ||
@@ -28,0 +25,0 @@ }; |
@@ -18,4 +18,3 @@ "use strict"; | ||
tslib_1.__exportStar(require("./plugins/use-validation-rule.js"), exports); | ||
tslib_1.__exportStar(require("./tracer.js"), exports); | ||
var document_string_map_js_1 = require("./document-string-map.js"); | ||
Object.defineProperty(exports, "getDocumentString", { enumerable: true, get: function () { return document_string_map_js_1.getDocumentString; } }); |
import { createEnvelopOrchestrator } from './orchestrator.js'; | ||
import { getTraced, getTracer } from './tracer.js'; | ||
function notEmpty(value) { | ||
@@ -8,16 +7,14 @@ return value != null; | ||
const plugins = options.plugins.filter(notEmpty); | ||
const tracer = getTracer(plugins); | ||
const orchestrator = createEnvelopOrchestrator({ | ||
plugins, | ||
}); | ||
const getEnveloped = (context = {}) => { | ||
const traced = getTraced({ context }); | ||
const getEnveloped = (initialContext = {}) => { | ||
const typedOrchestrator = orchestrator; | ||
traced.fn(tracer?.init, orchestrator.init)(context); | ||
typedOrchestrator.init(initialContext); | ||
return { | ||
parse: traced.fn(tracer?.parse, typedOrchestrator.parse(context)), | ||
validate: traced.fn(tracer?.validate, typedOrchestrator.validate(context)), | ||
contextFactory: traced.fn(tracer?.context, typedOrchestrator.contextFactory(context)), | ||
execute: traced.asyncFn(tracer?.execute, typedOrchestrator.execute), | ||
subscribe: traced.asyncFn(tracer?.subscribe, typedOrchestrator.subscribe), | ||
parse: typedOrchestrator.parse(initialContext), | ||
validate: typedOrchestrator.validate(initialContext), | ||
contextFactory: typedOrchestrator.contextFactory(initialContext), | ||
execute: typedOrchestrator.execute, | ||
subscribe: typedOrchestrator.subscribe, | ||
schema: typedOrchestrator.getCurrentSchema(), | ||
@@ -24,0 +21,0 @@ }; |
@@ -14,3 +14,2 @@ // eslint-disable-next-line import/export | ||
export * from './plugins/use-validation-rule.js'; | ||
export * from './tracer.js'; | ||
export { getDocumentString } from './document-string-map.js'; |
{ | ||
"name": "@envelop/core", | ||
"version": "5.1.0-alpha-20250218184439-60549a8c807f873679d6aed228e4810334344231", | ||
"version": "5.1.0-alpha-20250219000503-0cdd4823cb59c8fb01b05a0352613389d21888be", | ||
"sideEffects": false, | ||
"dependencies": { | ||
"@envelop/types": "5.1.0-alpha-20250218184439-60549a8c807f873679d6aed228e4810334344231", | ||
"@envelop/types": "5.1.0-alpha-20250219000503-0cdd4823cb59c8fb01b05a0352613389d21888be", | ||
"tslib": "^2.5.0" | ||
@@ -8,0 +8,0 @@ }, |
@@ -13,3 +13,2 @@ export * from '@envelop/types'; | ||
export * from './plugins/use-validation-rule.js'; | ||
export * from './tracer.js'; | ||
export { getDocumentString } from './document-string-map.js'; |
Sorry, the diff of this file is not supported yet
92000
60
2134