definitely-fine 0.1.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/LICENSE +21 -0
- package/README.md +281 -0
- package/dist/index.d.ts +604 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +729 -0
- package/dist/index.js.map +1 -0
- package/package.json +29 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,604 @@
|
|
|
1
|
+
//#region src/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Generic callable shape used throughout definitely-fine contracts.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
type UnknownFunction = (...args: never[]) => unknown;
|
|
7
|
+
/**
|
|
8
|
+
* Contract shape for a named service whose values are callable methods.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
type ServiceContract = Record<string, UnknownFunction>;
|
|
12
|
+
/**
|
|
13
|
+
* Map of named services available to a system under test.
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
type ServiceContracts = Record<string, ServiceContract>;
|
|
17
|
+
/**
|
|
18
|
+
* Map of named top-level functions available to a system under test.
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
type FunctionContracts = Record<string, UnknownFunction>;
|
|
22
|
+
/**
|
|
23
|
+
* Map of named error factory functions available to a runtime.
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
type ErrorFactoryContracts = Record<string, UnknownFunction>;
|
|
27
|
+
/**
|
|
28
|
+
* Full contract definition for services, functions, and error factories.
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
type SutContract = {
|
|
32
|
+
/**
|
|
33
|
+
* Named service contracts whose members are callable methods.
|
|
34
|
+
*/
|
|
35
|
+
services: ServiceContracts;
|
|
36
|
+
/**
|
|
37
|
+
* Named top-level function contracts.
|
|
38
|
+
*/
|
|
39
|
+
functions: FunctionContracts;
|
|
40
|
+
/**
|
|
41
|
+
* Named error factory contracts available to runtime rules.
|
|
42
|
+
*/
|
|
43
|
+
errors: ErrorFactoryContracts;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Union of valid service names from a contract.
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
type ContractServiceName<TContract extends SutContract> = Extract<keyof TContract["services"], string>;
|
|
50
|
+
/**
|
|
51
|
+
* Union of valid function names from a contract.
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
type ContractFunctionName<TContract extends SutContract> = Extract<keyof TContract["functions"], string>;
|
|
55
|
+
/**
|
|
56
|
+
* Union of valid error factory names from a contract.
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
type ContractErrorFactoryName<TContract extends SutContract> = Extract<keyof TContract["errors"], string>;
|
|
60
|
+
/**
|
|
61
|
+
* Union of valid method names for a service in a contract.
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
type ContractServiceMethodName<TContract extends SutContract, TServiceName extends ContractServiceName<TContract>> = Extract<keyof TContract["services"][TServiceName], string>;
|
|
65
|
+
/**
|
|
66
|
+
* Function type for a named contract function.
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
type ContractFunction<TContract extends SutContract, TFunctionName extends ContractFunctionName<TContract>> = TContract["functions"][TFunctionName];
|
|
70
|
+
type SyncServiceMethodName<TService extends ServiceContract> = Extract<{ [TMethodName in keyof TService]: TService[TMethodName] extends ((...args: infer _Args) => PromiseLike<unknown>) ? never : TMethodName }[keyof TService], string>;
|
|
71
|
+
type AsyncServiceMethodName<TService extends ServiceContract> = Extract<{ [TMethodName in keyof TService]: TService[TMethodName] extends ((...args: infer _Args) => PromiseLike<unknown>) ? TMethodName : never }[keyof TService], string>;
|
|
72
|
+
type SyncContractFunctionName<TContract extends SutContract> = Extract<{ [TFunctionName in keyof TContract["functions"]]: TContract["functions"][TFunctionName] extends ((...args: infer _Args) => PromiseLike<unknown>) ? never : TFunctionName }[keyof TContract["functions"]], string>;
|
|
73
|
+
type AsyncContractFunctionName<TContract extends SutContract> = Extract<{ [TFunctionName in keyof TContract["functions"]]: TContract["functions"][TFunctionName] extends ((...args: infer _Args) => PromiseLike<unknown>) ? TFunctionName : never }[keyof TContract["functions"]], string>;
|
|
74
|
+
/**
|
|
75
|
+
* Method type for a named service method in a contract.
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
type ContractServiceMethod<TContract extends SutContract, TServiceName extends ContractServiceName<TContract>, TMethodName extends ContractServiceMethodName<TContract, TServiceName>> = TContract["services"][TServiceName][TMethodName];
|
|
79
|
+
type SyncContractServiceMethodName<TContract extends SutContract, TServiceName extends ContractServiceName<TContract>> = SyncServiceMethodName<TContract["services"][TServiceName]>;
|
|
80
|
+
type AsyncContractServiceMethodName<TContract extends SutContract, TServiceName extends ContractServiceName<TContract>> = AsyncServiceMethodName<TContract["services"][TServiceName]>;
|
|
81
|
+
type SyncContractServiceName<TContract extends SutContract> = Extract<{ [TServiceName in keyof TContract["services"]]: AsyncServiceMethodName<TContract["services"][TServiceName]> extends never ? TServiceName : never }[keyof TContract["services"]], string>;
|
|
82
|
+
type AsyncContractServiceName<TContract extends SutContract> = Extract<{ [TServiceName in keyof TContract["services"]]: SyncServiceMethodName<TContract["services"][TServiceName]> extends never ? TServiceName : never }[keyof TContract["services"]], string>;
|
|
83
|
+
/**
|
|
84
|
+
* Error factory type for a named contract factory.
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
87
|
+
type ContractErrorFactory<TContract extends SutContract, TFactoryName extends ContractErrorFactoryName<TContract>> = TContract["errors"][TFactoryName];
|
|
88
|
+
/**
|
|
89
|
+
* Resolved return value for a named contract function.
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
type ContractFunctionReturnValue<TContract extends SutContract, TFunctionName extends ContractFunctionName<TContract>> = Awaited<ReturnType<ContractFunction<TContract, TFunctionName>>>;
|
|
93
|
+
/**
|
|
94
|
+
* Resolved return value for a named contract service method.
|
|
95
|
+
* @public
|
|
96
|
+
*/
|
|
97
|
+
type ContractServiceMethodReturnValue<TContract extends SutContract, TServiceName extends ContractServiceName<TContract>, TMethodName extends ContractServiceMethodName<TContract, TServiceName>> = Awaited<ReturnType<ContractServiceMethod<TContract, TServiceName, TMethodName>>>;
|
|
98
|
+
/**
|
|
99
|
+
* First input argument accepted by a named contract error factory.
|
|
100
|
+
* @public
|
|
101
|
+
*/
|
|
102
|
+
type ContractErrorFactoryInput<TContract extends SutContract, TFactoryName extends ContractErrorFactoryName<TContract>> = Parameters<ContractErrorFactory<TContract, TFactoryName>>[0];
|
|
103
|
+
type ContractErrorFactoryParameters<TContract extends SutContract, TFactoryName extends ContractErrorFactoryName<TContract>> = Parameters<ContractErrorFactory<TContract, TFactoryName>>;
|
|
104
|
+
/**
|
|
105
|
+
* Tuple form accepted when configuring a thrown error factory action.
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
108
|
+
type ContractErrorFactoryArguments<TContract extends SutContract, TFactoryName extends ContractErrorFactoryName<TContract>> = ContractErrorFactoryParameters<TContract, TFactoryName>["length"] extends 0 ? [] : 0 extends ContractErrorFactoryParameters<TContract, TFactoryName>["length"] ? [input?: ContractErrorFactoryInput<TContract, TFactoryName>] : [input: ContractErrorFactoryInput<TContract, TFactoryName>];
|
|
109
|
+
/**
|
|
110
|
+
* Serialized identifier for a wrapped function or service method target.
|
|
111
|
+
* @public
|
|
112
|
+
*/
|
|
113
|
+
type SerializedTarget = {
|
|
114
|
+
/**
|
|
115
|
+
* Marks the target as a service method.
|
|
116
|
+
*/
|
|
117
|
+
kind: "service-method";
|
|
118
|
+
/**
|
|
119
|
+
* Service name that owns the intercepted method.
|
|
120
|
+
*/
|
|
121
|
+
service: string;
|
|
122
|
+
/**
|
|
123
|
+
* Method name being intercepted on the service.
|
|
124
|
+
*/
|
|
125
|
+
method: string;
|
|
126
|
+
} | {
|
|
127
|
+
/**
|
|
128
|
+
* Marks the target as a top-level function.
|
|
129
|
+
*/
|
|
130
|
+
kind: "function";
|
|
131
|
+
/**
|
|
132
|
+
* Function name being intercepted.
|
|
133
|
+
*/
|
|
134
|
+
function: string;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Serialized scenario action executed when a rule matches.
|
|
138
|
+
* @public
|
|
139
|
+
*/
|
|
140
|
+
type SerializedAction = {
|
|
141
|
+
/**
|
|
142
|
+
* Marks the action as returning a value.
|
|
143
|
+
*/
|
|
144
|
+
kind: "return";
|
|
145
|
+
/**
|
|
146
|
+
* Value returned to the caller when the rule matches.
|
|
147
|
+
*/
|
|
148
|
+
value: unknown;
|
|
149
|
+
} | {
|
|
150
|
+
/**
|
|
151
|
+
* Marks the action as throwing a plain error message.
|
|
152
|
+
*/
|
|
153
|
+
kind: "throw-message";
|
|
154
|
+
/**
|
|
155
|
+
* Error message thrown when the rule matches.
|
|
156
|
+
*/
|
|
157
|
+
message: string;
|
|
158
|
+
} | {
|
|
159
|
+
/**
|
|
160
|
+
* Marks the action as invoking an error factory.
|
|
161
|
+
*/
|
|
162
|
+
kind: "throw-factory";
|
|
163
|
+
/**
|
|
164
|
+
* Registered error factory name to invoke.
|
|
165
|
+
*/
|
|
166
|
+
factory: string;
|
|
167
|
+
/**
|
|
168
|
+
* Optional input passed to the error factory.
|
|
169
|
+
*/
|
|
170
|
+
input?: unknown;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Serialized interception rule for a single call target and call number.
|
|
174
|
+
* @public
|
|
175
|
+
*/
|
|
176
|
+
type SerializedRule = {
|
|
177
|
+
/**
|
|
178
|
+
* Target that this rule applies to.
|
|
179
|
+
*/
|
|
180
|
+
target: SerializedTarget;
|
|
181
|
+
/**
|
|
182
|
+
* One-based call number that activates this rule.
|
|
183
|
+
*/
|
|
184
|
+
callNumber: number;
|
|
185
|
+
/**
|
|
186
|
+
* Action executed when the target is called at the matching count.
|
|
187
|
+
*/
|
|
188
|
+
action: SerializedAction;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Serialized scenario document persisted by storage adapters.
|
|
192
|
+
* @public
|
|
193
|
+
*/
|
|
194
|
+
type SerializedScenario = {
|
|
195
|
+
/**
|
|
196
|
+
* Stable identifier for the persisted scenario.
|
|
197
|
+
*/
|
|
198
|
+
id: string;
|
|
199
|
+
/**
|
|
200
|
+
* Persisted schema version for the scenario document.
|
|
201
|
+
*/
|
|
202
|
+
version: 1;
|
|
203
|
+
/**
|
|
204
|
+
* ISO timestamp when the scenario was created.
|
|
205
|
+
*/
|
|
206
|
+
createdAt: string;
|
|
207
|
+
/**
|
|
208
|
+
* Ordered list of interception rules stored in the scenario.
|
|
209
|
+
*/
|
|
210
|
+
rules: SerializedRule[];
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Async-local context that carries the active runtime scenario id.
|
|
214
|
+
* @public
|
|
215
|
+
*/
|
|
216
|
+
type RuntimeScenarioContext = {
|
|
217
|
+
/**
|
|
218
|
+
* Scenario id currently active in async-local runtime context.
|
|
219
|
+
*/
|
|
220
|
+
scenarioId?: string;
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Registered runtime error factories keyed by contract factory name.
|
|
224
|
+
* @public
|
|
225
|
+
*/
|
|
226
|
+
type ErrorFactoryRegistry<TContract extends SutContract> = Partial<{ [TFactoryName in ContractErrorFactoryName<TContract>]: ContractErrorFactory<TContract, TFactoryName> }>;
|
|
227
|
+
/**
|
|
228
|
+
* Builder API for assigning an action to a single intercepted call.
|
|
229
|
+
* @public
|
|
230
|
+
*/
|
|
231
|
+
type ScenarioActionBuilder<TContract extends SutContract, TReturnValue> = {
|
|
232
|
+
returns(value: TReturnValue): ScenarioBuilder<TContract>;
|
|
233
|
+
throwsMessage(message: string): ScenarioBuilder<TContract>;
|
|
234
|
+
throwsFactory<TFactoryName extends ContractErrorFactoryName<TContract>>(factory: TFactoryName, ...args: ContractErrorFactoryArguments<TContract, TFactoryName>): ScenarioBuilder<TContract>;
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* Builder API for configuring rules for a named function.
|
|
238
|
+
* @public
|
|
239
|
+
*/
|
|
240
|
+
type ScenarioFunctionRuleBuilder<TContract extends SutContract, TFunctionName extends ContractFunctionName<TContract>> = {
|
|
241
|
+
onCall(callNumber: number): ScenarioActionBuilder<TContract, ContractFunctionReturnValue<TContract, TFunctionName>>;
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* Builder API for configuring rules for a named service method.
|
|
245
|
+
* @public
|
|
246
|
+
*/
|
|
247
|
+
type ScenarioServiceMethodRuleBuilder<TContract extends SutContract, TServiceName extends ContractServiceName<TContract>, TMethodName extends ContractServiceMethodName<TContract, TServiceName>> = {
|
|
248
|
+
onCall(callNumber: number): ScenarioActionBuilder<TContract, ContractServiceMethodReturnValue<TContract, TServiceName, TMethodName>>;
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* Builder API for selecting a method on a named service.
|
|
252
|
+
* @public
|
|
253
|
+
*/
|
|
254
|
+
type ScenarioServiceRuleBuilder<TContract extends SutContract, TServiceName extends ContractServiceName<TContract>> = {
|
|
255
|
+
method<TMethodName extends ContractServiceMethodName<TContract, TServiceName>>(method: TMethodName): ScenarioServiceMethodRuleBuilder<TContract, TServiceName, TMethodName>;
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* Scenario builder API used to author and persist interception rules.
|
|
259
|
+
* @public
|
|
260
|
+
*/
|
|
261
|
+
type ScenarioBuilder<TContract extends SutContract> = {
|
|
262
|
+
/**
|
|
263
|
+
* Phantom contract marker that preserves generic inference.
|
|
264
|
+
*/
|
|
265
|
+
readonly __contract?: TContract;
|
|
266
|
+
/**
|
|
267
|
+
* Scenario id that will be used for persistence and runtime lookup.
|
|
268
|
+
*/
|
|
269
|
+
readonly id: string;
|
|
270
|
+
service<TServiceName extends ContractServiceName<TContract>>(service: TServiceName): ScenarioServiceRuleBuilder<TContract, TServiceName>;
|
|
271
|
+
fn<TFunctionName extends ContractFunctionName<TContract>>(fn: TFunctionName): ScenarioFunctionRuleBuilder<TContract, TFunctionName>;
|
|
272
|
+
save(): Promise<void>;
|
|
273
|
+
dispose(): Promise<void>;
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* Runtime API for wrapping contract functions and services.
|
|
277
|
+
* @public
|
|
278
|
+
*/
|
|
279
|
+
type Runtime<TContract extends SutContract> = {
|
|
280
|
+
wrapSyncFunction<TFunctionName extends SyncContractFunctionName<TContract>>(name: TFunctionName, implementation: ContractFunction<TContract, TFunctionName>): ContractFunction<TContract, TFunctionName>;
|
|
281
|
+
wrapAsyncFunction<TFunctionName extends AsyncContractFunctionName<TContract>>(name: TFunctionName, implementation: ContractFunction<TContract, TFunctionName>): ContractFunction<TContract, TFunctionName>;
|
|
282
|
+
wrapSyncServiceMethod<TServiceName extends ContractServiceName<TContract>, TMethodName extends SyncContractServiceMethodName<TContract, TServiceName>>(...args: [service: TServiceName, method: TMethodName, implementation: ContractServiceMethod<TContract, TServiceName, TMethodName>]): ContractServiceMethod<TContract, TServiceName, TMethodName>;
|
|
283
|
+
wrapAsyncServiceMethod<TServiceName extends ContractServiceName<TContract>, TMethodName extends AsyncContractServiceMethodName<TContract, TServiceName>>(...args: [service: TServiceName, method: TMethodName, implementation: ContractServiceMethod<TContract, TServiceName, TMethodName>]): ContractServiceMethod<TContract, TServiceName, TMethodName>;
|
|
284
|
+
wrapSyncService<TServiceName extends SyncContractServiceName<TContract>>(service: TServiceName, implementation: TContract["services"][TServiceName]): TContract["services"][TServiceName];
|
|
285
|
+
wrapAsyncService<TServiceName extends AsyncContractServiceName<TContract>>(service: TServiceName, implementation: TContract["services"][TServiceName]): TContract["services"][TServiceName];
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region src/runtime-scenario-context.d.ts
|
|
290
|
+
/**
|
|
291
|
+
* Runs a callback inside a request-scoped runtime scenario context.
|
|
292
|
+
* @public
|
|
293
|
+
*
|
|
294
|
+
* @example
|
|
295
|
+
* ```ts
|
|
296
|
+
* runWithRuntimeScenarioContext({ scenarioId: "checkout" }, () => {
|
|
297
|
+
* return getRuntimeScenarioId();
|
|
298
|
+
* });
|
|
299
|
+
* ```
|
|
300
|
+
*/
|
|
301
|
+
declare function runWithRuntimeScenarioContext<TResult>(context: RuntimeScenarioContext, callback: () => TResult): TResult;
|
|
302
|
+
/**
|
|
303
|
+
* Returns the active runtime scenario id for the current async scope.
|
|
304
|
+
* @public
|
|
305
|
+
*
|
|
306
|
+
* @example
|
|
307
|
+
* ```ts
|
|
308
|
+
* const scenarioId = getRuntimeScenarioId();
|
|
309
|
+
* ```
|
|
310
|
+
*/
|
|
311
|
+
declare function getRuntimeScenarioId(): string | undefined;
|
|
312
|
+
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region src/services/interfaces/IScenarioStorageAdapter.d.ts
|
|
315
|
+
//# sourceMappingURL=runtime-scenario-context.d.ts.map
|
|
316
|
+
/**
|
|
317
|
+
* Storage contract for loading, saving, and deleting persisted scenarios.
|
|
318
|
+
* @public
|
|
319
|
+
*/
|
|
320
|
+
interface IScenarioStorageAdapter {
|
|
321
|
+
saveScenario(scenario: SerializedScenario): Promise<void>;
|
|
322
|
+
loadScenario(scenarioId: string): SerializedScenario | undefined;
|
|
323
|
+
deleteScenario(scenarioId: string): Promise<void>;
|
|
324
|
+
describeScenarioLocation?(scenarioId: string): string;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
//#endregion
|
|
328
|
+
//#region src/services/impls/JsonScenarioStorageAdapter.d.ts
|
|
329
|
+
//# sourceMappingURL=IScenarioStorageAdapter.d.ts.map
|
|
330
|
+
/**
|
|
331
|
+
* Options for the built-in JSON scenario storage adapter.
|
|
332
|
+
* @public
|
|
333
|
+
*/
|
|
334
|
+
type JsonScenarioStorageAdapterOptions = {
|
|
335
|
+
/**
|
|
336
|
+
* Directory where scenario JSON files should be stored.
|
|
337
|
+
*/
|
|
338
|
+
directory?: string;
|
|
339
|
+
};
|
|
340
|
+
type ResolveJsonScenarioStorageAdapterDirectoryOptions = {
|
|
341
|
+
/**
|
|
342
|
+
* Directory override for the resolved scenario storage location.
|
|
343
|
+
*/
|
|
344
|
+
directory?: string;
|
|
345
|
+
/**
|
|
346
|
+
* Module URL used to locate the installed package root.
|
|
347
|
+
*/
|
|
348
|
+
moduleUrl?: string;
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* Resolves the default directory used by the built-in JSON scenario adapter.
|
|
352
|
+
* @public
|
|
353
|
+
*
|
|
354
|
+
* @example
|
|
355
|
+
* ```ts
|
|
356
|
+
* import { resolveJsonScenarioStorageAdapterDirectory } from "definitely-fine";
|
|
357
|
+
*
|
|
358
|
+
* const directory = resolveJsonScenarioStorageAdapterDirectory({
|
|
359
|
+
* directory: ".definitely-fine",
|
|
360
|
+
* });
|
|
361
|
+
* ```
|
|
362
|
+
*/
|
|
363
|
+
declare function resolveJsonScenarioStorageAdapterDirectory(options: ResolveJsonScenarioStorageAdapterDirectoryOptions): string;
|
|
364
|
+
/**
|
|
365
|
+
* Persists scenarios as JSON files in a local directory.
|
|
366
|
+
*
|
|
367
|
+
* @example
|
|
368
|
+
* ```ts
|
|
369
|
+
* import { JsonScenarioStorageAdapter } from "definitely-fine";
|
|
370
|
+
*
|
|
371
|
+
* const adapter = new JsonScenarioStorageAdapter({
|
|
372
|
+
* directory: ".definitely-fine",
|
|
373
|
+
* });
|
|
374
|
+
* ```
|
|
375
|
+
* @public
|
|
376
|
+
*/
|
|
377
|
+
declare class JsonScenarioStorageAdapter implements IScenarioStorageAdapter {
|
|
378
|
+
readonly directory: string;
|
|
379
|
+
constructor(options?: JsonScenarioStorageAdapterOptions);
|
|
380
|
+
deleteScenario(scenarioId: string): Promise<void>;
|
|
381
|
+
describeScenarioLocation(scenarioId: string): string;
|
|
382
|
+
loadScenario(scenarioId: string): SerializedScenario | undefined;
|
|
383
|
+
saveScenario(scenario: SerializedScenario): Promise<void>;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region src/services/impls/RuntimeScenarioCacheService.d.ts
|
|
388
|
+
/**
|
|
389
|
+
* Cache retention configuration for loaded runtime scenarios.
|
|
390
|
+
* @public
|
|
391
|
+
*/
|
|
392
|
+
type RuntimeCacheOptions = {
|
|
393
|
+
/**
|
|
394
|
+
* Inactivity window before a cached scenario is evicted.
|
|
395
|
+
*/
|
|
396
|
+
ttlMs?: number;
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region src/runtime-errors.d.ts
|
|
401
|
+
/**
|
|
402
|
+
* Default runtime scenario cache with inactivity-based eviction.
|
|
403
|
+
* @internal
|
|
404
|
+
*/
|
|
405
|
+
/**
|
|
406
|
+
* Signals that runtime setup is missing required configuration.
|
|
407
|
+
* @public
|
|
408
|
+
*
|
|
409
|
+
* @example
|
|
410
|
+
* ```ts
|
|
411
|
+
* import { RuntimeConfigurationError } from "definitely-fine";
|
|
412
|
+
*
|
|
413
|
+
* throw new RuntimeConfigurationError("A scenario adapter is required.");
|
|
414
|
+
* ```
|
|
415
|
+
*/
|
|
416
|
+
declare class RuntimeConfigurationError extends Error {
|
|
417
|
+
constructor(message: string, options?: ErrorOptions);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
//#endregion
|
|
421
|
+
//#region src/index.d.ts
|
|
422
|
+
//# sourceMappingURL=runtime-errors.d.ts.map
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Storage options for persisting scenarios.
|
|
426
|
+
*
|
|
427
|
+
* Pass an explicit `adapter` to route persistence through custom storage, or a
|
|
428
|
+
* `directory` to keep using the built-in file adapter behavior.
|
|
429
|
+
*
|
|
430
|
+
* @example
|
|
431
|
+
* ```ts
|
|
432
|
+
* import {
|
|
433
|
+
* JsonScenarioStorageAdapter,
|
|
434
|
+
* createScenario,
|
|
435
|
+
* type IScenarioStorageAdapter,
|
|
436
|
+
* } from "definitely-fine";
|
|
437
|
+
*
|
|
438
|
+
* const customAdapter: IScenarioStorageAdapter = {
|
|
439
|
+
* async deleteScenario(_scenarioId) {},
|
|
440
|
+
* loadScenario(_scenarioId) {
|
|
441
|
+
* return undefined;
|
|
442
|
+
* },
|
|
443
|
+
* async saveScenario(_scenario) {},
|
|
444
|
+
* };
|
|
445
|
+
*
|
|
446
|
+
* createScenario({
|
|
447
|
+
* adapter: new JsonScenarioStorageAdapter({}),
|
|
448
|
+
* });
|
|
449
|
+
*
|
|
450
|
+
* createScenario({
|
|
451
|
+
* adapter: customAdapter,
|
|
452
|
+
* });
|
|
453
|
+
* ```
|
|
454
|
+
* @public
|
|
455
|
+
*/
|
|
456
|
+
type ScenarioOptions = {
|
|
457
|
+
/**
|
|
458
|
+
* Omit storage options to use the built-in JSON adapter with its inferred default directory.
|
|
459
|
+
*/
|
|
460
|
+
adapter?: never;
|
|
461
|
+
/**
|
|
462
|
+
* Omit storage options to use the built-in JSON adapter with its inferred default directory.
|
|
463
|
+
*/
|
|
464
|
+
directory?: never;
|
|
465
|
+
} | {
|
|
466
|
+
/**
|
|
467
|
+
* Directory where the scenario should be saved.
|
|
468
|
+
*/
|
|
469
|
+
directory: string;
|
|
470
|
+
/**
|
|
471
|
+
* Explicit adapters cannot be combined with a directory.
|
|
472
|
+
*/
|
|
473
|
+
adapter?: never;
|
|
474
|
+
} | {
|
|
475
|
+
/**
|
|
476
|
+
* Custom adapter used to persist the scenario.
|
|
477
|
+
*/
|
|
478
|
+
adapter: IScenarioStorageAdapter;
|
|
479
|
+
/**
|
|
480
|
+
* Explicit adapters cannot be combined with a directory.
|
|
481
|
+
*/
|
|
482
|
+
directory?: never;
|
|
483
|
+
};
|
|
484
|
+
type RuntimeOptionsBase<TContract extends SutContract> = {
|
|
485
|
+
/**
|
|
486
|
+
* Enables or disables runtime interception for the wrapped target.
|
|
487
|
+
*/
|
|
488
|
+
enabled?: boolean;
|
|
489
|
+
/**
|
|
490
|
+
* Cache retention for loaded scenario documents.
|
|
491
|
+
*/
|
|
492
|
+
cache?: RuntimeCacheOptions;
|
|
493
|
+
/**
|
|
494
|
+
* Error factories available to `throwsFactory()` rules.
|
|
495
|
+
*/
|
|
496
|
+
errorFactories?: ErrorFactoryRegistry<TContract>;
|
|
497
|
+
};
|
|
498
|
+
/**
|
|
499
|
+
* Storage and cache options for loading persisted scenarios into a runtime.
|
|
500
|
+
*
|
|
501
|
+
* @example
|
|
502
|
+
* ```ts
|
|
503
|
+
* import {
|
|
504
|
+
* JsonScenarioStorageAdapter,
|
|
505
|
+
* createRuntime,
|
|
506
|
+
* type IScenarioStorageAdapter,
|
|
507
|
+
* } from "definitely-fine";
|
|
508
|
+
*
|
|
509
|
+
* const customAdapter: IScenarioStorageAdapter = {
|
|
510
|
+
* async deleteScenario(_scenarioId) {},
|
|
511
|
+
* loadScenario(_scenarioId) {
|
|
512
|
+
* return undefined;
|
|
513
|
+
* },
|
|
514
|
+
* async saveScenario(_scenario) {},
|
|
515
|
+
* };
|
|
516
|
+
*
|
|
517
|
+
* createRuntime({
|
|
518
|
+
* adapter: new JsonScenarioStorageAdapter({}),
|
|
519
|
+
* });
|
|
520
|
+
*
|
|
521
|
+
* createRuntime({
|
|
522
|
+
* adapter: customAdapter,
|
|
523
|
+
* });
|
|
524
|
+
* ```
|
|
525
|
+
* @public
|
|
526
|
+
*/
|
|
527
|
+
type RuntimeOptions<TContract extends SutContract> = RuntimeOptionsBase<TContract> & ({
|
|
528
|
+
/**
|
|
529
|
+
* Omit storage options to use the built-in JSON adapter with its inferred default directory.
|
|
530
|
+
*/
|
|
531
|
+
adapter?: never;
|
|
532
|
+
/**
|
|
533
|
+
* Omit storage options to use the built-in JSON adapter with its inferred default directory.
|
|
534
|
+
*/
|
|
535
|
+
directory?: never;
|
|
536
|
+
} | {
|
|
537
|
+
/**
|
|
538
|
+
* Directory where persisted scenarios should be loaded from.
|
|
539
|
+
*/
|
|
540
|
+
directory: string;
|
|
541
|
+
/**
|
|
542
|
+
* Explicit adapters cannot be combined with a directory.
|
|
543
|
+
*/
|
|
544
|
+
adapter?: never;
|
|
545
|
+
} | {
|
|
546
|
+
/**
|
|
547
|
+
* Custom adapter used to load persisted scenarios.
|
|
548
|
+
*/
|
|
549
|
+
adapter: IScenarioStorageAdapter;
|
|
550
|
+
/**
|
|
551
|
+
* Explicit adapters cannot be combined with a directory.
|
|
552
|
+
*/
|
|
553
|
+
directory?: never;
|
|
554
|
+
});
|
|
555
|
+
/**
|
|
556
|
+
* Creates a scenario builder that records interception rules and persists them as JSON.
|
|
557
|
+
*
|
|
558
|
+
* @public
|
|
559
|
+
*
|
|
560
|
+
* @example
|
|
561
|
+
* ```ts
|
|
562
|
+
* import { JsonScenarioStorageAdapter, createScenario } from "definitely-fine";
|
|
563
|
+
*
|
|
564
|
+
* const scenario = createScenario({
|
|
565
|
+
* adapter: new JsonScenarioStorageAdapter({}),
|
|
566
|
+
* });
|
|
567
|
+
*
|
|
568
|
+
* scenario.fn("fetchUser").onCall(1).returns({ id: "user-1" });
|
|
569
|
+
* await scenario.save();
|
|
570
|
+
* ```
|
|
571
|
+
*/
|
|
572
|
+
declare function createScenario<TContract extends SutContract>(options?: ScenarioOptions): ScenarioBuilder<TContract>;
|
|
573
|
+
/**
|
|
574
|
+
* Creates a runtime that loads a persisted scenario and wraps implementations.
|
|
575
|
+
*
|
|
576
|
+
* @public
|
|
577
|
+
*
|
|
578
|
+
* @example
|
|
579
|
+
* ```ts
|
|
580
|
+
* import { createRuntime, type IScenarioStorageAdapter } from "definitely-fine";
|
|
581
|
+
*
|
|
582
|
+
* const customAdapter: IScenarioStorageAdapter = {
|
|
583
|
+
* async deleteScenario(_scenarioId) {},
|
|
584
|
+
* loadScenario(_scenarioId) {
|
|
585
|
+
* return undefined;
|
|
586
|
+
* },
|
|
587
|
+
* async saveScenario(_scenario) {},
|
|
588
|
+
* };
|
|
589
|
+
*
|
|
590
|
+
* const runtime = createRuntime({
|
|
591
|
+
* adapter: customAdapter,
|
|
592
|
+
* errorFactories: {},
|
|
593
|
+
* });
|
|
594
|
+
*
|
|
595
|
+
* const wrappedFetchUser = runtime.wrapAsyncFunction("fetchUser", fetchUser);
|
|
596
|
+
* ```
|
|
597
|
+
*/
|
|
598
|
+
declare function createRuntime<TContract extends SutContract>(options?: RuntimeOptions<TContract>): Runtime<TContract>;
|
|
599
|
+
|
|
600
|
+
//#endregion
|
|
601
|
+
//# sourceMappingURL=index.d.ts.map
|
|
602
|
+
|
|
603
|
+
export { ContractErrorFactory, ContractErrorFactoryArguments, ContractErrorFactoryInput, ContractErrorFactoryName, ContractFunction, ContractFunctionName, ContractFunctionReturnValue, ContractServiceMethod, ContractServiceMethodName, ContractServiceMethodReturnValue, ContractServiceName, ErrorFactoryContracts, ErrorFactoryRegistry, FunctionContracts, IScenarioStorageAdapter, JsonScenarioStorageAdapter, JsonScenarioStorageAdapterOptions, Runtime, RuntimeCacheOptions, RuntimeConfigurationError, RuntimeOptions, RuntimeScenarioContext, ScenarioActionBuilder, ScenarioBuilder, ScenarioFunctionRuleBuilder, ScenarioOptions, ScenarioServiceMethodRuleBuilder, ScenarioServiceRuleBuilder, SerializedAction, SerializedRule, SerializedScenario, SerializedTarget, ServiceContract, ServiceContracts, SutContract, UnknownFunction, createRuntime, createScenario, getRuntimeScenarioId, resolveJsonScenarioStorageAdapterDirectory, runWithRuntimeScenarioContext };
|
|
604
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/runtime-scenario-context.ts","../src/services/interfaces/IScenarioStorageAdapter.ts","../src/services/impls/JsonScenarioStorageAdapter.ts","../src/services/impls/RuntimeScenarioCacheService.ts","../src/runtime-errors.ts","../src/index.ts"],"sourcesContent":null,"mappings":";;;;;KAIY,eAAA;AAAZ;;;;KAMY,eAAA,GAAkB,eAAe;AAA7C;;;;AAAoC,KAMxB,gBAAA,GAAmB,MANK,CAAA,MAAA,EAMU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