@shipengine/js-api 0.45.1 → 0.46.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 CHANGED
@@ -3769,6 +3769,13 @@ class ShippingRulesAPI {
3769
3769
  this.delete = (shippingRuleId) => {
3770
3770
  return this.client.delete(`/v1/shipping_rules/${shippingRuleId}`);
3771
3771
  };
3772
+ /**
3773
+ * The `edit` method edits a specific shipping rule by `shippingRuleId` with a new
3774
+ * `ShippingRule`.
3775
+ */
3776
+ this.edit = (shippingRule) => {
3777
+ return this.client.put(`/v1/shipping_rules/${shippingRule.id}`, shippingRule);
3778
+ };
3772
3779
  this.client = client;
3773
3780
  }
3774
3781
  }
package/index.mjs CHANGED
@@ -3765,6 +3765,13 @@ class ShippingRulesAPI {
3765
3765
  this.delete = (shippingRuleId) => {
3766
3766
  return this.client.delete(`/v1/shipping_rules/${shippingRuleId}`);
3767
3767
  };
3768
+ /**
3769
+ * The `edit` method edits a specific shipping rule by `shippingRuleId` with a new
3770
+ * `ShippingRule`.
3771
+ */
3772
+ this.edit = (shippingRule) => {
3773
+ return this.client.put(`/v1/shipping_rules/${shippingRule.id}`, shippingRule);
3774
+ };
3768
3775
  this.client = client;
3769
3776
  }
3770
3777
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/js-api",
3
- "version": "0.45.1",
3
+ "version": "0.46.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -24,4 +24,9 @@ export declare class ShippingRulesAPI {
24
24
  * The `delete` method deletes a shipping rule by `shippingRuleId`.
25
25
  */
26
26
  delete: (shippingRuleId: string) => Promise<import("axios").AxiosResponse<any, any>>;
27
+ /**
28
+ * The `edit` method edits a specific shipping rule by `shippingRuleId` with a new
29
+ * `ShippingRule`.
30
+ */
31
+ edit: (shippingRule: ShippingRule) => Promise<import("axios").AxiosResponse<ShippingRule, any>>;
27
32
  }
@@ -15,6 +15,14 @@ export interface ShippingRulesConditions {
15
15
  operation: RuleTypeCondition;
16
16
  value: string;
17
17
  }
18
+ /**
19
+ * @category Entities
20
+ */
21
+ export interface Rule {
22
+ conditions: ShippingRulesConditions[];
23
+ priority: number;
24
+ service: ShippingRuleSelectedService;
25
+ }
18
26
  /**
19
27
  * @category Entities
20
28
  */
@@ -34,13 +42,7 @@ export interface ShippingRule {
34
42
  deletedAt?: ISOString;
35
43
  id: string;
36
44
  name: string;
37
- rules?: [
38
- {
39
- conditions: ShippingRulesConditions[];
40
- priority: number;
41
- service: ShippingRuleSelectedService;
42
- }
43
- ];
45
+ rules?: Rule[];
44
46
  updatedAt?: ISOString;
45
47
  }
46
48
  /**