@orderingstack/ordering-types 0.0.2 → 0.1.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/{index.d.ts → dist/cjs/index.d.ts} +53 -17
- package/dist/cjs/index.js +43 -0
- package/dist/esm/index.d.ts +137 -0
- package/dist/esm/index.js +40 -0
- package/package.json +9 -4
|
@@ -15,7 +15,7 @@ export interface Address {
|
|
|
15
15
|
city: string;
|
|
16
16
|
country: string;
|
|
17
17
|
}
|
|
18
|
-
export enum CouponViewType {
|
|
18
|
+
export declare enum CouponViewType {
|
|
19
19
|
CAROUSEL = "carousel",
|
|
20
20
|
NORMAL = "normal",
|
|
21
21
|
IMAGE = "image"
|
|
@@ -24,7 +24,7 @@ export interface Coupon {
|
|
|
24
24
|
id: string;
|
|
25
25
|
img: string;
|
|
26
26
|
viewType?: CouponViewType;
|
|
27
|
-
size?:
|
|
27
|
+
size?: "md" | "lg";
|
|
28
28
|
price?: number;
|
|
29
29
|
name?: string;
|
|
30
30
|
endDate?: string;
|
|
@@ -35,8 +35,8 @@ export interface Language {
|
|
|
35
35
|
key: string;
|
|
36
36
|
icon: any;
|
|
37
37
|
}
|
|
38
|
-
export type StringBoolean =
|
|
39
|
-
export enum EProductKind {
|
|
38
|
+
export type StringBoolean = "true" | "false";
|
|
39
|
+
export declare enum EProductKind {
|
|
40
40
|
GROUP = "3e/group",
|
|
41
41
|
PRODUCT = "3e/product",
|
|
42
42
|
CATEGORY = "3e/group/category",
|
|
@@ -46,20 +46,20 @@ export enum EProductKind {
|
|
|
46
46
|
REF = "3e/ref",
|
|
47
47
|
QUERY = "3e/query"
|
|
48
48
|
}
|
|
49
|
-
export enum EProductKindBucket {
|
|
49
|
+
export declare enum EProductKindBucket {
|
|
50
50
|
GROUP = "group",
|
|
51
51
|
PRODUCT = "product"
|
|
52
52
|
}
|
|
53
53
|
export type Literals = {
|
|
54
|
+
description?: string;
|
|
54
55
|
name: string;
|
|
55
56
|
fiscal?: string;
|
|
56
|
-
"target-product-id"?: string
|
|
57
|
+
"target-product-id"?: string;
|
|
57
58
|
};
|
|
58
59
|
export type Media = {
|
|
59
60
|
url: string;
|
|
60
61
|
name: string;
|
|
61
62
|
};
|
|
62
|
-
|
|
63
63
|
export type Availability = {
|
|
64
64
|
MON?: [string, string];
|
|
65
65
|
TUE?: [string, string];
|
|
@@ -68,34 +68,70 @@ export type Availability = {
|
|
|
68
68
|
FRI?: [string, string];
|
|
69
69
|
SAT?: [string, string];
|
|
70
70
|
SUN?: [string, string];
|
|
71
|
-
}
|
|
71
|
+
};
|
|
72
72
|
export type Product = {
|
|
73
73
|
availability?: Availability;
|
|
74
|
+
details?: {
|
|
75
|
+
literals?: Literals;
|
|
76
|
+
media?: Media[];
|
|
77
|
+
};
|
|
78
|
+
filter?: any;
|
|
79
|
+
fltCtx?: any;
|
|
74
80
|
id: string;
|
|
75
81
|
img?: string;
|
|
76
82
|
items?: Product[];
|
|
77
83
|
kind: EProductKind | EProductKindBucket;
|
|
78
84
|
literals?: Literals;
|
|
79
|
-
details?: {
|
|
80
|
-
literals?: Literals;
|
|
81
|
-
media?: Media[];
|
|
82
|
-
};
|
|
83
85
|
price: string;
|
|
84
86
|
minPrice?: string;
|
|
85
87
|
quantity: string;
|
|
86
88
|
vat: string;
|
|
87
|
-
outsideAvailabilitySlot?: boolean;
|
|
88
89
|
state?: ProductConfig;
|
|
89
90
|
selCtx: string;
|
|
90
|
-
filter?: any;
|
|
91
|
-
fltCtx?: any;
|
|
92
91
|
};
|
|
93
92
|
export type ProductConfig = {
|
|
94
93
|
selected: any;
|
|
95
94
|
filter: any;
|
|
96
95
|
};
|
|
97
|
-
|
|
98
96
|
export interface Category {
|
|
99
97
|
id: string;
|
|
100
98
|
name: string;
|
|
101
|
-
}
|
|
99
|
+
}
|
|
100
|
+
export interface SaleChannel {
|
|
101
|
+
active?: boolean;
|
|
102
|
+
minDeliveryTime?: string;
|
|
103
|
+
minOrderValue?: string;
|
|
104
|
+
week?: Availability;
|
|
105
|
+
}
|
|
106
|
+
declare enum EChannelName {
|
|
107
|
+
DINE_IN = "DINE_IN",
|
|
108
|
+
TAKE_AWAY = "TAKE_AWAY",
|
|
109
|
+
DELIVERY = "DELIVERY",
|
|
110
|
+
GLOVO_DELIVERY = "GLOVO_DELIVERY",
|
|
111
|
+
JUSTEAT_DELIVERY = "JUSTEAT_DELIVERY",
|
|
112
|
+
UBER_DELIVERY = "UBER_DELIVERY",
|
|
113
|
+
BOLT_DELIVERY = "BOLT_DELIVERY",
|
|
114
|
+
WOLT_DELIVERY = "WOLT_DELIVERY"
|
|
115
|
+
}
|
|
116
|
+
export interface VenueConfig {
|
|
117
|
+
active: boolean;
|
|
118
|
+
address: {
|
|
119
|
+
city: string;
|
|
120
|
+
country: string;
|
|
121
|
+
number: string;
|
|
122
|
+
postal: string;
|
|
123
|
+
street: string;
|
|
124
|
+
};
|
|
125
|
+
channelConstraints: Partial<Record<EChannelName, SaleChannel>>;
|
|
126
|
+
device: Record<string, Record<string, string>>;
|
|
127
|
+
extra: Record<string, string>;
|
|
128
|
+
geoPosition: GeoPosition;
|
|
129
|
+
id: string;
|
|
130
|
+
menu: string;
|
|
131
|
+
name: string;
|
|
132
|
+
sync: boolean;
|
|
133
|
+
tempDisabled: boolean;
|
|
134
|
+
timeZone: string;
|
|
135
|
+
warehouse: string;
|
|
136
|
+
}
|
|
137
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EProductKindBucket = exports.EProductKind = exports.CouponViewType = void 0;
|
|
4
|
+
var CouponViewType;
|
|
5
|
+
(function (CouponViewType) {
|
|
6
|
+
CouponViewType["CAROUSEL"] = "carousel";
|
|
7
|
+
CouponViewType["NORMAL"] = "normal";
|
|
8
|
+
CouponViewType["IMAGE"] = "image";
|
|
9
|
+
})(CouponViewType = exports.CouponViewType || (exports.CouponViewType = {}));
|
|
10
|
+
var EProductKind;
|
|
11
|
+
(function (EProductKind) {
|
|
12
|
+
EProductKind["GROUP"] = "3e/group";
|
|
13
|
+
EProductKind["PRODUCT"] = "3e/product";
|
|
14
|
+
EProductKind["CATEGORY"] = "3e/group/category";
|
|
15
|
+
EProductKind["OPTIONS"] = "3e/group/options";
|
|
16
|
+
EProductKind["CONFIG"] = "3e/group/config";
|
|
17
|
+
EProductKind["STATIC"] = "3e/static";
|
|
18
|
+
EProductKind["REF"] = "3e/ref";
|
|
19
|
+
EProductKind["QUERY"] = "3e/query";
|
|
20
|
+
})(EProductKind = exports.EProductKind || (exports.EProductKind = {}));
|
|
21
|
+
var EProductKindBucket;
|
|
22
|
+
(function (EProductKindBucket) {
|
|
23
|
+
EProductKindBucket["GROUP"] = "group";
|
|
24
|
+
EProductKindBucket["PRODUCT"] = "product";
|
|
25
|
+
})(EProductKindBucket = exports.EProductKindBucket || (exports.EProductKindBucket = {}));
|
|
26
|
+
var EChannelName;
|
|
27
|
+
(function (EChannelName) {
|
|
28
|
+
EChannelName["DINE_IN"] = "DINE_IN";
|
|
29
|
+
EChannelName["TAKE_AWAY"] = "TAKE_AWAY";
|
|
30
|
+
EChannelName["DELIVERY"] = "DELIVERY";
|
|
31
|
+
EChannelName["GLOVO_DELIVERY"] = "GLOVO_DELIVERY";
|
|
32
|
+
// GLOVO_TAKE_AWAY = "GLOVO_TAKE_AWAY",
|
|
33
|
+
EChannelName["JUSTEAT_DELIVERY"] = "JUSTEAT_DELIVERY";
|
|
34
|
+
// JUSTEAT_TAKE_AWAY = "JUSTEAT_TAKE_AWAY",
|
|
35
|
+
EChannelName["UBER_DELIVERY"] = "UBER_DELIVERY";
|
|
36
|
+
// UBER_TAKE_AWAY = "UBER_TAKE_AWAY",
|
|
37
|
+
// UBER_DINE_IN = "UBER_DINE_IN",
|
|
38
|
+
EChannelName["BOLT_DELIVERY"] = "BOLT_DELIVERY";
|
|
39
|
+
// BOLT_TAKE_AWAY = "BOLT_TAKE_AWAY",
|
|
40
|
+
EChannelName["WOLT_DELIVERY"] = "WOLT_DELIVERY";
|
|
41
|
+
// WOLT_TAKE_AWAY = "WOLT_TAKE_AWAY",
|
|
42
|
+
// WOLT_DINE_IN = "WOLT_DINE_IN"
|
|
43
|
+
})(EChannelName || (EChannelName = {}));
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
export interface Restaurant {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
geoPosition: GeoPosition;
|
|
5
|
+
address: Address;
|
|
6
|
+
}
|
|
7
|
+
export interface GeoPosition {
|
|
8
|
+
lat: number;
|
|
9
|
+
lng: number;
|
|
10
|
+
}
|
|
11
|
+
export interface Address {
|
|
12
|
+
street: string;
|
|
13
|
+
number: string;
|
|
14
|
+
postal: string;
|
|
15
|
+
city: string;
|
|
16
|
+
country: string;
|
|
17
|
+
}
|
|
18
|
+
export declare enum CouponViewType {
|
|
19
|
+
CAROUSEL = "carousel",
|
|
20
|
+
NORMAL = "normal",
|
|
21
|
+
IMAGE = "image"
|
|
22
|
+
}
|
|
23
|
+
export interface Coupon {
|
|
24
|
+
id: string;
|
|
25
|
+
img: string;
|
|
26
|
+
viewType?: CouponViewType;
|
|
27
|
+
size?: "md" | "lg";
|
|
28
|
+
price?: number;
|
|
29
|
+
name?: string;
|
|
30
|
+
endDate?: string;
|
|
31
|
+
timeToEnd?: any;
|
|
32
|
+
}
|
|
33
|
+
export interface Language {
|
|
34
|
+
label: string;
|
|
35
|
+
key: string;
|
|
36
|
+
icon: any;
|
|
37
|
+
}
|
|
38
|
+
export type StringBoolean = "true" | "false";
|
|
39
|
+
export declare enum EProductKind {
|
|
40
|
+
GROUP = "3e/group",
|
|
41
|
+
PRODUCT = "3e/product",
|
|
42
|
+
CATEGORY = "3e/group/category",
|
|
43
|
+
OPTIONS = "3e/group/options",
|
|
44
|
+
CONFIG = "3e/group/config",
|
|
45
|
+
STATIC = "3e/static",
|
|
46
|
+
REF = "3e/ref",
|
|
47
|
+
QUERY = "3e/query"
|
|
48
|
+
}
|
|
49
|
+
export declare enum EProductKindBucket {
|
|
50
|
+
GROUP = "group",
|
|
51
|
+
PRODUCT = "product"
|
|
52
|
+
}
|
|
53
|
+
export type Literals = {
|
|
54
|
+
description?: string;
|
|
55
|
+
name: string;
|
|
56
|
+
fiscal?: string;
|
|
57
|
+
"target-product-id"?: string;
|
|
58
|
+
};
|
|
59
|
+
export type Media = {
|
|
60
|
+
url: string;
|
|
61
|
+
name: string;
|
|
62
|
+
};
|
|
63
|
+
export type Availability = {
|
|
64
|
+
MON?: [string, string];
|
|
65
|
+
TUE?: [string, string];
|
|
66
|
+
WED?: [string, string];
|
|
67
|
+
THU?: [string, string];
|
|
68
|
+
FRI?: [string, string];
|
|
69
|
+
SAT?: [string, string];
|
|
70
|
+
SUN?: [string, string];
|
|
71
|
+
};
|
|
72
|
+
export type Product = {
|
|
73
|
+
availability?: Availability;
|
|
74
|
+
details?: {
|
|
75
|
+
literals?: Literals;
|
|
76
|
+
media?: Media[];
|
|
77
|
+
};
|
|
78
|
+
filter?: any;
|
|
79
|
+
fltCtx?: any;
|
|
80
|
+
id: string;
|
|
81
|
+
img?: string;
|
|
82
|
+
items?: Product[];
|
|
83
|
+
kind: EProductKind | EProductKindBucket;
|
|
84
|
+
literals?: Literals;
|
|
85
|
+
price: string;
|
|
86
|
+
minPrice?: string;
|
|
87
|
+
quantity: string;
|
|
88
|
+
vat: string;
|
|
89
|
+
state?: ProductConfig;
|
|
90
|
+
selCtx: string;
|
|
91
|
+
};
|
|
92
|
+
export type ProductConfig = {
|
|
93
|
+
selected: any;
|
|
94
|
+
filter: any;
|
|
95
|
+
};
|
|
96
|
+
export interface Category {
|
|
97
|
+
id: string;
|
|
98
|
+
name: string;
|
|
99
|
+
}
|
|
100
|
+
export interface SaleChannel {
|
|
101
|
+
active?: boolean;
|
|
102
|
+
minDeliveryTime?: string;
|
|
103
|
+
minOrderValue?: string;
|
|
104
|
+
week?: Availability;
|
|
105
|
+
}
|
|
106
|
+
declare enum EChannelName {
|
|
107
|
+
DINE_IN = "DINE_IN",
|
|
108
|
+
TAKE_AWAY = "TAKE_AWAY",
|
|
109
|
+
DELIVERY = "DELIVERY",
|
|
110
|
+
GLOVO_DELIVERY = "GLOVO_DELIVERY",
|
|
111
|
+
JUSTEAT_DELIVERY = "JUSTEAT_DELIVERY",
|
|
112
|
+
UBER_DELIVERY = "UBER_DELIVERY",
|
|
113
|
+
BOLT_DELIVERY = "BOLT_DELIVERY",
|
|
114
|
+
WOLT_DELIVERY = "WOLT_DELIVERY"
|
|
115
|
+
}
|
|
116
|
+
export interface VenueConfig {
|
|
117
|
+
active: boolean;
|
|
118
|
+
address: {
|
|
119
|
+
city: string;
|
|
120
|
+
country: string;
|
|
121
|
+
number: string;
|
|
122
|
+
postal: string;
|
|
123
|
+
street: string;
|
|
124
|
+
};
|
|
125
|
+
channelConstraints: Partial<Record<EChannelName, SaleChannel>>;
|
|
126
|
+
device: Record<string, Record<string, string>>;
|
|
127
|
+
extra: Record<string, string>;
|
|
128
|
+
geoPosition: GeoPosition;
|
|
129
|
+
id: string;
|
|
130
|
+
menu: string;
|
|
131
|
+
name: string;
|
|
132
|
+
sync: boolean;
|
|
133
|
+
tempDisabled: boolean;
|
|
134
|
+
timeZone: string;
|
|
135
|
+
warehouse: string;
|
|
136
|
+
}
|
|
137
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export var CouponViewType;
|
|
2
|
+
(function (CouponViewType) {
|
|
3
|
+
CouponViewType["CAROUSEL"] = "carousel";
|
|
4
|
+
CouponViewType["NORMAL"] = "normal";
|
|
5
|
+
CouponViewType["IMAGE"] = "image";
|
|
6
|
+
})(CouponViewType || (CouponViewType = {}));
|
|
7
|
+
export var EProductKind;
|
|
8
|
+
(function (EProductKind) {
|
|
9
|
+
EProductKind["GROUP"] = "3e/group";
|
|
10
|
+
EProductKind["PRODUCT"] = "3e/product";
|
|
11
|
+
EProductKind["CATEGORY"] = "3e/group/category";
|
|
12
|
+
EProductKind["OPTIONS"] = "3e/group/options";
|
|
13
|
+
EProductKind["CONFIG"] = "3e/group/config";
|
|
14
|
+
EProductKind["STATIC"] = "3e/static";
|
|
15
|
+
EProductKind["REF"] = "3e/ref";
|
|
16
|
+
EProductKind["QUERY"] = "3e/query";
|
|
17
|
+
})(EProductKind || (EProductKind = {}));
|
|
18
|
+
export var EProductKindBucket;
|
|
19
|
+
(function (EProductKindBucket) {
|
|
20
|
+
EProductKindBucket["GROUP"] = "group";
|
|
21
|
+
EProductKindBucket["PRODUCT"] = "product";
|
|
22
|
+
})(EProductKindBucket || (EProductKindBucket = {}));
|
|
23
|
+
var EChannelName;
|
|
24
|
+
(function (EChannelName) {
|
|
25
|
+
EChannelName["DINE_IN"] = "DINE_IN";
|
|
26
|
+
EChannelName["TAKE_AWAY"] = "TAKE_AWAY";
|
|
27
|
+
EChannelName["DELIVERY"] = "DELIVERY";
|
|
28
|
+
EChannelName["GLOVO_DELIVERY"] = "GLOVO_DELIVERY";
|
|
29
|
+
// GLOVO_TAKE_AWAY = "GLOVO_TAKE_AWAY",
|
|
30
|
+
EChannelName["JUSTEAT_DELIVERY"] = "JUSTEAT_DELIVERY";
|
|
31
|
+
// JUSTEAT_TAKE_AWAY = "JUSTEAT_TAKE_AWAY",
|
|
32
|
+
EChannelName["UBER_DELIVERY"] = "UBER_DELIVERY";
|
|
33
|
+
// UBER_TAKE_AWAY = "UBER_TAKE_AWAY",
|
|
34
|
+
// UBER_DINE_IN = "UBER_DINE_IN",
|
|
35
|
+
EChannelName["BOLT_DELIVERY"] = "BOLT_DELIVERY";
|
|
36
|
+
// BOLT_TAKE_AWAY = "BOLT_TAKE_AWAY",
|
|
37
|
+
EChannelName["WOLT_DELIVERY"] = "WOLT_DELIVERY";
|
|
38
|
+
// WOLT_TAKE_AWAY = "WOLT_TAKE_AWAY",
|
|
39
|
+
// WOLT_DINE_IN = "WOLT_DINE_IN"
|
|
40
|
+
})(EChannelName || (EChannelName = {}));
|
package/package.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orderingstack/ordering-types",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Typescript types for @orderingstack",
|
|
5
|
-
"types": "index.d.ts",
|
|
6
|
-
"main":"index.
|
|
5
|
+
"types": "dist/esm/index.d.ts",
|
|
6
|
+
"main": "dist/cjs/index.js",
|
|
7
|
+
"module": "dist/esm/index.js",
|
|
7
8
|
"files": [
|
|
8
|
-
"
|
|
9
|
+
"dist/"
|
|
9
10
|
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc -p tsconfig.json && tsc -p tsconfig-cjs.json",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
10
15
|
"author": "Tomasz Rojek <tomasz.rojek@e3.pl>",
|
|
11
16
|
"devDependencies": {
|
|
12
17
|
"typescript": "next"
|