Skip to content

Commit

Permalink
Merge pull request #84 from route4me/1.0.16
Browse files Browse the repository at this point in the history
1.0.16
  • Loading branch information
r4m-juan authored Nov 16, 2022
2 parents d805410 + 142be73 commit ab6b871
Show file tree
Hide file tree
Showing 27 changed files with 4,550 additions and 54 deletions.
3 changes: 3 additions & 0 deletions book/en/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
### V5

* [AddressBookV5](code/AddressBookV5.md)
* [AutomaticTerritories](code/AutomaticTerritories.md)
* [TeamManagement](code/TeamManagement.md)
* [VehiclesV5](code/VehiclesV5.md)

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

Expand Down
72 changes: 72 additions & 0 deletions book/en/code/AutomaticTerritories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<a id="AutomaticTerritories" name="AutomaticTerritories"></a>

## AutomaticTerritories ℗

AutomaticTerritories facility

**Category**: AutomaticTerritories
**Access**: private
**Since**: 1.0.16

* [AutomaticTerritories](#AutomaticTerritories)
* [new AutomaticTerritories(requestManager)](#new_AutomaticTerritories_new)
* [.createJob(addresses, [mode], [params], callback)](#AutomaticTerritories+createJob)
* [.getJobStatus(jobId, callback)](#AutomaticTerritories+getJobStatus)
* [.getJobResult(jobId, callback)](#AutomaticTerritories+getJobResult)

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

### new AutomaticTerritories(requestManager)

Constructor

**Returns**: [<code>AutomaticTerritories</code>](#AutomaticTerritories) - - AutomaticTerritories facility

| Param | Type | Description |
| --- | --- | --- |
| requestManager | <code>RequestManager</code> | Request Manager |

<a id="AutomaticTerritories+createJob" name="AutomaticTerritories+createJob"></a>

### automaticTerritories.createJob(addresses, [mode], [params], callback)

Create job.

**Since**: 1.0.16

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| addresses | <code>Array.&lt;Object&gt;</code> | | An array of the address objects. |
| addresses.id | <code>String</code> | | Address ID. |
| addresses.lat | <code>Number</code> | | Address latitude. |
| addresses.lng | <code>Number</code> | | Address longitude. |
| [mode] | <code>Number</code> | <code>0</code> | |
| [params] | <code>Array.&lt;String&gt;</code> | <code>[]</code> | An array of parameters. |
| callback | <code>module:route4me-node~RequestCallback.&lt;jsonschema:AutomaticTerritories.JobID&gt;</code> | | |

<a id="AutomaticTerritories+getJobStatus" name="AutomaticTerritories+getJobStatus"></a>

### automaticTerritories.getJobStatus(jobId, callback)

Check the asynchronous job status by specifying the 'job_id' path parameter.

**Since**: 1.0.16

| Param | Type | Description |
| --- | --- | --- |
| jobId | <code>String</code> | Job ID to check status. |
| callback | <code>module:route4me-node~RequestCallback.&lt;jsonschema:AutomaticTerritories.ResponseStatus&gt;</code> | |

<a id="AutomaticTerritories+getJobResult" name="AutomaticTerritories+getJobResult"></a>

### automaticTerritories.getJobResult(jobId, callback)

Get the asynchronous job result by specifying the 'job_id' path parameter.

**Since**: 1.0.16

| Param | Type | Description |
| --- | --- | --- |
| jobId | <code>String</code> | Job ID to get result. |
| callback | <code>module:route4me-node~RequestCallback.&lt;jsonschema:AutomaticTerritories.ResponseJob&gt;</code> | |

69 changes: 69 additions & 0 deletions book/en/code/Optimizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Optimizations facility
* [Optimizations](#Optimizations)
* [new Optimizations(requestManager)](#new_Optimizations_new)
* [.create(optimization, isRedirect, [callback])](#Optimizations+create)
* [.createWithAdvancedConstraints(props, [isRedirect], callback)](#Optimizations+createWithAdvancedConstraints)
* [.get(id, [callback])](#Optimizations+get)
* [.list(states, options, [callback])](#Optimizations+list)
* [.update(id, data, [reoptimize], [callback])](#Optimizations+update)
Expand Down Expand Up @@ -45,6 +46,74 @@ Create a new optimization
| isRedirect | <code>boolean</code> | |
| [callback] | <code>module:route4me-node~RequestCallback.&lt;jsonschema:Optimizations.Response&gt;</code> | |

<a id="Optimizations+createWithAdvancedConstraints" name="Optimizations+createWithAdvancedConstraints"></a>

### optimizations.createWithAdvancedConstraints(props, [isRedirect], callback)

Create a new optimization with Advanced constraints

**See**

- [https://route4me.io/docs/#create-an-optimization](https://route4me.io/docs/#create-an-optimization)
- [https://github.com/route4me/route4me-json-schemas/blob/master/Optimization_create.json](https://github.com/route4me/route4me-json-schemas/blob/master/Optimization_create.json)
- [https://github.com/route4me/route4me-json-schemas/blob/master/RouteParameters.json](https://github.com/route4me/route4me-json-schemas/blob/master/RouteParameters.json)
- [https://github.com/route4me/route4me-json-schemas/blob/master/Address.json](https://github.com/route4me/route4me-json-schemas/blob/master/Address.json)
- [https://github.com/route4me/route4me-json-schemas/blob/master/Optimization_response.json](https://github.com/route4me/route4me-json-schemas/blob/master/Optimization_response.json)

**Since**: 0.1.15

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| props | <code>object</code> | | Optimization properties. Here are some required or useful properties, for full list of properties look at docs. |
| props.parameters | <code>object</code> | | Route Parameters. Here are some required and useful parameters, for full list of properties look at docs. |
| props.parameters.algorithm_type | <code>number</code> | | The optimization algorithm to be used. Possible values: 1 = TSP, 2 = VRP, 3 = CVRP_TW_SD, 4 = CVRP_TW_MD, 5 = TSP_TW, 6 = TSP_TW_CR, 7 = BBCVRP, 9 = ADVANCED_CVRP_TW,100 = ALG_NONE, 101 = ALG_LEGACY_DISTRIBUTED |
| props.parameters.device_type | <code>string</code> | | The type of the device that is creating this route. Possible values: "web", "iphone", "ipad", "android_phone", "android_tablet". |
| props.parameters.distance_unit | <code>string</code> | | The distance measurement unit for the route. Possible values: "mi", "km". |
| props.parameters.route_max_duration | <code>number</code> | | = 86400 - How many seconds a route can last at most. Default is 24 hours = 86400 seconds. |
| props.parameters.route_time | <code>number</code> | | = 25200 - Time when the route starts (relative to route_date) (Seconds). UTC timezone as well. Default is 07:00 UTC = 25200 seconds. |
| props.parameters.travel_mode | <code>number</code> | | The mode of travel that the directions should be optimized for. Possible values: "Driving", "Walking", "Bicycling". |
| [props.parameters.optimize] | <code>string</code> | | The driving directions will be generated biased for this selection. This has no impact on route sequencing. Possible values: "Distance", "Time", "timeWithTraffic". |
| [props.parameters.parts] | <code>number</code> | | Legacy feature which permits a user to request an example number of optimized routes. |
| [props.parameters.route_date] | <code>number</code> | | The route start date in UTC, unix timestamp seconds. Used to show users when the route will begin, also used for reporting and analytics. |
| [props.parameters.route_name] | <code>string</code> | | The name of this route. this route name will be accessible in the search API, and also will be displayed on the mobile device of a user. |
| [props.parameters.rt] | <code>boolean</code> | | The tour type of this route. rt is short for round trip, the optimization engine changes its behavior for round trip routes. |
| [props.parameters.vehicle_capacity] | <code>number</code> | | How much cargo can the vehicle carry (units, e.g. cubic meters) |
| [props.parameters.vehicle_max_distance_mi] | <code>number</code> | | Maximum distance for a single vehicle in this route (always in miles). |
| [props.parameters.advanced_constraints] | <code>number</code> | | Advanced Constraints. |
| [props.parameters.advanced_constraints.max_cargo_weight] | <code>number</code> | | Maximum cargo weight per route. |
| [props.parameters.advanced_constraints.max_cargo_volume] | <code>number</code> | | Maximum cargo volume per route. |
| [props.parameters.advanced_constraints.max_capacity] | <code>number</code> | | How much total cargo can be transported per route (units, e.g. cubic meters). |
| [props.parameters.advanced_constraints.members_count] | <code>number</code> | | Legacy feature which permits a user to request an example number of optimized routes. |
| props.parameters.advanced_constraints.available_time_windows | <code>Array.&lt;array&gt;</code> | | An array of the available time windows, e.g. [[43200, 72000], [TimeStart, TimeEnd]] Time Window Start in seconds: 7:00 am EST = (7 + 5) * 3600 = 43200 Time Window End in seconds: 15:00 am EST = (15 + 5) * 3600 = 72000 |
| [props.parameters.advanced_constraints.tags] | <code>Array.&lt;string&gt;</code> | | The driver tags specified in a team member's custom data. (e.g. 'driver skills': ["Class A CDL", "Class B CDL", "Forklift", "Skid Steer Loader", "Independent Contractor"]) |
| [props.parameters.advanced_constraints.route4me_members_id] | <code>Array.&lt;number&gt;</code> | | An array of the skilled driver IDs. |
| [props.parameters.advanced_constraints.depot_address] | <code>object</code> | | A depot address. |
| props.parameters.advanced_constraints.depot_address.source_id | <code>number</code> | | Source ID. |
| props.parameters.advanced_constraints.depot_address.source_type | <code>string</code> | | Source type (e.g. input_addresses). |
| [props.parameters.advanced_constraints.location_sequence_pattern] | <code>Array.&lt;object&gt;</code> | | The parameter is used in advanced constraints to set the stops you plan to visit each route. Note: empty string "" means any stops, for example ["", AddresssObject1, AddresssObject2, "", AddresssObject3] means any stops before AddresssObject1 and between AddresssObject2 and AddresssObject3. |
| [props.parameters.advanced_constraints.location_sequence_pattern.alias] | <code>string</code> | | Location alias |
| [props.parameters.advanced_constraints.location_sequence_pattern.address] | <code>string</code> | | Location address |
| props.parameters.advanced_constraints.location_sequence_pattern.lat | <code>number</code> | | Location latitude |
| props.parameters.advanced_constraints.location_sequence_pattern.lng | <code>number</code> | | Location longitude |
| [props.parameters.advanced_constraints.location_sequence_pattern.time] | <code>number</code> | | Location service time |
| [props.parameters.advanced_constraints.group] | <code>string</code> | | Group name of the advanced constraints. |
| [props.depots] | <code>Array.&lt;object&gt;</code> | | A valid array of Address objects of Depots. |
| props.addresses | <code>Array.&lt;object&gt;</code> | | A valid array of Address objects. Here are some required and useful properties of the Address object, for full list of properties look at docs. |
| props.addresses.lat | <code>number</code> | | Latitude. |
| props.addresses.lng | <code>number</code> | | Longitude. |
| [props.addresses.alias] | <code>string</code> | | Address Alias. |
| [props.addresses.address] | <code>string</code> | | The route Address Line 1. |
| [props.addresses.is_depot] | <code>boolean</code> | <code>false</code> | This address is a depot. |
| [props.addresses.group] | <code>string</code> | | Address group. |
| [props.addresses.time] | <code>number</code> | | Service time (seconds). |
| [props.addresses.time_window_start] | <code>number</code> | | Time Window Start in seconds, relative to the route start date (midnight), UTC time zone. It is relative to start date because start time changes would shift time windows. |
| [props.addresses.time_window_end] | <code>number</code> | | Time Window End in seconds, relative to the route start date (midnight), UTC time zone. It is relative to start date because start time changes would shift time windows. |
| [props.addresses.tags] | <code>Array.&lt;string&gt;</code> | | Array of address tags. |
| [props.addresses.contact_id] | <code>number</code> | | Address book contact id (0 means not connected to the address book). |
| [props.optimized_callback_url] | <code>string</code> | | A URL that gets called when the optimization is solved, or if there is an error. The callback is called with a POST request. The POST data sent is: timestamp (Seconds) - Server timestamp of request sent; optimization_problem_id (Hash String) - ID of the optimization; state (Small Int) - The state can be one of the values: 4 = OPTIMIZATION_STATE_OPTIMIZED, which means the optimization was successful; 5 = OPTIMIZATION_STATE_ERROR, which means there was an error solving the optimization. Query string (GET fields). |
| [isRedirect] | <code>boolean</code> | | If set, it will be redirected. Use false for no redirection or not send. |
| callback | <code>RequestCallback</code> | | The callback that handles the response. |

<a id="Optimizations+get" name="Optimizations+get"></a>

### optimizations.get(id, [callback])
Expand Down
57 changes: 41 additions & 16 deletions book/en/code/Route4Me.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,25 @@ With `route4me` instance you should get responses from API easy-peasy.

Main members of the instanse of `Route4Me` class:

* [ActivityFeed ](ActivityFeed)
* [Addresses ](Addresses)
* [AddressBook ](AddressBook)
* [AddressBookV5 ](AddressBookV5)
* [AddressBarcodes ](AddressBarcodes)
* [AvoidanceZones ](AvoidanceZones)
* [Geocoding ](Geocoding)
* [Members ](Members)
* [Notes ](Notes)
* [Optimizations ](Optimizations)
* [Orders ](Orders)
* [OrderCustomFields](OrderCustomFields)
* [Routes ](Routes)
* [Territories ](Territories)
* [Tracking ](Tracking)
* [Vehicles ](Vehicles)
* [ActivityFeed ](ActivityFeed)
* [Addresses ](Addresses)
* [AddressBook ](AddressBook)
* [AddressBookV5 ](AddressBookV5)
* [AddressBarcodes ](AddressBarcodes)
* [AutomaticTerritories](AutomaticTerritories)
* [AvoidanceZones ](AvoidanceZones)
* [Geocoding ](Geocoding)
* [Members ](Members)
* [Notes ](Notes)
* [Optimizations ](Optimizations)
* [Orders ](Orders)
* [OrderCustomFields ](OrderCustomFields)
* [Routes ](Routes)
* [TeamManagement ](TeamManagement)
* [Territories ](Territories)
* [Tracking ](Tracking)
* [Vehicles ](Vehicles)
* [VehiclesV5 ](VehiclesV5)

Each member corresponds to an bunch of methods, described in API-documentation,
but the most methods in this SDK have unified names:
Expand Down Expand Up @@ -129,15 +132,18 @@ For most use cases it is necessary:
* [.AddressBookV5](#Route4Me+AddressBookV5) : <code>AddressBookV5</code>
* [.AddressBarcodes](#Route4Me+AddressBarcodes) : <code>AddressBarcodes</code>
* [.Addresses](#Route4Me+Addresses) : <code>Addresses</code>
* [.AutomaticTerritories](#Route4Me+AutomaticTerritories) : <code>AutomaticTerritories</code>
* [.AvoidanceZones](#Route4Me+AvoidanceZones) : <code>AvoidanceZones</code>
* [.Geocoding](#Route4Me+Geocoding) : <code>Geocoding</code>
* [.Notes](#Route4Me+Notes) : <code>Notes</code>
* [.Optimizations](#Route4Me+Optimizations) : <code>Optimizations</code>
* [.Orders](#Route4Me+Orders) : <code>Orders</code>
* [.Routes](#Route4Me+Routes) : <code>Routes</code>
* [.TeamManagement](#Route4Me+TeamManagement) : <code>TeamManagement</code>
* [.Territories](#Route4Me+Territories) : <code>Territories</code>
* [.Tracking](#Route4Me+Tracking) : <code>Tracking</code>
* [.Vehicles](#Route4Me+Vehicles) : <code>Vehicles</code>
* [.VehiclesV5](#Route4Me+VehiclesV5) : <code>VehiclesV5</code>
* [.version](#Route4Me+version) ⇒ <code>string</code>
* [.baseUrl()](#Route4Me+baseUrl) ⇒ <code>string</code>
* [.baseUrl5()](#Route4Me+baseUrl5) ⇒ <code>string</code>
Expand Down Expand Up @@ -197,6 +203,13 @@ Create new API client
**Addresses** related API calls

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

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

**AutomaticTerritories** related API calls

**Since**: 0.1.16
<a id="Route4Me+AvoidanceZones" name="Route4Me+AvoidanceZones"></a>

### route4Me.AvoidanceZones : <code>AvoidanceZones</code>
Expand Down Expand Up @@ -237,6 +250,12 @@ Create new API client
**Routes** related API calls

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

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

**TeamManagement** related API calls

<a id="Route4Me+Territories" name="Route4Me+Territories"></a>

### route4Me.Territories : <code>Territories</code>
Expand All @@ -255,6 +274,12 @@ Create new API client

**Vehicles** related API calls

<a id="Route4Me+VehiclesV5" name="Route4Me+VehiclesV5"></a>

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

**VehiclesV5** related API calls

<a id="Route4Me+version" name="Route4Me+version"></a>

### route4Me.version ⇒ <code>string</code>
Expand Down
Loading

0 comments on commit ab6b871

Please sign in to comment.