@shipengine/react-api 3.4.0 → 3.5.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.
@@ -3,4 +3,4 @@
3
3
  *
4
4
  * @see [https://github.com/ShipEngine/shipengine-api-definition/pull/58/files#diff-775a1c7e38ec7549a98ad8c00e18cb9fc5b4c87ddeb1d496ca3525f48c7381e0
5
5
  */
6
- export declare const useGetAccountSettings: () => import("@tanstack/react-query").UseQueryResult<import("@shipengine/js-api").AccountSettings, import("@shipengine/js-api").CodedError[]>;
6
+ export declare const useGetAccountSettings: () => import("@tanstack/react-query").UseQueryResult<import("@shipengine/js-api").ShipEngineAccountSettings, import("@shipengine/js-api").CodedError[]>;
@@ -2,4 +2,4 @@ import { SE } from "@shipengine/js-api";
2
2
  /**
3
3
  * @category ShipEngine API Hooks
4
4
  * */
5
- export declare const useUpdateAccountSettings: () => import("@tanstack/react-query").UseMutationResult<SE.AccountSettings, SE.CodedError[], Partial<SE.AccountSettings>, unknown>;
5
+ export declare const useUpdateAccountSettings: () => import("@tanstack/react-query").UseMutationResult<SE.ShipEngineAccountSettings, SE.CodedError[], SE.AccountSettings, unknown>;
@@ -1,10 +1,16 @@
1
1
  import { SE } from "@shipengine/js-api";
2
- export type CreateShipmentData = {
2
+ export type CreateShipmentData = ({
3
3
  warehouseId: string;
4
- } & Partial<Omit<SE.Shipment, "items">>;
4
+ } | {
5
+ shipFrom: SE.Address;
6
+ }) & Partial<Omit<SE.Shipment, "items">>;
5
7
  /**
6
8
  * @category ShipEngine API Hooks
7
9
  *
8
10
  * @see [ShipEngine Developer Docs](https://shipengine.github.io/shipengine-openapi/#operation/create_shipments)
9
11
  */
10
- export declare const useCreateShipment: () => import("@tanstack/react-query").UseMutationResult<import("@shipengine/js-api").CreateShipmentResult, SE.CodedError[], CreateShipmentData, unknown>;
12
+ export declare const useCreateShipment: () => import("@tanstack/react-query").UseMutationResult<import("@shipengine/js-api").CreateShipmentResult, SE.CodedError[], ({
13
+ warehouseId: string;
14
+ } | {
15
+ shipFrom: SE.Address;
16
+ }) & Partial<Omit<SE.Shipment, "items">>, unknown>;
package/index.js CHANGED
@@ -1854,7 +1854,7 @@ const useCreateShipment = () => {
1854
1854
  return reactQuery.useMutation({
1855
1855
  mutationFn: (shipment) => __async$f(void 0, null, function* () {
1856
1856
  var _a;
1857
- if (shipment.warehouseId === void 0) {
1857
+ if (shipment.warehouseId === void 0 && shipment.shipFrom === void 0) {
1858
1858
  throw new jsApi.SE.CodedError("errorMessages.noWarehouses", {
1859
1859
  errorCode: "unknown",
1860
1860
  errorSource: "client",
package/index.mjs CHANGED
@@ -1851,7 +1851,7 @@ const useCreateShipment = () => {
1851
1851
  return useMutation({
1852
1852
  mutationFn: (shipment) => __async$f(void 0, null, function* () {
1853
1853
  var _a;
1854
- if (shipment.warehouseId === void 0) {
1854
+ if (shipment.warehouseId === void 0 && shipment.shipFrom === void 0) {
1855
1855
  throw new SE.CodedError("errorMessages.noWarehouses", {
1856
1856
  errorCode: "unknown",
1857
1857
  errorSource: "client",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/react-api",
3
- "version": "3.4.0",
3
+ "version": "3.5.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {