@open-tender/types 0.0.136 → 0.1.1

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/.DS_Store ADDED
Binary file
Binary file
@@ -1,15 +1,16 @@
1
1
  import { AuthType } from '../global';
2
- export interface AnnouncementImage {
3
- type: 'LARGE_IMAGE' | 'SMALL_IMAGE' | 'APP_IMAGE' | 'IMAGE' | 'SECONDARY_IMAGE' | 'FEATURED_IMAGE';
2
+ export interface ContentImage {
3
+ type: 'SECONDARY_IMAGE' | 'FEATURED_IMAGE';
4
4
  url: string | null;
5
5
  }
6
+ export declare type ContentImages = ContentImage[];
6
7
  export interface Announcement {
7
8
  announcement_id: number;
8
9
  display_order: number;
9
10
  hide_text: boolean;
10
11
  hide_text_mobile: boolean;
11
12
  horizontal: string;
12
- images: Array<AnnouncementImage>;
13
+ images: ContentImages;
13
14
  overlay_color: string;
14
15
  overlay_opacity: number;
15
16
  show_overlay: boolean;
@@ -1,87 +1,68 @@
1
- import { Favorite } from './favorite';
2
1
  import { NutritionalInfo } from './menu';
3
- export interface GuestItem {
4
- cart_guest_id?: number | null;
5
- customer_id?: number | null;
6
- made_for: string | null;
7
- notes: string | null;
8
- }
9
2
  export interface CartItemOption {
10
- id: number;
11
- name: string;
12
- shortName: string;
3
+ allergens: string[];
4
+ cals: number | null;
13
5
  description: string | null;
6
+ groups: CartItemGroups;
7
+ id: number;
14
8
  imageUrl: string | null;
15
- allergens: string[];
16
- tags: string[];
9
+ increment: number;
17
10
  ingredients: string | null;
11
+ isDefault: boolean;
12
+ isSoldOut: boolean;
13
+ max: number;
14
+ min: number;
15
+ name: string;
18
16
  nutritionalInfo: NutritionalInfo | null;
19
- cals: number | null;
17
+ points: number | null;
20
18
  price: number;
21
- price_total?: number;
22
19
  quantity: number;
23
- isDefault?: boolean | number;
24
- increment: number;
25
- max: number;
26
- min: number;
27
- isSoldOut: boolean;
28
- points: number;
29
- totalPrice?: number;
30
- totalPoints?: number | null;
31
- totalCals?: number | null;
32
- groups?: Array<Partial<CartItemGroup>>;
20
+ shortDescription: string | null;
21
+ shortName: string;
22
+ slug: string;
23
+ tags: string[];
24
+ totalCals: number | null;
25
+ totalPoints: number | null;
26
+ totalPrice: number | null;
27
+ }
28
+ export interface CartItemOptionWithIndex extends CartItemOption {
29
+ index: number;
30
+ }
31
+ export interface CartItem extends Omit<CartItemOption, 'isDefault'> {
32
+ cartGuestId: number | null;
33
+ customerId: number | null;
34
+ index?: number;
35
+ madeFor: string | null;
36
+ notes: string | null;
37
+ signature?: string;
38
+ similarItems: number[];
39
+ upsellItems: number[];
33
40
  }
34
- export declare type CartItemOptions = Array<Partial<CartItemOption>>;
41
+ export declare type CartItemOptions = CartItemOption[];
35
42
  export interface CartItemGroup {
36
- id: number;
37
- name: string;
38
43
  description: string | null;
44
+ id: number;
39
45
  imageUrl: string | null;
40
46
  included: number;
47
+ isPizza: boolean;
48
+ isSize: boolean;
41
49
  max: number;
42
50
  min: number;
43
- isSize: boolean;
51
+ name: string;
44
52
  options: CartItemOptions;
45
- inc?: number;
46
- is_size?: boolean;
47
- short_name: string;
48
53
  quantity?: number;
49
- isPizza?: boolean;
50
54
  }
51
- export declare type CartItemGroups = Array<Partial<CartItemGroup>>;
52
- export interface CartItem {
53
- index?: number;
54
- id: number;
55
- name: string;
56
- shortName: string;
57
- cart_guest_id?: number | null;
58
- category: string;
59
- customer_id?: number | null;
60
- description: string | null;
61
- imageUrl: string | null;
62
- slug: string;
63
- allergens: string[];
64
- tags: string[];
65
- ingredients: string | null;
66
- madeFor?: string | null;
67
- notes?: string | null;
68
- nutritionalInfo: NutritionalInfo | null;
69
- cals: number | null;
70
- groups: CartItemGroups;
71
- quantity: number;
72
- price: number;
73
- increment: number;
74
- max: number;
75
- min: number;
76
- points: number | null;
77
- upsellItems: number[];
78
- similarItems: number[];
79
- totalPrice: number;
80
- totalPoints: number | null;
81
- totalCals: number | null;
82
- favorite: Favorite;
83
- isSoldOut?: boolean;
84
- signature?: string;
85
- }
86
- export declare type Cart = Array<CartItem>;
55
+ export declare type CartItemGroups = CartItemGroup[];
56
+ export declare type Cart = CartItem[];
57
+ export declare type CartLevels = number[][];
87
58
  export declare type CartCounts = Record<string, number>;
59
+ export declare type CartItemOptionLookup = Record<string, CartItemOption>;
60
+ export declare type CartItemGroupLookupOptions = Omit<CartItemGroup, 'options'> & {
61
+ options: CartItemOptionLookup;
62
+ };
63
+ export declare type CartItemGroupLookup = Record<string, CartItemGroupLookupOptions>;
64
+ export interface PosCartItem extends CartItem {
65
+ item_no: number;
66
+ line_no: number;
67
+ }
68
+ export declare type PosCart = PosCartItem[];
@@ -37,21 +37,30 @@ export interface CustomerCheckout {
37
37
  export interface SimpleCartOption {
38
38
  id: number;
39
39
  quantity: number;
40
+ groups: SimpleCartGroups;
40
41
  }
41
42
  export interface SimpleCartGroup {
42
43
  id: number;
43
- options: Array<SimpleCartOption>;
44
+ options: SimpleCartOption[];
44
45
  }
46
+ export declare type SimpleCartGroups = SimpleCartGroup[];
45
47
  export interface SimpleCartItem {
46
48
  id: number;
47
49
  quantity: number;
48
- groups?: Array<SimpleCartGroup>;
50
+ groups: SimpleCartGroups;
49
51
  made_for?: string;
50
52
  notes?: string;
51
53
  cart_guest_id?: number;
52
54
  customer_id?: number;
53
55
  }
54
- export declare type SimpleCart = Array<SimpleCartItem>;
56
+ export declare type SimpleCart = SimpleCartItem[];
57
+ export interface SimpleCartLookupOption {
58
+ quantity: number;
59
+ groupsLookup: Record<string, SimpleCartLookupGroup> | null;
60
+ }
61
+ export interface SimpleCartLookupGroup {
62
+ options: Record<string, SimpleCartLookupOption>;
63
+ }
55
64
  export interface OrderCreateDetails {
56
65
  eating_utensils?: boolean;
57
66
  serving_utensils?: boolean;
@@ -1,39 +1,36 @@
1
1
  import { ISOString } from '../../datetimes';
2
2
  import { ServiceType } from '../../global';
3
- import { RequestErrorAPI, RequestStatus } from '../../request';
4
- import { OrderItem, OrderRevenueCenter } from '../order';
3
+ import { SimpleCart } from '../checkout';
5
4
  import { Address } from './addresses';
6
5
  export interface CartOwner {
7
6
  customer_id: number;
8
7
  first_name: string;
9
8
  last_name: string;
10
9
  }
10
+ export interface GroupOrderGuest {
11
+ cart_guest_id: number;
12
+ cart_id: number;
13
+ first_name: string;
14
+ last_name: string;
15
+ }
16
+ export declare type GroupOrderGuests = GroupOrderGuest[];
11
17
  export interface GroupOrder {
12
- order_id?: string | null;
13
- address?: Address | null;
14
- cart: Array<OrderItem>;
15
- cartGuest?: any;
16
- cartGuests?: any;
17
- cart_guests: any;
18
+ address: Address | null;
19
+ cart: SimpleCart;
20
+ cart_guests?: GroupOrderGuests;
18
21
  cart_id: number;
19
- cartOwner?: CartOwner;
20
- customer?: CartOwner;
21
22
  closed: boolean;
22
- cutoff_at: string;
23
- error?: RequestErrorAPI;
23
+ customer?: CartOwner;
24
+ cutoff_at: string | null;
24
25
  guest_count: number;
25
- guest_limit: number;
26
- isCartOwner: boolean;
27
- loading?: RequestStatus;
28
- requested_at: ISOString;
29
- revenue_center?: OrderRevenueCenter;
26
+ guest_limit: number | null;
27
+ requested_at: ISOString | 'asap';
30
28
  revenue_center_id: number;
31
29
  service_type: ServiceType;
32
- spending_limit: string;
30
+ spending_limit: string | null;
33
31
  token: string;
34
- spendingLimit: string;
35
32
  }
36
- export declare type GroupOrders = Array<GroupOrder>;
33
+ export declare type GroupOrders = GroupOrder[];
37
34
  export interface GroupOrderTime {
38
35
  isAdjusted: boolean;
39
36
  firstIso: ISOString;
@@ -1,98 +1,12 @@
1
1
  import { ISOStringOffset } from '../datetimes';
2
- import { Decimal, Temperature } from '../global';
3
- import { NutritionalInfo } from './menu';
4
- export interface FavoriteCartOption {
5
- id: number;
6
- quantity: number;
7
- }
8
- export interface FavoriteCartGroup {
9
- id: number;
10
- options: Array<FavoriteCartOption>;
11
- }
12
- export interface FavoriteCartItem {
13
- id: number;
14
- made_for?: string;
15
- notes?: string;
16
- quantity?: string;
17
- }
18
- export declare type FavoriteCart = Array<FavoriteCartItem>;
19
- export interface FavoriteItemImage {
20
- type: 'LARGE_IMAGE' | 'SMALL_IMAGE' | 'APP_IMAGE';
21
- url: string | null;
22
- }
23
- export interface FavoriteItemNutritionalInfo {
24
- calories: Decimal;
25
- cholesterol: Decimal;
26
- dietary_fiber: Decimal;
27
- protein: Decimal;
28
- saturated_fat: Decimal;
29
- serving_size: Decimal;
30
- sodium: Decimal;
31
- sugars: Decimal;
32
- total_carbs: Decimal;
33
- total_fat: Decimal;
34
- trans_fat: Decimal;
35
- }
36
- export interface FavoriteItemGroup {
37
- id: number;
38
- inc?: number;
39
- is_size?: boolean;
40
- max?: number;
41
- min?: number;
42
- name?: string;
43
- options: Array<Partial<FavoriteItem>>;
44
- short_name?: string;
45
- }
46
- export interface FavoriteItem {
47
- allergens: Array<string>;
48
- description: string;
49
- groups?: Array<Partial<FavoriteItemGroup>>;
50
- id: number;
51
- images: Array<FavoriteItemImage>;
52
- ingredients: string | null;
53
- made_for?: string;
54
- name: string;
55
- notes?: string;
56
- nutritional_info?: FavoriteItemNutritionalInfo | null;
57
- points?: number | null;
58
- quantity?: number;
59
- short_description: string | null;
60
- tags: Array<string>;
61
- temperature: Temperature;
62
- index?: number;
63
- shortName?: string;
64
- cart_guest_id?: number | null;
65
- category: string | null;
66
- customer_id?: number | null;
67
- imageUrl: string | null;
68
- slug: string;
69
- madeFor?: string | null;
70
- nutritionalInfo: NutritionalInfo | null;
71
- cals: number | null;
72
- price: number;
73
- increment: number;
74
- max: number;
75
- min: number;
76
- upsellItems: number[];
77
- similarItems: number[];
78
- totalPrice: number;
79
- totalPoints: number | null;
80
- totalCals: number | null;
81
- item_no?: number;
82
- price_total?: number;
83
- favorite_id?: number;
84
- shortDescription?: string;
85
- signature?: string;
86
- isDefault?: boolean | number;
87
- isSoldOut?: boolean;
88
- favorite?: Favorite;
89
- }
2
+ import { SimpleCartItem } from './checkout';
3
+ import { OrderItem } from './order';
90
4
  export interface Favorite {
91
5
  added_at: ISOStringOffset;
92
- cart: FavoriteCart;
93
- favorite_id?: number;
94
- item: Partial<FavoriteItem>;
6
+ cart: SimpleCartItem;
7
+ favorite_id: number;
8
+ item: OrderItem;
95
9
  name: string | null;
96
10
  updated_at: ISOStringOffset;
97
11
  }
98
- export declare type Favorites = Array<Favorite>;
12
+ export declare type Favorites = Favorite[];
@@ -1,8 +1,5 @@
1
1
  import { RequestedAt } from '../datetimes';
2
2
  import { Decimal, Money, ServiceType, TaxTypeInt, Temperature } from '../global';
3
- import { CartItemGroups } from './cart';
4
- import { Favorite } from './favorite';
5
- import { OrderItemImages } from './order';
6
3
  export interface NutritionalInfo {
7
4
  calories: number;
8
5
  cholesterol: number;
@@ -16,6 +13,18 @@ export interface NutritionalInfo {
16
13
  total_fat: number;
17
14
  trans_fat: number;
18
15
  }
16
+ export interface NutritionalInfoCalcs extends Record<string, number> {
17
+ calories: number;
18
+ cholesterol: number;
19
+ dietary_fiber: number;
20
+ protein: number;
21
+ saturated_fat: number;
22
+ sodium: number;
23
+ sugars: number;
24
+ total_carbs: number;
25
+ total_fat: number;
26
+ trans_fat: number;
27
+ }
19
28
  export declare type NutritionalInfoWithEmpty = NutritionalInfo | Record<string, never> | null;
20
29
  export interface MenuItemSize {
21
30
  name: string;
@@ -34,120 +43,66 @@ export interface MenuItemGroup {
34
43
  description: string | null;
35
44
  id: number;
36
45
  included_options: number;
46
+ is_pizza: boolean;
37
47
  is_size: boolean;
38
- is_upsell: boolean;
39
48
  large_image_url: string | null;
40
49
  max_options: number;
41
50
  menu_position: number;
42
51
  min_options: number;
43
52
  name: string;
44
- option_items: Array<OptionItem>;
53
+ option_items: OptionItem[];
54
+ pos_display_color: string | null;
45
55
  short_name: string;
46
56
  slug: string;
47
57
  small_image_url: string | null;
48
58
  }
49
- export declare type MenuItemGroups = Array<MenuItemGroup>;
50
- export interface Item {
51
- allergen_classes: string;
52
- allergens: string | string[];
59
+ export declare type MenuItemGroups = MenuItemGroup[];
60
+ export interface MenuItem {
61
+ allergens: string | null;
53
62
  app_image_url: string | null;
54
- color?: string | null;
55
- delivery_days: number | null;
63
+ calories: number | null;
56
64
  description: string | null;
57
- end_date: number | null;
58
- end_date_str: string | null;
59
- height: string | null;
60
- id?: number;
65
+ dimensions: number[] | null;
66
+ featured_position: number | null;
67
+ id: number;
61
68
  increment: number;
62
69
  ingredients: string | null;
63
70
  is_alcohol: boolean;
64
71
  item_id: number;
65
72
  large_image_url: string | null;
66
- length: string | null;
67
73
  max_quantity: number;
68
74
  menu_position: number;
69
75
  min_quantity: number;
70
- name?: string;
76
+ name: string;
71
77
  nutritional_info: NutritionalInfo | null;
78
+ option_groups: MenuItemGroups;
72
79
  plu: string | null;
73
80
  points: number | null;
81
+ pos_display_color: string | null;
74
82
  price: Money | string;
75
83
  sales_tax_override: Decimal | null;
76
- service_restrictions: number[];
77
- short_description?: string | null;
84
+ short_description: string | null;
78
85
  short_name: string;
79
86
  shorthand: string | null;
87
+ similar_items: number[];
80
88
  slug: string;
81
89
  small_image_url: string | null;
82
- start_date: number | null;
83
- start_date_str: string | null;
84
- tag_classes: string;
85
- tags: string | string[];
90
+ suspend_until: number | null;
91
+ tags: string | null;
86
92
  taxes: MenuItemTaxes;
87
93
  temperature: Temperature;
88
- weight: string | null;
89
- width: string | null;
90
- }
91
- export interface OptionItem extends Item {
92
- group_id: number;
93
- opt_is_default: 1 | 0;
94
- serving_size: string | null;
94
+ upsell_items: number[];
95
95
  }
96
- export interface MenuItem extends Item {
97
- calories: number | null;
98
- category_id: number;
99
- category_name: string;
100
- display_options: number;
101
- has_upsell: boolean;
102
- option_groups: MenuItemGroups;
103
- similar_items: number[] | null;
104
- sizes: MenuItemSizes | null;
105
- upsell_items: number[] | null;
106
- use_options_wizard: 1 | 0;
107
- favorite?: Partial<Favorite>;
108
- upsellItems: number[];
109
- index?: number;
110
- id?: number;
111
- name?: string;
112
- shortName?: string;
113
- cart_guest_id?: number | null;
114
- category: string | null;
115
- customer_id?: number | null;
116
- description: string | null;
117
- imageUrl: string | null;
118
- slug: string;
119
- allergens: string[];
120
- tags: string[];
121
- ingredients: string | null;
122
- madeFor?: string | null;
123
- notes?: string | null;
124
- nutritionalInfo: NutritionalInfo | null;
125
- cals: number | null;
126
- groups: CartItemGroups;
127
- quantity: number;
128
- price: string;
129
- increment: number;
130
- max: number;
131
- min: number;
132
- points: any;
133
- similarItems: number[];
134
- totalPrice: number;
135
- totalPoints: number | null;
136
- totalCals: number | null;
137
- item_no?: number;
138
- nutritional_info: NutritionalInfo | null;
139
- price_total?: number;
140
- favorite_id?: number;
141
- images?: OrderItemImages;
142
- short_description?: string | null;
143
- shortDescription?: string;
144
- made_for?: string;
145
- signature?: string;
146
- isDefault?: boolean | number;
147
- isSoldOut?: boolean;
96
+ export interface OptionItem extends MenuItem {
97
+ opt_is_default: boolean;
148
98
  }
149
- export declare type MenuItems = Array<MenuItem>;
99
+ export declare type MenuItems = MenuItem[];
150
100
  export declare type MenuCategoryAppearance = 'small' | 'medium' | 'large';
101
+ export interface MenuCategoryPos {
102
+ section_id: number | null;
103
+ color: string | null;
104
+ order: number | null;
105
+ }
151
106
  export interface MenuCategory {
152
107
  app_image_url: string | null;
153
108
  appearance: MenuCategoryAppearance;
@@ -156,17 +111,17 @@ export interface MenuCategory {
156
111
  id: number;
157
112
  items: MenuItems;
158
113
  large_image_url: string | null;
114
+ menu_name: string;
115
+ menu_name_id: number;
116
+ menu_position: number;
159
117
  name: string;
160
- pos_display_color: string;
161
- pos_display_order: number;
162
- pos_section_id: number;
163
- position: number;
118
+ pos: MenuCategoryPos | null;
164
119
  revenue_center_id: number | null;
165
120
  short_name: string;
166
121
  slug: string;
167
122
  small_image_url: string | null;
168
123
  }
169
- export declare type MenuCategories = Array<MenuCategory>;
124
+ export declare type MenuCategories = MenuCategory[];
170
125
  export interface Menu {
171
126
  menu: MenuCategories;
172
127
  service_type: ServiceType;