Skip to content

Commit

Permalink
Merge pull request #76 from route4me/1.0.12
Browse files Browse the repository at this point in the history
1.0.12
  • Loading branch information
r4m-juan committed Aug 24, 2022
2 parents 9f8d1ab + d857a73 commit b23a544
Show file tree
Hide file tree
Showing 42 changed files with 5,081 additions and 304 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
exports = module.exports = {
"extends": [
"airbnb"
"airbnb-base"
],
"plugins": [
// TODO: this is LINT rules for DOC. `Use with npm install eslint-plugin-jsdoc`
Expand Down
6 changes: 6 additions & 0 deletions book/en/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

## Code

### V4

* [Route4Me](code/Route4Me.md#Route4Me)
* [ActivityFeed](code/ActivityFeed.md)
* [AddressBarcodes](code/AddressBarcodes.md)
Expand All @@ -34,6 +36,10 @@
* [Route4MeValidationError](code/Errors.md#Route4MeValidationError)
* [Other](code/Uncategorized.md)

### V5

* [AddressBookV5](code/AddressBookV5.md)

{% include "code/index.md" %}

## Examples
Expand Down
27 changes: 15 additions & 12 deletions book/en/code/AddressBook.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ AddressBook facility
* [new AddressBook(requestManager)](#new_AddressBook_new)
* [.create(data, [callback])](#AddressBook+create)
* [.getMany(ids, [callback])](#AddressBook+getMany)
* [.list(options, [callback])](#AddressBook+list)
* [.search(query, options, [callback])](#AddressBook+search)
* [.list(ids, [options], [callback])](#AddressBook+list)
* [.search(query, [options], [callback])](#AddressBook+search)
* [.update(id, data, [callback])](#AddressBook+update)
* [.remove(ids, [callback])](#AddressBook+remove)

Expand Down Expand Up @@ -65,7 +65,7 @@ GET locations from an address book by a specified list of locations IDs.

<a id="AddressBook+list" name="AddressBook+list"></a>

### addressBook.list(options, [callback])
### addressBook.list(ids, [options], [callback])

GET all locations from a user’s address book.

Expand All @@ -74,18 +74,21 @@ GET all locations from a user’s address book.
**Todo**

- [ ] TODO: Parse response
- [ ] TODO: Describe ALL options (in one place, list+search)
- [ ] TODO: convert options to optional


| Param | Type | Description |
| --- | --- | --- |
| options | <code>Object</code> | List-parameters |
| ids | <code>String</code> \| <code>Number</code> \| <code>Array.&lt;String&gt;</code> \| <code>Array.&lt;Number&gt;</code> | Order IDs |
| [options] | <code>Object</code> | List-parameters |
| [options.offset] | <code>Number</code> | List offset |
| [options.limit] | <code>Number</code> | List limit |
| [options.fields] | <code>String</code> | String of comma separated fields to return |
| [options.routed] | <code>Boolean</code> | Return routed or unrouted records |
| [callback] | <code>module:route4me-node~RequestCallback.&lt;jsonschema:AddressBook.AddressBookSearchResult&gt;</code> | |

<a id="AddressBook+search" name="AddressBook+search"></a>

### addressBook.search(query, options, [callback])
### addressBook.search(query, [options], [callback])

Search an address book location by containing specified text in any
field/defined fields.
Expand All @@ -98,19 +101,19 @@ field/defined fields.
**Since**: 0.1.8
**Todo**

- [ ] TODO: convert options to optional
- [ ] TODO: Parse response
- [ ] TODO: Describe ALL options (in one place, list+search)
- [ ] TODO: Handle the diffrerent format of the output (when fields are set,
see https://github.com/route4me/route4me-nodejs-sdk/issues/38)


| Param | Type | Description |
| --- | --- | --- |
| query | <code>string</code> | Searched text |
| options | <code>Object</code> | List-parameters |
| [options.limit] | <code>number</code> | List limit |
| [options.offset] | <code>number</code> | List offset |
| [options] | <code>Object</code> | List-parameters |
| [options.offset] | <code>Number</code> | List offset |
| [options.limit] | <code>Number</code> | List limit |
| [options.fields] | <code>String</code> | String of comma separated fields to return |
| [options.routed] | <code>Boolean</code> | Return routed or unrouted records |
| [callback] | <code>module:route4me-node~RequestCallback.&lt;jsonschema:AddressBook.AddressBookSearchResult&gt;</code> | |

<a id="AddressBook+update" name="AddressBook+update"></a>
Expand Down
594 changes: 594 additions & 0 deletions book/en/code/AddressBookV5.md

Large diffs are not rendered by default.

45 changes: 43 additions & 2 deletions book/en/code/Route4Me.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Main members of the instanse of `Route4Me` class:
* [ActivityFeed ](ActivityFeed)
* [Addresses ](Addresses)
* [AddressBook ](AddressBook)
* [AddressBookV5 ](AddressBookV5)
* [AddressBarcodes ](AddressBarcodes)
* [AvoidanceZones ](AvoidanceZones)
* [Geocoding ](Geocoding)
Expand Down Expand Up @@ -125,6 +126,7 @@ For most use cases it is necessary:
* _instance_
* [.ActivityFeed](#Route4Me+ActivityFeed) : <code>ActivityFeed</code>
* [.AddressBook](#Route4Me+AddressBook) : <code>AddressBook</code>
* [.AddressBookV5](#Route4Me+AddressBookV5) : <code>AddressBookV5</code>
* [.AddressBarcodes](#Route4Me+AddressBarcodes) : <code>AddressBarcodes</code>
* [.Addresses](#Route4Me+Addresses) : <code>Addresses</code>
* [.AvoidanceZones](#Route4Me+AvoidanceZones) : <code>AvoidanceZones</code>
Expand All @@ -137,6 +139,8 @@ For most use cases it is necessary:
* [.Tracking](#Route4Me+Tracking) : <code>Tracking</code>
* [.Vehicles](#Route4Me+Vehicles) : <code>Vehicles</code>
* [.version](#Route4Me+version) ⇒ <code>string</code>
* [.baseUrl()](#Route4Me+baseUrl) ⇒ <code>string</code>
* [.baseUrl5()](#Route4Me+baseUrl5) ⇒ <code>string</code>
* _static_
* [.version](#Route4Me.version) ⇒ <code>string</code>

Expand All @@ -152,7 +156,8 @@ Create new API client
| --- | --- | --- | --- |
| apiKey | <code>string</code> | | API KEY |
| [options] | <code>object</code> | | Additional options for new instance |
| [options.baseUrl] | <code>string</code> | <code>&quot;\&quot;https://api.route4me.com\&quot;&quot;</code> | Base URL for sending requests |
| [options.baseUrl] | <code>string</code> | <code>&quot;https://api.route4me.com&quot;</code> | Base URL for sending requests |
| [options.baseUrl5] | <code>string</code> | <code>&quot;https://wh.route4me.com/modules&quot;</code> | Base URL for sending requests to backend API v.5 |
| [options.logger] | [<code>ILogger</code>](#ILogger) | <code></code> | Logger facility |
| [options.promise] | <code>boolean</code> \| <code>function</code> | <code>false</code> | Use promises instead of callbacks. Usage: * `false` means _no promises, use callbacks_; * `true` means _use global `Promise`_ as promises' constructor; * `constructor (function)` forces to use explicit Promise library. See also Examples section of this documentation. |
| [options.validate] | <code>module:route4me-node~ValidationCallback</code> | <code>false</code> | Validator for input and output parameters of the API methods. Set **falsey** value to skip autovalidation (in favor of manual check). |
Expand All @@ -170,6 +175,13 @@ Create new API client

**AddressBook** related API calls

**Since**: 0.1.8
<a id="Route4Me+AddressBookV5" name="Route4Me+AddressBookV5"></a>

### route4Me.AddressBookV5 : <code>AddressBookV5</code>

**AddressBookV5** related API calls

**Since**: 0.1.8
<a id="Route4Me+AddressBarcodes" name="Route4Me+AddressBarcodes"></a>

Expand Down Expand Up @@ -252,6 +264,24 @@ Version of this API client
**Returns**: <code>string</code> - Version
**Read only**: true
**Since**: 0.2.0
<a id="Route4Me+baseUrl" name="Route4Me+baseUrl"></a>

### route4Me.baseUrl() ⇒ <code>string</code>

Base URL for sending requests

**Returns**: <code>string</code> - URL
**Read only**: true
**Since**: 1.0.9
<a id="Route4Me+baseUrl5" name="Route4Me+baseUrl5"></a>

### route4Me.baseUrl5() ⇒ <code>string</code>

Base URL for sending requests to backend API v.5

**Returns**: <code>string</code> - URL
**Read only**: true
**Since**: 1.0.9
<a id="Route4Me.version" name="Route4Me.version"></a>

### Route4Me.version ⇒ <code>string</code>
Expand Down Expand Up @@ -289,9 +319,15 @@ Enum for all known **activity type**.
| MarkDestinationVisited | <code>string</code> | <code>&quot;mark-destination-visited&quot;</code> | |
| MoveDestination | <code>string</code> | <code>&quot;move-destination&quot;</code> | |
| UpdateDestinations | <code>string</code> | <code>&quot;update-destinations&quot;</code> | |
| DriverArrivedEarly | <code>string</code> | <code>&quot;driver-arrived-early&quot;</code> | Get driver arrived early activities [https://route4me.io/docs/#driver-arrived-early](https://route4me.io/docs/#driver-arrived-early) |
| AddressbookInsert | <code>string</code> | <code>&quot;addressbook-insert&quot;</code> | Get driver arrived early activities [https://route4me.io/docs/#driver-arrived-early](https://route4me.io/docs/#driver-arrived-early) |
| AddressbookUpdate | <code>string</code> | <code>&quot;addressbook-update&quot;</code> | |
| AddressbookDelete | <code>string</code> | <code>&quot;addressbook-delete&quot;</code> | |
| DriverArrivedEarly | <code>string</code> | <code>&quot;driver-arrived-early&quot;</code> | |
| DriverArrivedLate | <code>string</code> | <code>&quot;driver-arrived-late&quot;</code> | |
| DriverArrivedInTime | <code>string</code> | <code>&quot;driver-arrived-in-time&quot;</code> | |
| DriverArrivedOnTime | <code>string</code> | <code>&quot;driver-arrived-on-time&quot;</code> | |
| LocalGeofenceEntered | <code>string</code> | <code>&quot;local_geofence_entered&quot;</code> | |
| LocalGeofenceLeft | <code>string</code> | <code>&quot;local_geofence_left&quot;</code> | |
| MemberCreated | <code>string</code> | <code>&quot;member-created&quot;</code> | |
| MemberDeleted | <code>string</code> | <code>&quot;member-deleted&quot;</code> | |
| MemberModified | <code>string</code> | <code>&quot;member-modified&quot;</code> | |
Expand All @@ -304,5 +340,10 @@ Enum for all known **activity type**.
| OrderUpdated | <code>string</code> | <code>&quot;order-updated&quot;</code> | |
| OrderDeleted | <code>string</code> | <code>&quot;order-deleted&quot;</code> | |
| UnapprovedToExecute | <code>string</code> | <code>&quot;unapproved-to-execute&quot;</code> | |
| PickupBarcodeScanning | <code>string</code> | <code>&quot;pickup_barcode_scanning&quot;</code> | |
| RouteCompleted | <code>string</code> | <code>&quot;route-completed&quot;</code> | |
| RouteDestinationStatus | <code>string</code> | <code>&quot;route-destination-status&quot;</code> | |
| RoutePaused | <code>string</code> | <code>&quot;route-paused&quot;</code> | |
| RouteStarted | <code>string</code> | <code>&quot;route-started&quot;</code> | |
| RouteUpdate | <code>string</code> | <code>&quot;route-update&quot;</code> | |

124 changes: 124 additions & 0 deletions book/en/code/Routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ Routes facility
* [.optimize(id, criteria, [callback])](#Routes+optimize)
* [.routeexamples_optiomization(param, [callback])](#Routes+routeexamples_optiomization)
* [.get_schedule_calendar(param, [callback])](#Routes+get_schedule_calendar)
* [.routeBreaks(options, [callback])](#Routes+routeBreaks)
* [.getStatus(routeId, [callback])](#Routes+getStatus)
* [.rollbackStatus(routeId, [callback])](#Routes+rollbackStatus)
* [.getHistoryStatus(routeId, [options], [callback])](#Routes+getHistoryStatus)
* [.updateStatus(routeId, params, [callback])](#Routes+updateStatus)
* [.setPlannedStatus(routeIds, [callback])](#Routes+setPlannedStatus)
* [.routeStopStatus(destinationIds, status, [callback])](#Routes+routeStopStatus)

<a id="new_Routes_new" name="new_Routes_new"></a>

Expand Down Expand Up @@ -304,3 +311,120 @@ Get Schedule Calendar
| param | <code>object</code> | Schedule params |
| [callback] | <code>module:route4me-node~RequestCallback</code> | |
<a id="Routes+routeBreaks" name="Routes+routeBreaks"></a>
### routes.routeBreaks(options, [callback])
Store a new Driver Break in the database.
**See**: [https://virtserver.swaggerhub.com/Route4Me/route-breaks/5.0](https://virtserver.swaggerhub.com/Route4Me/route-breaks/5.0)
**Since**: 1.0.12
| Param | Type | Description |
| --- | --- | --- |
| options | <code>object</code> | Routebreaks params |
| options.route_id | <code>Array.&lt;string&gt;</code> | Route IDs to get result. |
| options.breaks | <code>Array.&lt;object&gt;</code> | Break IDs. |
| options.breaks.type | <code>string</code> | Type of break. Possible values: - approximate_time_of_day - certain_number_of_total_elapsed_time - certain_number_of_travel_time - certain_number_of_service_time - certain_number_of_locations |
| options.breaks.duration | <code>number</code> | Duration of break. |
| options.breaks.params | <code>Array.&lt;number&gt;</code> | Params break. |
| options.replace_existing_breaks | <code>boolean</code> | Replace existing breaks. |
| [callback] | <code>module:route4me-node~RequestCallback</code> | |
<a id="Routes+getStatus" name="Routes+getStatus"></a>
### routes.getStatus(routeId, [callback])
Get the status by specifying the path parameter ID.
**See**: [https://virtserver.swaggerhub.com/Route4Me/route-status/5.0](https://virtserver.swaggerhub.com/Route4Me/route-status/5.0)
**Since**: 1.0.12
| Param | Type | Description |
| --- | --- | --- |
| routeId | <code>string</code> | Route ID to get status. |
| [callback] | <code>module:route4me-node~RequestCallback</code> | |
<a id="Routes+rollbackStatus" name="Routes+rollbackStatus"></a>
### routes.rollbackStatus(routeId, [callback])
Roll back route status by specifying the path parameter ID.
Sometimes a status rollback is possible.
**See**: [https://virtserver.swaggerhub.com/Route4Me/route-status/5.0](https://virtserver.swaggerhub.com/Route4Me/route-status/5.0)
**Since**: 1.0.12
| Param | Type | Description |
| --- | --- | --- |
| routeId | <code>string</code> | Route ID to rollback status. |
| [callback] | <code>module:route4me-node~RequestCallback</code> | |
<a id="Routes+getHistoryStatus" name="Routes+getHistoryStatus"></a>
### routes.getHistoryStatus(routeId, [options], [callback])
Get route status history by specifying the path parameter ID.
**See**: [https://virtserver.swaggerhub.com/Route4Me/route-status/5.0](https://virtserver.swaggerhub.com/Route4Me/route-status/5.0)
**Since**: 1.0.12
| Param | Type | Description |
| --- | --- | --- |
| routeId | <code>string</code> | Route ID to get history status. |
| [options] | <code>object</code> | |
| [options.order_by] | <code>string</code> | Result order. Possible values: 'asc' and 'desc' |
| [options.start] | <code>number</code> | Unix timestamp in seconds. |
| [options.end] | <code>number</code> | Unix timestamp in seconds. |
| [callback] | <code>module:route4me-node~RequestCallback</code> | |
<a id="Routes+updateStatus" name="Routes+updateStatus"></a>
### routes.updateStatus(routeId, params, [callback])
Store a new Status in the database or update the status by specifying
the path parameter ID.
Route statuses change only forward - planned > started/paused > completed.
**See**: [https://virtserver.swaggerhub.com/Route4Me/route-breaks/5.0](https://virtserver.swaggerhub.com/Route4Me/route-breaks/5.0)
**Since**: 1.0.12
| Param | Type | Description |
| --- | --- | --- |
| routeId | <code>string</code> | Route ID to update status. |
| params | <code>object</code> | |
| params.status | <code>string</code> | Value of status. Possible values: 'planned', 'started', 'paused' and 'completed'. |
| params.lat | <code>number</code> | Latitude. |
| params.lng | <code>number</code> | Longitude. |
| params.event_timestamp | <code>number</code> | Unix timestamp in seconds.. |
| [callback] | <code>module:route4me-node~RequestCallback</code> | |
<a id="Routes+setPlannedStatus" name="Routes+setPlannedStatus"></a>
### routes.setPlannedStatus(routeIds, [callback])
Store a new Status in the database with 'planned' status.
**See**: [https://virtserver.swaggerhub.com/Route4Me/route-breaks/5.0](https://virtserver.swaggerhub.com/Route4Me/route-breaks/5.0)
**Since**: 1.0.12
| Param | Type | Description |
| --- | --- | --- |
| routeIds | <code>Array.&lt;string&gt;</code> | Route IDs to set 'planned' status. |
| [callback] | <code>module:route4me-node~RequestCallback</code> | |
<a id="Routes+routeStopStatus" name="Routes+routeStopStatus"></a>
### routes.routeStopStatus(destinationIds, status, [callback])
Insert or update route address status/statuses.
**See**: [https://virtserver.swaggerhub.com/Route4Me/route-breaks/5.0](https://virtserver.swaggerhub.com/Route4Me/route-breaks/5.0)
**Since**: 1.0.12
| Param | Type | Description |
| --- | --- | --- |
| destinationIds | <code>Array.&lt;number&gt;</code> | Array of destination IDs to set status. |
| status | <code>string</code> | Value od status to set. Possible values: 'Skipped', 'Completed', 'Failed' and 'Empty'. |
| [callback] | <code>module:route4me-node~RequestCallback</code> | |
8 changes: 8 additions & 0 deletions book/en/code/Uncategorized.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ Uses base url route4me API v4.0
| [options.qs] | <code>object</code> | | Query string |
| [options.body] | <code>object</code> | | Body |
| [options.validationContext] | <code>null</code> \| <code>string</code> \| <code>function</code> | <code></code> | * `null` cause validation disabled (TODO: test this case) * `string` is threated as the name of JSON Schema * `function` will be used for validation. |
| [options.returns] | <code>object</code> | | Return values if present the return will be object with next structure { status, // e.g. 200, 201, 202, etc ... // other fields, e.g. 'jobId' res // result of request } |
| [options.returns.status] | <code>boolean</code> | | Return status |
| [options.returns.jobId] | <code>boolean</code> | | Return headers.x-job-id |
| [options.returns.location] | <code>boolean</code> | | Return headers.location |
| [callback] | [<code>RequestCallback</code>](#module_route4me-node..RequestCallback) | | |

<a id="RequestManager+_makeRequest5" name="RequestManager+_makeRequest5"></a>
Expand All @@ -133,6 +137,10 @@ Uses base url route4me API v5.0
| [options.qs] | <code>object</code> | | Query string |
| [options.body] | <code>object</code> | | Body |
| [options.validationContext] | <code>null</code> \| <code>string</code> \| <code>function</code> | <code></code> | * `null` cause validation disabled (TODO: test this case) * `string` is threated as the name of JSON Schema * `function` will be used for validation. |
| [options.returns] | <code>object</code> | | Return values if present the return will be object with next structure { status, // e.g. 200, 201, 202, etc ... // other fields, e.g. 'jobId' res // result of request } |
| [options.returns.status] | <code>boolean</code> | | Return status |
| [options.returns.jobId] | <code>boolean</code> | | Return headers.x-job-id |
| [options.returns.location] | <code>boolean</code> | | Return headers.location |
| [callback] | [<code>RequestCallback</code>](#module_route4me-node..RequestCallback) | | |

<a id="RequestManager+_makeError" name="RequestManager+_makeError"></a>
Expand Down
Loading

0 comments on commit b23a544

Please sign in to comment.