ppi-sdk 1.0.0 → 1.1.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/README.md +22 -0
- package/console.log(' +0 -0
- package/console.log('Import +0 -0
- package/package.json +2 -1
- package/src/README.md +13 -0
- package/{ppi-api/node_modules/.package-lock.json → tools/package-lock.json} +827 -847
- package/tools/package.json +17 -0
- package/tools/playground-static/index.html +666 -0
- package/tools/ppi-bridge.js +268 -0
- package/tools/ppi-playground-server.js +273 -0
- package/tools/ppi-playground.js +260 -91
- package/tools/simple-server.js +66 -0
- package/ppi-api/node_modules/.bin/mime +0 -16
- package/ppi-api/node_modules/.bin/mime.cmd +0 -17
- package/ppi-api/node_modules/.bin/mime.ps1 +0 -28
- package/ppi-api/node_modules/accepts/HISTORY.md +0 -243
- package/ppi-api/node_modules/accepts/LICENSE +0 -23
- package/ppi-api/node_modules/accepts/README.md +0 -140
- package/ppi-api/node_modules/accepts/index.js +0 -238
- package/ppi-api/node_modules/accepts/package.json +0 -47
- package/ppi-api/node_modules/array-flatten/LICENSE +0 -21
- package/ppi-api/node_modules/array-flatten/README.md +0 -43
- package/ppi-api/node_modules/array-flatten/array-flatten.js +0 -64
- package/ppi-api/node_modules/array-flatten/package.json +0 -39
- package/ppi-api/node_modules/body-parser/HISTORY.md +0 -672
- package/ppi-api/node_modules/body-parser/LICENSE +0 -23
- package/ppi-api/node_modules/body-parser/README.md +0 -476
- package/ppi-api/node_modules/body-parser/SECURITY.md +0 -25
- package/ppi-api/node_modules/body-parser/index.js +0 -156
- package/ppi-api/node_modules/body-parser/lib/read.js +0 -205
- package/ppi-api/node_modules/body-parser/lib/types/json.js +0 -247
- package/ppi-api/node_modules/body-parser/lib/types/raw.js +0 -101
- package/ppi-api/node_modules/body-parser/lib/types/text.js +0 -121
- package/ppi-api/node_modules/body-parser/lib/types/urlencoded.js +0 -307
- package/ppi-api/node_modules/body-parser/package.json +0 -56
- package/ppi-api/node_modules/bytes/History.md +0 -97
- package/ppi-api/node_modules/bytes/LICENSE +0 -23
- package/ppi-api/node_modules/bytes/Readme.md +0 -152
- package/ppi-api/node_modules/bytes/index.js +0 -170
- package/ppi-api/node_modules/bytes/package.json +0 -42
- package/ppi-api/node_modules/call-bind-apply-helpers/.eslintrc +0 -17
- package/ppi-api/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/call-bind-apply-helpers/.nycrc +0 -9
- package/ppi-api/node_modules/call-bind-apply-helpers/CHANGELOG.md +0 -30
- package/ppi-api/node_modules/call-bind-apply-helpers/LICENSE +0 -21
- package/ppi-api/node_modules/call-bind-apply-helpers/README.md +0 -62
- package/ppi-api/node_modules/call-bind-apply-helpers/actualApply.d.ts +0 -1
- package/ppi-api/node_modules/call-bind-apply-helpers/actualApply.js +0 -10
- package/ppi-api/node_modules/call-bind-apply-helpers/applyBind.d.ts +0 -19
- package/ppi-api/node_modules/call-bind-apply-helpers/applyBind.js +0 -10
- package/ppi-api/node_modules/call-bind-apply-helpers/functionApply.d.ts +0 -1
- package/ppi-api/node_modules/call-bind-apply-helpers/functionApply.js +0 -4
- package/ppi-api/node_modules/call-bind-apply-helpers/functionCall.d.ts +0 -1
- package/ppi-api/node_modules/call-bind-apply-helpers/functionCall.js +0 -4
- package/ppi-api/node_modules/call-bind-apply-helpers/index.d.ts +0 -64
- package/ppi-api/node_modules/call-bind-apply-helpers/index.js +0 -15
- package/ppi-api/node_modules/call-bind-apply-helpers/package.json +0 -85
- package/ppi-api/node_modules/call-bind-apply-helpers/reflectApply.d.ts +0 -3
- package/ppi-api/node_modules/call-bind-apply-helpers/reflectApply.js +0 -4
- package/ppi-api/node_modules/call-bind-apply-helpers/test/index.js +0 -63
- package/ppi-api/node_modules/call-bind-apply-helpers/tsconfig.json +0 -9
- package/ppi-api/node_modules/call-bound/.eslintrc +0 -13
- package/ppi-api/node_modules/call-bound/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/call-bound/.nycrc +0 -9
- package/ppi-api/node_modules/call-bound/CHANGELOG.md +0 -42
- package/ppi-api/node_modules/call-bound/LICENSE +0 -21
- package/ppi-api/node_modules/call-bound/README.md +0 -53
- package/ppi-api/node_modules/call-bound/index.d.ts +0 -94
- package/ppi-api/node_modules/call-bound/index.js +0 -19
- package/ppi-api/node_modules/call-bound/package.json +0 -99
- package/ppi-api/node_modules/call-bound/test/index.js +0 -61
- package/ppi-api/node_modules/call-bound/tsconfig.json +0 -10
- package/ppi-api/node_modules/content-disposition/HISTORY.md +0 -60
- package/ppi-api/node_modules/content-disposition/LICENSE +0 -22
- package/ppi-api/node_modules/content-disposition/README.md +0 -142
- package/ppi-api/node_modules/content-disposition/index.js +0 -458
- package/ppi-api/node_modules/content-disposition/package.json +0 -44
- package/ppi-api/node_modules/content-type/HISTORY.md +0 -29
- package/ppi-api/node_modules/content-type/LICENSE +0 -22
- package/ppi-api/node_modules/content-type/README.md +0 -94
- package/ppi-api/node_modules/content-type/index.js +0 -225
- package/ppi-api/node_modules/content-type/package.json +0 -42
- package/ppi-api/node_modules/cookie/LICENSE +0 -24
- package/ppi-api/node_modules/cookie/README.md +0 -317
- package/ppi-api/node_modules/cookie/SECURITY.md +0 -25
- package/ppi-api/node_modules/cookie/index.js +0 -334
- package/ppi-api/node_modules/cookie/package.json +0 -44
- package/ppi-api/node_modules/cookie-signature/History.md +0 -38
- package/ppi-api/node_modules/cookie-signature/Readme.md +0 -42
- package/ppi-api/node_modules/cookie-signature/index.js +0 -51
- package/ppi-api/node_modules/cookie-signature/package.json +0 -18
- package/ppi-api/node_modules/cors/CONTRIBUTING.md +0 -33
- package/ppi-api/node_modules/cors/HISTORY.md +0 -58
- package/ppi-api/node_modules/cors/LICENSE +0 -22
- package/ppi-api/node_modules/cors/README.md +0 -243
- package/ppi-api/node_modules/cors/lib/index.js +0 -238
- package/ppi-api/node_modules/cors/package.json +0 -41
- package/ppi-api/node_modules/debug/.coveralls.yml +0 -1
- package/ppi-api/node_modules/debug/.eslintrc +0 -11
- package/ppi-api/node_modules/debug/.travis.yml +0 -14
- package/ppi-api/node_modules/debug/CHANGELOG.md +0 -362
- package/ppi-api/node_modules/debug/LICENSE +0 -19
- package/ppi-api/node_modules/debug/Makefile +0 -50
- package/ppi-api/node_modules/debug/README.md +0 -312
- package/ppi-api/node_modules/debug/component.json +0 -19
- package/ppi-api/node_modules/debug/karma.conf.js +0 -70
- package/ppi-api/node_modules/debug/node.js +0 -1
- package/ppi-api/node_modules/debug/package.json +0 -49
- package/ppi-api/node_modules/debug/src/browser.js +0 -185
- package/ppi-api/node_modules/debug/src/debug.js +0 -202
- package/ppi-api/node_modules/debug/src/index.js +0 -10
- package/ppi-api/node_modules/debug/src/inspector-log.js +0 -15
- package/ppi-api/node_modules/debug/src/node.js +0 -248
- package/ppi-api/node_modules/depd/History.md +0 -103
- package/ppi-api/node_modules/depd/LICENSE +0 -22
- package/ppi-api/node_modules/depd/Readme.md +0 -280
- package/ppi-api/node_modules/depd/index.js +0 -538
- package/ppi-api/node_modules/depd/lib/browser/index.js +0 -77
- package/ppi-api/node_modules/depd/package.json +0 -45
- package/ppi-api/node_modules/destroy/LICENSE +0 -23
- package/ppi-api/node_modules/destroy/README.md +0 -63
- package/ppi-api/node_modules/destroy/index.js +0 -209
- package/ppi-api/node_modules/destroy/package.json +0 -48
- package/ppi-api/node_modules/dunder-proto/.eslintrc +0 -5
- package/ppi-api/node_modules/dunder-proto/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/dunder-proto/.nycrc +0 -13
- package/ppi-api/node_modules/dunder-proto/CHANGELOG.md +0 -24
- package/ppi-api/node_modules/dunder-proto/LICENSE +0 -21
- package/ppi-api/node_modules/dunder-proto/README.md +0 -54
- package/ppi-api/node_modules/dunder-proto/get.d.ts +0 -5
- package/ppi-api/node_modules/dunder-proto/get.js +0 -30
- package/ppi-api/node_modules/dunder-proto/package.json +0 -76
- package/ppi-api/node_modules/dunder-proto/set.d.ts +0 -5
- package/ppi-api/node_modules/dunder-proto/set.js +0 -35
- package/ppi-api/node_modules/dunder-proto/test/get.js +0 -34
- package/ppi-api/node_modules/dunder-proto/test/index.js +0 -4
- package/ppi-api/node_modules/dunder-proto/test/set.js +0 -50
- package/ppi-api/node_modules/dunder-proto/tsconfig.json +0 -9
- package/ppi-api/node_modules/ee-first/LICENSE +0 -22
- package/ppi-api/node_modules/ee-first/README.md +0 -80
- package/ppi-api/node_modules/ee-first/index.js +0 -95
- package/ppi-api/node_modules/ee-first/package.json +0 -29
- package/ppi-api/node_modules/encodeurl/LICENSE +0 -22
- package/ppi-api/node_modules/encodeurl/README.md +0 -109
- package/ppi-api/node_modules/encodeurl/index.js +0 -60
- package/ppi-api/node_modules/encodeurl/package.json +0 -40
- package/ppi-api/node_modules/es-define-property/.eslintrc +0 -13
- package/ppi-api/node_modules/es-define-property/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/es-define-property/.nycrc +0 -9
- package/ppi-api/node_modules/es-define-property/CHANGELOG.md +0 -29
- package/ppi-api/node_modules/es-define-property/LICENSE +0 -21
- package/ppi-api/node_modules/es-define-property/README.md +0 -49
- package/ppi-api/node_modules/es-define-property/index.d.ts +0 -3
- package/ppi-api/node_modules/es-define-property/index.js +0 -14
- package/ppi-api/node_modules/es-define-property/package.json +0 -81
- package/ppi-api/node_modules/es-define-property/test/index.js +0 -56
- package/ppi-api/node_modules/es-define-property/tsconfig.json +0 -10
- package/ppi-api/node_modules/es-errors/.eslintrc +0 -5
- package/ppi-api/node_modules/es-errors/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/es-errors/CHANGELOG.md +0 -40
- package/ppi-api/node_modules/es-errors/LICENSE +0 -21
- package/ppi-api/node_modules/es-errors/README.md +0 -55
- package/ppi-api/node_modules/es-errors/eval.d.ts +0 -3
- package/ppi-api/node_modules/es-errors/eval.js +0 -4
- package/ppi-api/node_modules/es-errors/index.d.ts +0 -3
- package/ppi-api/node_modules/es-errors/index.js +0 -4
- package/ppi-api/node_modules/es-errors/package.json +0 -80
- package/ppi-api/node_modules/es-errors/range.d.ts +0 -3
- package/ppi-api/node_modules/es-errors/range.js +0 -4
- package/ppi-api/node_modules/es-errors/ref.d.ts +0 -3
- package/ppi-api/node_modules/es-errors/ref.js +0 -4
- package/ppi-api/node_modules/es-errors/syntax.d.ts +0 -3
- package/ppi-api/node_modules/es-errors/syntax.js +0 -4
- package/ppi-api/node_modules/es-errors/test/index.js +0 -19
- package/ppi-api/node_modules/es-errors/tsconfig.json +0 -49
- package/ppi-api/node_modules/es-errors/type.d.ts +0 -3
- package/ppi-api/node_modules/es-errors/type.js +0 -4
- package/ppi-api/node_modules/es-errors/uri.d.ts +0 -3
- package/ppi-api/node_modules/es-errors/uri.js +0 -4
- package/ppi-api/node_modules/es-object-atoms/.eslintrc +0 -16
- package/ppi-api/node_modules/es-object-atoms/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/es-object-atoms/CHANGELOG.md +0 -37
- package/ppi-api/node_modules/es-object-atoms/LICENSE +0 -21
- package/ppi-api/node_modules/es-object-atoms/README.md +0 -63
- package/ppi-api/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +0 -3
- package/ppi-api/node_modules/es-object-atoms/RequireObjectCoercible.js +0 -11
- package/ppi-api/node_modules/es-object-atoms/ToObject.d.ts +0 -7
- package/ppi-api/node_modules/es-object-atoms/ToObject.js +0 -10
- package/ppi-api/node_modules/es-object-atoms/index.d.ts +0 -3
- package/ppi-api/node_modules/es-object-atoms/index.js +0 -4
- package/ppi-api/node_modules/es-object-atoms/isObject.d.ts +0 -3
- package/ppi-api/node_modules/es-object-atoms/isObject.js +0 -6
- package/ppi-api/node_modules/es-object-atoms/package.json +0 -80
- package/ppi-api/node_modules/es-object-atoms/test/index.js +0 -38
- package/ppi-api/node_modules/es-object-atoms/tsconfig.json +0 -6
- package/ppi-api/node_modules/escape-html/LICENSE +0 -24
- package/ppi-api/node_modules/escape-html/Readme.md +0 -43
- package/ppi-api/node_modules/escape-html/index.js +0 -78
- package/ppi-api/node_modules/escape-html/package.json +0 -24
- package/ppi-api/node_modules/etag/HISTORY.md +0 -83
- package/ppi-api/node_modules/etag/LICENSE +0 -22
- package/ppi-api/node_modules/etag/README.md +0 -159
- package/ppi-api/node_modules/etag/index.js +0 -131
- package/ppi-api/node_modules/etag/package.json +0 -47
- package/ppi-api/node_modules/express/History.md +0 -3656
- package/ppi-api/node_modules/express/LICENSE +0 -24
- package/ppi-api/node_modules/express/Readme.md +0 -260
- package/ppi-api/node_modules/express/index.js +0 -11
- package/ppi-api/node_modules/express/lib/application.js +0 -661
- package/ppi-api/node_modules/express/lib/express.js +0 -116
- package/ppi-api/node_modules/express/lib/middleware/init.js +0 -43
- package/ppi-api/node_modules/express/lib/middleware/query.js +0 -47
- package/ppi-api/node_modules/express/lib/request.js +0 -525
- package/ppi-api/node_modules/express/lib/response.js +0 -1179
- package/ppi-api/node_modules/express/lib/router/index.js +0 -673
- package/ppi-api/node_modules/express/lib/router/layer.js +0 -181
- package/ppi-api/node_modules/express/lib/router/route.js +0 -230
- package/ppi-api/node_modules/express/lib/utils.js +0 -303
- package/ppi-api/node_modules/express/lib/view.js +0 -182
- package/ppi-api/node_modules/express/package.json +0 -102
- package/ppi-api/node_modules/finalhandler/HISTORY.md +0 -210
- package/ppi-api/node_modules/finalhandler/LICENSE +0 -22
- package/ppi-api/node_modules/finalhandler/README.md +0 -147
- package/ppi-api/node_modules/finalhandler/SECURITY.md +0 -25
- package/ppi-api/node_modules/finalhandler/index.js +0 -341
- package/ppi-api/node_modules/finalhandler/package.json +0 -47
- package/ppi-api/node_modules/forwarded/HISTORY.md +0 -21
- package/ppi-api/node_modules/forwarded/LICENSE +0 -22
- package/ppi-api/node_modules/forwarded/README.md +0 -57
- package/ppi-api/node_modules/forwarded/index.js +0 -90
- package/ppi-api/node_modules/forwarded/package.json +0 -45
- package/ppi-api/node_modules/fresh/HISTORY.md +0 -70
- package/ppi-api/node_modules/fresh/LICENSE +0 -23
- package/ppi-api/node_modules/fresh/README.md +0 -119
- package/ppi-api/node_modules/fresh/index.js +0 -137
- package/ppi-api/node_modules/fresh/package.json +0 -46
- package/ppi-api/node_modules/function-bind/.eslintrc +0 -21
- package/ppi-api/node_modules/function-bind/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/function-bind/.github/SECURITY.md +0 -3
- package/ppi-api/node_modules/function-bind/.nycrc +0 -13
- package/ppi-api/node_modules/function-bind/CHANGELOG.md +0 -136
- package/ppi-api/node_modules/function-bind/LICENSE +0 -20
- package/ppi-api/node_modules/function-bind/README.md +0 -46
- package/ppi-api/node_modules/function-bind/implementation.js +0 -84
- package/ppi-api/node_modules/function-bind/index.js +0 -5
- package/ppi-api/node_modules/function-bind/package.json +0 -87
- package/ppi-api/node_modules/function-bind/test/.eslintrc +0 -9
- package/ppi-api/node_modules/function-bind/test/index.js +0 -252
- package/ppi-api/node_modules/get-intrinsic/.eslintrc +0 -42
- package/ppi-api/node_modules/get-intrinsic/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/get-intrinsic/.nycrc +0 -9
- package/ppi-api/node_modules/get-intrinsic/CHANGELOG.md +0 -186
- package/ppi-api/node_modules/get-intrinsic/LICENSE +0 -21
- package/ppi-api/node_modules/get-intrinsic/README.md +0 -71
- package/ppi-api/node_modules/get-intrinsic/index.js +0 -378
- package/ppi-api/node_modules/get-intrinsic/package.json +0 -97
- package/ppi-api/node_modules/get-intrinsic/test/GetIntrinsic.js +0 -274
- package/ppi-api/node_modules/get-proto/.eslintrc +0 -10
- package/ppi-api/node_modules/get-proto/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/get-proto/.nycrc +0 -9
- package/ppi-api/node_modules/get-proto/CHANGELOG.md +0 -21
- package/ppi-api/node_modules/get-proto/LICENSE +0 -21
- package/ppi-api/node_modules/get-proto/Object.getPrototypeOf.d.ts +0 -5
- package/ppi-api/node_modules/get-proto/Object.getPrototypeOf.js +0 -6
- package/ppi-api/node_modules/get-proto/README.md +0 -50
- package/ppi-api/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +0 -3
- package/ppi-api/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -4
- package/ppi-api/node_modules/get-proto/index.d.ts +0 -5
- package/ppi-api/node_modules/get-proto/index.js +0 -27
- package/ppi-api/node_modules/get-proto/package.json +0 -81
- package/ppi-api/node_modules/get-proto/test/index.js +0 -68
- package/ppi-api/node_modules/get-proto/tsconfig.json +0 -9
- package/ppi-api/node_modules/gopd/.eslintrc +0 -16
- package/ppi-api/node_modules/gopd/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/gopd/CHANGELOG.md +0 -45
- package/ppi-api/node_modules/gopd/LICENSE +0 -21
- package/ppi-api/node_modules/gopd/README.md +0 -40
- package/ppi-api/node_modules/gopd/gOPD.d.ts +0 -1
- package/ppi-api/node_modules/gopd/gOPD.js +0 -4
- package/ppi-api/node_modules/gopd/index.d.ts +0 -5
- package/ppi-api/node_modules/gopd/index.js +0 -15
- package/ppi-api/node_modules/gopd/package.json +0 -77
- package/ppi-api/node_modules/gopd/test/index.js +0 -36
- package/ppi-api/node_modules/gopd/tsconfig.json +0 -9
- package/ppi-api/node_modules/has-symbols/.eslintrc +0 -11
- package/ppi-api/node_modules/has-symbols/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/has-symbols/.nycrc +0 -9
- package/ppi-api/node_modules/has-symbols/CHANGELOG.md +0 -91
- package/ppi-api/node_modules/has-symbols/LICENSE +0 -21
- package/ppi-api/node_modules/has-symbols/README.md +0 -46
- package/ppi-api/node_modules/has-symbols/index.d.ts +0 -3
- package/ppi-api/node_modules/has-symbols/index.js +0 -14
- package/ppi-api/node_modules/has-symbols/package.json +0 -111
- package/ppi-api/node_modules/has-symbols/shams.d.ts +0 -3
- package/ppi-api/node_modules/has-symbols/shams.js +0 -45
- package/ppi-api/node_modules/has-symbols/test/index.js +0 -22
- package/ppi-api/node_modules/has-symbols/test/shams/core-js.js +0 -29
- package/ppi-api/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -29
- package/ppi-api/node_modules/has-symbols/test/tests.js +0 -58
- package/ppi-api/node_modules/has-symbols/tsconfig.json +0 -10
- package/ppi-api/node_modules/hasown/.eslintrc +0 -5
- package/ppi-api/node_modules/hasown/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/hasown/.nycrc +0 -13
- package/ppi-api/node_modules/hasown/CHANGELOG.md +0 -40
- package/ppi-api/node_modules/hasown/LICENSE +0 -21
- package/ppi-api/node_modules/hasown/README.md +0 -40
- package/ppi-api/node_modules/hasown/index.d.ts +0 -3
- package/ppi-api/node_modules/hasown/index.js +0 -8
- package/ppi-api/node_modules/hasown/package.json +0 -92
- package/ppi-api/node_modules/hasown/tsconfig.json +0 -6
- package/ppi-api/node_modules/http-errors/HISTORY.md +0 -180
- package/ppi-api/node_modules/http-errors/LICENSE +0 -23
- package/ppi-api/node_modules/http-errors/README.md +0 -169
- package/ppi-api/node_modules/http-errors/index.js +0 -289
- package/ppi-api/node_modules/http-errors/package.json +0 -50
- package/ppi-api/node_modules/iconv-lite/Changelog.md +0 -162
- package/ppi-api/node_modules/iconv-lite/LICENSE +0 -21
- package/ppi-api/node_modules/iconv-lite/README.md +0 -156
- package/ppi-api/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -555
- package/ppi-api/node_modules/iconv-lite/encodings/dbcs-data.js +0 -176
- package/ppi-api/node_modules/iconv-lite/encodings/index.js +0 -22
- package/ppi-api/node_modules/iconv-lite/encodings/internal.js +0 -188
- package/ppi-api/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
- package/ppi-api/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
- package/ppi-api/node_modules/iconv-lite/encodings/sbcs-data.js +0 -174
- package/ppi-api/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
- package/ppi-api/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
- package/ppi-api/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
- package/ppi-api/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
- package/ppi-api/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
- package/ppi-api/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
- package/ppi-api/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -55
- package/ppi-api/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
- package/ppi-api/node_modules/iconv-lite/encodings/utf16.js +0 -177
- package/ppi-api/node_modules/iconv-lite/encodings/utf7.js +0 -290
- package/ppi-api/node_modules/iconv-lite/lib/bom-handling.js +0 -52
- package/ppi-api/node_modules/iconv-lite/lib/extend-node.js +0 -217
- package/ppi-api/node_modules/iconv-lite/lib/index.d.ts +0 -24
- package/ppi-api/node_modules/iconv-lite/lib/index.js +0 -153
- package/ppi-api/node_modules/iconv-lite/lib/streams.js +0 -121
- package/ppi-api/node_modules/iconv-lite/package.json +0 -46
- package/ppi-api/node_modules/inherits/LICENSE +0 -16
- package/ppi-api/node_modules/inherits/README.md +0 -42
- package/ppi-api/node_modules/inherits/inherits.js +0 -9
- package/ppi-api/node_modules/inherits/inherits_browser.js +0 -27
- package/ppi-api/node_modules/inherits/package.json +0 -29
- package/ppi-api/node_modules/ipaddr.js/LICENSE +0 -19
- package/ppi-api/node_modules/ipaddr.js/README.md +0 -233
- package/ppi-api/node_modules/ipaddr.js/ipaddr.min.js +0 -1
- package/ppi-api/node_modules/ipaddr.js/lib/ipaddr.js +0 -673
- package/ppi-api/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +0 -68
- package/ppi-api/node_modules/ipaddr.js/package.json +0 -35
- package/ppi-api/node_modules/math-intrinsics/.eslintrc +0 -16
- package/ppi-api/node_modules/math-intrinsics/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/math-intrinsics/CHANGELOG.md +0 -24
- package/ppi-api/node_modules/math-intrinsics/LICENSE +0 -21
- package/ppi-api/node_modules/math-intrinsics/README.md +0 -50
- package/ppi-api/node_modules/math-intrinsics/abs.d.ts +0 -1
- package/ppi-api/node_modules/math-intrinsics/abs.js +0 -4
- package/ppi-api/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +0 -3
- package/ppi-api/node_modules/math-intrinsics/constants/maxArrayLength.js +0 -4
- package/ppi-api/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +0 -3
- package/ppi-api/node_modules/math-intrinsics/constants/maxSafeInteger.js +0 -5
- package/ppi-api/node_modules/math-intrinsics/constants/maxValue.d.ts +0 -3
- package/ppi-api/node_modules/math-intrinsics/constants/maxValue.js +0 -5
- package/ppi-api/node_modules/math-intrinsics/floor.d.ts +0 -1
- package/ppi-api/node_modules/math-intrinsics/floor.js +0 -4
- package/ppi-api/node_modules/math-intrinsics/isFinite.d.ts +0 -3
- package/ppi-api/node_modules/math-intrinsics/isFinite.js +0 -12
- package/ppi-api/node_modules/math-intrinsics/isInteger.d.ts +0 -3
- package/ppi-api/node_modules/math-intrinsics/isInteger.js +0 -16
- package/ppi-api/node_modules/math-intrinsics/isNaN.d.ts +0 -1
- package/ppi-api/node_modules/math-intrinsics/isNaN.js +0 -6
- package/ppi-api/node_modules/math-intrinsics/isNegativeZero.d.ts +0 -3
- package/ppi-api/node_modules/math-intrinsics/isNegativeZero.js +0 -6
- package/ppi-api/node_modules/math-intrinsics/max.d.ts +0 -1
- package/ppi-api/node_modules/math-intrinsics/max.js +0 -4
- package/ppi-api/node_modules/math-intrinsics/min.d.ts +0 -1
- package/ppi-api/node_modules/math-intrinsics/min.js +0 -4
- package/ppi-api/node_modules/math-intrinsics/mod.d.ts +0 -3
- package/ppi-api/node_modules/math-intrinsics/mod.js +0 -9
- package/ppi-api/node_modules/math-intrinsics/package.json +0 -86
- package/ppi-api/node_modules/math-intrinsics/pow.d.ts +0 -1
- package/ppi-api/node_modules/math-intrinsics/pow.js +0 -4
- package/ppi-api/node_modules/math-intrinsics/round.d.ts +0 -1
- package/ppi-api/node_modules/math-intrinsics/round.js +0 -4
- package/ppi-api/node_modules/math-intrinsics/sign.d.ts +0 -3
- package/ppi-api/node_modules/math-intrinsics/sign.js +0 -11
- package/ppi-api/node_modules/math-intrinsics/test/index.js +0 -192
- package/ppi-api/node_modules/math-intrinsics/tsconfig.json +0 -3
- package/ppi-api/node_modules/media-typer/HISTORY.md +0 -22
- package/ppi-api/node_modules/media-typer/LICENSE +0 -22
- package/ppi-api/node_modules/media-typer/README.md +0 -81
- package/ppi-api/node_modules/media-typer/index.js +0 -270
- package/ppi-api/node_modules/media-typer/package.json +0 -26
- package/ppi-api/node_modules/merge-descriptors/HISTORY.md +0 -21
- package/ppi-api/node_modules/merge-descriptors/LICENSE +0 -23
- package/ppi-api/node_modules/merge-descriptors/README.md +0 -49
- package/ppi-api/node_modules/merge-descriptors/index.js +0 -60
- package/ppi-api/node_modules/merge-descriptors/package.json +0 -39
- package/ppi-api/node_modules/methods/HISTORY.md +0 -29
- package/ppi-api/node_modules/methods/LICENSE +0 -24
- package/ppi-api/node_modules/methods/README.md +0 -51
- package/ppi-api/node_modules/methods/index.js +0 -69
- package/ppi-api/node_modules/methods/package.json +0 -36
- package/ppi-api/node_modules/mime/CHANGELOG.md +0 -164
- package/ppi-api/node_modules/mime/LICENSE +0 -21
- package/ppi-api/node_modules/mime/README.md +0 -90
- package/ppi-api/node_modules/mime/cli.js +0 -8
- package/ppi-api/node_modules/mime/mime.js +0 -108
- package/ppi-api/node_modules/mime/package.json +0 -44
- package/ppi-api/node_modules/mime/src/build.js +0 -53
- package/ppi-api/node_modules/mime/src/test.js +0 -60
- package/ppi-api/node_modules/mime/types.json +0 -1
- package/ppi-api/node_modules/mime-db/HISTORY.md +0 -507
- package/ppi-api/node_modules/mime-db/LICENSE +0 -23
- package/ppi-api/node_modules/mime-db/README.md +0 -100
- package/ppi-api/node_modules/mime-db/db.json +0 -8519
- package/ppi-api/node_modules/mime-db/index.js +0 -12
- package/ppi-api/node_modules/mime-db/package.json +0 -60
- package/ppi-api/node_modules/mime-types/HISTORY.md +0 -397
- package/ppi-api/node_modules/mime-types/LICENSE +0 -23
- package/ppi-api/node_modules/mime-types/README.md +0 -113
- package/ppi-api/node_modules/mime-types/index.js +0 -188
- package/ppi-api/node_modules/mime-types/package.json +0 -44
- package/ppi-api/node_modules/ms/index.js +0 -152
- package/ppi-api/node_modules/ms/license.md +0 -21
- package/ppi-api/node_modules/ms/package.json +0 -37
- package/ppi-api/node_modules/ms/readme.md +0 -51
- package/ppi-api/node_modules/negotiator/HISTORY.md +0 -108
- package/ppi-api/node_modules/negotiator/LICENSE +0 -24
- package/ppi-api/node_modules/negotiator/README.md +0 -203
- package/ppi-api/node_modules/negotiator/index.js +0 -82
- package/ppi-api/node_modules/negotiator/lib/charset.js +0 -169
- package/ppi-api/node_modules/negotiator/lib/encoding.js +0 -184
- package/ppi-api/node_modules/negotiator/lib/language.js +0 -179
- package/ppi-api/node_modules/negotiator/lib/mediaType.js +0 -294
- package/ppi-api/node_modules/negotiator/package.json +0 -42
- package/ppi-api/node_modules/object-assign/index.js +0 -90
- package/ppi-api/node_modules/object-assign/license +0 -21
- package/ppi-api/node_modules/object-assign/package.json +0 -42
- package/ppi-api/node_modules/object-assign/readme.md +0 -61
- package/ppi-api/node_modules/object-inspect/.eslintrc +0 -53
- package/ppi-api/node_modules/object-inspect/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/object-inspect/.nycrc +0 -13
- package/ppi-api/node_modules/object-inspect/CHANGELOG.md +0 -424
- package/ppi-api/node_modules/object-inspect/LICENSE +0 -21
- package/ppi-api/node_modules/object-inspect/example/all.js +0 -23
- package/ppi-api/node_modules/object-inspect/example/circular.js +0 -6
- package/ppi-api/node_modules/object-inspect/example/fn.js +0 -5
- package/ppi-api/node_modules/object-inspect/example/inspect.js +0 -10
- package/ppi-api/node_modules/object-inspect/index.js +0 -544
- package/ppi-api/node_modules/object-inspect/package-support.json +0 -20
- package/ppi-api/node_modules/object-inspect/package.json +0 -105
- package/ppi-api/node_modules/object-inspect/readme.markdown +0 -84
- package/ppi-api/node_modules/object-inspect/test/bigint.js +0 -58
- package/ppi-api/node_modules/object-inspect/test/browser/dom.js +0 -15
- package/ppi-api/node_modules/object-inspect/test/circular.js +0 -16
- package/ppi-api/node_modules/object-inspect/test/deep.js +0 -12
- package/ppi-api/node_modules/object-inspect/test/element.js +0 -53
- package/ppi-api/node_modules/object-inspect/test/err.js +0 -48
- package/ppi-api/node_modules/object-inspect/test/fakes.js +0 -29
- package/ppi-api/node_modules/object-inspect/test/fn.js +0 -76
- package/ppi-api/node_modules/object-inspect/test/global.js +0 -17
- package/ppi-api/node_modules/object-inspect/test/has.js +0 -15
- package/ppi-api/node_modules/object-inspect/test/holes.js +0 -15
- package/ppi-api/node_modules/object-inspect/test/indent-option.js +0 -271
- package/ppi-api/node_modules/object-inspect/test/inspect.js +0 -139
- package/ppi-api/node_modules/object-inspect/test/lowbyte.js +0 -12
- package/ppi-api/node_modules/object-inspect/test/number.js +0 -58
- package/ppi-api/node_modules/object-inspect/test/quoteStyle.js +0 -26
- package/ppi-api/node_modules/object-inspect/test/toStringTag.js +0 -40
- package/ppi-api/node_modules/object-inspect/test/undef.js +0 -12
- package/ppi-api/node_modules/object-inspect/test/values.js +0 -261
- package/ppi-api/node_modules/object-inspect/test-core-js.js +0 -26
- package/ppi-api/node_modules/object-inspect/util.inspect.js +0 -1
- package/ppi-api/node_modules/on-finished/HISTORY.md +0 -98
- package/ppi-api/node_modules/on-finished/LICENSE +0 -23
- package/ppi-api/node_modules/on-finished/README.md +0 -162
- package/ppi-api/node_modules/on-finished/index.js +0 -234
- package/ppi-api/node_modules/on-finished/package.json +0 -39
- package/ppi-api/node_modules/parseurl/HISTORY.md +0 -58
- package/ppi-api/node_modules/parseurl/LICENSE +0 -24
- package/ppi-api/node_modules/parseurl/README.md +0 -133
- package/ppi-api/node_modules/parseurl/index.js +0 -158
- package/ppi-api/node_modules/parseurl/package.json +0 -40
- package/ppi-api/node_modules/path-to-regexp/LICENSE +0 -21
- package/ppi-api/node_modules/path-to-regexp/Readme.md +0 -35
- package/ppi-api/node_modules/path-to-regexp/index.js +0 -156
- package/ppi-api/node_modules/path-to-regexp/package.json +0 -30
- package/ppi-api/node_modules/proxy-addr/HISTORY.md +0 -161
- package/ppi-api/node_modules/proxy-addr/LICENSE +0 -22
- package/ppi-api/node_modules/proxy-addr/README.md +0 -139
- package/ppi-api/node_modules/proxy-addr/index.js +0 -327
- package/ppi-api/node_modules/proxy-addr/package.json +0 -47
- package/ppi-api/node_modules/qs/.editorconfig +0 -46
- package/ppi-api/node_modules/qs/.eslintrc +0 -38
- package/ppi-api/node_modules/qs/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/qs/.nycrc +0 -13
- package/ppi-api/node_modules/qs/CHANGELOG.md +0 -600
- package/ppi-api/node_modules/qs/LICENSE.md +0 -29
- package/ppi-api/node_modules/qs/README.md +0 -709
- package/ppi-api/node_modules/qs/dist/qs.js +0 -90
- package/ppi-api/node_modules/qs/lib/formats.js +0 -23
- package/ppi-api/node_modules/qs/lib/index.js +0 -11
- package/ppi-api/node_modules/qs/lib/parse.js +0 -296
- package/ppi-api/node_modules/qs/lib/stringify.js +0 -351
- package/ppi-api/node_modules/qs/lib/utils.js +0 -265
- package/ppi-api/node_modules/qs/package.json +0 -91
- package/ppi-api/node_modules/qs/test/empty-keys-cases.js +0 -267
- package/ppi-api/node_modules/qs/test/parse.js +0 -1170
- package/ppi-api/node_modules/qs/test/stringify.js +0 -1298
- package/ppi-api/node_modules/qs/test/utils.js +0 -136
- package/ppi-api/node_modules/range-parser/HISTORY.md +0 -56
- package/ppi-api/node_modules/range-parser/LICENSE +0 -23
- package/ppi-api/node_modules/range-parser/README.md +0 -84
- package/ppi-api/node_modules/range-parser/index.js +0 -162
- package/ppi-api/node_modules/range-parser/package.json +0 -44
- package/ppi-api/node_modules/raw-body/HISTORY.md +0 -308
- package/ppi-api/node_modules/raw-body/LICENSE +0 -22
- package/ppi-api/node_modules/raw-body/README.md +0 -223
- package/ppi-api/node_modules/raw-body/SECURITY.md +0 -24
- package/ppi-api/node_modules/raw-body/index.d.ts +0 -87
- package/ppi-api/node_modules/raw-body/index.js +0 -336
- package/ppi-api/node_modules/raw-body/package.json +0 -49
- package/ppi-api/node_modules/safe-buffer/LICENSE +0 -21
- package/ppi-api/node_modules/safe-buffer/README.md +0 -584
- package/ppi-api/node_modules/safe-buffer/index.d.ts +0 -187
- package/ppi-api/node_modules/safe-buffer/index.js +0 -65
- package/ppi-api/node_modules/safe-buffer/package.json +0 -51
- package/ppi-api/node_modules/safer-buffer/LICENSE +0 -21
- package/ppi-api/node_modules/safer-buffer/Porting-Buffer.md +0 -268
- package/ppi-api/node_modules/safer-buffer/Readme.md +0 -156
- package/ppi-api/node_modules/safer-buffer/dangerous.js +0 -58
- package/ppi-api/node_modules/safer-buffer/package.json +0 -34
- package/ppi-api/node_modules/safer-buffer/safer.js +0 -77
- package/ppi-api/node_modules/safer-buffer/tests.js +0 -406
- package/ppi-api/node_modules/send/HISTORY.md +0 -526
- package/ppi-api/node_modules/send/LICENSE +0 -23
- package/ppi-api/node_modules/send/README.md +0 -327
- package/ppi-api/node_modules/send/SECURITY.md +0 -24
- package/ppi-api/node_modules/send/index.js +0 -1142
- package/ppi-api/node_modules/send/node_modules/encodeurl/HISTORY.md +0 -14
- package/ppi-api/node_modules/send/node_modules/encodeurl/LICENSE +0 -22
- package/ppi-api/node_modules/send/node_modules/encodeurl/README.md +0 -128
- package/ppi-api/node_modules/send/node_modules/encodeurl/index.js +0 -60
- package/ppi-api/node_modules/send/node_modules/encodeurl/package.json +0 -40
- package/ppi-api/node_modules/send/node_modules/ms/index.js +0 -162
- package/ppi-api/node_modules/send/node_modules/ms/license.md +0 -21
- package/ppi-api/node_modules/send/node_modules/ms/package.json +0 -38
- package/ppi-api/node_modules/send/node_modules/ms/readme.md +0 -59
- package/ppi-api/node_modules/send/package.json +0 -62
- package/ppi-api/node_modules/serve-static/HISTORY.md +0 -487
- package/ppi-api/node_modules/serve-static/LICENSE +0 -25
- package/ppi-api/node_modules/serve-static/README.md +0 -257
- package/ppi-api/node_modules/serve-static/index.js +0 -209
- package/ppi-api/node_modules/serve-static/package.json +0 -42
- package/ppi-api/node_modules/setprototypeof/LICENSE +0 -13
- package/ppi-api/node_modules/setprototypeof/README.md +0 -31
- package/ppi-api/node_modules/setprototypeof/index.d.ts +0 -2
- package/ppi-api/node_modules/setprototypeof/index.js +0 -17
- package/ppi-api/node_modules/setprototypeof/package.json +0 -38
- package/ppi-api/node_modules/setprototypeof/test/index.js +0 -24
- package/ppi-api/node_modules/side-channel/.editorconfig +0 -9
- package/ppi-api/node_modules/side-channel/.eslintrc +0 -12
- package/ppi-api/node_modules/side-channel/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/side-channel/.nycrc +0 -13
- package/ppi-api/node_modules/side-channel/CHANGELOG.md +0 -110
- package/ppi-api/node_modules/side-channel/LICENSE +0 -21
- package/ppi-api/node_modules/side-channel/README.md +0 -61
- package/ppi-api/node_modules/side-channel/index.d.ts +0 -14
- package/ppi-api/node_modules/side-channel/index.js +0 -43
- package/ppi-api/node_modules/side-channel/package.json +0 -85
- package/ppi-api/node_modules/side-channel/test/index.js +0 -104
- package/ppi-api/node_modules/side-channel/tsconfig.json +0 -9
- package/ppi-api/node_modules/side-channel-list/.editorconfig +0 -9
- package/ppi-api/node_modules/side-channel-list/.eslintrc +0 -11
- package/ppi-api/node_modules/side-channel-list/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/side-channel-list/.nycrc +0 -13
- package/ppi-api/node_modules/side-channel-list/CHANGELOG.md +0 -15
- package/ppi-api/node_modules/side-channel-list/LICENSE +0 -21
- package/ppi-api/node_modules/side-channel-list/README.md +0 -62
- package/ppi-api/node_modules/side-channel-list/index.d.ts +0 -13
- package/ppi-api/node_modules/side-channel-list/index.js +0 -113
- package/ppi-api/node_modules/side-channel-list/list.d.ts +0 -14
- package/ppi-api/node_modules/side-channel-list/package.json +0 -77
- package/ppi-api/node_modules/side-channel-list/test/index.js +0 -104
- package/ppi-api/node_modules/side-channel-list/tsconfig.json +0 -9
- package/ppi-api/node_modules/side-channel-map/.editorconfig +0 -9
- package/ppi-api/node_modules/side-channel-map/.eslintrc +0 -11
- package/ppi-api/node_modules/side-channel-map/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/side-channel-map/.nycrc +0 -13
- package/ppi-api/node_modules/side-channel-map/CHANGELOG.md +0 -22
- package/ppi-api/node_modules/side-channel-map/LICENSE +0 -21
- package/ppi-api/node_modules/side-channel-map/README.md +0 -62
- package/ppi-api/node_modules/side-channel-map/index.d.ts +0 -15
- package/ppi-api/node_modules/side-channel-map/index.js +0 -68
- package/ppi-api/node_modules/side-channel-map/package.json +0 -80
- package/ppi-api/node_modules/side-channel-map/test/index.js +0 -114
- package/ppi-api/node_modules/side-channel-map/tsconfig.json +0 -9
- package/ppi-api/node_modules/side-channel-weakmap/.editorconfig +0 -9
- package/ppi-api/node_modules/side-channel-weakmap/.eslintrc +0 -12
- package/ppi-api/node_modules/side-channel-weakmap/.github/FUNDING.yml +0 -12
- package/ppi-api/node_modules/side-channel-weakmap/.nycrc +0 -13
- package/ppi-api/node_modules/side-channel-weakmap/CHANGELOG.md +0 -28
- package/ppi-api/node_modules/side-channel-weakmap/LICENSE +0 -21
- package/ppi-api/node_modules/side-channel-weakmap/README.md +0 -62
- package/ppi-api/node_modules/side-channel-weakmap/index.d.ts +0 -15
- package/ppi-api/node_modules/side-channel-weakmap/index.js +0 -84
- package/ppi-api/node_modules/side-channel-weakmap/package.json +0 -87
- package/ppi-api/node_modules/side-channel-weakmap/test/index.js +0 -114
- package/ppi-api/node_modules/side-channel-weakmap/tsconfig.json +0 -9
- package/ppi-api/node_modules/statuses/HISTORY.md +0 -82
- package/ppi-api/node_modules/statuses/LICENSE +0 -23
- package/ppi-api/node_modules/statuses/README.md +0 -136
- package/ppi-api/node_modules/statuses/codes.json +0 -65
- package/ppi-api/node_modules/statuses/index.js +0 -146
- package/ppi-api/node_modules/statuses/package.json +0 -49
- package/ppi-api/node_modules/toidentifier/HISTORY.md +0 -9
- package/ppi-api/node_modules/toidentifier/LICENSE +0 -21
- package/ppi-api/node_modules/toidentifier/README.md +0 -61
- package/ppi-api/node_modules/toidentifier/index.js +0 -32
- package/ppi-api/node_modules/toidentifier/package.json +0 -38
- package/ppi-api/node_modules/type-is/HISTORY.md +0 -259
- package/ppi-api/node_modules/type-is/LICENSE +0 -23
- package/ppi-api/node_modules/type-is/README.md +0 -170
- package/ppi-api/node_modules/type-is/index.js +0 -266
- package/ppi-api/node_modules/type-is/package.json +0 -45
- package/ppi-api/node_modules/unpipe/HISTORY.md +0 -4
- package/ppi-api/node_modules/unpipe/LICENSE +0 -22
- package/ppi-api/node_modules/unpipe/README.md +0 -43
- package/ppi-api/node_modules/unpipe/index.js +0 -69
- package/ppi-api/node_modules/unpipe/package.json +0 -27
- package/ppi-api/node_modules/utils-merge/LICENSE +0 -20
- package/ppi-api/node_modules/utils-merge/README.md +0 -34
- package/ppi-api/node_modules/utils-merge/index.js +0 -23
- package/ppi-api/node_modules/utils-merge/package.json +0 -40
- package/ppi-api/node_modules/vary/HISTORY.md +0 -39
- package/ppi-api/node_modules/vary/LICENSE +0 -22
- package/ppi-api/node_modules/vary/README.md +0 -101
- package/ppi-api/node_modules/vary/index.js +0 -149
- package/ppi-api/node_modules/vary/package.json +0 -43
|
@@ -1,476 +0,0 @@
|
|
|
1
|
-
# body-parser
|
|
2
|
-
|
|
3
|
-
[![NPM Version][npm-version-image]][npm-url]
|
|
4
|
-
[![NPM Downloads][npm-downloads-image]][npm-url]
|
|
5
|
-
[![Build Status][ci-image]][ci-url]
|
|
6
|
-
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
7
|
-
[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer]
|
|
8
|
-
|
|
9
|
-
Node.js body parsing middleware.
|
|
10
|
-
|
|
11
|
-
Parse incoming request bodies in a middleware before your handlers, available
|
|
12
|
-
under the `req.body` property.
|
|
13
|
-
|
|
14
|
-
**Note** As `req.body`'s shape is based on user-controlled input, all
|
|
15
|
-
properties and values in this object are untrusted and should be validated
|
|
16
|
-
before trusting. For example, `req.body.foo.toString()` may fail in multiple
|
|
17
|
-
ways, for example the `foo` property may not be there or may not be a string,
|
|
18
|
-
and `toString` may not be a function and instead a string or other user input.
|
|
19
|
-
|
|
20
|
-
[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/).
|
|
21
|
-
|
|
22
|
-
_This does not handle multipart bodies_, due to their complex and typically
|
|
23
|
-
large nature. For multipart bodies, you may be interested in the following
|
|
24
|
-
modules:
|
|
25
|
-
|
|
26
|
-
* [busboy](https://www.npmjs.org/package/busboy#readme) and
|
|
27
|
-
[connect-busboy](https://www.npmjs.org/package/connect-busboy#readme)
|
|
28
|
-
* [multiparty](https://www.npmjs.org/package/multiparty#readme) and
|
|
29
|
-
[connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme)
|
|
30
|
-
* [formidable](https://www.npmjs.org/package/formidable#readme)
|
|
31
|
-
* [multer](https://www.npmjs.org/package/multer#readme)
|
|
32
|
-
|
|
33
|
-
This module provides the following parsers:
|
|
34
|
-
|
|
35
|
-
* [JSON body parser](#bodyparserjsonoptions)
|
|
36
|
-
* [Raw body parser](#bodyparserrawoptions)
|
|
37
|
-
* [Text body parser](#bodyparsertextoptions)
|
|
38
|
-
* [URL-encoded form body parser](#bodyparserurlencodedoptions)
|
|
39
|
-
|
|
40
|
-
Other body parsers you might be interested in:
|
|
41
|
-
|
|
42
|
-
- [body](https://www.npmjs.org/package/body#readme)
|
|
43
|
-
- [co-body](https://www.npmjs.org/package/co-body#readme)
|
|
44
|
-
|
|
45
|
-
## Installation
|
|
46
|
-
|
|
47
|
-
```sh
|
|
48
|
-
$ npm install body-parser
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## API
|
|
52
|
-
|
|
53
|
-
```js
|
|
54
|
-
var bodyParser = require('body-parser')
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
The `bodyParser` object exposes various factories to create middlewares. All
|
|
58
|
-
middlewares will populate the `req.body` property with the parsed body when
|
|
59
|
-
the `Content-Type` request header matches the `type` option, or an empty
|
|
60
|
-
object (`{}`) if there was no body to parse, the `Content-Type` was not matched,
|
|
61
|
-
or an error occurred.
|
|
62
|
-
|
|
63
|
-
The various errors returned by this module are described in the
|
|
64
|
-
[errors section](#errors).
|
|
65
|
-
|
|
66
|
-
### bodyParser.json([options])
|
|
67
|
-
|
|
68
|
-
Returns middleware that only parses `json` and only looks at requests where
|
|
69
|
-
the `Content-Type` header matches the `type` option. This parser accepts any
|
|
70
|
-
Unicode encoding of the body and supports automatic inflation of `gzip` and
|
|
71
|
-
`deflate` encodings.
|
|
72
|
-
|
|
73
|
-
A new `body` object containing the parsed data is populated on the `request`
|
|
74
|
-
object after the middleware (i.e. `req.body`).
|
|
75
|
-
|
|
76
|
-
#### Options
|
|
77
|
-
|
|
78
|
-
The `json` function takes an optional `options` object that may contain any of
|
|
79
|
-
the following keys:
|
|
80
|
-
|
|
81
|
-
##### inflate
|
|
82
|
-
|
|
83
|
-
When set to `true`, then deflated (compressed) bodies will be inflated; when
|
|
84
|
-
`false`, deflated bodies are rejected. Defaults to `true`.
|
|
85
|
-
|
|
86
|
-
##### limit
|
|
87
|
-
|
|
88
|
-
Controls the maximum request body size. If this is a number, then the value
|
|
89
|
-
specifies the number of bytes; if it is a string, the value is passed to the
|
|
90
|
-
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
|
|
91
|
-
to `'100kb'`.
|
|
92
|
-
|
|
93
|
-
##### reviver
|
|
94
|
-
|
|
95
|
-
The `reviver` option is passed directly to `JSON.parse` as the second
|
|
96
|
-
argument. You can find more information on this argument
|
|
97
|
-
[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter).
|
|
98
|
-
|
|
99
|
-
##### strict
|
|
100
|
-
|
|
101
|
-
When set to `true`, will only accept arrays and objects; when `false` will
|
|
102
|
-
accept anything `JSON.parse` accepts. Defaults to `true`.
|
|
103
|
-
|
|
104
|
-
##### type
|
|
105
|
-
|
|
106
|
-
The `type` option is used to determine what media type the middleware will
|
|
107
|
-
parse. This option can be a string, array of strings, or a function. If not a
|
|
108
|
-
function, `type` option is passed directly to the
|
|
109
|
-
[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
|
|
110
|
-
be an extension name (like `json`), a mime type (like `application/json`), or
|
|
111
|
-
a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type`
|
|
112
|
-
option is called as `fn(req)` and the request is parsed if it returns a truthy
|
|
113
|
-
value. Defaults to `application/json`.
|
|
114
|
-
|
|
115
|
-
##### verify
|
|
116
|
-
|
|
117
|
-
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
|
|
118
|
-
where `buf` is a `Buffer` of the raw request body and `encoding` is the
|
|
119
|
-
encoding of the request. The parsing can be aborted by throwing an error.
|
|
120
|
-
|
|
121
|
-
### bodyParser.raw([options])
|
|
122
|
-
|
|
123
|
-
Returns middleware that parses all bodies as a `Buffer` and only looks at
|
|
124
|
-
requests where the `Content-Type` header matches the `type` option. This
|
|
125
|
-
parser supports automatic inflation of `gzip` and `deflate` encodings.
|
|
126
|
-
|
|
127
|
-
A new `body` object containing the parsed data is populated on the `request`
|
|
128
|
-
object after the middleware (i.e. `req.body`). This will be a `Buffer` object
|
|
129
|
-
of the body.
|
|
130
|
-
|
|
131
|
-
#### Options
|
|
132
|
-
|
|
133
|
-
The `raw` function takes an optional `options` object that may contain any of
|
|
134
|
-
the following keys:
|
|
135
|
-
|
|
136
|
-
##### inflate
|
|
137
|
-
|
|
138
|
-
When set to `true`, then deflated (compressed) bodies will be inflated; when
|
|
139
|
-
`false`, deflated bodies are rejected. Defaults to `true`.
|
|
140
|
-
|
|
141
|
-
##### limit
|
|
142
|
-
|
|
143
|
-
Controls the maximum request body size. If this is a number, then the value
|
|
144
|
-
specifies the number of bytes; if it is a string, the value is passed to the
|
|
145
|
-
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
|
|
146
|
-
to `'100kb'`.
|
|
147
|
-
|
|
148
|
-
##### type
|
|
149
|
-
|
|
150
|
-
The `type` option is used to determine what media type the middleware will
|
|
151
|
-
parse. This option can be a string, array of strings, or a function.
|
|
152
|
-
If not a function, `type` option is passed directly to the
|
|
153
|
-
[type-is](https://www.npmjs.org/package/type-is#readme) library and this
|
|
154
|
-
can be an extension name (like `bin`), a mime type (like
|
|
155
|
-
`application/octet-stream`), or a mime type with a wildcard (like `*/*` or
|
|
156
|
-
`application/*`). If a function, the `type` option is called as `fn(req)`
|
|
157
|
-
and the request is parsed if it returns a truthy value. Defaults to
|
|
158
|
-
`application/octet-stream`.
|
|
159
|
-
|
|
160
|
-
##### verify
|
|
161
|
-
|
|
162
|
-
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
|
|
163
|
-
where `buf` is a `Buffer` of the raw request body and `encoding` is the
|
|
164
|
-
encoding of the request. The parsing can be aborted by throwing an error.
|
|
165
|
-
|
|
166
|
-
### bodyParser.text([options])
|
|
167
|
-
|
|
168
|
-
Returns middleware that parses all bodies as a string and only looks at
|
|
169
|
-
requests where the `Content-Type` header matches the `type` option. This
|
|
170
|
-
parser supports automatic inflation of `gzip` and `deflate` encodings.
|
|
171
|
-
|
|
172
|
-
A new `body` string containing the parsed data is populated on the `request`
|
|
173
|
-
object after the middleware (i.e. `req.body`). This will be a string of the
|
|
174
|
-
body.
|
|
175
|
-
|
|
176
|
-
#### Options
|
|
177
|
-
|
|
178
|
-
The `text` function takes an optional `options` object that may contain any of
|
|
179
|
-
the following keys:
|
|
180
|
-
|
|
181
|
-
##### defaultCharset
|
|
182
|
-
|
|
183
|
-
Specify the default character set for the text content if the charset is not
|
|
184
|
-
specified in the `Content-Type` header of the request. Defaults to `utf-8`.
|
|
185
|
-
|
|
186
|
-
##### inflate
|
|
187
|
-
|
|
188
|
-
When set to `true`, then deflated (compressed) bodies will be inflated; when
|
|
189
|
-
`false`, deflated bodies are rejected. Defaults to `true`.
|
|
190
|
-
|
|
191
|
-
##### limit
|
|
192
|
-
|
|
193
|
-
Controls the maximum request body size. If this is a number, then the value
|
|
194
|
-
specifies the number of bytes; if it is a string, the value is passed to the
|
|
195
|
-
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
|
|
196
|
-
to `'100kb'`.
|
|
197
|
-
|
|
198
|
-
##### type
|
|
199
|
-
|
|
200
|
-
The `type` option is used to determine what media type the middleware will
|
|
201
|
-
parse. This option can be a string, array of strings, or a function. If not
|
|
202
|
-
a function, `type` option is passed directly to the
|
|
203
|
-
[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
|
|
204
|
-
be an extension name (like `txt`), a mime type (like `text/plain`), or a mime
|
|
205
|
-
type with a wildcard (like `*/*` or `text/*`). If a function, the `type`
|
|
206
|
-
option is called as `fn(req)` and the request is parsed if it returns a
|
|
207
|
-
truthy value. Defaults to `text/plain`.
|
|
208
|
-
|
|
209
|
-
##### verify
|
|
210
|
-
|
|
211
|
-
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
|
|
212
|
-
where `buf` is a `Buffer` of the raw request body and `encoding` is the
|
|
213
|
-
encoding of the request. The parsing can be aborted by throwing an error.
|
|
214
|
-
|
|
215
|
-
### bodyParser.urlencoded([options])
|
|
216
|
-
|
|
217
|
-
Returns middleware that only parses `urlencoded` bodies and only looks at
|
|
218
|
-
requests where the `Content-Type` header matches the `type` option. This
|
|
219
|
-
parser accepts only UTF-8 encoding of the body and supports automatic
|
|
220
|
-
inflation of `gzip` and `deflate` encodings.
|
|
221
|
-
|
|
222
|
-
A new `body` object containing the parsed data is populated on the `request`
|
|
223
|
-
object after the middleware (i.e. `req.body`). This object will contain
|
|
224
|
-
key-value pairs, where the value can be a string or array (when `extended` is
|
|
225
|
-
`false`), or any type (when `extended` is `true`).
|
|
226
|
-
|
|
227
|
-
#### Options
|
|
228
|
-
|
|
229
|
-
The `urlencoded` function takes an optional `options` object that may contain
|
|
230
|
-
any of the following keys:
|
|
231
|
-
|
|
232
|
-
##### extended
|
|
233
|
-
|
|
234
|
-
The `extended` option allows to choose between parsing the URL-encoded data
|
|
235
|
-
with the `querystring` library (when `false`) or the `qs` library (when
|
|
236
|
-
`true`). The "extended" syntax allows for rich objects and arrays to be
|
|
237
|
-
encoded into the URL-encoded format, allowing for a JSON-like experience
|
|
238
|
-
with URL-encoded. For more information, please
|
|
239
|
-
[see the qs library](https://www.npmjs.org/package/qs#readme).
|
|
240
|
-
|
|
241
|
-
Defaults to `true`, but using the default has been deprecated. Please
|
|
242
|
-
research into the difference between `qs` and `querystring` and choose the
|
|
243
|
-
appropriate setting.
|
|
244
|
-
|
|
245
|
-
##### inflate
|
|
246
|
-
|
|
247
|
-
When set to `true`, then deflated (compressed) bodies will be inflated; when
|
|
248
|
-
`false`, deflated bodies are rejected. Defaults to `true`.
|
|
249
|
-
|
|
250
|
-
##### limit
|
|
251
|
-
|
|
252
|
-
Controls the maximum request body size. If this is a number, then the value
|
|
253
|
-
specifies the number of bytes; if it is a string, the value is passed to the
|
|
254
|
-
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
|
|
255
|
-
to `'100kb'`.
|
|
256
|
-
|
|
257
|
-
##### parameterLimit
|
|
258
|
-
|
|
259
|
-
The `parameterLimit` option controls the maximum number of parameters that
|
|
260
|
-
are allowed in the URL-encoded data. If a request contains more parameters
|
|
261
|
-
than this value, a 413 will be returned to the client. Defaults to `1000`.
|
|
262
|
-
|
|
263
|
-
##### type
|
|
264
|
-
|
|
265
|
-
The `type` option is used to determine what media type the middleware will
|
|
266
|
-
parse. This option can be a string, array of strings, or a function. If not
|
|
267
|
-
a function, `type` option is passed directly to the
|
|
268
|
-
[type-is](https://www.npmjs.org/package/type-is#readme) library and this can
|
|
269
|
-
be an extension name (like `urlencoded`), a mime type (like
|
|
270
|
-
`application/x-www-form-urlencoded`), or a mime type with a wildcard (like
|
|
271
|
-
`*/x-www-form-urlencoded`). If a function, the `type` option is called as
|
|
272
|
-
`fn(req)` and the request is parsed if it returns a truthy value. Defaults
|
|
273
|
-
to `application/x-www-form-urlencoded`.
|
|
274
|
-
|
|
275
|
-
##### verify
|
|
276
|
-
|
|
277
|
-
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
|
|
278
|
-
where `buf` is a `Buffer` of the raw request body and `encoding` is the
|
|
279
|
-
encoding of the request. The parsing can be aborted by throwing an error.
|
|
280
|
-
|
|
281
|
-
#### depth
|
|
282
|
-
|
|
283
|
-
The `depth` option is used to configure the maximum depth of the `qs` library when `extended` is `true`. This allows you to limit the amount of keys that are parsed and can be useful to prevent certain types of abuse. Defaults to `32`. It is recommended to keep this value as low as possible.
|
|
284
|
-
|
|
285
|
-
## Errors
|
|
286
|
-
|
|
287
|
-
The middlewares provided by this module create errors using the
|
|
288
|
-
[`http-errors` module](https://www.npmjs.com/package/http-errors). The errors
|
|
289
|
-
will typically have a `status`/`statusCode` property that contains the suggested
|
|
290
|
-
HTTP response code, an `expose` property to determine if the `message` property
|
|
291
|
-
should be displayed to the client, a `type` property to determine the type of
|
|
292
|
-
error without matching against the `message`, and a `body` property containing
|
|
293
|
-
the read body, if available.
|
|
294
|
-
|
|
295
|
-
The following are the common errors created, though any error can come through
|
|
296
|
-
for various reasons.
|
|
297
|
-
|
|
298
|
-
### content encoding unsupported
|
|
299
|
-
|
|
300
|
-
This error will occur when the request had a `Content-Encoding` header that
|
|
301
|
-
contained an encoding but the "inflation" option was set to `false`. The
|
|
302
|
-
`status` property is set to `415`, the `type` property is set to
|
|
303
|
-
`'encoding.unsupported'`, and the `charset` property will be set to the
|
|
304
|
-
encoding that is unsupported.
|
|
305
|
-
|
|
306
|
-
### entity parse failed
|
|
307
|
-
|
|
308
|
-
This error will occur when the request contained an entity that could not be
|
|
309
|
-
parsed by the middleware. The `status` property is set to `400`, the `type`
|
|
310
|
-
property is set to `'entity.parse.failed'`, and the `body` property is set to
|
|
311
|
-
the entity value that failed parsing.
|
|
312
|
-
|
|
313
|
-
### entity verify failed
|
|
314
|
-
|
|
315
|
-
This error will occur when the request contained an entity that could not be
|
|
316
|
-
failed verification by the defined `verify` option. The `status` property is
|
|
317
|
-
set to `403`, the `type` property is set to `'entity.verify.failed'`, and the
|
|
318
|
-
`body` property is set to the entity value that failed verification.
|
|
319
|
-
|
|
320
|
-
### request aborted
|
|
321
|
-
|
|
322
|
-
This error will occur when the request is aborted by the client before reading
|
|
323
|
-
the body has finished. The `received` property will be set to the number of
|
|
324
|
-
bytes received before the request was aborted and the `expected` property is
|
|
325
|
-
set to the number of expected bytes. The `status` property is set to `400`
|
|
326
|
-
and `type` property is set to `'request.aborted'`.
|
|
327
|
-
|
|
328
|
-
### request entity too large
|
|
329
|
-
|
|
330
|
-
This error will occur when the request body's size is larger than the "limit"
|
|
331
|
-
option. The `limit` property will be set to the byte limit and the `length`
|
|
332
|
-
property will be set to the request body's length. The `status` property is
|
|
333
|
-
set to `413` and the `type` property is set to `'entity.too.large'`.
|
|
334
|
-
|
|
335
|
-
### request size did not match content length
|
|
336
|
-
|
|
337
|
-
This error will occur when the request's length did not match the length from
|
|
338
|
-
the `Content-Length` header. This typically occurs when the request is malformed,
|
|
339
|
-
typically when the `Content-Length` header was calculated based on characters
|
|
340
|
-
instead of bytes. The `status` property is set to `400` and the `type` property
|
|
341
|
-
is set to `'request.size.invalid'`.
|
|
342
|
-
|
|
343
|
-
### stream encoding should not be set
|
|
344
|
-
|
|
345
|
-
This error will occur when something called the `req.setEncoding` method prior
|
|
346
|
-
to this middleware. This module operates directly on bytes only and you cannot
|
|
347
|
-
call `req.setEncoding` when using this module. The `status` property is set to
|
|
348
|
-
`500` and the `type` property is set to `'stream.encoding.set'`.
|
|
349
|
-
|
|
350
|
-
### stream is not readable
|
|
351
|
-
|
|
352
|
-
This error will occur when the request is no longer readable when this middleware
|
|
353
|
-
attempts to read it. This typically means something other than a middleware from
|
|
354
|
-
this module read the request body already and the middleware was also configured to
|
|
355
|
-
read the same request. The `status` property is set to `500` and the `type`
|
|
356
|
-
property is set to `'stream.not.readable'`.
|
|
357
|
-
|
|
358
|
-
### too many parameters
|
|
359
|
-
|
|
360
|
-
This error will occur when the content of the request exceeds the configured
|
|
361
|
-
`parameterLimit` for the `urlencoded` parser. The `status` property is set to
|
|
362
|
-
`413` and the `type` property is set to `'parameters.too.many'`.
|
|
363
|
-
|
|
364
|
-
### unsupported charset "BOGUS"
|
|
365
|
-
|
|
366
|
-
This error will occur when the request had a charset parameter in the
|
|
367
|
-
`Content-Type` header, but the `iconv-lite` module does not support it OR the
|
|
368
|
-
parser does not support it. The charset is contained in the message as well
|
|
369
|
-
as in the `charset` property. The `status` property is set to `415`, the
|
|
370
|
-
`type` property is set to `'charset.unsupported'`, and the `charset` property
|
|
371
|
-
is set to the charset that is unsupported.
|
|
372
|
-
|
|
373
|
-
### unsupported content encoding "bogus"
|
|
374
|
-
|
|
375
|
-
This error will occur when the request had a `Content-Encoding` header that
|
|
376
|
-
contained an unsupported encoding. The encoding is contained in the message
|
|
377
|
-
as well as in the `encoding` property. The `status` property is set to `415`,
|
|
378
|
-
the `type` property is set to `'encoding.unsupported'`, and the `encoding`
|
|
379
|
-
property is set to the encoding that is unsupported.
|
|
380
|
-
|
|
381
|
-
### The input exceeded the depth
|
|
382
|
-
|
|
383
|
-
This error occurs when using `bodyParser.urlencoded` with the `extended` property set to `true` and the input exceeds the configured `depth` option. The `status` property is set to `400`. It is recommended to review the `depth` option and evaluate if it requires a higher value. When the `depth` option is set to `32` (default value), the error will not be thrown.
|
|
384
|
-
|
|
385
|
-
## Examples
|
|
386
|
-
|
|
387
|
-
### Express/Connect top-level generic
|
|
388
|
-
|
|
389
|
-
This example demonstrates adding a generic JSON and URL-encoded parser as a
|
|
390
|
-
top-level middleware, which will parse the bodies of all incoming requests.
|
|
391
|
-
This is the simplest setup.
|
|
392
|
-
|
|
393
|
-
```js
|
|
394
|
-
var express = require('express')
|
|
395
|
-
var bodyParser = require('body-parser')
|
|
396
|
-
|
|
397
|
-
var app = express()
|
|
398
|
-
|
|
399
|
-
// parse application/x-www-form-urlencoded
|
|
400
|
-
app.use(bodyParser.urlencoded({ extended: false }))
|
|
401
|
-
|
|
402
|
-
// parse application/json
|
|
403
|
-
app.use(bodyParser.json())
|
|
404
|
-
|
|
405
|
-
app.use(function (req, res) {
|
|
406
|
-
res.setHeader('Content-Type', 'text/plain')
|
|
407
|
-
res.write('you posted:\n')
|
|
408
|
-
res.end(JSON.stringify(req.body, null, 2))
|
|
409
|
-
})
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
### Express route-specific
|
|
413
|
-
|
|
414
|
-
This example demonstrates adding body parsers specifically to the routes that
|
|
415
|
-
need them. In general, this is the most recommended way to use body-parser with
|
|
416
|
-
Express.
|
|
417
|
-
|
|
418
|
-
```js
|
|
419
|
-
var express = require('express')
|
|
420
|
-
var bodyParser = require('body-parser')
|
|
421
|
-
|
|
422
|
-
var app = express()
|
|
423
|
-
|
|
424
|
-
// create application/json parser
|
|
425
|
-
var jsonParser = bodyParser.json()
|
|
426
|
-
|
|
427
|
-
// create application/x-www-form-urlencoded parser
|
|
428
|
-
var urlencodedParser = bodyParser.urlencoded({ extended: false })
|
|
429
|
-
|
|
430
|
-
// POST /login gets urlencoded bodies
|
|
431
|
-
app.post('/login', urlencodedParser, function (req, res) {
|
|
432
|
-
res.send('welcome, ' + req.body.username)
|
|
433
|
-
})
|
|
434
|
-
|
|
435
|
-
// POST /api/users gets JSON bodies
|
|
436
|
-
app.post('/api/users', jsonParser, function (req, res) {
|
|
437
|
-
// create user in req.body
|
|
438
|
-
})
|
|
439
|
-
```
|
|
440
|
-
|
|
441
|
-
### Change accepted type for parsers
|
|
442
|
-
|
|
443
|
-
All the parsers accept a `type` option which allows you to change the
|
|
444
|
-
`Content-Type` that the middleware will parse.
|
|
445
|
-
|
|
446
|
-
```js
|
|
447
|
-
var express = require('express')
|
|
448
|
-
var bodyParser = require('body-parser')
|
|
449
|
-
|
|
450
|
-
var app = express()
|
|
451
|
-
|
|
452
|
-
// parse various different custom JSON types as JSON
|
|
453
|
-
app.use(bodyParser.json({ type: 'application/*+json' }))
|
|
454
|
-
|
|
455
|
-
// parse some custom thing into a Buffer
|
|
456
|
-
app.use(bodyParser.raw({ type: 'application/vnd.custom-type' }))
|
|
457
|
-
|
|
458
|
-
// parse an HTML body into a string
|
|
459
|
-
app.use(bodyParser.text({ type: 'text/html' }))
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
## License
|
|
463
|
-
|
|
464
|
-
[MIT](LICENSE)
|
|
465
|
-
|
|
466
|
-
[ci-image]: https://badgen.net/github/checks/expressjs/body-parser/master?label=ci
|
|
467
|
-
[ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml
|
|
468
|
-
[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/body-parser/master
|
|
469
|
-
[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master
|
|
470
|
-
[node-version-image]: https://badgen.net/npm/node/body-parser
|
|
471
|
-
[node-version-url]: https://nodejs.org/en/download
|
|
472
|
-
[npm-downloads-image]: https://badgen.net/npm/dm/body-parser
|
|
473
|
-
[npm-url]: https://npmjs.org/package/body-parser
|
|
474
|
-
[npm-version-image]: https://badgen.net/npm/v/body-parser
|
|
475
|
-
[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/body-parser/badge
|
|
476
|
-
[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# Security Policies and Procedures
|
|
2
|
-
|
|
3
|
-
## Reporting a Bug
|
|
4
|
-
|
|
5
|
-
The Express team and community take all security bugs seriously. Thank you
|
|
6
|
-
for improving the security of Express. We appreciate your efforts and
|
|
7
|
-
responsible disclosure and will make every effort to acknowledge your
|
|
8
|
-
contributions.
|
|
9
|
-
|
|
10
|
-
Report security bugs by emailing the current owner(s) of `body-parser`. This
|
|
11
|
-
information can be found in the npm registry using the command
|
|
12
|
-
`npm owner ls body-parser`.
|
|
13
|
-
If unsure or unable to get the information from the above, open an issue
|
|
14
|
-
in the [project issue tracker](https://github.com/expressjs/body-parser/issues)
|
|
15
|
-
asking for the current contact information.
|
|
16
|
-
|
|
17
|
-
To ensure the timely response to your report, please ensure that the entirety
|
|
18
|
-
of the report is contained within the email body and not solely behind a web
|
|
19
|
-
link or an attachment.
|
|
20
|
-
|
|
21
|
-
At least one owner will acknowledge your email within 48 hours, and will send a
|
|
22
|
-
more detailed response within 48 hours indicating the next steps in handling
|
|
23
|
-
your report. After the initial reply to your report, the owners will
|
|
24
|
-
endeavor to keep you informed of the progress towards a fix and full
|
|
25
|
-
announcement, and may ask for additional information or guidance.
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* body-parser
|
|
3
|
-
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
4
|
-
* MIT Licensed
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
'use strict'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Module dependencies.
|
|
11
|
-
* @private
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
var deprecate = require('depd')('body-parser')
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Cache of loaded parsers.
|
|
18
|
-
* @private
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
var parsers = Object.create(null)
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @typedef Parsers
|
|
25
|
-
* @type {function}
|
|
26
|
-
* @property {function} json
|
|
27
|
-
* @property {function} raw
|
|
28
|
-
* @property {function} text
|
|
29
|
-
* @property {function} urlencoded
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Module exports.
|
|
34
|
-
* @type {Parsers}
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
exports = module.exports = deprecate.function(bodyParser,
|
|
38
|
-
'bodyParser: use individual json/urlencoded middlewares')
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* JSON parser.
|
|
42
|
-
* @public
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
Object.defineProperty(exports, 'json', {
|
|
46
|
-
configurable: true,
|
|
47
|
-
enumerable: true,
|
|
48
|
-
get: createParserGetter('json')
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Raw parser.
|
|
53
|
-
* @public
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
Object.defineProperty(exports, 'raw', {
|
|
57
|
-
configurable: true,
|
|
58
|
-
enumerable: true,
|
|
59
|
-
get: createParserGetter('raw')
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Text parser.
|
|
64
|
-
* @public
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
Object.defineProperty(exports, 'text', {
|
|
68
|
-
configurable: true,
|
|
69
|
-
enumerable: true,
|
|
70
|
-
get: createParserGetter('text')
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* URL-encoded parser.
|
|
75
|
-
* @public
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
Object.defineProperty(exports, 'urlencoded', {
|
|
79
|
-
configurable: true,
|
|
80
|
-
enumerable: true,
|
|
81
|
-
get: createParserGetter('urlencoded')
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Create a middleware to parse json and urlencoded bodies.
|
|
86
|
-
*
|
|
87
|
-
* @param {object} [options]
|
|
88
|
-
* @return {function}
|
|
89
|
-
* @deprecated
|
|
90
|
-
* @public
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
function bodyParser (options) {
|
|
94
|
-
// use default type for parsers
|
|
95
|
-
var opts = Object.create(options || null, {
|
|
96
|
-
type: {
|
|
97
|
-
configurable: true,
|
|
98
|
-
enumerable: true,
|
|
99
|
-
value: undefined,
|
|
100
|
-
writable: true
|
|
101
|
-
}
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
var _urlencoded = exports.urlencoded(opts)
|
|
105
|
-
var _json = exports.json(opts)
|
|
106
|
-
|
|
107
|
-
return function bodyParser (req, res, next) {
|
|
108
|
-
_json(req, res, function (err) {
|
|
109
|
-
if (err) return next(err)
|
|
110
|
-
_urlencoded(req, res, next)
|
|
111
|
-
})
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Create a getter for loading a parser.
|
|
117
|
-
* @private
|
|
118
|
-
*/
|
|
119
|
-
|
|
120
|
-
function createParserGetter (name) {
|
|
121
|
-
return function get () {
|
|
122
|
-
return loadParser(name)
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Load a parser module.
|
|
128
|
-
* @private
|
|
129
|
-
*/
|
|
130
|
-
|
|
131
|
-
function loadParser (parserName) {
|
|
132
|
-
var parser = parsers[parserName]
|
|
133
|
-
|
|
134
|
-
if (parser !== undefined) {
|
|
135
|
-
return parser
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// this uses a switch for static require analysis
|
|
139
|
-
switch (parserName) {
|
|
140
|
-
case 'json':
|
|
141
|
-
parser = require('./lib/types/json')
|
|
142
|
-
break
|
|
143
|
-
case 'raw':
|
|
144
|
-
parser = require('./lib/types/raw')
|
|
145
|
-
break
|
|
146
|
-
case 'text':
|
|
147
|
-
parser = require('./lib/types/text')
|
|
148
|
-
break
|
|
149
|
-
case 'urlencoded':
|
|
150
|
-
parser = require('./lib/types/urlencoded')
|
|
151
|
-
break
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// store to prevent invoking require()
|
|
155
|
-
return (parsers[parserName] = parser)
|
|
156
|
-
}
|