@shopperlabs/shopper-types 2.4.3 → 2.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.
- package/dist/discount.d.ts +7 -2
- package/dist/discount.js +9 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/order.d.ts +71 -11
- package/dist/order.js +41 -12
- package/dist/payment_method.d.ts +5 -4
- package/dist/payment_transaction.d.ts +46 -0
- package/dist/payment_transaction.js +17 -0
- package/package.json +1 -1
package/dist/discount.d.ts
CHANGED
|
@@ -6,11 +6,16 @@ export declare enum DiscountType {
|
|
|
6
6
|
}
|
|
7
7
|
export declare enum DiscountApplyTo {
|
|
8
8
|
ORDER = "order",
|
|
9
|
-
|
|
9
|
+
PRODUCTS = "products"
|
|
10
10
|
}
|
|
11
11
|
export declare enum DiscountEligibility {
|
|
12
12
|
EVERYONE = "everyone",
|
|
13
|
-
CUSTOMERS = "
|
|
13
|
+
CUSTOMERS = "customers"
|
|
14
|
+
}
|
|
15
|
+
export declare enum DiscountRequirement {
|
|
16
|
+
NONE = "none",
|
|
17
|
+
PRICE = "price",
|
|
18
|
+
QUANTITY = "quantity"
|
|
14
19
|
}
|
|
15
20
|
export declare enum DiscountCondition {
|
|
16
21
|
APPLY_TO = "apply_to",
|
package/dist/discount.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DiscountCondition = exports.DiscountEligibility = exports.DiscountApplyTo = exports.DiscountType = void 0;
|
|
3
|
+
exports.DiscountCondition = exports.DiscountRequirement = exports.DiscountEligibility = exports.DiscountApplyTo = exports.DiscountType = void 0;
|
|
4
4
|
var DiscountType;
|
|
5
5
|
(function (DiscountType) {
|
|
6
6
|
DiscountType["PERCENTAGE"] = "percentage";
|
|
@@ -9,13 +9,19 @@ var DiscountType;
|
|
|
9
9
|
var DiscountApplyTo;
|
|
10
10
|
(function (DiscountApplyTo) {
|
|
11
11
|
DiscountApplyTo["ORDER"] = "order";
|
|
12
|
-
DiscountApplyTo["
|
|
12
|
+
DiscountApplyTo["PRODUCTS"] = "products";
|
|
13
13
|
})(DiscountApplyTo || (exports.DiscountApplyTo = DiscountApplyTo = {}));
|
|
14
14
|
var DiscountEligibility;
|
|
15
15
|
(function (DiscountEligibility) {
|
|
16
16
|
DiscountEligibility["EVERYONE"] = "everyone";
|
|
17
|
-
DiscountEligibility["CUSTOMERS"] = "
|
|
17
|
+
DiscountEligibility["CUSTOMERS"] = "customers";
|
|
18
18
|
})(DiscountEligibility || (exports.DiscountEligibility = DiscountEligibility = {}));
|
|
19
|
+
var DiscountRequirement;
|
|
20
|
+
(function (DiscountRequirement) {
|
|
21
|
+
DiscountRequirement["NONE"] = "none";
|
|
22
|
+
DiscountRequirement["PRICE"] = "price";
|
|
23
|
+
DiscountRequirement["QUANTITY"] = "quantity";
|
|
24
|
+
})(DiscountRequirement || (exports.DiscountRequirement = DiscountRequirement = {}));
|
|
19
25
|
var DiscountCondition;
|
|
20
26
|
(function (DiscountCondition) {
|
|
21
27
|
DiscountCondition["APPLY_TO"] = "apply_to";
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './inventory';
|
|
|
14
14
|
export * from './media';
|
|
15
15
|
export * from './order';
|
|
16
16
|
export * from './payment_method';
|
|
17
|
+
export * from './payment_transaction';
|
|
17
18
|
export * from './product_variant';
|
|
18
19
|
export * from './product_tag';
|
|
19
20
|
export * from './product';
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ __exportStar(require("./inventory"), exports);
|
|
|
30
30
|
__exportStar(require("./media"), exports);
|
|
31
31
|
__exportStar(require("./order"), exports);
|
|
32
32
|
__exportStar(require("./payment_method"), exports);
|
|
33
|
+
__exportStar(require("./payment_transaction"), exports);
|
|
33
34
|
__exportStar(require("./product_variant"), exports);
|
|
34
35
|
__exportStar(require("./product_tag"), exports);
|
|
35
36
|
__exportStar(require("./product"), exports);
|
package/dist/order.d.ts
CHANGED
|
@@ -5,29 +5,55 @@ import type { Customer } from './customer';
|
|
|
5
5
|
import type { PaymentMethod } from './payment_method';
|
|
6
6
|
import type { Zone } from './zone';
|
|
7
7
|
export declare enum OrderStatus {
|
|
8
|
-
ARCHIVED = "archived",
|
|
9
8
|
NEW = "new",
|
|
9
|
+
PROCESSING = "processing",
|
|
10
|
+
COMPLETED = "completed",
|
|
11
|
+
CANCELLED = "cancelled",
|
|
12
|
+
ARCHIVED = "archived"
|
|
13
|
+
}
|
|
14
|
+
export declare enum PaymentStatus {
|
|
15
|
+
PENDING = "pending",
|
|
16
|
+
AUTHORIZED = "authorized",
|
|
17
|
+
PAID = "paid",
|
|
18
|
+
PARTIALLY_REFUNDED = "partially_refunded",
|
|
19
|
+
REFUNDED = "refunded",
|
|
20
|
+
VOIDED = "voided"
|
|
21
|
+
}
|
|
22
|
+
export declare enum ShippingStatus {
|
|
23
|
+
UNFULFILLED = "unfulfilled",
|
|
24
|
+
PARTIALLY_SHIPPED = "partially_shipped",
|
|
10
25
|
SHIPPED = "shipped",
|
|
26
|
+
PARTIALLY_DELIVERED = "partially_delivered",
|
|
11
27
|
DELIVERED = "delivered",
|
|
28
|
+
PARTIALLY_RETURNED = "partially_returned",
|
|
29
|
+
RETURNED = "returned"
|
|
30
|
+
}
|
|
31
|
+
export declare enum ShipmentStatus {
|
|
12
32
|
PENDING = "pending",
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
33
|
+
PICKED_UP = "picked_up",
|
|
34
|
+
IN_TRANSIT = "in_transit",
|
|
35
|
+
AT_SORTING_CENTER = "at_sorting_center",
|
|
36
|
+
OUT_FOR_DELIVERY = "out_for_delivery",
|
|
37
|
+
DELIVERED = "delivered",
|
|
38
|
+
DELIVERY_FAILED = "delivery_failed",
|
|
39
|
+
RETURNED = "returned"
|
|
17
40
|
}
|
|
18
41
|
export declare enum FulfillmentStatus {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
42
|
+
PENDING = "pending",
|
|
43
|
+
FORWARDED_TO_SUPPLIER = "forwarded_to_supplier",
|
|
44
|
+
PROCESSING = "processing",
|
|
45
|
+
SHIPPED = "shipped",
|
|
46
|
+
DELIVERED = "delivered",
|
|
22
47
|
CANCELLED = "cancelled"
|
|
23
48
|
}
|
|
24
49
|
export declare enum OrderRefundStatus {
|
|
50
|
+
AWAITING = "awaiting",
|
|
25
51
|
PENDING = "pending",
|
|
26
52
|
TREATMENT = "treatment",
|
|
27
|
-
PARTIAL_REFUND = "
|
|
53
|
+
PARTIAL_REFUND = "partial_refund",
|
|
28
54
|
REFUNDED = "refunded",
|
|
29
|
-
|
|
30
|
-
|
|
55
|
+
REJECTED = "rejected",
|
|
56
|
+
CANCELLED = "cancelled"
|
|
31
57
|
}
|
|
32
58
|
/**
|
|
33
59
|
* Order model.
|
|
@@ -45,6 +71,10 @@ export interface Order extends Entity {
|
|
|
45
71
|
total_amount?: number;
|
|
46
72
|
/** The order status. */
|
|
47
73
|
status: OrderStatus;
|
|
74
|
+
/** The payment status. */
|
|
75
|
+
payment_status: PaymentStatus;
|
|
76
|
+
/** The shipping status. */
|
|
77
|
+
shipping_status: ShippingStatus;
|
|
48
78
|
/** The date the order was cancelled. */
|
|
49
79
|
cancelled_at: DateEntity | null;
|
|
50
80
|
/** The date the order was archived. */
|
|
@@ -156,6 +186,8 @@ export interface OrderAddress extends Entity {
|
|
|
156
186
|
* OrderShipping model.
|
|
157
187
|
*/
|
|
158
188
|
export interface OrderShipping extends Entity {
|
|
189
|
+
/** The shipment status. */
|
|
190
|
+
status: ShipmentStatus | null;
|
|
159
191
|
/** The date the order was shipped. */
|
|
160
192
|
shipped_at: DateEntity;
|
|
161
193
|
/** The date the order was received. */
|
|
@@ -178,6 +210,34 @@ export interface OrderShipping extends Entity {
|
|
|
178
210
|
carrier?: import('./carrier').Carrier;
|
|
179
211
|
/** The items in this shipment. */
|
|
180
212
|
items?: OrderItem[];
|
|
213
|
+
/** The shipment tracking events. */
|
|
214
|
+
events?: OrderShippingEvent[];
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* OrderShippingEvent model.
|
|
218
|
+
*/
|
|
219
|
+
export interface OrderShippingEvent {
|
|
220
|
+
id: number;
|
|
221
|
+
/** The event status. */
|
|
222
|
+
status: ShipmentStatus;
|
|
223
|
+
/** The description of the event. */
|
|
224
|
+
description: string | null;
|
|
225
|
+
/** The location of the event. */
|
|
226
|
+
location: string | null;
|
|
227
|
+
/** The latitude of the event. */
|
|
228
|
+
latitude: number | null;
|
|
229
|
+
/** The longitude of the event. */
|
|
230
|
+
longitude: number | null;
|
|
231
|
+
/** The metadata of the event. */
|
|
232
|
+
metadata: Metadata;
|
|
233
|
+
/** The date the event occurred. */
|
|
234
|
+
occurred_at: DateEntity;
|
|
235
|
+
/** The creation date. */
|
|
236
|
+
created_at?: DateEntity;
|
|
237
|
+
/** The order shipping ID. */
|
|
238
|
+
order_shipping_id: number;
|
|
239
|
+
/** The shipment this event belongs to. */
|
|
240
|
+
shipment?: OrderShipping;
|
|
181
241
|
}
|
|
182
242
|
/**
|
|
183
243
|
* OrderRefund model.
|
package/dist/order.js
CHANGED
|
@@ -1,31 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OrderRefundStatus = exports.FulfillmentStatus = exports.OrderStatus = void 0;
|
|
3
|
+
exports.OrderRefundStatus = exports.FulfillmentStatus = exports.ShipmentStatus = exports.ShippingStatus = exports.PaymentStatus = exports.OrderStatus = void 0;
|
|
4
4
|
var OrderStatus;
|
|
5
5
|
(function (OrderStatus) {
|
|
6
|
-
OrderStatus["ARCHIVED"] = "archived";
|
|
7
6
|
OrderStatus["NEW"] = "new";
|
|
8
|
-
OrderStatus["
|
|
9
|
-
OrderStatus["DELIVERED"] = "delivered";
|
|
10
|
-
OrderStatus["PENDING"] = "pending";
|
|
11
|
-
OrderStatus["PAID"] = "paid";
|
|
12
|
-
OrderStatus["REGISTER"] = "registered";
|
|
7
|
+
OrderStatus["PROCESSING"] = "processing";
|
|
13
8
|
OrderStatus["COMPLETED"] = "completed";
|
|
14
9
|
OrderStatus["CANCELLED"] = "cancelled";
|
|
10
|
+
OrderStatus["ARCHIVED"] = "archived";
|
|
15
11
|
})(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
|
|
12
|
+
var PaymentStatus;
|
|
13
|
+
(function (PaymentStatus) {
|
|
14
|
+
PaymentStatus["PENDING"] = "pending";
|
|
15
|
+
PaymentStatus["AUTHORIZED"] = "authorized";
|
|
16
|
+
PaymentStatus["PAID"] = "paid";
|
|
17
|
+
PaymentStatus["PARTIALLY_REFUNDED"] = "partially_refunded";
|
|
18
|
+
PaymentStatus["REFUNDED"] = "refunded";
|
|
19
|
+
PaymentStatus["VOIDED"] = "voided";
|
|
20
|
+
})(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
|
|
21
|
+
var ShippingStatus;
|
|
22
|
+
(function (ShippingStatus) {
|
|
23
|
+
ShippingStatus["UNFULFILLED"] = "unfulfilled";
|
|
24
|
+
ShippingStatus["PARTIALLY_SHIPPED"] = "partially_shipped";
|
|
25
|
+
ShippingStatus["SHIPPED"] = "shipped";
|
|
26
|
+
ShippingStatus["PARTIALLY_DELIVERED"] = "partially_delivered";
|
|
27
|
+
ShippingStatus["DELIVERED"] = "delivered";
|
|
28
|
+
ShippingStatus["PARTIALLY_RETURNED"] = "partially_returned";
|
|
29
|
+
ShippingStatus["RETURNED"] = "returned";
|
|
30
|
+
})(ShippingStatus || (exports.ShippingStatus = ShippingStatus = {}));
|
|
31
|
+
var ShipmentStatus;
|
|
32
|
+
(function (ShipmentStatus) {
|
|
33
|
+
ShipmentStatus["PENDING"] = "pending";
|
|
34
|
+
ShipmentStatus["PICKED_UP"] = "picked_up";
|
|
35
|
+
ShipmentStatus["IN_TRANSIT"] = "in_transit";
|
|
36
|
+
ShipmentStatus["AT_SORTING_CENTER"] = "at_sorting_center";
|
|
37
|
+
ShipmentStatus["OUT_FOR_DELIVERY"] = "out_for_delivery";
|
|
38
|
+
ShipmentStatus["DELIVERED"] = "delivered";
|
|
39
|
+
ShipmentStatus["DELIVERY_FAILED"] = "delivery_failed";
|
|
40
|
+
ShipmentStatus["RETURNED"] = "returned";
|
|
41
|
+
})(ShipmentStatus || (exports.ShipmentStatus = ShipmentStatus = {}));
|
|
16
42
|
var FulfillmentStatus;
|
|
17
43
|
(function (FulfillmentStatus) {
|
|
18
|
-
FulfillmentStatus["
|
|
19
|
-
FulfillmentStatus["
|
|
20
|
-
FulfillmentStatus["
|
|
44
|
+
FulfillmentStatus["PENDING"] = "pending";
|
|
45
|
+
FulfillmentStatus["FORWARDED_TO_SUPPLIER"] = "forwarded_to_supplier";
|
|
46
|
+
FulfillmentStatus["PROCESSING"] = "processing";
|
|
47
|
+
FulfillmentStatus["SHIPPED"] = "shipped";
|
|
48
|
+
FulfillmentStatus["DELIVERED"] = "delivered";
|
|
21
49
|
FulfillmentStatus["CANCELLED"] = "cancelled";
|
|
22
50
|
})(FulfillmentStatus || (exports.FulfillmentStatus = FulfillmentStatus = {}));
|
|
23
51
|
var OrderRefundStatus;
|
|
24
52
|
(function (OrderRefundStatus) {
|
|
53
|
+
OrderRefundStatus["AWAITING"] = "awaiting";
|
|
25
54
|
OrderRefundStatus["PENDING"] = "pending";
|
|
26
55
|
OrderRefundStatus["TREATMENT"] = "treatment";
|
|
27
|
-
OrderRefundStatus["PARTIAL_REFUND"] = "
|
|
56
|
+
OrderRefundStatus["PARTIAL_REFUND"] = "partial_refund";
|
|
28
57
|
OrderRefundStatus["REFUNDED"] = "refunded";
|
|
29
|
-
OrderRefundStatus["CANCELLED"] = "cancelled";
|
|
30
58
|
OrderRefundStatus["REJECTED"] = "rejected";
|
|
59
|
+
OrderRefundStatus["CANCELLED"] = "cancelled";
|
|
31
60
|
})(OrderRefundStatus || (exports.OrderRefundStatus = OrderRefundStatus = {}));
|
package/dist/payment_method.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Entity, Metadata } from './common';
|
|
2
|
+
import type { Media } from './media';
|
|
2
3
|
import type { Zone } from './zone';
|
|
3
4
|
/**
|
|
4
5
|
* PaymentMethod model.
|
|
@@ -8,10 +9,6 @@ export interface PaymentMethod extends Entity {
|
|
|
8
9
|
title: string;
|
|
9
10
|
/** The slug of the payment method. */
|
|
10
11
|
slug: string;
|
|
11
|
-
/** The logo path of the payment method. */
|
|
12
|
-
logo: string | null;
|
|
13
|
-
/** The computed logo URL. */
|
|
14
|
-
logo_url: string | null;
|
|
15
12
|
/** The link URL of the payment method. */
|
|
16
13
|
link_url: string | null;
|
|
17
14
|
/** The description of the payment method. */
|
|
@@ -20,8 +17,12 @@ export interface PaymentMethod extends Entity {
|
|
|
20
17
|
instructions: string | null;
|
|
21
18
|
/** Whether the payment method is enabled. */
|
|
22
19
|
is_enabled: boolean;
|
|
20
|
+
/** The payment driver identifier. */
|
|
21
|
+
driver: string | null;
|
|
23
22
|
/** The metadata of the payment method. */
|
|
24
23
|
metadata: Metadata;
|
|
24
|
+
/** The logo of the payment method. */
|
|
25
|
+
logo?: Media | null;
|
|
25
26
|
/** The zones this payment method belongs to. */
|
|
26
27
|
zones?: Zone[];
|
|
27
28
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Entity, Metadata } from './common';
|
|
2
|
+
import type { Order } from './order';
|
|
3
|
+
import type { PaymentMethod } from './payment_method';
|
|
4
|
+
export declare enum TransactionStatus {
|
|
5
|
+
PENDING = "pending",
|
|
6
|
+
SUCCESS = "success",
|
|
7
|
+
FAILED = "failed"
|
|
8
|
+
}
|
|
9
|
+
export declare enum TransactionType {
|
|
10
|
+
INITIATE = "initiate",
|
|
11
|
+
AUTHORIZE = "authorize",
|
|
12
|
+
CAPTURE = "capture",
|
|
13
|
+
REFUND = "refund",
|
|
14
|
+
CANCEL = "cancel"
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* PaymentTransaction model.
|
|
18
|
+
*/
|
|
19
|
+
export interface PaymentTransaction extends Entity {
|
|
20
|
+
/** The payment driver used. */
|
|
21
|
+
driver: string;
|
|
22
|
+
/** The transaction type. */
|
|
23
|
+
type: TransactionType;
|
|
24
|
+
/** The transaction status. */
|
|
25
|
+
status: TransactionStatus;
|
|
26
|
+
/** The transaction amount (in cents). */
|
|
27
|
+
amount: number;
|
|
28
|
+
/** The currency code. */
|
|
29
|
+
currency_code: string;
|
|
30
|
+
/** The external reference ID. */
|
|
31
|
+
reference: string | null;
|
|
32
|
+
/** The transaction data from the provider. */
|
|
33
|
+
data: Record<string, unknown> | null;
|
|
34
|
+
/** Additional notes. */
|
|
35
|
+
notes: string | null;
|
|
36
|
+
/** The metadata of the transaction. */
|
|
37
|
+
metadata: Metadata;
|
|
38
|
+
/** The order ID. */
|
|
39
|
+
order_id: number | null;
|
|
40
|
+
/** The payment method ID. */
|
|
41
|
+
payment_method_id: number | null;
|
|
42
|
+
/** The order. */
|
|
43
|
+
order?: Order;
|
|
44
|
+
/** The payment method. */
|
|
45
|
+
paymentMethod?: PaymentMethod;
|
|
46
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionType = exports.TransactionStatus = void 0;
|
|
4
|
+
var TransactionStatus;
|
|
5
|
+
(function (TransactionStatus) {
|
|
6
|
+
TransactionStatus["PENDING"] = "pending";
|
|
7
|
+
TransactionStatus["SUCCESS"] = "success";
|
|
8
|
+
TransactionStatus["FAILED"] = "failed";
|
|
9
|
+
})(TransactionStatus || (exports.TransactionStatus = TransactionStatus = {}));
|
|
10
|
+
var TransactionType;
|
|
11
|
+
(function (TransactionType) {
|
|
12
|
+
TransactionType["INITIATE"] = "initiate";
|
|
13
|
+
TransactionType["AUTHORIZE"] = "authorize";
|
|
14
|
+
TransactionType["CAPTURE"] = "capture";
|
|
15
|
+
TransactionType["REFUND"] = "refund";
|
|
16
|
+
TransactionType["CANCEL"] = "cancel";
|
|
17
|
+
})(TransactionType || (exports.TransactionType = TransactionType = {}));
|
package/package.json
CHANGED