@loutrejs/loutre 0.5.0 → 0.7.0
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/README.md +63 -32
- package/dist/adapters/aws-lambda.d.ts +5 -3
- package/dist/adapters/aws-lambda.js +53 -23
- package/dist/adapters/bun.d.ts +7 -4
- package/dist/adapters/bun.js +52 -42
- package/dist/adapters/cloudflare-workers.d.ts +5 -3
- package/dist/adapters/cloudflare-workers.js +23 -28
- package/dist/adapters/deno.d.ts +7 -4
- package/dist/adapters/deno.js +94 -57
- package/dist/adapters/electron.d.ts +13 -5
- package/dist/adapters/electron.js +76 -28
- package/dist/application/definition.d.ts +31 -0
- package/dist/application/definition.js +16 -0
- package/dist/application/index.d.ts +4 -63
- package/dist/application/index.js +2 -11
- package/dist/application/kernel-internal.d.ts +2 -0
- package/dist/application/kernel-internal.js +10 -0
- package/dist/application/kernel.d.ts +22 -0
- package/dist/application/kernel.js +65 -0
- package/dist/core/diagnostic.d.ts +9 -0
- package/dist/core/diagnostic.js +9 -0
- package/dist/core/extension.d.ts +118 -0
- package/dist/core/extension.js +73 -0
- package/dist/core/generic-layer.d.ts +26 -0
- package/dist/core/generic-layer.js +116 -0
- package/dist/core/index.d.ts +32 -15
- package/dist/core/index.js +15 -15
- package/dist/core/injection.d.ts +4 -13
- package/dist/core/injection.js +63 -0
- package/dist/core/instrumentation.d.ts +36 -0
- package/dist/core/model/context.d.ts +18 -0
- package/dist/core/model/context.js +34 -0
- package/dist/core/model/lifecycle.d.ts +5 -0
- package/dist/core/model/lifecycle.js +44 -0
- package/dist/core/model/modules.d.ts +2 -0
- package/dist/core/model/modules.js +101 -0
- package/dist/core/model/providers.d.ts +4 -0
- package/dist/core/model/providers.js +74 -0
- package/dist/core/model/snapshot.d.ts +6 -0
- package/dist/core/model/snapshot.js +31 -0
- package/dist/core/model/types.d.ts +78 -0
- package/dist/core/model/types.js +1 -0
- package/dist/core/model/validation.d.ts +4 -0
- package/dist/core/model/validation.js +40 -0
- package/dist/core/model/visibility.d.ts +4 -0
- package/dist/core/model/visibility.js +20 -0
- package/dist/core/model.d.ts +10 -0
- package/dist/core/model.js +346 -0
- package/dist/core/module.d.ts +8 -13
- package/dist/core/source-location.d.ts +8 -0
- package/dist/core/source-location.js +31 -0
- package/dist/core/token-internal.d.ts +3 -0
- package/dist/core/token-internal.js +4 -0
- package/dist/core/type.d.ts +7 -0
- package/dist/core/type.js +4 -0
- package/dist/devtools/capsule.d.ts +51 -0
- package/dist/devtools/capsule.js +245 -0
- package/dist/devtools/index.d.ts +11 -0
- package/dist/devtools/index.js +6 -0
- package/dist/devtools/inspector.d.ts +57 -0
- package/dist/devtools/inspector.js +1 -0
- package/dist/devtools/module.d.ts +18 -0
- package/dist/devtools/module.js +26 -0
- package/dist/devtools/observer.d.ts +77 -0
- package/dist/devtools/observer.js +10 -0
- package/dist/devtools/protocol.d.ts +1 -0
- package/dist/devtools/protocol.js +1 -0
- package/dist/devtools/provider-instrumentation.d.ts +14 -0
- package/dist/devtools/provider-instrumentation.js +117 -0
- package/dist/devtools/runtime.d.ts +20 -0
- package/dist/devtools/runtime.js +519 -0
- package/dist/devtools/values.d.ts +35 -0
- package/dist/devtools/values.js +175 -0
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/graph/index.d.ts +2 -3
- package/dist/graph/index.js +1 -3
- package/dist/graph/model.d.ts +34 -0
- package/dist/graph/model.js +127 -0
- package/dist/http/auth.d.ts +46 -0
- package/dist/http/auth.js +96 -0
- package/dist/http/client.d.ts +28 -31
- package/dist/http/client.js +58 -44
- package/dist/http/cors-internal.d.ts +29 -0
- package/dist/http/cors-internal.js +160 -0
- package/dist/http/cors.d.ts +5 -8
- package/dist/http/cors.js +7 -165
- package/dist/http/extension.d.ts +348 -0
- package/dist/http/extension.js +1061 -0
- package/dist/http/index.d.ts +9 -7
- package/dist/http/index.js +5 -7
- package/dist/{application → http}/openapi.d.ts +12 -3
- package/dist/{application → http}/openapi.js +164 -102
- package/dist/http/path.d.ts +1 -42
- package/dist/http/path.js +1 -2
- package/dist/http/runtime/request.d.ts +17 -0
- package/dist/http/runtime/request.js +109 -0
- package/dist/http/runtime/response.d.ts +18 -0
- package/dist/http/runtime/response.js +108 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/message-port/extension.d.ts +66 -0
- package/dist/message-port/extension.js +411 -0
- package/dist/message-port/index.d.ts +4 -73
- package/dist/message-port/index.js +2 -189
- package/dist/message-port/transport.d.ts +11 -0
- package/dist/message-port/transport.js +45 -0
- package/dist/runtime/async-iterator-lifecycle.d.ts +12 -0
- package/dist/runtime/async-iterator-lifecycle.js +95 -0
- package/dist/runtime/capability.d.ts +11 -11
- package/dist/runtime/capability.js +3 -3
- package/dist/runtime/di.d.ts +5 -21
- package/dist/runtime/di.js +22 -289
- package/dist/runtime/execution-tracker.d.ts +8 -0
- package/dist/runtime/execution-tracker.js +54 -0
- package/dist/runtime/index.d.ts +15 -9
- package/dist/runtime/index.js +9 -9
- package/dist/runtime/ingress-gate.d.ts +7 -0
- package/dist/runtime/ingress-gate.js +33 -0
- package/dist/runtime/kernel.d.ts +25 -0
- package/dist/runtime/kernel.js +447 -0
- package/dist/runtime/logger.d.ts +2 -0
- package/dist/runtime/logger.js +2 -0
- package/dist/runtime/node-capabilities.d.ts +1 -1
- package/dist/runtime/node-capabilities.js +1 -1
- package/dist/runtime/server-port.d.ts +2 -0
- package/dist/runtime/server-port.js +11 -0
- package/dist/tasks/extension.d.ts +144 -0
- package/dist/tasks/extension.js +525 -0
- package/dist/tasks/index.d.ts +2 -0
- package/dist/tasks/index.js +1 -0
- package/dist/tasks/runtime/cron.d.ts +6 -0
- package/dist/tasks/runtime/cron.js +89 -0
- package/dist/websocket/errors.d.ts +9 -0
- package/dist/websocket/errors.js +18 -0
- package/dist/websocket/extension.d.ts +154 -0
- package/dist/websocket/extension.js +533 -0
- package/dist/websocket/index.d.ts +3 -0
- package/dist/websocket/index.js +2 -0
- package/package.json +16 -16
- package/dist/application/binding.d.ts +0 -33
- package/dist/application/binding.js +0 -295
- package/dist/application/host.d.ts +0 -8
- package/dist/application/host.js +0 -14
- package/dist/application/queue.d.ts +0 -3
- package/dist/application/queue.js +0 -4
- package/dist/application/scheduler.d.ts +0 -2
- package/dist/application/scheduler.js +0 -45
- package/dist/core/context-key.d.ts +0 -16
- package/dist/core/context-key.js +0 -17
- package/dist/core/contract-internal.d.ts +0 -22
- package/dist/core/contract-internal.js +0 -61
- package/dist/core/contract.d.ts +0 -96
- package/dist/core/contract.js +0 -88
- package/dist/core/execution.d.ts +0 -78
- package/dist/core/execution.js +0 -61
- package/dist/core/implementation.d.ts +0 -44
- package/dist/core/implementation.js +0 -35
- package/dist/core/layer.d.ts +0 -137
- package/dist/core/layer.js +0 -81
- package/dist/graph/compiler.d.ts +0 -4
- package/dist/graph/compiler.js +0 -228
- package/dist/graph/graph.d.ts +0 -18
- package/dist/graph/graph.js +0 -1118
- package/dist/graph/ir.d.ts +0 -175
- package/dist/http/application.d.ts +0 -18
- package/dist/http/application.js +0 -515
- package/dist/http/basic-auth.d.ts +0 -37
- package/dist/http/basic-auth.js +0 -67
- package/dist/http/definitions.d.ts +0 -363
- package/dist/http/definitions.js +0 -310
- package/dist/http/hosted-protocol.d.ts +0 -4
- package/dist/http/hosted-protocol.js +0 -4
- package/dist/http/internal.d.ts +0 -8
- package/dist/http/internal.js +0 -1
- package/dist/http/params.d.ts +0 -2
- package/dist/http/params.js +0 -19
- package/dist/http/request-body.d.ts +0 -4
- package/dist/http/request-body.js +0 -6
- package/dist/http/validate.d.ts +0 -20
- package/dist/http/validate.js +0 -6
- package/dist/message-port/environment.d.ts +0 -2
- package/dist/message-port/environment.js +0 -4
- package/dist/runtime/application.d.ts +0 -38
- package/dist/runtime/application.js +0 -339
- package/dist/runtime/pipeline.d.ts +0 -11
- package/dist/runtime/pipeline.js +0 -161
- /package/dist/{graph/ir.js → core/instrumentation.js} +0 -0
package/dist/graph/ir.d.ts
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
export interface ModuleIR {
|
|
2
|
-
readonly id: string;
|
|
3
|
-
readonly name?: string;
|
|
4
|
-
readonly description?: string;
|
|
5
|
-
readonly imports: readonly string[];
|
|
6
|
-
readonly environment: readonly string[];
|
|
7
|
-
readonly providers: readonly string[];
|
|
8
|
-
readonly exports: readonly string[];
|
|
9
|
-
readonly lifecycle: readonly string[];
|
|
10
|
-
readonly requires: readonly string[];
|
|
11
|
-
}
|
|
12
|
-
export interface ProviderIR {
|
|
13
|
-
readonly token: string;
|
|
14
|
-
readonly kind: 'class' | 'value' | 'factory' | 'conditional' | 'environment' | 'arguments';
|
|
15
|
-
readonly scope: 'application' | 'transient';
|
|
16
|
-
readonly dependencies: readonly string[];
|
|
17
|
-
}
|
|
18
|
-
export interface DependencyNodeIR {
|
|
19
|
-
readonly id: string;
|
|
20
|
-
readonly label: string;
|
|
21
|
-
readonly kind: 'class' | 'token' | 'factory' | 'conditional' | 'environment' | 'arguments' | 'implementation' | 'layer' | 'task' | 'framework';
|
|
22
|
-
readonly scope?: 'application' | 'transient';
|
|
23
|
-
readonly module?: string;
|
|
24
|
-
readonly visibility?: 'private' | 'exported';
|
|
25
|
-
}
|
|
26
|
-
export interface DependencyEdgeIR {
|
|
27
|
-
readonly from: string;
|
|
28
|
-
readonly to: string;
|
|
29
|
-
readonly kind: 'inject' | 'factory' | 'lifecycle' | 'conditional' | 'framework';
|
|
30
|
-
readonly source: 'declared' | 'probed';
|
|
31
|
-
readonly condition?: {
|
|
32
|
-
readonly source: 'environment' | 'arguments';
|
|
33
|
-
readonly contract: string;
|
|
34
|
-
readonly key: string;
|
|
35
|
-
readonly equals: PropertyKey;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export interface TokenIR {
|
|
39
|
-
readonly id: string;
|
|
40
|
-
}
|
|
41
|
-
export interface ContextKeyIR {
|
|
42
|
-
readonly name: string;
|
|
43
|
-
}
|
|
44
|
-
export interface LayerIR {
|
|
45
|
-
readonly index: number;
|
|
46
|
-
readonly name: string;
|
|
47
|
-
readonly role: 'generic' | 'authentication' | 'guard' | 'validation' | 'framework' | 'terminal';
|
|
48
|
-
readonly requires: readonly string[];
|
|
49
|
-
readonly provides: readonly string[];
|
|
50
|
-
readonly returns?: readonly string[];
|
|
51
|
-
readonly requiresValidated: readonly string[];
|
|
52
|
-
readonly dependencies?: readonly string[];
|
|
53
|
-
readonly attributes?: Readonly<Record<string, string | number | boolean>>;
|
|
54
|
-
readonly pipeline?: readonly LayerIR[];
|
|
55
|
-
readonly shortCircuits?: readonly {
|
|
56
|
-
readonly protocol: string;
|
|
57
|
-
readonly variant: string;
|
|
58
|
-
readonly response?: Readonly<Record<string, unknown>>;
|
|
59
|
-
}[];
|
|
60
|
-
}
|
|
61
|
-
export type ContractId = `contract:${number}`;
|
|
62
|
-
export type ImplementationId = `implementation:${number}`;
|
|
63
|
-
export interface ContractProtocolIR {
|
|
64
|
-
readonly name: string;
|
|
65
|
-
readonly dispatchKey: string | null;
|
|
66
|
-
readonly interaction: string;
|
|
67
|
-
}
|
|
68
|
-
export interface ContractProcedureIR {
|
|
69
|
-
readonly name: string;
|
|
70
|
-
readonly protocols: readonly ContractProtocolIR[];
|
|
71
|
-
}
|
|
72
|
-
export interface ContractIR {
|
|
73
|
-
readonly id: ContractId;
|
|
74
|
-
readonly procedures: readonly ContractProcedureIR[];
|
|
75
|
-
}
|
|
76
|
-
export interface PipelineIR {
|
|
77
|
-
readonly contract: ContractId;
|
|
78
|
-
readonly procedure: string;
|
|
79
|
-
readonly protocol: string;
|
|
80
|
-
readonly layers: readonly LayerIR[];
|
|
81
|
-
}
|
|
82
|
-
export interface ImplementationIR {
|
|
83
|
-
readonly id: ImplementationId;
|
|
84
|
-
readonly name: string;
|
|
85
|
-
readonly contract: ContractId;
|
|
86
|
-
readonly protocol: string;
|
|
87
|
-
readonly procedures: readonly string[];
|
|
88
|
-
}
|
|
89
|
-
export interface CapabilityIR {
|
|
90
|
-
readonly name: string;
|
|
91
|
-
readonly scope: 'application' | 'execution';
|
|
92
|
-
readonly requiredBy: string;
|
|
93
|
-
}
|
|
94
|
-
export interface ProtocolExecutionRootIR {
|
|
95
|
-
readonly id: `protocol:${string}`;
|
|
96
|
-
readonly kind: 'protocol';
|
|
97
|
-
readonly protocol: string;
|
|
98
|
-
readonly contract: ContractId;
|
|
99
|
-
readonly procedure: string;
|
|
100
|
-
readonly implementation: ImplementationId;
|
|
101
|
-
}
|
|
102
|
-
export interface ApplicationArgumentsIR {
|
|
103
|
-
readonly name: string;
|
|
104
|
-
}
|
|
105
|
-
export interface TaskIR {
|
|
106
|
-
readonly id: `task:${string}`;
|
|
107
|
-
readonly name: string;
|
|
108
|
-
readonly public: boolean;
|
|
109
|
-
}
|
|
110
|
-
export interface TaskExecutionRootIR {
|
|
111
|
-
readonly id: `task:${string}`;
|
|
112
|
-
readonly kind: 'task';
|
|
113
|
-
readonly name: string;
|
|
114
|
-
}
|
|
115
|
-
export interface CronTriggerExecutionRootIR {
|
|
116
|
-
readonly id: `trigger:${string}`;
|
|
117
|
-
readonly kind: 'trigger';
|
|
118
|
-
readonly trigger: 'cron';
|
|
119
|
-
readonly name: string;
|
|
120
|
-
readonly expression: string;
|
|
121
|
-
readonly timezone: string;
|
|
122
|
-
readonly overlap: 'allow' | 'skip';
|
|
123
|
-
readonly task: string;
|
|
124
|
-
}
|
|
125
|
-
export interface FixedDelayTriggerExecutionRootIR {
|
|
126
|
-
readonly id: `trigger:${string}`;
|
|
127
|
-
readonly kind: 'trigger';
|
|
128
|
-
readonly trigger: 'fixed-delay';
|
|
129
|
-
readonly name: string;
|
|
130
|
-
readonly delay: number;
|
|
131
|
-
readonly immediate: boolean;
|
|
132
|
-
readonly task: string;
|
|
133
|
-
}
|
|
134
|
-
export interface QueueConsumerTriggerExecutionRootIR {
|
|
135
|
-
readonly id: `trigger:${string}`;
|
|
136
|
-
readonly kind: 'trigger';
|
|
137
|
-
readonly trigger: 'queue-consumer';
|
|
138
|
-
readonly name: string;
|
|
139
|
-
readonly queue: string;
|
|
140
|
-
readonly task: string;
|
|
141
|
-
}
|
|
142
|
-
export type TriggerExecutionRootIR = CronTriggerExecutionRootIR | FixedDelayTriggerExecutionRootIR | QueueConsumerTriggerExecutionRootIR;
|
|
143
|
-
export type ExecutionRootIR = ProtocolExecutionRootIR | TaskExecutionRootIR | TriggerExecutionRootIR;
|
|
144
|
-
export interface QueueIR {
|
|
145
|
-
readonly id: `queue:${string}`;
|
|
146
|
-
readonly name: string;
|
|
147
|
-
readonly payloadSchema: string;
|
|
148
|
-
}
|
|
149
|
-
export interface ApplicationGraphIR {
|
|
150
|
-
readonly modules: readonly ModuleIR[];
|
|
151
|
-
readonly arguments?: ApplicationArgumentsIR;
|
|
152
|
-
readonly providers: readonly ProviderIR[];
|
|
153
|
-
readonly tokens: readonly TokenIR[];
|
|
154
|
-
readonly contextKeys: readonly ContextKeyIR[];
|
|
155
|
-
readonly contracts: readonly ContractIR[];
|
|
156
|
-
readonly pipelines: readonly PipelineIR[];
|
|
157
|
-
readonly implementations: readonly ImplementationIR[];
|
|
158
|
-
readonly tasks: readonly TaskIR[];
|
|
159
|
-
readonly queues: readonly QueueIR[];
|
|
160
|
-
readonly executions: readonly ExecutionRootIR[];
|
|
161
|
-
readonly capabilities: readonly CapabilityIR[];
|
|
162
|
-
readonly hostCapabilities: readonly string[];
|
|
163
|
-
readonly nodes: readonly DependencyNodeIR[];
|
|
164
|
-
readonly edges: readonly DependencyEdgeIR[];
|
|
165
|
-
readonly diagnostics: readonly Diagnostic[];
|
|
166
|
-
}
|
|
167
|
-
export interface Diagnostic {
|
|
168
|
-
readonly code: string;
|
|
169
|
-
readonly message: string;
|
|
170
|
-
readonly path: string;
|
|
171
|
-
}
|
|
172
|
-
export interface CompilationResult {
|
|
173
|
-
readonly graph: ApplicationGraphIR;
|
|
174
|
-
readonly diagnostics: readonly Diagnostic[];
|
|
175
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ApplicationGraphIR } from '../graph/index.js';
|
|
2
|
-
import { ApplicationRuntime, Logger } from '../runtime/index.js';
|
|
3
|
-
export interface HttpProtocolExecution {
|
|
4
|
-
readonly graph: ApplicationGraphIR;
|
|
5
|
-
initialize(): Promise<void>;
|
|
6
|
-
shutdown(signal?: string): Promise<void>;
|
|
7
|
-
onServerListening(url: string): void;
|
|
8
|
-
handle(request: Request): Promise<Response>;
|
|
9
|
-
}
|
|
10
|
-
export interface HttpProtocolExecutionLifecycle {
|
|
11
|
-
readonly onServerListening?: (url: string) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare function createHttpExecution(options: {
|
|
14
|
-
readonly runtime: ApplicationRuntime;
|
|
15
|
-
readonly graph: ApplicationGraphIR;
|
|
16
|
-
readonly lifecycle?: HttpProtocolExecutionLifecycle;
|
|
17
|
-
readonly logger?: Logger;
|
|
18
|
-
}): HttpProtocolExecution;
|