@bobfrankston/mailx 1.0.31 → 1.0.33
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/client/styles/layout.css +12 -7
- package/launcher/builder/postinstall.js +7 -7
- package/package.json +5 -5
- package/packages/mailx-send/mailsend/node_modules/.package-lock.json +0 -49
- package/packages/mailx-send/mailsend/node_modules/@types/node/LICENSE +0 -21
- package/packages/mailx-send/mailsend/node_modules/@types/node/README.md +0 -15
- package/packages/mailx-send/mailsend/node_modules/@types/node/assert/strict.d.ts +0 -111
- package/packages/mailx-send/mailsend/node_modules/@types/node/assert.d.ts +0 -1078
- package/packages/mailx-send/mailsend/node_modules/@types/node/async_hooks.d.ts +0 -603
- package/packages/mailx-send/mailsend/node_modules/@types/node/buffer.buffer.d.ts +0 -472
- package/packages/mailx-send/mailsend/node_modules/@types/node/buffer.d.ts +0 -1934
- package/packages/mailx-send/mailsend/node_modules/@types/node/child_process.d.ts +0 -1476
- package/packages/mailx-send/mailsend/node_modules/@types/node/cluster.d.ts +0 -578
- package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
- package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
- package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
- package/packages/mailx-send/mailsend/node_modules/@types/node/console.d.ts +0 -452
- package/packages/mailx-send/mailsend/node_modules/@types/node/constants.d.ts +0 -21
- package/packages/mailx-send/mailsend/node_modules/@types/node/crypto.d.ts +0 -4545
- package/packages/mailx-send/mailsend/node_modules/@types/node/dgram.d.ts +0 -600
- package/packages/mailx-send/mailsend/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
- package/packages/mailx-send/mailsend/node_modules/@types/node/dns/promises.d.ts +0 -503
- package/packages/mailx-send/mailsend/node_modules/@types/node/dns.d.ts +0 -923
- package/packages/mailx-send/mailsend/node_modules/@types/node/domain.d.ts +0 -170
- package/packages/mailx-send/mailsend/node_modules/@types/node/events.d.ts +0 -976
- package/packages/mailx-send/mailsend/node_modules/@types/node/fs/promises.d.ts +0 -1295
- package/packages/mailx-send/mailsend/node_modules/@types/node/fs.d.ts +0 -4461
- package/packages/mailx-send/mailsend/node_modules/@types/node/globals.d.ts +0 -172
- package/packages/mailx-send/mailsend/node_modules/@types/node/globals.typedarray.d.ts +0 -38
- package/packages/mailx-send/mailsend/node_modules/@types/node/http.d.ts +0 -2089
- package/packages/mailx-send/mailsend/node_modules/@types/node/http2.d.ts +0 -2644
- package/packages/mailx-send/mailsend/node_modules/@types/node/https.d.ts +0 -579
- package/packages/mailx-send/mailsend/node_modules/@types/node/index.d.ts +0 -97
- package/packages/mailx-send/mailsend/node_modules/@types/node/inspector.d.ts +0 -253
- package/packages/mailx-send/mailsend/node_modules/@types/node/inspector.generated.d.ts +0 -4052
- package/packages/mailx-send/mailsend/node_modules/@types/node/module.d.ts +0 -891
- package/packages/mailx-send/mailsend/node_modules/@types/node/net.d.ts +0 -1057
- package/packages/mailx-send/mailsend/node_modules/@types/node/os.d.ts +0 -506
- package/packages/mailx-send/mailsend/node_modules/@types/node/package.json +0 -145
- package/packages/mailx-send/mailsend/node_modules/@types/node/path.d.ts +0 -200
- package/packages/mailx-send/mailsend/node_modules/@types/node/perf_hooks.d.ts +0 -968
- package/packages/mailx-send/mailsend/node_modules/@types/node/process.d.ts +0 -2084
- package/packages/mailx-send/mailsend/node_modules/@types/node/punycode.d.ts +0 -117
- package/packages/mailx-send/mailsend/node_modules/@types/node/querystring.d.ts +0 -152
- package/packages/mailx-send/mailsend/node_modules/@types/node/readline/promises.d.ts +0 -161
- package/packages/mailx-send/mailsend/node_modules/@types/node/readline.d.ts +0 -594
- package/packages/mailx-send/mailsend/node_modules/@types/node/repl.d.ts +0 -428
- package/packages/mailx-send/mailsend/node_modules/@types/node/sea.d.ts +0 -153
- package/packages/mailx-send/mailsend/node_modules/@types/node/sqlite.d.ts +0 -721
- package/packages/mailx-send/mailsend/node_modules/@types/node/stream/consumers.d.ts +0 -38
- package/packages/mailx-send/mailsend/node_modules/@types/node/stream/promises.d.ts +0 -90
- package/packages/mailx-send/mailsend/node_modules/@types/node/stream/web.d.ts +0 -622
- package/packages/mailx-send/mailsend/node_modules/@types/node/stream.d.ts +0 -1664
- package/packages/mailx-send/mailsend/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/packages/mailx-send/mailsend/node_modules/@types/node/test.d.ts +0 -2163
- package/packages/mailx-send/mailsend/node_modules/@types/node/timers/promises.d.ts +0 -108
- package/packages/mailx-send/mailsend/node_modules/@types/node/timers.d.ts +0 -287
- package/packages/mailx-send/mailsend/node_modules/@types/node/tls.d.ts +0 -1319
- package/packages/mailx-send/mailsend/node_modules/@types/node/trace_events.d.ts +0 -197
- package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -468
- package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -34
- package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/index.d.ts +0 -97
- package/packages/mailx-send/mailsend/node_modules/@types/node/tty.d.ts +0 -208
- package/packages/mailx-send/mailsend/node_modules/@types/node/url.d.ts +0 -984
- package/packages/mailx-send/mailsend/node_modules/@types/node/util.d.ts +0 -2606
- package/packages/mailx-send/mailsend/node_modules/@types/node/v8.d.ts +0 -920
- package/packages/mailx-send/mailsend/node_modules/@types/node/vm.d.ts +0 -1000
- package/packages/mailx-send/mailsend/node_modules/@types/node/wasi.d.ts +0 -181
- package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
- package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
- package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/events.d.ts +0 -97
- package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/fetch.d.ts +0 -55
- package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/navigator.d.ts +0 -22
- package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/storage.d.ts +0 -24
- package/packages/mailx-send/mailsend/node_modules/@types/node/worker_threads.d.ts +0 -784
- package/packages/mailx-send/mailsend/node_modules/@types/node/zlib.d.ts +0 -747
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/LICENSE +0 -21
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/README.md +0 -15
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/index.d.ts +0 -82
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/addressparser/index.d.ts +0 -31
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/base64/index.d.ts +0 -22
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/index.d.ts +0 -45
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/message-parser.d.ts +0 -75
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/relaxed-body.d.ts +0 -75
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/sign.d.ts +0 -21
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/fetch/cookies.d.ts +0 -54
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/fetch/index.d.ts +0 -38
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/json-transport/index.d.ts +0 -53
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mail-composer/index.d.ts +0 -25
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mailer/index.d.ts +0 -283
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mailer/mail-message.d.ts +0 -32
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-funcs/index.d.ts +0 -87
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-funcs/mime-types.d.ts +0 -2
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-node/index.d.ts +0 -224
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-node/last-newline.d.ts +0 -9
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/qp/index.d.ts +0 -23
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/index.d.ts +0 -53
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/le-unix.d.ts +0 -7
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/le-windows.d.ts +0 -7
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/ses-transport/index.d.ts +0 -146
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/shared/index.d.ts +0 -58
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/data-stream.d.ts +0 -11
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/http-proxy-client.d.ts +0 -16
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/index.d.ts +0 -270
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-pool/index.d.ts +0 -93
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-pool/pool-resource.d.ts +0 -66
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-transport/index.d.ts +0 -115
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/stream-transport/index.d.ts +0 -59
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/well-known/index.d.ts +0 -6
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/xoauth2/index.d.ts +0 -114
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/package.json +0 -38
- package/packages/mailx-send/mailsend/node_modules/nodemailer/.ncurc.js +0 -9
- package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierignore +0 -8
- package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierrc +0 -12
- package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierrc.js +0 -10
- package/packages/mailx-send/mailsend/node_modules/nodemailer/.release-please-config.json +0 -9
- package/packages/mailx-send/mailsend/node_modules/nodemailer/LICENSE +0 -16
- package/packages/mailx-send/mailsend/node_modules/nodemailer/README.md +0 -86
- package/packages/mailx-send/mailsend/node_modules/nodemailer/SECURITY.txt +0 -22
- package/packages/mailx-send/mailsend/node_modules/nodemailer/eslint.config.js +0 -88
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/addressparser/index.js +0 -383
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/base64/index.js +0 -139
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/index.js +0 -253
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/message-parser.js +0 -155
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/relaxed-body.js +0 -154
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/sign.js +0 -117
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/fetch/cookies.js +0 -281
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/fetch/index.js +0 -280
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/json-transport/index.js +0 -82
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mail-composer/index.js +0 -629
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mailer/index.js +0 -441
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mailer/mail-message.js +0 -316
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-funcs/index.js +0 -625
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-funcs/mime-types.js +0 -2113
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/index.js +0 -1316
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/last-newline.js +0 -33
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/le-unix.js +0 -43
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/le-windows.js +0 -52
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/nodemailer.js +0 -157
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/punycode/index.js +0 -460
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/qp/index.js +0 -227
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/sendmail-transport/index.js +0 -210
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/ses-transport/index.js +0 -234
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/shared/index.js +0 -754
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/data-stream.js +0 -108
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +0 -143
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/index.js +0 -1870
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-pool/index.js +0 -652
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +0 -259
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-transport/index.js +0 -421
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/stream-transport/index.js +0 -135
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/well-known/index.js +0 -47
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/well-known/services.json +0 -611
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/xoauth2/index.js +0 -427
- package/packages/mailx-send/mailsend/node_modules/nodemailer/package.json +0 -47
- package/packages/mailx-send/mailsend/node_modules/undici-types/LICENSE +0 -21
- package/packages/mailx-send/mailsend/node_modules/undici-types/README.md +0 -6
- package/packages/mailx-send/mailsend/node_modules/undici-types/agent.d.ts +0 -31
- package/packages/mailx-send/mailsend/node_modules/undici-types/api.d.ts +0 -43
- package/packages/mailx-send/mailsend/node_modules/undici-types/balanced-pool.d.ts +0 -29
- package/packages/mailx-send/mailsend/node_modules/undici-types/cache.d.ts +0 -36
- package/packages/mailx-send/mailsend/node_modules/undici-types/client.d.ts +0 -108
- package/packages/mailx-send/mailsend/node_modules/undici-types/connector.d.ts +0 -34
- package/packages/mailx-send/mailsend/node_modules/undici-types/content-type.d.ts +0 -21
- package/packages/mailx-send/mailsend/node_modules/undici-types/cookies.d.ts +0 -28
- package/packages/mailx-send/mailsend/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
- package/packages/mailx-send/mailsend/node_modules/undici-types/dispatcher.d.ts +0 -256
- package/packages/mailx-send/mailsend/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
- package/packages/mailx-send/mailsend/node_modules/undici-types/errors.d.ts +0 -149
- package/packages/mailx-send/mailsend/node_modules/undici-types/eventsource.d.ts +0 -61
- package/packages/mailx-send/mailsend/node_modules/undici-types/fetch.d.ts +0 -209
- package/packages/mailx-send/mailsend/node_modules/undici-types/file.d.ts +0 -39
- package/packages/mailx-send/mailsend/node_modules/undici-types/filereader.d.ts +0 -54
- package/packages/mailx-send/mailsend/node_modules/undici-types/formdata.d.ts +0 -108
- package/packages/mailx-send/mailsend/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/packages/mailx-send/mailsend/node_modules/undici-types/global-origin.d.ts +0 -7
- package/packages/mailx-send/mailsend/node_modules/undici-types/handlers.d.ts +0 -15
- package/packages/mailx-send/mailsend/node_modules/undici-types/header.d.ts +0 -4
- package/packages/mailx-send/mailsend/node_modules/undici-types/index.d.ts +0 -71
- package/packages/mailx-send/mailsend/node_modules/undici-types/interceptors.d.ts +0 -17
- package/packages/mailx-send/mailsend/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/packages/mailx-send/mailsend/node_modules/undici-types/mock-client.d.ts +0 -25
- package/packages/mailx-send/mailsend/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/packages/mailx-send/mailsend/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/packages/mailx-send/mailsend/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/packages/mailx-send/mailsend/node_modules/undici-types/package.json +0 -55
- package/packages/mailx-send/mailsend/node_modules/undici-types/patch.d.ts +0 -33
- package/packages/mailx-send/mailsend/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/packages/mailx-send/mailsend/node_modules/undici-types/pool.d.ts +0 -39
- package/packages/mailx-send/mailsend/node_modules/undici-types/proxy-agent.d.ts +0 -28
- package/packages/mailx-send/mailsend/node_modules/undici-types/readable.d.ts +0 -65
- package/packages/mailx-send/mailsend/node_modules/undici-types/retry-agent.d.ts +0 -8
- package/packages/mailx-send/mailsend/node_modules/undici-types/retry-handler.d.ts +0 -116
- package/packages/mailx-send/mailsend/node_modules/undici-types/util.d.ts +0 -18
- package/packages/mailx-send/mailsend/node_modules/undici-types/webidl.d.ts +0 -228
- package/packages/mailx-send/mailsend/node_modules/undici-types/websocket.d.ts +0 -150
- package/packages/mailx-send/node_modules/.package-lock.json +0 -49
- package/packages/mailx-send/node_modules/@types/node/LICENSE +0 -21
- package/packages/mailx-send/node_modules/@types/node/README.md +0 -15
- package/packages/mailx-send/node_modules/@types/node/assert/strict.d.ts +0 -111
- package/packages/mailx-send/node_modules/@types/node/assert.d.ts +0 -1078
- package/packages/mailx-send/node_modules/@types/node/async_hooks.d.ts +0 -603
- package/packages/mailx-send/node_modules/@types/node/buffer.buffer.d.ts +0 -472
- package/packages/mailx-send/node_modules/@types/node/buffer.d.ts +0 -1934
- package/packages/mailx-send/node_modules/@types/node/child_process.d.ts +0 -1476
- package/packages/mailx-send/node_modules/@types/node/cluster.d.ts +0 -578
- package/packages/mailx-send/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
- package/packages/mailx-send/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/packages/mailx-send/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
- package/packages/mailx-send/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
- package/packages/mailx-send/node_modules/@types/node/console.d.ts +0 -452
- package/packages/mailx-send/node_modules/@types/node/constants.d.ts +0 -21
- package/packages/mailx-send/node_modules/@types/node/crypto.d.ts +0 -4545
- package/packages/mailx-send/node_modules/@types/node/dgram.d.ts +0 -600
- package/packages/mailx-send/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
- package/packages/mailx-send/node_modules/@types/node/dns/promises.d.ts +0 -503
- package/packages/mailx-send/node_modules/@types/node/dns.d.ts +0 -923
- package/packages/mailx-send/node_modules/@types/node/domain.d.ts +0 -170
- package/packages/mailx-send/node_modules/@types/node/events.d.ts +0 -976
- package/packages/mailx-send/node_modules/@types/node/fs/promises.d.ts +0 -1295
- package/packages/mailx-send/node_modules/@types/node/fs.d.ts +0 -4461
- package/packages/mailx-send/node_modules/@types/node/globals.d.ts +0 -172
- package/packages/mailx-send/node_modules/@types/node/globals.typedarray.d.ts +0 -38
- package/packages/mailx-send/node_modules/@types/node/http.d.ts +0 -2089
- package/packages/mailx-send/node_modules/@types/node/http2.d.ts +0 -2644
- package/packages/mailx-send/node_modules/@types/node/https.d.ts +0 -579
- package/packages/mailx-send/node_modules/@types/node/index.d.ts +0 -97
- package/packages/mailx-send/node_modules/@types/node/inspector.d.ts +0 -253
- package/packages/mailx-send/node_modules/@types/node/inspector.generated.d.ts +0 -4052
- package/packages/mailx-send/node_modules/@types/node/module.d.ts +0 -891
- package/packages/mailx-send/node_modules/@types/node/net.d.ts +0 -1057
- package/packages/mailx-send/node_modules/@types/node/os.d.ts +0 -506
- package/packages/mailx-send/node_modules/@types/node/package.json +0 -145
- package/packages/mailx-send/node_modules/@types/node/path.d.ts +0 -200
- package/packages/mailx-send/node_modules/@types/node/perf_hooks.d.ts +0 -968
- package/packages/mailx-send/node_modules/@types/node/process.d.ts +0 -2084
- package/packages/mailx-send/node_modules/@types/node/punycode.d.ts +0 -117
- package/packages/mailx-send/node_modules/@types/node/querystring.d.ts +0 -152
- package/packages/mailx-send/node_modules/@types/node/readline/promises.d.ts +0 -161
- package/packages/mailx-send/node_modules/@types/node/readline.d.ts +0 -594
- package/packages/mailx-send/node_modules/@types/node/repl.d.ts +0 -428
- package/packages/mailx-send/node_modules/@types/node/sea.d.ts +0 -153
- package/packages/mailx-send/node_modules/@types/node/sqlite.d.ts +0 -721
- package/packages/mailx-send/node_modules/@types/node/stream/consumers.d.ts +0 -38
- package/packages/mailx-send/node_modules/@types/node/stream/promises.d.ts +0 -90
- package/packages/mailx-send/node_modules/@types/node/stream/web.d.ts +0 -622
- package/packages/mailx-send/node_modules/@types/node/stream.d.ts +0 -1664
- package/packages/mailx-send/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/packages/mailx-send/node_modules/@types/node/test.d.ts +0 -2163
- package/packages/mailx-send/node_modules/@types/node/timers/promises.d.ts +0 -108
- package/packages/mailx-send/node_modules/@types/node/timers.d.ts +0 -287
- package/packages/mailx-send/node_modules/@types/node/tls.d.ts +0 -1319
- package/packages/mailx-send/node_modules/@types/node/trace_events.d.ts +0 -197
- package/packages/mailx-send/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -468
- package/packages/mailx-send/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -34
- package/packages/mailx-send/node_modules/@types/node/ts5.6/index.d.ts +0 -97
- package/packages/mailx-send/node_modules/@types/node/tty.d.ts +0 -208
- package/packages/mailx-send/node_modules/@types/node/url.d.ts +0 -984
- package/packages/mailx-send/node_modules/@types/node/util.d.ts +0 -2606
- package/packages/mailx-send/node_modules/@types/node/v8.d.ts +0 -920
- package/packages/mailx-send/node_modules/@types/node/vm.d.ts +0 -1000
- package/packages/mailx-send/node_modules/@types/node/wasi.d.ts +0 -181
- package/packages/mailx-send/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
- package/packages/mailx-send/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
- package/packages/mailx-send/node_modules/@types/node/web-globals/events.d.ts +0 -97
- package/packages/mailx-send/node_modules/@types/node/web-globals/fetch.d.ts +0 -55
- package/packages/mailx-send/node_modules/@types/node/web-globals/navigator.d.ts +0 -22
- package/packages/mailx-send/node_modules/@types/node/web-globals/storage.d.ts +0 -24
- package/packages/mailx-send/node_modules/@types/node/worker_threads.d.ts +0 -784
- package/packages/mailx-send/node_modules/@types/node/zlib.d.ts +0 -747
- package/packages/mailx-send/node_modules/undici-types/LICENSE +0 -21
- package/packages/mailx-send/node_modules/undici-types/README.md +0 -6
- package/packages/mailx-send/node_modules/undici-types/agent.d.ts +0 -31
- package/packages/mailx-send/node_modules/undici-types/api.d.ts +0 -43
- package/packages/mailx-send/node_modules/undici-types/balanced-pool.d.ts +0 -29
- package/packages/mailx-send/node_modules/undici-types/cache.d.ts +0 -36
- package/packages/mailx-send/node_modules/undici-types/client.d.ts +0 -108
- package/packages/mailx-send/node_modules/undici-types/connector.d.ts +0 -34
- package/packages/mailx-send/node_modules/undici-types/content-type.d.ts +0 -21
- package/packages/mailx-send/node_modules/undici-types/cookies.d.ts +0 -28
- package/packages/mailx-send/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
- package/packages/mailx-send/node_modules/undici-types/dispatcher.d.ts +0 -256
- package/packages/mailx-send/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
- package/packages/mailx-send/node_modules/undici-types/errors.d.ts +0 -149
- package/packages/mailx-send/node_modules/undici-types/eventsource.d.ts +0 -61
- package/packages/mailx-send/node_modules/undici-types/fetch.d.ts +0 -209
- package/packages/mailx-send/node_modules/undici-types/file.d.ts +0 -39
- package/packages/mailx-send/node_modules/undici-types/filereader.d.ts +0 -54
- package/packages/mailx-send/node_modules/undici-types/formdata.d.ts +0 -108
- package/packages/mailx-send/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/packages/mailx-send/node_modules/undici-types/global-origin.d.ts +0 -7
- package/packages/mailx-send/node_modules/undici-types/handlers.d.ts +0 -15
- package/packages/mailx-send/node_modules/undici-types/header.d.ts +0 -4
- package/packages/mailx-send/node_modules/undici-types/index.d.ts +0 -71
- package/packages/mailx-send/node_modules/undici-types/interceptors.d.ts +0 -17
- package/packages/mailx-send/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/packages/mailx-send/node_modules/undici-types/mock-client.d.ts +0 -25
- package/packages/mailx-send/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/packages/mailx-send/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/packages/mailx-send/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/packages/mailx-send/node_modules/undici-types/package.json +0 -55
- package/packages/mailx-send/node_modules/undici-types/patch.d.ts +0 -33
- package/packages/mailx-send/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/packages/mailx-send/node_modules/undici-types/pool.d.ts +0 -39
- package/packages/mailx-send/node_modules/undici-types/proxy-agent.d.ts +0 -28
- package/packages/mailx-send/node_modules/undici-types/readable.d.ts +0 -65
- package/packages/mailx-send/node_modules/undici-types/retry-agent.d.ts +0 -8
- package/packages/mailx-send/node_modules/undici-types/retry-handler.d.ts +0 -116
- package/packages/mailx-send/node_modules/undici-types/util.d.ts +0 -18
- package/packages/mailx-send/node_modules/undici-types/webidl.d.ts +0 -228
- package/packages/mailx-send/node_modules/undici-types/websocket.d.ts +0 -150
|
@@ -1,754 +0,0 @@
|
|
|
1
|
-
/* eslint no-console: 0 */
|
|
2
|
-
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
|
-
const urllib = require('url');
|
|
6
|
-
const util = require('util');
|
|
7
|
-
const fs = require('fs');
|
|
8
|
-
const nmfetch = require('../fetch');
|
|
9
|
-
const dns = require('dns');
|
|
10
|
-
const net = require('net');
|
|
11
|
-
const os = require('os');
|
|
12
|
-
|
|
13
|
-
const DNS_TTL = 5 * 60 * 1000;
|
|
14
|
-
const CACHE_CLEANUP_INTERVAL = 30 * 1000; // Minimum 30 seconds between cleanups
|
|
15
|
-
const MAX_CACHE_SIZE = 1000; // Maximum number of entries in cache
|
|
16
|
-
|
|
17
|
-
let lastCacheCleanup = 0;
|
|
18
|
-
module.exports._lastCacheCleanup = () => lastCacheCleanup;
|
|
19
|
-
module.exports._resetCacheCleanup = () => {
|
|
20
|
-
lastCacheCleanup = 0;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
let networkInterfaces;
|
|
24
|
-
try {
|
|
25
|
-
networkInterfaces = os.networkInterfaces();
|
|
26
|
-
} catch (_err) {
|
|
27
|
-
// fails on some systems
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
module.exports.networkInterfaces = networkInterfaces;
|
|
31
|
-
|
|
32
|
-
const isFamilySupported = (family, allowInternal) => {
|
|
33
|
-
let networkInterfaces = module.exports.networkInterfaces;
|
|
34
|
-
if (!networkInterfaces) {
|
|
35
|
-
// hope for the best
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const familySupported =
|
|
40
|
-
// crux that replaces Object.values(networkInterfaces) as Object.values is not supported in nodejs v6
|
|
41
|
-
Object.keys(networkInterfaces)
|
|
42
|
-
.map(key => networkInterfaces[key])
|
|
43
|
-
// crux that replaces .flat() as it is not supported in older Node versions (v10 and older)
|
|
44
|
-
.reduce((acc, val) => acc.concat(val), [])
|
|
45
|
-
.filter(i => !i.internal || allowInternal)
|
|
46
|
-
.filter(i => i.family === 'IPv' + family || i.family === family).length > 0;
|
|
47
|
-
|
|
48
|
-
return familySupported;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const resolver = (family, hostname, options, callback) => {
|
|
52
|
-
options = options || {};
|
|
53
|
-
const familySupported = isFamilySupported(family, options.allowInternalNetworkInterfaces);
|
|
54
|
-
|
|
55
|
-
if (!familySupported) {
|
|
56
|
-
return callback(null, []);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const resolver = dns.Resolver ? new dns.Resolver(options) : dns;
|
|
60
|
-
resolver['resolve' + family](hostname, (err, addresses) => {
|
|
61
|
-
if (err) {
|
|
62
|
-
switch (err.code) {
|
|
63
|
-
case dns.NODATA:
|
|
64
|
-
case dns.NOTFOUND:
|
|
65
|
-
case dns.NOTIMP:
|
|
66
|
-
case dns.SERVFAIL:
|
|
67
|
-
case dns.CONNREFUSED:
|
|
68
|
-
case dns.REFUSED:
|
|
69
|
-
case 'EAI_AGAIN':
|
|
70
|
-
return callback(null, []);
|
|
71
|
-
}
|
|
72
|
-
return callback(err);
|
|
73
|
-
}
|
|
74
|
-
return callback(null, Array.isArray(addresses) ? addresses : [].concat(addresses || []));
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const dnsCache = (module.exports.dnsCache = new Map());
|
|
79
|
-
|
|
80
|
-
const formatDNSValue = (value, extra) => {
|
|
81
|
-
if (!value) {
|
|
82
|
-
return Object.assign({}, extra || {});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return Object.assign(
|
|
86
|
-
{
|
|
87
|
-
servername: value.servername,
|
|
88
|
-
host:
|
|
89
|
-
!value.addresses || !value.addresses.length
|
|
90
|
-
? null
|
|
91
|
-
: value.addresses.length === 1
|
|
92
|
-
? value.addresses[0]
|
|
93
|
-
: value.addresses[Math.floor(Math.random() * value.addresses.length)]
|
|
94
|
-
},
|
|
95
|
-
extra || {}
|
|
96
|
-
);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
module.exports.resolveHostname = (options, callback) => {
|
|
100
|
-
options = options || {};
|
|
101
|
-
|
|
102
|
-
if (!options.host && options.servername) {
|
|
103
|
-
options.host = options.servername;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (!options.host || net.isIP(options.host)) {
|
|
107
|
-
// nothing to do here
|
|
108
|
-
let value = {
|
|
109
|
-
addresses: [options.host],
|
|
110
|
-
servername: options.servername || false
|
|
111
|
-
};
|
|
112
|
-
return callback(
|
|
113
|
-
null,
|
|
114
|
-
formatDNSValue(value, {
|
|
115
|
-
cached: false
|
|
116
|
-
})
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
let cached;
|
|
121
|
-
if (dnsCache.has(options.host)) {
|
|
122
|
-
cached = dnsCache.get(options.host);
|
|
123
|
-
|
|
124
|
-
// Lazy cleanup with time throttling
|
|
125
|
-
const now = Date.now();
|
|
126
|
-
if (now - lastCacheCleanup > CACHE_CLEANUP_INTERVAL) {
|
|
127
|
-
lastCacheCleanup = now;
|
|
128
|
-
|
|
129
|
-
// Clean up expired entries
|
|
130
|
-
for (const [host, entry] of dnsCache.entries()) {
|
|
131
|
-
if (entry.expires && entry.expires < now) {
|
|
132
|
-
dnsCache.delete(host);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// If cache is still too large, remove oldest entries
|
|
137
|
-
if (dnsCache.size > MAX_CACHE_SIZE) {
|
|
138
|
-
const toDelete = Math.floor(MAX_CACHE_SIZE * 0.1); // Remove 10% of entries
|
|
139
|
-
const keys = Array.from(dnsCache.keys()).slice(0, toDelete);
|
|
140
|
-
keys.forEach(key => dnsCache.delete(key));
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (!cached.expires || cached.expires >= now) {
|
|
145
|
-
return callback(
|
|
146
|
-
null,
|
|
147
|
-
formatDNSValue(cached.value, {
|
|
148
|
-
cached: true
|
|
149
|
-
})
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
resolver(4, options.host, options, (err, addresses) => {
|
|
155
|
-
if (err) {
|
|
156
|
-
if (cached) {
|
|
157
|
-
dnsCache.set(options.host, {
|
|
158
|
-
value: cached.value,
|
|
159
|
-
expires: Date.now() + (options.dnsTtl || DNS_TTL)
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
return callback(
|
|
163
|
-
null,
|
|
164
|
-
formatDNSValue(cached.value, {
|
|
165
|
-
cached: true,
|
|
166
|
-
error: err
|
|
167
|
-
})
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
return callback(err);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
if (addresses && addresses.length) {
|
|
174
|
-
let value = {
|
|
175
|
-
addresses,
|
|
176
|
-
servername: options.servername || options.host
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
dnsCache.set(options.host, {
|
|
180
|
-
value,
|
|
181
|
-
expires: Date.now() + (options.dnsTtl || DNS_TTL)
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
return callback(
|
|
185
|
-
null,
|
|
186
|
-
formatDNSValue(value, {
|
|
187
|
-
cached: false
|
|
188
|
-
})
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
resolver(6, options.host, options, (err, addresses) => {
|
|
193
|
-
if (err) {
|
|
194
|
-
if (cached) {
|
|
195
|
-
dnsCache.set(options.host, {
|
|
196
|
-
value: cached.value,
|
|
197
|
-
expires: Date.now() + (options.dnsTtl || DNS_TTL)
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
return callback(
|
|
201
|
-
null,
|
|
202
|
-
formatDNSValue(cached.value, {
|
|
203
|
-
cached: true,
|
|
204
|
-
error: err
|
|
205
|
-
})
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
return callback(err);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
if (addresses && addresses.length) {
|
|
212
|
-
let value = {
|
|
213
|
-
addresses,
|
|
214
|
-
servername: options.servername || options.host
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
dnsCache.set(options.host, {
|
|
218
|
-
value,
|
|
219
|
-
expires: Date.now() + (options.dnsTtl || DNS_TTL)
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
return callback(
|
|
223
|
-
null,
|
|
224
|
-
formatDNSValue(value, {
|
|
225
|
-
cached: false
|
|
226
|
-
})
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
try {
|
|
231
|
-
dns.lookup(options.host, { all: true }, (err, addresses) => {
|
|
232
|
-
if (err) {
|
|
233
|
-
if (cached) {
|
|
234
|
-
dnsCache.set(options.host, {
|
|
235
|
-
value: cached.value,
|
|
236
|
-
expires: Date.now() + (options.dnsTtl || DNS_TTL)
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
return callback(
|
|
240
|
-
null,
|
|
241
|
-
formatDNSValue(cached.value, {
|
|
242
|
-
cached: true,
|
|
243
|
-
error: err
|
|
244
|
-
})
|
|
245
|
-
);
|
|
246
|
-
}
|
|
247
|
-
return callback(err);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
let address = addresses
|
|
251
|
-
? addresses
|
|
252
|
-
.filter(addr => isFamilySupported(addr.family))
|
|
253
|
-
.map(addr => addr.address)
|
|
254
|
-
.shift()
|
|
255
|
-
: false;
|
|
256
|
-
|
|
257
|
-
if (addresses && addresses.length && !address) {
|
|
258
|
-
// there are addresses but none can be used
|
|
259
|
-
console.warn(`Failed to resolve IPv${addresses[0].family} addresses with current network`);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
if (!address && cached) {
|
|
263
|
-
// nothing was found, fallback to cached value
|
|
264
|
-
return callback(
|
|
265
|
-
null,
|
|
266
|
-
formatDNSValue(cached.value, {
|
|
267
|
-
cached: true
|
|
268
|
-
})
|
|
269
|
-
);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
let value = {
|
|
273
|
-
addresses: address ? [address] : [options.host],
|
|
274
|
-
servername: options.servername || options.host
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
dnsCache.set(options.host, {
|
|
278
|
-
value,
|
|
279
|
-
expires: Date.now() + (options.dnsTtl || DNS_TTL)
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
return callback(
|
|
283
|
-
null,
|
|
284
|
-
formatDNSValue(value, {
|
|
285
|
-
cached: false
|
|
286
|
-
})
|
|
287
|
-
);
|
|
288
|
-
});
|
|
289
|
-
} catch (_err) {
|
|
290
|
-
if (cached) {
|
|
291
|
-
dnsCache.set(options.host, {
|
|
292
|
-
value: cached.value,
|
|
293
|
-
expires: Date.now() + (options.dnsTtl || DNS_TTL)
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
return callback(
|
|
297
|
-
null,
|
|
298
|
-
formatDNSValue(cached.value, {
|
|
299
|
-
cached: true,
|
|
300
|
-
error: err
|
|
301
|
-
})
|
|
302
|
-
);
|
|
303
|
-
}
|
|
304
|
-
return callback(err);
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
});
|
|
308
|
-
};
|
|
309
|
-
/**
|
|
310
|
-
* Parses connection url to a structured configuration object
|
|
311
|
-
*
|
|
312
|
-
* @param {String} str Connection url
|
|
313
|
-
* @return {Object} Configuration object
|
|
314
|
-
*/
|
|
315
|
-
module.exports.parseConnectionUrl = str => {
|
|
316
|
-
str = str || '';
|
|
317
|
-
let options = {};
|
|
318
|
-
|
|
319
|
-
[urllib.parse(str, true)].forEach(url => {
|
|
320
|
-
let auth;
|
|
321
|
-
|
|
322
|
-
switch (url.protocol) {
|
|
323
|
-
case 'smtp:':
|
|
324
|
-
options.secure = false;
|
|
325
|
-
break;
|
|
326
|
-
case 'smtps:':
|
|
327
|
-
options.secure = true;
|
|
328
|
-
break;
|
|
329
|
-
case 'direct:':
|
|
330
|
-
options.direct = true;
|
|
331
|
-
break;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
if (!isNaN(url.port) && Number(url.port)) {
|
|
335
|
-
options.port = Number(url.port);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
if (url.hostname) {
|
|
339
|
-
options.host = url.hostname;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
if (url.auth) {
|
|
343
|
-
auth = url.auth.split(':');
|
|
344
|
-
|
|
345
|
-
if (!options.auth) {
|
|
346
|
-
options.auth = {};
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
options.auth.user = auth.shift();
|
|
350
|
-
options.auth.pass = auth.join(':');
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
Object.keys(url.query || {}).forEach(key => {
|
|
354
|
-
let obj = options;
|
|
355
|
-
let lKey = key;
|
|
356
|
-
let value = url.query[key];
|
|
357
|
-
|
|
358
|
-
if (!isNaN(value)) {
|
|
359
|
-
value = Number(value);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
switch (value) {
|
|
363
|
-
case 'true':
|
|
364
|
-
value = true;
|
|
365
|
-
break;
|
|
366
|
-
case 'false':
|
|
367
|
-
value = false;
|
|
368
|
-
break;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
// tls is nested object
|
|
372
|
-
if (key.indexOf('tls.') === 0) {
|
|
373
|
-
lKey = key.substr(4);
|
|
374
|
-
if (!options.tls) {
|
|
375
|
-
options.tls = {};
|
|
376
|
-
}
|
|
377
|
-
obj = options.tls;
|
|
378
|
-
} else if (key.indexOf('.') >= 0) {
|
|
379
|
-
// ignore nested properties besides tls
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
if (!(lKey in obj)) {
|
|
384
|
-
obj[lKey] = value;
|
|
385
|
-
}
|
|
386
|
-
});
|
|
387
|
-
});
|
|
388
|
-
|
|
389
|
-
return options;
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
module.exports._logFunc = (logger, level, defaults, data, message, ...args) => {
|
|
393
|
-
let entry = {};
|
|
394
|
-
|
|
395
|
-
Object.keys(defaults || {}).forEach(key => {
|
|
396
|
-
if (key !== 'level') {
|
|
397
|
-
entry[key] = defaults[key];
|
|
398
|
-
}
|
|
399
|
-
});
|
|
400
|
-
|
|
401
|
-
Object.keys(data || {}).forEach(key => {
|
|
402
|
-
if (key !== 'level') {
|
|
403
|
-
entry[key] = data[key];
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
|
|
407
|
-
logger[level](entry, message, ...args);
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
/**
|
|
411
|
-
* Returns a bunyan-compatible logger interface. Uses either provided logger or
|
|
412
|
-
* creates a default console logger
|
|
413
|
-
*
|
|
414
|
-
* @param {Object} [options] Options object that might include 'logger' value
|
|
415
|
-
* @return {Object} bunyan compatible logger
|
|
416
|
-
*/
|
|
417
|
-
module.exports.getLogger = (options, defaults) => {
|
|
418
|
-
options = options || {};
|
|
419
|
-
|
|
420
|
-
let response = {};
|
|
421
|
-
let levels = ['trace', 'debug', 'info', 'warn', 'error', 'fatal'];
|
|
422
|
-
|
|
423
|
-
if (!options.logger) {
|
|
424
|
-
// use vanity logger
|
|
425
|
-
levels.forEach(level => {
|
|
426
|
-
response[level] = () => false;
|
|
427
|
-
});
|
|
428
|
-
return response;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
let logger = options.logger;
|
|
432
|
-
|
|
433
|
-
if (options.logger === true) {
|
|
434
|
-
// create console logger
|
|
435
|
-
logger = createDefaultLogger(levels);
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
levels.forEach(level => {
|
|
439
|
-
response[level] = (data, message, ...args) => {
|
|
440
|
-
module.exports._logFunc(logger, level, defaults, data, message, ...args);
|
|
441
|
-
};
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
return response;
|
|
445
|
-
};
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* Wrapper for creating a callback that either resolves or rejects a promise
|
|
449
|
-
* based on input
|
|
450
|
-
*
|
|
451
|
-
* @param {Function} resolve Function to run if callback is called
|
|
452
|
-
* @param {Function} reject Function to run if callback ends with an error
|
|
453
|
-
*/
|
|
454
|
-
module.exports.callbackPromise = (resolve, reject) =>
|
|
455
|
-
function () {
|
|
456
|
-
let args = Array.from(arguments);
|
|
457
|
-
let err = args.shift();
|
|
458
|
-
if (err) {
|
|
459
|
-
reject(err);
|
|
460
|
-
} else {
|
|
461
|
-
resolve(...args);
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
|
-
|
|
465
|
-
module.exports.parseDataURI = uri => {
|
|
466
|
-
if (typeof uri !== 'string') {
|
|
467
|
-
return null;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
// Early return for non-data URIs to avoid unnecessary processing
|
|
471
|
-
if (!uri.startsWith('data:')) {
|
|
472
|
-
return null;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
// Find the first comma safely - this prevents ReDoS
|
|
476
|
-
const commaPos = uri.indexOf(',');
|
|
477
|
-
if (commaPos === -1) {
|
|
478
|
-
return null;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
const data = uri.substring(commaPos + 1);
|
|
482
|
-
const metaStr = uri.substring('data:'.length, commaPos);
|
|
483
|
-
|
|
484
|
-
let encoding;
|
|
485
|
-
const metaEntries = metaStr.split(';');
|
|
486
|
-
|
|
487
|
-
if (metaEntries.length > 0) {
|
|
488
|
-
const lastEntry = metaEntries[metaEntries.length - 1].toLowerCase().trim();
|
|
489
|
-
// Only recognize valid encoding types to prevent manipulation
|
|
490
|
-
if (['base64', 'utf8', 'utf-8'].includes(lastEntry) && lastEntry.indexOf('=') === -1) {
|
|
491
|
-
encoding = lastEntry;
|
|
492
|
-
metaEntries.pop();
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
const contentType = metaEntries.length > 0 ? metaEntries.shift() : 'application/octet-stream';
|
|
497
|
-
const params = {};
|
|
498
|
-
|
|
499
|
-
for (let i = 0; i < metaEntries.length; i++) {
|
|
500
|
-
const entry = metaEntries[i];
|
|
501
|
-
const sepPos = entry.indexOf('=');
|
|
502
|
-
if (sepPos > 0) {
|
|
503
|
-
// Ensure there's a key before the '='
|
|
504
|
-
const key = entry.substring(0, sepPos).trim();
|
|
505
|
-
const value = entry.substring(sepPos + 1).trim();
|
|
506
|
-
if (key) {
|
|
507
|
-
params[key] = value;
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
// Decode data based on encoding with proper error handling
|
|
513
|
-
let bufferData;
|
|
514
|
-
try {
|
|
515
|
-
if (encoding === 'base64') {
|
|
516
|
-
bufferData = Buffer.from(data, 'base64');
|
|
517
|
-
} else {
|
|
518
|
-
try {
|
|
519
|
-
bufferData = Buffer.from(decodeURIComponent(data));
|
|
520
|
-
} catch (_decodeError) {
|
|
521
|
-
bufferData = Buffer.from(data);
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
} catch (_bufferError) {
|
|
525
|
-
bufferData = Buffer.alloc(0);
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
return {
|
|
529
|
-
data: bufferData,
|
|
530
|
-
encoding: encoding || null,
|
|
531
|
-
contentType: contentType || 'application/octet-stream',
|
|
532
|
-
params
|
|
533
|
-
};
|
|
534
|
-
};
|
|
535
|
-
|
|
536
|
-
/**
|
|
537
|
-
* Resolves a String or a Buffer value for content value. Useful if the value
|
|
538
|
-
* is a Stream or a file or an URL. If the value is a Stream, overwrites
|
|
539
|
-
* the stream object with the resolved value (you can't stream a value twice).
|
|
540
|
-
*
|
|
541
|
-
* This is useful when you want to create a plugin that needs a content value,
|
|
542
|
-
* for example the `html` or `text` value as a String or a Buffer but not as
|
|
543
|
-
* a file path or an URL.
|
|
544
|
-
*
|
|
545
|
-
* @param {Object} data An object or an Array you want to resolve an element for
|
|
546
|
-
* @param {String|Number} key Property name or an Array index
|
|
547
|
-
* @param {Function} callback Callback function with (err, value)
|
|
548
|
-
*/
|
|
549
|
-
module.exports.resolveContent = (data, key, callback) => {
|
|
550
|
-
let promise;
|
|
551
|
-
|
|
552
|
-
if (!callback) {
|
|
553
|
-
promise = new Promise((resolve, reject) => {
|
|
554
|
-
callback = module.exports.callbackPromise(resolve, reject);
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
let content = (data && data[key] && data[key].content) || data[key];
|
|
559
|
-
let contentStream;
|
|
560
|
-
let encoding = ((typeof data[key] === 'object' && data[key].encoding) || 'utf8')
|
|
561
|
-
.toString()
|
|
562
|
-
.toLowerCase()
|
|
563
|
-
.replace(/[-_\s]/g, '');
|
|
564
|
-
|
|
565
|
-
if (!content) {
|
|
566
|
-
return callback(null, content);
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
if (typeof content === 'object') {
|
|
570
|
-
if (typeof content.pipe === 'function') {
|
|
571
|
-
return resolveStream(content, (err, value) => {
|
|
572
|
-
if (err) {
|
|
573
|
-
return callback(err);
|
|
574
|
-
}
|
|
575
|
-
// we can't stream twice the same content, so we need
|
|
576
|
-
// to replace the stream object with the streaming result
|
|
577
|
-
if (data[key].content) {
|
|
578
|
-
data[key].content = value;
|
|
579
|
-
} else {
|
|
580
|
-
data[key] = value;
|
|
581
|
-
}
|
|
582
|
-
callback(null, value);
|
|
583
|
-
});
|
|
584
|
-
} else if (/^https?:\/\//i.test(content.path || content.href)) {
|
|
585
|
-
contentStream = nmfetch(content.path || content.href);
|
|
586
|
-
return resolveStream(contentStream, callback);
|
|
587
|
-
} else if (/^data:/i.test(content.path || content.href)) {
|
|
588
|
-
let parsedDataUri = module.exports.parseDataURI(content.path || content.href);
|
|
589
|
-
|
|
590
|
-
if (!parsedDataUri || !parsedDataUri.data) {
|
|
591
|
-
return callback(null, Buffer.from(0));
|
|
592
|
-
}
|
|
593
|
-
return callback(null, parsedDataUri.data);
|
|
594
|
-
} else if (content.path) {
|
|
595
|
-
return resolveStream(fs.createReadStream(content.path), callback);
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
if (typeof data[key].content === 'string' && !['utf8', 'usascii', 'ascii'].includes(encoding)) {
|
|
600
|
-
content = Buffer.from(data[key].content, encoding);
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
// default action, return as is
|
|
604
|
-
setImmediate(() => callback(null, content));
|
|
605
|
-
|
|
606
|
-
return promise;
|
|
607
|
-
};
|
|
608
|
-
|
|
609
|
-
/**
|
|
610
|
-
* Copies properties from source objects to target objects
|
|
611
|
-
*/
|
|
612
|
-
module.exports.assign = function (/* target, ... sources */) {
|
|
613
|
-
let args = Array.from(arguments);
|
|
614
|
-
let target = args.shift() || {};
|
|
615
|
-
|
|
616
|
-
args.forEach(source => {
|
|
617
|
-
Object.keys(source || {}).forEach(key => {
|
|
618
|
-
if (['tls', 'auth'].includes(key) && source[key] && typeof source[key] === 'object') {
|
|
619
|
-
// tls and auth are special keys that need to be enumerated separately
|
|
620
|
-
// other objects are passed as is
|
|
621
|
-
if (!target[key]) {
|
|
622
|
-
// ensure that target has this key
|
|
623
|
-
target[key] = {};
|
|
624
|
-
}
|
|
625
|
-
Object.keys(source[key]).forEach(subKey => {
|
|
626
|
-
target[key][subKey] = source[key][subKey];
|
|
627
|
-
});
|
|
628
|
-
} else {
|
|
629
|
-
target[key] = source[key];
|
|
630
|
-
}
|
|
631
|
-
});
|
|
632
|
-
});
|
|
633
|
-
return target;
|
|
634
|
-
};
|
|
635
|
-
|
|
636
|
-
module.exports.encodeXText = str => {
|
|
637
|
-
// ! 0x21
|
|
638
|
-
// + 0x2B
|
|
639
|
-
// = 0x3D
|
|
640
|
-
// ~ 0x7E
|
|
641
|
-
if (!/[^\x21-\x2A\x2C-\x3C\x3E-\x7E]/.test(str)) {
|
|
642
|
-
return str;
|
|
643
|
-
}
|
|
644
|
-
let buf = Buffer.from(str);
|
|
645
|
-
let result = '';
|
|
646
|
-
for (let i = 0, len = buf.length; i < len; i++) {
|
|
647
|
-
let c = buf[i];
|
|
648
|
-
if (c < 0x21 || c > 0x7e || c === 0x2b || c === 0x3d) {
|
|
649
|
-
result += '+' + (c < 0x10 ? '0' : '') + c.toString(16).toUpperCase();
|
|
650
|
-
} else {
|
|
651
|
-
result += String.fromCharCode(c);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
return result;
|
|
655
|
-
};
|
|
656
|
-
|
|
657
|
-
/**
|
|
658
|
-
* Streams a stream value into a Buffer
|
|
659
|
-
*
|
|
660
|
-
* @param {Object} stream Readable stream
|
|
661
|
-
* @param {Function} callback Callback function with (err, value)
|
|
662
|
-
*/
|
|
663
|
-
function resolveStream(stream, callback) {
|
|
664
|
-
let responded = false;
|
|
665
|
-
let chunks = [];
|
|
666
|
-
let chunklen = 0;
|
|
667
|
-
|
|
668
|
-
stream.on('error', err => {
|
|
669
|
-
if (responded) {
|
|
670
|
-
return;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
responded = true;
|
|
674
|
-
callback(err);
|
|
675
|
-
});
|
|
676
|
-
|
|
677
|
-
stream.on('readable', () => {
|
|
678
|
-
let chunk;
|
|
679
|
-
while ((chunk = stream.read()) !== null) {
|
|
680
|
-
chunks.push(chunk);
|
|
681
|
-
chunklen += chunk.length;
|
|
682
|
-
}
|
|
683
|
-
});
|
|
684
|
-
|
|
685
|
-
stream.on('end', () => {
|
|
686
|
-
if (responded) {
|
|
687
|
-
return;
|
|
688
|
-
}
|
|
689
|
-
responded = true;
|
|
690
|
-
|
|
691
|
-
let value;
|
|
692
|
-
|
|
693
|
-
try {
|
|
694
|
-
value = Buffer.concat(chunks, chunklen);
|
|
695
|
-
} catch (E) {
|
|
696
|
-
return callback(E);
|
|
697
|
-
}
|
|
698
|
-
callback(null, value);
|
|
699
|
-
});
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
/**
|
|
703
|
-
* Generates a bunyan-like logger that prints to console
|
|
704
|
-
*
|
|
705
|
-
* @returns {Object} Bunyan logger instance
|
|
706
|
-
*/
|
|
707
|
-
function createDefaultLogger(levels) {
|
|
708
|
-
let levelMaxLen = 0;
|
|
709
|
-
let levelNames = new Map();
|
|
710
|
-
levels.forEach(level => {
|
|
711
|
-
if (level.length > levelMaxLen) {
|
|
712
|
-
levelMaxLen = level.length;
|
|
713
|
-
}
|
|
714
|
-
});
|
|
715
|
-
|
|
716
|
-
levels.forEach(level => {
|
|
717
|
-
let levelName = level.toUpperCase();
|
|
718
|
-
if (levelName.length < levelMaxLen) {
|
|
719
|
-
levelName += ' '.repeat(levelMaxLen - levelName.length);
|
|
720
|
-
}
|
|
721
|
-
levelNames.set(level, levelName);
|
|
722
|
-
});
|
|
723
|
-
|
|
724
|
-
let print = (level, entry, message, ...args) => {
|
|
725
|
-
let prefix = '';
|
|
726
|
-
if (entry) {
|
|
727
|
-
if (entry.tnx === 'server') {
|
|
728
|
-
prefix = 'S: ';
|
|
729
|
-
} else if (entry.tnx === 'client') {
|
|
730
|
-
prefix = 'C: ';
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
if (entry.sid) {
|
|
734
|
-
prefix = '[' + entry.sid + '] ' + prefix;
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
if (entry.cid) {
|
|
738
|
-
prefix = '[#' + entry.cid + '] ' + prefix;
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
message = util.format(message, ...args);
|
|
743
|
-
message.split(/\r?\n/).forEach(line => {
|
|
744
|
-
console.log('[%s] %s %s', new Date().toISOString().substr(0, 19).replace(/T/, ' '), levelNames.get(level), prefix + line);
|
|
745
|
-
});
|
|
746
|
-
};
|
|
747
|
-
|
|
748
|
-
let logger = {};
|
|
749
|
-
levels.forEach(level => {
|
|
750
|
-
logger[level] = print.bind(null, level);
|
|
751
|
-
});
|
|
752
|
-
|
|
753
|
-
return logger;
|
|
754
|
-
}
|