node-zendesk
Advanced tools
Comparing version 4.0.5 to 5.0.0
{ | ||
"name": "node-zendesk", | ||
"version": "4.0.5", | ||
"version": "5.0.0", | ||
"type": "commonjs", | ||
@@ -25,11 +25,29 @@ "description": "zendesk API client wrapper", | ||
}, | ||
"main": "./src/index.js", | ||
"types": "./dist/types/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.js" | ||
} | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"clean:dist": "npx rimraf ./dist", | ||
"esbuild": "npx esbuild ./src/index.js --bundle --outdir=dist --platform=node --target=node18 --minify --packages=external --format=cjs", | ||
"build:types": "npx -p typescript tsc ./src/**/**/*.js --declaration --allowJs --emitDeclarationOnly --outDir dist/types", | ||
"build": "npm run clean:dist && npm run build:types && npm run esbuild", | ||
"prepublishOnly": "npm run build", | ||
"postpublish": "npm run clean:dist", | ||
"test": "vitest run", | ||
"test:coverage": "vitest run --coverage", | ||
"lint": "xo", | ||
"lint:fix": "xo --fix", | ||
"docs:code": "npx typedoc --out ./docs/code --plugin typedoc-plugin-markdown 'dist/**/*.ts'", | ||
"docs:dev": "vitepress dev docs", | ||
"docs:build": "vitepress build docs", | ||
"lint": "xo", | ||
"lint:fix": "xo --fix", | ||
"docs:preview": "vitepress preview docs" | ||
"docs:preview": "vitepress preview docs", | ||
"docs:deploy-github-pages": "npm run build && npm run docs:code && npm run docs:build", | ||
"release": "git push origin --follow-tags" | ||
}, | ||
@@ -81,10 +99,18 @@ "author": "Farrin Reid <blakmatrix@gmail.com>", | ||
}, | ||
"dependencies": { | ||
"cross-fetch": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@vitest/coverage-v8": "^0.34.3", | ||
"dotenv": "^16.3.1", | ||
"eslint-plugin-jsdoc": "^46.8.2", | ||
"nock": "^13.3.3", | ||
"request": "^2.88.2", | ||
"typedoc": "^0.25.2", | ||
"typedoc-plugin-markdown": "^3.16.0", | ||
"vitepress": "^1.0.0-rc.20", | ||
"vitepress-sidebar": "^1.18.0", | ||
"vitest": "^0.34.3", | ||
"vue-github-button": "^3.1.0", | ||
"xo": "^0.56.0" | ||
} | ||
} |
@@ -47,3 +47,5 @@ <div align="center"> | ||
$ npm install --save node-zendesk | ||
```shell | ||
npm install --save node-zendesk | ||
``` | ||
@@ -55,2 +57,3 @@ | ||
var zendesk = require('node-zendesk'); | ||
// or `import {createClient} from 'node-zendesk'` if using typescript | ||
@@ -60,33 +63,19 @@ var client = zendesk.createClient({ | ||
token: 'token', | ||
remoteUri: 'https://remote.zendesk.com/api/v2' | ||
subdomain: 'subdomain' | ||
}); | ||
client.users.list(function (err, req, result) { | ||
if (err) { | ||
console.log(err); | ||
return; | ||
} | ||
console.log(JSON.stringify(result[0], null, 2, true));//gets the first page | ||
client.users.list().then(users => { | ||
console.log('Total Users:', users.length); | ||
console.log('User Names:', users.map(user => user.name)); | ||
}).catch(error => { | ||
console.error(`Failed to get list of users: ${error.message}`); | ||
}); | ||
``` | ||
or you can use `Promises`, you just need to skip the callback: | ||
```js | ||
var zendesk = require('node-zendesk'); | ||
var client = zendesk.createClient({ | ||
username: 'username', | ||
token: 'token', | ||
remoteUri: 'https://remote.zendesk.com/api/v2' | ||
}); | ||
client.users.list() | ||
.then(function(result) { | ||
console.log(JSON.stringify(result[0], null, 2, true));//gets the first page | ||
}) | ||
.catch(function(error) { | ||
console.log(error); | ||
}); | ||
``` | ||
Take a look in the `examples` folder for more examples. | ||
## Getting Started | ||
If you're new to `node-zendesk`, we recommend checking out our [Getting Started Guide](https://blakmatrix.github.io/node-zendesk/guide) to help you set up and familiarize yourself with the library. | ||
## Contributions | ||
@@ -93,0 +82,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
338338
82
1
11
5769
1
115
+ Addedcross-fetch@^4.0.0
+ Addedcross-fetch@4.1.0(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)