@gomusdev/web-components 1.22.3 → 1.24.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-js/components/cart/mocks/gomusTicketMocks.d.ts +0 -2
- package/dist-js/components/ticketSelection/TicketSelectionDetails.svelte.d.ts +1 -1
- package/dist-js/components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.d.ts +5 -4
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/TicketSegmentDetails.svelte.d.ts +4 -919
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/annualTickets.svelte.d.ts +2 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/dayTickets.svelte.d.ts +2 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/event/eventScaledPriceTickets.spec.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/event/eventScaledPriceTickets.svelte.d.ts +2 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/event/eventTickets.spec.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/event/eventTickets.svelte.d.ts +2 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/timeslotTickets.svelte.d.ts +2 -0
- package/dist-js/gomus-webcomponents.iife.js +343 -270
- package/dist-js/gomus-webcomponents.js +343 -270
- package/dist-js/lib/models/capacities/capacities.d.ts +44 -0
- package/dist-js/lib/models/capacities/capacities.spec.d.ts +1 -0
- package/dist-js/lib/models/scalePrice/UIScaledPrice.svelte.d.ts +0 -6
- package/dist-js/lib/models/ticket/UITicket.svelte.d.ts +1 -4
- package/dist-js/lib/stores/shop.svelte.d.ts +45 -54
- package/dist-js/mocks/MSWMocks.d.ts +5 -0
- package/dist-js/mocks/mocks.d.ts +0 -24
- package/package.json +1 -1
- package/dist-js/lib/helpers/Wrapper.svelte.d.ts +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Capacities } from '@gomus/types';
|
|
2
|
+
export type UICapacities = ReturnType<typeof createCapacities>;
|
|
3
|
+
export declare function createCapacities(apiCapacities: Capacities): {
|
|
4
|
+
apiData: {
|
|
5
|
+
[key: string]: {
|
|
6
|
+
tickets: number[];
|
|
7
|
+
capacities: {
|
|
8
|
+
[key: string]: number;
|
|
9
|
+
};
|
|
10
|
+
total_capacities: {
|
|
11
|
+
[key: string]: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
reservations: Record<string, number>;
|
|
16
|
+
setReservation(ticketId: number, timeSlot: string, quantity: number): void;
|
|
17
|
+
getReservation(ticketId: number, timeSlot: string): number;
|
|
18
|
+
/**
|
|
19
|
+
* a flat list of all timeslots and their capacities, considering reservations.
|
|
20
|
+
*/
|
|
21
|
+
timeslots(): {
|
|
22
|
+
timeSlot: string;
|
|
23
|
+
quota: string;
|
|
24
|
+
capacity: number;
|
|
25
|
+
tickets: number[];
|
|
26
|
+
}[];
|
|
27
|
+
tickets(ticketId: number): {
|
|
28
|
+
timeslot: string;
|
|
29
|
+
ticket: number;
|
|
30
|
+
quota: string;
|
|
31
|
+
capacity: number;
|
|
32
|
+
}[];
|
|
33
|
+
ticketsByTimeSlot(timeslot: string): {
|
|
34
|
+
timeslot: string;
|
|
35
|
+
ticket: number;
|
|
36
|
+
quota: string;
|
|
37
|
+
capacity: number;
|
|
38
|
+
}[];
|
|
39
|
+
ticketCapacityByTicketAndTimeslot(ticketId: number, timeslot: string): number;
|
|
40
|
+
/**
|
|
41
|
+
* returns the max capacity of a ticket in all timeslots
|
|
42
|
+
*/
|
|
43
|
+
ticketCapacityByTicketId(ticketId: number): number;
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -10,9 +10,6 @@ export declare function isUIEventTicket(x: Product): x is UIEventTicket;
|
|
|
10
10
|
export type UIEventTicket = ReturnType<typeof createUIEventTicket>;
|
|
11
11
|
export declare function createUIEventTicket(apiTicket: EventScalePriceTicket, dateId: number, options?: Options): {
|
|
12
12
|
type: UIEventTicketTypes;
|
|
13
|
-
max_capacity: number;
|
|
14
|
-
min_quantity: number;
|
|
15
|
-
max_quantity: number;
|
|
16
13
|
minAvailableCapacity: number;
|
|
17
14
|
selectedTime: string;
|
|
18
15
|
quantity: number;
|
|
@@ -31,9 +28,6 @@ export declare function createUIEventTicket(apiTicket: EventScalePriceTicket, da
|
|
|
31
28
|
uid: number;
|
|
32
29
|
} | {
|
|
33
30
|
type: UIEventTicketTypes;
|
|
34
|
-
max_capacity: number;
|
|
35
|
-
min_quantity: number;
|
|
36
|
-
max_quantity: number;
|
|
37
31
|
product_type: ProductType;
|
|
38
32
|
accounting_article_id: number;
|
|
39
33
|
accounting_article_type: string;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { Product, ProductType } from '../cart/types.ts';
|
|
2
2
|
import { AnnualTicket, Ticket, Tickets } from '@gomus/types';
|
|
3
3
|
interface Options {
|
|
4
|
-
minAvailableCapacity?: number;
|
|
5
4
|
selectedTime?: string;
|
|
6
5
|
}
|
|
7
|
-
export type UITicketType = 'timeslot' | 'annual' | 'day';
|
|
6
|
+
export type UITicketType = 'timeslot' | 'annual' | 'day' | 'event:ticket';
|
|
8
7
|
export type UITicket = ReturnType<typeof createUITicket>;
|
|
9
8
|
export declare function isUITicket(x: Product): x is UITicket;
|
|
10
9
|
export declare function createUITicket(apiTicket: Ticket | AnnualTicket, options?: Options): {
|
|
11
10
|
product_type: ProductType;
|
|
12
11
|
type: UITicketType;
|
|
13
12
|
shop_order: number;
|
|
14
|
-
minAvailableCapacity: number;
|
|
15
13
|
selectedTime: string;
|
|
16
14
|
id: number;
|
|
17
15
|
title: string;
|
|
@@ -123,7 +121,6 @@ export declare function createUITicket(apiTicket: Ticket | AnnualTicket, options
|
|
|
123
121
|
product_type: ProductType;
|
|
124
122
|
type: UITicketType;
|
|
125
123
|
shop_order: number;
|
|
126
|
-
minAvailableCapacity: number;
|
|
127
124
|
selectedTime: string;
|
|
128
125
|
id: number;
|
|
129
126
|
title: string;
|
|
@@ -3,7 +3,7 @@ import { ShopUrls } from '../helpers/urls';
|
|
|
3
3
|
import { User } from './user.svelte.ts';
|
|
4
4
|
import { OpenApiClient } from '@gomus/api';
|
|
5
5
|
import { TicketsAndQuotasParams, TicketsCalendarParams, TicketsParams } from '@gomus/api/lib/types.ts';
|
|
6
|
-
import { CheckoutParams, CheckoutResponse, Country, Event, Exhibition, FinalizePersonalizationParams, FinalizePersonalizationResponse, LocaleOptions, Merchandise, Museum, PasswordResetResponse, Salutation, ShopType, SignInParams, SignInResponse, SignUpParams, SignUpResponse, Tour } from '@gomus/types';
|
|
6
|
+
import { CapacitiesResponse, CheckoutParams, CheckoutResponse, Country, Event, Exhibition, FinalizePersonalizationParams, FinalizePersonalizationResponse, LocaleOptions, Merchandise, Museum, PasswordResetResponse, Salutation, ShopType, SignInParams, SignInResponse, SignUpParams, SignUpResponse, Tour } from '@gomus/types';
|
|
7
7
|
export type ShopKind = 'angular' | 'jmb';
|
|
8
8
|
export declare class Shop {
|
|
9
9
|
#private;
|
|
@@ -132,60 +132,50 @@ export declare class Shop {
|
|
|
132
132
|
meta: import('@gomus/types').components["schemas"]["meta"];
|
|
133
133
|
};
|
|
134
134
|
tickets(params: TicketsParams): {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
min_persons?: number;
|
|
165
|
-
max_persons?: number;
|
|
166
|
-
description?: string | null;
|
|
167
|
-
};
|
|
168
|
-
} | null;
|
|
169
|
-
is_sub_ticket: boolean;
|
|
170
|
-
created_at: string;
|
|
171
|
-
updated_at: string;
|
|
172
|
-
shop_order: number;
|
|
173
|
-
shipped_with_merchandise_id: number | null;
|
|
174
|
-
restricted_shop_account: boolean;
|
|
175
|
-
cash_point_order: number;
|
|
176
|
-
capacities: {
|
|
177
|
-
[key: string]: number;
|
|
178
|
-
};
|
|
179
|
-
total_capacities: {
|
|
180
|
-
[key: string]: number;
|
|
135
|
+
id: number;
|
|
136
|
+
title: string;
|
|
137
|
+
ticket_type: "time_slot" | "annual" | "normal";
|
|
138
|
+
bookable: boolean;
|
|
139
|
+
museum_ids: number[];
|
|
140
|
+
exhibition_ids: number[];
|
|
141
|
+
price_cents: number;
|
|
142
|
+
discount: number;
|
|
143
|
+
vat_pct: number;
|
|
144
|
+
tax_included: boolean;
|
|
145
|
+
entry_duration: number | null;
|
|
146
|
+
quota_ids: number[];
|
|
147
|
+
first_entry: number;
|
|
148
|
+
last_entry: number;
|
|
149
|
+
personalizeable: boolean;
|
|
150
|
+
attendees: boolean | string;
|
|
151
|
+
identification: boolean | string;
|
|
152
|
+
free_timing: boolean;
|
|
153
|
+
is_collective: boolean;
|
|
154
|
+
is_upgrade: boolean;
|
|
155
|
+
is_mantle: boolean;
|
|
156
|
+
description: string | null;
|
|
157
|
+
sub_ticket_ids: number[];
|
|
158
|
+
sub_tickets: {
|
|
159
|
+
[key: string]: {
|
|
160
|
+
title?: string;
|
|
161
|
+
min_persons?: number;
|
|
162
|
+
max_persons?: number;
|
|
163
|
+
description?: string | null;
|
|
181
164
|
};
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
165
|
+
} | null;
|
|
166
|
+
is_sub_ticket: boolean;
|
|
167
|
+
created_at: string;
|
|
168
|
+
updated_at: string;
|
|
169
|
+
cash_point_order: number;
|
|
170
|
+
shop_order: number;
|
|
171
|
+
shipped_with_merchandise_id: number | null;
|
|
172
|
+
restricted_shop_account: boolean;
|
|
173
|
+
min_persons: number;
|
|
174
|
+
max_persons: number;
|
|
175
|
+
dynamic_prices?: {
|
|
176
|
+
[key: string]: number;
|
|
177
|
+
} | null;
|
|
178
|
+
}[];
|
|
189
179
|
signIn(params: SignInParams): Promise<SignInResponse>;
|
|
190
180
|
signUp(params: SignUpParams, asGuest?: boolean): Promise<SignUpResponse>;
|
|
191
181
|
passwordReset(params: {
|
|
@@ -337,6 +327,7 @@ export declare class Shop {
|
|
|
337
327
|
documents: import('@gomus/types').components["schemas"]["document"][];
|
|
338
328
|
content: Record<string, never>;
|
|
339
329
|
};
|
|
330
|
+
getTicketCapacities(date: string, ticketIds: number[]): Promise<CapacitiesResponse>;
|
|
340
331
|
getEventDetailsOnDate(eventId: number, dateId: number): {
|
|
341
332
|
id?: number;
|
|
342
333
|
event_id?: number;
|
|
@@ -11,7 +11,12 @@ export declare const MSWMocks: {
|
|
|
11
11
|
mockAnnualOrder: () => void;
|
|
12
12
|
mockCountries: () => void;
|
|
13
13
|
mockPersonalizationFormSubmit: () => void;
|
|
14
|
+
tickets: {
|
|
15
|
+
mockTwoTickets: (options?: Record<string, any>) => void;
|
|
16
|
+
mockOneTicketCapacity: (options?: Record<string, any>) => void;
|
|
17
|
+
};
|
|
14
18
|
events: {
|
|
15
19
|
mockTwoScaledPrices: (options?: Record<string, any>) => void;
|
|
20
|
+
mockTwoTickets: (options?: Record<string, any>) => void;
|
|
16
21
|
};
|
|
17
22
|
};
|
package/dist-js/mocks/mocks.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export declare const UITimeslotTicketsMocks: {
|
|
|
4
4
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
5
5
|
type: UITicketType;
|
|
6
6
|
shop_order: number;
|
|
7
|
-
minAvailableCapacity: number;
|
|
8
7
|
selectedTime: string;
|
|
9
8
|
id: number;
|
|
10
9
|
title: string;
|
|
@@ -116,7 +115,6 @@ export declare const UITimeslotTicketsMocks: {
|
|
|
116
115
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
117
116
|
type: UITicketType;
|
|
118
117
|
shop_order: number;
|
|
119
|
-
minAvailableCapacity: number;
|
|
120
118
|
selectedTime: string;
|
|
121
119
|
id: number;
|
|
122
120
|
title: string;
|
|
@@ -213,7 +211,6 @@ export declare const UITimeslotTicketsMocks: {
|
|
|
213
211
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
214
212
|
type: UITicketType;
|
|
215
213
|
shop_order: number;
|
|
216
|
-
minAvailableCapacity: number;
|
|
217
214
|
selectedTime: string;
|
|
218
215
|
id: number;
|
|
219
216
|
title: string;
|
|
@@ -325,7 +322,6 @@ export declare const UITimeslotTicketsMocks: {
|
|
|
325
322
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
326
323
|
type: UITicketType;
|
|
327
324
|
shop_order: number;
|
|
328
|
-
minAvailableCapacity: number;
|
|
329
325
|
selectedTime: string;
|
|
330
326
|
id: number;
|
|
331
327
|
title: string;
|
|
@@ -744,7 +740,6 @@ export declare const UIAnnualTicketMocks: {
|
|
|
744
740
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
745
741
|
type: UITicketType;
|
|
746
742
|
shop_order: number;
|
|
747
|
-
minAvailableCapacity: number;
|
|
748
743
|
selectedTime: string;
|
|
749
744
|
id: number;
|
|
750
745
|
title: string;
|
|
@@ -856,7 +851,6 @@ export declare const UIAnnualTicketMocks: {
|
|
|
856
851
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
857
852
|
type: UITicketType;
|
|
858
853
|
shop_order: number;
|
|
859
|
-
minAvailableCapacity: number;
|
|
860
854
|
selectedTime: string;
|
|
861
855
|
id: number;
|
|
862
856
|
title: string;
|
|
@@ -953,7 +947,6 @@ export declare const UIAnnualTicketMocks: {
|
|
|
953
947
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
954
948
|
type: UITicketType;
|
|
955
949
|
shop_order: number;
|
|
956
|
-
minAvailableCapacity: number;
|
|
957
950
|
selectedTime: string;
|
|
958
951
|
id: number;
|
|
959
952
|
title: string;
|
|
@@ -1065,7 +1058,6 @@ export declare const UIAnnualTicketMocks: {
|
|
|
1065
1058
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
1066
1059
|
type: UITicketType;
|
|
1067
1060
|
shop_order: number;
|
|
1068
|
-
minAvailableCapacity: number;
|
|
1069
1061
|
selectedTime: string;
|
|
1070
1062
|
id: number;
|
|
1071
1063
|
title: string;
|
|
@@ -1162,7 +1154,6 @@ export declare const UIAnnualTicketMocks: {
|
|
|
1162
1154
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
1163
1155
|
type: UITicketType;
|
|
1164
1156
|
shop_order: number;
|
|
1165
|
-
minAvailableCapacity: number;
|
|
1166
1157
|
selectedTime: string;
|
|
1167
1158
|
id: number;
|
|
1168
1159
|
title: string;
|
|
@@ -1274,7 +1265,6 @@ export declare const UIAnnualTicketMocks: {
|
|
|
1274
1265
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
1275
1266
|
type: UITicketType;
|
|
1276
1267
|
shop_order: number;
|
|
1277
|
-
minAvailableCapacity: number;
|
|
1278
1268
|
selectedTime: string;
|
|
1279
1269
|
id: number;
|
|
1280
1270
|
title: string;
|
|
@@ -1659,7 +1649,6 @@ export declare const CartItemMocks: {
|
|
|
1659
1649
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
1660
1650
|
type: UITicketType;
|
|
1661
1651
|
shop_order: number;
|
|
1662
|
-
minAvailableCapacity: number;
|
|
1663
1652
|
selectedTime: string;
|
|
1664
1653
|
id: number;
|
|
1665
1654
|
title: string;
|
|
@@ -1771,7 +1760,6 @@ export declare const CartItemMocks: {
|
|
|
1771
1760
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
1772
1761
|
type: UITicketType;
|
|
1773
1762
|
shop_order: number;
|
|
1774
|
-
minAvailableCapacity: number;
|
|
1775
1763
|
selectedTime: string;
|
|
1776
1764
|
id: number;
|
|
1777
1765
|
title: string;
|
|
@@ -1895,7 +1883,6 @@ export declare const CartItemMocks: {
|
|
|
1895
1883
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
1896
1884
|
type: UITicketType;
|
|
1897
1885
|
shop_order: number;
|
|
1898
|
-
minAvailableCapacity: number;
|
|
1899
1886
|
selectedTime: string;
|
|
1900
1887
|
id: number;
|
|
1901
1888
|
title: string;
|
|
@@ -2007,7 +1994,6 @@ export declare const CartItemMocks: {
|
|
|
2007
1994
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
2008
1995
|
type: UITicketType;
|
|
2009
1996
|
shop_order: number;
|
|
2010
|
-
minAvailableCapacity: number;
|
|
2011
1997
|
selectedTime: string;
|
|
2012
1998
|
id: number;
|
|
2013
1999
|
title: string;
|
|
@@ -2131,7 +2117,6 @@ export declare const CartItemMocks: {
|
|
|
2131
2117
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
2132
2118
|
type: UITicketType;
|
|
2133
2119
|
shop_order: number;
|
|
2134
|
-
minAvailableCapacity: number;
|
|
2135
2120
|
selectedTime: string;
|
|
2136
2121
|
id: number;
|
|
2137
2122
|
title: string;
|
|
@@ -2243,7 +2228,6 @@ export declare const CartItemMocks: {
|
|
|
2243
2228
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
2244
2229
|
type: UITicketType;
|
|
2245
2230
|
shop_order: number;
|
|
2246
|
-
minAvailableCapacity: number;
|
|
2247
2231
|
selectedTime: string;
|
|
2248
2232
|
id: number;
|
|
2249
2233
|
title: string;
|
|
@@ -2367,7 +2351,6 @@ export declare const CartItemMocks: {
|
|
|
2367
2351
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
2368
2352
|
type: UITicketType;
|
|
2369
2353
|
shop_order: number;
|
|
2370
|
-
minAvailableCapacity: number;
|
|
2371
2354
|
selectedTime: string;
|
|
2372
2355
|
id: number;
|
|
2373
2356
|
title: string;
|
|
@@ -2479,7 +2462,6 @@ export declare const CartItemMocks: {
|
|
|
2479
2462
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
2480
2463
|
type: UITicketType;
|
|
2481
2464
|
shop_order: number;
|
|
2482
|
-
minAvailableCapacity: number;
|
|
2483
2465
|
selectedTime: string;
|
|
2484
2466
|
id: number;
|
|
2485
2467
|
title: string;
|
|
@@ -2601,9 +2583,6 @@ export declare const CartItemMocks: {
|
|
|
2601
2583
|
type: import('../lib/models/cart/types').ProductType;
|
|
2602
2584
|
product: {
|
|
2603
2585
|
type: "scale";
|
|
2604
|
-
max_capacity: number;
|
|
2605
|
-
min_quantity: number;
|
|
2606
|
-
max_quantity: number;
|
|
2607
2586
|
minAvailableCapacity: number;
|
|
2608
2587
|
selectedTime: string;
|
|
2609
2588
|
quantity: number;
|
|
@@ -2622,9 +2601,6 @@ export declare const CartItemMocks: {
|
|
|
2622
2601
|
uid: number;
|
|
2623
2602
|
} | {
|
|
2624
2603
|
type: "scale";
|
|
2625
|
-
max_capacity: number;
|
|
2626
|
-
min_quantity: number;
|
|
2627
|
-
max_quantity: number;
|
|
2628
2604
|
product_type: import('../lib/models/cart/types').ProductType;
|
|
2629
2605
|
accounting_article_id: number;
|
|
2630
2606
|
accounting_article_type: string;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SvelteComponent as default } from 'svelte';
|