Some checks are pending
CI / verify (push) Waiting to run
requestJson merged Content-Type: application/json into a headers object,
then spread `...extra` after `headers` in the fetch options — which let
extra.headers (always passed by webexJson for Authorization) overwrite
the merged object, stripping Content-Type entirely. Undici then
defaulted the string body's Content-Type to text/plain;charset=UTF-8,
and strict Webex endpoints like POST /locations rejected the request
with HTTP 415. Latent since the node-fetch -> native fetch migration.
Reorder to `{ method, ...extra, headers }` so the explicit merged
headers win, and add a test/http.test.js suite (7 tests) that pins the
merge behaviour down so this can't regress silently again.
Also: update the npm test script to `test/**/*.test.js` glob. Node
22.23 no longer accepts a bare `test/` directory as a positional arg
to `--test` (fails with ERR_UNSUPPORTED_DIR_IMPORT).
Co-authored-by: Cursor <cursoragent@cursor.com>
41 lines
1.3 KiB
JSON
41 lines
1.3 KiB
JSON
{
|
|
"name": "wbxcallprov",
|
|
"version": "2.0.0",
|
|
"description": "Webex Calling provisioning bot for retail stores",
|
|
"private": true,
|
|
"type": "module",
|
|
"main": "src/index.js",
|
|
"engines": {
|
|
"node": ">=20.0.0"
|
|
},
|
|
"author": "Joseph B. McQueen",
|
|
"license": "ISC",
|
|
"scripts": {
|
|
"start": "node src/index.js",
|
|
"dev": "node --watch src/index.js",
|
|
"test": "node --test --import ./test/setup.js 'test/**/*.test.js'",
|
|
"lint": "eslint .",
|
|
"lint:fix": "eslint . --fix",
|
|
"format": "prettier --write .",
|
|
"format:check": "prettier --check .",
|
|
"generate-911-csv": "node scripts/generate911Csv.js",
|
|
"fix-store-phones": "node scripts/fixStorePhones.js",
|
|
"agent:package": "./docker/remote-agent/package.sh",
|
|
"agent:check": "./docker/remote-agent/package.sh --check",
|
|
"agent:inspect": "./docker/remote-agent/inspect-bundle.sh"
|
|
},
|
|
"dependencies": {
|
|
"dotenv": "^16.4.5",
|
|
"node-cron": "^3.0.3",
|
|
"undici": "^6.19.8",
|
|
"webex-node-bot-framework": "^2.5.1",
|
|
"ws": "^8.20.1"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^9.9.0",
|
|
"eslint": "^9.9.0",
|
|
"eslint-config-prettier": "^9.1.0",
|
|
"globals": "^15.9.0",
|
|
"prettier": "^3.3.3"
|
|
}
|
|
}
|