@openclaw/slack 2026.10.10-beta.5 → 2026.11.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-configured-zcR9TJJN.mjs → account-configured-35y0-Hso.mjs} +1 -2
- package/dist/.setup/{account-inspect-CmkKiSb9.mjs → account-inspect-DgQgj0wk.mjs} +13 -11
- package/dist/.setup/{accounts-msihSF3-.mjs → accounts-EaPP0fFY.mjs} +16 -11
- package/dist/.setup/{action-runtime-ChRfnnBu.mjs → action-runtime-CK9QZgQl.mjs} +39 -47
- package/dist/.setup/action-runtime.runtime-CpZktret.mjs +1 -0
- package/dist/.setup/{actions-By7tvpvv.mjs → actions-s3CcFO45.mjs} +98 -93
- package/dist/.setup/{approval-handler.runtime-D8ArtDQt.mjs → approval-handler.runtime-Ch7BecYK.mjs} +27 -32
- package/dist/.setup/{approval-message-updates-DT7XBPbV.mjs → approval-message-updates-CqcRoa28.mjs} +2 -3
- package/dist/.setup/{channel-6YzXl_63.mjs → channel-CAvo_WNZ.mjs} +573 -352
- package/dist/.setup/{channel-meta-C443t-lI.mjs → channel-meta-C5vsCo3a.mjs} +1 -2
- package/dist/.setup/{channel-type-BEFP2ORi.mjs → channel-type-9Lw6yLf2.mjs} +6 -11
- package/dist/.setup/{channel.setup-u6QQdbTa.mjs → channel.setup-BlgXNuCJ.mjs} +19 -23
- package/dist/.setup/{config-schema-DNnh6bWU.mjs → config-schema-Bx1tCZB0.mjs} +5 -11
- package/dist/.setup/cursor-pages-jVn3Vkfi.mjs +309 -0
- package/dist/.setup/{directory-config-Cjj0N8R0.mjs → directory-config-CGvKYg9F.mjs} +5 -6
- package/dist/.setup/{directory-live-BIKD-5B_.mjs → directory-live-DNdw97LA.mjs} +6 -7
- package/dist/.setup/{doctor-contract-Cd4-VzIM.mjs → doctor-contract-BB2KJ9Ni.mjs} +44 -58
- package/dist/.setup/{message-tool-api-BS5ekEA_.mjs → message-tool-api-B38BpEaE.mjs} +7 -8
- package/dist/.setup/{monitor-BFilOuM_.mjs → monitor-BD86SotB.mjs} +3416 -3750
- package/dist/.setup/{outbound-adapter-9dbnYtL1.mjs → outbound-adapter-BH6iPWBj.mjs} +32 -39
- package/dist/.setup/paths-CQZI_5WY.mjs +7 -0
- package/dist/.setup/{pipeline.runtime-BG5swHnj.mjs → pipeline.runtime-C4ELxaRU.mjs} +444 -590
- package/dist/.setup/{policy-yhn48xf5.mjs → policy-C6_DdlSf.mjs} +3 -6
- package/dist/.setup/{session-status-Dv8wNBEt.mjs → probe-B_Ax1vS1.mjs} +1015 -678
- package/dist/.setup/question-delivery-D3qAIwuv.mjs +38 -0
- package/dist/.setup/{relay-source-oY9SbDiX.mjs → relay-source-a8jodKuO.mjs} +12 -6
- package/dist/.setup/{replies-CJwjTqDr.mjs → replies-Bq7n0gfM.mjs} +37 -24
- package/dist/.setup/{reply-blocks-Ca-raz2z.mjs → reply-blocks-DyYYRrP_.mjs} +202 -210
- package/dist/.setup/{resolve-channels-DRRhElwz.mjs → resolve-channels-CF2JME9q.mjs} +6 -10
- package/dist/.setup/{resolve-users-Cz8e17ky.mjs → resolve-users-DDcCAjH1.mjs} +10 -19
- package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-nwUcYXjP.mjs} +1 -2
- package/dist/.setup/{runtime-JSVZSWAj.mjs → runtime-C6HKn7Av.mjs} +1 -2
- package/dist/.setup/runtime-setter-api-DrXr965r.mjs +2 -0
- package/dist/.setup/{scopes-DfQVi8Jw.mjs → scopes-CzHC_dwV.mjs} +3 -3
- package/dist/.setup/{secret-contract-B-Qm6aQQ.mjs → secret-contract-CqVqR7MP.mjs} +5 -4
- package/dist/.setup/{secret-contract-api-DB6CMdgc.mjs → secret-contract-api-DaCXZ47j.mjs} +1 -1
- package/dist/.setup/{security-audit-DFGiFLqd.mjs → security-audit-C3hXCfDt.mjs} +2 -3
- package/dist/.setup/{send-C-8wY0lK.mjs → send-WJZ73VSf.mjs} +306 -349
- package/dist/.setup/{send-results-eeOu_HYm.mjs → send-results-Bm6V1ekL.mjs} +4 -6
- package/dist/.setup/setup-plugin-api-DJXIB8CF.mjs +2 -0
- package/dist/.setup/{setup-surface-9WVQgYCT.mjs → setup-surface-uIqP2B0Y.mjs} +6 -8
- package/dist/.setup/{slash-dispatch.runtime-v5kQqJPh.mjs → slash-dispatch.runtime-Cwuwv7FL.mjs} +2 -2
- package/dist/.setup/{target-parsing-FFE26kOV.mjs → target-parsing-DwYAP3ts.mjs} +2 -4
- package/dist/.setup/{targets-C6LZQL1Q.mjs → targets-eeOxA_b_.mjs} +2 -3
- package/dist/.setup/{thread-ts-Cvt7WD6B.mjs → thread-ts-47Au2-Yn.mjs} +1 -2
- package/dist/.source-module-urls/c5ffd0957b234c7c12090e7de4eca2482ef339b8561e078da55b734211b0ba58.json +1 -0
- package/dist/account-inspect-api.js +2 -3
- package/dist/api.js +17 -18
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-entry.js +1 -2
- package/dist/channel-plugin-api.js +1 -1
- package/dist/configured-state.js +2 -3
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/index.js +1 -8
- package/dist/message-tool-api.js +1 -1
- package/dist/runtime-api.js +11 -13
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/setup-entry.js +4 -5
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/bolt/node_modules/@types/node/util.d.ts +6 -3
- package/node_modules/@slack/bolt/node_modules/content-disposition/README.md +105 -35
- package/node_modules/@slack/bolt/node_modules/content-disposition/dist/index.d.ts +72 -0
- package/node_modules/@slack/bolt/node_modules/content-disposition/dist/index.js +388 -0
- package/node_modules/@slack/bolt/node_modules/content-disposition/dist/index.js.map +1 -0
- package/node_modules/@slack/bolt/node_modules/content-disposition/package.json +31 -19
- package/node_modules/@slack/bolt/node_modules/content-type/README.md +34 -57
- package/node_modules/@slack/bolt/node_modules/content-type/package.json +35 -25
- package/node_modules/@slack/bolt/node_modules/express/Readme.md +15 -9
- package/node_modules/@slack/bolt/node_modules/express/lib/application.js +2 -2
- package/node_modules/@slack/bolt/node_modules/express/lib/request.js +32 -19
- package/node_modules/@slack/bolt/node_modules/express/lib/response.js +27 -30
- package/node_modules/@slack/bolt/node_modules/express/package.json +10 -10
- package/node_modules/@slack/bolt/node_modules/qs/.github/THREAT_MODEL.md +4 -2
- package/node_modules/@slack/bolt/node_modules/qs/CHANGELOG.md +38 -14
- package/node_modules/@slack/bolt/node_modules/qs/README.md +31 -3
- package/node_modules/@slack/bolt/node_modules/qs/dist/qs.js +20 -20
- package/node_modules/@slack/bolt/node_modules/qs/lib/parse.js +94 -4
- package/node_modules/@slack/bolt/node_modules/qs/lib/stringify.js +4 -4
- package/node_modules/@slack/bolt/node_modules/qs/lib/utils.js +130 -6
- package/node_modules/@slack/bolt/node_modules/qs/package.json +4 -4
- package/node_modules/@slack/bolt/node_modules/qs/test/parse.js +174 -0
- package/node_modules/@slack/bolt/node_modules/qs/test/stringify.js +263 -33
- package/node_modules/@slack/bolt/node_modules/qs/test/utils.js +184 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +6 -3
- package/node_modules/typebox/build/format/duration.d.mts +2 -2
- package/node_modules/typebox/build/format/duration.mjs +2 -2
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_email.mjs +1 -0
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
- package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
- package/node_modules/typebox/build/format/ipv4.mjs +2 -2
- package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
- package/node_modules/typebox/build/format/ipv6.mjs +1 -1
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/schema/build.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
- package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
- package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
- package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
- package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
- package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
- package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
- package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
- package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
- package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
- package/node_modules/typebox/build/system/memory/create.mjs +18 -13
- package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
- package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
- package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
- package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
- package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
- package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
- package/node_modules/typebox/build/system/memory/update.mjs +43 -16
- package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
- package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
- package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
- package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
- package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
- package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +1 -1
- package/node_modules/undici/README.md +25 -3
- package/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
- package/node_modules/undici/docs/docs/api/Client.md +11 -6
- package/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
- package/node_modules/undici/docs/docs/api/Errors.md +76 -1
- package/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
- package/node_modules/undici/docs/docs/api/Interceptors.md +28 -8
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
- package/node_modules/undici/docs/docs/index.md +12 -12
- package/node_modules/undici/docs/docs/type-map.json +66 -66
- package/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
- package/node_modules/undici/lib/core/connect.js +10 -4
- package/node_modules/undici/lib/core/constants.js +12 -1
- package/node_modules/undici/lib/core/errors.js +38 -1
- package/node_modules/undici/lib/core/request.js +16 -1
- package/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/undici/lib/core/util.js +26 -1
- package/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
- package/node_modules/undici/lib/dispatcher/client-h2.js +124 -17
- package/node_modules/undici/lib/dispatcher/client.js +4 -1
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
- package/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
- package/node_modules/undici/lib/dispatcher/pool-base.js +85 -31
- package/node_modules/undici/lib/dispatcher/pool.js +11 -8
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
- package/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
- package/node_modules/undici/lib/handler/cache-handler.js +153 -15
- package/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
- package/node_modules/undici/lib/handler/redirect-handler.js +28 -8
- package/node_modules/undici/lib/handler/retry-handler.js +44 -11
- package/node_modules/undici/lib/interceptor/cache.js +11 -3
- package/node_modules/undici/lib/interceptor/decompress.js +22 -9
- package/node_modules/undici/lib/interceptor/dns.js +11 -0
- package/node_modules/undici/lib/interceptor/response-error.js +72 -28
- package/node_modules/undici/lib/milo/LICENSE.md +7 -0
- package/node_modules/undici/lib/milo/no-simd.js +1002 -0
- package/node_modules/undici/lib/milo/simd.js +1002 -0
- package/node_modules/undici/lib/mock/mock-agent.js +11 -0
- package/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
- package/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
- package/node_modules/undici/lib/util/cache.js +11 -5
- package/node_modules/undici/lib/web/cookies/util.js +19 -2
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
- package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
- package/node_modules/undici/lib/web/fetch/body.js +47 -38
- package/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
- package/node_modules/undici/lib/web/fetch/headers.js +2 -2
- package/node_modules/undici/lib/web/fetch/index.js +8 -4
- package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
- package/node_modules/undici/lib/web/websocket/receiver.js +25 -4
- package/node_modules/undici/package.json +9 -7
- package/node_modules/undici/types/api.d.ts +1 -1
- package/node_modules/undici/types/cache-interceptor.d.ts +10 -0
- package/node_modules/undici/types/client.d.ts +10 -4
- package/node_modules/undici/types/errors.d.ts +16 -1
- package/node_modules/undici/types/h2c-client.d.ts +1 -1
- package/node_modules/undici/types/interceptors.d.ts +6 -1
- package/node_modules/undici/types/utility.d.ts +4 -4
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
- package/node_modules/zod/src/v4/core/compile.ts +9 -0
- package/node_modules/zod/src/v4/core/schemas.ts +35 -1
- package/node_modules/zod/src/v4/core/util.ts +13 -0
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/v4/core/compile.cjs +8 -0
- package/node_modules/zod/v4/core/compile.js +8 -0
- package/node_modules/zod/v4/core/schemas.cjs +30 -0
- package/node_modules/zod/v4/core/schemas.d.cts +3 -1
- package/node_modules/zod/v4/core/schemas.d.ts +3 -1
- package/node_modules/zod/v4/core/schemas.js +30 -0
- package/node_modules/zod/v4/core/util.cjs +15 -0
- package/node_modules/zod/v4/core/util.d.cts +2 -0
- package/node_modules/zod/v4/core/util.d.ts +2 -0
- package/node_modules/zod/v4/core/util.js +14 -0
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/openclaw.plugin.json +6 -30
- package/package.json +7 -7
- package/dist/.setup/action-runtime.runtime-Ck_j1YTn.mjs +0 -1
- package/dist/.setup/http-C9sM-FXe.mjs +0 -2
- package/dist/.setup/plugin-routes-D4qozHVn.mjs +0 -22
- package/dist/.setup/probe-IiHogLQN.mjs +0 -694
- package/dist/.setup/registry-DizWcnNp.mjs +0 -36
- package/dist/.setup/runtime-setter-api-Cx_PV-xu.mjs +0 -2
- package/dist/.setup/setup-plugin-api-B18kDKtr.mjs +0 -2
- package/dist/.setup/shared-DpHCoKy2.mjs +0 -259
- package/dist/.source-module-urls/562d694877afe9d9dcbb3b32a8883c16974738f2aa892c48d45572cdc9a62529.json +0 -1
- package/dist/http-routes-api.js +0 -1
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/LICENSE +0 -22
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/README.md +0 -71
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/package.json +0 -52
- package/node_modules/@slack/bolt/node_modules/content-disposition/index.js +0 -536
- package/node_modules/@slack/bolt/node_modules/content-type/HISTORY.md +0 -29
- package/node_modules/@slack/bolt/node_modules/content-type/index.js +0 -225
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/LICENSE +0 -22
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/README.md +0 -71
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +0 -46
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js +0 -176
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js.map +0 -1
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/package.json +0 -52
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/LICENSE +0 -22
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/README.md +0 -71
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.d.ts +0 -46
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js +0 -176
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js.map +0 -1
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/package.json +0 -52
- package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
- package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
- /package/node_modules/@slack/bolt/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.d.ts +0 -0
- /package/node_modules/@slack/bolt/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.js +0 -0
- /package/node_modules/@slack/bolt/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.js.map +0 -0
|
@@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/*!\n * content-disposition\n * Copyright(c) 2014-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\nexport interface ContentDisposition {\n /**\n * Content-Disposition type, such as \"attachment\" or \"inline\"\n */\n type: string;\n /**\n * Content-Disposition parameters, such as \"filename\"\n */\n parameters: Record<string, string>;\n}\n\n/**\n * Null object perf optimization. Faster than `Object.create(null)` and `{ __proto__: null }`.\n */\nconst NullObject = /* @__PURE__ */ (() => {\n const C = function () {};\n C.prototype = Object.create(null);\n return C;\n})() as unknown as { new (): any };\n\nexport interface CreateOptions {\n /**\n * Content-Disposition type, defaults to \"attachment\"\n * @default \"attachment\"\n */\n type?: string;\n /**\n * Fallback filename for non-US-ASCII strings. If true, a fallback will be generated by replacing non-US-ASCII characters with \"?\". If false, no fallback will be generated.\n * @default true\n */\n fallback?: string | boolean;\n}\n\n/**\n * Create an attachment Content-Disposition header.\n */\nexport function create(filename?: string, options?: CreateOptions): string {\n const type = options?.type || 'attachment';\n const parameters = createParameters(filename, options?.fallback);\n\n return format({ type, parameters }, { extended: false });\n}\n\nconst SP = 32; // \" \"\nconst HTAB = 9; // \"\\t\"\nconst SEMI = 59; // \";\"\nconst EQ = 61; // \"=\"\nconst DQUOTE = 34; // '\"'\nconst BSLASH = 92; // \"\\\\\"\nconst ASTERISK = 42; // \"*\"\n\nexport interface ParseOptions {\n /**\n * Whether to decode RFC 8187 encoded parameters.\n * @default true\n */\n extended?: boolean;\n /**\n * Parse parameters as sent by browsers in `multipart/form-data`.\n * @default false\n */\n multipart?: boolean;\n}\n\n/**\n * Parse Content-Disposition header string.\n */\nexport function parse(\n header: string,\n options?: ParseOptions,\n): ContentDisposition {\n const len = header.length;\n const multipart = options?.multipart === true;\n const extended = options?.extended !== false;\n let index = skipOWS(header, 0, header.length);\n\n const typeStart = index;\n index = parseToken(header, index, len);\n const typeEnd = trailingOWS(header, typeStart, index);\n const type = header.slice(typeStart, typeEnd).toLowerCase();\n\n const parameters: Record<string, string> = new NullObject();\n\n parameter: while (index < len) {\n index = skipOWS(header, index + 1, len); // Skip over semicolon.\n\n const keyStart = index;\n\n while (index < len) {\n const char = header.charCodeAt(index);\n if (char === SEMI) continue parameter;\n\n if (char === EQ) {\n const keyEnd = trailingOWS(header, keyStart, index);\n const key = header.slice(keyStart, keyEnd).toLowerCase();\n\n index = skipOWS(header, index + 1, len);\n\n if (index < len && header.charCodeAt(index) === DQUOTE) {\n index++;\n\n let value = '';\n\n if (multipart) {\n while (index < len) {\n const code = header.charCodeAt(index++);\n if (code === DQUOTE) {\n index = parseToken(header, index, len);\n if (parameters[key] === undefined) parameters[key] = value;\n break;\n }\n\n if (code === /* % */ 37 && index + 1 < len) {\n const code2 = header.charCodeAt(index);\n const code3 = header.charCodeAt(index + 1);\n\n if (code2 === 50 /* \"2\" */ && code3 === 50 /* \"2\" */) {\n value += '\"';\n index += 2;\n continue;\n }\n\n if (code2 === 48 /* \"0\" */) {\n if (code3 === 100 /* \"d\" */ || code3 === 68 /* \"D\" */) {\n value += '\\r';\n index += 2;\n continue;\n }\n\n if (code3 === 97 /* \"a\" */ || code3 === 65 /* \"A\" */) {\n value += '\\n';\n index += 2;\n continue;\n }\n }\n }\n\n value += String.fromCharCode(code);\n }\n } else {\n while (index < len) {\n const code = header.charCodeAt(index++);\n if (code === DQUOTE) {\n index = parseToken(header, index, len);\n if (parameters[key] === undefined) parameters[key] = value;\n break;\n }\n\n if (code === BSLASH && index < len) {\n value += header[index++];\n continue;\n }\n\n value += String.fromCharCode(code);\n }\n }\n\n continue parameter;\n }\n\n const valueStart = index;\n index = parseToken(header, index, len);\n const valueEnd = trailingOWS(header, valueStart, index);\n const value = header.slice(valueStart, valueEnd);\n\n if (parameters[key] === undefined) {\n parameters[key] = value;\n\n if (extended && key.charCodeAt(key.length - 1) === ASTERISK) {\n const normalizedKey = key.slice(0, -1);\n const decoded = decodeExtended(value);\n if (decoded !== undefined) parameters[normalizedKey] = decoded;\n }\n }\n\n continue parameter;\n }\n\n index++;\n }\n }\n\n return { type, parameters };\n}\n\n/**\n * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including \"%\")\n */\nconst ENCODE_URL_ATTR_CHAR_REGEXP = /[\\x00-\\x20\"'()*,/:;<=>?@[\\\\\\]{}\\x7f]/g; // eslint-disable-line no-control-regex\n\n/**\n * RegExp to match non-US-ASCII characters.\n */\nconst NON_ASCII_REGEXP = /[^\\x20-\\x7e]/g;\n\n/**\n * RegExp to match chars that must be quoted-pair in RFC 2616\n */\nconst QUOTE_REGEXP = /[\\\\\"]/g;\n\n/**\n * Match chars that can't be used in the filename for compatibility.\n */\nconst INVALID_FILENAME_REGEXP = /%[0-9A-Fa-f]{2}/;\n\n/**\n * RegExp for various RFC 2616 grammar\n *\n * parameter = token \"=\" ( token | quoted-string )\n * token = 1*<any CHAR except CTLs or separators>\n * separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n * | \",\" | \";\" | \":\" | \"\\\" | <\">\n * | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n * | \"{\" | \"}\" | SP | HT\n * quoted-string = ( <\"> *(qdtext | quoted-pair ) <\"> )\n * qdtext = <any TEXT except <\">>\n * quoted-pair = \"\\\" CHAR\n * CHAR = <any US-ASCII character (octets 0 - 127)>\n * TEXT = <any OCTET except CTLs, but including LWS>\n * LWS = [CRLF] 1*( SP | HT )\n * CRLF = CR LF\n * CR = <US-ASCII CR, carriage return (13)>\n * LF = <US-ASCII LF, linefeed (10)>\n * SP = <US-ASCII SP, space (32)>\n * HT = <US-ASCII HT, horizontal-tab (9)>\n * CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)>\n * OCTET = <any 8-bit sequence of data>\n */\nconst TEXT_REGEXP = /^[\\x20-\\x7e\\x80-\\xff]*$/;\nconst ASCII_TEXT_REGEXP = /^[\\x20-\\x7e]*$/;\nconst TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/;\n\n/**\n * Create parameters object from filename and fallback.\n */\nfunction createParameters(\n filename?: string,\n fallback: string | boolean = true,\n): Record<string, string> | undefined {\n if (filename === undefined) return;\n\n if (typeof fallback === 'string') {\n if (!ASCII_TEXT_REGEXP.test(fallback)) {\n throw new TypeError('Fallback must be valid US-ASCII: ' + fallback);\n }\n\n if (fallback === filename) return { filename };\n return { filename: fallback, 'filename*': encodeExtended(filename) };\n }\n\n // Use `filename` when possible, otherwise use `filename*`.\n if (\n ASCII_TEXT_REGEXP.test(filename) &&\n !INVALID_FILENAME_REGEXP.test(filename)\n ) {\n return { filename };\n }\n\n if (fallback === false) {\n return { 'filename*': encodeExtended(filename) };\n }\n\n return {\n filename: getAscii(filename),\n 'filename*': encodeExtended(filename),\n };\n}\n\n/**\n * Decode a RFC 8187 field value (gracefully).\n */\nexport function decodeExtended(str: string): string | undefined {\n const charsetEnd = str.indexOf(\"'\");\n if (charsetEnd <= 0) {\n return undefined;\n }\n\n const languageEnd = str.indexOf(\"'\", charsetEnd + 1);\n if (languageEnd === -1) {\n return undefined;\n }\n\n const charset = str.slice(0, charsetEnd).toLowerCase();\n const encoded = str.slice(languageEnd + 1);\n\n switch (charset) {\n case 'iso-8859-1': {\n return decodeHexEscapes(encoded);\n }\n case 'utf-8':\n case 'utf8': {\n return tryDecodeURIComponent(encoded);\n }\n }\n\n return undefined;\n}\n\n/**\n * Decode URI component but return `undefined` on error.\n */\nfunction tryDecodeURIComponent(str: string): string | undefined {\n try {\n return decodeURIComponent(str);\n } catch {\n return undefined;\n }\n}\n\n/**\n * Parse a token starting at the provided index.\n */\nfunction parseToken(str: string, index: number, len: number): number {\n while (index < len) {\n const char = str.charCodeAt(index);\n if (char === SEMI) break;\n index++;\n }\n return index;\n}\n\n/**\n * Skip RFC 2616 linear whitespace (space / tab).\n */\nfunction skipOWS(str: string, index: number, len: number): number {\n while (index < len) {\n const char = str.charCodeAt(index);\n if (char !== SP && char !== HTAB) break;\n index++;\n }\n return index;\n}\n\n/**\n * Skip RFC 2616 linear whitespace (space / tab) from the end of a string.\n */\nfunction trailingOWS(str: string, start: number, end: number): number {\n while (end > start) {\n const char = str.charCodeAt(end - 1);\n if (char !== SP && char !== HTAB) break;\n end--;\n }\n return end;\n}\n\nexport interface FormatOptions {\n /**\n * Whether to use extended parameter encoding for non-ISO-8859-1 strings.\n * If false, an error will be thrown when formatting such strings.\n * @default true\n */\n extended?: boolean;\n /**\n * Format parameters as sent by browsers in `multipart/form-data`.\n * @default false\n */\n multipart?: boolean;\n}\n\n/**\n * Format object to Content-Disposition header.\n */\nexport function format(\n obj: Partial<ContentDisposition>,\n options?: FormatOptions,\n): string {\n const { type, parameters } = obj;\n const multipart = options?.multipart === true;\n const extended = options?.extended !== false;\n\n if (!type || !TOKEN_REGEXP.test(type)) {\n throw new TypeError('Invalid type: ' + type);\n }\n\n let result = type;\n\n if (parameters) {\n for (const param of Object.keys(parameters)) {\n const value = parameters[param];\n\n if (!TOKEN_REGEXP.test(param)) {\n throw new TypeError('Invalid parameter name: ' + param);\n }\n\n if (multipart) {\n result += '; ' + param + '=' + qmultipart(value);\n continue;\n }\n\n if (TOKEN_REGEXP.test(value)) {\n result += '; ' + param + '=' + value;\n continue;\n }\n\n if (TEXT_REGEXP.test(value)) {\n result += '; ' + param + '=' + qstring(value);\n continue;\n }\n\n if (!extended) {\n throw new TypeError('Invalid parameter value: ' + value);\n }\n\n result += '; ' + param + '*=' + encodeExtended(value);\n }\n }\n\n return result;\n}\n\n/**\n * Get US-ASCII version of string.\n */\nfunction getAscii(val: string): string {\n // simple Unicode -> US-ASCII transformation\n return val.replace(NON_ASCII_REGEXP, '?');\n}\n\n/**\n * Percent encode a single character.\n */\nfunction pencode(char: string): string {\n return '%' + char.charCodeAt(0).toString(16).toUpperCase();\n}\n\n/**\n * Quote a string for HTTP.\n */\nfunction qstring(str: string): string {\n return '\"' + str.replace(QUOTE_REGEXP, '\\\\$&') + '\"';\n}\n\n/**\n * Quote a string for multipart/form-data.\n *\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart-form-data\n */\nfunction qmultipart(str: string): string {\n return '\"' + str.replace(/[\\n\\r\"]/g, multipartEscape) + '\"';\n}\n\n/**\n * Escape a multipart/form-data string character.\n */\nfunction multipartEscape(char: string): string {\n if (char === '\\n') return '%0A';\n if (char === '\\r') return '%0D';\n return '%22';\n}\n\n/**\n * Encode a Unicode string for HTTP (RFC 8187).\n */\nexport function encodeExtended(str: string): string {\n const encoded = encodeURIComponent(str).replace(\n ENCODE_URL_ATTR_CHAR_REGEXP,\n pencode,\n );\n\n return \"UTF-8''\" + encoded;\n}\n\n/**\n * Check if a character is a hex digit [0-9A-Fa-f]\n */\nfunction isHexDigit(char: string): boolean {\n const code = char.charCodeAt(0);\n return (\n (code >= 48 && code <= 57) || // 0-9\n (code >= 65 && code <= 70) || // A-F\n (code >= 97 && code <= 102) // a-f\n );\n}\n\n/**\n * Decode hex escapes in a string (e.g., %20 -> space)\n */\nfunction decodeHexEscapes(str: string): string {\n const firstEscape = str.indexOf('%');\n if (firstEscape === -1) return str;\n\n let result = str.slice(0, firstEscape);\n for (let idx = firstEscape; idx < str.length; idx++) {\n if (\n str[idx] === '%' &&\n idx + 2 < str.length &&\n isHexDigit(str[idx + 1]) &&\n isHexDigit(str[idx + 2])\n ) {\n result += String.fromCharCode(\n Number.parseInt(str[idx + 1] + str[idx + 2], 16),\n );\n idx += 2;\n } else {\n result += str[idx];\n }\n }\n return result;\n}\n"]}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "content-disposition",
|
|
3
|
+
"version": "2.0.1",
|
|
3
4
|
"description": "Create and parse Content-Disposition header",
|
|
4
|
-
"version": "1.1.0",
|
|
5
|
-
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
|
6
|
-
"license": "MIT",
|
|
7
5
|
"keywords": [
|
|
8
6
|
"content-disposition",
|
|
9
7
|
"http",
|
|
@@ -15,26 +13,40 @@
|
|
|
15
13
|
"type": "opencollective",
|
|
16
14
|
"url": "https://opencollective.com/express"
|
|
17
15
|
},
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"eslint-plugin-node": "^11.1.0",
|
|
25
|
-
"eslint-plugin-promise": "^6.6.0",
|
|
26
|
-
"eslint-plugin-standard": "^4.1.0"
|
|
27
|
-
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
|
18
|
+
"type": "commonjs",
|
|
19
|
+
"exports": "./dist/index.js",
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
28
22
|
"files": [
|
|
29
|
-
"
|
|
23
|
+
"dist/"
|
|
30
24
|
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"bench": "vitest bench",
|
|
27
|
+
"build": "ts-scripts build",
|
|
28
|
+
"demo": "node demo/server.js",
|
|
29
|
+
"format": "ts-scripts format",
|
|
30
|
+
"lint": "ts-scripts lint",
|
|
31
|
+
"prepare": "ts-scripts install && npm run build",
|
|
32
|
+
"specs": "ts-scripts specs",
|
|
33
|
+
"test": "ts-scripts test"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@borderless/ts-scripts": "^0.15.0",
|
|
37
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
38
|
+
"typescript": "^5.9.3",
|
|
39
|
+
"vitest": "^3.2.4"
|
|
40
|
+
},
|
|
31
41
|
"engines": {
|
|
32
42
|
"node": ">=18"
|
|
33
43
|
},
|
|
34
|
-
"scripts": {
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
44
|
+
"ts-scripts": {
|
|
45
|
+
"dist": [
|
|
46
|
+
"dist"
|
|
47
|
+
],
|
|
48
|
+
"project": [
|
|
49
|
+
"tsconfig.build.json"
|
|
50
|
+
]
|
|
39
51
|
}
|
|
40
52
|
}
|
|
@@ -1,81 +1,57 @@
|
|
|
1
1
|
# content-type
|
|
2
2
|
|
|
3
|
-
[![NPM
|
|
4
|
-
[![NPM
|
|
5
|
-
[![
|
|
6
|
-
[![Build
|
|
7
|
-
[![
|
|
3
|
+
[![NPM version][npm-image]][npm-url]
|
|
4
|
+
[![NPM downloads][downloads-image]][downloads-url]
|
|
5
|
+
[![Build status][build-image]][build-url]
|
|
6
|
+
[![Build coverage][coverage-image]][coverage-url]
|
|
7
|
+
[![License][license-image]][license-url]
|
|
8
8
|
|
|
9
|
-
Create and parse HTTP Content-Type header
|
|
9
|
+
Create and parse HTTP `Content-Type` header.
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
-
|
|
14
|
+
npm install content-type
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## API
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
|
-
|
|
20
|
+
const contentType = require("content-type");
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
### contentType.parse(string)
|
|
23
|
+
### contentType.parse(string, options?)
|
|
24
24
|
|
|
25
25
|
```js
|
|
26
|
-
|
|
26
|
+
const obj = contentType.parse("image/svg+xml; charset=utf-8");
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
Parse a `Content-Type` header. This will return an object with the following
|
|
30
|
-
properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`):
|
|
29
|
+
Parse a `Content-Type` header. This will return an object with the following properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`):
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
- `type`: The media type. Example: `'image/svg+xml'`.
|
|
32
|
+
- `parameters`: An object of the parameters in the media type (parameter name is always lower case). Example: `{charset: 'utf-8'}`.
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
always lower case). Example: `{charset: 'utf-8'}`
|
|
34
|
+
The parser is lenient and does not error. You should validate `type` and `parameters` before trusting them.
|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
#### Options
|
|
39
37
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var obj = contentType.parse(req)
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Parse the `Content-Type` header from the given `req`. Short-cut for
|
|
47
|
-
`contentType.parse(req.headers['content-type'])`.
|
|
48
|
-
|
|
49
|
-
Throws a `TypeError` if the `Content-Type` header is missing or invalid.
|
|
50
|
-
|
|
51
|
-
### contentType.parse(res)
|
|
52
|
-
|
|
53
|
-
```js
|
|
54
|
-
var obj = contentType.parse(res)
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Parse the `Content-Type` header set on the given `res`. Short-cut for
|
|
58
|
-
`contentType.parse(res.getHeader('content-type'))`.
|
|
59
|
-
|
|
60
|
-
Throws a `TypeError` if the `Content-Type` header is missing or invalid.
|
|
38
|
+
- `parameters` (default: `true`): Set to `false` to skip parameters.
|
|
39
|
+
- `comma` (default: `false`): Set to `true` to stop on a comma. This can be used to parse the media range in an `Accept` header.
|
|
40
|
+
- `start` (default: `0`): Set index to start parsing from.
|
|
61
41
|
|
|
62
42
|
### contentType.format(obj)
|
|
63
43
|
|
|
64
44
|
```js
|
|
65
|
-
|
|
66
|
-
type:
|
|
67
|
-
parameters: { charset:
|
|
68
|
-
})
|
|
45
|
+
const str = contentType.format({
|
|
46
|
+
type: "image/svg+xml",
|
|
47
|
+
parameters: { charset: "utf-8" },
|
|
48
|
+
});
|
|
69
49
|
```
|
|
70
50
|
|
|
71
|
-
Format an object into a `Content-Type` header. This will return a string of the
|
|
72
|
-
content type for the given object with the following properties (examples are
|
|
73
|
-
shown that produce the string `'image/svg+xml; charset=utf-8'`):
|
|
74
|
-
|
|
75
|
-
- `type`: The media type (will be lower-cased). Example: `'image/svg+xml'`
|
|
51
|
+
Format an object into a `Content-Type` header. This will return a string of the content type for the given object with the following properties (examples are shown that produce the string `'image/svg+xml; charset=utf-8'`):
|
|
76
52
|
|
|
77
|
-
|
|
78
|
-
|
|
53
|
+
- `type`: The media type. Example: `'image/svg+xml'`.
|
|
54
|
+
- `parameters`: An optional object of the parameters in the media type. Example: `{charset: 'utf-8'}`.
|
|
79
55
|
|
|
80
56
|
Throws a `TypeError` if the object contains an invalid type or parameter names.
|
|
81
57
|
|
|
@@ -83,12 +59,13 @@ Throws a `TypeError` if the object contains an invalid type or parameter names.
|
|
|
83
59
|
|
|
84
60
|
[MIT](LICENSE)
|
|
85
61
|
|
|
86
|
-
[
|
|
87
|
-
[ci-url]: https://github.com/jshttp/content-type/actions/workflows/ci.yml
|
|
88
|
-
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/content-type/master
|
|
89
|
-
[coveralls-url]: https://coveralls.io/r/jshttp/content-type?branch=master
|
|
90
|
-
[node-image]: https://badgen.net/npm/node/content-type
|
|
91
|
-
[node-url]: https://nodejs.org/en/download
|
|
92
|
-
[npm-downloads-image]: https://badgen.net/npm/dm/content-type
|
|
62
|
+
[npm-image]: https://img.shields.io/npm/v/content-type
|
|
93
63
|
[npm-url]: https://npmjs.org/package/content-type
|
|
94
|
-
[
|
|
64
|
+
[downloads-image]: https://img.shields.io/npm/dm/content-type
|
|
65
|
+
[downloads-url]: https://npmjs.org/package/content-type
|
|
66
|
+
[build-image]: https://img.shields.io/github/actions/workflow/status/jshttp/content-type/ci.yml?branch=master
|
|
67
|
+
[build-url]: https://github.com/jshttp/content-type/actions/workflows/ci.yml?query=branch%3Amaster
|
|
68
|
+
[coverage-image]: https://img.shields.io/codecov/c/gh/jshttp/content-type
|
|
69
|
+
[coverage-url]: https://codecov.io/gh/jshttp/content-type
|
|
70
|
+
[license-image]: http://img.shields.io/npm/l/content-type.svg?style=flat
|
|
71
|
+
[license-url]: LICENSE
|
|
@@ -1,42 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "content-type",
|
|
3
|
+
"version": "2.1.0",
|
|
3
4
|
"description": "Create and parse HTTP Content-Type header",
|
|
4
|
-
"version": "1.0.5",
|
|
5
|
-
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
|
6
|
-
"license": "MIT",
|
|
7
5
|
"keywords": [
|
|
8
6
|
"content-type",
|
|
9
7
|
"http",
|
|
10
8
|
"req",
|
|
11
9
|
"res",
|
|
12
|
-
"rfc7231"
|
|
10
|
+
"rfc7231",
|
|
11
|
+
"rfc9110"
|
|
13
12
|
],
|
|
14
13
|
"repository": "jshttp/content-type",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"eslint-config-standard": "15.0.1",
|
|
19
|
-
"eslint-plugin-import": "2.27.5",
|
|
20
|
-
"eslint-plugin-node": "11.1.0",
|
|
21
|
-
"eslint-plugin-promise": "6.1.1",
|
|
22
|
-
"eslint-plugin-standard": "4.1.0",
|
|
23
|
-
"mocha": "10.2.0",
|
|
24
|
-
"nyc": "15.1.0"
|
|
14
|
+
"funding": {
|
|
15
|
+
"type": "opencollective",
|
|
16
|
+
"url": "https://opencollective.com/express"
|
|
25
17
|
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
|
20
|
+
"type": "commonjs",
|
|
21
|
+
"exports": "./dist/index.js",
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"typings": "./dist/index.d.ts",
|
|
26
24
|
"files": [
|
|
27
|
-
"
|
|
28
|
-
"HISTORY.md",
|
|
29
|
-
"README.md",
|
|
30
|
-
"index.js"
|
|
25
|
+
"dist/"
|
|
31
26
|
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"bench": "vitest bench",
|
|
29
|
+
"build": "ts-scripts build",
|
|
30
|
+
"format": "ts-scripts format",
|
|
31
|
+
"prepare": "ts-scripts install && npm run build",
|
|
32
|
+
"specs": "ts-scripts specs",
|
|
33
|
+
"test": "ts-scripts test"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@borderless/ts-scripts": "^0.15.0",
|
|
37
|
+
"@vitest/coverage-v8": "^3.0.5",
|
|
38
|
+
"typescript": "^5.7.3",
|
|
39
|
+
"vitest": "^3.2.4"
|
|
40
|
+
},
|
|
32
41
|
"engines": {
|
|
33
|
-
"node": ">=
|
|
42
|
+
"node": ">=18"
|
|
34
43
|
},
|
|
35
|
-
"scripts": {
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
44
|
+
"ts-scripts": {
|
|
45
|
+
"dist": [
|
|
46
|
+
"dist"
|
|
47
|
+
],
|
|
48
|
+
"project": [
|
|
49
|
+
"tsconfig.build.json"
|
|
50
|
+
]
|
|
41
51
|
}
|
|
42
52
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
<a href="https://expressjs.com/">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://expressjs.com/images/logos/logo-express-white.svg">
|
|
4
|
+
<img alt="Express Logo" src="https://expressjs.com/images/logos/logo-express-black.svg" width="280">
|
|
5
|
+
</picture>
|
|
6
|
+
</a>
|
|
2
7
|
|
|
3
8
|
**Fast, unopinionated, minimalist web framework for [Node.js](https://nodejs.org).**
|
|
4
9
|
|
|
5
|
-
**This project has a [Code of Conduct].**
|
|
6
|
-
|
|
7
10
|
## Table of contents
|
|
8
11
|
|
|
9
|
-
- [Table of contents](#table-of-contents)
|
|
10
12
|
- [Installation](#installation)
|
|
11
13
|
- [Features](#features)
|
|
12
14
|
- [Docs \& Community](#docs--community)
|
|
@@ -57,7 +59,7 @@ If this is a brand new project, make sure to create a `package.json` first with
|
|
|
57
59
|
the [`npm init` command](https://docs.npmjs.com/creating-a-package-json-file).
|
|
58
60
|
|
|
59
61
|
Installation is done using the
|
|
60
|
-
[`npm install` command](https://docs.npmjs.com/
|
|
62
|
+
[`npm install` command](https://docs.npmjs.com/downloading-and-installing-packages-locally):
|
|
61
63
|
|
|
62
64
|
```bash
|
|
63
65
|
npm install express
|
|
@@ -80,7 +82,7 @@ for more information.
|
|
|
80
82
|
|
|
81
83
|
* [Website and Documentation](https://expressjs.com/) - [[website repo](https://github.com/expressjs/expressjs.com)]
|
|
82
84
|
* [GitHub Organization](https://github.com/expressjs) for Official Middleware & Modules
|
|
83
|
-
* [
|
|
85
|
+
* [GitHub Discussions](https://github.com/expressjs/discussions) for discussion on the development and usage of Express
|
|
84
86
|
|
|
85
87
|
**PROTIP** Be sure to read the [migration guide to v5](https://expressjs.com/en/guide/migrating-5)
|
|
86
88
|
|
|
@@ -152,9 +154,11 @@ tests, triaging incoming pull requests and issues, and more!
|
|
|
152
154
|
|
|
153
155
|
See the [Contributing Guide] for more technical details on contributing.
|
|
154
156
|
|
|
157
|
+
This project has a [Code of Conduct]. By participating, you are expected to uphold this code.
|
|
158
|
+
|
|
155
159
|
### Security Issues
|
|
156
160
|
|
|
157
|
-
If you discover a security vulnerability in Express, please see [Security Policies and Procedures](
|
|
161
|
+
If you discover a security vulnerability in Express, please see [Security Policies and Procedures](https://github.com/expressjs/express/security/policy).
|
|
158
162
|
|
|
159
163
|
### Running Tests
|
|
160
164
|
|
|
@@ -212,7 +216,9 @@ The original author of Express is [TJ Holowaychuk](https://github.com/tj)
|
|
|
212
216
|
* [IamLizu](https://github.com/IamLizu) - **S M Mahmudul Hasan** (he/him)
|
|
213
217
|
* [Phillip9587](https://github.com/Phillip9587) - **Phillip Barta**
|
|
214
218
|
* [efekrskl](https://github.com/efekrskl) - **Efe Karasakal**
|
|
215
|
-
|
|
219
|
+
* [rxmarbles](https://github.com/rxmarbles) - **Rick Markins** (he/him)
|
|
220
|
+
* [krzysdz](https://github.com/krzysdz)
|
|
221
|
+
* [GroophyLifefor](https://github.com/GroophyLifefor) - **Murat Kirazkaya**
|
|
216
222
|
|
|
217
223
|
<details>
|
|
218
224
|
<summary>Triagers emeriti members</summary>
|
|
@@ -247,7 +253,7 @@ The original author of Express is [TJ Holowaychuk](https://github.com/tj)
|
|
|
247
253
|
* [tunniclm](https://github.com/tunniclm) - **Mike Tunnicliffe**
|
|
248
254
|
* [enyoghasim](https://github.com/enyoghasim) - **David Enyoghasim**
|
|
249
255
|
* [0ss](https://github.com/0ss) - **Salah**
|
|
250
|
-
* [
|
|
256
|
+
* [ejcheng](https://github.com/ejcheng)- **Eric Cheng** (he/him)
|
|
251
257
|
* [dakshkhetan](https://github.com/dakshkhetan) - **Daksh Khetan** (he/him)
|
|
252
258
|
* [lucasraziel](https://github.com/lucasraziel) - **Lucas Soares Do Rego**
|
|
253
259
|
* [mertcanaltin](https://github.com/mertcanaltin) - **Mert Can Altin**
|
|
@@ -523,7 +523,7 @@ app.render = function render(name, options, callback) {
|
|
|
523
523
|
var cache = this.cache;
|
|
524
524
|
var done = callback;
|
|
525
525
|
var engines = this.engines;
|
|
526
|
-
var opts = options;
|
|
526
|
+
var opts = options || {};
|
|
527
527
|
var view;
|
|
528
528
|
|
|
529
529
|
// support callback function as second arg
|
|
@@ -614,7 +614,7 @@ app.listen = function listen() {
|
|
|
614
614
|
|
|
615
615
|
function logerror(err) {
|
|
616
616
|
/* istanbul ignore next */
|
|
617
|
-
if (this.get('env') !== 'test') console.error(err
|
|
617
|
+
if (this.get('env') !== 'test') console.error(err);
|
|
618
618
|
}
|
|
619
619
|
|
|
620
620
|
/**
|
|
@@ -83,16 +83,13 @@ req.header = function header(name) {
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* To do: update docs.
|
|
87
|
-
*
|
|
88
86
|
* Check if the given `type(s)` is acceptable, returning
|
|
89
|
-
* the best match when true, otherwise `
|
|
87
|
+
* the best match when true, otherwise `false`, in which
|
|
90
88
|
* case you should respond with 406 "Not Acceptable".
|
|
91
89
|
*
|
|
92
90
|
* The `type` value may be a single MIME type string
|
|
93
91
|
* such as "application/json", an extension name
|
|
94
|
-
* such as "json",
|
|
95
|
-
* an argument list such as `"json", "html", "text/plain"`,
|
|
92
|
+
* such as "json", an argument list such as `"json", "html", "text/plain"`,
|
|
96
93
|
* or an array `["json", "html", "text/plain"]`. When a list
|
|
97
94
|
* or array is given, the _best_ match, if any is returned.
|
|
98
95
|
*
|
|
@@ -107,7 +104,7 @@ req.header = function header(name) {
|
|
|
107
104
|
* // => "html"
|
|
108
105
|
* req.accepts('text/html');
|
|
109
106
|
* // => "text/html"
|
|
110
|
-
* req.accepts('json, text');
|
|
107
|
+
* req.accepts('json', 'text');
|
|
111
108
|
* // => "json"
|
|
112
109
|
* req.accepts('application/json');
|
|
113
110
|
* // => "application/json"
|
|
@@ -115,12 +112,11 @@ req.header = function header(name) {
|
|
|
115
112
|
* // Accept: text/*, application/json
|
|
116
113
|
* req.accepts('image/png');
|
|
117
114
|
* req.accepts('png');
|
|
118
|
-
* // =>
|
|
115
|
+
* // => false
|
|
119
116
|
*
|
|
120
117
|
* // Accept: text/*;q=.5, application/json
|
|
121
118
|
* req.accepts(['html', 'json']);
|
|
122
119
|
* req.accepts('html', 'json');
|
|
123
|
-
* req.accepts('html, json');
|
|
124
120
|
* // => "json"
|
|
125
121
|
*
|
|
126
122
|
* @param {String|Array} type(s)
|
|
@@ -147,17 +143,34 @@ req.acceptsEncodings = function(){
|
|
|
147
143
|
};
|
|
148
144
|
|
|
149
145
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
146
|
+
* Checks if the specified `charset`s are acceptable based on the request's `Accept-Charset` header.
|
|
147
|
+
* Returns the best matching charset or an array of acceptable charsets.
|
|
152
148
|
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
149
|
+
* The `charset` argument(s) can be:
|
|
150
|
+
* - A single charset string (e.g., "utf-8")
|
|
151
|
+
* - Multiple charset strings as arguments (e.g., `"utf-8", "iso-8859-1"`)
|
|
152
|
+
* - A comma-delimited list of charsets (e.g., `"utf-8, iso-8859-1"`)
|
|
153
|
+
*
|
|
154
|
+
* Examples:
|
|
155
|
+
*
|
|
156
|
+
* // Accept-Charset: utf-8, iso-8859-1
|
|
157
|
+
* req.acceptsCharsets('utf-8');
|
|
158
|
+
* // => "utf-8"
|
|
159
|
+
*
|
|
160
|
+
* req.acceptsCharsets('utf-8', 'iso-8859-1');
|
|
161
|
+
* // => "utf-8"
|
|
162
|
+
*
|
|
163
|
+
* req.acceptsCharsets('utf-8, utf-16');
|
|
164
|
+
* // => "utf-8"
|
|
165
|
+
*
|
|
166
|
+
* @param {...String} charsets - The charset(s) to check against the `Accept-Charset` header.
|
|
167
|
+
* @return {String|Array} - The best matching charset, or an array of acceptable charsets.
|
|
155
168
|
* @public
|
|
156
169
|
*/
|
|
157
170
|
|
|
158
|
-
req.acceptsCharsets = function(){
|
|
159
|
-
|
|
160
|
-
return accept.charsets
|
|
171
|
+
req.acceptsCharsets = function(...charsets) {
|
|
172
|
+
const accept = accepts(this);
|
|
173
|
+
return accept.charsets(...charsets);
|
|
161
174
|
};
|
|
162
175
|
|
|
163
176
|
/**
|
|
@@ -317,7 +330,7 @@ defineGetter(req, 'secure', function secure(){
|
|
|
317
330
|
/**
|
|
318
331
|
* Return the remote address from the trusted proxy.
|
|
319
332
|
*
|
|
320
|
-
*
|
|
333
|
+
* This is the remote address on the socket unless
|
|
321
334
|
* "trust proxy" is set.
|
|
322
335
|
*
|
|
323
336
|
* @return {String}
|
|
@@ -411,7 +424,7 @@ defineGetter(req, 'host', function host(){
|
|
|
411
424
|
} else if (val.indexOf(',') !== -1) {
|
|
412
425
|
// Note: X-Forwarded-Host is normally only ever a
|
|
413
426
|
// single value, but this is to be safe.
|
|
414
|
-
val = val.substring(0, val.indexOf(',')).
|
|
427
|
+
val = val.substring(0, val.indexOf(',')).trimEnd()
|
|
415
428
|
}
|
|
416
429
|
|
|
417
430
|
return val || undefined;
|
|
@@ -458,8 +471,8 @@ defineGetter(req, 'fresh', function(){
|
|
|
458
471
|
var res = this.res
|
|
459
472
|
var status = res.statusCode
|
|
460
473
|
|
|
461
|
-
// GET or
|
|
462
|
-
if ('GET' !== method && 'HEAD' !== method) return false;
|
|
474
|
+
// GET, HEAD, or QUERY for weak freshness validation only
|
|
475
|
+
if ('GET' !== method && 'HEAD' !== method && 'QUERY' !== method) return false;
|
|
463
476
|
|
|
464
477
|
// 2xx or 304 as per rfc2616 14.26
|
|
465
478
|
if ((status >= 200 && status < 300) || 304 === status) {
|