Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Add TS docstring for getNextPage functions #429

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions types/Address/Address.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,20 @@ export declare class Address implements IAddress {
* @returns {Promise<Address>} The verified {@link Address} address.
*/
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 }>;
}
16 changes: 16 additions & 0 deletions types/Event/Event.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,20 @@ export declare class Event implements IEvent {
* @returns {Object} - An object containing a list of {@link Event events} and pagination information.
*/
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 }>;
}
16 changes: 16 additions & 0 deletions types/Insurance/Insurance.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,20 @@ export declare class Insurance implements IInsurance {
* @returns {Promise<Insurance>} The retrieved {@link Insurance}.
*/
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 }>;
}
16 changes: 16 additions & 0 deletions types/Pickup/Pickup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,22 @@ export declare class Pickup implements IPickup {
*/
static cancel(pickupId: string): Promise<Pickup>;

/**
* 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.
Expand Down
16 changes: 16 additions & 0 deletions types/Referral/Referral.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,20 @@ export declare class Referral implements IReferral {
* @returns {object} Object representing the newly-added payment method
*/
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 }>;
}
16 changes: 16 additions & 0 deletions types/Refund/Refund.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,20 @@ export declare class Refund implements IRefund {
* @returns {Promise<Refund>} The created and verified {@link Refund}.
*/
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 }>;
}
16 changes: 16 additions & 0 deletions types/Report/Report.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,20 @@ export declare class Report implements IReport {
* @see https://www.easypost.com/docs/api/node#retrieve-a-report
*/
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 }>;
}
16 changes: 16 additions & 0 deletions types/ScanForm/ScanForm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,20 @@ export declare class ScanForm implements IScanForm {
* @param {string} scanFormId Unique, begins with "sf_".
*/
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 }>;
}
16 changes: 16 additions & 0 deletions types/Shipment/Shipment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,20 @@ export declare class Shipment implements IShipment {
* @returns {Promise<Array<Object>>} The array of estimated delivery dates and rates.
*/
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 }>;
}
16 changes: 16 additions & 0 deletions types/Tracker/Tracker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,20 @@ export declare class Tracker implements ITracker {
* @returns {Promise<Tracker>} The retrieved {@link Tracker}.
*/
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 }>;
}
16 changes: 16 additions & 0 deletions types/User/User.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,20 @@ export declare class User implements IUser {
* @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 }>;
}