@shopperlabs/shopper-types 1.0.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.
Files changed (46) hide show
  1. package/README.md +67 -0
  2. package/dist/address.d.ts +43 -0
  3. package/dist/address.js +8 -0
  4. package/dist/attribute.d.ts +51 -0
  5. package/dist/attribute.js +13 -0
  6. package/dist/brand.d.ts +23 -0
  7. package/dist/brand.js +2 -0
  8. package/dist/carrier.d.ts +51 -0
  9. package/dist/carrier.js +2 -0
  10. package/dist/category.d.ts +27 -0
  11. package/dist/category.js +2 -0
  12. package/dist/channel.d.ts +22 -0
  13. package/dist/channel.js +2 -0
  14. package/dist/collection.d.ts +71 -0
  15. package/dist/collection.js +33 -0
  16. package/dist/common.d.ts +94 -0
  17. package/dist/common.js +24 -0
  18. package/dist/country.d.ts +33 -0
  19. package/dist/country.js +2 -0
  20. package/dist/currency.d.ts +18 -0
  21. package/dist/currency.js +2 -0
  22. package/dist/customer.d.ts +48 -0
  23. package/dist/customer.js +11 -0
  24. package/dist/discount.d.ts +70 -0
  25. package/dist/discount.js +23 -0
  26. package/dist/index.d.ts +21 -0
  27. package/dist/index.js +37 -0
  28. package/dist/inventory.d.ts +64 -0
  29. package/dist/inventory.js +2 -0
  30. package/dist/media.d.ts +6 -0
  31. package/dist/media.js +2 -0
  32. package/dist/order.d.ts +198 -0
  33. package/dist/order.js +29 -0
  34. package/dist/payment_method.d.ts +25 -0
  35. package/dist/payment_method.js +2 -0
  36. package/dist/product.d.ts +75 -0
  37. package/dist/product.js +10 -0
  38. package/dist/product_variant.d.ts +37 -0
  39. package/dist/product_variant.js +2 -0
  40. package/dist/review.d.ts +35 -0
  41. package/dist/review.js +2 -0
  42. package/dist/supplier.d.ts +26 -0
  43. package/dist/supplier.js +2 -0
  44. package/dist/zone.d.ts +43 -0
  45. package/dist/zone.js +2 -0
  46. package/package.json +31 -0
@@ -0,0 +1,70 @@
1
+ import type { DateEntity, Entity, Metadata } from './common';
2
+ import type { Zone } from './zone';
3
+ export declare enum DiscountType {
4
+ PERCENTAGE = "percentage",
5
+ FIXED_AMOUNT = "fixed_amount"
6
+ }
7
+ export declare enum DiscountApplyTo {
8
+ ORDER = "order",
9
+ SPECIFIC = "specific"
10
+ }
11
+ export declare enum DiscountEligibility {
12
+ EVERYONE = "everyone",
13
+ CUSTOMERS = "specific_customers"
14
+ }
15
+ export declare enum DiscountCondition {
16
+ APPLY_TO = "apply_to",
17
+ ELIGIBILITY = "eligibility"
18
+ }
19
+ /**
20
+ * Discount model.
21
+ */
22
+ export interface Discount extends Entity {
23
+ /** The discount code. */
24
+ code: string;
25
+ /** The type of discount. */
26
+ type: DiscountType;
27
+ /** The value of the discount. */
28
+ value: number;
29
+ /** What the discount applies to. */
30
+ apply_to: DiscountApplyTo;
31
+ /** Who is eligible for this discount. */
32
+ eligibility: DiscountEligibility;
33
+ /** The usage limit for the discount. */
34
+ usage_limit: number | null;
35
+ /** The total number of times the discount has been used. */
36
+ total_use: number;
37
+ /** Whether the discount has a per-user usage limit. */
38
+ usage_limit_per_user: boolean;
39
+ /** Whether the discount is active. */
40
+ is_active: boolean;
41
+ /** The zone ID this discount belongs to. */
42
+ zone_id: number | null;
43
+ /** The metadata of the discount. */
44
+ metadata: Metadata;
45
+ /** The start date of the discount. */
46
+ start_at: DateEntity;
47
+ /** The end date of the discount. */
48
+ end_at: DateEntity | null;
49
+ /** The zone of the discount. */
50
+ zone?: Zone;
51
+ /** The discount items/details. */
52
+ items?: DiscountDetail[];
53
+ }
54
+ /**
55
+ * DiscountDetail model (discountables).
56
+ */
57
+ export interface DiscountDetail extends Entity {
58
+ /** The condition type for this detail. */
59
+ condition: DiscountCondition;
60
+ /** The type of the discountable entity. */
61
+ discountable_type: string;
62
+ /** The ID of the discountable entity. */
63
+ discountable_id: number;
64
+ /** The discount ID this detail belongs to. */
65
+ discount_id: number;
66
+ /** The total usage of this detail. */
67
+ total_use: number;
68
+ /** The discount this detail belongs to. */
69
+ discount?: Discount;
70
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiscountCondition = exports.DiscountEligibility = exports.DiscountApplyTo = exports.DiscountType = void 0;
4
+ var DiscountType;
5
+ (function (DiscountType) {
6
+ DiscountType["PERCENTAGE"] = "percentage";
7
+ DiscountType["FIXED_AMOUNT"] = "fixed_amount";
8
+ })(DiscountType || (exports.DiscountType = DiscountType = {}));
9
+ var DiscountApplyTo;
10
+ (function (DiscountApplyTo) {
11
+ DiscountApplyTo["ORDER"] = "order";
12
+ DiscountApplyTo["SPECIFIC"] = "specific";
13
+ })(DiscountApplyTo || (exports.DiscountApplyTo = DiscountApplyTo = {}));
14
+ var DiscountEligibility;
15
+ (function (DiscountEligibility) {
16
+ DiscountEligibility["EVERYONE"] = "everyone";
17
+ DiscountEligibility["CUSTOMERS"] = "specific_customers";
18
+ })(DiscountEligibility || (exports.DiscountEligibility = DiscountEligibility = {}));
19
+ var DiscountCondition;
20
+ (function (DiscountCondition) {
21
+ DiscountCondition["APPLY_TO"] = "apply_to";
22
+ DiscountCondition["ELIGIBILITY"] = "eligibility";
23
+ })(DiscountCondition || (exports.DiscountCondition = DiscountCondition = {}));
@@ -0,0 +1,21 @@
1
+ export * from './address';
2
+ export * from './attribute';
3
+ export * from './brand';
4
+ export * from './carrier';
5
+ export * from './category';
6
+ export * from './channel';
7
+ export * from './collection';
8
+ export * from './common';
9
+ export * from './country';
10
+ export * from './currency';
11
+ export * from './customer';
12
+ export * from './discount';
13
+ export * from './inventory';
14
+ export * from './media';
15
+ export * from './order';
16
+ export * from './payment_method';
17
+ export * from './product_variant';
18
+ export * from './product';
19
+ export * from './review';
20
+ export * from './supplier';
21
+ export * from './zone';
package/dist/index.js ADDED
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./address"), exports);
18
+ __exportStar(require("./attribute"), exports);
19
+ __exportStar(require("./brand"), exports);
20
+ __exportStar(require("./carrier"), exports);
21
+ __exportStar(require("./category"), exports);
22
+ __exportStar(require("./channel"), exports);
23
+ __exportStar(require("./collection"), exports);
24
+ __exportStar(require("./common"), exports);
25
+ __exportStar(require("./country"), exports);
26
+ __exportStar(require("./currency"), exports);
27
+ __exportStar(require("./customer"), exports);
28
+ __exportStar(require("./discount"), exports);
29
+ __exportStar(require("./inventory"), exports);
30
+ __exportStar(require("./media"), exports);
31
+ __exportStar(require("./order"), exports);
32
+ __exportStar(require("./payment_method"), exports);
33
+ __exportStar(require("./product_variant"), exports);
34
+ __exportStar(require("./product"), exports);
35
+ __exportStar(require("./review"), exports);
36
+ __exportStar(require("./supplier"), exports);
37
+ __exportStar(require("./zone"), exports);
@@ -0,0 +1,64 @@
1
+ import type { Entity } from './common';
2
+ import type { Country } from './country';
3
+ /**
4
+ * Inventory (warehouse/location) model.
5
+ */
6
+ export interface Inventory extends Entity {
7
+ /** The name of the inventory location. */
8
+ name: string;
9
+ /** The code of the inventory location. */
10
+ code: string;
11
+ /** The email of the inventory location. */
12
+ email: string;
13
+ /** The city of the inventory location. */
14
+ city: string;
15
+ /** The state/province of the inventory location. */
16
+ state: string | null;
17
+ /** The description of the inventory location. */
18
+ description: string | null;
19
+ /** The street address of the inventory location. */
20
+ street_address: string | null;
21
+ /** The additional street address. */
22
+ street_address_plus: string | null;
23
+ /** The postal code of the inventory location. */
24
+ postal_code: string;
25
+ /** The phone number of the inventory location. */
26
+ phone_number: string | null;
27
+ /** Whether this is the default inventory location. */
28
+ is_default: boolean;
29
+ /** The country ID of the inventory location. */
30
+ country_id: number;
31
+ /** The country of the inventory location. */
32
+ country?: Country;
33
+ /** The inventory histories. */
34
+ histories?: InventoryHistory[];
35
+ }
36
+ /**
37
+ * InventoryHistory model.
38
+ */
39
+ export interface InventoryHistory extends Entity {
40
+ /** The new quantity after the adjustment. */
41
+ quantity: number;
42
+ /** The old quantity before the adjustment. */
43
+ old_quantity: number | null;
44
+ /** The event that triggered this history entry. */
45
+ event: string | null;
46
+ /** The description of the history entry. */
47
+ description: string | null;
48
+ /** The user ID who made the adjustment. */
49
+ user_id: number;
50
+ /** The inventory ID. */
51
+ inventory_id: number;
52
+ /** The ID of the stockable entity. */
53
+ stockable_id: number;
54
+ /** The type of the stockable entity. */
55
+ stockable_type: string;
56
+ /** The ID of the reference entity. */
57
+ reference_id?: number | null;
58
+ /** The type of the reference entity. */
59
+ reference_type?: string | null;
60
+ /** The computed adjustment display. */
61
+ adjustment?: string | number;
62
+ /** The inventory location. */
63
+ inventory?: Inventory;
64
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export interface Media {
2
+ id: string | number;
3
+ url: string;
4
+ created_at: string;
5
+ updated_at: string;
6
+ }
package/dist/media.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,198 @@
1
+ import type { CarrierOption } from './carrier';
2
+ import type { Channel } from './channel';
3
+ import type { DateEntity, Entity } from './common';
4
+ import type { Customer } from './customer';
5
+ import type { PaymentMethod } from './payment_method';
6
+ import type { Zone } from './zone';
7
+ export declare enum OrderStatus {
8
+ PENDING = "pending",
9
+ NEW = "new",
10
+ REGISTER = "register",
11
+ PAID = "paid",
12
+ COMPLETED = "completed",
13
+ SHIPPED = "shipped",
14
+ CANCELLED = "cancelled"
15
+ }
16
+ export declare enum FulfillmentStatus {
17
+ UNFULFILLED = "unfulfilled",
18
+ PARTIALLY_FULFILLED = "partially_fulfilled",
19
+ FULFILLED = "fulfilled",
20
+ CANCELLED = "cancelled"
21
+ }
22
+ export declare enum OrderRefundStatus {
23
+ PENDING = "pending",
24
+ TREATMENT = "treatment",
25
+ PARTIAL_REFUND = "partial-refund",
26
+ REFUNDED = "refunded",
27
+ CANCELLED = "cancelled",
28
+ REJECTED = "rejected"
29
+ }
30
+ /**
31
+ * Order model.
32
+ */
33
+ export interface Order extends Entity {
34
+ /** The order number. */
35
+ number: string;
36
+ /** The total price amount (in cents). */
37
+ price_amount: number;
38
+ /** The notes for the order. */
39
+ notes: string | null;
40
+ /** The currency code for the order. */
41
+ currency_code: string;
42
+ /** The computed total amount. */
43
+ total_amount?: number;
44
+ /** The order status. */
45
+ status: OrderStatus;
46
+ /** The date the order was cancelled. */
47
+ canceled_at: DateEntity | null;
48
+ /** The date the order was archived. */
49
+ archived_at: DateEntity | null;
50
+ /** The zone ID. */
51
+ zone_id: number | null;
52
+ /** The shipping address ID. */
53
+ shipping_address_id: number | null;
54
+ /** The billing address ID. */
55
+ billing_address_id: number | null;
56
+ /** The payment method ID. */
57
+ payment_method_id: number | null;
58
+ /** The customer ID. */
59
+ customer_id: number | null;
60
+ /** The channel ID. */
61
+ channel_id: number | null;
62
+ /** The parent order ID (for split orders). */
63
+ parent_order_id: number | null;
64
+ /** The shipping option ID. */
65
+ shipping_option_id?: number | null;
66
+ /** The shipping option. */
67
+ shippingOption?: CarrierOption;
68
+ /** The shipping address. */
69
+ shippingAddress?: OrderAddress | null;
70
+ /** The billing address. */
71
+ billingAddress?: OrderAddress | null;
72
+ /** The payment method. */
73
+ paymentMethod?: PaymentMethod | null;
74
+ /** The zone. */
75
+ zone?: Zone | null;
76
+ /** The channel. */
77
+ channel?: Channel | null;
78
+ /** The parent order. */
79
+ parent?: Order | null;
80
+ /** The customer. */
81
+ customer?: Customer;
82
+ /** The order items. */
83
+ items?: OrderItem[];
84
+ /** The order shippings. */
85
+ shippings?: OrderShipping[];
86
+ /** The child orders (for split orders). */
87
+ children?: Order[];
88
+ /** The refund for the order. */
89
+ refund?: OrderRefund;
90
+ }
91
+ /**
92
+ * OrderItem model.
93
+ */
94
+ export interface OrderItem extends Entity {
95
+ /** The name of the order item. */
96
+ name: string;
97
+ /** The quantity of the order item. */
98
+ quantity: number;
99
+ /** The unit price amount. */
100
+ unit_price_amount: number | null;
101
+ /** The computed total (unit_price_amount * quantity). */
102
+ total: number;
103
+ /** The SKU of the order item. */
104
+ sku: string | null;
105
+ /** The product ID. */
106
+ product_id: number;
107
+ /** The product type (morph type). */
108
+ product_type: string;
109
+ /** The order ID. */
110
+ order_id: number;
111
+ /** The order shipping ID. */
112
+ order_shipping_id: number | null;
113
+ /** The fulfillment status. */
114
+ fulfillment_status: FulfillmentStatus | null;
115
+ /** The order. */
116
+ order?: Order;
117
+ /** The shipment. */
118
+ shipment?: OrderShipping;
119
+ }
120
+ /**
121
+ * OrderAddress model.
122
+ */
123
+ export interface OrderAddress extends Entity {
124
+ /** The first name. */
125
+ first_name: string;
126
+ /** The last name. */
127
+ last_name: string;
128
+ /** The computed full name. */
129
+ full_name: string;
130
+ /** The street address. */
131
+ street_address: string;
132
+ /** The additional street address. */
133
+ street_address_plus: string | null;
134
+ /** The postal code. */
135
+ postal_code: string;
136
+ /** The city. */
137
+ city: string;
138
+ /** The state/province. */
139
+ state: string | null;
140
+ /** The company name. */
141
+ company: string | null;
142
+ /** The phone number. */
143
+ phone: string | null;
144
+ /** The country name. */
145
+ country_name: string | null;
146
+ /** The customer ID. */
147
+ customer_id?: number | null;
148
+ /** The customer. */
149
+ customer?: Customer;
150
+ }
151
+ /**
152
+ * OrderShipping model.
153
+ */
154
+ export interface OrderShipping extends Entity {
155
+ /** The date the order was shipped. */
156
+ shipped_at: DateEntity;
157
+ /** The date the order was received. */
158
+ received_at: DateEntity | null;
159
+ /** The date the order was returned. */
160
+ returned_at: DateEntity | null;
161
+ /** The tracking number. */
162
+ tracking_number: string | null;
163
+ /** The tracking URL. */
164
+ tracking_url: string | null;
165
+ /** The shipping voucher data. */
166
+ voucher: Record<string, unknown> | null;
167
+ /** The order ID. */
168
+ order_id: number;
169
+ /** The carrier ID. */
170
+ carrier_id: number | null;
171
+ /** The order. */
172
+ order?: Order;
173
+ /** The carrier. */
174
+ carrier?: import('./carrier').Carrier;
175
+ /** The items in this shipment. */
176
+ items?: OrderItem[];
177
+ }
178
+ /**
179
+ * OrderRefund model.
180
+ */
181
+ export interface OrderRefund extends Entity {
182
+ /** The reason for the refund. */
183
+ refund_reason: string | null;
184
+ /** The refund amount (in cents). */
185
+ refund_amount: number | null;
186
+ /** The refund status. */
187
+ status: OrderRefundStatus;
188
+ /** Additional notes. */
189
+ notes: string | null;
190
+ /** The currency code. */
191
+ currency: string;
192
+ /** The order ID. */
193
+ order_id: number;
194
+ /** The user ID who processed the refund. */
195
+ user_id: number | null;
196
+ /** The order. */
197
+ order?: Order;
198
+ }
package/dist/order.js ADDED
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrderRefundStatus = exports.FulfillmentStatus = exports.OrderStatus = void 0;
4
+ var OrderStatus;
5
+ (function (OrderStatus) {
6
+ OrderStatus["PENDING"] = "pending";
7
+ OrderStatus["NEW"] = "new";
8
+ OrderStatus["REGISTER"] = "register";
9
+ OrderStatus["PAID"] = "paid";
10
+ OrderStatus["COMPLETED"] = "completed";
11
+ OrderStatus["SHIPPED"] = "shipped";
12
+ OrderStatus["CANCELLED"] = "cancelled";
13
+ })(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
14
+ var FulfillmentStatus;
15
+ (function (FulfillmentStatus) {
16
+ FulfillmentStatus["UNFULFILLED"] = "unfulfilled";
17
+ FulfillmentStatus["PARTIALLY_FULFILLED"] = "partially_fulfilled";
18
+ FulfillmentStatus["FULFILLED"] = "fulfilled";
19
+ FulfillmentStatus["CANCELLED"] = "cancelled";
20
+ })(FulfillmentStatus || (exports.FulfillmentStatus = FulfillmentStatus = {}));
21
+ var OrderRefundStatus;
22
+ (function (OrderRefundStatus) {
23
+ OrderRefundStatus["PENDING"] = "pending";
24
+ OrderRefundStatus["TREATMENT"] = "treatment";
25
+ OrderRefundStatus["PARTIAL_REFUND"] = "partial-refund";
26
+ OrderRefundStatus["REFUNDED"] = "refunded";
27
+ OrderRefundStatus["CANCELLED"] = "cancelled";
28
+ OrderRefundStatus["REJECTED"] = "rejected";
29
+ })(OrderRefundStatus || (exports.OrderRefundStatus = OrderRefundStatus = {}));
@@ -0,0 +1,25 @@
1
+ import type { Entity } from './common';
2
+ import type { Zone } from './zone';
3
+ /**
4
+ * PaymentMethod model.
5
+ */
6
+ export interface PaymentMethod extends Entity {
7
+ /** The title of the payment method. */
8
+ title: string;
9
+ /** The slug of the payment method. */
10
+ 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
+ /** The link URL of the payment method. */
16
+ link_url: string | null;
17
+ /** The description of the payment method. */
18
+ description: string | null;
19
+ /** The instructions for the payment method. */
20
+ instructions: string | null;
21
+ /** Whether the payment method is enabled. */
22
+ is_enabled: boolean;
23
+ /** The zones this payment method belongs to. */
24
+ zones?: Zone[];
25
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,75 @@
1
+ import type { Attribute } from './attribute';
2
+ import type { Brand } from './brand';
3
+ import type { Category } from './category';
4
+ import type { Channel } from './channel';
5
+ import type { Collection } from './collection';
6
+ import type { DateEntity, Entity, Metadata, Price, SEOFields, ShippingFields } from './common';
7
+ import type { Media } from './media';
8
+ import type { ProductVariant } from './product_variant';
9
+ import type { Review } from './review';
10
+ import type { Supplier } from './supplier';
11
+ export declare enum ProductType {
12
+ EXTERNAL = "external",
13
+ VIRTUAL = "virtual",
14
+ STANDARD = "standard",
15
+ VARIANT = "variant"
16
+ }
17
+ /**
18
+ * Product model.
19
+ */
20
+ export interface Product extends Entity, SEOFields, ShippingFields {
21
+ /** The name of the product. */
22
+ name: string;
23
+ /** The slug of the product. */
24
+ slug: string;
25
+ /** The Stock Keeping Unit (SKU) code of the product. */
26
+ sku?: string | null;
27
+ /** The barcode of the product. */
28
+ barcode: string | null;
29
+ /** The description of the product. */
30
+ description: string | null;
31
+ /** The security stock of the product. */
32
+ security_stock: number | null;
33
+ /** Whether the product is featured. */
34
+ featured: boolean;
35
+ /** Whether the product is visible. */
36
+ is_visible: boolean;
37
+ /** The type of the product. */
38
+ type: ProductType | null;
39
+ /** The published at date of the product. */
40
+ published_at: DateEntity | null;
41
+ /** The external ID of the product. */
42
+ external_id: string | null;
43
+ /** The stock quantity of the product. */
44
+ stock: number;
45
+ /** The combined stock of all variants. */
46
+ variants_stock?: number;
47
+ /** The supplier ID of the product. */
48
+ supplier_id?: number | null;
49
+ /** The brand ID of the product. */
50
+ brand_id: number | null;
51
+ /** The metadata of the product. */
52
+ metadata: Metadata;
53
+ /** The supplier of the product. */
54
+ supplier?: Supplier;
55
+ /** The brand of the product. */
56
+ brand?: Brand;
57
+ /** The channels of the product. */
58
+ channels?: Channel[];
59
+ /** The categories of the product. */
60
+ categories?: Category[];
61
+ /** The options/attributes of the product. */
62
+ options?: Attribute[];
63
+ /** The collections of the product. */
64
+ collections?: Collection[];
65
+ /** The variants of the product. */
66
+ variants?: ProductVariant[];
67
+ /** The related products. */
68
+ relatedProducts?: Product[];
69
+ /** The images of the product. */
70
+ images?: Media[] | null;
71
+ /** The reviews of the product. */
72
+ reviews?: Review[];
73
+ /** The prices of the product. */
74
+ prices?: Price[];
75
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProductType = void 0;
4
+ var ProductType;
5
+ (function (ProductType) {
6
+ ProductType["EXTERNAL"] = "external";
7
+ ProductType["VIRTUAL"] = "virtual";
8
+ ProductType["STANDARD"] = "standard";
9
+ ProductType["VARIANT"] = "variant";
10
+ })(ProductType || (exports.ProductType = ProductType = {}));
@@ -0,0 +1,37 @@
1
+ import type { AttributeValue } from './attribute';
2
+ import type { Entity, Metadata, Price, ShippingFields } from './common';
3
+ import type { Media } from './media';
4
+ import type { Product } from './product';
5
+ /**
6
+ * ProductVariant model.
7
+ */
8
+ export interface ProductVariant extends Entity, ShippingFields {
9
+ /** The name of the product variant. */
10
+ name: string;
11
+ /** The Stock Keeping Unit (SKU) code of the product variant. */
12
+ sku?: string | null;
13
+ /** The barcode of the product variant. */
14
+ barcode: string | null;
15
+ /** The EAN code of the product variant. */
16
+ ean: string | null;
17
+ /** The UPC code of the product variant. */
18
+ upc: string | null;
19
+ /** The position of the product variant. */
20
+ position: number;
21
+ /** Whether backorders are allowed. */
22
+ allow_backorder: boolean;
23
+ /** The product ID this variant belongs to. */
24
+ product_id: number;
25
+ /** The stock quantity of the variant. */
26
+ stock: number;
27
+ /** The metadata of the product variant. */
28
+ metadata: Metadata;
29
+ /** The product this variant belongs to. */
30
+ product?: Product;
31
+ /** The attribute values of this variant. */
32
+ values?: AttributeValue[];
33
+ /** The images of the product variant. */
34
+ images?: Media[] | null;
35
+ /** The prices of the product variant. */
36
+ prices?: Price[];
37
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,35 @@
1
+ import type { Entity } from './common';
2
+ import type { AvatarType } from './customer';
3
+ /**
4
+ * Review model.
5
+ */
6
+ export interface Review extends Entity {
7
+ /** Whether the review is recommended. */
8
+ is_recommended: boolean;
9
+ /** The rating (usually 1-5). */
10
+ rating: number;
11
+ /** The title of the review. */
12
+ title: string | null;
13
+ /** The content of the review. */
14
+ content: string | null;
15
+ /** Whether the review is approved. */
16
+ approved: boolean;
17
+ /** The ID of the reviewable entity. */
18
+ reviewrateable_id: number;
19
+ /** The type of the reviewable entity. */
20
+ reviewrateable_type: string;
21
+ /** The ID of the author. */
22
+ author_id: number;
23
+ /** The type of the author. */
24
+ author_type: string;
25
+ /** The author of the review. */
26
+ author?: ReviewAuthor;
27
+ }
28
+ /**
29
+ * ReviewAuthor type for author information.
30
+ */
31
+ export type ReviewAuthor = {
32
+ last_name: string;
33
+ first_name: string;
34
+ avatar: AvatarType;
35
+ };
package/dist/review.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });