@open-tender/types 0.2.20 → 0.2.22

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.
@@ -1,6 +1,6 @@
1
1
  import { RequestedAt } from '../datetimes';
2
2
  import { CardType, CardTypeName, DeviceType, DiscountType, Money, OrderType, PrepType, ServiceType, TenderType } from '../global';
3
- import { RequestErrorParams } from '../request';
3
+ import { CheckoutErrorParams } from '../request';
4
4
  import { Cart } from './cart';
5
5
  import { Address, Customer } from './customer';
6
6
  import { Order, OrderCustomer, OrderDiscounts, OrderFulfillment, OrderSurcharge } from './order';
@@ -85,7 +85,7 @@ export interface CheckoutConfig {
85
85
  export interface CheckoutCheck extends Omit<Order, 'customer'> {
86
86
  config: CheckoutConfig;
87
87
  customer: OrderCustomer | null;
88
- errors: RequestErrorParams;
88
+ errors: CheckoutErrorParams;
89
89
  }
90
90
  export interface OrderCreateDetails {
91
91
  cart_id?: number | null;
@@ -144,7 +144,7 @@ export interface CheckoutTenderCreditGuest {
144
144
  amount: Money;
145
145
  card_type_name: CardTypeName;
146
146
  exp: string;
147
- is_default: false;
147
+ is_default: boolean;
148
148
  last4: string;
149
149
  masked: string;
150
150
  tender_type: TenderType;
@@ -158,7 +158,7 @@ export interface CheckoutTenderCreditCustomer {
158
158
  customer_card_id: number;
159
159
  last4: string;
160
160
  masked: string;
161
- is_default: false;
161
+ is_default: boolean;
162
162
  }
163
163
  export interface CheckoutTenderGiftCard {
164
164
  amount: Money;
@@ -4,7 +4,7 @@ export interface CreditCard {
4
4
  card_type_name: CardTypeName;
5
5
  customer_card_id: number;
6
6
  has_profile?: boolean;
7
- is_default?: boolean;
7
+ is_default: boolean;
8
8
  last4: string;
9
9
  masked: string;
10
10
  }
@@ -21,6 +21,9 @@ export interface CreditCardData {
21
21
  is_default?: boolean;
22
22
  token?: string;
23
23
  }
24
+ export interface CreditCardUpdate {
25
+ is_default: boolean;
26
+ }
24
27
  export interface CreditCardErrors extends Record<string, string | undefined> {
25
28
  acct?: string;
26
29
  exp?: string;
@@ -1,3 +1,5 @@
1
+ export declare type Version = number | null;
2
+ export declare type RequestStatus = 'idle' | 'pending';
1
3
  export interface IndexedError {
2
4
  index: any;
3
5
  [x: string]: string;
@@ -14,5 +16,9 @@ export interface RequestErrorAPI extends RequestErrorMessage {
14
16
  params?: RequestErrorParams;
15
17
  }
16
18
  export declare type RequestError = RequestErrorAPI | null | undefined;
17
- export declare type RequestStatus = 'idle' | 'pending';
18
- export declare type Version = number | null;
19
+ export declare type CheckoutErrorParams = Record<string, RequestErrorMessage>;
20
+ export interface CheckoutErrorAPI extends RequestErrorMessage {
21
+ status: number;
22
+ params?: CheckoutErrorParams;
23
+ }
24
+ export declare type CheckoutError = CheckoutErrorAPI | null | undefined;
@@ -1,6 +1,6 @@
1
1
  import { RequestedAt } from '../datetimes';
2
2
  import { CardType, CardTypeName, DeviceType, DiscountType, Money, OrderType, PrepType, ServiceType, TenderType } from '../global';
3
- import { RequestErrorParams } from '../request';
3
+ import { CheckoutErrorParams } from '../request';
4
4
  import { Cart } from './cart';
5
5
  import { Address, Customer } from './customer';
6
6
  import { Order, OrderCustomer, OrderDiscounts, OrderFulfillment, OrderSurcharge } from './order';
@@ -85,7 +85,7 @@ export interface CheckoutConfig {
85
85
  export interface CheckoutCheck extends Omit<Order, 'customer'> {
86
86
  config: CheckoutConfig;
87
87
  customer: OrderCustomer | null;
88
- errors: RequestErrorParams;
88
+ errors: CheckoutErrorParams;
89
89
  }
90
90
  export interface OrderCreateDetails {
91
91
  cart_id?: number | null;
@@ -144,7 +144,7 @@ export interface CheckoutTenderCreditGuest {
144
144
  amount: Money;
145
145
  card_type_name: CardTypeName;
146
146
  exp: string;
147
- is_default: false;
147
+ is_default: boolean;
148
148
  last4: string;
149
149
  masked: string;
150
150
  tender_type: TenderType;
@@ -158,7 +158,7 @@ export interface CheckoutTenderCreditCustomer {
158
158
  customer_card_id: number;
159
159
  last4: string;
160
160
  masked: string;
161
- is_default: false;
161
+ is_default: boolean;
162
162
  }
163
163
  export interface CheckoutTenderGiftCard {
164
164
  amount: Money;
@@ -4,7 +4,7 @@ export interface CreditCard {
4
4
  card_type_name: CardTypeName;
5
5
  customer_card_id: number;
6
6
  has_profile?: boolean;
7
- is_default?: boolean;
7
+ is_default: boolean;
8
8
  last4: string;
9
9
  masked: string;
10
10
  }
@@ -21,6 +21,9 @@ export interface CreditCardData {
21
21
  is_default?: boolean;
22
22
  token?: string;
23
23
  }
24
+ export interface CreditCardUpdate {
25
+ is_default: boolean;
26
+ }
24
27
  export interface CreditCardErrors extends Record<string, string | undefined> {
25
28
  acct?: string;
26
29
  exp?: string;
@@ -1,3 +1,5 @@
1
+ export declare type Version = number | null;
2
+ export declare type RequestStatus = 'idle' | 'pending';
1
3
  export interface IndexedError {
2
4
  index: any;
3
5
  [x: string]: string;
@@ -14,5 +16,9 @@ export interface RequestErrorAPI extends RequestErrorMessage {
14
16
  params?: RequestErrorParams;
15
17
  }
16
18
  export declare type RequestError = RequestErrorAPI | null | undefined;
17
- export declare type RequestStatus = 'idle' | 'pending';
18
- export declare type Version = number | null;
19
+ export declare type CheckoutErrorParams = Record<string, RequestErrorMessage>;
20
+ export interface CheckoutErrorAPI extends RequestErrorMessage {
21
+ status: number;
22
+ params?: CheckoutErrorParams;
23
+ }
24
+ export declare type CheckoutError = CheckoutErrorAPI | null | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/types",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "description": "A library of types for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",