Skip to content

Commit

Permalink
Merge pull request #107 from onfleet/INT-1921-update-methods
Browse files Browse the repository at this point in the history
[INT-1921][node-wrapper]Prepare for v1.3.7
  • Loading branch information
lisandrobigi-onfleet authored Aug 26, 2024
2 parents ca3071c + 177aae9 commit cec126e
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.3.6] - 2024-08-23
## [1.3.7] - 2024-08-23
### Added
- Added Custom field support for node API wrapper

Expand Down Expand Up @@ -128,7 +128,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial release on npm

[Unreleased]: https://github.com/onfleet/node-onfleet/compare/v1.3.0...HEAD
[1.3.6]: https://github.com/onfleet/node-onfleet/compare/v1.3.4...v1.3.6
[1.3.6]: https://github.com/onfleet/node-onfleet/compare/v1.3.4...v1.3.7
[1.3.4]: https://github.com/onfleet/node-onfleet/compare/v1.3.3...v1.3.4
[1.3.3]: https://github.com/onfleet/node-onfleet/compare/v1.3.2...v1.3.3
[1.3.2]: https://github.com/onfleet/node-onfleet/compare/v1.3.1...v1.3.2
Expand Down
2 changes: 1 addition & 1 deletion README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Estas son las operaciones disponibles para cada endpoint:
| [Teams](https://docs.onfleet.com/reference/teams) | get()<br />get(id)<br />getWorkerEta(id, obj)<br />getTasks(id) | create(obj)<br />autoDispatch(id, obj) | update(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()<br />get(query)<br />get(id)<br />getByLocation(obj)<br />getSchedule(id)<br />getTasks(id) | create(obj)<br />setSchedule(id, obj)<br />matchMetadata(obj)<br />getDeliveryManifest(obj) | update(id, obj)<br />insertTask(id, obj) | deleteOne(id) |
| [Custom Fields](https://docs.onfleet.com/reference/task-custom-fields) | get(modelName) | create(obj) | update(obj) | delete(obj) |
| [Custom Fields](https://docs.onfleet.com/reference/task-custom-fields) | get(integration) | create(obj) | update(obj) | delete(obj) |

#### Peticiones GET
Para obtener todos los elementos disponibles en un recurso, éstas llamadas retornan un `Promise` con el arreglo de los resultados:
Expand Down
2 changes: 1 addition & 1 deletion README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Voici les opérations CRUD prises en charge pour chaque ordinateur d'extrémité
| [Teams](https://docs.onfleet.com/reference#teams) | get()<br />get(id)<br />getWorkerEta(id, obj)<br />getTasks(id) | create(obj)<br />autoDispatch(id, obj) | update(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()<br />get(query)<br />get(id)<br />getByLocation(obj)<br />getSchedule(id)<br />getTasks(id) | create(obj)<br />setSchedule(id, obj)<br />matchMetadata(obj)<br />getDeliveryManifest(obj) | update(id, obj)<br />insertTask(id, obj) | deleteOne(id) |
| [Custom Fields](https://docs.onfleet.com/reference/task-custom-fields) | get(modelName) | create(obj) | update(obj) | delete(obj) |
| [Custom Fields](https://docs.onfleet.com/reference/task-custom-fields) | get(integration) | create(obj) | update(obj) | delete(obj) |

#### Demandes GET
Pour obtenir tous les documents d'un noeud final, cela renvoie une `Promise` contenant un tableau de résultats:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Here are the operations available for each entity:
| [Teams](https://docs.onfleet.com/reference#teams) | get()<br />get(id)<br />getWorkerEta(id, obj)<br />getTasks(id) | create(obj)<br />autoDispatch(id, obj) | update(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()<br />get(query)<br />get(id)<br />getByLocation(obj)<br />getSchedule(id)<br />getTasks(id) | create(obj)<br />setSchedule(id, obj)<br />matchMetadata(obj)<br />getDeliveryManifest(obj) | update(id, obj)<br />insertTask(id, obj) | deleteOne(id) |
| [Custom Fields](https://docs.onfleet.com/reference/task-custom-fields) | get(modelName) | create(obj) | update(obj) | delete(obj) |
| [Custom Fields](https://docs.onfleet.com/reference/task-custom-fields) | get(integration) | create(obj) | update(obj) | delete(obj) |

#### GET Requests
To get all the documents within an endpoint, this returns a `Promise` containing an array of results:
Expand Down
2 changes: 1 addition & 1 deletion README.zh-tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ onfleetApi.verifyKey(); // Returns a boolean
| [Teams](https://docs.onfleet.com/reference/teams) | get()<br />get(id)<br />getWorkerEta(id, obj)<br />getTasks(id) | create(obj)<br />autoDispatch(id, obj) | update(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()<br />get(query)<br />get(id)<br />getByLocation(obj)<br />getSchedule(id)<br />getTasks(id) | create(obj)<br />setSchedule(id, obj)<br />matchMetadata(obj)<br />getDeliveryManifest(obj) | update(id, obj)<br />insertTask(id, obj) | deleteOne(id) |
| [Custom Fields](https://docs.onfleet.com/reference/task-custom-fields) | get(modelName) | create(obj) | update(obj) | delete(obj) |
| [Custom Fields](https://docs.onfleet.com/reference/task-custom-fields) | get(integration) | create(obj) | update(obj) | delete(obj) |

#### GET 請求
展示所有資源的指令如下,回應的主體為包含一陣列的[`Promise`物件](https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Promise):
Expand Down
4 changes: 4 additions & 0 deletions lib/Methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ const Methods = (key, api, ...args) => {
hasBody = true;
}
}
if (['PUT', 'DELETE'].includes(operations) && url.includes('customFields') && Array.isArray(args)) {
body = args[0]; // eslint-disable-line
hasBody = true;
}
// POST Prep - 3 different cases
if (operations === 'POST') {
if (util.isBase64Encoded(args[0])) { // forceComplete, clone, and autoDispatch (with ID)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onfleet/node-onfleet",
"version": "1.3.6",
"version": "1.3.7",
"description": "Onfleet's Node.js API Wrapper Package",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit cec126e

Please sign in to comment.