@alanszp/express-common-fn 12.0.2 → 13.0.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/dist/commonErrorsHandler.d.ts +3 -0
- package/dist/commonErrorsHandler.js +3 -0
- package/dist/commonErrorsHandler.js.map +1 -1
- package/package.json +6 -9
- package/.gitignore +0 -3
- package/.npmignore +0 -3
- package/node_modules/@alanszp/audit/.gitignore +0 -3
- package/node_modules/@alanszp/audit/.npmignore +0 -3
- package/node_modules/@alanszp/audit/LICENSE +0 -21
- package/node_modules/@alanszp/audit/dist/audit.d.ts +0 -9
- package/node_modules/@alanszp/audit/dist/audit.js +0 -25
- package/node_modules/@alanszp/audit/dist/audit.js.map +0 -1
- package/node_modules/@alanszp/audit/dist/auditWithState.d.ts +0 -10
- package/node_modules/@alanszp/audit/dist/auditWithState.js +0 -22
- package/node_modules/@alanszp/audit/dist/auditWithState.js.map +0 -1
- package/node_modules/@alanszp/audit/dist/errors/AuditError.d.ts +0 -3
- package/node_modules/@alanszp/audit/dist/errors/AuditError.js +0 -8
- package/node_modules/@alanszp/audit/dist/errors/AuditError.js.map +0 -1
- package/node_modules/@alanszp/audit/dist/errors/MissingAuditFieldsError.d.ts +0 -9
- package/node_modules/@alanszp/audit/dist/errors/MissingAuditFieldsError.js +0 -23
- package/node_modules/@alanszp/audit/dist/errors/MissingAuditFieldsError.js.map +0 -1
- package/node_modules/@alanszp/audit/dist/errors/index.d.ts +0 -2
- package/node_modules/@alanszp/audit/dist/errors/index.js +0 -19
- package/node_modules/@alanszp/audit/dist/errors/index.js.map +0 -1
- package/node_modules/@alanszp/audit/dist/factory.d.ts +0 -4
- package/node_modules/@alanszp/audit/dist/factory.js +0 -16
- package/node_modules/@alanszp/audit/dist/factory.js.map +0 -1
- package/node_modules/@alanszp/audit/dist/index.d.ts +0 -5
- package/node_modules/@alanszp/audit/dist/index.js +0 -22
- package/node_modules/@alanszp/audit/dist/index.js.map +0 -1
- package/node_modules/@alanszp/audit/dist/interfaces.d.ts +0 -22
- package/node_modules/@alanszp/audit/dist/interfaces.js +0 -18
- package/node_modules/@alanszp/audit/dist/interfaces.js.map +0 -1
- package/node_modules/@alanszp/audit/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@alanszp/audit/node_modules/@types/node/README.md +0 -15
- package/node_modules/@alanszp/audit/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/audit/node_modules/@types/node/assert.d.ts +0 -996
- package/node_modules/@alanszp/audit/node_modules/@types/node/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/audit/node_modules/@types/node/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/audit/node_modules/@types/node/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/audit/node_modules/@types/node/cluster.d.ts +0 -432
- package/node_modules/@alanszp/audit/node_modules/@types/node/console.d.ts +0 -415
- package/node_modules/@alanszp/audit/node_modules/@types/node/constants.d.ts +0 -19
- package/node_modules/@alanszp/audit/node_modules/@types/node/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/audit/node_modules/@types/node/dgram.d.ts +0 -596
- package/node_modules/@alanszp/audit/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/audit/node_modules/@types/node/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/audit/node_modules/@types/node/dns.d.ts +0 -809
- package/node_modules/@alanszp/audit/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/audit/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@alanszp/audit/node_modules/@types/node/events.d.ts +0 -879
- package/node_modules/@alanszp/audit/node_modules/@types/node/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/audit/node_modules/@types/node/fs.d.ts +0 -4311
- package/node_modules/@alanszp/audit/node_modules/@types/node/globals.d.ts +0 -411
- package/node_modules/@alanszp/audit/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/audit/node_modules/@types/node/http.d.ts +0 -1887
- package/node_modules/@alanszp/audit/node_modules/@types/node/http2.d.ts +0 -2382
- package/node_modules/@alanszp/audit/node_modules/@types/node/https.d.ts +0 -550
- package/node_modules/@alanszp/audit/node_modules/@types/node/index.d.ts +0 -88
- package/node_modules/@alanszp/audit/node_modules/@types/node/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/audit/node_modules/@types/node/module.d.ts +0 -315
- package/node_modules/@alanszp/audit/node_modules/@types/node/net.d.ts +0 -949
- package/node_modules/@alanszp/audit/node_modules/@types/node/os.d.ts +0 -478
- package/node_modules/@alanszp/audit/node_modules/@types/node/package.json +0 -229
- package/node_modules/@alanszp/audit/node_modules/@types/node/path.d.ts +0 -191
- package/node_modules/@alanszp/audit/node_modules/@types/node/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/audit/node_modules/@types/node/process.d.ts +0 -1561
- package/node_modules/@alanszp/audit/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@alanszp/audit/node_modules/@types/node/querystring.d.ts +0 -141
- package/node_modules/@alanszp/audit/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/audit/node_modules/@types/node/readline.d.ts +0 -539
- package/node_modules/@alanszp/audit/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@alanszp/audit/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/audit/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/audit/node_modules/@types/node/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/audit/node_modules/@types/node/stream.d.ts +0 -1701
- package/node_modules/@alanszp/audit/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/audit/node_modules/@types/node/test.d.ts +0 -1465
- package/node_modules/@alanszp/audit/node_modules/@types/node/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/audit/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@alanszp/audit/node_modules/@types/node/tls.d.ts +0 -1210
- package/node_modules/@alanszp/audit/node_modules/@types/node/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/@alanszp/audit/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@alanszp/audit/node_modules/@types/node/url.d.ts +0 -927
- package/node_modules/@alanszp/audit/node_modules/@types/node/util.d.ts +0 -2183
- package/node_modules/@alanszp/audit/node_modules/@types/node/v8.d.ts +0 -764
- package/node_modules/@alanszp/audit/node_modules/@types/node/vm.d.ts +0 -903
- package/node_modules/@alanszp/audit/node_modules/@types/node/wasi.d.ts +0 -179
- package/node_modules/@alanszp/audit/node_modules/@types/node/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/audit/node_modules/@types/node/zlib.d.ts +0 -517
- package/node_modules/@alanszp/audit/package.json +0 -32
- package/node_modules/@alanszp/audit/src/audit.ts +0 -31
- package/node_modules/@alanszp/audit/src/auditWithState.ts +0 -27
- package/node_modules/@alanszp/audit/src/errors/AuditError.ts +0 -3
- package/node_modules/@alanszp/audit/src/errors/MissingAuditFieldsError.ts +0 -25
- package/node_modules/@alanszp/audit/src/errors/index.ts +0 -2
- package/node_modules/@alanszp/audit/src/factory.ts +0 -16
- package/node_modules/@alanszp/audit/src/index.ts +0 -5
- package/node_modules/@alanszp/audit/src/interfaces.ts +0 -38
- package/node_modules/@alanszp/audit/tsconfig.json +0 -15
- package/node_modules/@alanszp/errors/.gitignore +0 -3
- package/node_modules/@alanszp/errors/.npmignore +0 -3
- package/node_modules/@alanszp/errors/LICENSE +0 -21
- package/node_modules/@alanszp/errors/dist/BaseError.d.ts +0 -3
- package/node_modules/@alanszp/errors/dist/BaseError.js +0 -18
- package/node_modules/@alanszp/errors/dist/BaseError.js.map +0 -1
- package/node_modules/@alanszp/errors/dist/HttpRenderableError.d.ts +0 -4
- package/node_modules/@alanszp/errors/dist/HttpRenderableError.js +0 -8
- package/node_modules/@alanszp/errors/dist/HttpRenderableError.js.map +0 -1
- package/node_modules/@alanszp/errors/dist/InternalServerError.d.ts +0 -8
- package/node_modules/@alanszp/errors/dist/InternalServerError.js +0 -24
- package/node_modules/@alanszp/errors/dist/InternalServerError.js.map +0 -1
- package/node_modules/@alanszp/errors/dist/RenderableError.d.ts +0 -15
- package/node_modules/@alanszp/errors/dist/RenderableError.js +0 -27
- package/node_modules/@alanszp/errors/dist/RenderableError.js.map +0 -1
- package/node_modules/@alanszp/errors/dist/index.d.ts +0 -4
- package/node_modules/@alanszp/errors/dist/index.js +0 -17
- package/node_modules/@alanszp/errors/dist/index.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/.gitignore +0 -3
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/.npmignore +0 -3
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/LICENSE +0 -21
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/appIdentifier.d.ts +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/appIdentifier.js +0 -10
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/appIdentifier.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/index.d.ts +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/index.js +0 -18
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/index.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/assignKey.d.ts +0 -2
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/assignKey.js +0 -20
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/assignKey.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/index.d.ts +0 -2
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/index.js +0 -19
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/index.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/keepOrUpdate.d.ts +0 -3
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/keepOrUpdate.js +0 -26
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/keepOrUpdate.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/types.d.ts +0 -6
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/types.js +0 -3
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/types.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/index.d.ts +0 -4
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/index.js +0 -21
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/index.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/ListResult.d.ts +0 -7
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/ListResult.js +0 -8
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/ListResult.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Orderable.d.ts +0 -11
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Orderable.js +0 -13
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Orderable.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Paginable.d.ts +0 -14
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Paginable.js +0 -22
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Paginable.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/index.d.ts +0 -3
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/index.js +0 -20
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/index.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/package.json +0 -25
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/tsconfig.json +0 -15
- package/node_modules/@alanszp/errors/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@alanszp/errors/node_modules/@types/node/README.md +0 -15
- package/node_modules/@alanszp/errors/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/errors/node_modules/@types/node/assert.d.ts +0 -996
- package/node_modules/@alanszp/errors/node_modules/@types/node/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/errors/node_modules/@types/node/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/errors/node_modules/@types/node/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/errors/node_modules/@types/node/cluster.d.ts +0 -432
- package/node_modules/@alanszp/errors/node_modules/@types/node/console.d.ts +0 -415
- package/node_modules/@alanszp/errors/node_modules/@types/node/constants.d.ts +0 -19
- package/node_modules/@alanszp/errors/node_modules/@types/node/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/errors/node_modules/@types/node/dgram.d.ts +0 -596
- package/node_modules/@alanszp/errors/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/errors/node_modules/@types/node/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/errors/node_modules/@types/node/dns.d.ts +0 -809
- package/node_modules/@alanszp/errors/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/errors/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@alanszp/errors/node_modules/@types/node/events.d.ts +0 -879
- package/node_modules/@alanszp/errors/node_modules/@types/node/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/errors/node_modules/@types/node/fs.d.ts +0 -4311
- package/node_modules/@alanszp/errors/node_modules/@types/node/globals.d.ts +0 -411
- package/node_modules/@alanszp/errors/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/errors/node_modules/@types/node/http.d.ts +0 -1887
- package/node_modules/@alanszp/errors/node_modules/@types/node/http2.d.ts +0 -2382
- package/node_modules/@alanszp/errors/node_modules/@types/node/https.d.ts +0 -550
- package/node_modules/@alanszp/errors/node_modules/@types/node/index.d.ts +0 -88
- package/node_modules/@alanszp/errors/node_modules/@types/node/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/errors/node_modules/@types/node/module.d.ts +0 -315
- package/node_modules/@alanszp/errors/node_modules/@types/node/net.d.ts +0 -949
- package/node_modules/@alanszp/errors/node_modules/@types/node/os.d.ts +0 -478
- package/node_modules/@alanszp/errors/node_modules/@types/node/package.json +0 -229
- package/node_modules/@alanszp/errors/node_modules/@types/node/path.d.ts +0 -191
- package/node_modules/@alanszp/errors/node_modules/@types/node/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/errors/node_modules/@types/node/process.d.ts +0 -1561
- package/node_modules/@alanszp/errors/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@alanszp/errors/node_modules/@types/node/querystring.d.ts +0 -141
- package/node_modules/@alanszp/errors/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/errors/node_modules/@types/node/readline.d.ts +0 -539
- package/node_modules/@alanszp/errors/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@alanszp/errors/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/errors/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/errors/node_modules/@types/node/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/errors/node_modules/@types/node/stream.d.ts +0 -1701
- package/node_modules/@alanszp/errors/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/errors/node_modules/@types/node/test.d.ts +0 -1465
- package/node_modules/@alanszp/errors/node_modules/@types/node/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/errors/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@alanszp/errors/node_modules/@types/node/tls.d.ts +0 -1210
- package/node_modules/@alanszp/errors/node_modules/@types/node/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/@alanszp/errors/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@alanszp/errors/node_modules/@types/node/url.d.ts +0 -927
- package/node_modules/@alanszp/errors/node_modules/@types/node/util.d.ts +0 -2183
- package/node_modules/@alanszp/errors/node_modules/@types/node/v8.d.ts +0 -764
- package/node_modules/@alanszp/errors/node_modules/@types/node/vm.d.ts +0 -903
- package/node_modules/@alanszp/errors/node_modules/@types/node/wasi.d.ts +0 -179
- package/node_modules/@alanszp/errors/node_modules/@types/node/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/errors/node_modules/@types/node/zlib.d.ts +0 -517
- package/node_modules/@alanszp/errors/package.json +0 -33
- package/node_modules/@alanszp/errors/src/BaseError.ts +0 -14
- package/node_modules/@alanszp/errors/src/HttpRenderableError.ts +0 -5
- package/node_modules/@alanszp/errors/src/InternalServerError.ts +0 -32
- package/node_modules/@alanszp/errors/src/RenderableError.ts +0 -37
- package/node_modules/@alanszp/errors/src/index.ts +0 -4
- package/node_modules/@alanszp/errors/tsconfig.json +0 -15
- package/node_modules/@alanszp/express/.gitignore +0 -3
- package/node_modules/@alanszp/express/.npmignore +0 -3
- package/node_modules/@alanszp/express/LICENSE +0 -21
- package/node_modules/@alanszp/express/babel.config.js +0 -7
- package/node_modules/@alanszp/express/dist/helpers/getIp.d.ts +0 -2
- package/node_modules/@alanszp/express/dist/helpers/getIp.js +0 -9
- package/node_modules/@alanszp/express/dist/helpers/getIp.js.map +0 -1
- package/node_modules/@alanszp/express/dist/helpers/getRequestLogger.d.ts +0 -2
- package/node_modules/@alanszp/express/dist/helpers/getRequestLogger.js +0 -10
- package/node_modules/@alanszp/express/dist/helpers/getRequestLogger.js.map +0 -1
- package/node_modules/@alanszp/express/dist/helpers/now.d.ts +0 -1
- package/node_modules/@alanszp/express/dist/helpers/now.js +0 -8
- package/node_modules/@alanszp/express/dist/helpers/now.js.map +0 -1
- package/node_modules/@alanszp/express/dist/helpers/renderErrorJson.d.ts +0 -4
- package/node_modules/@alanszp/express/dist/helpers/renderErrorJson.js +0 -32
- package/node_modules/@alanszp/express/dist/helpers/renderErrorJson.js.map +0 -1
- package/node_modules/@alanszp/express/dist/index.d.ts +0 -10
- package/node_modules/@alanszp/express/dist/index.js +0 -23
- package/node_modules/@alanszp/express/dist/index.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/accessLogger.d.ts +0 -3
- package/node_modules/@alanszp/express/dist/middlewares/accessLogger.js +0 -30
- package/node_modules/@alanszp/express/dist/middlewares/accessLogger.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/auditLog.d.ts +0 -8
- package/node_modules/@alanszp/express/dist/middlewares/auditLog.js +0 -44
- package/node_modules/@alanszp/express/dist/middlewares/auditLog.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/authedForOrg.d.ts +0 -3
- package/node_modules/@alanszp/express/dist/middlewares/authedForOrg.js +0 -45
- package/node_modules/@alanszp/express/dist/middlewares/authedForOrg.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.d.ts +0 -25
- package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.js +0 -115
- package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.test.d.ts +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.test.js +0 -308
- package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.test.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/createContext.d.ts +0 -6
- package/node_modules/@alanszp/express/dist/middlewares/createContext.js +0 -35
- package/node_modules/@alanszp/express/dist/middlewares/createContext.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/createContext.test.d.ts +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/createContext.test.js +0 -50
- package/node_modules/@alanszp/express/dist/middlewares/createContext.test.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/hasRoles.d.ts +0 -3
- package/node_modules/@alanszp/express/dist/middlewares/hasRoles.js +0 -21
- package/node_modules/@alanszp/express/dist/middlewares/hasRoles.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/jsonBodyParser.d.ts +0 -4
- package/node_modules/@alanszp/express/dist/middlewares/jsonBodyParser.js +0 -22
- package/node_modules/@alanszp/express/dist/middlewares/jsonBodyParser.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/returnInternalServerError.d.ts +0 -4
- package/node_modules/@alanszp/express/dist/middlewares/returnInternalServerError.js +0 -10
- package/node_modules/@alanszp/express/dist/middlewares/returnInternalServerError.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/returnNotFound.d.ts +0 -3
- package/node_modules/@alanszp/express/dist/middlewares/returnNotFound.js +0 -9
- package/node_modules/@alanszp/express/dist/middlewares/returnNotFound.js.map +0 -1
- package/node_modules/@alanszp/express/dist/test/mocks/authOptionsMocks.d.ts +0 -8
- package/node_modules/@alanszp/express/dist/test/mocks/authOptionsMocks.js +0 -30
- package/node_modules/@alanszp/express/dist/test/mocks/authOptionsMocks.js.map +0 -1
- package/node_modules/@alanszp/express/dist/test/mocks/expressMocks.d.ts +0 -6
- package/node_modules/@alanszp/express/dist/test/mocks/expressMocks.js +0 -26
- package/node_modules/@alanszp/express/dist/test/mocks/expressMocks.js.map +0 -1
- package/node_modules/@alanszp/express/dist/test/mocks/jwtUserMocks.d.ts +0 -3
- package/node_modules/@alanszp/express/dist/test/mocks/jwtUserMocks.js +0 -21
- package/node_modules/@alanszp/express/dist/test/mocks/jwtUserMocks.js.map +0 -1
- package/node_modules/@alanszp/express/dist/test/setup.d.ts +0 -1
- package/node_modules/@alanszp/express/dist/test/setup.js +0 -5
- package/node_modules/@alanszp/express/dist/test/setup.js.map +0 -1
- package/node_modules/@alanszp/express/dist/test/setup.test.d.ts +0 -1
- package/node_modules/@alanszp/express/dist/test/setup.test.js +0 -14
- package/node_modules/@alanszp/express/dist/test/setup.test.js.map +0 -1
- package/node_modules/@alanszp/express/dist/types/AuthMethod.d.ts +0 -10
- package/node_modules/@alanszp/express/dist/types/AuthMethod.js +0 -3
- package/node_modules/@alanszp/express/dist/types/AuthMethod.js.map +0 -1
- package/node_modules/@alanszp/express/dist/types/GenericRequest.d.ts +0 -2
- package/node_modules/@alanszp/express/dist/types/GenericRequest.js +0 -3
- package/node_modules/@alanszp/express/dist/types/GenericRequest.js.map +0 -1
- package/node_modules/@alanszp/express/jest.config.js +0 -10
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/LICENSE +0 -21
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/README.md +0 -5
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/index.d.ts +0 -93
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/index.js +0 -37
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/jasmineUtils.js +0 -282
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/types.js +0 -1
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/utils.js +0 -457
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/package.json +0 -33
- package/node_modules/@alanszp/express/node_modules/@jest/types/LICENSE +0 -21
- package/node_modules/@alanszp/express/node_modules/@jest/types/README.md +0 -30
- package/node_modules/@alanszp/express/node_modules/@jest/types/build/Circus.js +0 -1
- package/node_modules/@alanszp/express/node_modules/@jest/types/build/Config.js +0 -1
- package/node_modules/@alanszp/express/node_modules/@jest/types/build/Global.js +0 -1
- package/node_modules/@alanszp/express/node_modules/@jest/types/build/TestResult.js +0 -1
- package/node_modules/@alanszp/express/node_modules/@jest/types/build/Transform.js +0 -1
- package/node_modules/@alanszp/express/node_modules/@jest/types/build/index.d.ts +0 -1166
- package/node_modules/@alanszp/express/node_modules/@jest/types/build/index.js +0 -1
- package/node_modules/@alanszp/express/node_modules/@jest/types/package.json +0 -38
- package/node_modules/@alanszp/express/node_modules/@types/jest/LICENSE +0 -21
- package/node_modules/@alanszp/express/node_modules/@types/jest/README.md +0 -17
- package/node_modules/@alanszp/express/node_modules/@types/jest/index.d.ts +0 -1608
- package/node_modules/@alanszp/express/node_modules/@types/jest/package.json +0 -159
- package/node_modules/@alanszp/express/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@alanszp/express/node_modules/@types/node/README.md +0 -15
- package/node_modules/@alanszp/express/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/express/node_modules/@types/node/assert.d.ts +0 -996
- package/node_modules/@alanszp/express/node_modules/@types/node/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/express/node_modules/@types/node/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/express/node_modules/@types/node/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/express/node_modules/@types/node/cluster.d.ts +0 -432
- package/node_modules/@alanszp/express/node_modules/@types/node/console.d.ts +0 -415
- package/node_modules/@alanszp/express/node_modules/@types/node/constants.d.ts +0 -19
- package/node_modules/@alanszp/express/node_modules/@types/node/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/express/node_modules/@types/node/dgram.d.ts +0 -596
- package/node_modules/@alanszp/express/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/express/node_modules/@types/node/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/express/node_modules/@types/node/dns.d.ts +0 -809
- package/node_modules/@alanszp/express/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/express/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@alanszp/express/node_modules/@types/node/events.d.ts +0 -879
- package/node_modules/@alanszp/express/node_modules/@types/node/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/express/node_modules/@types/node/fs.d.ts +0 -4311
- package/node_modules/@alanszp/express/node_modules/@types/node/globals.d.ts +0 -411
- package/node_modules/@alanszp/express/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/express/node_modules/@types/node/http.d.ts +0 -1887
- package/node_modules/@alanszp/express/node_modules/@types/node/http2.d.ts +0 -2382
- package/node_modules/@alanszp/express/node_modules/@types/node/https.d.ts +0 -550
- package/node_modules/@alanszp/express/node_modules/@types/node/index.d.ts +0 -88
- package/node_modules/@alanszp/express/node_modules/@types/node/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/express/node_modules/@types/node/module.d.ts +0 -315
- package/node_modules/@alanszp/express/node_modules/@types/node/net.d.ts +0 -949
- package/node_modules/@alanszp/express/node_modules/@types/node/os.d.ts +0 -478
- package/node_modules/@alanszp/express/node_modules/@types/node/package.json +0 -229
- package/node_modules/@alanszp/express/node_modules/@types/node/path.d.ts +0 -191
- package/node_modules/@alanszp/express/node_modules/@types/node/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/express/node_modules/@types/node/process.d.ts +0 -1561
- package/node_modules/@alanszp/express/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@alanszp/express/node_modules/@types/node/querystring.d.ts +0 -141
- package/node_modules/@alanszp/express/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/express/node_modules/@types/node/readline.d.ts +0 -539
- package/node_modules/@alanszp/express/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@alanszp/express/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/express/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/express/node_modules/@types/node/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/express/node_modules/@types/node/stream.d.ts +0 -1701
- package/node_modules/@alanszp/express/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/express/node_modules/@types/node/test.d.ts +0 -1465
- package/node_modules/@alanszp/express/node_modules/@types/node/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/express/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@alanszp/express/node_modules/@types/node/tls.d.ts +0 -1210
- package/node_modules/@alanszp/express/node_modules/@types/node/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/@alanszp/express/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@alanszp/express/node_modules/@types/node/url.d.ts +0 -927
- package/node_modules/@alanszp/express/node_modules/@types/node/util.d.ts +0 -2183
- package/node_modules/@alanszp/express/node_modules/@types/node/v8.d.ts +0 -764
- package/node_modules/@alanszp/express/node_modules/@types/node/vm.d.ts +0 -903
- package/node_modules/@alanszp/express/node_modules/@types/node/wasi.d.ts +0 -179
- package/node_modules/@alanszp/express/node_modules/@types/node/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/express/node_modules/@types/node/zlib.d.ts +0 -517
- package/node_modules/@alanszp/express/package.json +0 -49
- package/node_modules/@alanszp/express/src/helpers/getIp.ts +0 -5
- package/node_modules/@alanszp/express/src/helpers/getRequestLogger.ts +0 -6
- package/node_modules/@alanszp/express/src/helpers/now.ts +0 -3
- package/node_modules/@alanszp/express/src/helpers/renderErrorJson.ts +0 -29
- package/node_modules/@alanszp/express/src/index.ts +0 -10
- package/node_modules/@alanszp/express/src/middlewares/accessLogger.ts +0 -34
- package/node_modules/@alanszp/express/src/middlewares/auditLog.ts +0 -52
- package/node_modules/@alanszp/express/src/middlewares/authedForOrg.ts +0 -50
- package/node_modules/@alanszp/express/src/middlewares/authenticateUser.test.ts +0 -403
- package/node_modules/@alanszp/express/src/middlewares/authenticateUser.ts +0 -171
- package/node_modules/@alanszp/express/src/middlewares/createContext.test.ts +0 -85
- package/node_modules/@alanszp/express/src/middlewares/createContext.ts +0 -49
- package/node_modules/@alanszp/express/src/middlewares/hasRoles.ts +0 -24
- package/node_modules/@alanszp/express/src/middlewares/jsonBodyParser.ts +0 -22
- package/node_modules/@alanszp/express/src/middlewares/returnInternalServerError.ts +0 -15
- package/node_modules/@alanszp/express/src/middlewares/returnNotFound.ts +0 -11
- package/node_modules/@alanszp/express/src/test/mocks/authOptionsMocks.ts +0 -35
- package/node_modules/@alanszp/express/src/test/mocks/expressMocks.ts +0 -33
- package/node_modules/@alanszp/express/src/test/mocks/jwtUserMocks.ts +0 -19
- package/node_modules/@alanszp/express/src/test/setup.test.ts +0 -15
- package/node_modules/@alanszp/express/src/test/setup.ts +0 -3
- package/node_modules/@alanszp/express/src/types/AuthMethod.ts +0 -27
- package/node_modules/@alanszp/express/src/types/GenericRequest.ts +0 -3
- package/node_modules/@alanszp/express/src/types/custom.d.ts +0 -20
- package/node_modules/@alanszp/express/tsconfig.json +0 -18
- package/node_modules/@alanszp/jwt/.gitignore +0 -3
- package/node_modules/@alanszp/jwt/.npmignore +0 -3
- package/node_modules/@alanszp/jwt/LICENSE +0 -21
- package/node_modules/@alanszp/jwt/dist/JWTUser.d.ts +0 -31
- package/node_modules/@alanszp/jwt/dist/JWTUser.js +0 -62
- package/node_modules/@alanszp/jwt/dist/JWTUser.js.map +0 -1
- package/node_modules/@alanszp/jwt/dist/index.d.ts +0 -3
- package/node_modules/@alanszp/jwt/dist/index.js +0 -16
- package/node_modules/@alanszp/jwt/dist/index.js.map +0 -1
- package/node_modules/@alanszp/jwt/dist/jwt.d.ts +0 -11
- package/node_modules/@alanszp/jwt/dist/jwt.js +0 -67
- package/node_modules/@alanszp/jwt/dist/jwt.js.map +0 -1
- package/node_modules/@alanszp/jwt/dist/types.d.ts +0 -26
- package/node_modules/@alanszp/jwt/dist/types.js +0 -3
- package/node_modules/@alanszp/jwt/dist/types.js.map +0 -1
- package/node_modules/@alanszp/jwt/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@alanszp/jwt/node_modules/@types/node/README.md +0 -15
- package/node_modules/@alanszp/jwt/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/jwt/node_modules/@types/node/assert.d.ts +0 -996
- package/node_modules/@alanszp/jwt/node_modules/@types/node/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/jwt/node_modules/@types/node/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/jwt/node_modules/@types/node/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/jwt/node_modules/@types/node/cluster.d.ts +0 -432
- package/node_modules/@alanszp/jwt/node_modules/@types/node/console.d.ts +0 -415
- package/node_modules/@alanszp/jwt/node_modules/@types/node/constants.d.ts +0 -19
- package/node_modules/@alanszp/jwt/node_modules/@types/node/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/jwt/node_modules/@types/node/dgram.d.ts +0 -596
- package/node_modules/@alanszp/jwt/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/jwt/node_modules/@types/node/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/jwt/node_modules/@types/node/dns.d.ts +0 -809
- package/node_modules/@alanszp/jwt/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/jwt/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@alanszp/jwt/node_modules/@types/node/events.d.ts +0 -879
- package/node_modules/@alanszp/jwt/node_modules/@types/node/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/jwt/node_modules/@types/node/fs.d.ts +0 -4311
- package/node_modules/@alanszp/jwt/node_modules/@types/node/globals.d.ts +0 -411
- package/node_modules/@alanszp/jwt/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/jwt/node_modules/@types/node/http.d.ts +0 -1887
- package/node_modules/@alanszp/jwt/node_modules/@types/node/http2.d.ts +0 -2382
- package/node_modules/@alanszp/jwt/node_modules/@types/node/https.d.ts +0 -550
- package/node_modules/@alanszp/jwt/node_modules/@types/node/index.d.ts +0 -88
- package/node_modules/@alanszp/jwt/node_modules/@types/node/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/jwt/node_modules/@types/node/module.d.ts +0 -315
- package/node_modules/@alanszp/jwt/node_modules/@types/node/net.d.ts +0 -949
- package/node_modules/@alanszp/jwt/node_modules/@types/node/os.d.ts +0 -478
- package/node_modules/@alanszp/jwt/node_modules/@types/node/package.json +0 -229
- package/node_modules/@alanszp/jwt/node_modules/@types/node/path.d.ts +0 -191
- package/node_modules/@alanszp/jwt/node_modules/@types/node/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/jwt/node_modules/@types/node/process.d.ts +0 -1561
- package/node_modules/@alanszp/jwt/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@alanszp/jwt/node_modules/@types/node/querystring.d.ts +0 -141
- package/node_modules/@alanszp/jwt/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/jwt/node_modules/@types/node/readline.d.ts +0 -539
- package/node_modules/@alanszp/jwt/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@alanszp/jwt/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/jwt/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/jwt/node_modules/@types/node/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/jwt/node_modules/@types/node/stream.d.ts +0 -1701
- package/node_modules/@alanszp/jwt/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/jwt/node_modules/@types/node/test.d.ts +0 -1465
- package/node_modules/@alanszp/jwt/node_modules/@types/node/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/jwt/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@alanszp/jwt/node_modules/@types/node/tls.d.ts +0 -1210
- package/node_modules/@alanszp/jwt/node_modules/@types/node/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/@alanszp/jwt/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@alanszp/jwt/node_modules/@types/node/url.d.ts +0 -927
- package/node_modules/@alanszp/jwt/node_modules/@types/node/util.d.ts +0 -2183
- package/node_modules/@alanszp/jwt/node_modules/@types/node/v8.d.ts +0 -764
- package/node_modules/@alanszp/jwt/node_modules/@types/node/vm.d.ts +0 -903
- package/node_modules/@alanszp/jwt/node_modules/@types/node/wasi.d.ts +0 -179
- package/node_modules/@alanszp/jwt/node_modules/@types/node/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/jwt/node_modules/@types/node/zlib.d.ts +0 -517
- package/node_modules/@alanszp/jwt/package.json +0 -29
- package/node_modules/@alanszp/jwt/src/JWTUser.ts +0 -85
- package/node_modules/@alanszp/jwt/src/index.ts +0 -3
- package/node_modules/@alanszp/jwt/src/jwt.ts +0 -81
- package/node_modules/@alanszp/jwt/src/types.ts +0 -31
- package/node_modules/@alanszp/jwt/tsconfig.json +0 -15
- package/node_modules/@alanszp/logger/.gitignore +0 -3
- package/node_modules/@alanszp/logger/.npmignore +0 -3
- package/node_modules/@alanszp/logger/LICENSE +0 -21
- package/node_modules/@alanszp/logger/dist/config.d.ts +0 -28
- package/node_modules/@alanszp/logger/dist/config.js +0 -3
- package/node_modules/@alanszp/logger/dist/config.js.map +0 -1
- package/node_modules/@alanszp/logger/dist/factory.d.ts +0 -5
- package/node_modules/@alanszp/logger/dist/factory.js +0 -55
- package/node_modules/@alanszp/logger/dist/factory.js.map +0 -1
- package/node_modules/@alanszp/logger/dist/index.d.ts +0 -5
- package/node_modules/@alanszp/logger/dist/index.js +0 -20
- package/node_modules/@alanszp/logger/dist/index.js.map +0 -1
- package/node_modules/@alanszp/logger/dist/interfaces.d.ts +0 -23
- package/node_modules/@alanszp/logger/dist/interfaces.js +0 -18
- package/node_modules/@alanszp/logger/dist/interfaces.js.map +0 -1
- package/node_modules/@alanszp/logger/dist/logger.d.ts +0 -14
- package/node_modules/@alanszp/logger/dist/logger.js +0 -45
- package/node_modules/@alanszp/logger/dist/logger.js.map +0 -1
- package/node_modules/@alanszp/logger/dist/mock.d.ts +0 -11
- package/node_modules/@alanszp/logger/dist/mock.js +0 -32
- package/node_modules/@alanszp/logger/dist/mock.js.map +0 -1
- package/node_modules/@alanszp/logger/dist/serializer.d.ts +0 -5
- package/node_modules/@alanszp/logger/dist/serializer.js +0 -67
- package/node_modules/@alanszp/logger/dist/serializer.js.map +0 -1
- package/node_modules/@alanszp/logger/dist/slackBunyan.d.ts +0 -16
- package/node_modules/@alanszp/logger/dist/slackBunyan.js +0 -108
- package/node_modules/@alanszp/logger/dist/slackBunyan.js.map +0 -1
- package/node_modules/@alanszp/logger/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@alanszp/logger/node_modules/@types/node/README.md +0 -15
- package/node_modules/@alanszp/logger/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/logger/node_modules/@types/node/assert.d.ts +0 -996
- package/node_modules/@alanszp/logger/node_modules/@types/node/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/logger/node_modules/@types/node/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/logger/node_modules/@types/node/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/logger/node_modules/@types/node/cluster.d.ts +0 -432
- package/node_modules/@alanszp/logger/node_modules/@types/node/console.d.ts +0 -415
- package/node_modules/@alanszp/logger/node_modules/@types/node/constants.d.ts +0 -19
- package/node_modules/@alanszp/logger/node_modules/@types/node/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/logger/node_modules/@types/node/dgram.d.ts +0 -596
- package/node_modules/@alanszp/logger/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/logger/node_modules/@types/node/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/logger/node_modules/@types/node/dns.d.ts +0 -809
- package/node_modules/@alanszp/logger/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/logger/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@alanszp/logger/node_modules/@types/node/events.d.ts +0 -879
- package/node_modules/@alanszp/logger/node_modules/@types/node/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/logger/node_modules/@types/node/fs.d.ts +0 -4311
- package/node_modules/@alanszp/logger/node_modules/@types/node/globals.d.ts +0 -411
- package/node_modules/@alanszp/logger/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/logger/node_modules/@types/node/http.d.ts +0 -1887
- package/node_modules/@alanszp/logger/node_modules/@types/node/http2.d.ts +0 -2382
- package/node_modules/@alanszp/logger/node_modules/@types/node/https.d.ts +0 -550
- package/node_modules/@alanszp/logger/node_modules/@types/node/index.d.ts +0 -88
- package/node_modules/@alanszp/logger/node_modules/@types/node/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/logger/node_modules/@types/node/module.d.ts +0 -315
- package/node_modules/@alanszp/logger/node_modules/@types/node/net.d.ts +0 -949
- package/node_modules/@alanszp/logger/node_modules/@types/node/os.d.ts +0 -478
- package/node_modules/@alanszp/logger/node_modules/@types/node/package.json +0 -229
- package/node_modules/@alanszp/logger/node_modules/@types/node/path.d.ts +0 -191
- package/node_modules/@alanszp/logger/node_modules/@types/node/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/logger/node_modules/@types/node/process.d.ts +0 -1561
- package/node_modules/@alanszp/logger/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@alanszp/logger/node_modules/@types/node/querystring.d.ts +0 -141
- package/node_modules/@alanszp/logger/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/logger/node_modules/@types/node/readline.d.ts +0 -539
- package/node_modules/@alanszp/logger/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@alanszp/logger/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/logger/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/logger/node_modules/@types/node/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/logger/node_modules/@types/node/stream.d.ts +0 -1701
- package/node_modules/@alanszp/logger/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/logger/node_modules/@types/node/test.d.ts +0 -1465
- package/node_modules/@alanszp/logger/node_modules/@types/node/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/logger/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@alanszp/logger/node_modules/@types/node/tls.d.ts +0 -1210
- package/node_modules/@alanszp/logger/node_modules/@types/node/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/@alanszp/logger/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@alanszp/logger/node_modules/@types/node/url.d.ts +0 -927
- package/node_modules/@alanszp/logger/node_modules/@types/node/util.d.ts +0 -2183
- package/node_modules/@alanszp/logger/node_modules/@types/node/v8.d.ts +0 -764
- package/node_modules/@alanszp/logger/node_modules/@types/node/vm.d.ts +0 -903
- package/node_modules/@alanszp/logger/node_modules/@types/node/wasi.d.ts +0 -179
- package/node_modules/@alanszp/logger/node_modules/@types/node/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/logger/node_modules/@types/node/zlib.d.ts +0 -517
- package/node_modules/@alanszp/logger/package.json +0 -35
- package/node_modules/@alanszp/logger/src/config.ts +0 -34
- package/node_modules/@alanszp/logger/src/factory.ts +0 -68
- package/node_modules/@alanszp/logger/src/index.ts +0 -5
- package/node_modules/@alanszp/logger/src/interfaces.ts +0 -26
- package/node_modules/@alanszp/logger/src/logger.ts +0 -54
- package/node_modules/@alanszp/logger/src/mock.ts +0 -35
- package/node_modules/@alanszp/logger/src/serializer.ts +0 -65
- package/node_modules/@alanszp/logger/src/slackBunyan.ts +0 -133
- package/node_modules/@alanszp/logger/tsconfig.json +0 -15
- package/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@types/node/README.md +0 -15
- package/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@types/node/assert.d.ts +0 -996
- package/node_modules/@types/node/async_hooks.d.ts +0 -539
- package/node_modules/@types/node/buffer.d.ts +0 -2362
- package/node_modules/@types/node/child_process.d.ts +0 -1540
- package/node_modules/@types/node/cluster.d.ts +0 -432
- package/node_modules/@types/node/console.d.ts +0 -415
- package/node_modules/@types/node/constants.d.ts +0 -19
- package/node_modules/@types/node/crypto.d.ts +0 -4487
- package/node_modules/@types/node/dgram.d.ts +0 -596
- package/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
- package/node_modules/@types/node/dns/promises.d.ts +0 -425
- package/node_modules/@types/node/dns.d.ts +0 -809
- package/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@types/node/events.d.ts +0 -879
- package/node_modules/@types/node/fs/promises.d.ts +0 -1239
- package/node_modules/@types/node/fs.d.ts +0 -4311
- package/node_modules/@types/node/globals.d.ts +0 -411
- package/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@types/node/http.d.ts +0 -1887
- package/node_modules/@types/node/http2.d.ts +0 -2382
- package/node_modules/@types/node/https.d.ts +0 -550
- package/node_modules/@types/node/index.d.ts +0 -88
- package/node_modules/@types/node/inspector.d.ts +0 -2747
- package/node_modules/@types/node/module.d.ts +0 -315
- package/node_modules/@types/node/net.d.ts +0 -949
- package/node_modules/@types/node/os.d.ts +0 -478
- package/node_modules/@types/node/package.json +0 -229
- package/node_modules/@types/node/path.d.ts +0 -191
- package/node_modules/@types/node/perf_hooks.d.ts +0 -645
- package/node_modules/@types/node/process.d.ts +0 -1561
- package/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@types/node/querystring.d.ts +0 -141
- package/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/node_modules/@types/node/readline.d.ts +0 -539
- package/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/node_modules/@types/node/stream/web.d.ts +0 -366
- package/node_modules/@types/node/stream.d.ts +0 -1701
- package/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@types/node/test.d.ts +0 -1465
- package/node_modules/@types/node/timers/promises.d.ts +0 -93
- package/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@types/node/tls.d.ts +0 -1210
- package/node_modules/@types/node/trace_events.d.ts +0 -182
- package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@types/node/url.d.ts +0 -927
- package/node_modules/@types/node/util.d.ts +0 -2183
- package/node_modules/@types/node/v8.d.ts +0 -764
- package/node_modules/@types/node/vm.d.ts +0 -903
- package/node_modules/@types/node/wasi.d.ts +0 -179
- package/node_modules/@types/node/worker_threads.d.ts +0 -691
- package/node_modules/@types/node/zlib.d.ts +0 -517
- package/src/commonErrorsHandler.ts +0 -105
- package/src/index.ts +0 -1
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { createContext } from "./createContext";
|
|
2
|
-
import { SharedContext } from "@alanszp/shared-context";
|
|
3
|
-
import { createMockLogger } from "@alanszp/logger";
|
|
4
|
-
import { createAuditLogger } from "@alanszp/audit";
|
|
5
|
-
import {
|
|
6
|
-
mockNext,
|
|
7
|
-
mockRequest,
|
|
8
|
-
mockRequestWithBody,
|
|
9
|
-
mockResponse,
|
|
10
|
-
} from "../test/mocks/expressMocks";
|
|
11
|
-
import { appIdentifier } from "@alanszp/core";
|
|
12
|
-
jest.mock("@alanszp/shared-context");
|
|
13
|
-
|
|
14
|
-
const logger = createMockLogger({});
|
|
15
|
-
const sharedContext = new SharedContext();
|
|
16
|
-
const lifecycleId = "123";
|
|
17
|
-
const lifecycleChain = "node:test";
|
|
18
|
-
|
|
19
|
-
describe("CreateContext", () => {
|
|
20
|
-
describe("when has lifecycle headers", () => {
|
|
21
|
-
beforeAll(() => {
|
|
22
|
-
(SharedContext as jest.Mock).mockClear();
|
|
23
|
-
});
|
|
24
|
-
it("should get lifecycle identifiers from there", () => {
|
|
25
|
-
const middleware = createContext(
|
|
26
|
-
sharedContext,
|
|
27
|
-
logger,
|
|
28
|
-
createAuditLogger(logger)
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
middleware(
|
|
32
|
-
mockRequest("authToken", {
|
|
33
|
-
"x-lifecycle-chain": lifecycleChain,
|
|
34
|
-
"x-lifecycle-id": lifecycleId,
|
|
35
|
-
}),
|
|
36
|
-
mockResponse(),
|
|
37
|
-
mockNext()
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
expect(sharedContext.run).toHaveBeenCalledWith(
|
|
41
|
-
expect.anything(),
|
|
42
|
-
expect.objectContaining({
|
|
43
|
-
lifecycleId,
|
|
44
|
-
lifecycleChain: `${lifecycleChain},${appIdentifier()}`,
|
|
45
|
-
})
|
|
46
|
-
);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
describe("when doesn't have lifecycle headers", () => {
|
|
51
|
-
beforeAll(() => {
|
|
52
|
-
(SharedContext as jest.Mock).mockClear();
|
|
53
|
-
});
|
|
54
|
-
it("should get lifecycle identifiers from body.detail", () => {
|
|
55
|
-
const middleware = createContext(
|
|
56
|
-
sharedContext,
|
|
57
|
-
logger,
|
|
58
|
-
createAuditLogger(logger)
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
middleware(
|
|
62
|
-
mockRequestWithBody(
|
|
63
|
-
"authToken",
|
|
64
|
-
{},
|
|
65
|
-
{
|
|
66
|
-
detail: {
|
|
67
|
-
lch: lifecycleChain,
|
|
68
|
-
lid: lifecycleId,
|
|
69
|
-
},
|
|
70
|
-
}
|
|
71
|
-
),
|
|
72
|
-
mockResponse(),
|
|
73
|
-
mockNext()
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
expect(sharedContext.run).toHaveBeenCalledWith(
|
|
77
|
-
expect.anything(),
|
|
78
|
-
expect.objectContaining({
|
|
79
|
-
lifecycleId,
|
|
80
|
-
lifecycleChain: `${lifecycleChain},${appIdentifier()}`,
|
|
81
|
-
})
|
|
82
|
-
);
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { createId } from "@paralleldrive/cuid2";
|
|
2
|
-
import { NextFunction, Response } from "express";
|
|
3
|
-
import { ILogger } from "@alanszp/logger";
|
|
4
|
-
import { Audit } from "@alanszp/audit";
|
|
5
|
-
import { appIdentifier } from "@alanszp/core";
|
|
6
|
-
import { GenericRequest } from "../types/GenericRequest";
|
|
7
|
-
import { SharedContext } from "@alanszp/shared-context";
|
|
8
|
-
import { compact } from "lodash";
|
|
9
|
-
|
|
10
|
-
export function createContext(
|
|
11
|
-
sharedContext: SharedContext,
|
|
12
|
-
baseLogger: ILogger,
|
|
13
|
-
audit: Audit
|
|
14
|
-
) {
|
|
15
|
-
return (req: GenericRequest, res: Response, next: NextFunction): void => {
|
|
16
|
-
req.context = req.context || {};
|
|
17
|
-
|
|
18
|
-
const receivedChain =
|
|
19
|
-
req.header("x-lifecycle-chain") || req.body?.detail?.lch;
|
|
20
|
-
const lifecycleChain = compact([receivedChain, appIdentifier()]).join(",");
|
|
21
|
-
|
|
22
|
-
const lifecycleId =
|
|
23
|
-
req.header("x-lifecycle-id") || req.body?.detail?.lid || createId();
|
|
24
|
-
|
|
25
|
-
const contextId = createId();
|
|
26
|
-
|
|
27
|
-
res.setHeader("x-lifecycle-id", lifecycleId);
|
|
28
|
-
res.setHeader("x-context-id", contextId);
|
|
29
|
-
|
|
30
|
-
sharedContext.run(
|
|
31
|
-
(context) => {
|
|
32
|
-
req.context.authenticated = [];
|
|
33
|
-
req.context.lifecycleId = context.lifecycleId;
|
|
34
|
-
req.context.lifecycleChain = context.lifecycleChain;
|
|
35
|
-
req.context.contextId = context.contextId;
|
|
36
|
-
req.context.log = context.logger;
|
|
37
|
-
req.context.audit = context.audit;
|
|
38
|
-
next();
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
logger: baseLogger,
|
|
42
|
-
audit: audit.withState(),
|
|
43
|
-
lifecycleId,
|
|
44
|
-
lifecycleChain,
|
|
45
|
-
contextId,
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { NextFunction, Response } from "express";
|
|
2
|
-
import { GenericRequest } from "../types/GenericRequest";
|
|
3
|
-
import { render401Error } from "../helpers/renderErrorJson";
|
|
4
|
-
|
|
5
|
-
function response401(res: Response): void {
|
|
6
|
-
res.status(401).json(render401Error(["permissions"]));
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function hasRoles(
|
|
10
|
-
roles: string | string[]
|
|
11
|
-
): (req: GenericRequest, res: Response, next: NextFunction) => void {
|
|
12
|
-
return (req: GenericRequest, res: Response, next: NextFunction) => {
|
|
13
|
-
const { jwtUser } = req.context;
|
|
14
|
-
if (!jwtUser) {
|
|
15
|
-
return response401(res);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (jwtUser.hasRoles(roles)) {
|
|
19
|
-
return next();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
response401(res);
|
|
23
|
-
};
|
|
24
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { json, OptionsJson } from "body-parser";
|
|
2
|
-
import { NextFunction, Response } from "express";
|
|
3
|
-
import { GenericRequest } from "../types/GenericRequest";
|
|
4
|
-
import { render400Error } from "../helpers/renderErrorJson";
|
|
5
|
-
|
|
6
|
-
export function jsonBodyParser(options?: OptionsJson) {
|
|
7
|
-
const bodyParser = json({ limit: "1mb", ...options });
|
|
8
|
-
return function jsonBodyParserMiddleware(
|
|
9
|
-
req: GenericRequest,
|
|
10
|
-
res: Response,
|
|
11
|
-
next: NextFunction
|
|
12
|
-
): void {
|
|
13
|
-
try {
|
|
14
|
-
bodyParser(req, res, (error?: unknown) => {
|
|
15
|
-
if (!error) return next();
|
|
16
|
-
res.status(400).json(render400Error("Malformed JSON"));
|
|
17
|
-
});
|
|
18
|
-
} catch (error: unknown) {
|
|
19
|
-
res.status(400).json(render400Error("Malformed JSON"));
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ErrorRequestHandler, NextFunction, Response } from "express";
|
|
2
|
-
import { InternalServerError } from "@alanszp/errors";
|
|
3
|
-
import { GenericRequest } from "../types/GenericRequest";
|
|
4
|
-
import { ILogger } from "@alanszp/logger";
|
|
5
|
-
|
|
6
|
-
export type GetInternalServerErrorMiddleware = (
|
|
7
|
-
getLogger: () => ILogger
|
|
8
|
-
) => ErrorRequestHandler;
|
|
9
|
-
|
|
10
|
-
export const returnInternalServerError: GetInternalServerErrorMiddleware =
|
|
11
|
-
(getLogger: () => ILogger) =>
|
|
12
|
-
(error: unknown, req: GenericRequest, res: Response, _next: NextFunction) => {
|
|
13
|
-
res.status(500).json(new InternalServerError(error).toView());
|
|
14
|
-
getLogger().error("error_to_client", { error });
|
|
15
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { NextFunction, Response } from "express";
|
|
2
|
-
import { GenericRequest } from "../types/GenericRequest";
|
|
3
|
-
import { render404Error } from "../helpers/renderErrorJson";
|
|
4
|
-
|
|
5
|
-
export function returnNotFound(
|
|
6
|
-
_req: GenericRequest,
|
|
7
|
-
res: Response,
|
|
8
|
-
_next: NextFunction
|
|
9
|
-
): void {
|
|
10
|
-
res.status(404).json(render404Error());
|
|
11
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ApiKeyOptions,
|
|
3
|
-
AuthMethods,
|
|
4
|
-
BothMethodsOptions,
|
|
5
|
-
JWTOptions,
|
|
6
|
-
} from "../../middlewares/authenticateUser";
|
|
7
|
-
|
|
8
|
-
export const jwtAuthOptions = {
|
|
9
|
-
jwtVerifyOptions: {
|
|
10
|
-
publicKey: "publicKey",
|
|
11
|
-
issuer: "issuer",
|
|
12
|
-
audience: "audience",
|
|
13
|
-
},
|
|
14
|
-
types: [AuthMethods.JWT],
|
|
15
|
-
} as any as JWTOptions;
|
|
16
|
-
|
|
17
|
-
export const verifyOptions = {
|
|
18
|
-
issuer: "issuer",
|
|
19
|
-
audience: "audience",
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const apiKeyAuthOptions: ApiKeyOptions = {
|
|
23
|
-
validApiKeys: ["token", "tooooken"],
|
|
24
|
-
types: [AuthMethods.API_KEY],
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const bothMethodsAuthOptions: BothMethodsOptions = {
|
|
28
|
-
jwtVerifyOptions: {
|
|
29
|
-
publicKey: "publicKey",
|
|
30
|
-
issuer: "issuer",
|
|
31
|
-
audience: "audience",
|
|
32
|
-
},
|
|
33
|
-
validApiKeys: ["token", "tooooken"],
|
|
34
|
-
types: [AuthMethods.API_KEY, AuthMethods.JWT],
|
|
35
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { GenericRequest } from "../../types/GenericRequest";
|
|
2
|
-
|
|
3
|
-
export const mockRequest = (
|
|
4
|
-
authorization: string,
|
|
5
|
-
otherHeaders?: Record<string, unknown>
|
|
6
|
-
): GenericRequest => {
|
|
7
|
-
const headers = { authorization, ...otherHeaders };
|
|
8
|
-
return {
|
|
9
|
-
headers,
|
|
10
|
-
context: { jwtUser: undefined, authenticated: [] },
|
|
11
|
-
header: (name: string) => headers[name],
|
|
12
|
-
} as any as GenericRequest;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const mockRequestWithBody = (
|
|
16
|
-
authorization: string,
|
|
17
|
-
otherHeaders?: Record<string, unknown>,
|
|
18
|
-
body: Record<string, unknown> = {}
|
|
19
|
-
): GenericRequest => {
|
|
20
|
-
return {
|
|
21
|
-
...mockRequest(authorization, otherHeaders),
|
|
22
|
-
body,
|
|
23
|
-
} as any as GenericRequest;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const mockResponse = () => {
|
|
27
|
-
const res = {} as any;
|
|
28
|
-
res.status = jest.fn().mockReturnValue(res);
|
|
29
|
-
res.json = jest.fn().mockReturnValue(res);
|
|
30
|
-
return res;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const mockNext = () => jest.fn();
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { JWTUser } from "@alanszp/jwt";
|
|
2
|
-
|
|
3
|
-
export const userJwtUserMock: JWTUser = new JWTUser({
|
|
4
|
-
id: "1",
|
|
5
|
-
employeeReference: "1",
|
|
6
|
-
organizationReference: "test",
|
|
7
|
-
roles: [],
|
|
8
|
-
permissions: "MA==",
|
|
9
|
-
segmentReference: null,
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export const laraJwtUserMock: JWTUser = new JWTUser({
|
|
13
|
-
id: "0",
|
|
14
|
-
employeeReference: "0",
|
|
15
|
-
organizationReference: "lara",
|
|
16
|
-
roles: [],
|
|
17
|
-
permissions: "MA==",
|
|
18
|
-
segmentReference: null,
|
|
19
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { now } from "../helpers/now";
|
|
2
|
-
|
|
3
|
-
jest.mock("@/helpers/now");
|
|
4
|
-
|
|
5
|
-
describe("Timezones", () => {
|
|
6
|
-
it("should always be UTC", () => {
|
|
7
|
-
expect(new Date().getTimezoneOffset()).toBe(0);
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it("now() is mocked", () => {
|
|
11
|
-
(now as jest.Mock).mockReturnValue(new Date("2021-01-01T12:30:43"));
|
|
12
|
-
|
|
13
|
-
expect(now()).toEqual(new Date("2021-01-01T12:30:43"));
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
|
-
export type DistributiveOmit<T, K extends keyof any> = T extends any
|
|
3
|
-
? Omit<T, K>
|
|
4
|
-
: never;
|
|
5
|
-
|
|
6
|
-
export type Overwrite<T, U> = DistributiveOmit<T, keyof U> & U;
|
|
7
|
-
|
|
8
|
-
type GenerateStringUnion<T> = Extract<
|
|
9
|
-
{
|
|
10
|
-
[Key in keyof T]: true extends T[Key] ? Key : never;
|
|
11
|
-
}[keyof T],
|
|
12
|
-
string
|
|
13
|
-
>;
|
|
14
|
-
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
-
type OverridableStringUnion<
|
|
17
|
-
T extends string | number,
|
|
18
|
-
U = {}
|
|
19
|
-
> = GenerateStringUnion<Overwrite<Record<T, true>, U>>;
|
|
20
|
-
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
22
|
-
export interface AuthMethodsOverride {}
|
|
23
|
-
|
|
24
|
-
export type AuthMethod = OverridableStringUnion<
|
|
25
|
-
"jwt" | "api_key",
|
|
26
|
-
AuthMethodsOverride
|
|
27
|
-
>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ILogger } from "@alanszp/logger";
|
|
2
|
-
import { AuditWithState } from "@alanszp/audit";
|
|
3
|
-
import { JWTUser } from "@alanszp/jwt";
|
|
4
|
-
import { AuthMethod } from "./AuthMethod";
|
|
5
|
-
|
|
6
|
-
declare global {
|
|
7
|
-
namespace Express {
|
|
8
|
-
export interface Request {
|
|
9
|
-
context: {
|
|
10
|
-
lifecycleId: string;
|
|
11
|
-
lifecycleChain: string;
|
|
12
|
-
contextId: string;
|
|
13
|
-
authenticated: AuthMethod[];
|
|
14
|
-
log: ILogger;
|
|
15
|
-
audit: AuditWithState;
|
|
16
|
-
jwtUser?: JWTUser;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"rootDir": "src",
|
|
4
|
-
"outDir": "dist",
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"target": "es6",
|
|
7
|
-
"types": ["jest", "node"],
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"sourceMap": true,
|
|
10
|
-
|
|
11
|
-
"alwaysStrict": true,
|
|
12
|
-
"strictNullChecks": true
|
|
13
|
-
},
|
|
14
|
-
"exclude": ["node_modules"],
|
|
15
|
-
"paths": {
|
|
16
|
-
"@/*": ["src/*"]
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Alan Szpigiel
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { IJWTUser, JWTPayload } from "./types";
|
|
2
|
-
export declare class JWTUser implements IJWTUser {
|
|
3
|
-
id: string;
|
|
4
|
-
employeeReference: string | null;
|
|
5
|
-
organizationReference: string;
|
|
6
|
-
originalOrganizationReference: string | null;
|
|
7
|
-
roles: string[];
|
|
8
|
-
permissions: string;
|
|
9
|
-
segmentReference: string | null;
|
|
10
|
-
constructor({ id, employeeReference, organizationReference, roles, permissions, segmentReference, }: IJWTUser);
|
|
11
|
-
static fromPayload(payload: JWTPayload): JWTUser;
|
|
12
|
-
toTokenPayload(): JWTPayload;
|
|
13
|
-
/**
|
|
14
|
-
* Old way of checking for a role
|
|
15
|
-
* Will be replaced by permission checks
|
|
16
|
-
* @param role - role code to check
|
|
17
|
-
*/
|
|
18
|
-
hasRole(role: string): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Old way of checking for roles
|
|
21
|
-
* Will be replaced by permission checks
|
|
22
|
-
*/
|
|
23
|
-
hasRoles(validateRoles: string | string[]): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Check if user has permission to perform an action
|
|
26
|
-
* @note - not implemented, will be implemented in the next release
|
|
27
|
-
* @param permissionCode - permission code to check
|
|
28
|
-
* @returns boolean
|
|
29
|
-
*/
|
|
30
|
-
hasPermission(_permissionCode: string): boolean;
|
|
31
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JWTUser = void 0;
|
|
4
|
-
class JWTUser {
|
|
5
|
-
constructor({ id, employeeReference, organizationReference, roles, permissions, segmentReference, }) {
|
|
6
|
-
this.id = id;
|
|
7
|
-
this.employeeReference = employeeReference;
|
|
8
|
-
this.organizationReference = organizationReference;
|
|
9
|
-
this.roles = roles;
|
|
10
|
-
this.permissions = permissions;
|
|
11
|
-
this.segmentReference = segmentReference;
|
|
12
|
-
}
|
|
13
|
-
static fromPayload(payload) {
|
|
14
|
-
return new JWTUser({
|
|
15
|
-
id: payload.sub,
|
|
16
|
-
employeeReference: payload.ref,
|
|
17
|
-
organizationReference: payload.org,
|
|
18
|
-
roles: payload.rls,
|
|
19
|
-
permissions: payload.prms,
|
|
20
|
-
segmentReference: payload.seg || null,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
toTokenPayload() {
|
|
24
|
-
return {
|
|
25
|
-
sub: this.id,
|
|
26
|
-
ref: this.employeeReference,
|
|
27
|
-
org: this.organizationReference,
|
|
28
|
-
rls: this.roles,
|
|
29
|
-
prms: this.permissions,
|
|
30
|
-
seg: this.segmentReference,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Old way of checking for a role
|
|
35
|
-
* Will be replaced by permission checks
|
|
36
|
-
* @param role - role code to check
|
|
37
|
-
*/
|
|
38
|
-
hasRole(role) {
|
|
39
|
-
return this.roles.includes(role);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Old way of checking for roles
|
|
43
|
-
* Will be replaced by permission checks
|
|
44
|
-
*/
|
|
45
|
-
hasRoles(validateRoles) {
|
|
46
|
-
if (typeof validateRoles === "string") {
|
|
47
|
-
return this.hasRole(validateRoles);
|
|
48
|
-
}
|
|
49
|
-
return validateRoles.some((role) => this.hasRole(role));
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Check if user has permission to perform an action
|
|
53
|
-
* @note - not implemented, will be implemented in the next release
|
|
54
|
-
* @param permissionCode - permission code to check
|
|
55
|
-
* @returns boolean
|
|
56
|
-
*/
|
|
57
|
-
hasPermission(_permissionCode) {
|
|
58
|
-
throw new Error("Not implemented");
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.JWTUser = JWTUser;
|
|
62
|
-
//# sourceMappingURL=JWTUser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JWTUser.js","sourceRoot":"","sources":["../src/JWTUser.ts"],"names":[],"mappings":";;;AAEA,MAAa,OAAO;IAelB,YAAY,EACV,EAAE,EACF,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,EACL,WAAW,EACX,gBAAgB,GACP;QACT,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;QACnD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,OAAmB;QACpC,OAAO,IAAI,OAAO,CAAC;YACjB,EAAE,EAAE,OAAO,CAAC,GAAG;YACf,iBAAiB,EAAE,OAAO,CAAC,GAAG;YAC9B,qBAAqB,EAAE,OAAO,CAAC,GAAG;YAClC,KAAK,EAAE,OAAO,CAAC,GAAG;YAClB,WAAW,EAAE,OAAO,CAAC,IAAI;YACzB,gBAAgB,EAAE,OAAO,CAAC,GAAG,IAAI,IAAI;SACtC,CAAC,CAAC;IACL,CAAC;IAEM,cAAc;QACnB,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,EAAE;YACZ,GAAG,EAAE,IAAI,CAAC,iBAAiB;YAC3B,GAAG,EAAE,IAAI,CAAC,qBAAqB;YAC/B,GAAG,EAAE,IAAI,CAAC,KAAK;YACf,IAAI,EAAE,IAAI,CAAC,WAAW;YACtB,GAAG,EAAE,IAAI,CAAC,gBAAgB;SAC3B,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,OAAO,CAAC,IAAY;QACzB,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACI,QAAQ,CAAC,aAAgC;QAC9C,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;YACrC,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;SACpC;QACD,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAC,eAAuB;QAC1C,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;CACF;AAlFD,0BAkFC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./types"), exports);
|
|
14
|
-
__exportStar(require("./JWTUser"), exports);
|
|
15
|
-
__exportStar(require("./jwt"), exports);
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB;AACxB,4CAA0B;AAC1B,wCAAsB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { KeyObject } from "crypto";
|
|
3
|
-
import type { SignOptions, VerifyOptions } from "./types";
|
|
4
|
-
import { JWTUser } from "./JWTUser";
|
|
5
|
-
export declare const JWT_ALGORITHM = "RS512";
|
|
6
|
-
export declare function privateKeyFromPem(key: string): KeyObject;
|
|
7
|
-
export declare function publicKeyFromPem(key: string): KeyObject;
|
|
8
|
-
export declare function withDefaultSignOptions(options?: Partial<SignOptions>): SignOptions;
|
|
9
|
-
export declare function withDefaultVerifyOptions(options?: Partial<VerifyOptions>): VerifyOptions;
|
|
10
|
-
export declare function generateJWT(privateKey: KeyObject | string, user: JWTUser, options?: Partial<SignOptions>): Promise<string>;
|
|
11
|
-
export declare function verifyJWT(publicKey: KeyObject | string, token: string, options?: Partial<VerifyOptions>): Promise<JWTUser>;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.verifyJWT = exports.generateJWT = exports.withDefaultVerifyOptions = exports.withDefaultSignOptions = exports.publicKeyFromPem = exports.privateKeyFromPem = exports.JWT_ALGORITHM = void 0;
|
|
13
|
-
const crypto_1 = require("crypto");
|
|
14
|
-
const jose_1 = require("jose");
|
|
15
|
-
const JWTUser_1 = require("./JWTUser");
|
|
16
|
-
exports.JWT_ALGORITHM = "RS512";
|
|
17
|
-
function privateKeyFromPem(key) {
|
|
18
|
-
return (0, crypto_1.createPrivateKey)({
|
|
19
|
-
key,
|
|
20
|
-
format: "pem",
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
exports.privateKeyFromPem = privateKeyFromPem;
|
|
24
|
-
function publicKeyFromPem(key) {
|
|
25
|
-
return (0, crypto_1.createPublicKey)({
|
|
26
|
-
key,
|
|
27
|
-
format: "pem",
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
exports.publicKeyFromPem = publicKeyFromPem;
|
|
31
|
-
function withDefaultSignOptions(options) {
|
|
32
|
-
return Object.assign({ issuer: "hodor", audience: "web", expiration: "24h" }, options);
|
|
33
|
-
}
|
|
34
|
-
exports.withDefaultSignOptions = withDefaultSignOptions;
|
|
35
|
-
function withDefaultVerifyOptions(options) {
|
|
36
|
-
return Object.assign({ issuer: ["hodor", "long:1"], audience: "web" }, options);
|
|
37
|
-
}
|
|
38
|
-
exports.withDefaultVerifyOptions = withDefaultVerifyOptions;
|
|
39
|
-
function generateJWT(privateKey, user, options) {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const key = typeof privateKey === "string" ? privateKeyFromPem(privateKey) : privateKey;
|
|
42
|
-
const opts = withDefaultSignOptions(options);
|
|
43
|
-
return new jose_1.SignJWT(user.toTokenPayload())
|
|
44
|
-
.setProtectedHeader({ alg: exports.JWT_ALGORITHM })
|
|
45
|
-
.setIssuedAt()
|
|
46
|
-
.setIssuer(opts.issuer)
|
|
47
|
-
.setAudience(opts.audience)
|
|
48
|
-
.setExpirationTime(opts.expiration)
|
|
49
|
-
.sign(key);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
exports.generateJWT = generateJWT;
|
|
53
|
-
function verifyJWT(publicKey, token, options) {
|
|
54
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
const key = typeof publicKey === "string" ? publicKeyFromPem(publicKey) : publicKey;
|
|
56
|
-
const opts = withDefaultVerifyOptions(options);
|
|
57
|
-
const verify = yield (0, jose_1.jwtVerify)(token, key, {
|
|
58
|
-
issuer: opts.issuer,
|
|
59
|
-
algorithms: [exports.JWT_ALGORITHM],
|
|
60
|
-
audience: opts.audience,
|
|
61
|
-
});
|
|
62
|
-
const payload = verify.payload;
|
|
63
|
-
return JWTUser_1.JWTUser.fromPayload(payload);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
exports.verifyJWT = verifyJWT;
|
|
67
|
-
//# sourceMappingURL=jwt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.js","sourceRoot":"","sources":["../src/jwt.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAsE;AACtE,+BAA0C;AAE1C,uCAAoC;AAEvB,QAAA,aAAa,GAAG,OAAO,CAAC;AAErC,SAAgB,iBAAiB,CAAC,GAAW;IAC3C,OAAO,IAAA,yBAAgB,EAAC;QACtB,GAAG;QACH,MAAM,EAAE,KAAK;KACd,CAAC,CAAC;AACL,CAAC;AALD,8CAKC;AAED,SAAgB,gBAAgB,CAAC,GAAW;IAC1C,OAAO,IAAA,wBAAe,EAAC;QACrB,GAAG;QACH,MAAM,EAAE,KAAK;KACd,CAAC,CAAC;AACL,CAAC;AALD,4CAKC;AAED,SAAgB,sBAAsB,CACpC,OAA8B;IAE9B,uBACE,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,KAAK,EACf,UAAU,EAAE,KAAK,IACd,OAAO,EACV;AACJ,CAAC;AATD,wDASC;AAED,SAAgB,wBAAwB,CACtC,OAAgC;IAEhC,uBACE,MAAM,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,EAC3B,QAAQ,EAAE,KAAK,IACZ,OAAO,EACV;AACJ,CAAC;AARD,4DAQC;AAED,SAAsB,WAAW,CAC/B,UAA8B,EAC9B,IAAa,EACb,OAA8B;;QAE9B,MAAM,GAAG,GACP,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;QAE9E,MAAM,IAAI,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;QAE7C,OAAO,IAAI,cAAO,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;aACtC,kBAAkB,CAAC,EAAE,GAAG,EAAE,qBAAa,EAAE,CAAC;aAC1C,WAAW,EAAE;aACb,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;aACtB,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC;aAC1B,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC;aAClC,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CAAA;AAjBD,kCAiBC;AAED,SAAsB,SAAS,CAC7B,SAA6B,EAC7B,KAAa,EACb,OAAgC;;QAEhC,MAAM,GAAG,GACP,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAE1E,MAAM,IAAI,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE/C,MAAM,MAAM,GAAG,MAAM,IAAA,gBAAS,EAAC,KAAK,EAAE,GAAG,EAAE;YACzC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,UAAU,EAAE,CAAC,qBAAa,CAAC;YAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,MAAM,CAAC,OAAqB,CAAC;QAE7C,OAAO,iBAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CAAA;AAnBD,8BAmBC"}
|