@dhaneshpurohit/mockstar 0.5.0 → 0.6.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/CHANGELOG.md +12 -0
- package/dist/cli.js +79 -38
- package/dist/core/scenarios/merger.d.ts +2 -0
- package/dist/core/scenarios/merger.d.ts.map +1 -1
- package/dist/core/templating/faker.d.ts +10 -6
- package/dist/core/templating/faker.d.ts.map +1 -1
- package/dist/core/templating/tier2/id.d.ts.map +1 -1
- package/dist/features/static-mock.d.ts +2 -0
- package/dist/features/static-mock.d.ts.map +1 -1
- package/dist/features/webhooks/dispatcher.d.ts +9 -2
- package/dist/features/webhooks/dispatcher.d.ts.map +1 -1
- package/dist/features/webhooks/types.d.ts +5 -0
- package/dist/features/webhooks/types.d.ts.map +1 -1
- package/dist/index.js +78 -37
- package/dist/server.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# [0.6.0](https://github.com/dhanesh/mockstar/compare/v0.5.0...v0.6.0) (2026-11-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **webhooks:** give each webhook its own seeded stream, rebuilt per attempt ([d5bb4a0](https://github.com/dhanesh/mockstar/commit/d5bb4a016994296f1b50ae28ad2cb7200fff560c)), closes [#57](https://github.com/dhanesh/mockstar/issues/57) [#53](https://github.com/dhanesh/mockstar/issues/53)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **templating:** seed deterministic values per tenant and mock entry ([939934e](https://github.com/dhanesh/mockstar/commit/939934e6015cf4374ed67cc7988161ee8b4c56b4)), closes [#53](https://github.com/dhanesh/mockstar/issues/53)
|
|
12
|
+
|
|
1
13
|
# [0.5.0](https://github.com/dhanesh/mockstar/compare/v0.4.1...v0.5.0) (2026-11-23)
|
|
2
14
|
|
|
3
15
|
|
package/dist/cli.js
CHANGED
|
@@ -2835,7 +2835,7 @@ function createFakerFactory(opts) {
|
|
|
2835
2835
|
const base = opts.seed ?? 0;
|
|
2836
2836
|
return (scope) => createFaker({
|
|
2837
2837
|
deterministic: true,
|
|
2838
|
-
seed: fnv1a(`${base}|${scope.tenant}|${scope.endpoint}|${scope.
|
|
2838
|
+
seed: fnv1a(`${base}|${scope.tenant}|${scope.endpoint}|${scope.hit}`)
|
|
2839
2839
|
});
|
|
2840
2840
|
}
|
|
2841
2841
|
function createFaker(opts) {
|
|
@@ -11435,7 +11435,7 @@ async function renderScenario(merged, opts) {
|
|
|
11435
11435
|
deterministic: opts.deterministic,
|
|
11436
11436
|
tenant: opts.tenant,
|
|
11437
11437
|
endpoint: opts.entryId,
|
|
11438
|
-
requestCounter:
|
|
11438
|
+
requestCounter: opts.hit
|
|
11439
11439
|
});
|
|
11440
11440
|
const templateCtx = {
|
|
11441
11441
|
faker: opts.faker,
|
|
@@ -12092,7 +12092,7 @@ async function renderStatic(input) {
|
|
|
12092
12092
|
deterministic: input.deterministic,
|
|
12093
12093
|
tenant: input.tenant,
|
|
12094
12094
|
endpoint: input.entry.id,
|
|
12095
|
-
requestCounter:
|
|
12095
|
+
requestCounter: input.hit
|
|
12096
12096
|
});
|
|
12097
12097
|
const templateCtx = {
|
|
12098
12098
|
faker: input.faker,
|
|
@@ -13019,8 +13019,10 @@ function dispatchWebhooks(deps, input) {
|
|
|
13019
13019
|
}
|
|
13020
13020
|
async function performAttempt(spec, input, _deps) {
|
|
13021
13021
|
const attemptStart = performance.now();
|
|
13022
|
+
const templateContext = input.templateContextFor(spec.id);
|
|
13023
|
+
const templatedUrl = spec.urlTemplate.render(templateContext);
|
|
13022
13024
|
const headerUrl = _deps.allowWebhookUrlHeader && spec.acceptHeaderOverride ? input.requestHeaders.get("x-mockstar-webhook-url") : undefined;
|
|
13023
|
-
const urlString = headerUrl ??
|
|
13025
|
+
const urlString = headerUrl ?? templatedUrl;
|
|
13024
13026
|
const validationOpts = {
|
|
13025
13027
|
allowedSchemes: spec.allowHttp ? ["http", "https"] : ["https"],
|
|
13026
13028
|
allowPrivateUpstreams: spec.allowPrivateNetworks
|
|
@@ -13028,9 +13030,9 @@ async function performAttempt(spec, input, _deps) {
|
|
|
13028
13030
|
const validatedUrl = await validateUpstreamUrlResolved(urlString, validationOpts);
|
|
13029
13031
|
const renderedHeaders = new Headers;
|
|
13030
13032
|
for (const [key, tmpl] of spec.headers) {
|
|
13031
|
-
renderedHeaders.set(key, tmpl.render(
|
|
13033
|
+
renderedHeaders.set(key, tmpl.render(templateContext));
|
|
13032
13034
|
}
|
|
13033
|
-
const rawBody = spec.body ? spec.body.render(
|
|
13035
|
+
const rawBody = spec.body ? spec.body.render(templateContext) : "";
|
|
13034
13036
|
if (spec.signing?.enabled) {
|
|
13035
13037
|
const secret = resolveSecret(spec.signing.secretRef);
|
|
13036
13038
|
const timestampMs = Date.now();
|
|
@@ -13121,6 +13123,7 @@ function recordAttempt(record, spec, input, deps, deliveryId) {
|
|
|
13121
13123
|
entryId: input.entryId,
|
|
13122
13124
|
webhookId: spec.id,
|
|
13123
13125
|
triggerRequestId: input.triggerRequestId,
|
|
13126
|
+
...input.triggerSeq !== undefined && { triggerSeq: input.triggerSeq },
|
|
13124
13127
|
attempt: record.attempt,
|
|
13125
13128
|
outcome: record.outcome,
|
|
13126
13129
|
durationUs: record.durationUs,
|
|
@@ -13190,6 +13193,7 @@ function createServer(opts) {
|
|
|
13190
13193
|
const clock = createClock({ deterministic: opts.deterministic ?? false });
|
|
13191
13194
|
const handlerTimeoutMs = opts.handlerTimeoutMs ?? 5000;
|
|
13192
13195
|
const genRequestId = createRequestIdGenerator(opts.deterministic ?? false);
|
|
13196
|
+
const nextHit = createHitCounter(opts.deterministic ?? false);
|
|
13193
13197
|
const app = new Hono3;
|
|
13194
13198
|
const replayWebhook = (tenant, deliveryId) => {
|
|
13195
13199
|
const snap = opts.holder.get();
|
|
@@ -13205,23 +13209,24 @@ function createServer(opts) {
|
|
|
13205
13209
|
const spec = specs.find((s2) => s2.id === original.webhookId);
|
|
13206
13210
|
if (!spec)
|
|
13207
13211
|
return { ok: false, code: "webhook_spec_removed" };
|
|
13208
|
-
const
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13212
|
+
const replayRequest = {
|
|
13213
|
+
method: "GET",
|
|
13214
|
+
path: "/__replay",
|
|
13215
|
+
query: {},
|
|
13216
|
+
headers: {},
|
|
13217
|
+
body: null,
|
|
13218
|
+
params: {}
|
|
13219
|
+
};
|
|
13220
|
+
const templateContextFor = webhookContextFactory({
|
|
13221
|
+
deterministic: opts.deterministic ?? false,
|
|
13222
|
+
fakerFor,
|
|
13223
|
+
clock,
|
|
13215
13224
|
tenant,
|
|
13225
|
+
entryId: original.entryId,
|
|
13226
|
+
hit: original.triggerSeq ?? 0,
|
|
13216
13227
|
requestId: original.triggerRequestId,
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
deterministic: opts.deterministic ?? false,
|
|
13220
|
-
tenant,
|
|
13221
|
-
endpoint: original.entryId,
|
|
13222
|
-
requestCounter: 0
|
|
13223
|
-
})
|
|
13224
|
-
};
|
|
13228
|
+
request: replayRequest
|
|
13229
|
+
});
|
|
13225
13230
|
const enqueued = dispatchWebhooks({
|
|
13226
13231
|
metrics,
|
|
13227
13232
|
journal: webhookJournal,
|
|
@@ -13233,9 +13238,10 @@ function createServer(opts) {
|
|
|
13233
13238
|
tenant,
|
|
13234
13239
|
matchPath: "/__replay",
|
|
13235
13240
|
triggerRequestId: original.triggerRequestId,
|
|
13241
|
+
...original.triggerSeq !== undefined && { triggerSeq: original.triggerSeq },
|
|
13236
13242
|
entryId: original.entryId,
|
|
13237
13243
|
webhooks: [spec],
|
|
13238
|
-
|
|
13244
|
+
templateContextFor,
|
|
13239
13245
|
requestHeaders: new Map,
|
|
13240
13246
|
replay: true
|
|
13241
13247
|
});
|
|
@@ -13263,6 +13269,7 @@ function createServer(opts) {
|
|
|
13263
13269
|
rateLimiter,
|
|
13264
13270
|
handlerTimeoutMs,
|
|
13265
13271
|
genRequestId,
|
|
13272
|
+
nextHit,
|
|
13266
13273
|
webhookJournal,
|
|
13267
13274
|
webhookEvents,
|
|
13268
13275
|
queueForTenant,
|
|
@@ -13374,12 +13381,6 @@ async function dispatch(ctx, deps) {
|
|
|
13374
13381
|
durationUs
|
|
13375
13382
|
});
|
|
13376
13383
|
if (webhookTrigger) {
|
|
13377
|
-
const idHelpers = createIdHelpers({
|
|
13378
|
-
deterministic: deps.opts.deterministic ?? false,
|
|
13379
|
-
tenant,
|
|
13380
|
-
endpoint: webhookTrigger.entryId,
|
|
13381
|
-
requestCounter: 0
|
|
13382
|
-
});
|
|
13383
13384
|
dispatchWebhooks({
|
|
13384
13385
|
metrics: deps.metrics,
|
|
13385
13386
|
journal: deps.webhookJournal,
|
|
@@ -13391,11 +13392,18 @@ async function dispatch(ctx, deps) {
|
|
|
13391
13392
|
tenant,
|
|
13392
13393
|
matchPath,
|
|
13393
13394
|
triggerRequestId: requestId,
|
|
13395
|
+
...deps.opts.deterministic && { triggerSeq: webhookTrigger.hit },
|
|
13394
13396
|
entryId: webhookTrigger.entryId,
|
|
13395
13397
|
webhooks: webhookTrigger.webhooks,
|
|
13396
13398
|
requestHeaders: new Map(Object.entries(webhookTrigger.headers)),
|
|
13397
|
-
|
|
13398
|
-
|
|
13399
|
+
templateContextFor: webhookContextFactory({
|
|
13400
|
+
deterministic: deps.opts.deterministic ?? false,
|
|
13401
|
+
fakerFor: deps.fakerFor,
|
|
13402
|
+
clock: deps.clock,
|
|
13403
|
+
tenant,
|
|
13404
|
+
entryId: webhookTrigger.entryId,
|
|
13405
|
+
hit: webhookTrigger.hit,
|
|
13406
|
+
requestId,
|
|
13399
13407
|
request: {
|
|
13400
13408
|
method,
|
|
13401
13409
|
path: matchPath,
|
|
@@ -13403,12 +13411,8 @@ async function dispatch(ctx, deps) {
|
|
|
13403
13411
|
headers: webhookTrigger.headers,
|
|
13404
13412
|
body: webhookTrigger.body,
|
|
13405
13413
|
params: webhookTrigger.params
|
|
13406
|
-
}
|
|
13407
|
-
|
|
13408
|
-
requestId,
|
|
13409
|
-
clock: deps.clock,
|
|
13410
|
-
idHelpers
|
|
13411
|
-
}
|
|
13414
|
+
}
|
|
13415
|
+
})
|
|
13412
13416
|
});
|
|
13413
13417
|
}
|
|
13414
13418
|
});
|
|
@@ -13437,10 +13441,12 @@ async function routeToMock(ctx, matchPath, method, tenant, snapshot, tenantSnap,
|
|
|
13437
13441
|
}), { status: 404, headers: { "content-type": "application/json" } })
|
|
13438
13442
|
};
|
|
13439
13443
|
}
|
|
13440
|
-
const
|
|
13444
|
+
const seq = deps.nextHit(tenant, hit.entry.id);
|
|
13445
|
+
const faker = deps.fakerFor({ tenant, endpoint: hit.entry.id, hit: seq });
|
|
13441
13446
|
const compiledWebhooks = tenantSnap.compiledWebhooks.get(hit.entry.id) ?? [];
|
|
13442
13447
|
const webhookTrigger = compiledWebhooks.length > 0 ? {
|
|
13443
13448
|
entryId: hit.entry.id,
|
|
13449
|
+
hit: seq,
|
|
13444
13450
|
webhooks: compiledWebhooks,
|
|
13445
13451
|
body,
|
|
13446
13452
|
params: hit.params,
|
|
@@ -13467,6 +13473,7 @@ async function routeToMock(ctx, matchPath, method, tenant, snapshot, tenantSnap,
|
|
|
13467
13473
|
deterministic: deps.opts.deterministic ?? false,
|
|
13468
13474
|
tenant,
|
|
13469
13475
|
requestId,
|
|
13476
|
+
hit: seq,
|
|
13470
13477
|
entryId: hit.entry.id,
|
|
13471
13478
|
ctx,
|
|
13472
13479
|
params: hit.params,
|
|
@@ -13510,6 +13517,7 @@ async function routeToMock(ctx, matchPath, method, tenant, snapshot, tenantSnap,
|
|
|
13510
13517
|
maxResponseBytes: tenantSnap.limits.maxResponseBytes,
|
|
13511
13518
|
tenant,
|
|
13512
13519
|
requestId,
|
|
13520
|
+
hit: seq,
|
|
13513
13521
|
body
|
|
13514
13522
|
});
|
|
13515
13523
|
break;
|
|
@@ -13570,6 +13578,39 @@ async function safeParseBody(ctx, maxBodyBytes) {
|
|
|
13570
13578
|
throw err;
|
|
13571
13579
|
}
|
|
13572
13580
|
}
|
|
13581
|
+
function webhookContextFactory(o2) {
|
|
13582
|
+
return (specId) => {
|
|
13583
|
+
const endpoint = `${o2.entryId}#webhooks#${specId}`;
|
|
13584
|
+
return {
|
|
13585
|
+
faker: o2.fakerFor({ tenant: o2.tenant, endpoint, hit: o2.hit }),
|
|
13586
|
+
request: o2.request,
|
|
13587
|
+
tenant: o2.tenant,
|
|
13588
|
+
requestId: o2.requestId,
|
|
13589
|
+
clock: o2.clock,
|
|
13590
|
+
idHelpers: createIdHelpers({
|
|
13591
|
+
deterministic: o2.deterministic,
|
|
13592
|
+
tenant: o2.tenant,
|
|
13593
|
+
endpoint,
|
|
13594
|
+
requestCounter: o2.hit
|
|
13595
|
+
})
|
|
13596
|
+
};
|
|
13597
|
+
};
|
|
13598
|
+
}
|
|
13599
|
+
function createHitCounter(deterministic) {
|
|
13600
|
+
if (!deterministic)
|
|
13601
|
+
return () => 0;
|
|
13602
|
+
const byTenant = new Map;
|
|
13603
|
+
return (tenant, entryId) => {
|
|
13604
|
+
let byEntry = byTenant.get(tenant);
|
|
13605
|
+
if (!byEntry) {
|
|
13606
|
+
byEntry = new Map;
|
|
13607
|
+
byTenant.set(tenant, byEntry);
|
|
13608
|
+
}
|
|
13609
|
+
const n2 = (byEntry.get(entryId) ?? 0) + 1;
|
|
13610
|
+
byEntry.set(entryId, n2);
|
|
13611
|
+
return n2;
|
|
13612
|
+
};
|
|
13613
|
+
}
|
|
13573
13614
|
function createRequestIdGenerator(deterministic) {
|
|
13574
13615
|
if (!deterministic)
|
|
13575
13616
|
return () => crypto.randomUUID();
|
|
@@ -15384,7 +15425,7 @@ function proxyHelp() {
|
|
|
15384
15425
|
}
|
|
15385
15426
|
|
|
15386
15427
|
// src/version.ts
|
|
15387
|
-
var MOCKSTAR_VERSION = "0.
|
|
15428
|
+
var MOCKSTAR_VERSION = "0.6.0";
|
|
15388
15429
|
|
|
15389
15430
|
// src/cli.ts
|
|
15390
15431
|
function parseArgs(argv) {
|
|
@@ -31,6 +31,8 @@ export interface ScenarioRenderOpts {
|
|
|
31
31
|
deterministic: boolean;
|
|
32
32
|
tenant: string;
|
|
33
33
|
requestId: string;
|
|
34
|
+
/** Deterministic hit number of this mock entry for this tenant; seeds `{{id()}}` (#53). */
|
|
35
|
+
hit: number;
|
|
34
36
|
entryId: string;
|
|
35
37
|
ctx: Context;
|
|
36
38
|
params: Record<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merger.d.ts","sourceRoot":"","sources":["../../../src/core/scenarios/merger.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,2BAA2B,CAAC;AAEnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAA4B,MAAM,gBAAgB,CAAC;AAEjF,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,2BAA2B,EAAE,gBAAgB,CAAC,CAAC;IACnF,YAAY,EAAE,OAAO,2BAA2B,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1E,QAAQ,EAAE,OAAO,2BAA2B,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACvE,KAAK,CAAC,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MA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,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAQD;;;GAGG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,mBAAmB,EAC3B,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,QAAQ,CAAC,CAuDnB"}
|
|
@@ -14,16 +14,20 @@ export interface FakerScope {
|
|
|
14
14
|
tenant: string;
|
|
15
15
|
/** Mock entry id; suffix it (e.g. `#webhooks`) to give a second stream for the same request. */
|
|
16
16
|
endpoint: string;
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Deterministic hit number of this mock entry for this tenant (1, 2, 3, ...). Not the public
|
|
19
|
+
* request id: that is a server-wide arrival counter, so other tenants' traffic would shift it.
|
|
20
|
+
*/
|
|
21
|
+
hit: number;
|
|
18
22
|
}
|
|
19
23
|
export type FakerFactory = (scope: FakerScope) => FakerInstance;
|
|
20
24
|
/**
|
|
21
25
|
* Per-request faker (TN8, same model as `createIdHelpers`). In deterministic mode every scope
|
|
22
|
-
* gets a FRESH instance seeded from FNV-1a(seed | tenant | endpoint |
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
26
|
+
* gets a FRESH instance seeded from FNV-1a(seed | tenant | endpoint | hit), so a request's
|
|
27
|
+
* faker values depend only on which hit of that mock entry it is — not on other tenants' or
|
|
28
|
+
* other mocks' traffic, nor on how many faker calls earlier requests made (#52, #53). Repeat
|
|
29
|
+
* hits on the SAME entry are still ordered. Non-deterministic mode shares one unseeded
|
|
30
|
+
* instance: there is nothing to isolate.
|
|
27
31
|
*/
|
|
28
32
|
export declare function createFakerFactory(opts: {
|
|
29
33
|
deterministic: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faker.d.ts","sourceRoot":"","sources":["../../../src/core/templating/faker.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,aA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AgG;IAChG,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,aAAa,CAAC;AAEhE;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IAAE,aAAa,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAWhG;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAAE,aAAa,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,aAAa,CAoB1F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../../src/core/templating/tier2/id.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../../src/core/templating/tier2/id.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,MAAM,mEAAmE,CAAC;AAEvF,MAAM,WAAW,MAAM;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACxB,4GAA4G;IAC5G,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9D;;;;;;OAMG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAClF;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CA0BvD;AAID,KAAK,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,UAAU,CAAC;AA+B9C,yEAAyE;AACzE,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOzC;AAED,oGAAoG;AACpG,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAalD"}
|
|
@@ -11,6 +11,8 @@ export interface StaticRenderInput {
|
|
|
11
11
|
faker: FakerInstance;
|
|
12
12
|
tenant: string;
|
|
13
13
|
requestId: string;
|
|
14
|
+
/** Deterministic hit number of this mock entry for this tenant; seeds `{{id()}}` (#53). */
|
|
15
|
+
hit: number;
|
|
14
16
|
body: unknown;
|
|
15
17
|
/** Injected clock — wall in prod, fixed-epoch in deterministic mode. */
|
|
16
18
|
clock: Clock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-mock.d.ts","sourceRoot":"","sources":["../../src/features/static-mock.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,gCAAgC,CAAC;AAExF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAG7D,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,wEAAwE;IACxE,KAAK,EAAE,KAAK,CAAC;IACb,wEAAwE;IACxE,aAAa,EAAE,OAAO,CAAC;IACvB,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAmE9E"}
|
|
1
|
+
{"version":3,"file":"static-mock.d.ts","sourceRoot":"","sources":["../../src/features/static-mock.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,gCAAgC,CAAC;AAExF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAG7D,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,2FAA2F;IAC3F,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,wEAAwE;IACxE,KAAK,EAAE,KAAK,CAAC;IACb,wEAAwE;IACxE,aAAa,EAAE,OAAO,CAAC;IACvB,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAmE9E"}
|
|
@@ -22,12 +22,19 @@ export interface DispatcherTriggerInput {
|
|
|
22
22
|
matchPath: string;
|
|
23
23
|
/** The inbound request id (RT-15 — links inbound request to outbound deliveries). */
|
|
24
24
|
triggerRequestId: string;
|
|
25
|
+
/** Deterministic hit number that seeded `templateContext`; journaled for replay (#53). */
|
|
26
|
+
triggerSeq?: number;
|
|
25
27
|
/** Mock-entry id whose match scheduled these webhooks (used for journal entry → spec lookup at replay time, INT-2). */
|
|
26
28
|
entryId: string;
|
|
27
29
|
/** Webhook specs attached to the matched mock entry (post-config-load compiled form). */
|
|
28
30
|
webhooks: readonly CompiledWebhookSpec[];
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Builds the templating context for one webhook spec — same shape as response rendering.
|
|
33
|
+
* Called afresh for EVERY attempt, so each spec has its own seeded stream (another spec on
|
|
34
|
+
* the same entry cannot shift it) and a retry re-renders byte-identical ids. Replay uses the
|
|
35
|
+
* same factory shape, so it reproduces what was delivered (#53).
|
|
36
|
+
*/
|
|
37
|
+
templateContextFor: (specId: string) => TemplateContext;
|
|
31
38
|
/** Inbound headers, lowercased — for the optional X-Mockstar-Webhook-Url override. */
|
|
32
39
|
requestHeaders: ReadonlyMap<string, string>;
|
|
33
40
|
/** True when this dispatch was triggered by an admin /replay call rather than an inbound match. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../../src/features/webhooks/dispatcher.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAiB,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGnE,OAAO,KAAK,EACV,mBAAmB,EAIpB,MAAM,YAAY,CAAC;AASpB,MAAM,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qB,CAAC;IAC9B,sEAAsE;IACtE,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,iBAAiB,CAAC;IACtD,8EAA8E;IAC9E,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,KAAK,cAAc,CAAC;IAC7F,kGAAkG;IAClG,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,gBAAgB,EAAE,MAAM,CAAC;IACzB,0FAA0F;IAC1F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uHAAuH;IACvH,OAAO,EAAE,MAAM,CAAC;IAChB,yFAAyF;IACzF,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACzC;;;;;OAKG;IACH,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,eAAe,CAAC;IACxD,sFAAsF;IACtF,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,mGAAmG;IACnG,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,sBAAsB,GAAG,SAAS,MAAM,EAAE,CAkDvG"}
|
|
@@ -99,6 +99,11 @@ export interface WebhookJournalEntry {
|
|
|
99
99
|
webhookId: string;
|
|
100
100
|
/** Inbound request id that triggered the delivery (U4 linkage; RT-15). */
|
|
101
101
|
triggerRequestId: string;
|
|
102
|
+
/**
|
|
103
|
+
* Deterministic mode only: the triggering mock entry's hit number, which seeds the payload's
|
|
104
|
+
* faker and `{{id()}}` values. Replay re-renders with it so the payload is reproduced (#53).
|
|
105
|
+
*/
|
|
106
|
+
triggerSeq?: number;
|
|
102
107
|
/** 1-indexed attempt counter; final entry has attempt === total. */
|
|
103
108
|
attempt: number;
|
|
104
109
|
outcome: DeliveryOutcome;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/webhooks/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,QAAQ,GACR,SAAS,GACT,cAAc,GACd,UAAU,CAAC;AAEf,+EAA+E;AAC/E,MAAM,WAAW,kBAAkB;IACjC,mGAAmG;IACnG,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,iDAAiD;IACjD,SAAS,EAAE,QAAQ,CAAC;IACpB,sHAAsH;IACtH,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC;IACtB,kFAAkF;IAClF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,4EAA4E;IAC5E,cAAc,EAAE,cAAc,CAAC;IAC/B,6EAA6E;IAC7E,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gGAAgG;IAChG,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,uGAAuG;AACvG,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,iDAAiD;AACjD,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,mFAAmF;AACnF,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM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UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,eAAe,CAAC;IACzB,0GAA0G;IAC1G,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iGAAiG;IACjG,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,mFAAmF;AACnF,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,eAAe,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB"}
|
package/dist/index.js
CHANGED
|
@@ -2371,7 +2371,7 @@ function createFakerFactory(opts) {
|
|
|
2371
2371
|
const base = opts.seed ?? 0;
|
|
2372
2372
|
return (scope) => createFaker({
|
|
2373
2373
|
deterministic: true,
|
|
2374
|
-
seed: fnv1a(`${base}|${scope.tenant}|${scope.endpoint}|${scope.
|
|
2374
|
+
seed: fnv1a(`${base}|${scope.tenant}|${scope.endpoint}|${scope.hit}`)
|
|
2375
2375
|
});
|
|
2376
2376
|
}
|
|
2377
2377
|
function createFaker(opts) {
|
|
@@ -10971,7 +10971,7 @@ async function renderScenario(merged, opts) {
|
|
|
10971
10971
|
deterministic: opts.deterministic,
|
|
10972
10972
|
tenant: opts.tenant,
|
|
10973
10973
|
endpoint: opts.entryId,
|
|
10974
|
-
requestCounter:
|
|
10974
|
+
requestCounter: opts.hit
|
|
10975
10975
|
});
|
|
10976
10976
|
const templateCtx = {
|
|
10977
10977
|
faker: opts.faker,
|
|
@@ -11628,7 +11628,7 @@ async function renderStatic(input) {
|
|
|
11628
11628
|
deterministic: input.deterministic,
|
|
11629
11629
|
tenant: input.tenant,
|
|
11630
11630
|
endpoint: input.entry.id,
|
|
11631
|
-
requestCounter:
|
|
11631
|
+
requestCounter: input.hit
|
|
11632
11632
|
});
|
|
11633
11633
|
const templateCtx = {
|
|
11634
11634
|
faker: input.faker,
|
|
@@ -12555,8 +12555,10 @@ function dispatchWebhooks(deps, input) {
|
|
|
12555
12555
|
}
|
|
12556
12556
|
async function performAttempt(spec, input, _deps) {
|
|
12557
12557
|
const attemptStart = performance.now();
|
|
12558
|
+
const templateContext = input.templateContextFor(spec.id);
|
|
12559
|
+
const templatedUrl = spec.urlTemplate.render(templateContext);
|
|
12558
12560
|
const headerUrl = _deps.allowWebhookUrlHeader && spec.acceptHeaderOverride ? input.requestHeaders.get("x-mockstar-webhook-url") : undefined;
|
|
12559
|
-
const urlString = headerUrl ??
|
|
12561
|
+
const urlString = headerUrl ?? templatedUrl;
|
|
12560
12562
|
const validationOpts = {
|
|
12561
12563
|
allowedSchemes: spec.allowHttp ? ["http", "https"] : ["https"],
|
|
12562
12564
|
allowPrivateUpstreams: spec.allowPrivateNetworks
|
|
@@ -12564,9 +12566,9 @@ async function performAttempt(spec, input, _deps) {
|
|
|
12564
12566
|
const validatedUrl = await validateUpstreamUrlResolved(urlString, validationOpts);
|
|
12565
12567
|
const renderedHeaders = new Headers;
|
|
12566
12568
|
for (const [key, tmpl] of spec.headers) {
|
|
12567
|
-
renderedHeaders.set(key, tmpl.render(
|
|
12569
|
+
renderedHeaders.set(key, tmpl.render(templateContext));
|
|
12568
12570
|
}
|
|
12569
|
-
const rawBody = spec.body ? spec.body.render(
|
|
12571
|
+
const rawBody = spec.body ? spec.body.render(templateContext) : "";
|
|
12570
12572
|
if (spec.signing?.enabled) {
|
|
12571
12573
|
const secret = resolveSecret(spec.signing.secretRef);
|
|
12572
12574
|
const timestampMs = Date.now();
|
|
@@ -12657,6 +12659,7 @@ function recordAttempt(record, spec, input, deps, deliveryId) {
|
|
|
12657
12659
|
entryId: input.entryId,
|
|
12658
12660
|
webhookId: spec.id,
|
|
12659
12661
|
triggerRequestId: input.triggerRequestId,
|
|
12662
|
+
...input.triggerSeq !== undefined && { triggerSeq: input.triggerSeq },
|
|
12660
12663
|
attempt: record.attempt,
|
|
12661
12664
|
outcome: record.outcome,
|
|
12662
12665
|
durationUs: record.durationUs,
|
|
@@ -12726,6 +12729,7 @@ function createServer(opts) {
|
|
|
12726
12729
|
const clock = createClock({ deterministic: opts.deterministic ?? false });
|
|
12727
12730
|
const handlerTimeoutMs = opts.handlerTimeoutMs ?? 5000;
|
|
12728
12731
|
const genRequestId = createRequestIdGenerator(opts.deterministic ?? false);
|
|
12732
|
+
const nextHit = createHitCounter(opts.deterministic ?? false);
|
|
12729
12733
|
const app = new Hono3;
|
|
12730
12734
|
const replayWebhook = (tenant, deliveryId) => {
|
|
12731
12735
|
const snap = opts.holder.get();
|
|
@@ -12741,23 +12745,24 @@ function createServer(opts) {
|
|
|
12741
12745
|
const spec = specs.find((s2) => s2.id === original.webhookId);
|
|
12742
12746
|
if (!spec)
|
|
12743
12747
|
return { ok: false, code: "webhook_spec_removed" };
|
|
12744
|
-
const
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
|
|
12748
|
+
const replayRequest = {
|
|
12749
|
+
method: "GET",
|
|
12750
|
+
path: "/__replay",
|
|
12751
|
+
query: {},
|
|
12752
|
+
headers: {},
|
|
12753
|
+
body: null,
|
|
12754
|
+
params: {}
|
|
12755
|
+
};
|
|
12756
|
+
const templateContextFor = webhookContextFactory({
|
|
12757
|
+
deterministic: opts.deterministic ?? false,
|
|
12758
|
+
fakerFor,
|
|
12759
|
+
clock,
|
|
12751
12760
|
tenant,
|
|
12761
|
+
entryId: original.entryId,
|
|
12762
|
+
hit: original.triggerSeq ?? 0,
|
|
12752
12763
|
requestId: original.triggerRequestId,
|
|
12753
|
-
|
|
12754
|
-
|
|
12755
|
-
deterministic: opts.deterministic ?? false,
|
|
12756
|
-
tenant,
|
|
12757
|
-
endpoint: original.entryId,
|
|
12758
|
-
requestCounter: 0
|
|
12759
|
-
})
|
|
12760
|
-
};
|
|
12764
|
+
request: replayRequest
|
|
12765
|
+
});
|
|
12761
12766
|
const enqueued = dispatchWebhooks({
|
|
12762
12767
|
metrics,
|
|
12763
12768
|
journal: webhookJournal,
|
|
@@ -12769,9 +12774,10 @@ function createServer(opts) {
|
|
|
12769
12774
|
tenant,
|
|
12770
12775
|
matchPath: "/__replay",
|
|
12771
12776
|
triggerRequestId: original.triggerRequestId,
|
|
12777
|
+
...original.triggerSeq !== undefined && { triggerSeq: original.triggerSeq },
|
|
12772
12778
|
entryId: original.entryId,
|
|
12773
12779
|
webhooks: [spec],
|
|
12774
|
-
|
|
12780
|
+
templateContextFor,
|
|
12775
12781
|
requestHeaders: new Map,
|
|
12776
12782
|
replay: true
|
|
12777
12783
|
});
|
|
@@ -12799,6 +12805,7 @@ function createServer(opts) {
|
|
|
12799
12805
|
rateLimiter,
|
|
12800
12806
|
handlerTimeoutMs,
|
|
12801
12807
|
genRequestId,
|
|
12808
|
+
nextHit,
|
|
12802
12809
|
webhookJournal,
|
|
12803
12810
|
webhookEvents,
|
|
12804
12811
|
queueForTenant,
|
|
@@ -12910,12 +12917,6 @@ async function dispatch(ctx, deps) {
|
|
|
12910
12917
|
durationUs
|
|
12911
12918
|
});
|
|
12912
12919
|
if (webhookTrigger) {
|
|
12913
|
-
const idHelpers = createIdHelpers({
|
|
12914
|
-
deterministic: deps.opts.deterministic ?? false,
|
|
12915
|
-
tenant,
|
|
12916
|
-
endpoint: webhookTrigger.entryId,
|
|
12917
|
-
requestCounter: 0
|
|
12918
|
-
});
|
|
12919
12920
|
dispatchWebhooks({
|
|
12920
12921
|
metrics: deps.metrics,
|
|
12921
12922
|
journal: deps.webhookJournal,
|
|
@@ -12927,11 +12928,18 @@ async function dispatch(ctx, deps) {
|
|
|
12927
12928
|
tenant,
|
|
12928
12929
|
matchPath,
|
|
12929
12930
|
triggerRequestId: requestId,
|
|
12931
|
+
...deps.opts.deterministic && { triggerSeq: webhookTrigger.hit },
|
|
12930
12932
|
entryId: webhookTrigger.entryId,
|
|
12931
12933
|
webhooks: webhookTrigger.webhooks,
|
|
12932
12934
|
requestHeaders: new Map(Object.entries(webhookTrigger.headers)),
|
|
12933
|
-
|
|
12934
|
-
|
|
12935
|
+
templateContextFor: webhookContextFactory({
|
|
12936
|
+
deterministic: deps.opts.deterministic ?? false,
|
|
12937
|
+
fakerFor: deps.fakerFor,
|
|
12938
|
+
clock: deps.clock,
|
|
12939
|
+
tenant,
|
|
12940
|
+
entryId: webhookTrigger.entryId,
|
|
12941
|
+
hit: webhookTrigger.hit,
|
|
12942
|
+
requestId,
|
|
12935
12943
|
request: {
|
|
12936
12944
|
method,
|
|
12937
12945
|
path: matchPath,
|
|
@@ -12939,12 +12947,8 @@ async function dispatch(ctx, deps) {
|
|
|
12939
12947
|
headers: webhookTrigger.headers,
|
|
12940
12948
|
body: webhookTrigger.body,
|
|
12941
12949
|
params: webhookTrigger.params
|
|
12942
|
-
}
|
|
12943
|
-
|
|
12944
|
-
requestId,
|
|
12945
|
-
clock: deps.clock,
|
|
12946
|
-
idHelpers
|
|
12947
|
-
}
|
|
12950
|
+
}
|
|
12951
|
+
})
|
|
12948
12952
|
});
|
|
12949
12953
|
}
|
|
12950
12954
|
});
|
|
@@ -12973,10 +12977,12 @@ async function routeToMock(ctx, matchPath, method, tenant, snapshot, tenantSnap,
|
|
|
12973
12977
|
}), { status: 404, headers: { "content-type": "application/json" } })
|
|
12974
12978
|
};
|
|
12975
12979
|
}
|
|
12976
|
-
const
|
|
12980
|
+
const seq = deps.nextHit(tenant, hit.entry.id);
|
|
12981
|
+
const faker = deps.fakerFor({ tenant, endpoint: hit.entry.id, hit: seq });
|
|
12977
12982
|
const compiledWebhooks = tenantSnap.compiledWebhooks.get(hit.entry.id) ?? [];
|
|
12978
12983
|
const webhookTrigger = compiledWebhooks.length > 0 ? {
|
|
12979
12984
|
entryId: hit.entry.id,
|
|
12985
|
+
hit: seq,
|
|
12980
12986
|
webhooks: compiledWebhooks,
|
|
12981
12987
|
body,
|
|
12982
12988
|
params: hit.params,
|
|
@@ -13003,6 +13009,7 @@ async function routeToMock(ctx, matchPath, method, tenant, snapshot, tenantSnap,
|
|
|
13003
13009
|
deterministic: deps.opts.deterministic ?? false,
|
|
13004
13010
|
tenant,
|
|
13005
13011
|
requestId,
|
|
13012
|
+
hit: seq,
|
|
13006
13013
|
entryId: hit.entry.id,
|
|
13007
13014
|
ctx,
|
|
13008
13015
|
params: hit.params,
|
|
@@ -13046,6 +13053,7 @@ async function routeToMock(ctx, matchPath, method, tenant, snapshot, tenantSnap,
|
|
|
13046
13053
|
maxResponseBytes: tenantSnap.limits.maxResponseBytes,
|
|
13047
13054
|
tenant,
|
|
13048
13055
|
requestId,
|
|
13056
|
+
hit: seq,
|
|
13049
13057
|
body
|
|
13050
13058
|
});
|
|
13051
13059
|
break;
|
|
@@ -13106,6 +13114,39 @@ async function safeParseBody(ctx, maxBodyBytes) {
|
|
|
13106
13114
|
throw err;
|
|
13107
13115
|
}
|
|
13108
13116
|
}
|
|
13117
|
+
function webhookContextFactory(o2) {
|
|
13118
|
+
return (specId) => {
|
|
13119
|
+
const endpoint = `${o2.entryId}#webhooks#${specId}`;
|
|
13120
|
+
return {
|
|
13121
|
+
faker: o2.fakerFor({ tenant: o2.tenant, endpoint, hit: o2.hit }),
|
|
13122
|
+
request: o2.request,
|
|
13123
|
+
tenant: o2.tenant,
|
|
13124
|
+
requestId: o2.requestId,
|
|
13125
|
+
clock: o2.clock,
|
|
13126
|
+
idHelpers: createIdHelpers({
|
|
13127
|
+
deterministic: o2.deterministic,
|
|
13128
|
+
tenant: o2.tenant,
|
|
13129
|
+
endpoint,
|
|
13130
|
+
requestCounter: o2.hit
|
|
13131
|
+
})
|
|
13132
|
+
};
|
|
13133
|
+
};
|
|
13134
|
+
}
|
|
13135
|
+
function createHitCounter(deterministic) {
|
|
13136
|
+
if (!deterministic)
|
|
13137
|
+
return () => 0;
|
|
13138
|
+
const byTenant = new Map;
|
|
13139
|
+
return (tenant, entryId) => {
|
|
13140
|
+
let byEntry = byTenant.get(tenant);
|
|
13141
|
+
if (!byEntry) {
|
|
13142
|
+
byEntry = new Map;
|
|
13143
|
+
byTenant.set(tenant, byEntry);
|
|
13144
|
+
}
|
|
13145
|
+
const n2 = (byEntry.get(entryId) ?? 0) + 1;
|
|
13146
|
+
byEntry.set(entryId, n2);
|
|
13147
|
+
return n2;
|
|
13148
|
+
};
|
|
13149
|
+
}
|
|
13109
13150
|
function createRequestIdGenerator(deterministic) {
|
|
13110
13151
|
if (!deterministic)
|
|
13111
13152
|
return () => crypto.randomUUID();
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgB,IAAI,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAwB,iBAAiB,EAAuB,MAAM,2BAA2B,CAAC;AACzG,OAAO,EAAqB,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgB,IAAI,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAwB,iBAAiB,EAAuB,MAAM,2BAA2B,CAAC;AACzG,OAAO,EAAqB,eAAe,E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AAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;KAAE,CAAC;IACtE,QAAQ,CAAC,sBAAsB,EAAE,MAAM,IAAI,CAAC;IAC5C,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,EAAE,sBAAsB,CAAC;IAChD,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,EAAE,qBAAqB,CAAC;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,YAAY,CAAC;IAC7E;;;;;;OAMG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC;CACnC;AAED,MAAM,MAAM,YAAY,GACpB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GACnC;IACE,EAAE,EAAE,KAAK,CAAC;IACV,IAAI,EAAE,kBAAkB,GAAG,yBAAyB,GAAG,oBAAoB,GAAG,sBAAsB,CAAC;CACtG,CAAC;AAEN,wBAAgB,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,aAAa,CA8LrE"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const MOCKSTAR_VERSION = "0.
|
|
1
|
+
export declare const MOCKSTAR_VERSION = "0.6.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhaneshpurohit/mockstar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Bun-based mock server with static + dynamic mocking, JSON config, named JS handlers, pass-through, multi-tenancy, and test-data utilities.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|