@easypost/api
Advanced tools
Comparing version 7.0.0 to 7.1.0
# CHANGELOG | ||
## v7.1.0 (2024-01-08) | ||
- Adds `allChildren` function in User service to get a paginated list of children | ||
- Adds `getNextPage` function in User service to get next paginated list of children | ||
## v7.0.0 (2023-12-06) | ||
@@ -4,0 +9,0 @@ |
{ | ||
"name": "@easypost/api", | ||
"description": "EasyPost Node Client Library", | ||
"version": "7.0.0", | ||
"version": "7.1.0", | ||
"author": "Easypost Engineering <oss@easypost.com>", | ||
@@ -65,3 +65,3 @@ "homepage": "https://easypost.com", | ||
"babel-preset-minify": "^0.5.2", | ||
"chai": "^4.3.7", | ||
"chai": "4.3.10", | ||
"chai-as-promised": "^7.1.1", | ||
@@ -68,0 +68,0 @@ "cross-env": "^7.0.3", |
@@ -119,2 +119,31 @@ import baseService from './base_service'; | ||
} | ||
/** | ||
* Retrieve a paginated list of children user {@link User user}. | ||
* See {@link https://www.easypost.com/docs/api/node#child-users EasyPost API Documentation} for more information. | ||
* @param {Object} params - Parameters to filter the list of children users. | ||
* @returns {Object} - An object containing a list of {@link Children User} and pagination information. | ||
*/ | ||
static async allChildren(params) { | ||
const url = 'users/children'; | ||
try { | ||
const response = await easypostClient._get(url, params); | ||
return this._convertToEasyPostObject(response.body, params); | ||
} catch (e) { | ||
return Promise.reject(e); | ||
} | ||
} | ||
/** | ||
* Retrieve the next page of children collection. | ||
* @param {Object} children An object containing a list of {@link Children children} and pagination information. | ||
* @param {Number} pageSize The number of records to return on each page | ||
* @returns {EasyPostObject|Promise<never>} The retrieved {@link EasyPostObject}-based class instance, or a `Promise` that rejects with an error. | ||
*/ | ||
static async getNextPage(children, pageSize = null) { | ||
const url = 'users/children'; | ||
return this._getNextPage(url, 'children', children, pageSize); | ||
} | ||
}; |
@@ -176,2 +176,18 @@ import { IObjectWithId } from '../base'; | ||
static retrieve(addressId: string): Promise<Address>; | ||
/** | ||
* Retrieve the next page of {@link Address addresses}. | ||
* | ||
* This automatically reuses the parameters from the previous call or the original {@link Address.all} call. | ||
* | ||
* @see https://www.easypost.com/docs/api/node#retrieve-a-list-of-addresses | ||
* | ||
* @param {Object} addresses - The previous page of addresses (the response from the last {@link Address.getNextPage} or {@link Address.all} call). | ||
* @param {number} [pageSize] - The number of addresses to retrieve per page, optional. Defaults to server-side default. | ||
* @returns {Object} - An object containing a list of {@link Address addresses} and pagination information. | ||
*/ | ||
static getNextPage( | ||
addresses: Object, | ||
pageSize?: number, | ||
): Promise<{ addresses: Address[]; has_more: boolean }>; | ||
} |
@@ -76,2 +76,18 @@ import { IDatedObject, IObjectWithId } from '../base'; | ||
static all(params: IEventListParameters): Promise<{ events: Event[]; has_more: boolean }>; | ||
/** | ||
* Retrieve the next page of {@link Event events}. | ||
* | ||
* This automatically reuses the parameters from the previous call or the original {@link Event.all} call. | ||
* | ||
* @see https://www.easypost.com/docs/api/node#retrieve-a-list-of-events | ||
* | ||
* @param {Object} events - The previous page of events (the response from the last {@link Event.getNextPage} or {@link Event.all} call). | ||
* @param {number} [pageSize] - The number of events to retrieve per page, optional. Defaults to server-side default. | ||
* @returns {Object} - An object containing a list of {@link Event events} and pagination information. | ||
*/ | ||
static getNextPage( | ||
events: Object, | ||
pageSize?: number, | ||
): Promise<{ events: Event[]; has_more: boolean }>; | ||
} |
@@ -148,2 +148,18 @@ import { IAddress } from '../Address'; | ||
static retrieve(insuranceId: string): Promise<Insurance>; | ||
/** | ||
* Retrieve the next page of {@link Insurance insurances}. | ||
* | ||
* This automatically reuses the parameters from the previous call or the original {@link Insurance.all} call. | ||
* | ||
* @see https://www.easypost.com/docs/api/node#retrieve-a-list-of-insurances | ||
* | ||
* @param {Object} insurances - The previous page of insurances (the response from the last {@link Insurance.getNextPage} or {@link Insurance.all} call). | ||
* @param {number} [pageSize] - The number of insurances to retrieve per page, optional. Defaults to server-side default. | ||
* @returns {Object} - An object containing a list of {@link Insurance insurances} and pagination information. | ||
*/ | ||
static getNextPage( | ||
insurances: Object, | ||
pageSize?: number, | ||
): Promise<{ insurances: Insurance[]; has_more: boolean }>; | ||
} |
@@ -177,3 +177,19 @@ import { IAddress } from '../Address'; | ||
/** | ||
* Retrieve the next page of {@link Pickup pickups}. | ||
* | ||
* This automatically reuses the parameters from the previous call or the original {@link Pickup.all} call. | ||
* | ||
* @see https://www.easypost.com/docs/api/node#retrieve-a-list-of-pickups | ||
* | ||
* @param {Object} pickups - The previous page of pickups (the response from the last {@link Pickup.getNextPage} or {@link Pickup.all} call). | ||
* @param {number} [pageSize] - The number of pickups to retrieve per page, optional. Defaults to server-side default. | ||
* @returns {Object} - An object containing a list of {@link Pickup pickups} and pagination information. | ||
*/ | ||
static getNextPage( | ||
pickups: Object, | ||
pageSize?: number, | ||
): Promise<{ pickups: Pickup[]; has_more: boolean }>; | ||
/** | ||
* | ||
* @param carriers a list of carriers to filter rates for. | ||
@@ -180,0 +196,0 @@ * @param services a list of services to filter rates for. |
@@ -99,2 +99,18 @@ import { IUser } from '../User'; | ||
static refundByPaymentLog(paymentLogId: string): object; | ||
/** | ||
* Retrieve the next page of {@link Referral referrals}. | ||
* | ||
* This automatically reuses the parameters from the previous call or the original {@link Referral.all} call. | ||
* | ||
* @see https://www.easypost.com/docs/api/node#retrieve-a-list-of-referral-customers | ||
* | ||
* @param {Object} referralCustomers - The previous page of referrals (the response from the last {@link Referral.getNextPage} or {@link Referral.all} call). | ||
* @param {number} [pageSize] - The number of referrals to retrieve per page, optional. Defaults to server-side default. | ||
* @returns {Object} - An object containing a list of {@link Referral referrals} and pagination information. | ||
*/ | ||
static getNextPage( | ||
referralCustomers: Object, | ||
pageSize?: number, | ||
): Promise<{ referrals: Referral[]; has_more: boolean }>; | ||
} |
@@ -84,2 +84,18 @@ import { IDatedObject, IObjectWithId } from '../base'; | ||
static retrieve(refundId: string): Promise<Refund>; | ||
/** | ||
* Retrieve the next page of {@link Refund refunds}. | ||
* | ||
* This automatically reuses the parameters from the previous call or the original {@link Refund.all} call. | ||
* | ||
* @see https://www.easypost.com/docs/api/node#retrieve-a-list-of-refunds | ||
* | ||
* @param {Object} refunds - The previous page of refunds (the response from the last {@link Refund.getNextPage} or {@link Refund.all} call). | ||
* @param {number} [pageSize] - The number of refunds to retrieve per page, optional. Defaults to server-side default. | ||
* @returns {Object} - An object containing a list of {@link Refund refunds} and pagination information. | ||
*/ | ||
static getNextPage( | ||
refunds: Object, | ||
pageSize?: number, | ||
): Promise<{ refunds: Refund[]; has_more: boolean }>; | ||
} |
@@ -117,2 +117,18 @@ import { IDatedObject, IObjectWithId } from '../base'; | ||
static retrieve(reportId: string): Promise<Report>; | ||
/** | ||
* Retrieve the next page of {@link Report reports}. | ||
* | ||
* This automatically reuses the parameters from the previous call or the original {@link Report.all} call. | ||
* | ||
* @see https://www.easypost.com/docs/api/node#retrieve-a-list-of-reports | ||
* | ||
* @param {Object} reports - The previous page of reports (the response from the last {@link Report.getNextPage} or {@link Report.all} call). | ||
* @param {number} [pageSize] - The number of reports to retrieve per page, optional. Defaults to server-side default. | ||
* @returns {Object} - An object containing a list of {@link Report reports} and pagination information. | ||
*/ | ||
static getNextPage( | ||
reports: Object, | ||
pageSize?: number, | ||
): Promise<{ reports: Report[]; has_more: boolean }>; | ||
} |
@@ -110,2 +110,18 @@ import { IAddress } from '../Address'; | ||
static retrieve(scanFormId: string): Promise<ScanForm>; | ||
/** | ||
* Retrieve the next page of {@link ScanForm scan forms}. | ||
* | ||
* This automatically reuses the parameters from the previous call or the original {@link ScanForm.all} call. | ||
* | ||
* @see https://www.easypost.com/docs/api/node#retrieve-a-list-of-scanforms | ||
* | ||
* @param {Object} scanforms - The previous page of scan forms (the response from the last {@link ScanForm.getNextPage} or {@link ScanForm.all} call). | ||
* @param {number} [pageSize] - The number of scan forms to retrieve per page, optional. Defaults to server-side default. | ||
* @returns {Object} - An object containing a list of {@link ScanForm scan forms} and pagination information. | ||
*/ | ||
static getNextPage( | ||
scanforms: Object, | ||
pageSize?: number, | ||
): Promise<{ scanforms: ScanForm[]; has_more: boolean }>; | ||
} |
@@ -330,2 +330,18 @@ import { IAddress } from '../Address'; | ||
static retrieveEstimatedDeliveryDate(id: string, plannedShipDate: string): Promise<Array<Object>>; | ||
/** | ||
* Retrieve the next page of {@link Shipment shipments}. | ||
* | ||
* This automatically reuses the parameters from the previous call or the original {@link Shipment.all} call. | ||
* | ||
* @see https://www.easypost.com/docs/api/node#retrieve-a-list-of-shipments | ||
* | ||
* @param {Object} shipments - The previous page of shipments (the response from the last {@link Shipment.getNextPage} or {@link Shipment.all} call). | ||
* @param {number} [pageSize] - The number of shipments to retrieve per page, optional. Defaults to server-side default. | ||
* @returns {Object} - An object containing a list of {@link Shipment shipments} and pagination information. | ||
*/ | ||
static getNextPage( | ||
shipments: Object, | ||
pageSize?: number, | ||
): Promise<{ shipments: Shipment[]; has_more: boolean }>; | ||
} |
@@ -168,2 +168,18 @@ import { IDatedObject, IObjectWithId } from '../base'; | ||
static retrieve(trackerId: string): Promise<Tracker>; | ||
/** | ||
* Retrieve the next page of {@link Tracker trackers}. | ||
* | ||
* This automatically reuses the parameters from the previous call or the original {@link Tracker.all} call. | ||
* | ||
* @see https://www.easypost.com/docs/api/node#retrieve-a-list-of-trackers | ||
* | ||
* @param {Object} trackers - The previous page of trackers (the response from the last {@link Tracker.getNextPage} or {@link Tracker.all} call). | ||
* @param {number} [pageSize] - The number of trackers to retrieve per page, optional. Defaults to server-side default. | ||
* @returns {Object} - An object containing a list of {@link Tracker trackers} and pagination information. | ||
*/ | ||
static getNextPage( | ||
trackers: Object, | ||
pageSize?: number, | ||
): Promise<{ trackers: Tracker[]; has_more: boolean }>; | ||
} |
@@ -159,2 +159,33 @@ import { IObjectWithId } from '../base'; | ||
static delete(id: string): void; | ||
/** | ||
* Retrieve a list of all children user. | ||
* | ||
* The Children List is a paginated list of all {@link User} objects associated with the given API Key. | ||
* It accepts a variety of parameters which can be used to modify the scope. | ||
* The has_more attribute indicates whether additional pages can be requested. | ||
* The recommended way of paginating is to use either the `before_id` or `after_id` parameter to specify where the next page begins. | ||
* | ||
* @see https://www.easypost.com/docs/api/node#child-users | ||
* | ||
* @param {Object} params - The parameters to use for the request. | ||
* @returns {Object} - An object containing a list of {@link Children children} and pagination information. | ||
*/ | ||
static allChildren(params: Object): Promise<{ children: User[]; has_more: boolean }>; | ||
/** | ||
* Retrieve the next page of {@link User child users}. | ||
* | ||
* This automatically reuses the parameters from the previous call or the original {@link User.allChildren} call. | ||
* | ||
* @see https://www.easypost.com/docs/api/node#child-users | ||
* | ||
* @param {Object} children - The previous page of child users (the response from the last {@link User.getNextPage} or {@link User.allChildren} call). | ||
* @param {number} [pageSize] - The number of child users to retrieve per page, optional. Defaults to server-side default. | ||
* @returns {Object} - An object containing a list of {@link User child users} and pagination information. | ||
*/ | ||
static getNextPage( | ||
children: Object, | ||
pageSize?: number, | ||
): Promise<{ children: User[]; has_more: boolean }>; | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
813499
12497