@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.
- package/README.md +67 -0
- package/dist/address.d.ts +43 -0
- package/dist/address.js +8 -0
- package/dist/attribute.d.ts +51 -0
- package/dist/attribute.js +13 -0
- package/dist/brand.d.ts +23 -0
- package/dist/brand.js +2 -0
- package/dist/carrier.d.ts +51 -0
- package/dist/carrier.js +2 -0
- package/dist/category.d.ts +27 -0
- package/dist/category.js +2 -0
- package/dist/channel.d.ts +22 -0
- package/dist/channel.js +2 -0
- package/dist/collection.d.ts +71 -0
- package/dist/collection.js +33 -0
- package/dist/common.d.ts +94 -0
- package/dist/common.js +24 -0
- package/dist/country.d.ts +33 -0
- package/dist/country.js +2 -0
- package/dist/currency.d.ts +18 -0
- package/dist/currency.js +2 -0
- package/dist/customer.d.ts +48 -0
- package/dist/customer.js +11 -0
- package/dist/discount.d.ts +70 -0
- package/dist/discount.js +23 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +37 -0
- package/dist/inventory.d.ts +64 -0
- package/dist/inventory.js +2 -0
- package/dist/media.d.ts +6 -0
- package/dist/media.js +2 -0
- package/dist/order.d.ts +198 -0
- package/dist/order.js +29 -0
- package/dist/payment_method.d.ts +25 -0
- package/dist/payment_method.js +2 -0
- package/dist/product.d.ts +75 -0
- package/dist/product.js +10 -0
- package/dist/product_variant.d.ts +37 -0
- package/dist/product_variant.js +2 -0
- package/dist/review.d.ts +35 -0
- package/dist/review.js +2 -0
- package/dist/supplier.d.ts +26 -0
- package/dist/supplier.js +2 -0
- package/dist/zone.d.ts +43 -0
- package/dist/zone.js +2 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://github.com/shopperlabs/art/blob/main/logomark.svg" alt="Shopper Logo" height="150" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# Shopper Types definitions
|
|
6
|
+
|
|
7
|
+
TypeScript types derived from the OpenAPI Spec (OAS) to be used in API clients for Laravel Shopper.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @shopper/types
|
|
13
|
+
# or
|
|
14
|
+
yarn add @shopper/types
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import type { Product, Order, Customer } from '@shopper/types'
|
|
21
|
+
|
|
22
|
+
const product: Product = {
|
|
23
|
+
id: 1,
|
|
24
|
+
name: 'My Product',
|
|
25
|
+
slug: 'my-product',
|
|
26
|
+
// ...
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Available Types
|
|
31
|
+
|
|
32
|
+
### Models
|
|
33
|
+
- `Product`
|
|
34
|
+
- `ProductVariant`
|
|
35
|
+
- `Category`
|
|
36
|
+
- `Brand`
|
|
37
|
+
- `Collection`
|
|
38
|
+
- `Order`
|
|
39
|
+
- `OrderItem`
|
|
40
|
+
- `Customer`
|
|
41
|
+
- `Address`
|
|
42
|
+
- `Inventory`
|
|
43
|
+
- `Discount`
|
|
44
|
+
- `Review`
|
|
45
|
+
- `Channel`
|
|
46
|
+
- `Currency`
|
|
47
|
+
- `PaymentMethod`
|
|
48
|
+
- `Attribute`
|
|
49
|
+
- `AttributeValue`
|
|
50
|
+
- `Media`
|
|
51
|
+
|
|
52
|
+
### Enums
|
|
53
|
+
- `ProductType`
|
|
54
|
+
- `CollectionType`
|
|
55
|
+
- `CollectionCondition`
|
|
56
|
+
- `AddressType`
|
|
57
|
+
- `GenderType`
|
|
58
|
+
- `Weight`
|
|
59
|
+
- `Length`
|
|
60
|
+
- `Volume`
|
|
61
|
+
|
|
62
|
+
### Common Interfaces
|
|
63
|
+
- `Entity`
|
|
64
|
+
- `DateEntity`
|
|
65
|
+
- `Price`
|
|
66
|
+
- `ShippingFields`
|
|
67
|
+
- `SEOFields`
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Entity } from './common';
|
|
2
|
+
import type { Country } from './country';
|
|
3
|
+
export declare enum AddressType {
|
|
4
|
+
BILLING = "billing",
|
|
5
|
+
SHIPPING = "shipping"
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The Address interface
|
|
9
|
+
*/
|
|
10
|
+
export interface Address extends Entity {
|
|
11
|
+
/** The first name of the address. */
|
|
12
|
+
first_name: string | null;
|
|
13
|
+
/** The last name of the address. */
|
|
14
|
+
last_name: string;
|
|
15
|
+
/** The full name (first_name + last_name). */
|
|
16
|
+
full_name: string;
|
|
17
|
+
/** The company name of the address. */
|
|
18
|
+
company_name: string | null;
|
|
19
|
+
/** The street address. */
|
|
20
|
+
street_address: string;
|
|
21
|
+
/** The additional street address. */
|
|
22
|
+
street_address_plus?: string | null;
|
|
23
|
+
/** The postal code. */
|
|
24
|
+
postal_code: string;
|
|
25
|
+
/** The city. */
|
|
26
|
+
city: string;
|
|
27
|
+
/** The state/province. */
|
|
28
|
+
state: string | null;
|
|
29
|
+
/** The phone number. */
|
|
30
|
+
phone_number?: string | null;
|
|
31
|
+
/** The type of the customer address. */
|
|
32
|
+
type: AddressType;
|
|
33
|
+
/** Whether this is the default shipping address. */
|
|
34
|
+
shipping_default: boolean;
|
|
35
|
+
/** Whether this is the default billing address. */
|
|
36
|
+
billing_default: boolean;
|
|
37
|
+
/** ID of the user this address belongs to. */
|
|
38
|
+
user_id: number;
|
|
39
|
+
/** ID of the country this address belongs to. */
|
|
40
|
+
country_id: number;
|
|
41
|
+
/** The country of the address. */
|
|
42
|
+
country?: Country;
|
|
43
|
+
}
|
package/dist/address.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddressType = void 0;
|
|
4
|
+
var AddressType;
|
|
5
|
+
(function (AddressType) {
|
|
6
|
+
AddressType["BILLING"] = "billing";
|
|
7
|
+
AddressType["SHIPPING"] = "shipping";
|
|
8
|
+
})(AddressType || (exports.AddressType = AddressType = {}));
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Entity } from './common';
|
|
2
|
+
export declare enum FieldType {
|
|
3
|
+
TEXT = "text",
|
|
4
|
+
NUMBER = "number",
|
|
5
|
+
RICH_TEXT = "richtext",
|
|
6
|
+
SELECT = "select",
|
|
7
|
+
CHECKBOX = "checkbox",
|
|
8
|
+
COLOR_PICKER = "colorpicker",
|
|
9
|
+
DATE_PICKER = "datepicker"
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Attribute model.
|
|
13
|
+
*/
|
|
14
|
+
export interface Attribute extends Entity {
|
|
15
|
+
/** The name of the attribute. */
|
|
16
|
+
name: string;
|
|
17
|
+
/** The slug of the attribute. */
|
|
18
|
+
slug: string;
|
|
19
|
+
/** The type of the attribute field. */
|
|
20
|
+
type: FieldType;
|
|
21
|
+
/** The icon of the attribute. */
|
|
22
|
+
icon: string | null;
|
|
23
|
+
/** The description of the attribute. */
|
|
24
|
+
description: string | null;
|
|
25
|
+
/** Whether the attribute is enabled. */
|
|
26
|
+
is_enabled: boolean;
|
|
27
|
+
/** Whether the attribute is searchable. */
|
|
28
|
+
is_searchable: boolean;
|
|
29
|
+
/** Whether the attribute is filterable. */
|
|
30
|
+
is_filterable: boolean;
|
|
31
|
+
/** The computed formatted type. */
|
|
32
|
+
type_formatted?: string;
|
|
33
|
+
/** The values of the attribute. */
|
|
34
|
+
values?: AttributeValue[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* AttributeValue model.
|
|
38
|
+
*/
|
|
39
|
+
export interface AttributeValue {
|
|
40
|
+
id: number;
|
|
41
|
+
/** The display value. */
|
|
42
|
+
value: string;
|
|
43
|
+
/** The key identifier. */
|
|
44
|
+
key: string;
|
|
45
|
+
/** The position/order. */
|
|
46
|
+
position: number;
|
|
47
|
+
/** The attribute ID this value belongs to. */
|
|
48
|
+
attribute_id: number;
|
|
49
|
+
/** The attribute this value belongs to. */
|
|
50
|
+
attribute?: Attribute;
|
|
51
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FieldType = void 0;
|
|
4
|
+
var FieldType;
|
|
5
|
+
(function (FieldType) {
|
|
6
|
+
FieldType["TEXT"] = "text";
|
|
7
|
+
FieldType["NUMBER"] = "number";
|
|
8
|
+
FieldType["RICH_TEXT"] = "richtext";
|
|
9
|
+
FieldType["SELECT"] = "select";
|
|
10
|
+
FieldType["CHECKBOX"] = "checkbox";
|
|
11
|
+
FieldType["COLOR_PICKER"] = "colorpicker";
|
|
12
|
+
FieldType["DATE_PICKER"] = "datepicker";
|
|
13
|
+
})(FieldType || (exports.FieldType = FieldType = {}));
|
package/dist/brand.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Entity, Metadata, SEOFields } from './common';
|
|
2
|
+
import type { Media } from './media';
|
|
3
|
+
/**
|
|
4
|
+
* Brand model.
|
|
5
|
+
*/
|
|
6
|
+
export interface Brand extends Entity, SEOFields {
|
|
7
|
+
/** The name of the brand. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** The slug of the brand. */
|
|
10
|
+
slug: string | null;
|
|
11
|
+
/** The website URL of the brand. */
|
|
12
|
+
website: string | null;
|
|
13
|
+
/** The description of the brand. */
|
|
14
|
+
description: string | null;
|
|
15
|
+
/** The position of the brand. */
|
|
16
|
+
position: number;
|
|
17
|
+
/** Whether the brand is enabled. */
|
|
18
|
+
is_enabled: boolean;
|
|
19
|
+
/** The metadata of the brand. */
|
|
20
|
+
metadata: Metadata;
|
|
21
|
+
/** The image of the brand. */
|
|
22
|
+
image?: Media | null;
|
|
23
|
+
}
|
package/dist/brand.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Entity, Metadata } from './common';
|
|
2
|
+
import type { Media } from './media';
|
|
3
|
+
import type { Zone } from './zone';
|
|
4
|
+
/**
|
|
5
|
+
* Carrier model.
|
|
6
|
+
*/
|
|
7
|
+
export interface Carrier extends Entity {
|
|
8
|
+
/** The name of the carrier. */
|
|
9
|
+
name: string;
|
|
10
|
+
/** The slug of the carrier. */
|
|
11
|
+
slug: string | null;
|
|
12
|
+
/** The shipping driver identifier. */
|
|
13
|
+
driver: string | null;
|
|
14
|
+
/** The description of the carrier. */
|
|
15
|
+
description: string | null;
|
|
16
|
+
/** The link URL of the carrier. */
|
|
17
|
+
link_url: string | null;
|
|
18
|
+
/** The shipping amount (in cents). */
|
|
19
|
+
shipping_amount: number | null;
|
|
20
|
+
/** Whether the carrier is enabled. */
|
|
21
|
+
is_enabled: boolean;
|
|
22
|
+
/** The metadata of the carrier. */
|
|
23
|
+
metadata: Metadata;
|
|
24
|
+
/** The logo of the carrier. */
|
|
25
|
+
logo?: Media | null;
|
|
26
|
+
/** The options of this carrier. */
|
|
27
|
+
options?: CarrierOption[];
|
|
28
|
+
/** The zones this carrier belongs to. */
|
|
29
|
+
zones?: Zone[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* CarrierOption model.
|
|
33
|
+
*/
|
|
34
|
+
export interface CarrierOption extends Entity {
|
|
35
|
+
/** The name of the carrier option. */
|
|
36
|
+
name: string;
|
|
37
|
+
/** The price of the carrier option (in cents). */
|
|
38
|
+
price: number;
|
|
39
|
+
/** Whether the carrier option is enabled. */
|
|
40
|
+
is_enabled: boolean;
|
|
41
|
+
/** The zone ID this option belongs to. */
|
|
42
|
+
zone_id: number;
|
|
43
|
+
/** The carrier ID this option belongs to. */
|
|
44
|
+
carrier_id: number;
|
|
45
|
+
/** The metadata of the carrier option. */
|
|
46
|
+
metadata: Metadata;
|
|
47
|
+
/** The zone of the carrier option. */
|
|
48
|
+
zone?: Zone;
|
|
49
|
+
/** The carrier of the carrier option. */
|
|
50
|
+
carrier?: Carrier;
|
|
51
|
+
}
|
package/dist/carrier.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Entity, Metadata } from './common';
|
|
2
|
+
import type { Media } from './media';
|
|
3
|
+
/**
|
|
4
|
+
* Category model.
|
|
5
|
+
*/
|
|
6
|
+
export interface Category extends Entity {
|
|
7
|
+
/** The name of the category. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** The slug of the category. */
|
|
10
|
+
slug: string;
|
|
11
|
+
/** The description of the category. */
|
|
12
|
+
description: string | null;
|
|
13
|
+
/** Whether the category is enabled. */
|
|
14
|
+
is_enabled: boolean;
|
|
15
|
+
/** The id of the parent category. */
|
|
16
|
+
parent_id: number | null;
|
|
17
|
+
/** The metadata of the category. */
|
|
18
|
+
metadata: Metadata;
|
|
19
|
+
/** The image of the category. */
|
|
20
|
+
image?: Media | null;
|
|
21
|
+
/** The parent category. */
|
|
22
|
+
parent?: Category;
|
|
23
|
+
/** The children categories. */
|
|
24
|
+
children?: Category[];
|
|
25
|
+
/** The slug path of the category. */
|
|
26
|
+
slug_path?: string;
|
|
27
|
+
}
|
package/dist/category.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Entity, Metadata } from './common';
|
|
2
|
+
/**
|
|
3
|
+
* Channel model.
|
|
4
|
+
*/
|
|
5
|
+
export interface Channel extends Entity {
|
|
6
|
+
/** The name of the channel. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** The slug of the channel. */
|
|
9
|
+
slug: string | null;
|
|
10
|
+
/** The description of the channel. */
|
|
11
|
+
description: string | null;
|
|
12
|
+
/** The timezone of the channel. */
|
|
13
|
+
timezone: string | null;
|
|
14
|
+
/** The URL of the channel. */
|
|
15
|
+
url: string | null;
|
|
16
|
+
/** Whether the channel is the default. */
|
|
17
|
+
is_default: boolean;
|
|
18
|
+
/** Whether the channel is enabled. */
|
|
19
|
+
is_enabled: boolean;
|
|
20
|
+
/** The metadata of the channel. */
|
|
21
|
+
metadata: Metadata;
|
|
22
|
+
}
|
package/dist/channel.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { DateEntity, Entity, Metadata, SEOFields } from './common';
|
|
2
|
+
import type { Media } from './media';
|
|
3
|
+
import type { Zone } from './zone';
|
|
4
|
+
export declare enum CollectionType {
|
|
5
|
+
MANUAL = "manual",
|
|
6
|
+
AUTO = "auto"
|
|
7
|
+
}
|
|
8
|
+
export declare enum CollectionCondition {
|
|
9
|
+
ALL = "all",
|
|
10
|
+
ANY = "any"
|
|
11
|
+
}
|
|
12
|
+
export declare enum CollectionRuleType {
|
|
13
|
+
PRODUCT_TITLE = "product_title",
|
|
14
|
+
PRODUCT_PRICE = "product_price",
|
|
15
|
+
COMPARE_AT_PRICE = "compare_at_price",
|
|
16
|
+
INVENTORY_STOCK = "inventory_stock",
|
|
17
|
+
PRODUCT_CATEGORY = "product_category",
|
|
18
|
+
PRODUCT_BRAND = "product_brand"
|
|
19
|
+
}
|
|
20
|
+
export declare enum CollectionOperator {
|
|
21
|
+
EQUALS = "equals",
|
|
22
|
+
NOT_EQUALS = "not_equals",
|
|
23
|
+
LESS_THAN = "less_than",
|
|
24
|
+
GREATER_THAN = "greater_than",
|
|
25
|
+
STARTS_WITH = "starts_with",
|
|
26
|
+
ENDS_WITH = "ends_with",
|
|
27
|
+
CONTAINS = "contains",
|
|
28
|
+
NOT_CONTAINS = "not_contains"
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Collection model.
|
|
32
|
+
*/
|
|
33
|
+
export interface Collection extends Entity, SEOFields {
|
|
34
|
+
/** The name of the collection. */
|
|
35
|
+
name: string;
|
|
36
|
+
/** The slug of the collection. */
|
|
37
|
+
slug: string;
|
|
38
|
+
/** The description of the collection. */
|
|
39
|
+
description?: string | null;
|
|
40
|
+
/** The type of the collection. */
|
|
41
|
+
type: CollectionType;
|
|
42
|
+
/** The match conditions for automatic collections. */
|
|
43
|
+
match_conditions: CollectionCondition | null;
|
|
44
|
+
/** The sort order for products. */
|
|
45
|
+
sort: string | null;
|
|
46
|
+
/** The published date of the collection. */
|
|
47
|
+
published_at: DateEntity | null;
|
|
48
|
+
/** The metadata of the collection. */
|
|
49
|
+
metadata: Metadata;
|
|
50
|
+
/** The image of the collection. */
|
|
51
|
+
image?: Media | null;
|
|
52
|
+
/** The rules for automatic collections. */
|
|
53
|
+
rules?: CollectionRule[];
|
|
54
|
+
/** The zones this collection belongs to. */
|
|
55
|
+
zones?: Zone[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* CollectionRule model.
|
|
59
|
+
*/
|
|
60
|
+
export interface CollectionRule extends Entity {
|
|
61
|
+
/** The rule type. */
|
|
62
|
+
rule: CollectionRuleType;
|
|
63
|
+
/** The operator for the rule. */
|
|
64
|
+
operator: CollectionOperator;
|
|
65
|
+
/** The value for the rule. */
|
|
66
|
+
value: string;
|
|
67
|
+
/** The collection ID this rule belongs to. */
|
|
68
|
+
collection_id: number;
|
|
69
|
+
/** The collection this rule belongs to. */
|
|
70
|
+
collection?: Collection;
|
|
71
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CollectionOperator = exports.CollectionRuleType = exports.CollectionCondition = exports.CollectionType = void 0;
|
|
4
|
+
var CollectionType;
|
|
5
|
+
(function (CollectionType) {
|
|
6
|
+
CollectionType["MANUAL"] = "manual";
|
|
7
|
+
CollectionType["AUTO"] = "auto";
|
|
8
|
+
})(CollectionType || (exports.CollectionType = CollectionType = {}));
|
|
9
|
+
var CollectionCondition;
|
|
10
|
+
(function (CollectionCondition) {
|
|
11
|
+
CollectionCondition["ALL"] = "all";
|
|
12
|
+
CollectionCondition["ANY"] = "any";
|
|
13
|
+
})(CollectionCondition || (exports.CollectionCondition = CollectionCondition = {}));
|
|
14
|
+
var CollectionRuleType;
|
|
15
|
+
(function (CollectionRuleType) {
|
|
16
|
+
CollectionRuleType["PRODUCT_TITLE"] = "product_title";
|
|
17
|
+
CollectionRuleType["PRODUCT_PRICE"] = "product_price";
|
|
18
|
+
CollectionRuleType["COMPARE_AT_PRICE"] = "compare_at_price";
|
|
19
|
+
CollectionRuleType["INVENTORY_STOCK"] = "inventory_stock";
|
|
20
|
+
CollectionRuleType["PRODUCT_CATEGORY"] = "product_category";
|
|
21
|
+
CollectionRuleType["PRODUCT_BRAND"] = "product_brand";
|
|
22
|
+
})(CollectionRuleType || (exports.CollectionRuleType = CollectionRuleType = {}));
|
|
23
|
+
var CollectionOperator;
|
|
24
|
+
(function (CollectionOperator) {
|
|
25
|
+
CollectionOperator["EQUALS"] = "equals";
|
|
26
|
+
CollectionOperator["NOT_EQUALS"] = "not_equals";
|
|
27
|
+
CollectionOperator["LESS_THAN"] = "less_than";
|
|
28
|
+
CollectionOperator["GREATER_THAN"] = "greater_than";
|
|
29
|
+
CollectionOperator["STARTS_WITH"] = "starts_with";
|
|
30
|
+
CollectionOperator["ENDS_WITH"] = "ends_with";
|
|
31
|
+
CollectionOperator["CONTAINS"] = "contains";
|
|
32
|
+
CollectionOperator["NOT_CONTAINS"] = "not_contains";
|
|
33
|
+
})(CollectionOperator || (exports.CollectionOperator = CollectionOperator = {}));
|
package/dist/common.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Currency } from './currency';
|
|
2
|
+
export declare enum Weight {
|
|
3
|
+
KG = "kg",
|
|
4
|
+
G = "g",
|
|
5
|
+
LBS = "lbs"
|
|
6
|
+
}
|
|
7
|
+
export declare enum Length {
|
|
8
|
+
M = "m",
|
|
9
|
+
CM = "cm",
|
|
10
|
+
MM = "mm",
|
|
11
|
+
FT = "ft",
|
|
12
|
+
IN = "in"
|
|
13
|
+
}
|
|
14
|
+
export declare enum Volume {
|
|
15
|
+
L = "l",
|
|
16
|
+
ML = "ml",
|
|
17
|
+
GAL = "gal",
|
|
18
|
+
FLOZ = "floz"
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Global entity for all the models.
|
|
22
|
+
*/
|
|
23
|
+
export interface Entity {
|
|
24
|
+
/** The id of the entity. */
|
|
25
|
+
id: number;
|
|
26
|
+
/** The created at of the entity. */
|
|
27
|
+
created_at?: DateEntity;
|
|
28
|
+
/** The updated at of the entity. */
|
|
29
|
+
updated_at?: DateEntity;
|
|
30
|
+
/** The deleted at of the entity. */
|
|
31
|
+
deleted_at?: DateEntity | null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A date DTO to manage date format.
|
|
35
|
+
*/
|
|
36
|
+
export interface DateEntity {
|
|
37
|
+
/** The date format of the entity. */
|
|
38
|
+
date: Date;
|
|
39
|
+
/** The human readable date. Eg: 2 hours ago. */
|
|
40
|
+
human: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Price interface for entity.
|
|
44
|
+
*/
|
|
45
|
+
export interface Price {
|
|
46
|
+
/** The original amount for the entity. */
|
|
47
|
+
amount: number | null;
|
|
48
|
+
/** The compare_amount amount for the entity. */
|
|
49
|
+
compare_amount: number | null;
|
|
50
|
+
/** The cost_amount for the entity. */
|
|
51
|
+
cost_amount: number | null;
|
|
52
|
+
/** The currency_id for the entity. */
|
|
53
|
+
currency_id: number;
|
|
54
|
+
/** The currency_code for the entity. */
|
|
55
|
+
currency_code: string;
|
|
56
|
+
/** The currency for the entity. */
|
|
57
|
+
currency?: Currency;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* ShippingFields interface for shipping entity.
|
|
61
|
+
*/
|
|
62
|
+
export interface ShippingFields {
|
|
63
|
+
/** The width_unit of the entity. */
|
|
64
|
+
width_unit: Length;
|
|
65
|
+
/** The width_value of the entity. */
|
|
66
|
+
width_value: number | null;
|
|
67
|
+
/** The weight_unit of the entity. */
|
|
68
|
+
weight_unit: Weight;
|
|
69
|
+
/** The weight_value of the entity. */
|
|
70
|
+
weight_value: number | null;
|
|
71
|
+
/** The height_unit of the entity. */
|
|
72
|
+
height_unit: Length;
|
|
73
|
+
/** The height_value of the entity. */
|
|
74
|
+
height_value: number | null;
|
|
75
|
+
/** The depth_unit of the entity. */
|
|
76
|
+
depth_unit: Length;
|
|
77
|
+
/** The depth_value of the entity. */
|
|
78
|
+
depth_value: number | null;
|
|
79
|
+
/** The volume_unit of the entity. */
|
|
80
|
+
volume_unit: Volume;
|
|
81
|
+
/** The volume_value of the entity. */
|
|
82
|
+
volume_value: number | null;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Seo Fields interface for entities.
|
|
86
|
+
*/
|
|
87
|
+
export interface SEOFields {
|
|
88
|
+
seo_title?: string | null;
|
|
89
|
+
seo_description?: string | null;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Metadata type for entities.
|
|
93
|
+
*/
|
|
94
|
+
export type Metadata = Record<string, unknown> | null;
|
package/dist/common.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Volume = exports.Length = exports.Weight = void 0;
|
|
4
|
+
var Weight;
|
|
5
|
+
(function (Weight) {
|
|
6
|
+
Weight["KG"] = "kg";
|
|
7
|
+
Weight["G"] = "g";
|
|
8
|
+
Weight["LBS"] = "lbs";
|
|
9
|
+
})(Weight || (exports.Weight = Weight = {}));
|
|
10
|
+
var Length;
|
|
11
|
+
(function (Length) {
|
|
12
|
+
Length["M"] = "m";
|
|
13
|
+
Length["CM"] = "cm";
|
|
14
|
+
Length["MM"] = "mm";
|
|
15
|
+
Length["FT"] = "ft";
|
|
16
|
+
Length["IN"] = "in";
|
|
17
|
+
})(Length || (exports.Length = Length = {}));
|
|
18
|
+
var Volume;
|
|
19
|
+
(function (Volume) {
|
|
20
|
+
Volume["L"] = "l";
|
|
21
|
+
Volume["ML"] = "ml";
|
|
22
|
+
Volume["GAL"] = "gal";
|
|
23
|
+
Volume["FLOZ"] = "floz";
|
|
24
|
+
})(Volume || (exports.Volume = Volume = {}));
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Zone } from './zone';
|
|
2
|
+
/**
|
|
3
|
+
* Country model.
|
|
4
|
+
*/
|
|
5
|
+
export interface Country {
|
|
6
|
+
id: number;
|
|
7
|
+
/** The name of the country. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** The official name of the country. */
|
|
10
|
+
name_official: string;
|
|
11
|
+
/** The region of the country. */
|
|
12
|
+
region: string;
|
|
13
|
+
/** The subregion of the country. */
|
|
14
|
+
subregion: string;
|
|
15
|
+
/** The ISO 3166-1 alpha-3 code. */
|
|
16
|
+
cca3: string;
|
|
17
|
+
/** The ISO 3166-1 alpha-2 code. */
|
|
18
|
+
cca2: string;
|
|
19
|
+
/** The flag emoji of the country. */
|
|
20
|
+
flag: string;
|
|
21
|
+
/** The SVG flag URL of the country. */
|
|
22
|
+
svg_flag: string;
|
|
23
|
+
/** The latitude of the country. */
|
|
24
|
+
latitude: number;
|
|
25
|
+
/** The longitude of the country. */
|
|
26
|
+
longitude: number;
|
|
27
|
+
/** The phone calling codes of the country. */
|
|
28
|
+
phone_calling_code: Record<string, unknown>;
|
|
29
|
+
/** The currencies of the country. */
|
|
30
|
+
currencies: Record<string, unknown>;
|
|
31
|
+
/** The zones this country belongs to. */
|
|
32
|
+
zones?: Zone[];
|
|
33
|
+
}
|
package/dist/country.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Currency model.
|
|
3
|
+
*/
|
|
4
|
+
export interface Currency {
|
|
5
|
+
id: number;
|
|
6
|
+
/** The name of the currency. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** The code of the currency (e.g., USD, EUR). */
|
|
9
|
+
code: string;
|
|
10
|
+
/** The symbol of the currency (e.g., $, €). */
|
|
11
|
+
symbol: string;
|
|
12
|
+
/** The format pattern for displaying amounts. */
|
|
13
|
+
format: string;
|
|
14
|
+
/** The exchange rate relative to the base currency. */
|
|
15
|
+
exchange_rate: number;
|
|
16
|
+
/** Whether the currency is enabled. */
|
|
17
|
+
is_enabled: boolean;
|
|
18
|
+
}
|
package/dist/currency.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Address } from './address';
|
|
2
|
+
import type { DateEntity, Entity } from './common';
|
|
3
|
+
/**
|
|
4
|
+
* The Gender Type for the customer.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum GenderType {
|
|
7
|
+
MALE = "male",
|
|
8
|
+
FEMALE = "female"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The Avatar interface for the customer.
|
|
12
|
+
*/
|
|
13
|
+
export interface AvatarType {
|
|
14
|
+
type: string;
|
|
15
|
+
url: string;
|
|
16
|
+
default: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Customer model.
|
|
20
|
+
*/
|
|
21
|
+
export interface Customer extends Entity {
|
|
22
|
+
/** The first name of the customer. */
|
|
23
|
+
first_name: string | null;
|
|
24
|
+
/** The last name of the customer. */
|
|
25
|
+
last_name: string;
|
|
26
|
+
/** The email of the customer. */
|
|
27
|
+
email: string;
|
|
28
|
+
/** The gender of the customer. */
|
|
29
|
+
gender: GenderType | null;
|
|
30
|
+
/** The phone number of the customer. */
|
|
31
|
+
phone_number: string | null;
|
|
32
|
+
/** The birth date of the customer. */
|
|
33
|
+
birth_date: Date | null;
|
|
34
|
+
/** The date the email was verified. */
|
|
35
|
+
email_verified_at: Date | null;
|
|
36
|
+
/** The avatar of the customer. */
|
|
37
|
+
avatar: AvatarType;
|
|
38
|
+
/** The timezone of the customer. */
|
|
39
|
+
timezone?: string | null;
|
|
40
|
+
/** Whether the customer has opted in to marketing. */
|
|
41
|
+
opt_in: boolean;
|
|
42
|
+
/** The last login date. */
|
|
43
|
+
last_login_at: DateEntity | null;
|
|
44
|
+
/** The last login IP address. */
|
|
45
|
+
last_login_ip?: string | null;
|
|
46
|
+
/** The customer's addresses. */
|
|
47
|
+
addresses?: Address[];
|
|
48
|
+
}
|
package/dist/customer.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenderType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The Gender Type for the customer.
|
|
6
|
+
*/
|
|
7
|
+
var GenderType;
|
|
8
|
+
(function (GenderType) {
|
|
9
|
+
GenderType["MALE"] = "male";
|
|
10
|
+
GenderType["FEMALE"] = "female";
|
|
11
|
+
})(GenderType || (exports.GenderType = GenderType = {}));
|