@shipengine/js-api 0.38.1 → 0.39.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/index.js +6 -0
- package/index.mjs +6 -0
- package/package.json +1 -1
- package/shipping-rules/api.d.ts +5 -0
- package/shipping-rules/types.d.ts +7 -7
- package/types.d.ts +1 -0
package/index.js
CHANGED
|
@@ -3644,6 +3644,12 @@ class ShippingRulesAPI {
|
|
|
3644
3644
|
this.list = () => {
|
|
3645
3645
|
return this.client.get(`/v1/shipping_rules`);
|
|
3646
3646
|
};
|
|
3647
|
+
/**
|
|
3648
|
+
* The `create` method creates a new shipping rule for a given user.
|
|
3649
|
+
*/
|
|
3650
|
+
this.create = (shippingRule) => {
|
|
3651
|
+
return this.client.post("/v1/shipping_rules", shippingRule);
|
|
3652
|
+
};
|
|
3647
3653
|
this.client = client;
|
|
3648
3654
|
}
|
|
3649
3655
|
}
|
package/index.mjs
CHANGED
|
@@ -3640,6 +3640,12 @@ class ShippingRulesAPI {
|
|
|
3640
3640
|
this.list = () => {
|
|
3641
3641
|
return this.client.get(`/v1/shipping_rules`);
|
|
3642
3642
|
};
|
|
3643
|
+
/**
|
|
3644
|
+
* The `create` method creates a new shipping rule for a given user.
|
|
3645
|
+
*/
|
|
3646
|
+
this.create = (shippingRule) => {
|
|
3647
|
+
return this.client.post("/v1/shipping_rules", shippingRule);
|
|
3648
|
+
};
|
|
3643
3649
|
this.client = client;
|
|
3644
3650
|
}
|
|
3645
3651
|
}
|
package/package.json
CHANGED
package/shipping-rules/api.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
|
+
import { RequiredFields } from "../types";
|
|
2
3
|
import { ShippingRule } from "./types";
|
|
3
4
|
/**
|
|
4
5
|
* # Shipping Rules API module - /v1/shipping_rules
|
|
@@ -12,4 +13,8 @@ export declare class ShippingRulesAPI {
|
|
|
12
13
|
list: () => Promise<import("axios").AxiosResponse<{
|
|
13
14
|
shippingRules: ShippingRule[];
|
|
14
15
|
}, any>>;
|
|
16
|
+
/**
|
|
17
|
+
* The `create` method creates a new shipping rule for a given user.
|
|
18
|
+
*/
|
|
19
|
+
create: (shippingRule: ShippingRule) => Promise<import("axios").AxiosResponse<RequiredFields<ShippingRule, "id">, any>>;
|
|
15
20
|
}
|
|
@@ -10,7 +10,7 @@ type RuleTypeCondition = "is" | "is_less" | "is_more" | "is_not";
|
|
|
10
10
|
/**
|
|
11
11
|
* @category Entities
|
|
12
12
|
*/
|
|
13
|
-
export interface
|
|
13
|
+
export interface ShippingRulesConditions {
|
|
14
14
|
identifier: RuleType;
|
|
15
15
|
operation: RuleTypeCondition;
|
|
16
16
|
value: string;
|
|
@@ -18,7 +18,7 @@ export interface Conditions {
|
|
|
18
18
|
/**
|
|
19
19
|
* @category Entities
|
|
20
20
|
*/
|
|
21
|
-
export interface
|
|
21
|
+
export interface ShippingRuleSelectedService {
|
|
22
22
|
carrierId: string;
|
|
23
23
|
carrierServiceCode: string;
|
|
24
24
|
}
|
|
@@ -30,8 +30,8 @@ export interface ShippingRule {
|
|
|
30
30
|
code?: string;
|
|
31
31
|
createdAt?: ISOString;
|
|
32
32
|
default: {
|
|
33
|
-
services:
|
|
34
|
-
sortBy
|
|
33
|
+
services: ShippingRuleSelectedService[];
|
|
34
|
+
sortBy?: string;
|
|
35
35
|
};
|
|
36
36
|
deleted?: boolean;
|
|
37
37
|
deletedAt?: ISOString;
|
|
@@ -39,10 +39,10 @@ export interface ShippingRule {
|
|
|
39
39
|
name: string;
|
|
40
40
|
rules?: [
|
|
41
41
|
{
|
|
42
|
-
conditions:
|
|
42
|
+
conditions: ShippingRulesConditions[];
|
|
43
43
|
priority: number;
|
|
44
|
-
services:
|
|
45
|
-
sortBy
|
|
44
|
+
services: ShippingRuleSelectedService[];
|
|
45
|
+
sortBy?: string;
|
|
46
46
|
}
|
|
47
47
|
];
|
|
48
48
|
updatedAt?: ISOString;
|
package/types.d.ts
CHANGED