@event-driven-io/emmett-expressjs 0.20.2-alpha.3 → 0.20.2-alpha2
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/dist/index.cjs +5 -625
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -625
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,627 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// src/application.ts
|
|
5
|
-
var _express = require('express'); var _express2 = _interopRequireDefault(_express);
|
|
6
|
-
|
|
7
|
-
var _http = require('http'); var _http2 = _interopRequireDefault(_http);
|
|
8
|
-
|
|
9
|
-
// ../emmett/dist/chunk-AEEEXE2R.js
|
|
10
|
-
var isNumber = (val) => typeof val === "number" && val === val;
|
|
11
|
-
|
|
12
|
-
// ../emmett/dist/index.js
|
|
13
|
-
var _uuid = require('uuid');
|
|
14
|
-
var _webstreamspolyfill = require('web-streams-polyfill');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _asyncretry = require('async-retry'); var _asyncretry2 = _interopRequireDefault(_asyncretry);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var notifyAboutNoActiveReadersStream = (onNoActiveReaderCallback, options = {}) => new NotifyAboutNoActiveReadersStream(onNoActiveReaderCallback, options);
|
|
33
|
-
var NotifyAboutNoActiveReadersStream = (_class = class extends _webstreamspolyfill.TransformStream {
|
|
34
|
-
constructor(onNoActiveReaderCallback, options = {}) {
|
|
35
|
-
super({
|
|
36
|
-
cancel: (reason) => {
|
|
37
|
-
console.log("Stream was canceled. Reason:", reason);
|
|
38
|
-
this.stopChecking();
|
|
39
|
-
}
|
|
40
|
-
});_class.prototype.__init.call(this);_class.prototype.__init2.call(this);;
|
|
41
|
-
this.onNoActiveReaderCallback = onNoActiveReaderCallback;
|
|
42
|
-
this.streamId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _2 => _2.streamId]), () => ( _uuid.v4.call(void 0, )));
|
|
43
|
-
this.onNoActiveReaderCallback = onNoActiveReaderCallback;
|
|
44
|
-
this.startChecking(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _3 => _3.intervalCheckInMs]), () => ( 20)));
|
|
45
|
-
}
|
|
46
|
-
__init() {this.checkInterval = null}
|
|
47
|
-
|
|
48
|
-
__init2() {this._isStopped = false}
|
|
49
|
-
get hasActiveSubscribers() {
|
|
50
|
-
return !this._isStopped;
|
|
51
|
-
}
|
|
52
|
-
startChecking(interval) {
|
|
53
|
-
this.checkInterval = setInterval(() => {
|
|
54
|
-
this.checkNoActiveReader();
|
|
55
|
-
}, interval);
|
|
56
|
-
}
|
|
57
|
-
stopChecking() {
|
|
58
|
-
if (!this.checkInterval) return;
|
|
59
|
-
clearInterval(this.checkInterval);
|
|
60
|
-
this.checkInterval = null;
|
|
61
|
-
this._isStopped = true;
|
|
62
|
-
this.onNoActiveReaderCallback(this);
|
|
63
|
-
}
|
|
64
|
-
checkNoActiveReader() {
|
|
65
|
-
if (!this.readable.locked && !this._isStopped) {
|
|
66
|
-
this.stopChecking();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}, _class);
|
|
70
|
-
var asyncRetry = async (fn, opts) => {
|
|
71
|
-
if (opts === void 0 || opts.retries === 0) return fn();
|
|
72
|
-
return _asyncretry2.default.call(void 0,
|
|
73
|
-
async (bail) => {
|
|
74
|
-
try {
|
|
75
|
-
return await fn();
|
|
76
|
-
} catch (error2) {
|
|
77
|
-
if (_optionalChain([opts, 'optionalAccess', _4 => _4.shouldRetryError]) && !opts.shouldRetryError(error2)) {
|
|
78
|
-
bail(error2);
|
|
79
|
-
}
|
|
80
|
-
throw error2;
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
_nullishCoalesce(opts, () => ( { retries: 0 }))
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
var ParseError = class extends Error {
|
|
87
|
-
constructor(text) {
|
|
88
|
-
super(`Cannot parse! ${text}`);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
var JSONParser = {
|
|
92
|
-
stringify: (value, options) => {
|
|
93
|
-
return JSON.stringify(
|
|
94
|
-
_optionalChain([options, 'optionalAccess', _5 => _5.map]) ? options.map(value) : value,
|
|
95
|
-
//TODO: Consider adding support to DateTime and adding specific format to mark that's a bigint
|
|
96
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
97
|
-
(_, v) => typeof v === "bigint" ? v.toString() : v
|
|
98
|
-
);
|
|
99
|
-
},
|
|
100
|
-
parse: (text, options) => {
|
|
101
|
-
const parsed = JSON.parse(text, _optionalChain([options, 'optionalAccess', _6 => _6.reviver]));
|
|
102
|
-
if (_optionalChain([options, 'optionalAccess', _7 => _7.typeCheck]) && !_optionalChain([options, 'optionalAccess', _8 => _8.typeCheck, 'call', _9 => _9(parsed)]))
|
|
103
|
-
throw new ParseError(text);
|
|
104
|
-
return _optionalChain([options, 'optionalAccess', _10 => _10.map]) ? options.map(parsed) : parsed;
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
var filter = (filter2) => new (0, _webstreamspolyfill.TransformStream)({
|
|
108
|
-
transform(chunk, controller) {
|
|
109
|
-
if (filter2(chunk)) {
|
|
110
|
-
controller.enqueue(chunk);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
var map = (map2) => new (0, _webstreamspolyfill.TransformStream)({
|
|
115
|
-
transform(chunk, controller) {
|
|
116
|
-
controller.enqueue(map2(chunk));
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
var reduce = (reducer, initialValue) => new ReduceTransformStream(reducer, initialValue);
|
|
120
|
-
var ReduceTransformStream = class extends _webstreamspolyfill.TransformStream {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
constructor(reducer, initialValue) {
|
|
124
|
-
super({
|
|
125
|
-
transform: (chunk) => {
|
|
126
|
-
this.accumulator = this.reducer(this.accumulator, chunk);
|
|
127
|
-
},
|
|
128
|
-
flush: (controller) => {
|
|
129
|
-
controller.enqueue(this.accumulator);
|
|
130
|
-
controller.terminate();
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
this.accumulator = initialValue;
|
|
134
|
-
this.reducer = reducer;
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
var retryStream = (createSourceStream, handleChunk2, retryOptions = { forever: true, minTimeout: 25 }) => new (0, _webstreamspolyfill.TransformStream)({
|
|
138
|
-
start(controller) {
|
|
139
|
-
asyncRetry(
|
|
140
|
-
() => onRestream(createSourceStream, handleChunk2, controller),
|
|
141
|
-
retryOptions
|
|
142
|
-
).catch((error2) => {
|
|
143
|
-
controller.error(error2);
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
var onRestream = async (createSourceStream, handleChunk2, controller) => {
|
|
148
|
-
const sourceStream = createSourceStream();
|
|
149
|
-
const reader = sourceStream.getReader();
|
|
150
|
-
try {
|
|
151
|
-
let done;
|
|
152
|
-
do {
|
|
153
|
-
const result = await reader.read();
|
|
154
|
-
done = result.done;
|
|
155
|
-
await handleChunk2(result, controller);
|
|
156
|
-
if (done) {
|
|
157
|
-
controller.terminate();
|
|
158
|
-
}
|
|
159
|
-
} while (!done);
|
|
160
|
-
} finally {
|
|
161
|
-
reader.releaseLock();
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
var skip = (limit) => new SkipTransformStream(limit);
|
|
165
|
-
var SkipTransformStream = (_class2 = class extends _webstreamspolyfill.TransformStream {
|
|
166
|
-
__init3() {this.count = 0}
|
|
167
|
-
|
|
168
|
-
constructor(skip2) {
|
|
169
|
-
super({
|
|
170
|
-
transform: (chunk, controller) => {
|
|
171
|
-
this.count++;
|
|
172
|
-
if (this.count > this.skip) {
|
|
173
|
-
controller.enqueue(chunk);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
});_class2.prototype.__init3.call(this);;
|
|
177
|
-
this.skip = skip2;
|
|
178
|
-
}
|
|
179
|
-
}, _class2);
|
|
180
|
-
var stopAfter = (stopCondition) => new (0, _webstreamspolyfill.TransformStream)({
|
|
181
|
-
transform(chunk, controller) {
|
|
182
|
-
controller.enqueue(chunk);
|
|
183
|
-
if (stopCondition(chunk)) {
|
|
184
|
-
controller.terminate();
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
var stopOn = (stopCondition) => new (0, _webstreamspolyfill.TransformStream)({
|
|
189
|
-
async transform(chunk, controller) {
|
|
190
|
-
if (!stopCondition(chunk)) {
|
|
191
|
-
controller.enqueue(chunk);
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
await Promise.resolve();
|
|
195
|
-
controller.terminate();
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
var take = (limit) => new TakeTransformStream(limit);
|
|
199
|
-
var TakeTransformStream = (_class3 = class extends _webstreamspolyfill.TransformStream {
|
|
200
|
-
__init4() {this.count = 0}
|
|
201
|
-
|
|
202
|
-
constructor(limit) {
|
|
203
|
-
super({
|
|
204
|
-
transform: (chunk, controller) => {
|
|
205
|
-
if (this.count < this.limit) {
|
|
206
|
-
this.count++;
|
|
207
|
-
controller.enqueue(chunk);
|
|
208
|
-
} else {
|
|
209
|
-
controller.terminate();
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
});_class3.prototype.__init4.call(this);;
|
|
213
|
-
this.limit = limit;
|
|
214
|
-
}
|
|
215
|
-
}, _class3);
|
|
216
|
-
var waitAtMost = (waitTimeInMs) => new (0, _webstreamspolyfill.TransformStream)({
|
|
217
|
-
start(controller) {
|
|
218
|
-
const timeoutId = setTimeout(() => {
|
|
219
|
-
controller.terminate();
|
|
220
|
-
}, waitTimeInMs);
|
|
221
|
-
const originalTerminate = controller.terminate.bind(controller);
|
|
222
|
-
controller.terminate = () => {
|
|
223
|
-
clearTimeout(timeoutId);
|
|
224
|
-
originalTerminate();
|
|
225
|
-
};
|
|
226
|
-
},
|
|
227
|
-
transform(chunk, controller) {
|
|
228
|
-
controller.enqueue(chunk);
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
var streamTransformations = {
|
|
232
|
-
filter,
|
|
233
|
-
take,
|
|
234
|
-
TakeTransformStream,
|
|
235
|
-
skip,
|
|
236
|
-
SkipTransformStream,
|
|
237
|
-
map,
|
|
238
|
-
notifyAboutNoActiveReadersStream,
|
|
239
|
-
NotifyAboutNoActiveReadersStream,
|
|
240
|
-
reduce,
|
|
241
|
-
ReduceTransformStream,
|
|
242
|
-
retry: retryStream,
|
|
243
|
-
stopAfter,
|
|
244
|
-
stopOn,
|
|
245
|
-
waitAtMost
|
|
246
|
-
};
|
|
247
|
-
var { retry: retry2 } = streamTransformations;
|
|
248
|
-
var AssertionError = class extends Error {
|
|
249
|
-
constructor(message) {
|
|
250
|
-
super(message);
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
var isSubset = (superObj, subObj) => {
|
|
254
|
-
const sup = superObj;
|
|
255
|
-
const sub = subObj;
|
|
256
|
-
assertOk(sup);
|
|
257
|
-
assertOk(sub);
|
|
258
|
-
return Object.keys(sub).every((ele) => {
|
|
259
|
-
if (typeof sub[ele] == "object") {
|
|
260
|
-
return isSubset(sup[ele], sub[ele]);
|
|
261
|
-
}
|
|
262
|
-
return sub[ele] === sup[ele];
|
|
263
|
-
});
|
|
264
|
-
};
|
|
265
|
-
var assertFails = (message) => {
|
|
266
|
-
throw new AssertionError(_nullishCoalesce(message, () => ( "That should not ever happened, right?")));
|
|
267
|
-
};
|
|
268
|
-
var assertMatches = (actual, expected, message) => {
|
|
269
|
-
if (!isSubset(actual, expected))
|
|
270
|
-
throw new AssertionError(
|
|
271
|
-
_nullishCoalesce(message, () => ( `subObj:
|
|
272
|
-
${JSONParser.stringify(expected)}
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3;require('express-async-errors');var _express = require('express'); var _express2 = _interopRequireDefault(_express);var _http = require('http'); var _http2 = _interopRequireDefault(_http);var y=e=>typeof e=="number"&&e===e;var _uuid = require('uuid');var _webstreamspolyfill = require('web-streams-polyfill');var _asyncretry = require('async-retry'); var _asyncretry2 = _interopRequireDefault(_asyncretry);var V=(e,t={})=>new R(e,t),R= (_class =class extends _webstreamspolyfill.TransformStream{constructor(e,t={}){super({cancel:r=>{console.log("Stream was canceled. Reason:",r),this.stopChecking()}});_class.prototype.__init.call(this);_class.prototype.__init2.call(this);,this.onNoActiveReaderCallback=e,this.streamId=_nullishCoalesce(_optionalChain([t, 'optionalAccess', _2 => _2.streamId]), () => (_uuid.v4.call(void 0, ))),this.onNoActiveReaderCallback=e,this.startChecking(_nullishCoalesce(_optionalChain([t, 'optionalAccess', _3 => _3.intervalCheckInMs]), () => (20)))}__init() {this.checkInterval=null}__init2() {this._isStopped=!1}get hasActiveSubscribers(){return!this._isStopped}startChecking(e){this.checkInterval=setInterval(()=>{this.checkNoActiveReader()},e)}stopChecking(){this.checkInterval&&(clearInterval(this.checkInterval),this.checkInterval=null,this._isStopped=!0,this.onNoActiveReaderCallback(this))}checkNoActiveReader(){!this.readable.locked&&!this._isStopped&&this.stopChecking()}}, _class);var B=async(e,t)=>t===void 0||t.retries===0?e():_asyncretry2.default.call(void 0, async r=>{try{return await e()}catch(s){throw _optionalChain([t, 'optionalAccess', _4 => _4.shouldRetryError])&&!t.shouldRetryError(s)&&r(s),s}},_nullishCoalesce(t, () => ({retries:0})));var j=class extends Error{constructor(e){super(`Cannot parse! ${e}`)}},l={stringify:(e,t)=>JSON.stringify(_optionalChain([t, 'optionalAccess', _5 => _5.map])?t.map(e):e,(r,s)=>typeof s=="bigint"?s.toString():s),parse:(e,t)=>{let r=JSON.parse(e,_optionalChain([t, 'optionalAccess', _6 => _6.reviver]));if(_optionalChain([t, 'optionalAccess', _7 => _7.typeCheck])&&!_optionalChain([t, 'optionalAccess', _8 => _8.typeCheck, 'call', _9 => _9(r)]))throw new j(e);return _optionalChain([t, 'optionalAccess', _10 => _10.map])?t.map(r):r}};var $=e=>new (0, _webstreamspolyfill.TransformStream)({transform(t,r){e(t)&&r.enqueue(t)}}),W=e=>new (0, _webstreamspolyfill.TransformStream)({transform(t,r){r.enqueue(e(t))}}),J=(e,t)=>new x(e,t),x=class extends _webstreamspolyfill.TransformStream{constructor(e,t){super({transform:r=>{this.accumulator=this.reducer(this.accumulator,r)},flush:r=>{r.enqueue(this.accumulator),r.terminate()}}),this.accumulator=t,this.reducer=e}},L=(e,t,r={forever:!0,minTimeout:25})=>new (0, _webstreamspolyfill.TransformStream)({start(s){B(()=>X(e,t,s),r).catch(n=>{s.error(n)})}}),X=async(e,t,r)=>{let n=e().getReader();try{let o;do{let i=await n.read();o=i.done,await t(i,r),o&&r.terminate()}while(!o)}finally{n.releaseLock()}},z=e=>new A(e),A= (_class2 =class extends _webstreamspolyfill.TransformStream{__init3() {this.count=0}constructor(e){super({transform:(t,r)=>{this.count++,this.count>this.skip&&r.enqueue(t)}});_class2.prototype.__init3.call(this);,this.skip=e}}, _class2),ee=e=>new (0, _webstreamspolyfill.TransformStream)({transform(t,r){r.enqueue(t),e(t)&&r.terminate()}}),re=e=>new (0, _webstreamspolyfill.TransformStream)({async transform(t,r){if(!e(t)){r.enqueue(t);return}await Promise.resolve(),r.terminate()}}),ne=e=>new C(e),C= (_class3 =class extends _webstreamspolyfill.TransformStream{__init4() {this.count=0}constructor(e){super({transform:(t,r)=>{this.count<this.limit?(this.count++,r.enqueue(t)):r.terminate()}});_class3.prototype.__init4.call(this);,this.limit=e}}, _class3),ae=e=>new (0, _webstreamspolyfill.TransformStream)({start(t){let r=setTimeout(()=>{t.terminate()},e),s=t.terminate.bind(t);t.terminate=()=>{clearTimeout(r),s()}},transform(t,r){r.enqueue(t)}}),ie={filter:$,take:ne,TakeTransformStream:C,skip:z,SkipTransformStream:A,map:W,notifyAboutNoActiveReadersStream:V,NotifyAboutNoActiveReadersStream:R,reduce:J,ReduceTransformStream:x,retry:L,stopAfter:ee,stopOn:re,waitAtMost:ae},{retry:ct}=ie;var d=class extends Error{constructor(e){super(e)}},O=(e,t)=>{let r=e,s=t;return w(r),w(s),Object.keys(s).every(n=>typeof s[n]=="object"?O(r[n],s[n]):s[n]===r[n])},E=e=>{throw new d(_nullishCoalesce(e, () => ("That should not ever happened, right?")))};var f=(e,t,r)=>{if(!O(e,t))throw new d(_nullishCoalesce(r, () => (`subObj:
|
|
2
|
+
${l.stringify(t)}
|
|
273
3
|
is not subset of
|
|
274
|
-
${
|
|
275
|
-
|
|
276
|
-
};
|
|
277
|
-
function assertOk(obj, message) {
|
|
278
|
-
if (!obj) throw new AssertionError(_nullishCoalesce(message, () => ( `Condition is not truthy`)));
|
|
279
|
-
}
|
|
280
|
-
function assertEqual(expected, actual, message) {
|
|
281
|
-
if (expected !== actual)
|
|
282
|
-
throw new AssertionError(
|
|
283
|
-
`${_nullishCoalesce(message, () => ( "Objects are not equal"))}:
|
|
284
|
-
Expected: ${JSONParser.stringify(expected)}
|
|
285
|
-
Actual:${JSONParser.stringify(actual)}`
|
|
286
|
-
);
|
|
287
|
-
}
|
|
288
|
-
var WrapEventStore = (eventStore) => {
|
|
289
|
-
const appendedEvents = /* @__PURE__ */ new Map();
|
|
290
|
-
return {
|
|
291
|
-
async aggregateStream(streamName, options) {
|
|
292
|
-
return eventStore.aggregateStream(streamName, options);
|
|
293
|
-
},
|
|
294
|
-
readStream(streamName, options) {
|
|
295
|
-
return eventStore.readStream(streamName, options);
|
|
296
|
-
},
|
|
297
|
-
appendToStream: async (streamName, events, options) => {
|
|
298
|
-
const result = await eventStore.appendToStream(
|
|
299
|
-
streamName,
|
|
300
|
-
events,
|
|
301
|
-
options
|
|
302
|
-
);
|
|
303
|
-
const currentStream = _nullishCoalesce(appendedEvents.get(streamName), () => ( [streamName, []]));
|
|
304
|
-
appendedEvents.set(streamName, [
|
|
305
|
-
streamName,
|
|
306
|
-
[...currentStream[1], ...events]
|
|
307
|
-
]);
|
|
308
|
-
return result;
|
|
309
|
-
},
|
|
310
|
-
appendedEvents,
|
|
311
|
-
setup: async (streamName, events) => {
|
|
312
|
-
return eventStore.appendToStream(streamName, events);
|
|
313
|
-
}
|
|
314
|
-
// streamEvents: (): ReadableStream<
|
|
315
|
-
// // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
|
316
|
-
// ReadEvent<Event, ReadEventMetadataType> | GlobalSubscriptionEvent
|
|
317
|
-
// > => {
|
|
318
|
-
// return eventStore.streamEvents();
|
|
319
|
-
// },
|
|
320
|
-
};
|
|
321
|
-
};
|
|
322
|
-
|
|
323
|
-
// src/middlewares/problemDetailsMiddleware.ts
|
|
324
|
-
var _httpproblemdetails = require('http-problem-details');
|
|
325
|
-
var problemDetailsMiddleware = (mapError) => (error, request, response, _next) => {
|
|
326
|
-
let problemDetails;
|
|
327
|
-
if (mapError) problemDetails = mapError(error, request);
|
|
328
|
-
problemDetails = _nullishCoalesce(problemDetails, () => ( defaulErrorToProblemDetailsMapping(error)));
|
|
329
|
-
sendProblem(response, problemDetails.status, { problem: problemDetails });
|
|
330
|
-
};
|
|
331
|
-
var defaulErrorToProblemDetailsMapping = (error) => {
|
|
332
|
-
let statusCode = 500;
|
|
333
|
-
if ("errorCode" in error && isNumber(error.errorCode) && error.errorCode >= 100 && error.errorCode < 600) {
|
|
334
|
-
statusCode = error.errorCode;
|
|
335
|
-
}
|
|
336
|
-
return new (0, _httpproblemdetails.ProblemDocument)({
|
|
337
|
-
detail: error.message,
|
|
338
|
-
status: statusCode
|
|
339
|
-
});
|
|
340
|
-
};
|
|
341
|
-
|
|
342
|
-
// src/application.ts
|
|
343
|
-
var getApplication = (options) => {
|
|
344
|
-
const app = _express2.default.call(void 0, );
|
|
345
|
-
const {
|
|
346
|
-
apis,
|
|
347
|
-
mapError,
|
|
348
|
-
enableDefaultExpressEtag,
|
|
349
|
-
disableJsonMiddleware,
|
|
350
|
-
disableUrlEncodingMiddleware,
|
|
351
|
-
disableProblemDetailsMiddleware
|
|
352
|
-
} = options;
|
|
353
|
-
const router = _express.Router.call(void 0, );
|
|
354
|
-
app.set("etag", _nullishCoalesce(enableDefaultExpressEtag, () => ( false)));
|
|
355
|
-
if (!disableJsonMiddleware) app.use(_express2.default.json());
|
|
356
|
-
if (!disableUrlEncodingMiddleware)
|
|
357
|
-
app.use(
|
|
358
|
-
_express2.default.urlencoded({
|
|
359
|
-
extended: true
|
|
360
|
-
})
|
|
361
|
-
);
|
|
362
|
-
for (const api of apis) {
|
|
363
|
-
api(router);
|
|
364
|
-
}
|
|
365
|
-
app.use(router);
|
|
366
|
-
if (!disableProblemDetailsMiddleware)
|
|
367
|
-
app.use(problemDetailsMiddleware(mapError));
|
|
368
|
-
return app;
|
|
369
|
-
};
|
|
370
|
-
var startAPI = (app, options = { port: 3e3 }) => {
|
|
371
|
-
const { port } = options;
|
|
372
|
-
const server = _http2.default.createServer(app);
|
|
373
|
-
server.on("listening", () => {
|
|
374
|
-
console.info("server up listening");
|
|
375
|
-
});
|
|
376
|
-
return server.listen(port);
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
// src/etag.ts
|
|
380
|
-
var HeaderNames = {
|
|
381
|
-
IF_MATCH: "if-match",
|
|
382
|
-
IF_NOT_MATCH: "if-not-match",
|
|
383
|
-
ETag: "etag"
|
|
384
|
-
};
|
|
385
|
-
var WeakETagRegex = /W\/"(-?\d+.*)"/;
|
|
386
|
-
var ETagErrors = /* @__PURE__ */ ((ETagErrors2) => {
|
|
387
|
-
ETagErrors2["WRONG_WEAK_ETAG_FORMAT"] = "WRONG_WEAK_ETAG_FORMAT";
|
|
388
|
-
ETagErrors2["MISSING_IF_MATCH_HEADER"] = "MISSING_IF_MATCH_HEADER";
|
|
389
|
-
ETagErrors2["MISSING_IF_NOT_MATCH_HEADER"] = "MISSING_IF_NOT_MATCH_HEADER";
|
|
390
|
-
return ETagErrors2;
|
|
391
|
-
})(ETagErrors || {});
|
|
392
|
-
var isWeakETag = (etag) => {
|
|
393
|
-
return WeakETagRegex.test(etag);
|
|
394
|
-
};
|
|
395
|
-
var getWeakETagValue = (etag) => {
|
|
396
|
-
const result = WeakETagRegex.exec(etag);
|
|
397
|
-
if (result === null || result.length === 0) {
|
|
398
|
-
throw new Error("WRONG_WEAK_ETAG_FORMAT" /* WRONG_WEAK_ETAG_FORMAT */);
|
|
399
|
-
}
|
|
400
|
-
return result[1];
|
|
401
|
-
};
|
|
402
|
-
var toWeakETag = (value) => {
|
|
403
|
-
return `W/"${value}"`;
|
|
404
|
-
};
|
|
405
|
-
var getETagFromIfMatch = (request) => {
|
|
406
|
-
const etag = request.headers[HeaderNames.IF_MATCH];
|
|
407
|
-
if (etag === void 0) {
|
|
408
|
-
throw new Error("MISSING_IF_MATCH_HEADER" /* MISSING_IF_MATCH_HEADER */);
|
|
409
|
-
}
|
|
410
|
-
return etag;
|
|
411
|
-
};
|
|
412
|
-
var getETagFromIfNotMatch = (request) => {
|
|
413
|
-
const etag = request.headers[HeaderNames.IF_NOT_MATCH];
|
|
414
|
-
if (etag === void 0) {
|
|
415
|
-
throw new Error("MISSING_IF_MATCH_HEADER" /* MISSING_IF_MATCH_HEADER */);
|
|
416
|
-
}
|
|
417
|
-
return Array.isArray(etag) ? etag[0] : etag;
|
|
418
|
-
};
|
|
419
|
-
var setETag = (response, etag) => {
|
|
420
|
-
response.setHeader(HeaderNames.ETag, etag);
|
|
421
|
-
};
|
|
422
|
-
var getETagValueFromIfMatch = (request) => {
|
|
423
|
-
const eTagValue = getETagFromIfMatch(request);
|
|
424
|
-
return isWeakETag(eTagValue) ? getWeakETagValue(eTagValue) : eTagValue;
|
|
425
|
-
};
|
|
426
|
-
|
|
427
|
-
// src/handler.ts
|
|
428
|
-
|
|
429
|
-
var on = (handle) => async (request, response, _next) => {
|
|
430
|
-
const setResponse = await Promise.resolve(handle(request));
|
|
431
|
-
return setResponse(response);
|
|
432
|
-
};
|
|
433
|
-
var OK = (options) => (response) => {
|
|
434
|
-
send(response, 200, options);
|
|
435
|
-
};
|
|
436
|
-
var Created = (options) => (response) => {
|
|
437
|
-
sendCreated(response, options);
|
|
438
|
-
};
|
|
439
|
-
var Accepted = (options) => (response) => {
|
|
440
|
-
sendAccepted(response, options);
|
|
441
|
-
};
|
|
442
|
-
var NoContent = (options) => HttpResponse(204, options);
|
|
443
|
-
var HttpResponse = (statusCode, options) => (response) => {
|
|
444
|
-
send(response, statusCode, options);
|
|
445
|
-
};
|
|
446
|
-
var BadRequest = (options) => HttpProblem(400, options);
|
|
447
|
-
var Forbidden = (options) => HttpProblem(403, options);
|
|
448
|
-
var NotFound = (options) => HttpProblem(404, options);
|
|
449
|
-
var Conflict = (options) => HttpProblem(409, options);
|
|
450
|
-
var PreconditionFailed = (options) => HttpProblem(412, options);
|
|
451
|
-
var HttpProblem = (statusCode, options) => (response) => {
|
|
452
|
-
sendProblem(response, statusCode, options);
|
|
453
|
-
};
|
|
454
|
-
|
|
455
|
-
// src/responses.ts
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
var DefaultHttpResponseOptions = {};
|
|
459
|
-
var DefaultHttpProblemResponseOptions = {
|
|
460
|
-
problemDetails: "Error occured!"
|
|
461
|
-
};
|
|
462
|
-
var sendCreated = (response, { eTag, ...options }) => send(response, 201, {
|
|
463
|
-
location: "url" in options ? options.url : `${response.req.url}/${options.createdId}`,
|
|
464
|
-
body: "createdId" in options ? { id: options.createdId } : void 0,
|
|
465
|
-
eTag
|
|
466
|
-
});
|
|
467
|
-
var sendAccepted = (response, options) => send(response, 202, options);
|
|
468
|
-
var send = (response, statusCode, options) => {
|
|
469
|
-
const { location, body, eTag } = _nullishCoalesce(options, () => ( DefaultHttpResponseOptions));
|
|
470
|
-
if (eTag) setETag(response, eTag);
|
|
471
|
-
if (location) response.setHeader("Location", location);
|
|
472
|
-
if (body) {
|
|
473
|
-
response.statusCode = statusCode;
|
|
474
|
-
response.send(body);
|
|
475
|
-
} else {
|
|
476
|
-
response.sendStatus(statusCode);
|
|
477
|
-
}
|
|
478
|
-
};
|
|
479
|
-
var sendProblem = (response, statusCode, options) => {
|
|
480
|
-
options = _nullishCoalesce(options, () => ( DefaultHttpProblemResponseOptions));
|
|
481
|
-
const { location, eTag } = options;
|
|
482
|
-
const problemDetails = "problem" in options ? options.problem : new (0, _httpproblemdetails.ProblemDocument)({
|
|
483
|
-
detail: options.problemDetails,
|
|
484
|
-
status: statusCode
|
|
485
|
-
});
|
|
486
|
-
if (eTag) setETag(response, eTag);
|
|
487
|
-
if (location) response.setHeader("Location", location);
|
|
488
|
-
response.setHeader("Content-Type", "application/problem+json");
|
|
489
|
-
response.statusCode = statusCode;
|
|
490
|
-
response.json(problemDetails);
|
|
491
|
-
};
|
|
492
|
-
|
|
493
|
-
// src/testing/apiE2ESpecification.ts
|
|
494
|
-
var _supertest = require('supertest'); var _supertest2 = _interopRequireDefault(_supertest);
|
|
495
|
-
var _assert = require('assert'); var _assert2 = _interopRequireDefault(_assert);
|
|
496
|
-
var ApiE2ESpecification = {
|
|
497
|
-
for: (getEventStore, getApplication2) => {
|
|
498
|
-
{
|
|
499
|
-
return (...givenRequests) => {
|
|
500
|
-
const eventStore = WrapEventStore(getEventStore());
|
|
501
|
-
const application = getApplication2(eventStore);
|
|
502
|
-
return {
|
|
503
|
-
when: (setupRequest) => {
|
|
504
|
-
const handle = async () => {
|
|
505
|
-
for (const requestFn of givenRequests) {
|
|
506
|
-
await requestFn(_supertest2.default.call(void 0, application));
|
|
507
|
-
}
|
|
508
|
-
return setupRequest(_supertest2.default.call(void 0, application));
|
|
509
|
-
};
|
|
510
|
-
return {
|
|
511
|
-
then: async (verify) => {
|
|
512
|
-
const response = await handle();
|
|
513
|
-
verify.forEach((assertion) => {
|
|
514
|
-
const succeeded = assertion(response);
|
|
515
|
-
if (succeeded === false) _assert2.default.fail();
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
};
|
|
519
|
-
}
|
|
520
|
-
};
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
};
|
|
525
|
-
|
|
526
|
-
// src/testing/apiSpecification.ts
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
var existingStream = (streamId, events) => {
|
|
530
|
-
return [streamId, events];
|
|
531
|
-
};
|
|
532
|
-
var expect = (streamId, events) => {
|
|
533
|
-
return [streamId, events];
|
|
534
|
-
};
|
|
535
|
-
var expectNewEvents = (streamId, events) => {
|
|
536
|
-
return [streamId, events];
|
|
537
|
-
};
|
|
538
|
-
var expectResponse = (statusCode, options) => (response) => {
|
|
539
|
-
const { body, headers } = _nullishCoalesce(options, () => ( {}));
|
|
540
|
-
assertEqual(statusCode, response.statusCode, "Response code doesn't match");
|
|
541
|
-
if (body) assertMatches(response.body, body);
|
|
542
|
-
if (headers) assertMatches(response.headers, headers);
|
|
543
|
-
};
|
|
544
|
-
var expectError = (errorCode, problemDetails) => expectResponse(
|
|
545
|
-
errorCode,
|
|
546
|
-
problemDetails ? { body: problemDetails } : void 0
|
|
547
|
-
);
|
|
548
|
-
var ApiSpecification = {
|
|
549
|
-
for: (getEventStore, getApplication2) => {
|
|
550
|
-
{
|
|
551
|
-
return (...givenStreams) => {
|
|
552
|
-
const eventStore = WrapEventStore(getEventStore());
|
|
553
|
-
const application = getApplication2(eventStore);
|
|
554
|
-
return {
|
|
555
|
-
when: (setupRequest) => {
|
|
556
|
-
const handle = async () => {
|
|
557
|
-
for (const [streamName, events] of givenStreams) {
|
|
558
|
-
await eventStore.setup(streamName, events);
|
|
559
|
-
}
|
|
560
|
-
return setupRequest(_supertest2.default.call(void 0, application));
|
|
561
|
-
};
|
|
562
|
-
return {
|
|
563
|
-
then: async (verify) => {
|
|
564
|
-
const response = await handle();
|
|
565
|
-
if (typeof verify === "function") {
|
|
566
|
-
const succeeded = verify(response);
|
|
567
|
-
if (succeeded === false) assertFails();
|
|
568
|
-
} else if (Array.isArray(verify)) {
|
|
569
|
-
const [first, ...rest] = verify;
|
|
570
|
-
if (typeof first === "function") {
|
|
571
|
-
const succeeded = first(response);
|
|
572
|
-
if (succeeded === false) assertFails();
|
|
573
|
-
}
|
|
574
|
-
const events = typeof first === "function" ? rest : verify;
|
|
575
|
-
assertMatches(
|
|
576
|
-
Array.from(eventStore.appendedEvents.values()),
|
|
577
|
-
events
|
|
578
|
-
);
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
};
|
|
582
|
-
}
|
|
583
|
-
};
|
|
584
|
-
};
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
exports.Accepted = Accepted; exports.ApiE2ESpecification = ApiE2ESpecification; exports.ApiSpecification = ApiSpecification; exports.BadRequest = BadRequest; exports.Conflict = Conflict; exports.Created = Created; exports.DefaultHttpProblemResponseOptions = DefaultHttpProblemResponseOptions; exports.DefaultHttpResponseOptions = DefaultHttpResponseOptions; exports.ETagErrors = ETagErrors; exports.Forbidden = Forbidden; exports.HeaderNames = HeaderNames; exports.HttpProblem = HttpProblem; exports.HttpResponse = HttpResponse; exports.NoContent = NoContent; exports.NotFound = NotFound; exports.OK = OK; exports.PreconditionFailed = PreconditionFailed; exports.WeakETagRegex = WeakETagRegex; exports.existingStream = existingStream; exports.expect = expect; exports.expectError = expectError; exports.expectNewEvents = expectNewEvents; exports.expectResponse = expectResponse; exports.getApplication = getApplication; exports.getETagFromIfMatch = getETagFromIfMatch; exports.getETagFromIfNotMatch = getETagFromIfNotMatch; exports.getETagValueFromIfMatch = getETagValueFromIfMatch; exports.getWeakETagValue = getWeakETagValue; exports.isWeakETag = isWeakETag; exports.on = on; exports.send = send; exports.sendAccepted = sendAccepted; exports.sendCreated = sendCreated; exports.sendProblem = sendProblem; exports.setETag = setETag; exports.startAPI = startAPI; exports.toWeakETag = toWeakETag;
|
|
4
|
+
${l.stringify(e)}`)))};function w(e,t){if(!e)throw new d(_nullishCoalesce(t, () => ("Condition is not truthy")))}function I(e,t,r){if(e!==t)throw new d(`${_nullishCoalesce(r, () => ("Objects are not equal"))}:
|
|
5
|
+
Expected: ${l.stringify(e)}
|
|
6
|
+
Actual:${l.stringify(t)}`)}var g=e=>{let t=new Map;return{async aggregateStream(r,s){return e.aggregateStream(r,s)},readStream(r,s){return e.readStream(r,s)},appendToStream:async(r,s,n)=>{let o=await e.appendToStream(r,s,n),i=_nullishCoalesce(t.get(r), () => ([r,[]]));return t.set(r,[r,[...i[1],...s]]),o},appendedEvents:t,setup:async(r,s)=>e.appendToStream(r,s)}};var _httpproblemdetails = require('http-problem-details');var N=e=>(t,r,s,n)=>{let o;e&&(o=e(t,r)),o=_nullishCoalesce(o, () => (pe(t))),h(s,o.status,{problem:o})},pe=e=>{let t=500;return"errorCode"in e&&y(e.errorCode)&&e.errorCode>=100&&e.errorCode<600&&(t=e.errorCode),new (0, _httpproblemdetails.ProblemDocument)({detail:e.message,status:t})};var Rt=e=>{let t=_express2.default.call(void 0, ),{apis:r,mapError:s,enableDefaultExpressEtag:n,disableJsonMiddleware:o,disableUrlEncodingMiddleware:i,disableProblemDetailsMiddleware:a}=e,c=_express.Router.call(void 0, );t.set("etag",_nullishCoalesce(n, () => (!1))),o||t.use(_express2.default.json()),i||t.use(_express2.default.urlencoded({extended:!0}));for(let p of r)p(c);return t.use(c),a||t.use(N(s)),t},xt= exports.startAPI =(e,t={port:3e3})=>{let{port:r}=t,s=_http2.default.createServer(e);return s.on("listening",()=>{console.info("server up listening")}),s.listen(r)};var T={IF_MATCH:"if-match",IF_NOT_MATCH:"if-not-match",ETag:"etag"},_= exports.WeakETagRegex =/W\/"(-?\d+.*)"/,le= exports.ETagErrors =(s=>(s.WRONG_WEAK_ETAG_FORMAT="WRONG_WEAK_ETAG_FORMAT",s.MISSING_IF_MATCH_HEADER="MISSING_IF_MATCH_HEADER",s.MISSING_IF_NOT_MATCH_HEADER="MISSING_IF_NOT_MATCH_HEADER",s))(le||{}),de= exports.isWeakETag =e=>_.test(e),fe= exports.getWeakETagValue =e=>{let t=_.exec(e);if(t===null||t.length===0)throw new Error("WRONG_WEAK_ETAG_FORMAT");return t[1]},Ot= exports.toWeakETag =e=>`W/"${e}"`,ge= exports.getETagFromIfMatch =e=>{let t=e.headers[T.IF_MATCH];if(t===void 0)throw new Error("MISSING_IF_MATCH_HEADER");return t},It= exports.getETagFromIfNotMatch =e=>{let t=e.headers[T.IF_NOT_MATCH];if(t===void 0)throw new Error("MISSING_IF_MATCH_HEADER");return Array.isArray(t)?t[0]:t},S= exports.setETag =(e,t)=>{e.setHeader(T.ETag,t)},Nt= exports.getETagValueFromIfMatch =e=>{let t=ge(e);return de(t)?fe(t):t};var Ht=e=>async(t,r,s)=>(await Promise.resolve(e(t)))(r),Dt= exports.OK =e=>t=>{m(t,200,e)},kt= exports.Created =e=>t=>{P(t,e)},qt= exports.Accepted =e=>t=>{M(t,e)},Vt= exports.NoContent =e=>he(204,e),he= exports.HttpResponse =(e,t)=>r=>{m(r,e,t)},Ft= exports.BadRequest =e=>u(400,e),Bt= exports.Forbidden =e=>u(403,e),jt= exports.NotFound =e=>u(404,e),Yt= exports.Conflict =e=>u(409,e),$t= exports.PreconditionFailed =e=>u(412,e),u= exports.HttpProblem =(e,t)=>r=>{h(r,e,t)};var Ee={},ve= exports.DefaultHttpProblemResponseOptions ={problemDetails:"Error occured!"},P= exports.sendCreated =(e,{eTag:t,...r})=>m(e,201,{location:"url"in r?r.url:`${e.req.url}/${r.createdId}`,body:"createdId"in r?{id:r.createdId}:void 0,eTag:t}),M= exports.sendAccepted =(e,t)=>m(e,202,t),m= exports.send =(e,t,r)=>{let{location:s,body:n,eTag:o}=_nullishCoalesce(r, () => (Ee));o&&S(e,o),s&&e.setHeader("Location",s),n?(e.statusCode=t,e.send(n)):e.sendStatus(t)},h= exports.sendProblem =(e,t,r)=>{r=_nullishCoalesce(r, () => (ve));let{location:s,eTag:n}=r,o="problem"in r?r.problem:new (0, _httpproblemdetails.ProblemDocument)({detail:r.problemDetails,status:t});n&&S(e,n),s&&e.setHeader("Location",s),e.setHeader("Content-Type","application/problem+json"),e.statusCode=t,e.json(o)};var _supertest = require('supertest'); var _supertest2 = _interopRequireDefault(_supertest);var _assert = require('assert'); var _assert2 = _interopRequireDefault(_assert);var zt={for:(e,t)=>(...r)=>{let s=g(e()),n=t(s);return{when:o=>{let i=async()=>{for(let a of r)await a(_supertest2.default.call(void 0, n));return o(_supertest2.default.call(void 0, n))};return{then:async a=>{let c=await i();a.forEach(p=>{p(c)===!1&&_assert2.default.fail()})}}}}}};var sr=(e,t)=>[e,t],nr= exports.expect =(e,t)=>[e,t],or= exports.expectNewEvents =(e,t)=>[e,t],be= exports.expectResponse =(e,t)=>r=>{let{body:s,headers:n}=_nullishCoalesce(t, () => ({}));I(e,r.statusCode,"Response code doesn't match"),s&&f(r.body,s),n&&f(r.headers,n)},ar= exports.expectError =(e,t)=>be(e,t?{body:t}:void 0),ir= exports.ApiSpecification ={for:(e,t)=>(...r)=>{let s=g(e()),n=t(s);return{when:o=>{let i=async()=>{for(let[a,c]of r)await s.setup(a,c);return o(_supertest2.default.call(void 0, n))};return{then:async a=>{let c=await i();if(typeof a=="function")a(c)===!1&&E();else if(Array.isArray(a)){let[p,...b]=a;typeof p=="function"&&p(c)===!1&&E();let D=typeof p=="function"?b:a;f(Array.from(s.appendedEvents.values()),D)}}}}}}};exports.Accepted = qt; exports.ApiE2ESpecification = zt; exports.ApiSpecification = ir; exports.BadRequest = Ft; exports.Conflict = Yt; exports.Created = kt; exports.DefaultHttpProblemResponseOptions = ve; exports.DefaultHttpResponseOptions = Ee; exports.ETagErrors = le; exports.Forbidden = Bt; exports.HeaderNames = T; exports.HttpProblem = u; exports.HttpResponse = he; exports.NoContent = Vt; exports.NotFound = jt; exports.OK = Dt; exports.PreconditionFailed = $t; exports.WeakETagRegex = _; exports.existingStream = sr; exports.expect = nr; exports.expectError = ar; exports.expectNewEvents = or; exports.expectResponse = be; exports.getApplication = Rt; exports.getETagFromIfMatch = ge; exports.getETagFromIfNotMatch = It; exports.getETagValueFromIfMatch = Nt; exports.getWeakETagValue = fe; exports.isWeakETag = de; exports.on = Ht; exports.send = m; exports.sendAccepted = M; exports.sendCreated = P; exports.sendProblem = h; exports.setETag = S; exports.startAPI = xt; exports.toWeakETag = Ot;
|
|
627
7
|
//# sourceMappingURL=index.cjs.map
|