ai 1.1.0 → 2.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/LICENSE +10 -24
- package/dist/ai-stream.d.ts +18 -0
- package/dist/ai-stream.js +132 -0
- package/dist/ai-stream.mjs +13 -0
- package/dist/anthropic-stream.d.ts +5 -0
- package/dist/anthropic-stream.js +133 -0
- package/dist/anthropic-stream.mjs +8 -0
- package/dist/chunk-265FSSO4.mjs +91 -0
- package/dist/chunk-2L3ZO4UM.mjs +45 -0
- package/dist/chunk-EZJ7FC5E.mjs +33 -0
- package/dist/chunk-JGDC3BXD.mjs +22 -0
- package/dist/chunk-NK2CVBLI.mjs +38 -0
- package/dist/chunk-PEYAHBDF.mjs +43 -0
- package/dist/chunk-TJMME6CL.mjs +24 -0
- package/dist/huggingface-stream.d.ts +5 -0
- package/dist/huggingface-stream.js +121 -0
- package/dist/huggingface-stream.mjs +8 -0
- package/dist/index.d.ts +131 -0
- package/dist/index.js +278 -0
- package/dist/index.mjs +35 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.js +12 -0
- package/dist/index.test.mjs +10 -0
- package/dist/langchain-stream.d.ts +12 -0
- package/dist/langchain-stream.js +102 -0
- package/dist/langchain-stream.mjs +8 -0
- package/dist/openai-stream.d.ts +5 -0
- package/dist/openai-stream.js +144 -0
- package/dist/openai-stream.mjs +8 -0
- package/dist/streaming-text-response.d.ts +17 -0
- package/dist/streaming-text-response.js +75 -0
- package/dist/streaming-text-response.mjs +9 -0
- package/package.json +78 -29
- package/react/dist/chunk-5PP6W52J.mjs +202 -0
- package/react/dist/chunk-6EH3SWMP.mjs +55 -0
- package/react/dist/chunk-PW6HSU2N.mjs +154 -0
- package/react/dist/index.d.ts +3 -0
- package/react/dist/index.js +424 -0
- package/react/dist/index.mjs +12 -0
- package/react/dist/types-f862f74a.d.ts +123 -0
- package/react/dist/use-chat.d.ts +42 -0
- package/react/dist/use-chat.js +276 -0
- package/react/dist/use-chat.mjs +8 -0
- package/react/dist/use-completion.d.ts +47 -0
- package/react/dist/use-completion.js +229 -0
- package/react/dist/use-completion.mjs +8 -0
- package/svelte/dist/chunk-6USBQIV6.mjs +177 -0
- package/svelte/dist/chunk-BQ64GHZ3.mjs +136 -0
- package/svelte/dist/chunk-CENOSGDG.mjs +493 -0
- package/svelte/dist/index.d.ts +4 -0
- package/svelte/dist/index.js +808 -0
- package/svelte/dist/index.mjs +11 -0
- package/svelte/dist/types-f862f74a.d.ts +123 -0
- package/svelte/dist/use-chat.d.ts +39 -0
- package/svelte/dist/use-chat.js +680 -0
- package/svelte/dist/use-chat.mjs +7 -0
- package/svelte/dist/use-completion.d.ts +38 -0
- package/svelte/dist/use-completion.js +640 -0
- package/svelte/dist/use-completion.mjs +7 -0
- package/.npmignore +0 -15
- package/.travis.yml +0 -4
- package/README.md +0 -21
- package/bin/ai.js +0 -22
- package/index.js +0 -37
- package/node_modules/request/.npmignore +0 -2
- package/node_modules/request/.travis.yml +0 -12
- package/node_modules/request/CHANGELOG.md +0 -954
- package/node_modules/request/LICENSE +0 -55
- package/node_modules/request/README.md +0 -421
- package/node_modules/request/index.js +0 -166
- package/node_modules/request/lib/cookies.js +0 -40
- package/node_modules/request/lib/copy.js +0 -8
- package/node_modules/request/lib/debug.js +0 -7
- package/node_modules/request/lib/getSafe.js +0 -34
- package/node_modules/request/lib/optional.js +0 -5
- package/node_modules/request/node_modules/aws-sign2/LICENSE +0 -55
- package/node_modules/request/node_modules/aws-sign2/README.md +0 -4
- package/node_modules/request/node_modules/aws-sign2/index.js +0 -202
- package/node_modules/request/node_modules/aws-sign2/package.json +0 -47
- package/node_modules/request/node_modules/forever-agent/LICENSE +0 -55
- package/node_modules/request/node_modules/forever-agent/README.md +0 -4
- package/node_modules/request/node_modules/forever-agent/index.js +0 -119
- package/node_modules/request/node_modules/forever-agent/package.json +0 -46
- package/node_modules/request/node_modules/form-data/License +0 -19
- package/node_modules/request/node_modules/form-data/Readme.md +0 -175
- package/node_modules/request/node_modules/form-data/lib/form_data.js +0 -351
- package/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml +0 -3
- package/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +0 -19
- package/node_modules/request/node_modules/form-data/node_modules/async/README.md +0 -1646
- package/node_modules/request/node_modules/form-data/node_modules/async/component.json +0 -11
- package/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +0 -1123
- package/node_modules/request/node_modules/form-data/node_modules/async/package.json +0 -60
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +0 -19
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +0 -132
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +0 -186
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore +0 -2
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License +0 -19
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +0 -7
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +0 -154
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +0 -99
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json +0 -42
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js +0 -6
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +0 -38
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js +0 -21
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js +0 -14
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js +0 -48
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js +0 -15
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js +0 -18
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js +0 -13
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js +0 -13
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js +0 -7
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +0 -61
- package/node_modules/request/node_modules/form-data/node_modules/mime/LICENSE +0 -19
- package/node_modules/request/node_modules/form-data/node_modules/mime/README.md +0 -66
- package/node_modules/request/node_modules/form-data/node_modules/mime/mime.js +0 -114
- package/node_modules/request/node_modules/form-data/node_modules/mime/package.json +0 -59
- package/node_modules/request/node_modules/form-data/node_modules/mime/test.js +0 -84
- package/node_modules/request/node_modules/form-data/node_modules/mime/types/mime.types +0 -1588
- package/node_modules/request/node_modules/form-data/node_modules/mime/types/node.types +0 -77
- package/node_modules/request/node_modules/form-data/package.json +0 -80
- package/node_modules/request/node_modules/hawk/.npmignore +0 -18
- package/node_modules/request/node_modules/hawk/.travis.yml +0 -5
- package/node_modules/request/node_modules/hawk/LICENSE +0 -24
- package/node_modules/request/node_modules/hawk/Makefile +0 -10
- package/node_modules/request/node_modules/hawk/README.md +0 -625
- package/node_modules/request/node_modules/hawk/example/usage.js +0 -78
- package/node_modules/request/node_modules/hawk/images/hawk.png +0 -0
- package/node_modules/request/node_modules/hawk/images/logo.png +0 -0
- package/node_modules/request/node_modules/hawk/index.js +0 -1
- package/node_modules/request/node_modules/hawk/lib/browser.js +0 -507
- package/node_modules/request/node_modules/hawk/lib/client.js +0 -371
- package/node_modules/request/node_modules/hawk/lib/crypto.js +0 -118
- package/node_modules/request/node_modules/hawk/lib/index.js +0 -15
- package/node_modules/request/node_modules/hawk/lib/server.js +0 -523
- package/node_modules/request/node_modules/hawk/lib/utils.js +0 -183
- package/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore +0 -18
- package/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml +0 -5
- package/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE +0 -24
- package/node_modules/request/node_modules/hawk/node_modules/boom/Makefile +0 -11
- package/node_modules/request/node_modules/hawk/node_modules/boom/README.md +0 -6
- package/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png +0 -0
- package/node_modules/request/node_modules/hawk/node_modules/boom/index.js +0 -1
- package/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js +0 -207
- package/node_modules/request/node_modules/hawk/node_modules/boom/package.json +0 -64
- package/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js +0 -245
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore +0 -18
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml +0 -5
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE +0 -24
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile +0 -11
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md +0 -6
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js +0 -1
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js +0 -68
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +0 -65
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js +0 -101
- package/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore +0 -18
- package/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml +0 -5
- package/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE +0 -33
- package/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile +0 -10
- package/node_modules/request/node_modules/hawk/node_modules/hoek/README.md +0 -436
- package/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png +0 -0
- package/node_modules/request/node_modules/hawk/node_modules/hoek/index.js +0 -1
- package/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js +0 -132
- package/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js +0 -585
- package/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +0 -70
- package/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js +0 -86
- package/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js +0 -1078
- package/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js +0 -1
- package/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js +0 -1
- package/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js +0 -1
- package/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore +0 -18
- package/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml +0 -5
- package/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE +0 -24
- package/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile +0 -11
- package/node_modules/request/node_modules/hawk/node_modules/sntp/README.md +0 -68
- package/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js +0 -16
- package/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js +0 -25
- package/node_modules/request/node_modules/hawk/node_modules/sntp/index.js +0 -1
- package/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js +0 -409
- package/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +0 -65
- package/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js +0 -359
- package/node_modules/request/node_modules/hawk/package.json +0 -70
- package/node_modules/request/node_modules/hawk/test/browser.js +0 -817
- package/node_modules/request/node_modules/hawk/test/client.js +0 -206
- package/node_modules/request/node_modules/hawk/test/crypto.js +0 -86
- package/node_modules/request/node_modules/hawk/test/index.js +0 -316
- package/node_modules/request/node_modules/hawk/test/message.js +0 -246
- package/node_modules/request/node_modules/hawk/test/readme.js +0 -98
- package/node_modules/request/node_modules/hawk/test/server.js +0 -686
- package/node_modules/request/node_modules/hawk/test/uri.js +0 -456
- package/node_modules/request/node_modules/hawk/test/utils.js +0 -120
- package/node_modules/request/node_modules/http-signature/.dir-locals.el +0 -6
- package/node_modules/request/node_modules/http-signature/.npmignore +0 -7
- package/node_modules/request/node_modules/http-signature/LICENSE +0 -18
- package/node_modules/request/node_modules/http-signature/README.md +0 -75
- package/node_modules/request/node_modules/http-signature/http_signing.md +0 -296
- package/node_modules/request/node_modules/http-signature/lib/index.js +0 -25
- package/node_modules/request/node_modules/http-signature/lib/parser.js +0 -304
- package/node_modules/request/node_modules/http-signature/lib/signer.js +0 -179
- package/node_modules/request/node_modules/http-signature/lib/util.js +0 -249
- package/node_modules/request/node_modules/http-signature/lib/verify.js +0 -42
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore +0 -2
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE +0 -19
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md +0 -50
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js +0 -13
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js +0 -27
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js +0 -267
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js +0 -36
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js +0 -317
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js +0 -20
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json +0 -63
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js +0 -172
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js +0 -296
- package/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md +0 -126
- package/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js +0 -196
- package/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +0 -38
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG +0 -71
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE +0 -24
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/README +0 -82
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old +0 -298
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js +0 -245
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js +0 -1485
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js +0 -944
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype +0 -241
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +0 -36
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf +0 -129
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle +0 -839
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/float.json +0 -13
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/int.json +0 -13
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/psinfo.json +0 -104
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/struct.json +0 -19
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.fail.js +0 -39
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.float.js +0 -14
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.int.js +0 -14
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.psinfo.js +0 -17
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.struct.js +0 -18
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.typedef.js +0 -15
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/typedef.json +0 -14
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.rfloat.js +0 -767
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.wfloat.js +0 -753
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.64.js +0 -638
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.rint.js +0 -101
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wbounds.js +0 -53
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js +0 -92
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.64.js +0 -451
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.roundtrip.js +0 -81
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.ruint.js +0 -95
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.wuint.js +0 -156
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicr.js +0 -50
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicw.js +0 -44
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.char.js +0 -42
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.endian.js +0 -45
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.oldwrite.js +0 -28
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.readSize.js +0 -128
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.structw.js +0 -28
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.writeStruct.js +0 -31
- package/node_modules/request/node_modules/http-signature/package.json +0 -54
- package/node_modules/request/node_modules/json-stringify-safe/LICENSE +0 -27
- package/node_modules/request/node_modules/json-stringify-safe/README.md +0 -49
- package/node_modules/request/node_modules/json-stringify-safe/package.json +0 -51
- package/node_modules/request/node_modules/json-stringify-safe/stringify.js +0 -39
- package/node_modules/request/node_modules/json-stringify-safe/test.js +0 -128
- package/node_modules/request/node_modules/mime-types/.npmignore +0 -14
- package/node_modules/request/node_modules/mime-types/.travis.yml +0 -12
- package/node_modules/request/node_modules/mime-types/LICENSE +0 -22
- package/node_modules/request/node_modules/mime-types/Makefile +0 -9
- package/node_modules/request/node_modules/mime-types/README.md +0 -101
- package/node_modules/request/node_modules/mime-types/SOURCES.md +0 -17
- package/node_modules/request/node_modules/mime-types/component.json +0 -16
- package/node_modules/request/node_modules/mime-types/lib/custom.json +0 -27
- package/node_modules/request/node_modules/mime-types/lib/index.js +0 -75
- package/node_modules/request/node_modules/mime-types/lib/mime.json +0 -3317
- package/node_modules/request/node_modules/mime-types/lib/node.json +0 -55
- package/node_modules/request/node_modules/mime-types/package.json +0 -69
- package/node_modules/request/node_modules/node-uuid/.npmignore +0 -2
- package/node_modules/request/node_modules/node-uuid/LICENSE.md +0 -2
- package/node_modules/request/node_modules/node-uuid/README.md +0 -207
- package/node_modules/request/node_modules/node-uuid/benchmark/README.md +0 -53
- package/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +0 -174
- package/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +0 -34
- package/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +0 -34
- package/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +0 -84
- package/node_modules/request/node_modules/node-uuid/component.json +0 -18
- package/node_modules/request/node_modules/node-uuid/package.json +0 -54
- package/node_modules/request/node_modules/node-uuid/test/compare_v1.js +0 -63
- package/node_modules/request/node_modules/node-uuid/test/test.html +0 -17
- package/node_modules/request/node_modules/node-uuid/test/test.js +0 -228
- package/node_modules/request/node_modules/node-uuid/uuid.js +0 -245
- package/node_modules/request/node_modules/oauth-sign/LICENSE +0 -55
- package/node_modules/request/node_modules/oauth-sign/README.md +0 -4
- package/node_modules/request/node_modules/oauth-sign/index.js +0 -43
- package/node_modules/request/node_modules/oauth-sign/package.json +0 -49
- package/node_modules/request/node_modules/oauth-sign/test.js +0 -49
- package/node_modules/request/node_modules/qs/.jshintignore +0 -1
- package/node_modules/request/node_modules/qs/.jshintrc +0 -10
- package/node_modules/request/node_modules/qs/.npmignore +0 -18
- package/node_modules/request/node_modules/qs/.travis.yml +0 -4
- package/node_modules/request/node_modules/qs/LICENSE +0 -28
- package/node_modules/request/node_modules/qs/Makefile +0 -8
- package/node_modules/request/node_modules/qs/Readme.md +0 -120
- package/node_modules/request/node_modules/qs/index.js +0 -1
- package/node_modules/request/node_modules/qs/lib/index.js +0 -15
- package/node_modules/request/node_modules/qs/lib/parse.js +0 -151
- package/node_modules/request/node_modules/qs/lib/stringify.js +0 -52
- package/node_modules/request/node_modules/qs/lib/utils.js +0 -131
- package/node_modules/request/node_modules/qs/package.json +0 -61
- package/node_modules/request/node_modules/qs/test/parse.js +0 -236
- package/node_modules/request/node_modules/qs/test/stringify.js +0 -123
- package/node_modules/request/node_modules/stringstream/.npmignore +0 -15
- package/node_modules/request/node_modules/stringstream/.travis.yml +0 -4
- package/node_modules/request/node_modules/stringstream/LICENSE.txt +0 -4
- package/node_modules/request/node_modules/stringstream/README.md +0 -38
- package/node_modules/request/node_modules/stringstream/example.js +0 -27
- package/node_modules/request/node_modules/stringstream/package.json +0 -48
- package/node_modules/request/node_modules/stringstream/stringstream.js +0 -102
- package/node_modules/request/node_modules/tough-cookie/.jshintrc +0 -70
- package/node_modules/request/node_modules/tough-cookie/.npmignore +0 -3
- package/node_modules/request/node_modules/tough-cookie/.travis.yml +0 -8
- package/node_modules/request/node_modules/tough-cookie/LICENSE +0 -78
- package/node_modules/request/node_modules/tough-cookie/README.md +0 -412
- package/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js +0 -239
- package/node_modules/request/node_modules/tough-cookie/lib/cookie.js +0 -1107
- package/node_modules/request/node_modules/tough-cookie/lib/memstore.js +0 -123
- package/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js +0 -69
- package/node_modules/request/node_modules/tough-cookie/lib/store.js +0 -37
- package/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt +0 -20
- package/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md +0 -176
- package/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json +0 -87
- package/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js +0 -528
- package/node_modules/request/node_modules/tough-cookie/package.json +0 -67
- package/node_modules/request/node_modules/tough-cookie/public-suffix.txt +0 -5229
- package/node_modules/request/node_modules/tough-cookie/test.js +0 -1625
- package/node_modules/request/node_modules/tunnel-agent/.jshintrc +0 -5
- package/node_modules/request/node_modules/tunnel-agent/LICENSE +0 -55
- package/node_modules/request/node_modules/tunnel-agent/README.md +0 -4
- package/node_modules/request/node_modules/tunnel-agent/index.js +0 -236
- package/node_modules/request/node_modules/tunnel-agent/package.json +0 -46
- package/node_modules/request/package.json +0 -77
- package/node_modules/request/request.js +0 -1428
- package/test/fixtures/github-response.json +0 -1367
- package/test/index.js +0 -55
@@ -1,371 +0,0 @@
|
|
1
|
-
// Load modules
|
2
|
-
|
3
|
-
var Url = require('url');
|
4
|
-
var Hoek = require('hoek');
|
5
|
-
var Cryptiles = require('cryptiles');
|
6
|
-
var Crypto = require('./crypto');
|
7
|
-
var Utils = require('./utils');
|
8
|
-
|
9
|
-
|
10
|
-
// Declare internals
|
11
|
-
|
12
|
-
var internals = {};
|
13
|
-
|
14
|
-
|
15
|
-
// Generate an Authorization header for a given request
|
16
|
-
|
17
|
-
/*
|
18
|
-
uri: 'http://example.com/resource?a=b' or object from Url.parse()
|
19
|
-
method: HTTP verb (e.g. 'GET', 'POST')
|
20
|
-
options: {
|
21
|
-
|
22
|
-
// Required
|
23
|
-
|
24
|
-
credentials: {
|
25
|
-
id: 'dh37fgj492je',
|
26
|
-
key: 'aoijedoaijsdlaksjdl',
|
27
|
-
algorithm: 'sha256' // 'sha1', 'sha256'
|
28
|
-
},
|
29
|
-
|
30
|
-
// Optional
|
31
|
-
|
32
|
-
ext: 'application-specific', // Application specific data sent via the ext attribute
|
33
|
-
timestamp: Date.now(), // A pre-calculated timestamp
|
34
|
-
nonce: '2334f34f', // A pre-generated nonce
|
35
|
-
localtimeOffsetMsec: 400, // Time offset to sync with server time (ignored if timestamp provided)
|
36
|
-
payload: '{"some":"payload"}', // UTF-8 encoded string for body hash generation (ignored if hash provided)
|
37
|
-
contentType: 'application/json', // Payload content-type (ignored if hash provided)
|
38
|
-
hash: 'U4MKKSmiVxk37JCCrAVIjV=', // Pre-calculated payload hash
|
39
|
-
app: '24s23423f34dx', // Oz application id
|
40
|
-
dlg: '234sz34tww3sd' // Oz delegated-by application id
|
41
|
-
}
|
42
|
-
*/
|
43
|
-
|
44
|
-
exports.header = function (uri, method, options) {
|
45
|
-
|
46
|
-
var result = {
|
47
|
-
field: '',
|
48
|
-
artifacts: {}
|
49
|
-
};
|
50
|
-
|
51
|
-
// Validate inputs
|
52
|
-
|
53
|
-
if (!uri || (typeof uri !== 'string' && typeof uri !== 'object') ||
|
54
|
-
!method || typeof method !== 'string' ||
|
55
|
-
!options || typeof options !== 'object') {
|
56
|
-
|
57
|
-
result.err = 'Invalid argument type';
|
58
|
-
return result;
|
59
|
-
}
|
60
|
-
|
61
|
-
// Application time
|
62
|
-
|
63
|
-
var timestamp = options.timestamp || Math.floor((Utils.now() + (options.localtimeOffsetMsec || 0)) / 1000)
|
64
|
-
|
65
|
-
// Validate credentials
|
66
|
-
|
67
|
-
var credentials = options.credentials;
|
68
|
-
if (!credentials ||
|
69
|
-
!credentials.id ||
|
70
|
-
!credentials.key ||
|
71
|
-
!credentials.algorithm) {
|
72
|
-
|
73
|
-
result.err = 'Invalid credential object';
|
74
|
-
return result;
|
75
|
-
}
|
76
|
-
|
77
|
-
if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
|
78
|
-
result.err = 'Unknown algorithm';
|
79
|
-
return result;
|
80
|
-
}
|
81
|
-
|
82
|
-
// Parse URI
|
83
|
-
|
84
|
-
if (typeof uri === 'string') {
|
85
|
-
uri = Url.parse(uri);
|
86
|
-
}
|
87
|
-
|
88
|
-
// Calculate signature
|
89
|
-
|
90
|
-
var artifacts = {
|
91
|
-
ts: timestamp,
|
92
|
-
nonce: options.nonce || Cryptiles.randomString(6),
|
93
|
-
method: method,
|
94
|
-
resource: uri.pathname + (uri.search || ''), // Maintain trailing '?'
|
95
|
-
host: uri.hostname,
|
96
|
-
port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
|
97
|
-
hash: options.hash,
|
98
|
-
ext: options.ext,
|
99
|
-
app: options.app,
|
100
|
-
dlg: options.dlg
|
101
|
-
};
|
102
|
-
|
103
|
-
result.artifacts = artifacts;
|
104
|
-
|
105
|
-
// Calculate payload hash
|
106
|
-
|
107
|
-
if (!artifacts.hash &&
|
108
|
-
options.hasOwnProperty('payload')) {
|
109
|
-
|
110
|
-
artifacts.hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
|
111
|
-
}
|
112
|
-
|
113
|
-
var mac = Crypto.calculateMac('header', credentials, artifacts);
|
114
|
-
|
115
|
-
// Construct header
|
116
|
-
|
117
|
-
var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''; // Other falsey values allowed
|
118
|
-
var header = 'Hawk id="' + credentials.id +
|
119
|
-
'", ts="' + artifacts.ts +
|
120
|
-
'", nonce="' + artifacts.nonce +
|
121
|
-
(artifacts.hash ? '", hash="' + artifacts.hash : '') +
|
122
|
-
(hasExt ? '", ext="' + Utils.escapeHeaderAttribute(artifacts.ext) : '') +
|
123
|
-
'", mac="' + mac + '"';
|
124
|
-
|
125
|
-
if (artifacts.app) {
|
126
|
-
header += ', app="' + artifacts.app +
|
127
|
-
(artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"';
|
128
|
-
}
|
129
|
-
|
130
|
-
result.field = header;
|
131
|
-
|
132
|
-
return result;
|
133
|
-
};
|
134
|
-
|
135
|
-
|
136
|
-
// Validate server response
|
137
|
-
|
138
|
-
/*
|
139
|
-
res: node's response object
|
140
|
-
artifacts: object recieved from header().artifacts
|
141
|
-
options: {
|
142
|
-
payload: optional payload received
|
143
|
-
required: specifies if a Server-Authorization header is required. Defaults to 'false'
|
144
|
-
}
|
145
|
-
*/
|
146
|
-
|
147
|
-
exports.authenticate = function (res, credentials, artifacts, options) {
|
148
|
-
|
149
|
-
artifacts = Hoek.clone(artifacts);
|
150
|
-
options = options || {};
|
151
|
-
|
152
|
-
if (res.headers['www-authenticate']) {
|
153
|
-
|
154
|
-
// Parse HTTP WWW-Authenticate header
|
155
|
-
|
156
|
-
var attributes = Utils.parseAuthorizationHeader(res.headers['www-authenticate'], ['ts', 'tsm', 'error']);
|
157
|
-
if (attributes instanceof Error) {
|
158
|
-
return false;
|
159
|
-
}
|
160
|
-
|
161
|
-
// Validate server timestamp (not used to update clock since it is done via the SNPT client)
|
162
|
-
|
163
|
-
if (attributes.ts) {
|
164
|
-
var tsm = Crypto.calculateTsMac(attributes.ts, credentials);
|
165
|
-
if (tsm !== attributes.tsm) {
|
166
|
-
return false;
|
167
|
-
}
|
168
|
-
}
|
169
|
-
}
|
170
|
-
|
171
|
-
// Parse HTTP Server-Authorization header
|
172
|
-
|
173
|
-
if (!res.headers['server-authorization'] &&
|
174
|
-
!options.required) {
|
175
|
-
|
176
|
-
return true;
|
177
|
-
}
|
178
|
-
|
179
|
-
var attributes = Utils.parseAuthorizationHeader(res.headers['server-authorization'], ['mac', 'ext', 'hash']);
|
180
|
-
if (attributes instanceof Error) {
|
181
|
-
return false;
|
182
|
-
}
|
183
|
-
|
184
|
-
artifacts.ext = attributes.ext;
|
185
|
-
artifacts.hash = attributes.hash;
|
186
|
-
|
187
|
-
var mac = Crypto.calculateMac('response', credentials, artifacts);
|
188
|
-
if (mac !== attributes.mac) {
|
189
|
-
return false;
|
190
|
-
}
|
191
|
-
|
192
|
-
if (!options.hasOwnProperty('payload')) {
|
193
|
-
return true;
|
194
|
-
}
|
195
|
-
|
196
|
-
if (!attributes.hash) {
|
197
|
-
return false;
|
198
|
-
}
|
199
|
-
|
200
|
-
var calculatedHash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, res.headers['content-type']);
|
201
|
-
return (calculatedHash === attributes.hash);
|
202
|
-
};
|
203
|
-
|
204
|
-
|
205
|
-
// Generate a bewit value for a given URI
|
206
|
-
|
207
|
-
/*
|
208
|
-
* credentials is an object with the following keys: 'id, 'key', 'algorithm'.
|
209
|
-
* options is an object with the following optional keys: 'ext', 'localtimeOffsetMsec'
|
210
|
-
*/
|
211
|
-
/*
|
212
|
-
uri: 'http://example.com/resource?a=b' or object from Url.parse()
|
213
|
-
options: {
|
214
|
-
|
215
|
-
// Required
|
216
|
-
|
217
|
-
credentials: {
|
218
|
-
id: 'dh37fgj492je',
|
219
|
-
key: 'aoijedoaijsdlaksjdl',
|
220
|
-
algorithm: 'sha256' // 'sha1', 'sha256'
|
221
|
-
},
|
222
|
-
ttlSec: 60 * 60, // TTL in seconds
|
223
|
-
|
224
|
-
// Optional
|
225
|
-
|
226
|
-
ext: 'application-specific', // Application specific data sent via the ext attribute
|
227
|
-
localtimeOffsetMsec: 400 // Time offset to sync with server time
|
228
|
-
};
|
229
|
-
*/
|
230
|
-
|
231
|
-
exports.getBewit = function (uri, options) {
|
232
|
-
|
233
|
-
// Validate inputs
|
234
|
-
|
235
|
-
if (!uri ||
|
236
|
-
(typeof uri !== 'string' && typeof uri !== 'object') ||
|
237
|
-
!options ||
|
238
|
-
typeof options !== 'object' ||
|
239
|
-
!options.ttlSec) {
|
240
|
-
|
241
|
-
return '';
|
242
|
-
}
|
243
|
-
|
244
|
-
options.ext = (options.ext === null || options.ext === undefined ? '' : options.ext); // Zero is valid value
|
245
|
-
|
246
|
-
// Application time
|
247
|
-
|
248
|
-
var now = Utils.now() + (options.localtimeOffsetMsec || 0);
|
249
|
-
|
250
|
-
// Validate credentials
|
251
|
-
|
252
|
-
var credentials = options.credentials;
|
253
|
-
if (!credentials ||
|
254
|
-
!credentials.id ||
|
255
|
-
!credentials.key ||
|
256
|
-
!credentials.algorithm) {
|
257
|
-
|
258
|
-
return '';
|
259
|
-
}
|
260
|
-
|
261
|
-
if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
|
262
|
-
return '';
|
263
|
-
}
|
264
|
-
|
265
|
-
// Parse URI
|
266
|
-
|
267
|
-
if (typeof uri === 'string') {
|
268
|
-
uri = Url.parse(uri);
|
269
|
-
}
|
270
|
-
|
271
|
-
// Calculate signature
|
272
|
-
|
273
|
-
var exp = Math.floor(now / 1000) + options.ttlSec;
|
274
|
-
var mac = Crypto.calculateMac('bewit', credentials, {
|
275
|
-
ts: exp,
|
276
|
-
nonce: '',
|
277
|
-
method: 'GET',
|
278
|
-
resource: uri.pathname + (uri.search || ''), // Maintain trailing '?'
|
279
|
-
host: uri.hostname,
|
280
|
-
port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
|
281
|
-
ext: options.ext
|
282
|
-
});
|
283
|
-
|
284
|
-
// Construct bewit: id\exp\mac\ext
|
285
|
-
|
286
|
-
var bewit = credentials.id + '\\' + exp + '\\' + mac + '\\' + options.ext;
|
287
|
-
return Utils.base64urlEncode(bewit);
|
288
|
-
};
|
289
|
-
|
290
|
-
|
291
|
-
// Generate an authorization string for a message
|
292
|
-
|
293
|
-
/*
|
294
|
-
host: 'example.com',
|
295
|
-
port: 8000,
|
296
|
-
message: '{"some":"payload"}', // UTF-8 encoded string for body hash generation
|
297
|
-
options: {
|
298
|
-
|
299
|
-
// Required
|
300
|
-
|
301
|
-
credentials: {
|
302
|
-
id: 'dh37fgj492je',
|
303
|
-
key: 'aoijedoaijsdlaksjdl',
|
304
|
-
algorithm: 'sha256' // 'sha1', 'sha256'
|
305
|
-
},
|
306
|
-
|
307
|
-
// Optional
|
308
|
-
|
309
|
-
timestamp: Date.now(), // A pre-calculated timestamp
|
310
|
-
nonce: '2334f34f', // A pre-generated nonce
|
311
|
-
localtimeOffsetMsec: 400, // Time offset to sync with server time (ignored if timestamp provided)
|
312
|
-
}
|
313
|
-
*/
|
314
|
-
|
315
|
-
exports.message = function (host, port, message, options) {
|
316
|
-
|
317
|
-
// Validate inputs
|
318
|
-
|
319
|
-
if (!host || typeof host !== 'string' ||
|
320
|
-
!port || typeof port !== 'number' ||
|
321
|
-
message === null || message === undefined || typeof message !== 'string' ||
|
322
|
-
!options || typeof options !== 'object') {
|
323
|
-
|
324
|
-
return null;
|
325
|
-
}
|
326
|
-
|
327
|
-
// Application time
|
328
|
-
|
329
|
-
var timestamp = options.timestamp || Math.floor((Utils.now() + (options.localtimeOffsetMsec || 0)) / 1000)
|
330
|
-
|
331
|
-
// Validate credentials
|
332
|
-
|
333
|
-
var credentials = options.credentials;
|
334
|
-
if (!credentials ||
|
335
|
-
!credentials.id ||
|
336
|
-
!credentials.key ||
|
337
|
-
!credentials.algorithm) {
|
338
|
-
|
339
|
-
// Invalid credential object
|
340
|
-
return null;
|
341
|
-
}
|
342
|
-
|
343
|
-
if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
|
344
|
-
return null;
|
345
|
-
}
|
346
|
-
|
347
|
-
// Calculate signature
|
348
|
-
|
349
|
-
var artifacts = {
|
350
|
-
ts: timestamp,
|
351
|
-
nonce: options.nonce || Cryptiles.randomString(6),
|
352
|
-
host: host,
|
353
|
-
port: port,
|
354
|
-
hash: Crypto.calculatePayloadHash(message, credentials.algorithm)
|
355
|
-
};
|
356
|
-
|
357
|
-
// Construct authorization
|
358
|
-
|
359
|
-
var result = {
|
360
|
-
id: credentials.id,
|
361
|
-
ts: artifacts.ts,
|
362
|
-
nonce: artifacts.nonce,
|
363
|
-
hash: artifacts.hash,
|
364
|
-
mac: Crypto.calculateMac('message', credentials, artifacts)
|
365
|
-
};
|
366
|
-
|
367
|
-
return result;
|
368
|
-
};
|
369
|
-
|
370
|
-
|
371
|
-
|
@@ -1,118 +0,0 @@
|
|
1
|
-
// Load modules
|
2
|
-
|
3
|
-
var Crypto = require('crypto');
|
4
|
-
var Url = require('url');
|
5
|
-
var Utils = require('./utils');
|
6
|
-
|
7
|
-
|
8
|
-
// Declare internals
|
9
|
-
|
10
|
-
var internals = {};
|
11
|
-
|
12
|
-
|
13
|
-
// MAC normalization format version
|
14
|
-
|
15
|
-
exports.headerVersion = '1'; // Prevent comparison of mac values generated with different normalized string formats
|
16
|
-
|
17
|
-
|
18
|
-
// Supported HMAC algorithms
|
19
|
-
|
20
|
-
exports.algorithms = ['sha1', 'sha256'];
|
21
|
-
|
22
|
-
|
23
|
-
// Calculate the request MAC
|
24
|
-
|
25
|
-
/*
|
26
|
-
type: 'header', // 'header', 'bewit', 'response'
|
27
|
-
credentials: {
|
28
|
-
key: 'aoijedoaijsdlaksjdl',
|
29
|
-
algorithm: 'sha256' // 'sha1', 'sha256'
|
30
|
-
},
|
31
|
-
options: {
|
32
|
-
method: 'GET',
|
33
|
-
resource: '/resource?a=1&b=2',
|
34
|
-
host: 'example.com',
|
35
|
-
port: 8080,
|
36
|
-
ts: 1357718381034,
|
37
|
-
nonce: 'd3d345f',
|
38
|
-
hash: 'U4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=',
|
39
|
-
ext: 'app-specific-data',
|
40
|
-
app: 'hf48hd83qwkj', // Application id (Oz)
|
41
|
-
dlg: 'd8djwekds9cj' // Delegated by application id (Oz), requires options.app
|
42
|
-
}
|
43
|
-
*/
|
44
|
-
|
45
|
-
exports.calculateMac = function (type, credentials, options) {
|
46
|
-
|
47
|
-
var normalized = exports.generateNormalizedString(type, options);
|
48
|
-
|
49
|
-
var hmac = Crypto.createHmac(credentials.algorithm, credentials.key).update(normalized);
|
50
|
-
var digest = hmac.digest('base64');
|
51
|
-
return digest;
|
52
|
-
};
|
53
|
-
|
54
|
-
|
55
|
-
exports.generateNormalizedString = function (type, options) {
|
56
|
-
|
57
|
-
var normalized = 'hawk.' + exports.headerVersion + '.' + type + '\n' +
|
58
|
-
options.ts + '\n' +
|
59
|
-
options.nonce + '\n' +
|
60
|
-
(options.method || '').toUpperCase() + '\n' +
|
61
|
-
(options.resource || '') + '\n' +
|
62
|
-
options.host.toLowerCase() + '\n' +
|
63
|
-
options.port + '\n' +
|
64
|
-
(options.hash || '') + '\n';
|
65
|
-
|
66
|
-
if (options.ext) {
|
67
|
-
normalized += options.ext.replace('\\', '\\\\').replace('\n', '\\n');
|
68
|
-
}
|
69
|
-
|
70
|
-
normalized += '\n';
|
71
|
-
|
72
|
-
if (options.app) {
|
73
|
-
normalized += options.app + '\n' +
|
74
|
-
(options.dlg || '') + '\n';
|
75
|
-
}
|
76
|
-
|
77
|
-
return normalized;
|
78
|
-
};
|
79
|
-
|
80
|
-
|
81
|
-
exports.calculatePayloadHash = function (payload, algorithm, contentType) {
|
82
|
-
|
83
|
-
var hash = exports.initializePayloadHash(algorithm, contentType);
|
84
|
-
hash.update(payload || '');
|
85
|
-
return exports.finalizePayloadHash(hash);
|
86
|
-
};
|
87
|
-
|
88
|
-
|
89
|
-
exports.initializePayloadHash = function (algorithm, contentType) {
|
90
|
-
|
91
|
-
var hash = Crypto.createHash(algorithm);
|
92
|
-
hash.update('hawk.' + exports.headerVersion + '.payload\n');
|
93
|
-
hash.update(Utils.parseContentType(contentType) + '\n');
|
94
|
-
return hash;
|
95
|
-
};
|
96
|
-
|
97
|
-
|
98
|
-
exports.finalizePayloadHash = function (hash) {
|
99
|
-
|
100
|
-
hash.update('\n');
|
101
|
-
return hash.digest('base64');
|
102
|
-
};
|
103
|
-
|
104
|
-
|
105
|
-
exports.calculateTsMac = function (ts, credentials) {
|
106
|
-
|
107
|
-
var hmac = Crypto.createHmac(credentials.algorithm, credentials.key);
|
108
|
-
hmac.update('hawk.' + exports.headerVersion + '.ts\n' + ts + '\n');
|
109
|
-
return hmac.digest('base64');
|
110
|
-
};
|
111
|
-
|
112
|
-
|
113
|
-
exports.timestampMessage = function (credentials, localtimeOffsetMsec) {
|
114
|
-
|
115
|
-
var now = Math.floor((Utils.now() + (localtimeOffsetMsec || 0)) / 1000);
|
116
|
-
var tsm = exports.calculateTsMac(now, credentials);
|
117
|
-
return { ts: now, tsm: tsm };
|
118
|
-
};
|
@@ -1,15 +0,0 @@
|
|
1
|
-
// Export sub-modules
|
2
|
-
|
3
|
-
exports.error = exports.Error = require('boom');
|
4
|
-
exports.sntp = require('sntp');
|
5
|
-
|
6
|
-
exports.server = require('./server');
|
7
|
-
exports.client = require('./client');
|
8
|
-
exports.crypto = require('./crypto');
|
9
|
-
exports.utils = require('./utils');
|
10
|
-
|
11
|
-
exports.uri = {
|
12
|
-
authenticate: exports.server.authenticateBewit,
|
13
|
-
getBewit: exports.client.getBewit
|
14
|
-
};
|
15
|
-
|