@onfleet/node-onfleet
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -85,9 +85,9 @@ /* eslint-disable no-console */ | ||
if (operations === 'POST') { | ||
if (util.isBase64Encoded(args[0])) { // forceComplete and clone (with ID) | ||
if (util.isBase64Encoded(args[0])) { // forceComplete, clone, and autoDispatch (with ID) | ||
url = util.replaceWithId(url, args[0]); | ||
if (args[1]) { // forceComplete (with ID, has body) | ||
if (args[1]) { // forceComplete and autoDispatch (with ID, has body) | ||
body = args[1]; // eslint-disable-line | ||
hasBody = true; | ||
} | ||
} else { // create, batchCreate, and autoAssign (no ID, has body) | ||
} else { // create, batchCreate, matchMetadata, and autoAssign (no ID, has body) | ||
body = args[0]; // eslint-disable-line | ||
@@ -148,2 +148,4 @@ hasBody = true; | ||
throw new ServiceError(errorInfo[0], errorInfo[1], errorInfo[2], errorInfo[3]); | ||
} else if (errorCode === 2218) { // Precondition error for Auto-Dispatch | ||
throw new ServiceError(errorInfo[0], errorInfo[1], errorInfo[2], errorInfo[3]); | ||
} | ||
@@ -150,0 +152,0 @@ // All others, throw general HTTP error |
@@ -28,2 +28,6 @@ const Resource = require('../Resource'); | ||
}, | ||
matchMetadata: { | ||
path: '/admins/metadata', | ||
method: 'POST', | ||
}, | ||
}); | ||
@@ -30,0 +34,0 @@ } |
@@ -20,2 +20,6 @@ const Resource = require('../Resource'); | ||
}, | ||
matchMetadata: { | ||
path: '/destinations/metadata', | ||
method: 'POST', | ||
}, | ||
}); | ||
@@ -22,0 +26,0 @@ } |
@@ -21,2 +21,6 @@ const Resource = require('../Resource'); | ||
}, | ||
matchMetadata: { | ||
path: '/recipients/metadata', | ||
method: 'POST', | ||
}, | ||
update: { | ||
@@ -23,0 +27,0 @@ path: '/recipients/:recipientId', |
@@ -46,2 +46,6 @@ const Resource = require('../Resource'); | ||
}, | ||
matchMetadata: { | ||
path: '/tasks/metadata', | ||
method: 'POST', | ||
}, | ||
}); | ||
@@ -48,0 +52,0 @@ } |
@@ -33,2 +33,6 @@ const Resource = require('../Resource'); | ||
}, | ||
autoDispatch: { | ||
path: '/teams/:teamId/dispatch', | ||
method: 'POST', | ||
}, | ||
}); | ||
@@ -35,0 +39,0 @@ } |
@@ -47,2 +47,6 @@ const Resource = require('../Resource'); | ||
}, | ||
matchMetadata: { | ||
path: '/workers/metadata', | ||
method: 'POST', | ||
}, | ||
}); | ||
@@ -49,0 +53,0 @@ } |
{ | ||
"name": "@onfleet/node-onfleet", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Official client library for accessing the Onfleet API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -92,12 +92,12 @@ # Onfleet Node.js Wrapper | ||
|:------------:|:---------------------------------------------------:|:----------------------------------------------------------------------:|:------------------------------------:|:-------------:| | ||
| [Admins/Administrators](https://docs.onfleet.com/reference#administrators) | get() | create(obj) | update(id, obj) | deleteOne(id) | | ||
| [Admins/Administrators](https://docs.onfleet.com/reference#administrators) | get() | create(obj), matchMetadata(obj) | update(id, obj) | deleteOne(id) | | ||
| [Containers](https://docs.onfleet.com/reference#containers) | get(id, 'workers'), get(id, 'teams'), get(id, 'organizations') | x | update(id, obj) | x | | ||
| [Destinations](https://docs.onfleet.com/reference#destinations) | get(id) | create(obj) | x | x | | ||
| [Destinations](https://docs.onfleet.com/reference#destinations) | get(id) | create(obj), matchMetadata(obj) | x | x | | ||
| [Hubs](https://docs.onfleet.com/reference#hubs) | get() | x | x | x | | ||
| [Organization](https://docs.onfleet.com/reference#organizations) | get(), get(id) | x | insertTask(id, obj) | x | | ||
| [Recipients](https://docs.onfleet.com/reference#recipients) | get(id), get(name, 'name'), get(phone, 'phone') | create(obj) | update(id, obj) | x | | ||
| [Tasks](https://docs.onfleet.com/reference#tasks) | get(query), get(id), get(shortId, 'shortId') | create(obj), clone(id), forceComplete(id), batch(obj), autoAssign(obj) | update(id, obj) | deleteOne(id) | | ||
| [Teams](https://docs.onfleet.com/reference#teams) | get(), get(id) | create(obj) | update(id, obj), insertTask(id, obj) | deleteOne(id) | | ||
| [Recipients](https://docs.onfleet.com/reference#recipients) | get(id), get(name, 'name'), get(phone, 'phone') | create(obj), matchMetadata(obj) | update(id, obj) | x | | ||
| [Tasks](https://docs.onfleet.com/reference#tasks) | get(query), get(id), get(shortId, 'shortId') | create(obj), clone(id), forceComplete(id), batch(obj), autoAssign(obj), matchMetadata(obj) | update(id, obj) | deleteOne(id) | | ||
| [Teams](https://docs.onfleet.com/reference#teams) | get(), get(id) | create(obj), autoDispatch(id, obj) | update(id, obj), insertTask(id, obj) | deleteOne(id) | | ||
| [Webhooks](https://docs.onfleet.com/reference#webhooks) | get() | create(obj) | x | deleteOne(id) | | ||
| [Workers](https://docs.onfleet.com/reference#workers) | get(), get(query), get(id), getByLocation(obj), getSchedule(id) | create(obj), setSchedule(id, obj) | update(id, obj), insertTask(id, obj) | deleteOne(id) | | ||
| [Workers](https://docs.onfleet.com/reference#workers) | get(), get(query), get(id), getByLocation(obj), getSchedule(id) | create(obj), setSchedule(id, obj), matchMetadata(obj) | update(id, obj), insertTask(id, obj) | deleteOne(id) | | ||
@@ -214,3 +214,3 @@ #### Requêtes GET | ||
``` | ||
Les requêtes POST étendues incluent `clone`,` forceComplete`, `batchCreate`,` autoAssign`, `setSchedule`: | ||
Les requêtes POST étendues incluent `clone`,` forceComplete`, `batchCreate`,` autoAssign`, `setSchedule`, `autoDispatch`: | ||
```js | ||
@@ -222,6 +222,9 @@ onfleet.tasks.clone('<24_digit_id>'); | ||
onfleet.<entity>.matchMetadata('<metadata_object_array>'); | ||
onfleet.workers.setSchedule('<24_digit_id>', newSchedule); | ||
onfleet.teams.autoDispatch('<24_digit_id>', dispatchConfig); | ||
``` | ||
Pour plus de détails, consultez notre documentation sur [clone](https://docs.onfleet.com/reference#clone-task), [forceComplete](https://docs.onfleet.com/reference#complete-task), [batchCreate](https://docs.onfleet.com/reference#create-tasks-in-batch), [autoAssign](https://docs.onfleet.com/reference#automatically-assign-list-of-tasks), and [setSchedule](https://docs.onfleet.com/reference#set-workers-schedule) | ||
Pour plus de détails, consultez notre documentation sur [clone](https://docs.onfleet.com/reference#clone-task), [forceComplete](https://docs.onfleet.com/reference#complete-task), [batchCreate](https://docs.onfleet.com/reference#create-tasks-in-batch), [autoAssign](https://docs.onfleet.com/reference#automatically-assign-list-of-tasks), [setSchedule](https://docs.onfleet.com/reference#set-workers-schedule), [matchMetadata](https://docs.onfleet.com/reference#querying-by-metadata), et [autoDispatch](https://docs.onfleet.com/reference#team-auto-dispatch). | ||
@@ -228,0 +231,0 @@ #### Demandes PUT |
@@ -93,12 +93,12 @@ # Onfleet Node.js Wrapper | ||
|:------------:|:---------------------------------------------------:|:----------------------------------------------------------------------:|:------------------------------------:|:-------------:| | ||
| [Admins/Administrators](https://docs.onfleet.com/reference#administrators) | get() | create(obj) | update(id, obj) | deleteOne(id) | | ||
| [Admins/Administrators](https://docs.onfleet.com/reference#administrators) | get() | create(obj), matchMetadata(obj) | update(id, obj) | deleteOne(id) | | ||
| [Containers](https://docs.onfleet.com/reference#containers) | get(id, 'workers'), get(id, 'teams'), get(id, 'organizations') | x | update(id, obj) | x | | ||
| [Destinations](https://docs.onfleet.com/reference#destinations) | get(id) | create(obj) | x | x | | ||
| [Destinations](https://docs.onfleet.com/reference#destinations) | get(id) | create(obj), matchMetadata(obj) | x | x | | ||
| [Hubs](https://docs.onfleet.com/reference#hubs) | get() | x | x | x | | ||
| [Organization](https://docs.onfleet.com/reference#organizations) | get(), get(id) | x | insertTask(id, obj) | x | | ||
| [Recipients](https://docs.onfleet.com/reference#recipients) | get(id), get(name, 'name'), get(phone, 'phone') | create(obj) | update(id, obj) | x | | ||
| [Tasks](https://docs.onfleet.com/reference#tasks) | get(query), get(id), get(shortId, 'shortId') | create(obj), clone(id), forceComplete(id), batch(obj), autoAssign(obj) | update(id, obj) | deleteOne(id) | | ||
| [Teams](https://docs.onfleet.com/reference#teams) | get(), get(id) | create(obj) | update(id, obj), insertTask(id, obj) | deleteOne(id) | | ||
| [Recipients](https://docs.onfleet.com/reference#recipients) | get(id), get(name, 'name'), get(phone, 'phone') | create(obj), matchMetadata(obj) | update(id, obj) | x | | ||
| [Tasks](https://docs.onfleet.com/reference#tasks) | get(query), get(id), get(shortId, 'shortId') | create(obj), clone(id), forceComplete(id), batch(obj), autoAssign(obj), matchMetadata(obj) | update(id, obj) | deleteOne(id) | | ||
| [Teams](https://docs.onfleet.com/reference#teams) | get(), get(id) | create(obj), autoDispatch(id, obj) | update(id, obj), insertTask(id, obj) | deleteOne(id) | | ||
| [Webhooks](https://docs.onfleet.com/reference#webhooks) | get() | create(obj) | x | deleteOne(id) | | ||
| [Workers](https://docs.onfleet.com/reference#workers) | get(), get(query), get(id), getByLocation(obj), getSchedule(id) | create(obj), setSchedule(id, obj) | update(id, obj), insertTask(id, obj) | deleteOne(id) | | ||
| [Workers](https://docs.onfleet.com/reference#workers) | get(), get(query), get(id), getByLocation(obj), getSchedule(id) | create(obj), setSchedule(id, obj), matchMetadata(obj) | update(id, obj), insertTask(id, obj) | deleteOne(id) | | ||
@@ -219,3 +219,4 @@ #### GET Requests | ||
``` | ||
Extended POST requests include `clone`, `forceComplete`, `batchCreate`, `autoAssign` on the tasks endpoint and `setSchedule` on the workers endpoint: | ||
Extended POST requests include `clone`, `forceComplete`, `batchCreate`, `autoAssign` on the tasks endpoint, `setSchedule` on the workers endpoint, `matchMetadata` on all supported entity endpoints, and `autoDispatch` on the teams endpoint: | ||
```js | ||
@@ -226,7 +227,11 @@ onfleet.tasks.clone('<24_digit_id>'); | ||
onfleet.tasks.autoAssign('<auto_assign_object>'); | ||
onfleet.<entities>.matchMetdata('<an_array_of_metadata_objects>'); | ||
onfleet.workers.setSchedule('<24_digit_id>', newSchedule); | ||
onfleet.teams.autoDispatch('<24_digit_id>', dispatchConfig); | ||
``` | ||
For more details, check our documentation on [clone](https://docs.onfleet.com/reference#clone-task), [forceComplete](https://docs.onfleet.com/reference#complete-task), [batchCreate](https://docs.onfleet.com/reference#create-tasks-in-batch), [autoAssign](https://docs.onfleet.com/reference#automatically-assign-list-of-tasks), and [setSchedule](https://docs.onfleet.com/reference#set-workers-schedule) | ||
For more details, check our documentation on [clone](https://docs.onfleet.com/reference#clone-task), [forceComplete](https://docs.onfleet.com/reference#complete-task), [batchCreate](https://docs.onfleet.com/reference#create-tasks-in-batch), [autoAssign](https://docs.onfleet.com/reference#automatically-assign-list-of-tasks), [setSchedule](https://docs.onfleet.com/reference#set-workers-schedule), [matchMetadata](https://docs.onfleet.com/reference#querying-by-metadata), and [autoDispatch](https://docs.onfleet.com/reference#team-auto-dispatch) | ||
#### PUT Requests | ||
@@ -233,0 +238,0 @@ To update a document within an endpoint: |
@@ -95,12 +95,12 @@ # Onfleet Node.js Wrapper | ||
|:------------:|:---------------------------------------------------:|:----------------------------------------------------------------------:|:------------------------------------:|:-------------:| | ||
| [Admins/Administrators](https://docs.onfleet.com/reference#administrators) | get() | create(obj) | update(id, obj) | deleteOne(id) | | ||
| [Admins/Administrators](https://docs.onfleet.com/reference#administrators) | get() | create(obj), matchMetadata(obj) | update(id, obj) | deleteOne(id) | | ||
| [Containers](https://docs.onfleet.com/reference#containers) | get(id, 'workers'), get(id, 'teams'), get(id, 'organizations') | x | update(id, obj) | x | | ||
| [Destinations](https://docs.onfleet.com/reference#destinations) | get(id) | create(obj) | x | x | | ||
| [Destinations](https://docs.onfleet.com/reference#destinations) | get(id) | create(obj), matchMetadata(obj) | x | x | | ||
| [Hubs](https://docs.onfleet.com/reference#hubs) | get() | x | x | x | | ||
| [Organization](https://docs.onfleet.com/reference#organizations) | get(), get(id) | x | insertTask(id, obj) | x | | ||
| [Recipients](https://docs.onfleet.com/reference#recipients) | get(id), get(name, 'name'), get(phone, 'phone') | create(obj) | update(id, obj) | x | | ||
| [Tasks](https://docs.onfleet.com/reference#tasks) | get(query), get(id), get(shortId, 'shortId') | create(obj), clone(id), forceComplete(id), batch(obj), autoAssign(obj) | update(id, obj) | deleteOne(id) | | ||
| [Teams](https://docs.onfleet.com/reference#teams) | get(), get(id) | create(obj) | update(id, obj), insertTask(id, obj) | deleteOne(id) | | ||
| [Recipients](https://docs.onfleet.com/reference#recipients) | get(id), get(name, 'name'), get(phone, 'phone') | create(obj), matchMetadata(obj) | update(id, obj) | x | | ||
| [Tasks](https://docs.onfleet.com/reference#tasks) | get(query), get(id), get(shortId, 'shortId') | create(obj), clone(id), forceComplete(id), batch(obj), autoAssign(obj), matchMetadata(obj) | update(id, obj) | deleteOne(id) | | ||
| [Teams](https://docs.onfleet.com/reference#teams) | get(), get(id) | create(obj), autoDispatch(id, obj) | update(id, obj), insertTask(id, obj) | deleteOne(id) | | ||
| [Webhooks](https://docs.onfleet.com/reference#webhooks) | get() | create(obj) | x | deleteOne(id) | | ||
| [Workers](https://docs.onfleet.com/reference#workers) | get(), get(query), get(id), getByLocation(obj), getSchedule(id) | create(obj), setSchedule(id, obj) | update(id, obj), insertTask(id, obj) | deleteOne(id) | | ||
| [Workers](https://docs.onfleet.com/reference#workers) | get(), get(query), get(id), getByLocation(obj), getSchedule(id) | create(obj), setSchedule(id, obj), matchMetadata(obj) | update(id, obj), insertTask(id, obj) | deleteOne(id) | | ||
@@ -220,3 +220,4 @@ #### GET 請求 | ||
``` | ||
其他延伸的POST請求包含了tasks節點上的`clone`, `forceComplete`, `batchCreate`, `autoAssign`以及workers節點上的`setSchedule`: | ||
其他延伸的POST請求包含了tasks節點上的`clone`, `forceComplete`, `batchCreate`, `autoAssign`,workers節點上的`setSchedule`, 所有支持的節點上的`matchMetadata`, 以及teams節點上的`autoDispatch`: | ||
```js | ||
@@ -228,6 +229,10 @@ onfleet.tasks.clone('<24_digit_id>'); | ||
onfleet.<entity>.matchMetadata('<array_of_metadata_object>'); | ||
onfleet.workers.setSchedule('<24_digit_id>', newSchedule); | ||
onfleet.teams.autoDispatch('<24_digit_id>', dispatchConfig); | ||
``` | ||
參考資料:[clone](https://docs.onfleet.com/reference#clone-task), [forceComplete](https://docs.onfleet.com/reference#complete-task), [batchCreate](https://docs.onfleet.com/reference#create-tasks-in-batch), [autoAssign](https://docs.onfleet.com/reference#automatically-assign-list-of-tasks), 以及[setSchedule](https://docs.onfleet.com/reference#set-workers-schedule)。 | ||
參考資料:[clone](https://docs.onfleet.com/reference#clone-task), [forceComplete](https://docs.onfleet.com/reference#complete-task), [batchCreate](https://docs.onfleet.com/reference#create-tasks-in-batch), [autoAssign](https://docs.onfleet.com/reference#automatically-assign-list-of-tasks), [setSchedule](https://docs.onfleet.com/reference#set-workers-schedule), [matchMetadata](https://docs.onfleet.com/reference#querying-by-metadata), 以及[autoDispatch](https://docs.onfleet.com/reference#team-auto-dispatch)。 | ||
#### PUT 請求 | ||
@@ -234,0 +239,0 @@ 取代(更新)某單一指定資源的指令如下: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69181
978
304