Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Commit

Permalink
fix: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jonyw4 committed Apr 20, 2020
1 parent a7058a3 commit a2455fd
Show file tree
Hide file tree
Showing 6 changed files with 239 additions and 39 deletions.
62 changes: 51 additions & 11 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Name | Description
------ | -----------
[MelhorEnvioPackage] |
[MelhorEnvioCalculateShipmentProduct] |
[MelhorEnvioGetShipmentCalculateShipmentItem] |
[MelhorEnvioGetShipmentCalculateShipmentResponseItem] |
[MelhorEnvioCompany] |
[MelhorEnvioBoxRange] |
[MelhorEnvioGetShipmentServicesResponseItem] |
Expand Down Expand Up @@ -58,7 +58,7 @@ Name | Description
💵 Calculate quote for shipment

**Kind**: inner method of [`MelhorEnvio`]
**Returns**: `Promise.<Array.<MelhorEnvioGetShipmentCalculateShipmentItem>, (Error)>` - Return all shipment quote, or an error if rejected. (Optional)
**Returns**: `Promise.<Array.<MelhorEnvioGetShipmentCalculateShipmentResponseItem>, (Error)>` - Return all shipment quote, or an error if rejected. (Optional)

| Param | Type | Default | Description |
| --- | --- | --- | --- |
Expand Down Expand Up @@ -128,15 +128,33 @@ Name | Description
| quantity | `number` | Qty of items |


## MelhorEnvioGetShipmentCalculateShipmentItem
## MelhorEnvioGetShipmentCalculateShipmentResponseItem

**Kind**: global typedef
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| company | `getShipmentServices.MelhorEnvioCompany` | Company information |
| \[error\] | `string` | A message of error. (Only if don't return information) |
| Id | `number` | Id |
| name | `string` | Name |
| price | `number` | Shipment Price |
| custom_price | `number` | Custom price |
| discount | `number` | Discount |
| currency | `string` | Currency |
| delivery_time | `number` | Delivery time in days |
| delivery_range | `object` | Range of delivery in days |
| delivery_range.min | `number` | Minimum value for delivery in days |
| delivery_range.max | `number` | Maximum value for delivery in days |
| custom_delivery_time | `number` | Custom delivery time |
| custom_delivery_range | `object` | Range of custom delivery |
| custom_delivery_range.min | `number` | Minimum value for custom delivery |
| custom_delivery_range.max | `number` | Maximum value for custom delivery |
| packages | `Array` | Packages |
| additional_services | `object` | Additional Services |
| additional_services.receipt | `boolean` | If the additional service receipt is active |
| additional_services.own_hand | `boolean` | If the additional service own hand is active |
| additional_services.collect | `boolean` | If the shipment will be collected |
| company | [`MelhorEnvioCompany`] | Company information |


## MelhorEnvioCompany
Expand All @@ -146,7 +164,9 @@ Name | Description

| Name | Type | Description |
| --- | --- | --- |
| id | `string` | ID |
| id | `number` | Id |
| name | `string` | Name |
| picture | `string` | Picture |


## MelhorEnvioBoxRange
Expand All @@ -156,7 +176,19 @@ Name | Description

| Name | Type | Description |
| --- | --- | --- |
| id | `string` | ID |
| weight | `object` | Range of weight |
| weight.min | `number` | Minimum value for weight |
| weight.max | `number` | Maximum value for weight |
| width | `object` | Range of width |
| width.min | `number` | Minimum value for width |
| width.max | `number` | Maximum value for width |
| height | `object` | Range of height |
| height.min | `number` | Minimum value for height |
| height.max | `number` | Maximum value for height |
| length | `object` | Range of length |
| length.min | `number` | Minimum value for length |
| length.max | `number` | Maximum value for length |
| sum | `number` | sum |


## MelhorEnvioGetShipmentServicesResponseItem
Expand All @@ -166,12 +198,20 @@ Name | Description

| Name | Type | Description |
| --- | --- | --- |
| id | `number` | Id |
| name | `string` | Name |
| type | `string` | Type |
| range | `string` | range |
| restrictions | `object` | Restriction information |
| restrictions.insurance_value | `object` | Range of insurance allowed |
| restrictions.insurance_value.min | `number` | Minimum value for insurance |
| restrictions.insurance_value.max | `number` | Maximum value for insurance |
| restrictions.formats | `object` | A list of allowed formats |
| restrictions.formats.box | [`MelhorEnvioBoxRange`] | Box format limits |
| \[restrictions.formats.roll\] | [`MelhorEnvioBoxRange`] | Roll format limits. (Optional) |
| \[restrictions.formats.letter\] | [`MelhorEnvioBoxRange`] | Letter format limits. (Optional) |
| \[restrictions.formats.roll\] | [`MelhorEnvioBoxRange`] | Roll format limits |
| \[restrictions.formats.letter\] | [`MelhorEnvioBoxRange`] | Letter format limits |
| requirements | `Array` | Requirements |
| optionals | `Array` | optionals services |
| company | [`MelhorEnvioCompany`] | Company information |

<!-- LINKS -->
Expand All @@ -180,16 +220,16 @@ Name | Description
[AxiosTestError]:#axiostesterror
[MelhorEnvioPackage]:#melhorenviopackage
[MelhorEnvioCalculateShipmentProduct]:#melhorenviocalculateshipmentproduct
[MelhorEnvioGetShipmentCalculateShipmentItem]:#melhorenviogetshipmentcalculateshipmentitem
[MelhorEnvioGetShipmentCalculateShipmentResponseItem]:#melhorenviogetshipmentcalculateshipmentresponseitem
[MelhorEnvioCompany]:#melhorenviocompany
[MelhorEnvioBoxRange]:#melhorenvioboxrange
[MelhorEnvioGetShipmentServicesResponseItem]:#melhorenviogetshipmentservicesresponseitem
[.MelhorEnvio]:#melhor-envio-jsmelhorenvio
[`melhor-envio-js`]:#melhor-envio-js
[`MelhorEnvio`]:#new-melhorenviotoken-issandbox-timeout
[`MelhorEnvioPackage`]:#melhorenviopackage
[`MelhorEnvioBoxRange`]:#melhorenvioboxrange
[`MelhorEnvioCompany`]:#melhorenviocompany
[`MelhorEnvioBoxRange`]:#melhorenvioboxrange
[new MelhorEnvio(token, \[isSandbox\], \[timeout\])]:#new-melhorenviotoken-issandbox-timeout
[~calculateShipment(fromPostalCode, toPostalCode, \[packageData\], \[productsData\], \[services\], \[receipt\], \[ownHand\], \[insuranceValue\])]:#melhorenviocalculateshipmentfrompostalcode-topostalcode-packagedata-productsdata-services-receipt-ownhand-insurancevalue
[~fetch(url, \[method\], \[params\], \[data\])]:#melhorenviofetchurl-method-params-data
Expand Down
54 changes: 47 additions & 7 deletions dist/melhor-envio-js-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,44 @@

/**
* @typedef {object} MelhorEnvioCompany
* @property {string} id ID
* @property {number} id Id
* @property {string} name Name
* @property {string} picture Picture
*/

/**
* @typedef {object} MelhorEnvioBoxRange
* @property {string} id ID
* @property {object} weight Range of weight
* @property {number} weight.min Minimum value for weight
* @property {number} weight.max Maximum value for weight
* @property {object} width Range of width
* @property {number} width.min Minimum value for width
* @property {number} width.max Maximum value for width
* @property {object} height Range of height
* @property {number} height.min Minimum value for height
* @property {number} height.max Maximum value for height
* @property {object} length Range of length
* @property {number} length.min Minimum value for length
* @property {number} length.max Maximum value for length
* @property {number} sum sum
*/

/**
* @typedef {object} MelhorEnvioGetShipmentServicesResponseItem
* @property {number} id Id
* @property {string} name Name
* @property {string} type Type
* @property {string} range range
* @property {object} restrictions Restriction information
* @property {object} restrictions.insurance_value Range of insurance allowed
* @property {number} restrictions.insurance_value.min Minimum value for insurance
* @property {number} restrictions.insurance_value.max Maximum value for insurance
* @property {object} restrictions.formats A list of allowed formats
* @property {MelhorEnvioBoxRange} restrictions.formats.box Box format limits
* @property {MelhorEnvioBoxRange} [restrictions.formats.roll] Roll format limits. (Optional)
* @property {MelhorEnvioBoxRange} [restrictions.formats.letter] Letter format limits. (Optional)
* @property {MelhorEnvioBoxRange} [restrictions.formats.roll] Roll format limits
* @property {MelhorEnvioBoxRange} [restrictions.formats.letter] Letter format limits
* @property {Array} requirements Requirements
* @property {Array} optionals optionals services
* @property {MelhorEnvioCompany} company Company information
*/

Expand Down Expand Up @@ -153,9 +175,27 @@
*/

/**
* @typedef {object} MelhorEnvioGetShipmentCalculateShipmentItem
* @typedef {object} MelhorEnvioGetShipmentCalculateShipmentResponseItem
* @property {number} Id Id
* @property {string} name Name
* @property {number} price Shipment Price
* @property {number} custom_price Custom price
* @property {number} discount Discount
* @property {string} currency Currency
* @property {number} delivery_time Delivery time in days
* @property {object} delivery_range Range of delivery in days
* @property {number} delivery_range.min Minimum value for delivery in days
* @property {number} delivery_range.max Maximum value for delivery in days
* @property {number} custom_delivery_time Custom delivery time
* @property {object} custom_delivery_range Range of custom delivery
* @property {number} custom_delivery_range.min Minimum value for custom delivery
* @property {number} custom_delivery_range.max Maximum value for custom delivery
* @property {Array} packages Packages
* @property {object} additional_services Additional Services
* @property {boolean} additional_services.receipt If the additional service receipt is active
* @property {boolean} additional_services.own_hand If the additional service own hand is active
* @property {boolean} additional_services.collect If the shipment will be collected
* @property {MelhorEnvioCompany} company Company information
* @property {string} [error] A message of error. (Only if don't return information)
*/

/**
Expand All @@ -170,7 +210,7 @@
* @param {boolean} [receipt=false] If you want a receipt service (Optional)
* @param {boolean} [ownHand=false] If you want a own hand service (Optional)
* @param {number} [insuranceValue=0] **Used only if you use packageData**. Value for the insurance (Optional)
* @returns {Promise.<Array.<MelhorEnvioGetShipmentCalculateShipmentItem>, (Error)>} Return all shipment quote, or an error if rejected. (Optional)
* @returns {Promise.<Array.<MelhorEnvioGetShipmentCalculateShipmentResponseItem>, (Error)>} Return all shipment quote, or an error if rejected. (Optional)
*/
async function calculateShipment (
fromPostalCode,
Expand Down
54 changes: 47 additions & 7 deletions dist/melhor-envio-js-esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,44 @@ async function fetch (

/**
* @typedef {object} MelhorEnvioCompany
* @property {string} id ID
* @property {number} id Id
* @property {string} name Name
* @property {string} picture Picture
*/

/**
* @typedef {object} MelhorEnvioBoxRange
* @property {string} id ID
* @property {object} weight Range of weight
* @property {number} weight.min Minimum value for weight
* @property {number} weight.max Maximum value for weight
* @property {object} width Range of width
* @property {number} width.min Minimum value for width
* @property {number} width.max Maximum value for width
* @property {object} height Range of height
* @property {number} height.min Minimum value for height
* @property {number} height.max Maximum value for height
* @property {object} length Range of length
* @property {number} length.min Minimum value for length
* @property {number} length.max Maximum value for length
* @property {number} sum sum
*/

/**
* @typedef {object} MelhorEnvioGetShipmentServicesResponseItem
* @property {number} id Id
* @property {string} name Name
* @property {string} type Type
* @property {string} range range
* @property {object} restrictions Restriction information
* @property {object} restrictions.insurance_value Range of insurance allowed
* @property {number} restrictions.insurance_value.min Minimum value for insurance
* @property {number} restrictions.insurance_value.max Maximum value for insurance
* @property {object} restrictions.formats A list of allowed formats
* @property {MelhorEnvioBoxRange} restrictions.formats.box Box format limits
* @property {MelhorEnvioBoxRange} [restrictions.formats.roll] Roll format limits. (Optional)
* @property {MelhorEnvioBoxRange} [restrictions.formats.letter] Letter format limits. (Optional)
* @property {MelhorEnvioBoxRange} [restrictions.formats.roll] Roll format limits
* @property {MelhorEnvioBoxRange} [restrictions.formats.letter] Letter format limits
* @property {Array} requirements Requirements
* @property {Array} optionals optionals services
* @property {MelhorEnvioCompany} company Company information
*/

Expand Down Expand Up @@ -148,9 +170,27 @@ async function getShipmentServices () {
*/

/**
* @typedef {object} MelhorEnvioGetShipmentCalculateShipmentItem
* @typedef {object} MelhorEnvioGetShipmentCalculateShipmentResponseItem
* @property {number} Id Id
* @property {string} name Name
* @property {number} price Shipment Price
* @property {number} custom_price Custom price
* @property {number} discount Discount
* @property {string} currency Currency
* @property {number} delivery_time Delivery time in days
* @property {object} delivery_range Range of delivery in days
* @property {number} delivery_range.min Minimum value for delivery in days
* @property {number} delivery_range.max Maximum value for delivery in days
* @property {number} custom_delivery_time Custom delivery time
* @property {object} custom_delivery_range Range of custom delivery
* @property {number} custom_delivery_range.min Minimum value for custom delivery
* @property {number} custom_delivery_range.max Maximum value for custom delivery
* @property {Array} packages Packages
* @property {object} additional_services Additional Services
* @property {boolean} additional_services.receipt If the additional service receipt is active
* @property {boolean} additional_services.own_hand If the additional service own hand is active
* @property {boolean} additional_services.collect If the shipment will be collected
* @property {MelhorEnvioCompany} company Company information
* @property {string} [error] A message of error. (Only if don't return information)
*/

/**
Expand All @@ -165,7 +205,7 @@ async function getShipmentServices () {
* @param {boolean} [receipt=false] If you want a receipt service (Optional)
* @param {boolean} [ownHand=false] If you want a own hand service (Optional)
* @param {number} [insuranceValue=0] **Used only if you use packageData**. Value for the insurance (Optional)
* @returns {Promise.<Array.<MelhorEnvioGetShipmentCalculateShipmentItem>, (Error)>} Return all shipment quote, or an error if rejected. (Optional)
* @returns {Promise.<Array.<MelhorEnvioGetShipmentCalculateShipmentResponseItem>, (Error)>} Return all shipment quote, or an error if rejected. (Optional)
*/
async function calculateShipment (
fromPostalCode,
Expand Down
54 changes: 47 additions & 7 deletions dist/melhor-envio-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,44 @@

/**
* @typedef {object} MelhorEnvioCompany
* @property {string} id ID
* @property {number} id Id
* @property {string} name Name
* @property {string} picture Picture
*/

/**
* @typedef {object} MelhorEnvioBoxRange
* @property {string} id ID
* @property {object} weight Range of weight
* @property {number} weight.min Minimum value for weight
* @property {number} weight.max Maximum value for weight
* @property {object} width Range of width
* @property {number} width.min Minimum value for width
* @property {number} width.max Maximum value for width
* @property {object} height Range of height
* @property {number} height.min Minimum value for height
* @property {number} height.max Maximum value for height
* @property {object} length Range of length
* @property {number} length.min Minimum value for length
* @property {number} length.max Maximum value for length
* @property {number} sum sum
*/

/**
* @typedef {object} MelhorEnvioGetShipmentServicesResponseItem
* @property {number} id Id
* @property {string} name Name
* @property {string} type Type
* @property {string} range range
* @property {object} restrictions Restriction information
* @property {object} restrictions.insurance_value Range of insurance allowed
* @property {number} restrictions.insurance_value.min Minimum value for insurance
* @property {number} restrictions.insurance_value.max Maximum value for insurance
* @property {object} restrictions.formats A list of allowed formats
* @property {MelhorEnvioBoxRange} restrictions.formats.box Box format limits
* @property {MelhorEnvioBoxRange} [restrictions.formats.roll] Roll format limits. (Optional)
* @property {MelhorEnvioBoxRange} [restrictions.formats.letter] Letter format limits. (Optional)
* @property {MelhorEnvioBoxRange} [restrictions.formats.roll] Roll format limits
* @property {MelhorEnvioBoxRange} [restrictions.formats.letter] Letter format limits
* @property {Array} requirements Requirements
* @property {Array} optionals optionals services
* @property {MelhorEnvioCompany} company Company information
*/

Expand Down Expand Up @@ -153,9 +175,27 @@
*/

/**
* @typedef {object} MelhorEnvioGetShipmentCalculateShipmentItem
* @typedef {object} MelhorEnvioGetShipmentCalculateShipmentResponseItem
* @property {number} Id Id
* @property {string} name Name
* @property {number} price Shipment Price
* @property {number} custom_price Custom price
* @property {number} discount Discount
* @property {string} currency Currency
* @property {number} delivery_time Delivery time in days
* @property {object} delivery_range Range of delivery in days
* @property {number} delivery_range.min Minimum value for delivery in days
* @property {number} delivery_range.max Maximum value for delivery in days
* @property {number} custom_delivery_time Custom delivery time
* @property {object} custom_delivery_range Range of custom delivery
* @property {number} custom_delivery_range.min Minimum value for custom delivery
* @property {number} custom_delivery_range.max Maximum value for custom delivery
* @property {Array} packages Packages
* @property {object} additional_services Additional Services
* @property {boolean} additional_services.receipt If the additional service receipt is active
* @property {boolean} additional_services.own_hand If the additional service own hand is active
* @property {boolean} additional_services.collect If the shipment will be collected
* @property {MelhorEnvioCompany} company Company information
* @property {string} [error] A message of error. (Only if don't return information)
*/

/**
Expand All @@ -170,7 +210,7 @@
* @param {boolean} [receipt=false] If you want a receipt service (Optional)
* @param {boolean} [ownHand=false] If you want a own hand service (Optional)
* @param {number} [insuranceValue=0] **Used only if you use packageData**. Value for the insurance (Optional)
* @returns {Promise.<Array.<MelhorEnvioGetShipmentCalculateShipmentItem>, (Error)>} Return all shipment quote, or an error if rejected. (Optional)
* @returns {Promise.<Array.<MelhorEnvioGetShipmentCalculateShipmentResponseItem>, (Error)>} Return all shipment quote, or an error if rejected. (Optional)
*/
async function calculateShipment (
fromPostalCode,
Expand Down
Loading

0 comments on commit a2455fd

Please sign in to comment.