@shopperlabs/shopper-types 2.2.6 → 2.3.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/address.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Entity } from './common';
1
+ import type { Entity, Metadata } from './common';
2
2
  import type { Country } from './country';
3
3
  export declare enum AddressType {
4
4
  BILLING = "billing",
@@ -30,6 +30,8 @@ export interface Address extends Entity {
30
30
  phone_number?: string | null;
31
31
  /** The type of the customer address. */
32
32
  type: AddressType;
33
+ /** The metadata of the address. */
34
+ metadata: Metadata;
33
35
  /** Whether this is the default shipping address. */
34
36
  shipping_default: boolean;
35
37
  /** Whether this is the default billing address. */
package/dist/carrier.d.ts CHANGED
@@ -34,6 +34,8 @@ export interface Carrier extends Entity {
34
34
  export interface CarrierOption extends Entity {
35
35
  /** The name of the carrier option. */
36
36
  name: string;
37
+ /** The description of the carrier option. */
38
+ description: string | null;
37
39
  /** The price of the carrier option (in cents). */
38
40
  price: number;
39
41
  /** Whether the carrier option is enabled. */
@@ -1,9 +1,10 @@
1
- import type { Entity, Metadata } from './common';
1
+ import type { Entity, Metadata, SEOFields } from './common';
2
2
  import type { Media } from './media';
3
+ import type { Product } from './product';
3
4
  /**
4
5
  * Category model.
5
6
  */
6
- export interface Category extends Entity {
7
+ export interface Category extends Entity, SEOFields {
7
8
  /** The name of the category. */
8
9
  name: string;
9
10
  /** The slug of the category. */
@@ -12,6 +13,8 @@ export interface Category extends Entity {
12
13
  description: string | null;
13
14
  /** Whether the category is enabled. */
14
15
  is_enabled: boolean;
16
+ /** The position of the category. */
17
+ position: number;
15
18
  /** The id of the parent category. */
16
19
  parent_id: number | null;
17
20
  /** The metadata of the category. */
@@ -22,6 +25,8 @@ export interface Category extends Entity {
22
25
  parent?: Category;
23
26
  /** The children categories. */
24
27
  children?: Category[];
28
+ /** The products of the category. */
29
+ products?: Product[];
25
30
  /** The slug path of the category. */
26
31
  slug_path?: string;
27
32
  }
package/dist/channel.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { Entity, Metadata } from './common';
2
+ import type { Product } from './product';
2
3
  /**
3
4
  * Channel model.
4
5
  */
@@ -19,4 +20,6 @@ export interface Channel extends Entity {
19
20
  is_enabled: boolean;
20
21
  /** The metadata of the channel. */
21
22
  metadata: Metadata;
23
+ /** The products of the channel. */
24
+ products?: Product[];
22
25
  }
@@ -1,5 +1,6 @@
1
1
  import type { DateEntity, Entity, Metadata, SEOFields } from './common';
2
2
  import type { Media } from './media';
3
+ import type { Product } from './product';
3
4
  import type { Zone } from './zone';
4
5
  export declare enum CollectionType {
5
6
  MANUAL = "manual",
@@ -11,15 +12,19 @@ export declare enum CollectionCondition {
11
12
  }
12
13
  export declare enum CollectionRuleType {
13
14
  PRODUCT_TITLE = "product_title",
15
+ PRODUCT_BRAND = "product_brand",
16
+ PRODUCT_CATEGORY = "product_category",
14
17
  PRODUCT_PRICE = "product_price",
15
18
  COMPARE_AT_PRICE = "compare_at_price",
16
19
  INVENTORY_STOCK = "inventory_stock",
17
- PRODUCT_CATEGORY = "product_category",
18
- PRODUCT_BRAND = "product_brand"
20
+ PRODUCT_CREATED_AT = "product_created_at",
21
+ PRODUCT_FEATURED = "product_featured",
22
+ PRODUCT_RATING = "product_rating",
23
+ PRODUCT_SALES_COUNT = "product_sales_count"
19
24
  }
20
25
  export declare enum CollectionOperator {
21
- EQUALS = "equals",
22
- NOT_EQUALS = "not_equals",
26
+ EQUALS_TO = "equals_to",
27
+ NOT_EQUAL_TO = "not_equal_to",
23
28
  LESS_THAN = "less_than",
24
29
  GREATER_THAN = "greater_than",
25
30
  STARTS_WITH = "starts_with",
@@ -53,6 +58,8 @@ export interface Collection extends Entity, SEOFields {
53
58
  rules?: CollectionRule[];
54
59
  /** The zones this collection belongs to. */
55
60
  zones?: Zone[];
61
+ /** The products of the collection. */
62
+ products?: Product[];
56
63
  }
57
64
  /**
58
65
  * CollectionRule model.
@@ -14,16 +14,20 @@ var CollectionCondition;
14
14
  var CollectionRuleType;
15
15
  (function (CollectionRuleType) {
16
16
  CollectionRuleType["PRODUCT_TITLE"] = "product_title";
17
+ CollectionRuleType["PRODUCT_BRAND"] = "product_brand";
18
+ CollectionRuleType["PRODUCT_CATEGORY"] = "product_category";
17
19
  CollectionRuleType["PRODUCT_PRICE"] = "product_price";
18
20
  CollectionRuleType["COMPARE_AT_PRICE"] = "compare_at_price";
19
21
  CollectionRuleType["INVENTORY_STOCK"] = "inventory_stock";
20
- CollectionRuleType["PRODUCT_CATEGORY"] = "product_category";
21
- CollectionRuleType["PRODUCT_BRAND"] = "product_brand";
22
+ CollectionRuleType["PRODUCT_CREATED_AT"] = "product_created_at";
23
+ CollectionRuleType["PRODUCT_FEATURED"] = "product_featured";
24
+ CollectionRuleType["PRODUCT_RATING"] = "product_rating";
25
+ CollectionRuleType["PRODUCT_SALES_COUNT"] = "product_sales_count";
22
26
  })(CollectionRuleType || (exports.CollectionRuleType = CollectionRuleType = {}));
23
27
  var CollectionOperator;
24
28
  (function (CollectionOperator) {
25
- CollectionOperator["EQUALS"] = "equals";
26
- CollectionOperator["NOT_EQUALS"] = "not_equals";
29
+ CollectionOperator["EQUALS_TO"] = "equals_to";
30
+ CollectionOperator["NOT_EQUAL_TO"] = "not_equal_to";
27
31
  CollectionOperator["LESS_THAN"] = "less_than";
28
32
  CollectionOperator["GREATER_THAN"] = "greater_than";
29
33
  CollectionOperator["STARTS_WITH"] = "starts_with";
package/dist/common.d.ts CHANGED
@@ -35,8 +35,8 @@ export interface Entity {
35
35
  */
36
36
  export interface DateEntity {
37
37
  /** The date format of the entity. */
38
- date: Date;
39
- /** The human readable date. Eg: 2 hours ago. */
38
+ date: string;
39
+ /** The human-readable date. Eg: 2 hours ago. */
40
40
  human: string;
41
41
  }
42
42
  /**
@@ -54,7 +54,7 @@ export interface Price {
54
54
  /** The currency_code for the entity. */
55
55
  currency_code: string;
56
56
  /** The currency for the entity. */
57
- currency?: Currency;
57
+ currency: Currency;
58
58
  }
59
59
  /**
60
60
  * ShippingFields interface for shipping entity.
@@ -1,3 +1,4 @@
1
+ import type { Zone } from './zone';
1
2
  /**
2
3
  * Currency model.
3
4
  */
@@ -15,4 +16,6 @@ export interface Currency {
15
16
  exchange_rate: number;
16
17
  /** Whether the currency is enabled. */
17
18
  is_enabled: boolean;
19
+ /** The zone using this currency. */
20
+ zone?: Zone;
18
21
  }
@@ -29,7 +29,7 @@ export interface Customer extends Entity {
29
29
  gender: GenderType | null;
30
30
  /** The phone number of the customer. */
31
31
  phone_number: string | null;
32
- /** The birth date of the customer. */
32
+ /** The birthdate of the customer. */
33
33
  birth_date: Date | null;
34
34
  /** The date the email was verified. */
35
35
  email_verified_at: Date | null;
@@ -28,6 +28,10 @@ export interface Discount extends Entity {
28
28
  value: number;
29
29
  /** What the discount applies to. */
30
30
  apply_to: DiscountApplyTo;
31
+ /** The minimum required type. */
32
+ min_required: string;
33
+ /** The minimum required value. */
34
+ min_required_value: string | null;
31
35
  /** Who is eligible for this discount. */
32
36
  eligibility: DiscountEligibility;
33
37
  /** The usage limit for the discount. */
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export * from './media';
15
15
  export * from './order';
16
16
  export * from './payment_method';
17
17
  export * from './product_variant';
18
+ export * from './product_tag';
18
19
  export * from './product';
19
20
  export * from './review';
20
21
  export * from './supplier';
package/dist/index.js CHANGED
@@ -31,6 +31,7 @@ __exportStar(require("./media"), exports);
31
31
  __exportStar(require("./order"), exports);
32
32
  __exportStar(require("./payment_method"), exports);
33
33
  __exportStar(require("./product_variant"), exports);
34
+ __exportStar(require("./product_tag"), exports);
34
35
  __exportStar(require("./product"), exports);
35
36
  __exportStar(require("./review"), exports);
36
37
  __exportStar(require("./supplier"), exports);
@@ -26,6 +26,12 @@ export interface Inventory extends Entity {
26
26
  phone_number: string | null;
27
27
  /** Whether this is the default inventory location. */
28
28
  is_default: boolean;
29
+ /** The priority of the inventory location. */
30
+ priority: number;
31
+ /** The latitude of the inventory location. */
32
+ latitude: number;
33
+ /** The longitude of the inventory location. */
34
+ longitude: number;
29
35
  /** The country ID of the inventory location. */
30
36
  country_id: number;
31
37
  /** The country of the inventory location. */
package/dist/media.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export interface Media {
2
2
  id: string | number;
3
3
  url: string;
4
- created_at: string;
5
- updated_at: string;
4
+ name?: string | null;
5
+ extension?: string | null;
6
+ created_at?: string;
7
+ updated_at?: string;
6
8
  }
package/dist/order.d.ts CHANGED
@@ -1,16 +1,18 @@
1
1
  import type { CarrierOption } from './carrier';
2
2
  import type { Channel } from './channel';
3
- import type { DateEntity, Entity } from './common';
3
+ import type { DateEntity, Entity, Metadata } from './common';
4
4
  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
- PENDING = "pending",
8
+ ARCHIVED = "archived",
9
9
  NEW = "new",
10
- REGISTER = "register",
10
+ SHIPPED = "shipped",
11
+ DELIVERED = "delivered",
12
+ PENDING = "pending",
11
13
  PAID = "paid",
14
+ REGISTER = "registered",
12
15
  COMPLETED = "completed",
13
- SHIPPED = "shipped",
14
16
  CANCELLED = "cancelled"
15
17
  }
16
18
  export declare enum FulfillmentStatus {
@@ -44,7 +46,7 @@ export interface Order extends Entity {
44
46
  /** The order status. */
45
47
  status: OrderStatus;
46
48
  /** The date the order was cancelled. */
47
- canceled_at: DateEntity | null;
49
+ cancelled_at: DateEntity | null;
48
50
  /** The date the order was archived. */
49
51
  archived_at: DateEntity | null;
50
52
  /** The zone ID. */
@@ -61,6 +63,8 @@ export interface Order extends Entity {
61
63
  channel_id: number | null;
62
64
  /** The parent order ID (for split orders). */
63
65
  parent_order_id: number | null;
66
+ /** The metadata of the order. */
67
+ metadata: Metadata;
64
68
  /** The shipping option ID. */
65
69
  shipping_option_id?: number | null;
66
70
  /** The shipping option. */
@@ -193,6 +197,8 @@ export interface OrderRefund extends Entity {
193
197
  order_id: number;
194
198
  /** The user ID who processed the refund. */
195
199
  user_id: number | null;
200
+ /** The metadata of the refund. */
201
+ metadata: Metadata;
196
202
  /** The order. */
197
203
  order?: Order;
198
204
  }
package/dist/order.js CHANGED
@@ -3,12 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrderRefundStatus = exports.FulfillmentStatus = exports.OrderStatus = void 0;
4
4
  var OrderStatus;
5
5
  (function (OrderStatus) {
6
- OrderStatus["PENDING"] = "pending";
6
+ OrderStatus["ARCHIVED"] = "archived";
7
7
  OrderStatus["NEW"] = "new";
8
- OrderStatus["REGISTER"] = "register";
8
+ OrderStatus["SHIPPED"] = "shipped";
9
+ OrderStatus["DELIVERED"] = "delivered";
10
+ OrderStatus["PENDING"] = "pending";
9
11
  OrderStatus["PAID"] = "paid";
12
+ OrderStatus["REGISTER"] = "registered";
10
13
  OrderStatus["COMPLETED"] = "completed";
11
- OrderStatus["SHIPPED"] = "shipped";
12
14
  OrderStatus["CANCELLED"] = "cancelled";
13
15
  })(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
14
16
  var FulfillmentStatus;
@@ -1,4 +1,4 @@
1
- import type { Entity } from './common';
1
+ import type { Entity, Metadata } from './common';
2
2
  import type { Zone } from './zone';
3
3
  /**
4
4
  * PaymentMethod model.
@@ -20,6 +20,8 @@ export interface PaymentMethod extends Entity {
20
20
  instructions: string | null;
21
21
  /** Whether the payment method is enabled. */
22
22
  is_enabled: boolean;
23
+ /** The metadata of the payment method. */
24
+ metadata: Metadata;
23
25
  /** The zones this payment method belongs to. */
24
26
  zones?: Zone[];
25
27
  }
package/dist/product.d.ts CHANGED
@@ -5,6 +5,7 @@ import type { Channel } from './channel';
5
5
  import type { Collection } from './collection';
6
6
  import type { DateEntity, Entity, Metadata, Price, SEOFields, ShippingFields } from './common';
7
7
  import type { Media } from './media';
8
+ import type { ProductTag } from './product_tag';
8
9
  import type { ProductVariant } from './product_variant';
9
10
  import type { Review } from './review';
10
11
  import type { Supplier } from './supplier';
@@ -26,6 +27,8 @@ export interface Product extends Entity, SEOFields, ShippingFields {
26
27
  sku?: string | null;
27
28
  /** The barcode of the product. */
28
29
  barcode: string | null;
30
+ /** The summary of the product. */
31
+ summary: string | null;
29
32
  /** The description of the product. */
30
33
  description: string | null;
31
34
  /** The security stock of the product. */
@@ -62,6 +65,8 @@ export interface Product extends Entity, SEOFields, ShippingFields {
62
65
  options?: Attribute[];
63
66
  /** The collections of the product. */
64
67
  collections?: Collection[];
68
+ /** The tags of the product. */
69
+ tags?: ProductTag[];
65
70
  /** The variants of the product. */
66
71
  variants?: ProductVariant[];
67
72
  /** The related products. */
@@ -0,0 +1,13 @@
1
+ import type { Entity } from './common';
2
+ import type { Product } from './product';
3
+ /**
4
+ * ProductTag model.
5
+ */
6
+ export interface ProductTag extends Entity {
7
+ /** The name of the tag. */
8
+ name: string;
9
+ /** The slug of the tag. */
10
+ slug: string | null;
11
+ /** The products associated with this tag. */
12
+ products?: Product[];
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopperlabs/shopper-types",
3
- "version": "2.2.6",
3
+ "version": "2.3.0",
4
4
  "description": "TypeScript types for Laravel Shopper",
5
5
  "author": "Arthur Monney <monneylobe@gmail.com> (https://arthurmonney.me)",
6
6
  "main": "dist/index.js",