@nymphjs/server 1.0.0-beta.11 → 1.0.0-beta.12

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.js CHANGED
@@ -1,794 +1,22 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
4
15
  };
5
16
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.HttpError = void 0;
7
- const express_1 = __importDefault(require("express"));
8
- const cookie_parser_1 = __importDefault(require("cookie-parser"));
9
- const nymph_1 = require("@nymphjs/nymph");
10
- const nymph_2 = require("@nymphjs/nymph");
11
- const HttpError_1 = require("./HttpError");
12
- Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return HttpError_1.HttpError; } });
13
- const NOT_FOUND_ERROR = 'Entity is not found.';
14
- function createServer(nymph, { jsonOptions = {} } = {}) {
15
- const rest = (0, express_1.default)();
16
- rest.use((0, cookie_parser_1.default)());
17
- rest.use(express_1.default.json(jsonOptions || {}));
18
- function instantiateNymph(_request, response, next) {
19
- response.locals.nymph = nymph.clone();
20
- next();
21
- }
22
- function authenticateTilmeld(request, response, next) {
23
- if (response.locals.nymph.tilmeld) {
24
- response.locals.nymph.tilmeld.request = request;
25
- response.locals.nymph.tilmeld.response = response;
26
- try {
27
- response.locals.nymph.tilmeld.authenticate();
28
- }
29
- catch (e) {
30
- httpError(response, 500, e);
31
- return;
32
- }
33
- }
34
- next();
35
- }
36
- function unauthenticateTilmeld(_request, response, next) {
37
- if (response.locals.nymph.tilmeld) {
38
- response.locals.nymph.tilmeld.request = null;
39
- response.locals.nymph.tilmeld.response = null;
40
- try {
41
- response.locals.nymph.tilmeld.clearSession();
42
- }
43
- catch (e) {
44
- httpError(response, 500, e);
45
- return;
46
- }
47
- }
48
- next();
49
- }
50
- function getActionData(request) {
51
- if (request.method === 'GET') {
52
- if (typeof request.query?.action !== 'string' ||
53
- typeof request.query?.data !== 'string') {
54
- return {
55
- action: '',
56
- data: {},
57
- };
58
- }
59
- return {
60
- action: JSON.parse(request.query.action) ?? '',
61
- data: JSON.parse(request.query.data),
62
- };
63
- }
64
- else {
65
- return {
66
- action: request.body.action ?? '',
67
- data: request.body.data,
68
- };
69
- }
70
- }
71
- rest.use(instantiateNymph);
72
- rest.use(authenticateTilmeld);
73
- rest.get('/', async (request, response) => {
74
- try {
75
- const { action, data } = getActionData(request);
76
- if (['entity', 'entities', 'uid'].indexOf(action) === -1) {
77
- httpError(response, 400);
78
- return;
79
- }
80
- if (['entity', 'entities'].indexOf(action) !== -1) {
81
- if (!Array.isArray(data)) {
82
- httpError(response, 400);
83
- return;
84
- }
85
- const count = data.length;
86
- if (count < 1 || typeof data[0] !== 'object') {
87
- httpError(response, 400);
88
- return;
89
- }
90
- if (!('class' in data[0])) {
91
- httpError(response, 400);
92
- return;
93
- }
94
- let [options, ...selectors] = data;
95
- let EntityClass;
96
- try {
97
- EntityClass = response.locals.nymph.getEntityClass(data[0].class);
98
- }
99
- catch (e) {
100
- httpError(response, 400, e);
101
- return;
102
- }
103
- options.class = EntityClass;
104
- options.source = 'client';
105
- options.skipAc = false;
106
- selectors = (0, nymph_1.classNamesToEntityConstructors)(response.locals.nymph, selectors);
107
- let result;
108
- try {
109
- if (action === 'entity') {
110
- result = await response.locals.nymph.getEntity(options, ...selectors);
111
- }
112
- else {
113
- result = await response.locals.nymph.getEntities(options, ...selectors);
114
- }
115
- }
116
- catch (e) {
117
- httpError(response, 500, e);
118
- return;
119
- }
120
- if (result == null || (Array.isArray(result) && result.length === 0)) {
121
- if (action === 'entity' ||
122
- response.locals.nymph.config.emptyListError) {
123
- httpError(response, 404);
124
- return;
125
- }
126
- }
127
- response.setHeader('Content-Type', 'application/json');
128
- response.send(JSON.stringify(result));
129
- }
130
- else {
131
- if (typeof data !== 'string') {
132
- httpError(response, 400);
133
- return;
134
- }
135
- if (response.locals.nymph.tilmeld) {
136
- if (!response.locals.nymph.tilmeld.checkClientUIDPermissions(data, nymph_1.TilmeldAccessLevels.READ_ACCESS)) {
137
- httpError(response, 403);
138
- return;
139
- }
140
- }
141
- let result;
142
- try {
143
- result = await response.locals.nymph.getUID(data);
144
- }
145
- catch (e) {
146
- httpError(response, 500, e);
147
- return;
148
- }
149
- if (result === null) {
150
- httpError(response, 404);
151
- return;
152
- }
153
- else if (typeof result !== 'number') {
154
- httpError(response, 500);
155
- return;
156
- }
157
- response.setHeader('Content-Type', 'text/plain');
158
- response.send(`${result}`);
159
- }
160
- }
161
- catch (e) {
162
- httpError(response, 500, e);
163
- return;
164
- }
165
- });
166
- rest.post('/', async (request, response) => {
167
- try {
168
- const { action, data: dataConst } = getActionData(request);
169
- let data = dataConst;
170
- if (['entity', 'entities', 'uid', 'method'].indexOf(action) === -1) {
171
- httpError(response, 400);
172
- return;
173
- }
174
- if (['entity', 'entities'].indexOf(action) !== -1) {
175
- if (action === 'entity') {
176
- data = [data];
177
- }
178
- const created = [];
179
- let hadSuccess = false;
180
- let invalidRequest = false;
181
- let conflict = false;
182
- let notfound = false;
183
- let lastException = null;
184
- for (let entData of data) {
185
- if (entData.guid) {
186
- invalidRequest = true;
187
- created.push(null);
188
- continue;
189
- }
190
- let entity;
191
- try {
192
- entity = await loadEntity(entData, response.locals.nymph);
193
- }
194
- catch (e) {
195
- if (e instanceof nymph_1.EntityConflictError) {
196
- conflict = true;
197
- }
198
- else if (e.message === NOT_FOUND_ERROR) {
199
- notfound = true;
200
- }
201
- else if (e instanceof nymph_1.InvalidParametersError) {
202
- invalidRequest = true;
203
- lastException = e;
204
- }
205
- else {
206
- lastException = e;
207
- }
208
- created.push(null);
209
- continue;
210
- }
211
- if (!entity) {
212
- invalidRequest = true;
213
- created.push(null);
214
- continue;
215
- }
216
- try {
217
- if (await entity.$save()) {
218
- created.push(entity);
219
- hadSuccess = true;
220
- }
221
- else {
222
- created.push(false);
223
- }
224
- }
225
- catch (e) {
226
- if (e instanceof nymph_2.EntityInvalidDataError) {
227
- invalidRequest = true;
228
- }
229
- else {
230
- lastException = e;
231
- }
232
- created.push(null);
233
- }
234
- }
235
- if (!hadSuccess) {
236
- if (invalidRequest) {
237
- httpError(response, 400, lastException);
238
- return;
239
- }
240
- else if (conflict) {
241
- httpError(response, 409);
242
- return;
243
- }
244
- else if (notfound) {
245
- httpError(response, 404);
246
- return;
247
- }
248
- else {
249
- httpError(response, 500, lastException);
250
- return;
251
- }
252
- }
253
- response.status(201);
254
- response.setHeader('Content-Type', 'application/json');
255
- if (action === 'entity') {
256
- response.send(JSON.stringify(created[0]));
257
- }
258
- else {
259
- response.send(created);
260
- }
261
- }
262
- else if (action === 'method') {
263
- if (!Array.isArray(data.params)) {
264
- httpError(response, 400);
265
- return;
266
- }
267
- const params = referencesToEntities([...data.params], response.locals.nymph);
268
- if (data.static) {
269
- let EntityClass;
270
- try {
271
- EntityClass = response.locals.nymph.getEntityClass(data.class);
272
- }
273
- catch (e) {
274
- httpError(response, 400);
275
- return;
276
- }
277
- if (EntityClass.clientEnabledStaticMethods.indexOf(data.method) === -1) {
278
- httpError(response, 403);
279
- return;
280
- }
281
- if (!(data.method in EntityClass)) {
282
- httpError(response, 400);
283
- return;
284
- }
285
- const method = EntityClass[data.method];
286
- if (typeof method !== 'function') {
287
- httpError(response, 400);
288
- return;
289
- }
290
- try {
291
- const result = method.call(EntityClass, ...params);
292
- let ret = result;
293
- if (result instanceof Promise) {
294
- ret = await result;
295
- }
296
- response.status(200);
297
- response.setHeader('Content-Type', 'application/json');
298
- response.send({ return: ret });
299
- }
300
- catch (e) {
301
- httpError(response, 500, e);
302
- return;
303
- }
304
- }
305
- else {
306
- let entity;
307
- try {
308
- entity = await loadEntity(data.entity, response.locals.nymph);
309
- }
310
- catch (e) {
311
- if (e instanceof nymph_1.EntityConflictError) {
312
- httpError(response, 409);
313
- }
314
- else if (e.message === NOT_FOUND_ERROR) {
315
- httpError(response, 404, e);
316
- }
317
- else if (e instanceof nymph_1.InvalidParametersError) {
318
- httpError(response, 400, e);
319
- }
320
- else {
321
- httpError(response, 500, e);
322
- }
323
- return;
324
- }
325
- if (data.entity.guid && !entity.guid) {
326
- httpError(response, 400);
327
- return;
328
- }
329
- if (entity.$getClientEnabledMethods().indexOf(data.method) === -1) {
330
- httpError(response, 403);
331
- return;
332
- }
333
- if (!(data.method in entity) ||
334
- typeof entity[data.method] !== 'function') {
335
- httpError(response, 400);
336
- return;
337
- }
338
- try {
339
- const result = entity[data.method](...params);
340
- let ret = result;
341
- if (result instanceof Promise) {
342
- ret = await result;
343
- }
344
- response.status(200);
345
- response.setHeader('Content-Type', 'application/json');
346
- if (data.stateless) {
347
- response.send({ return: ret });
348
- }
349
- else {
350
- response.send({ entity: entity, return: ret });
351
- }
352
- }
353
- catch (e) {
354
- httpError(response, 500, e);
355
- return;
356
- }
357
- }
358
- }
359
- else {
360
- if (typeof data !== 'string') {
361
- httpError(response, 400);
362
- return;
363
- }
364
- if (response.locals.nymph.tilmeld) {
365
- if (!response.locals.nymph.tilmeld.checkClientUIDPermissions(data, nymph_1.TilmeldAccessLevels.WRITE_ACCESS)) {
366
- httpError(response, 403);
367
- return;
368
- }
369
- }
370
- let result;
371
- try {
372
- result = await response.locals.nymph.newUID(data);
373
- }
374
- catch (e) {
375
- httpError(response, 500, e);
376
- return;
377
- }
378
- if (typeof result !== 'number') {
379
- httpError(response, 500);
380
- return;
381
- }
382
- response.status(201);
383
- response.setHeader('Content-Type', 'text/plain');
384
- response.send(`${result}`);
385
- }
386
- }
387
- catch (e) {
388
- httpError(response, 500, e);
389
- return;
390
- }
391
- });
392
- rest.put('/', async (request, response) => {
393
- try {
394
- const { action, data } = getActionData(request);
395
- if (['entity', 'entities', 'uid'].indexOf(action) === -1) {
396
- httpError(response, 400);
397
- return;
398
- }
399
- await doPutOrPatch(response, action, data, false);
400
- }
401
- catch (e) {
402
- httpError(response, 500, e);
403
- return;
404
- }
405
- });
406
- rest.patch('/', async (request, response) => {
407
- try {
408
- const { action, data } = getActionData(request);
409
- if (['entity', 'entities'].indexOf(action) === -1) {
410
- httpError(response, 400);
411
- return;
412
- }
413
- await doPutOrPatch(response, action, data, true);
414
- }
415
- catch (e) {
416
- httpError(response, 500, e);
417
- return;
418
- }
419
- });
420
- async function doPutOrPatch(response, action, data, patch) {
421
- if (action === 'uid') {
422
- if (typeof data.name !== 'string' || typeof data.value !== 'number') {
423
- httpError(response, 400);
424
- return;
425
- }
426
- if (response.locals.nymph.tilmeld) {
427
- if (!response.locals.nymph.tilmeld.checkClientUIDPermissions(data.name, nymph_1.TilmeldAccessLevels.FULL_ACCESS)) {
428
- httpError(response, 403);
429
- return;
430
- }
431
- }
432
- let result;
433
- try {
434
- result = await response.locals.nymph.setUID(data.name, data.value);
435
- }
436
- catch (e) {
437
- httpError(response, 500, e);
438
- return;
439
- }
440
- if (!result) {
441
- httpError(response, 500);
442
- return;
443
- }
444
- response.status(200);
445
- response.setHeader('Content-Type', 'text/plain');
446
- response.send(`${result}`);
447
- }
448
- else {
449
- if (action === 'entity') {
450
- data = [data];
451
- }
452
- const saved = [];
453
- let hadSuccess = false;
454
- let invalidRequest = false;
455
- let conflict = false;
456
- let notfound = false;
457
- let lastException = null;
458
- for (let entData of data) {
459
- if (entData.guid && entData.guid.length != 24) {
460
- invalidRequest = true;
461
- saved.push(null);
462
- continue;
463
- }
464
- let entity;
465
- try {
466
- entity = await loadEntity(entData, response.locals.nymph, patch);
467
- }
468
- catch (e) {
469
- if (e instanceof nymph_1.EntityConflictError) {
470
- conflict = true;
471
- }
472
- else if (e.message === NOT_FOUND_ERROR) {
473
- notfound = true;
474
- }
475
- else if (e instanceof nymph_1.InvalidParametersError) {
476
- invalidRequest = true;
477
- lastException = e;
478
- }
479
- else {
480
- lastException = e;
481
- }
482
- saved.push(null);
483
- continue;
484
- }
485
- if (!entity) {
486
- invalidRequest = true;
487
- saved.push(null);
488
- continue;
489
- }
490
- try {
491
- if (await entity.$save()) {
492
- saved.push(entity);
493
- hadSuccess = true;
494
- }
495
- else {
496
- saved.push(false);
497
- }
498
- }
499
- catch (e) {
500
- if (e instanceof nymph_2.EntityInvalidDataError) {
501
- invalidRequest = true;
502
- }
503
- else {
504
- lastException = e;
505
- }
506
- saved.push(null);
507
- }
508
- }
509
- if (!hadSuccess) {
510
- if (invalidRequest) {
511
- httpError(response, 400, lastException);
512
- }
513
- else if (conflict) {
514
- httpError(response, 409);
515
- }
516
- else if (notfound) {
517
- httpError(response, 404);
518
- }
519
- else {
520
- httpError(response, 500, lastException);
521
- }
522
- return;
523
- }
524
- response.status(200);
525
- response.setHeader('Content-Type', 'application/json');
526
- if (action === 'entity') {
527
- response.send(JSON.stringify(saved[0]));
528
- }
529
- else {
530
- response.send(saved);
531
- }
532
- }
533
- }
534
- rest.delete('/', async (request, response) => {
535
- try {
536
- const { action, data: dataConst } = getActionData(request);
537
- let data = dataConst;
538
- if (['entity', 'entities', 'uid'].indexOf(action) === -1) {
539
- httpError(response, 400);
540
- return;
541
- }
542
- if (['entity', 'entities'].indexOf(action) !== -1) {
543
- if (action === 'entity') {
544
- data = [data];
545
- }
546
- const deleted = [];
547
- let failures = false;
548
- let invalidRequest = false;
549
- let notfound = false;
550
- let lastException = null;
551
- for (let entData of data) {
552
- if (entData.guid && entData.guid.length != 24) {
553
- invalidRequest = true;
554
- continue;
555
- }
556
- let EntityClass;
557
- try {
558
- EntityClass = response.locals.nymph.getEntityClass(entData.class);
559
- }
560
- catch (e) {
561
- invalidRequest = true;
562
- failures = true;
563
- continue;
564
- }
565
- let entity;
566
- try {
567
- entity = await response.locals.nymph.getEntity({ class: EntityClass }, { type: '&', guid: entData.guid });
568
- }
569
- catch (e) {
570
- lastException = e;
571
- failures = true;
572
- continue;
573
- }
574
- if (!entity) {
575
- notfound = true;
576
- failures = true;
577
- continue;
578
- }
579
- try {
580
- if (await entity.$delete()) {
581
- deleted.push(entData.guid);
582
- }
583
- else {
584
- failures = true;
585
- }
586
- }
587
- catch (e) {
588
- lastException = e;
589
- failures = true;
590
- }
591
- }
592
- if (deleted.length === 0) {
593
- if (invalidRequest || !failures) {
594
- httpError(response, 400, lastException);
595
- }
596
- else if (notfound) {
597
- httpError(response, 404);
598
- }
599
- else {
600
- httpError(response, 500, lastException);
601
- }
602
- return;
603
- }
604
- response.status(200);
605
- response.setHeader('Content-Type', 'application/json');
606
- if (action === 'entity') {
607
- response.send(JSON.stringify(deleted[0]));
608
- }
609
- else {
610
- response.send(deleted);
611
- }
612
- }
613
- else {
614
- if (typeof data !== 'string') {
615
- httpError(response, 400);
616
- return;
617
- }
618
- if (response.locals.nymph.tilmeld) {
619
- if (!response.locals.nymph.tilmeld.checkClientUIDPermissions(data, nymph_1.TilmeldAccessLevels.FULL_ACCESS)) {
620
- httpError(response, 403);
621
- return;
622
- }
623
- }
624
- let result;
625
- try {
626
- result = await response.locals.nymph.deleteUID(data);
627
- }
628
- catch (e) {
629
- httpError(response, 500, e);
630
- return;
631
- }
632
- if (!result) {
633
- httpError(response, 500);
634
- return;
635
- }
636
- response.status(200);
637
- response.setHeader('Content-Type', 'application/json');
638
- response.send(JSON.stringify(result));
639
- }
640
- }
641
- catch (e) {
642
- httpError(response, 500, e);
643
- return;
644
- }
645
- });
646
- rest.use(unauthenticateTilmeld);
647
- async function loadEntity(entityData, nymph, patch = false, allowConflict = false) {
648
- if (entityData.class === 'Entity') {
649
- throw new nymph_1.InvalidParametersError("Can't use Entity class directly from the front end.");
650
- }
651
- let EntityClass = nymph.getEntityClass(entityData.class);
652
- let entity;
653
- if (entityData.guid) {
654
- entity = await nymph.getEntity({ class: EntityClass, source: 'client' }, {
655
- type: '&',
656
- guid: `${entityData['guid']}`,
657
- });
658
- if (entity === null) {
659
- throw new Error(NOT_FOUND_ERROR);
660
- }
661
- }
662
- else {
663
- entity = await EntityClass.factory();
664
- }
665
- if (patch) {
666
- entity.$jsonAcceptPatch(entityData, allowConflict);
667
- }
668
- else {
669
- entity.$jsonAcceptData(entityData, allowConflict);
670
- }
671
- return entity;
672
- }
673
- function referencesToEntities(item, nymph) {
674
- if (Array.isArray(item)) {
675
- if (item.length === 3 && item[0] === 'nymph_entity_reference') {
676
- try {
677
- const EntityClass = nymph.getEntityClass(item[1]);
678
- return EntityClass.factoryReference(item);
679
- }
680
- catch (e) {
681
- return item;
682
- }
683
- }
684
- return item.map((entry) => referencesToEntities(entry, nymph));
685
- }
686
- else if (typeof item === 'object' && !(item instanceof nymph_1.Entity)) {
687
- const newItem = {};
688
- for (let curProperty in item) {
689
- newItem[curProperty] = referencesToEntities(item[curProperty], nymph);
690
- }
691
- return newItem;
692
- }
693
- return item;
694
- }
695
- function httpError(res, defaultStatusCode, error) {
696
- const status = error?.status || defaultStatusCode;
697
- const statusText = error?.statusText ||
698
- (error?.status == null
699
- ? statusDescriptions[defaultStatusCode]
700
- : error.status in statusDescriptions &&
701
- statusDescriptions[error.status]) ||
702
- 'Internal Server Error';
703
- if (!res.headersSent) {
704
- res.status(status);
705
- res.setHeader('Content-Type', 'application/json');
706
- }
707
- if (error) {
708
- res.send({
709
- textStatus: `${status} ${statusText}`,
710
- statusText,
711
- message: error.message,
712
- error,
713
- ...(process.env.NODE_ENV !== 'production'
714
- ? { stack: error.stack }
715
- : {}),
716
- });
717
- }
718
- else {
719
- res.send({
720
- textStatus: `${status} ${statusText}`,
721
- statusText,
722
- message: statusText,
723
- });
724
- }
725
- }
726
- return rest;
727
- }
728
- exports.default = createServer;
729
- const statusDescriptions = {
730
- 100: 'Continue',
731
- 101: 'Switching Protocols',
732
- 102: 'Processing',
733
- 103: 'Early Hints',
734
- 200: 'OK',
735
- 201: 'Created',
736
- 202: 'Accepted',
737
- 203: 'Non-Authoritative Information',
738
- 204: 'No Content',
739
- 205: 'Reset Content',
740
- 206: 'Partial Content',
741
- 207: 'Multi-Status',
742
- 208: 'Already Reported',
743
- 226: 'IM Used',
744
- 300: 'Multiple Choices',
745
- 301: 'Moved Permanently',
746
- 302: 'Found',
747
- 303: 'See Other',
748
- 304: 'Not Modified',
749
- 305: 'Use Proxy',
750
- 306: 'Switch Proxy',
751
- 307: 'Temporary Redirect',
752
- 308: 'Permanent Redirect',
753
- 400: 'Bad Request',
754
- 401: 'Unauthorized',
755
- 402: 'Payment Required',
756
- 403: 'Forbidden',
757
- 404: 'Not Found',
758
- 405: 'Method Not Allowed',
759
- 406: 'Not Acceptable',
760
- 407: 'Proxy Authentication Required',
761
- 408: 'Request Timeout',
762
- 409: 'Conflict',
763
- 410: 'Gone',
764
- 411: 'Length Required',
765
- 412: 'Precondition Failed',
766
- 413: 'Payload Too Large',
767
- 414: 'URI Too Long',
768
- 415: 'Unsupported Media Type',
769
- 416: 'Range Not Satisfiable',
770
- 417: 'Expectation Failed',
771
- 418: "I'm a teapot",
772
- 421: 'Misdirected Request',
773
- 422: 'Unprocessable Entity',
774
- 423: 'Locked',
775
- 424: 'Failed Dependency',
776
- 425: 'Too Early',
777
- 426: 'Upgrade Required',
778
- 428: 'Precondition Required',
779
- 429: 'Too Many Requests',
780
- 431: 'Request Header Fields Too Large',
781
- 451: 'Unavailable For Legal Reasons',
782
- 500: 'Internal Server Error',
783
- 501: 'Not Implemented',
784
- 502: 'Bad Gateway',
785
- 503: 'Service Unavailable',
786
- 504: 'Gateway Timeout',
787
- 505: 'HTTP Version Not Supported',
788
- 506: 'Variant Also Negotiates',
789
- 507: 'Insufficient Storage',
790
- 508: 'Loop Detected',
791
- 510: 'Not Extended',
792
- 511: 'Network Authentication Required',
793
- };
17
+ const createServer_1 = require("./createServer");
18
+ __exportStar(require("./HttpError"), exports);
19
+ __exportStar(require("./statusDescriptions"), exports);
20
+ __exportStar(require("./createServer"), exports);
21
+ exports.default = createServer_1.createServer;
794
22
  //# sourceMappingURL=index.js.map