coveo-pushapi-cli v1.1.0
PushAPI-node.js
Description
This project is a simple wrapper to help sending JSON payloads using Coveo Cloud V2 PushAPI.
Available documentation
The code in this project uses the Push API from the Coveo Cloud V2 Platform. You can use the following resource for more information and get started:
- Push API documentation: https://docs.coveo.com/en/68/cloud-v2-developers/push-api
Contributing
- Branch or Fork
- Pull Request
- And... that's pretty much it!
How-to build
git clonethis project.npm installto get the dependencies (request, fs).
CLI command
Install it with NPM:
npm i coveo-pushapi-cli --globalHow-to run
The first time you run in one folder, it will help you to set up your config .pushapi-config.json by asking about your sourceId and your API key.
Note For a source in a Coveo Cloud HIPAA org, you need to manually add the following line to the
.pushapi-config.jsonfile:
"platform": "pushhipaa.cloud.coveo.com".
Push one JSON payload file:
pushapi file.jsonwhere
file.jsonis a the path to a Push API payload (JSON) file. Don't forget to setDocumentIdin the payloads.Push one JSON payload file, but delete source item older than 24 hours:
pushapi file.json -d 24to use typically when you create/update all valid items, you want to delete all othere items that are older.
Push all JSON payload files from one folder:
pushapi folderwhere
folderis teh path to a folder containing multiple Push API JSON payload files.
What does it do?
The helper does a minimal validation on the payload, then executes these API calls:
- Change source state to REBUILD
- Get a File container
- Upload the payload to the File container
- Sends the batch command to process the File container
- Change the source state back to IDLE
Note You can add this attribute
"debug": truein your.pushapi-config.jsonto see these requests and their response code.
Dependencies
- Node.js
- Node modules:
fs,request
Authors
- Jérôme Devost (https://github.com/jdevost)
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago