@matochmat/api-client 1.3.3 → 1.3.4
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/index.cjs.js.map +1 -0
- package/{src/index.ts → dist/index.d.ts} +0 -2
- package/dist/index.esm.js +7 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/v2/baseResponse.d.ts +21 -0
- package/dist/v2/cateringFunctionality.d.ts +39 -0
- package/dist/v2/city.d.ts +102 -0
- package/dist/v2/cityUploadConnection.d.ts +11 -0
- package/dist/v2/cityUploadGrouping.d.ts +3 -0
- package/dist/v2/crawlingConfiguration.d.ts +55 -0
- package/dist/v2/crawlingConfigurationTextContentStrategyType.d.ts +30 -0
- package/dist/v2/date.d.ts +29 -0
- package/dist/v2/day.d.ts +47 -0
- package/dist/v2/deliveryInfo.d.ts +46 -0
- package/dist/v2/dinnerFunctionality.d.ts +47 -0
- package/dist/v2/foodItem.d.ts +22 -0
- package/dist/v2/geodata.d.ts +39 -0
- package/dist/v2/integrationV1Configuration.d.ts +38 -0
- package/dist/v2/integrationV2Configuration.d.ts +42 -0
- package/dist/v2/lunchBoxFunctionality.d.ts +31 -0
- package/dist/v2/lunchDish.d.ts +2 -0
- package/dist/v2/lunchFunctionality.d.ts +59 -0
- package/dist/v2/lunchMenu.d.ts +34 -0
- package/dist/v2/month.d.ts +22 -0
- package/dist/v2/monthSet.d.ts +11 -0
- package/dist/v2/openingHour.d.ts +50 -0
- package/dist/v2/restaurant.d.ts +162 -0
- package/dist/v2/restaurantFunctionalityType.d.ts +25 -0
- package/dist/v2/restaurantUploadConnection.d.ts +19 -0
- package/dist/v2/restaurantUploadGrouping.d.ts +3 -0
- package/dist/v2/tableBooking.d.ts +54 -0
- package/dist/v2/takeAway.d.ts +46 -0
- package/dist/v2/upload.d.ts +34 -0
- package/dist/v2/uploadConnection.d.ts +18 -0
- package/dist/v2/uploadGrouping.d.ts +11 -0
- package/dist/v2/version.d.ts +31 -0
- package/dist/v2/week.d.ts +34 -0
- package/dist/v2/year.d.ts +22 -0
- package/dist/v2/yearSet.d.ts +11 -0
- package/package.json +2 -2
- package/src/v2/baseResponse.ts +0 -25
- package/src/v2/cateringFunctionality.ts +0 -48
- package/src/v2/city.ts +0 -126
- package/src/v2/cityUploadConnection.ts +0 -14
- package/src/v2/cityUploadGrouping.ts +0 -4
- package/src/v2/crawlingConfiguration.ts +0 -68
- package/src/v2/crawlingConfigurationTextContentStrategyType.ts +0 -37
- package/src/v2/date.ts +0 -36
- package/src/v2/day.ts +0 -58
- package/src/v2/deliveryInfo.ts +0 -57
- package/src/v2/dinnerFunctionality.ts +0 -58
- package/src/v2/foodItem.ts +0 -27
- package/src/v2/geodata.ts +0 -48
- package/src/v2/integrationV1Configuration.ts +0 -47
- package/src/v2/integrationV2Configuration.ts +0 -52
- package/src/v2/lunchBoxFunctionality.ts +0 -38
- package/src/v2/lunchDish.ts +0 -3
- package/src/v2/lunchFunctionality.ts +0 -73
- package/src/v2/lunchMenu.ts +0 -42
- package/src/v2/month.ts +0 -27
- package/src/v2/monthSet.ts +0 -14
- package/src/v2/openingHour.ts +0 -62
- package/src/v2/restaurant.ts +0 -199
- package/src/v2/restaurantFunctionalityType.ts +0 -30
- package/src/v2/restaurantUploadConnection.ts +0 -24
- package/src/v2/restaurantUploadGrouping.ts +0 -4
- package/src/v2/tableBooking.ts +0 -67
- package/src/v2/takeAway.ts +0 -57
- package/src/v2/upload.ts +0 -42
- package/src/v2/uploadConnection.ts +0 -22
- package/src/v2/uploadGrouping.ts +0 -14
- package/src/v2/version.ts +0 -41
- package/src/v2/week.ts +0 -44
- package/src/v2/year.ts +0 -27
- package/src/v2/yearSet.ts +0 -14
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ApiV2BaseResponseType } from '../v2/baseResponse';
|
|
2
|
+
import type { ApiV2LunchDishType } from '../v2/lunchDish';
|
|
3
|
+
import type { ApiV2OpeningHourType } from '../v2/openingHour';
|
|
4
|
+
import type { ApiV2RestaurantFunctionalityType } from '../v2/restaurantFunctionalityType';
|
|
5
|
+
/**
|
|
6
|
+
* Type for the individual array items in v2 of the API for the lunch functionality endpoint.
|
|
7
|
+
*/
|
|
8
|
+
export type ApiV2LunchFunctionalityType = ApiV2RestaurantFunctionalityType & {
|
|
9
|
+
/**
|
|
10
|
+
* Controls whether or not the restaurant has bonus stamps active.
|
|
11
|
+
*/
|
|
12
|
+
bonusStampsActive: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Text entered by the restaurant concerning which-if any-special conditions apply for getting bonus stamps.
|
|
15
|
+
*/
|
|
16
|
+
bonusStampsConditionsText: string;
|
|
17
|
+
/**
|
|
18
|
+
* Date when the restaurant should be displayed as the daily lunch tip.
|
|
19
|
+
*/
|
|
20
|
+
dailyLunchTipDate: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Date when the restaurant would've been displayed as the daily lunch tip but was intentionally skipped.
|
|
23
|
+
*/
|
|
24
|
+
dailyLunchTipSkippedDate: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Default lunch menu data.
|
|
27
|
+
*/
|
|
28
|
+
lunchDefault: ApiV2LunchDishType[];
|
|
29
|
+
/**
|
|
30
|
+
* Text shown above the menu to provide generic information not directly related to the dishes themselves.
|
|
31
|
+
*/
|
|
32
|
+
menuText: string;
|
|
33
|
+
/**
|
|
34
|
+
* List of opening hours for the lunch.
|
|
35
|
+
*/
|
|
36
|
+
openingHourList: {
|
|
37
|
+
items: ApiV2OpeningHourType[];
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Styling (CSS code) for the PDF menus.
|
|
41
|
+
*/
|
|
42
|
+
pdfStyling: string;
|
|
43
|
+
/**
|
|
44
|
+
* Template (HTML code and custom shortcodes) for custom daily PDF menus.
|
|
45
|
+
*/
|
|
46
|
+
pdfTemplateDaily: string;
|
|
47
|
+
/**
|
|
48
|
+
* Template (HTML code and custom shortcodes) for custom weekly PDF menus.
|
|
49
|
+
*/
|
|
50
|
+
pdfTemplateWeekly: string;
|
|
51
|
+
/**
|
|
52
|
+
* Type of PDF menus.
|
|
53
|
+
*/
|
|
54
|
+
pdfTypeId: number;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* The API response type for lunch functionality.
|
|
58
|
+
*/
|
|
59
|
+
export type ApiV2LunchFunctionalityResponseType = ApiV2BaseResponseType<ApiV2LunchFunctionalityType[], number>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ApiV2BaseResponseType } from '../v2/baseResponse';
|
|
2
|
+
/**
|
|
3
|
+
* Type for the individual array items in v2 of the API for the non-normalized lunch menu endpoint.
|
|
4
|
+
*/
|
|
5
|
+
export type ApiV2LunchMenuType = {
|
|
6
|
+
/**
|
|
7
|
+
* The actual food contents of the lunch menu as a JSON string.
|
|
8
|
+
*/
|
|
9
|
+
content: string;
|
|
10
|
+
/**
|
|
11
|
+
* Keeps track of whether or not the menu is a default menu.
|
|
12
|
+
*/
|
|
13
|
+
isDefaultMenu: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Timestamp of when the menu was last updated.
|
|
16
|
+
*/
|
|
17
|
+
lastUpdated: string;
|
|
18
|
+
/**
|
|
19
|
+
* ID of the restaurant that the menu belongs to.
|
|
20
|
+
*/
|
|
21
|
+
restaurantId: number;
|
|
22
|
+
/**
|
|
23
|
+
* Week the lunch menu is relevant for.
|
|
24
|
+
*/
|
|
25
|
+
week: number;
|
|
26
|
+
/**
|
|
27
|
+
* Year the lunch menu is relevant for.
|
|
28
|
+
*/
|
|
29
|
+
year: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The API response type for the non-normalized lunch menus.
|
|
33
|
+
*/
|
|
34
|
+
export type ApiV2LunchMenuResponseType = ApiV2BaseResponseType<ApiV2LunchMenuType[], number>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type ApiV2MonthType = {
|
|
2
|
+
/**
|
|
3
|
+
* Index of the year.
|
|
4
|
+
*/
|
|
5
|
+
index: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
|
|
6
|
+
/**
|
|
7
|
+
* Name of the month.
|
|
8
|
+
*/
|
|
9
|
+
name: 'Januari' | 'Februari' | 'Mars' | 'April' | 'Maj' | 'Juni' | 'Juli' | 'Augusti' | 'September' | 'Oktober' | 'November' | 'December';
|
|
10
|
+
/**
|
|
11
|
+
* Number of the year.
|
|
12
|
+
*/
|
|
13
|
+
number: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
14
|
+
/**
|
|
15
|
+
* Short name.
|
|
16
|
+
*/
|
|
17
|
+
shortName: 'Jan' | 'Feb' | 'Mar' | 'Apr' | 'Maj' | 'Jun' | 'Jul' | 'Aug' | 'Sep' | 'Okt' | 'Nov' | 'Dec';
|
|
18
|
+
/**
|
|
19
|
+
* Machine readable name.
|
|
20
|
+
*/
|
|
21
|
+
slug: 'januari' | 'februari' | 'mars' | 'april' | 'maj' | 'juni' | 'juli' | 'augusti' | 'september' | 'oktober' | 'november' | 'december';
|
|
22
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ApiV2BaseResponseType } from '../v2/baseResponse';
|
|
2
|
+
/**
|
|
3
|
+
* Type for the individual array items in v2 of the API for the opening hour endpoint.
|
|
4
|
+
*/
|
|
5
|
+
export type ApiV2OpeningHourType = {
|
|
6
|
+
/**
|
|
7
|
+
* Time of day when the restaurant closes.
|
|
8
|
+
*/
|
|
9
|
+
closingTime: string;
|
|
10
|
+
/**
|
|
11
|
+
* String representation of when the entity was created.
|
|
12
|
+
*/
|
|
13
|
+
created: string;
|
|
14
|
+
/**
|
|
15
|
+
* ID of the dinner functionality object the opening hour is relevant for, or null if this specific opening hour os connected to a different object type.
|
|
16
|
+
*/
|
|
17
|
+
dinnerFunctionalityId: number | null;
|
|
18
|
+
/**
|
|
19
|
+
* Unique ID for the entity.
|
|
20
|
+
*/
|
|
21
|
+
id: number;
|
|
22
|
+
/**
|
|
23
|
+
* Day of the week the opening hours are relevant for. This is ISO (not american) weekday number (not index).
|
|
24
|
+
*/
|
|
25
|
+
isoWeekdayNumber: number;
|
|
26
|
+
/**
|
|
27
|
+
* String representation of the last time the entity was updated.
|
|
28
|
+
*/
|
|
29
|
+
lastUpdated: string;
|
|
30
|
+
/**
|
|
31
|
+
* ID of the lunch box functionality object the opening hour is relevant for, or null if this specific opening hour os connected to a different object type.
|
|
32
|
+
*/
|
|
33
|
+
lunchBoxFunctionalityId: number | null;
|
|
34
|
+
/**
|
|
35
|
+
* ID of the lunch functionality object the opening hour is relevant for, or null if this specific opening hour os connected to a different object type.
|
|
36
|
+
*/
|
|
37
|
+
lunchFunctionalityId: number | null;
|
|
38
|
+
/**
|
|
39
|
+
* Whether or not the restaurant is open on this day.
|
|
40
|
+
*/
|
|
41
|
+
open: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Time of day when the restaurant opens.
|
|
44
|
+
*/
|
|
45
|
+
openingTime: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The API response type for opening hour items.
|
|
49
|
+
*/
|
|
50
|
+
export type ApiV2OpeningHourResponseType = ApiV2BaseResponseType<ApiV2OpeningHourType[], number>;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { ApiV2BaseResponseType } from '../v2/baseResponse';
|
|
2
|
+
import type { ApiV2CateringFunctionalityType } from '../v2/cateringFunctionality';
|
|
3
|
+
import type { ApiV2CrawlingConfigurationType } from '../v2/crawlingConfiguration';
|
|
4
|
+
import type { ApiV2DeliveryInfoType } from '../v2/deliveryInfo';
|
|
5
|
+
import type { ApiV2DinnerFunctionalityType } from '../v2/dinnerFunctionality';
|
|
6
|
+
import type { ApiV2GeodataType } from '../v2/geodata';
|
|
7
|
+
import type { ApiV2LunchBoxFunctionalityType } from '../v2/lunchBoxFunctionality';
|
|
8
|
+
import type { ApiV2LunchFunctionalityType } from '../v2/lunchFunctionality';
|
|
9
|
+
import type { ApiV2RestaurantUploadGroupingType } from '../v2/restaurantUploadGrouping';
|
|
10
|
+
import type { ApiV2TableBookingType } from '../v2/tableBooking';
|
|
11
|
+
import type { ApiV2TakeAwayType } from '../v2/takeAway';
|
|
12
|
+
/**
|
|
13
|
+
* Type for the individual array items in v2 of the API for the restaurant endpoint.
|
|
14
|
+
*/
|
|
15
|
+
export type ApiV2RestaurantType = {
|
|
16
|
+
/**
|
|
17
|
+
* Text that describes the restaurant. Displays on the page to give lunch guests a bit of info and is commonly also used for page metadata.
|
|
18
|
+
*/
|
|
19
|
+
about: string;
|
|
20
|
+
/**
|
|
21
|
+
* String representation of the street address for the restaurant.
|
|
22
|
+
*/
|
|
23
|
+
address: string;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
cateringFunctionality: ApiV2CateringFunctionalityType;
|
|
28
|
+
/**
|
|
29
|
+
* City ID determining which city the restaurant belongs to.
|
|
30
|
+
*/
|
|
31
|
+
cityId: number;
|
|
32
|
+
/**
|
|
33
|
+
* A compounded rating collected from different rating sites around the web.
|
|
34
|
+
*/
|
|
35
|
+
compoundRating: number | null;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
crawlingConfiguration: ApiV2CrawlingConfigurationType;
|
|
40
|
+
/**
|
|
41
|
+
* String representation of when the restaurant was created.
|
|
42
|
+
*/
|
|
43
|
+
created: null | string;
|
|
44
|
+
/**
|
|
45
|
+
* Customer ID determining which customer the restaurant belongs to.
|
|
46
|
+
*/
|
|
47
|
+
customerId: number;
|
|
48
|
+
/**
|
|
49
|
+
* Delivery information.
|
|
50
|
+
*/
|
|
51
|
+
deliveryInfo: ApiV2DeliveryInfoType;
|
|
52
|
+
/**
|
|
53
|
+
* Background for the restaurant details page header.
|
|
54
|
+
*/
|
|
55
|
+
detailsPageHeaderBackground: ApiV2RestaurantUploadGroupingType;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
dinnerFunctionality: ApiV2DinnerFunctionalityType;
|
|
60
|
+
/**
|
|
61
|
+
* Restaurant email. Used only for displaying to lunch guests and not for sending emails from the system.
|
|
62
|
+
*/
|
|
63
|
+
email: string;
|
|
64
|
+
/**
|
|
65
|
+
* URL to the restaurant's Facebook page.
|
|
66
|
+
*/
|
|
67
|
+
facebook: string;
|
|
68
|
+
/**
|
|
69
|
+
* Geodata information to place the restaurant on the map.
|
|
70
|
+
*/
|
|
71
|
+
geodata: ApiV2GeodataType;
|
|
72
|
+
/**
|
|
73
|
+
* Unique entity ID.
|
|
74
|
+
*/
|
|
75
|
+
id: number;
|
|
76
|
+
/**
|
|
77
|
+
* URL to the restaurant's Instagram page.
|
|
78
|
+
*/
|
|
79
|
+
instagram: string;
|
|
80
|
+
/**
|
|
81
|
+
* Keywords to match against when searching. Not actually displayed on the page.
|
|
82
|
+
*/
|
|
83
|
+
keywords: string;
|
|
84
|
+
/**
|
|
85
|
+
* String representation of when the restaurant was last updated.
|
|
86
|
+
*/
|
|
87
|
+
lastUpdated: string;
|
|
88
|
+
/**
|
|
89
|
+
* Background for the restaurant logotype.
|
|
90
|
+
*/
|
|
91
|
+
logotypeBackground: ApiV2RestaurantUploadGroupingType;
|
|
92
|
+
/**
|
|
93
|
+
* Restaurant logotype info for the logotype to display on image backgrounds.
|
|
94
|
+
*/
|
|
95
|
+
logotypeForImageBackground: ApiV2RestaurantUploadGroupingType;
|
|
96
|
+
/**
|
|
97
|
+
* Restaurant logotype info for the logotype to display on white backgrounds.
|
|
98
|
+
*/
|
|
99
|
+
logotypeForWhiteBackground: ApiV2RestaurantUploadGroupingType;
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
*/
|
|
103
|
+
lunchBoxFunctionality: ApiV2LunchBoxFunctionalityType;
|
|
104
|
+
/**
|
|
105
|
+
*
|
|
106
|
+
*/
|
|
107
|
+
lunchFunctionality: ApiV2LunchFunctionalityType;
|
|
108
|
+
/**
|
|
109
|
+
* Name of the restaurant.
|
|
110
|
+
*/
|
|
111
|
+
name: string;
|
|
112
|
+
/**
|
|
113
|
+
* Text shown below or in conjunction with name to convey further information. Useful when two restaurants have the same title but are located in different places or when a restaurant has changed name (for instance "Loremrestaurangen (f.d. Ipsumrestaurangen)").
|
|
114
|
+
*/
|
|
115
|
+
nameSubtext: string;
|
|
116
|
+
/**
|
|
117
|
+
* Obfuscated unique ID. Used for legacy purposes only.
|
|
118
|
+
* @deprecated Only used for legacy support for apps and third parties. In the long run we may consider removing this.
|
|
119
|
+
* @see ID is now saved as a plain property.
|
|
120
|
+
*/
|
|
121
|
+
obfuscatedId: string;
|
|
122
|
+
/**
|
|
123
|
+
* Whether or not the restaurant is pending and awaiting approval.
|
|
124
|
+
*/
|
|
125
|
+
pending: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Phone number to the restaurant.
|
|
128
|
+
*/
|
|
129
|
+
phone: string;
|
|
130
|
+
/**
|
|
131
|
+
* Where the price range of the items the restaurant serves starts at. This is on a scale of 1 to 4.
|
|
132
|
+
*/
|
|
133
|
+
priceRangeFrom: number | null;
|
|
134
|
+
/**
|
|
135
|
+
* Where the price range of the items the restaurant serves ends at. This is on a scale of 1 to 4.
|
|
136
|
+
*/
|
|
137
|
+
priceRangeTo: number | null;
|
|
138
|
+
/**
|
|
139
|
+
* Tags the restaurant is connected to.
|
|
140
|
+
*/
|
|
141
|
+
restaurantTagIds: number[];
|
|
142
|
+
/**
|
|
143
|
+
* Machine readable name of the restaurant.
|
|
144
|
+
*/
|
|
145
|
+
slug: string;
|
|
146
|
+
/**
|
|
147
|
+
* Table booking info for the restaurant.
|
|
148
|
+
*/
|
|
149
|
+
tableBooking: ApiV2TableBookingType;
|
|
150
|
+
/**
|
|
151
|
+
* Take away info for the restaurant.
|
|
152
|
+
*/
|
|
153
|
+
takeAway: ApiV2TakeAwayType;
|
|
154
|
+
/**
|
|
155
|
+
* URL to the restaurant's own website.
|
|
156
|
+
*/
|
|
157
|
+
website: string;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* The API response type for restaurants.
|
|
161
|
+
*/
|
|
162
|
+
export type ApiV2RestaurantResponseType = ApiV2BaseResponseType<ApiV2RestaurantType[], number>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
*/
|
|
4
|
+
export type ApiV2RestaurantFunctionalityType = {
|
|
5
|
+
/**
|
|
6
|
+
* String representation of when the entity was created.
|
|
7
|
+
*/
|
|
8
|
+
created: string;
|
|
9
|
+
/**
|
|
10
|
+
* Unique ID for the entity.
|
|
11
|
+
*/
|
|
12
|
+
id: number;
|
|
13
|
+
/**
|
|
14
|
+
* String representation of the last time the entity was updated.
|
|
15
|
+
*/
|
|
16
|
+
lastUpdated: string;
|
|
17
|
+
/**
|
|
18
|
+
* ID of the functionality visibility type for the functionality.
|
|
19
|
+
*/
|
|
20
|
+
restaurantFunctionalityVisibilityTypeId: 1 | 2 | 3 | 4;
|
|
21
|
+
/**
|
|
22
|
+
* Restaurant ID the functionality relates to.
|
|
23
|
+
*/
|
|
24
|
+
restaurantId: number;
|
|
25
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ApiV2UploadConnectionType } from '../v2/uploadConnection';
|
|
2
|
+
export type ApiV2RestaurantUploadConnectionType = ApiV2UploadConnectionType & {
|
|
3
|
+
/**
|
|
4
|
+
* Background color for the upload.
|
|
5
|
+
*/
|
|
6
|
+
backgroundColor: string;
|
|
7
|
+
/**
|
|
8
|
+
* ID of the restaurant the entity belongs to.
|
|
9
|
+
*/
|
|
10
|
+
restaurantId: number;
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
restaurantUploadTypeId: number;
|
|
15
|
+
/**
|
|
16
|
+
* Sort order for the connection.
|
|
17
|
+
*/
|
|
18
|
+
sortOrder: number;
|
|
19
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ApiV2BaseResponseType } from '../v2/baseResponse';
|
|
2
|
+
/**
|
|
3
|
+
* Type for the individual array items in v2 of the API for the table booking endpoint.
|
|
4
|
+
*/
|
|
5
|
+
export type ApiV2TableBookingType = {
|
|
6
|
+
/**
|
|
7
|
+
* Booking link.
|
|
8
|
+
*/
|
|
9
|
+
bookingLink: string;
|
|
10
|
+
/**
|
|
11
|
+
* Text about table booking conditions.
|
|
12
|
+
*/
|
|
13
|
+
conditionsText: string;
|
|
14
|
+
/**
|
|
15
|
+
* Timestamp for when the entity was created.
|
|
16
|
+
*/
|
|
17
|
+
created: string;
|
|
18
|
+
/**
|
|
19
|
+
* Email to use for table booking.
|
|
20
|
+
*/
|
|
21
|
+
email: string;
|
|
22
|
+
/**
|
|
23
|
+
* Unique ID for the entity.
|
|
24
|
+
*/
|
|
25
|
+
id: number;
|
|
26
|
+
/**
|
|
27
|
+
* Link to use for iframe embeds of external table booking systems.
|
|
28
|
+
*/
|
|
29
|
+
iframeLink: string;
|
|
30
|
+
/**
|
|
31
|
+
* Timestamp for when the entity was last updated.
|
|
32
|
+
*/
|
|
33
|
+
lastUpdated: string;
|
|
34
|
+
/**
|
|
35
|
+
* Phone number for booking tables.
|
|
36
|
+
*/
|
|
37
|
+
phone: string;
|
|
38
|
+
/**
|
|
39
|
+
* ID of the restaurant that the table booking info is relevant for.
|
|
40
|
+
*/
|
|
41
|
+
restaurantId: number;
|
|
42
|
+
/**
|
|
43
|
+
* ID of the specific type of table booking that's selected.
|
|
44
|
+
*/
|
|
45
|
+
tableBookingTypeId: number;
|
|
46
|
+
/**
|
|
47
|
+
* Informational text about table booking conditions.
|
|
48
|
+
*/
|
|
49
|
+
text: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* The API response type for table booking info.
|
|
53
|
+
*/
|
|
54
|
+
export type ApiV2TableBookingResponseType = ApiV2BaseResponseType<ApiV2TableBookingType[], number>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ApiV2BaseResponseType } from '../v2/baseResponse';
|
|
2
|
+
/**
|
|
3
|
+
* Type for the individual array items in v2 of the API for the take away endpoint.
|
|
4
|
+
*/
|
|
5
|
+
export type ApiV2TakeAwayType = {
|
|
6
|
+
/**
|
|
7
|
+
* Timestamp for when the entity was created.
|
|
8
|
+
*/
|
|
9
|
+
created: string;
|
|
10
|
+
/**
|
|
11
|
+
* Email adress to be used for ordering take away.
|
|
12
|
+
*/
|
|
13
|
+
email: string;
|
|
14
|
+
/**
|
|
15
|
+
* Unique ID for the entity.
|
|
16
|
+
*/
|
|
17
|
+
id: number;
|
|
18
|
+
/**
|
|
19
|
+
* Timestamp for when the entity was last updated.
|
|
20
|
+
*/
|
|
21
|
+
lastUpdated: string;
|
|
22
|
+
/**
|
|
23
|
+
* Phone number used for ordering take away.
|
|
24
|
+
*/
|
|
25
|
+
phone: string;
|
|
26
|
+
/**
|
|
27
|
+
* Restaurant ID the entity belongs to.
|
|
28
|
+
*/
|
|
29
|
+
restaurantId: number;
|
|
30
|
+
/**
|
|
31
|
+
* Link to external take away site.
|
|
32
|
+
*/
|
|
33
|
+
takeAwayLink: string;
|
|
34
|
+
/**
|
|
35
|
+
* ID of the specific type of take away that's selected.
|
|
36
|
+
*/
|
|
37
|
+
takeAwayTypeId: number;
|
|
38
|
+
/**
|
|
39
|
+
* Text to display to end users when displaying take away information.
|
|
40
|
+
*/
|
|
41
|
+
text: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The API response type for take away info.
|
|
45
|
+
*/
|
|
46
|
+
export type ApiV2TakeAwayResponseType = ApiV2BaseResponseType<ApiV2TakeAwayType[], number>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type ApiV2UploadType = {
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether or not this uses our alternative OG image variant.
|
|
4
|
+
*/
|
|
5
|
+
alternativeOgImage: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Base name of the file.
|
|
8
|
+
*/
|
|
9
|
+
baseName: string;
|
|
10
|
+
/**
|
|
11
|
+
* File extension.
|
|
12
|
+
*/
|
|
13
|
+
extension: string;
|
|
14
|
+
/**
|
|
15
|
+
* Unique entity ID.
|
|
16
|
+
*/
|
|
17
|
+
id: number;
|
|
18
|
+
/**
|
|
19
|
+
* Timestamp for when entity was last updated.
|
|
20
|
+
*/
|
|
21
|
+
lastUpdated: string;
|
|
22
|
+
/**
|
|
23
|
+
* Factor to use for modifying image max sizes in different parts of the system.
|
|
24
|
+
*/
|
|
25
|
+
maxSizeFactor: number;
|
|
26
|
+
/**
|
|
27
|
+
* Directory path to the file.
|
|
28
|
+
*/
|
|
29
|
+
path: string;
|
|
30
|
+
/**
|
|
31
|
+
* Timestamp for when the image was first uploaded.
|
|
32
|
+
*/
|
|
33
|
+
uploaded: string;
|
|
34
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type ApiV2UploadConnectionType = {
|
|
2
|
+
/**
|
|
3
|
+
* Timestamp for when the connection was created.
|
|
4
|
+
*/
|
|
5
|
+
created: string;
|
|
6
|
+
/**
|
|
7
|
+
* Unique ID for the entity.
|
|
8
|
+
*/
|
|
9
|
+
id: number;
|
|
10
|
+
/**
|
|
11
|
+
* Timestamp for last update.
|
|
12
|
+
*/
|
|
13
|
+
lastUpdated: string;
|
|
14
|
+
/**
|
|
15
|
+
* ID of the upload.
|
|
16
|
+
*/
|
|
17
|
+
uploadId: number;
|
|
18
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ApiV2UploadType } from '../v2/upload';
|
|
2
|
+
export type ApiV2UploadGroupingType<T> = {
|
|
3
|
+
/**
|
|
4
|
+
* Upload instance. This represents the actual uploaded file.
|
|
5
|
+
*/
|
|
6
|
+
upload: ApiV2UploadType;
|
|
7
|
+
/**
|
|
8
|
+
* Upload connection. This is the relation entity between the uploaded file and another entity.
|
|
9
|
+
*/
|
|
10
|
+
uploadConnection: T;
|
|
11
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ApiV2BaseResponseType } from '../v2/baseResponse';
|
|
2
|
+
/**
|
|
3
|
+
* The API response type for backend version info to be compare with client info.
|
|
4
|
+
*/
|
|
5
|
+
export type ApiV2VersionResponseType = ApiV2BaseResponseType<{
|
|
6
|
+
/**
|
|
7
|
+
* The semantic version of the latest built package for the version. This generally follows the version of the backend, but may sometimes be left out of sync for backend changes that don't require a new client version to be compiled.
|
|
8
|
+
*/
|
|
9
|
+
buildSemanticVersion: string;
|
|
10
|
+
/**
|
|
11
|
+
* Not relevant for external usage, exists only for in-app comparisons.
|
|
12
|
+
*/
|
|
13
|
+
buildTime: string;
|
|
14
|
+
/**
|
|
15
|
+
* Not relevant for external usage, exists only for in-app comparisons.
|
|
16
|
+
*/
|
|
17
|
+
buildVersion: string;
|
|
18
|
+
/**
|
|
19
|
+
* The version the backend is currently running. Please use this for any eventual comparisons used for checking breaking changes for your API- or client integrations.
|
|
20
|
+
*/
|
|
21
|
+
packageVersion: string;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated This is from a time before `buildSemanticVersion` and `ApiV2VersionResponseType` existed and you should use one of those instead, most likely what you want is the `packageVersion` specifically.
|
|
24
|
+
*/
|
|
25
|
+
semanticVersion: string;
|
|
26
|
+
}, number> & {
|
|
27
|
+
/**
|
|
28
|
+
* Irrelevant side-effect of generic item count handling for a non-generic endpoint. Can be ignored completely for this specific endpoint.
|
|
29
|
+
*/
|
|
30
|
+
count: number;
|
|
31
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ApiV2BaseResponseType } from '../v2/baseResponse';
|
|
2
|
+
import type { ApiV2DateType } from '../v2/date';
|
|
3
|
+
import type { ApiV2YearSetType } from '../v2/yearSet';
|
|
4
|
+
/**
|
|
5
|
+
* Type for the non-array data object in v2 of the API for the week endpoint.
|
|
6
|
+
*/
|
|
7
|
+
export type ApiV2WeekType = {
|
|
8
|
+
/**
|
|
9
|
+
* List of dates in week.
|
|
10
|
+
*/
|
|
11
|
+
dates: ApiV2DateType[];
|
|
12
|
+
/**
|
|
13
|
+
* Week number.
|
|
14
|
+
*/
|
|
15
|
+
number: number;
|
|
16
|
+
/**
|
|
17
|
+
* Set of current year and week year.
|
|
18
|
+
*/
|
|
19
|
+
yearSet: ApiV2YearSetType;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The API response type for week info.
|
|
23
|
+
*/
|
|
24
|
+
export type ApiV2WeekResponseType = ApiV2BaseResponseType<{
|
|
25
|
+
actual: ApiV2WeekType;
|
|
26
|
+
crawling: ApiV2WeekType;
|
|
27
|
+
currentlyShown: ApiV2WeekType;
|
|
28
|
+
requested: ApiV2WeekType;
|
|
29
|
+
}, number> & {
|
|
30
|
+
/**
|
|
31
|
+
* Irrelevant side-effect of generic item count handling for a non-generic endpoint. Can be ignored completely for this specific endpoint.
|
|
32
|
+
*/
|
|
33
|
+
count: number;
|
|
34
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type ApiV2YearType = {
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether year is a leap year.
|
|
4
|
+
*/
|
|
5
|
+
isLeapYear: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Year number.
|
|
8
|
+
*/
|
|
9
|
+
number: number;
|
|
10
|
+
/**
|
|
11
|
+
* Number of weeks this year. This is actually 1 through 53, but I'm not going to write out all options and AFAIK Typescript doesn't yet have built-in helpers for this...
|
|
12
|
+
*/
|
|
13
|
+
numberOfWeeks: number;
|
|
14
|
+
/**
|
|
15
|
+
* Number of weeks next year. This is actually 1 through 53, but I'm not going to write out all options and AFAIK Typescript doesn't yet have built-in helpers for this...
|
|
16
|
+
*/
|
|
17
|
+
numberOfWeeksNextYear: number;
|
|
18
|
+
/**
|
|
19
|
+
* Number of weeks in previous year. This is actually 1 through 53, but I'm not going to write out all options and AFAIK Typescript doesn't yet have built-in helpers for this...
|
|
20
|
+
*/
|
|
21
|
+
numberOfWeeksPreviousYear: number;
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matochmat/api-client",
|
|
3
3
|
"description": "API types and helper functionality for the Mat och Mat API.",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.4",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"node": ">=20.9"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
|
-
"
|
|
25
|
+
"dist"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@matochmat/eslint-plugin": "^1.3.0",
|