@shipengine/js-api 0.35.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/account-billing-plan/api.d.ts +13 -0
- package/account-billing-plan/index.d.ts +2 -0
- package/account-billing-plan/types.d.ts +30 -0
- package/client.d.ts +6 -0
- package/errors/types.d.ts +1 -1
- package/index.js +20 -0
- package/index.mjs +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { AccountBillingPlanResponse } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* # Account Billing Plan API module - /v1/account/billing_plan
|
|
5
|
+
*/
|
|
6
|
+
export declare class AccountBillingPlanAPI {
|
|
7
|
+
private client;
|
|
8
|
+
constructor(client: AxiosInstance);
|
|
9
|
+
/**
|
|
10
|
+
* The `get` method retrieves the account billing plan for the current user.
|
|
11
|
+
*/
|
|
12
|
+
get: () => Promise<import("axios").AxiosResponse<AccountBillingPlanResponse, any>>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare enum AccountBillingPlanChangeType {
|
|
2
|
+
Downgrade = 0,
|
|
3
|
+
Cancellation = 1
|
|
4
|
+
}
|
|
5
|
+
export type AccountBillingPlan = {
|
|
6
|
+
code: string;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Responses
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* "cancelledAt", "pendingChange" and "trialEndAt" are only available when applies
|
|
14
|
+
* won't be on the response otherwise
|
|
15
|
+
*/
|
|
16
|
+
export type AccountBillingPlanResponse = {
|
|
17
|
+
billingPlan: AccountBillingPlan;
|
|
18
|
+
cancelledAt?: string;
|
|
19
|
+
currentBillingCycle: {
|
|
20
|
+
endsAt: string;
|
|
21
|
+
startedAt: string;
|
|
22
|
+
};
|
|
23
|
+
pendingChange?: {
|
|
24
|
+
changeTo: AccountBillingPlan;
|
|
25
|
+
effectiveAt: string;
|
|
26
|
+
requestedAt: string;
|
|
27
|
+
type: AccountBillingPlanChangeType;
|
|
28
|
+
};
|
|
29
|
+
trialEndAt?: string;
|
|
30
|
+
};
|
package/client.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AxiosRequestHeaders } from "axios";
|
|
2
|
+
import { AccountBillingPlanAPI } from "./account-billing-plan";
|
|
2
3
|
import { AccountSettingsAPI } from "./account-settings";
|
|
3
4
|
import { AddressesAPI } from "./addresses";
|
|
4
5
|
import { CarriersAPI } from "./carriers";
|
|
@@ -54,6 +55,11 @@ export declare class ShipEngineAPI {
|
|
|
54
55
|
* @see {@link AccountSettingsAPI | The Account Settings API module}
|
|
55
56
|
*/
|
|
56
57
|
get accountSettings(): AccountSettingsAPI;
|
|
58
|
+
/**
|
|
59
|
+
* The `accountBillingPlan` method provides access to the Account Billing Plan endpoints
|
|
60
|
+
* in ShipEngine API.
|
|
61
|
+
*/
|
|
62
|
+
get accountBillingPlan(): AccountBillingPlanAPI;
|
|
57
63
|
/**
|
|
58
64
|
* The `addresses` method provides access to the Address Validation endpoints
|
|
59
65
|
* in ShipEngine API. e.g. Validate Addresses, Parse Addresses, etc.
|
package/errors/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @category Entities
|
|
3
3
|
*/
|
|
4
|
-
export type CodedErrorCode = "auto_fund_not_supported" | "batch_cannot_be_modified" | "carrier_conflict" | "carrier_disconnected" | "carrier_not_connected" | "carrier_not_supported" | "confirmation_not_supported" | "default_warehouse_cannot_be_deleted" | "duplicated_rate_card" | "empty_file" | "field_conflict" | "field_value_required" | "forbidden" | "identifier_conflict" | "identifiers_must_match" | "insufficient_funds" | "insufficient_rate_card_data" | "invalid_address" | "invalid_billing_plan" | "invalid_currency" | "invalid_field_value" | "invalid_file_type" | "invalid_file_size" | "invalid_identifier" | "invalid_status" | "invalid_string_length" | "invalid_zones" | "invalid_packages" | "invalid_weight_bands" | "invalid_rates" | "label_images_not_supported" | "meter_failure" | "not_found" | "order_source_not_active" | "rate_limit_exceeded" | "refresh_not_supported" | "request_body_required" | "return_label_not_supported" | "settings_not_supported" | "subscription_inactive" | "terms_not_accepted" | "tracking_not_supported" | "trial_expired" | "unauthorized" | "unknown" | "unspecified" | "verification_failure" | "warehouse_conflict" | "webhook_event_type_conflict";
|
|
4
|
+
export type CodedErrorCode = "auto_fund_not_supported" | "batch_cannot_be_modified" | "carrier_conflict" | "carrier_disconnected" | "carrier_not_connected" | "carrier_not_supported" | "confirmation_not_supported" | "default_warehouse_cannot_be_deleted" | "duplicated_rate_card" | "empty_file" | "field_conflict" | "field_value_required" | "forbidden" | "identifier_conflict" | "identifiers_must_match" | "insufficient_funds" | "insufficient_rate_card_data" | "invalid_address" | "invalid_billing_plan" | "invalid_currency" | "invalid_field_value" | "invalid_file_type" | "invalid_file_size" | "invalid_identifier" | "invalid_status" | "invalid_string_length" | "invalid_zones" | "invalid_packages" | "invalid_weight_bands" | "invalid_weight_bands_rates" | "invalid_rates" | "label_images_not_supported" | "meter_failure" | "not_found" | "order_source_not_active" | "rate_limit_exceeded" | "refresh_not_supported" | "repeated_surcharges_in_rate_card" | "repeated_surcharges_in_services" | "repeated_surcharges_in_zone" | "request_body_required" | "return_label_not_supported" | "settings_not_supported" | "subscription_inactive" | "terms_not_accepted" | "tracking_not_supported" | "trial_expired" | "unauthorized" | "unknown" | "unspecified" | "verification_failure" | "warehouse_conflict" | "webhook_event_type_conflict";
|
|
5
5
|
/**
|
|
6
6
|
* @category Entities
|
|
7
7
|
*/
|
package/index.js
CHANGED
|
@@ -3227,6 +3227,19 @@ var lib = {
|
|
|
3227
3227
|
stringify: stringify
|
|
3228
3228
|
};
|
|
3229
3229
|
|
|
3230
|
+
class AccountBillingPlanAPI {
|
|
3231
|
+
constructor(client) {
|
|
3232
|
+
this.client = client;
|
|
3233
|
+
/**
|
|
3234
|
+
* The `get` method retrieves the account billing plan for the current user.
|
|
3235
|
+
*/
|
|
3236
|
+
this.get = () => {
|
|
3237
|
+
return this.client.get("/v1/account/billing_plan");
|
|
3238
|
+
};
|
|
3239
|
+
this.client = client;
|
|
3240
|
+
}
|
|
3241
|
+
}
|
|
3242
|
+
|
|
3230
3243
|
class CustomPackagesAPI {
|
|
3231
3244
|
constructor(client) {
|
|
3232
3245
|
this.client = client;
|
|
@@ -3825,6 +3838,13 @@ class ShipEngineAPI {
|
|
|
3825
3838
|
get accountSettings() {
|
|
3826
3839
|
return new AccountSettingsAPI(this.client);
|
|
3827
3840
|
}
|
|
3841
|
+
/**
|
|
3842
|
+
* The `accountBillingPlan` method provides access to the Account Billing Plan endpoints
|
|
3843
|
+
* in ShipEngine API.
|
|
3844
|
+
*/
|
|
3845
|
+
get accountBillingPlan() {
|
|
3846
|
+
return new AccountBillingPlanAPI(this.client);
|
|
3847
|
+
}
|
|
3828
3848
|
/**
|
|
3829
3849
|
* The `addresses` method provides access to the Address Validation endpoints
|
|
3830
3850
|
* in ShipEngine API. e.g. Validate Addresses, Parse Addresses, etc.
|
package/index.mjs
CHANGED
|
@@ -3223,6 +3223,19 @@ var lib = {
|
|
|
3223
3223
|
stringify: stringify
|
|
3224
3224
|
};
|
|
3225
3225
|
|
|
3226
|
+
class AccountBillingPlanAPI {
|
|
3227
|
+
constructor(client) {
|
|
3228
|
+
this.client = client;
|
|
3229
|
+
/**
|
|
3230
|
+
* The `get` method retrieves the account billing plan for the current user.
|
|
3231
|
+
*/
|
|
3232
|
+
this.get = () => {
|
|
3233
|
+
return this.client.get("/v1/account/billing_plan");
|
|
3234
|
+
};
|
|
3235
|
+
this.client = client;
|
|
3236
|
+
}
|
|
3237
|
+
}
|
|
3238
|
+
|
|
3226
3239
|
class CustomPackagesAPI {
|
|
3227
3240
|
constructor(client) {
|
|
3228
3241
|
this.client = client;
|
|
@@ -3821,6 +3834,13 @@ class ShipEngineAPI {
|
|
|
3821
3834
|
get accountSettings() {
|
|
3822
3835
|
return new AccountSettingsAPI(this.client);
|
|
3823
3836
|
}
|
|
3837
|
+
/**
|
|
3838
|
+
* The `accountBillingPlan` method provides access to the Account Billing Plan endpoints
|
|
3839
|
+
* in ShipEngine API.
|
|
3840
|
+
*/
|
|
3841
|
+
get accountBillingPlan() {
|
|
3842
|
+
return new AccountBillingPlanAPI(this.client);
|
|
3843
|
+
}
|
|
3824
3844
|
/**
|
|
3825
3845
|
* The `addresses` method provides access to the Address Validation endpoints
|
|
3826
3846
|
* in ShipEngine API. e.g. Validate Addresses, Parse Addresses, etc.
|