@shipengine/js-api 0.16.2 → 0.17.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
@@ -3280,6 +3280,9 @@ class RateCardsAPI {
3280
3280
  `/v1/rate_cards?carrier_ids=${carrierIds.toString()}`
3281
3281
  );
3282
3282
  };
3283
+ this.create = (rateCardInput) => {
3284
+ return this.client.post("/v1/rate_cards", rateCardInput);
3285
+ };
3283
3286
  this.client = client;
3284
3287
  }
3285
3288
  }
package/index.mjs CHANGED
@@ -3276,6 +3276,9 @@ class RateCardsAPI {
3276
3276
  `/v1/rate_cards?carrier_ids=${carrierIds.toString()}`
3277
3277
  );
3278
3278
  };
3279
+ this.create = (rateCardInput) => {
3280
+ return this.client.post("/v1/rate_cards", rateCardInput);
3281
+ };
3279
3282
  this.client = client;
3280
3283
  }
3281
3284
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/js-api",
3
- "version": "0.16.2",
3
+ "version": "0.17.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -1,9 +1,10 @@
1
1
  import { AxiosInstance } from "axios";
2
- import { RateCard } from "./types";
2
+ import { RateCard, RateCardInput } from "./types";
3
3
  export declare class RateCardsAPI {
4
4
  private client;
5
5
  constructor(client: AxiosInstance);
6
6
  list: (carrierIds: string[]) => Promise<import("axios").AxiosResponse<{
7
7
  rateCards: RateCard[];
8
8
  }, any>>;
9
+ create: (rateCardInput: RateCardInput) => Promise<import("axios").AxiosResponse<RateCard, any>>;
9
10
  }
@@ -11,11 +11,12 @@ export interface ShipFromLocation {
11
11
  */
12
12
  export interface RateCard {
13
13
  carrierId: string;
14
- currency: Currency;
14
+ currency?: Currency;
15
15
  endDate?: string;
16
16
  id: string;
17
17
  name: string;
18
- shipFrom: ShipFromLocation;
19
- startDate: string;
20
- status: string;
18
+ shipFrom?: ShipFromLocation;
19
+ startDate?: string;
20
+ status?: string;
21
21
  }
22
+ export type RateCardInput = Partial<RateCard> & Pick<RateCard, "carrierId" | "name">;
@@ -1 +1,2 @@
1
1
  export * from "./ip-address";
2
+ export * from "./types";
@@ -0,0 +1 @@
1
+ export type RequireField<T, K extends keyof T> = T & Required<Pick<T, K>>;