swell-js 3.22.0 → 3.22.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swell-js",
3
- "version": "3.22.0",
3
+ "version": "3.22.2",
4
4
  "description": "Swell JS library for client-side stores",
5
5
  "engines": {
6
6
  "node": ">=14.19.1",
@@ -31,8 +31,7 @@ interface CartGiftCardItemSnake {
31
31
  code?: string;
32
32
  code_formatted?: string;
33
33
  giftcard?: string;
34
- last4?;
35
- string;
34
+ last4?: string;
36
35
  }
37
36
 
38
37
  interface CartItemSnake extends BaseModel {
@@ -117,6 +116,7 @@ interface CartSnake extends BaseModel {
117
116
  giftcard_delivery?: boolean;
118
117
  giftcard_total?: number;
119
118
  giftcards?: CartGiftCardItem[];
119
+ capture_total?: number;
120
120
  grand_total?: number;
121
121
  guest?: boolean;
122
122
  item_discount?: number;
package/types/index.d.ts CHANGED
@@ -121,14 +121,14 @@ export namespace account {
121
121
  function createCard(input: Card): Promise<Card>;
122
122
  function deleteAddress(id: string): Promise<Address>;
123
123
  function deleteCard(id: string): Promise<Card>;
124
- function get(): Promise<Account>;
124
+ function get(): Promise<Account | null>;
125
125
  function getAddresses(input: object): Promise<Address>;
126
126
  function getCards(input: object): Promise<Card[]>;
127
127
  function getOrder(id: string): Promise<Order>;
128
128
  function getOrders(): ResultsResponse<Promise<Order>>;
129
- function listAddresses(): Promise<Address[]>;
129
+ function listAddresses(): Promise<ResultsResponse<Address>>;
130
130
  function listCards(): Promise<Card[]>;
131
- function listOrders(input?: object): ResultsResponse<Promise<Order>>;
131
+ function listOrders(input?: object): Promise<ResultsResponse<Order>>;
132
132
  function login(
133
133
  user: string,
134
134
  password: string | PasswordTokenInput,
@@ -154,11 +154,13 @@ export namespace card {
154
154
  export namespace cart {
155
155
  function addItem(input: CartItem): Promise<Cart>;
156
156
  function applyCoupon(input: string): Promise<Cart>;
157
+ function applyGiftcard(input: string): Promise<Cart>;
157
158
  function get(input?: string): Promise<Cart | null>;
158
159
  function getSettings(): Promise<Settings>;
159
- function getShippingRates(): Promise<ShipmentRating[]>;
160
+ function getShippingRates(): Promise<ShipmentRating>;
160
161
  function recover(input: string): Promise<Cart>;
161
162
  function removeCoupon(input: string): Promise<Cart>;
163
+ function removeGiftcard(input: string): Promise<Cart>;
162
164
  function removeItem(input: string): Promise<Cart>;
163
165
  function setItems(input: CartItem[]): Promise<Cart>;
164
166
  function submitOrder(): Promise<Order>;