@gomusdev/web-components 1.24.1 → 1.25.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-js/components/cart/mocks/gomusTicketMocks.d.ts +8 -62
- package/dist-js/components/order/lib/OrderDetails.svelte.d.ts +1 -1
- package/dist-js/components/ticketSelection/TicketSelectionDetails.svelte.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/Item.svelte.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/TicketSegmentDetails.svelte.d.ts +5 -59
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/annualTickets.svelte.d.ts +1 -1
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/dayTickets.svelte.d.ts +1 -1
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/event/eventScaledPriceTickets.svelte.d.ts +1 -1
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/timeslotTickets.svelte.d.ts +1 -1
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/utils.svelte.d.ts +2 -3
- package/dist-js/gomus-webcomponents.css +6 -0
- package/dist-js/gomus-webcomponents.iife.js +5968 -5719
- package/dist-js/gomus-webcomponents.js +5968 -5719
- package/dist-js/lib/Log.svelte.d.ts +1 -0
- package/dist-js/lib/models/cart/CartEvents.svelte.d.ts +2 -1
- package/dist-js/lib/models/cart/CartItem.d.ts +2 -1
- package/dist-js/lib/models/cart/capacity/CapacityManager.d.ts +80 -0
- package/dist-js/lib/models/cart/capacity/calculators/quotaManager/QuotaManager.d.ts +62 -0
- package/dist-js/lib/models/cart/capacity/calculators/quotas.d.ts +2 -0
- package/dist-js/lib/models/cart/capacity/calculators/seats.d.ts +13 -0
- package/dist-js/lib/models/cart/capacity/calculators/unlimited.d.ts +2 -0
- package/dist-js/lib/models/cart/capacity/types.d.ts +10 -0
- package/dist-js/lib/models/cart/cart.svelte.d.ts +15 -113
- package/dist-js/lib/models/cart/localStorage.svelte.d.ts +2 -29
- package/dist-js/lib/models/cart/selectOptions.d.ts +1 -7
- package/dist-js/lib/models/cart/types.d.ts +1 -1
- package/dist-js/lib/models/scalePrice/UIScaledPrice.svelte.d.ts +4 -0
- package/dist-js/lib/models/ticket/UITicket.svelte.d.ts +11 -67
- package/dist-js/lib/stores/auth.svelte.d.ts +0 -1
- package/dist-js/lib/stores/shop.svelte.d.ts +127 -0
- package/dist-js/mocks/MSWMocks.d.ts +2 -2
- package/dist-js/mocks/TicketMocks.d.ts +74 -0
- package/dist-js/mocks/mocks.d.ts +201 -756
- package/package.json +1 -1
- package/dist-js/lib/models/capacities/capacities.d.ts +0 -44
- /package/dist-js/components/ticketSelection/subcomponents/tickets/{Tickets.spec.d.ts → Tickets.svelte.spec.d.ts} +0 -0
- /package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/event/{eventTickets.spec.d.ts → eventTickets.svelte.spec.d.ts} +0 -0
- /package/dist-js/lib/models/{capacities/capacities.spec.d.ts → cart/capacity/calculators/quotaManager/QuotaManager.spec.d.ts} +0 -0
- /package/dist-js/lib/models/cart/{selectOptions.spec.d.ts → capacity/calculators/seats.spec.d.ts} +0 -0
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { CalendarDates } from '../../components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.ts';
|
|
2
2
|
import { ShopUrls } from '../helpers/urls';
|
|
3
|
+
import { CapacityManager } from '../models/cart/capacity/CapacityManager.ts';
|
|
4
|
+
import { Cart } from '../models/cart/cart.svelte.ts';
|
|
5
|
+
import { Auth } from './auth.svelte.ts';
|
|
3
6
|
import { User } from './user.svelte.ts';
|
|
4
7
|
import { OpenApiClient } from '@gomus/api';
|
|
5
8
|
import { TicketsAndQuotasParams, TicketsCalendarParams, TicketsParams } from '@gomus/api/lib/types.ts';
|
|
@@ -10,6 +13,122 @@ export declare class Shop {
|
|
|
10
13
|
type: ShopKind;
|
|
11
14
|
constructor();
|
|
12
15
|
load(apiUrl: string, shopDomain: string, locale: string, type?: ShopKind): Promise<void>;
|
|
16
|
+
get capacityManager(): {
|
|
17
|
+
allSeats: Record<number, {
|
|
18
|
+
min?: number;
|
|
19
|
+
max?: number;
|
|
20
|
+
booked?: number;
|
|
21
|
+
available?: number;
|
|
22
|
+
max_per_registration?: number | null;
|
|
23
|
+
overbook?: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
allQuotas: import('@gomus/types').Quotas;
|
|
26
|
+
quotaManager: {
|
|
27
|
+
apiData: {
|
|
28
|
+
[key: string]: {
|
|
29
|
+
ticket_ids: number[];
|
|
30
|
+
capacities: {
|
|
31
|
+
[key: string]: number;
|
|
32
|
+
};
|
|
33
|
+
total_capacities: {
|
|
34
|
+
[key: string]: number;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
_timeslots: {
|
|
39
|
+
timeSlot: string;
|
|
40
|
+
quota: string;
|
|
41
|
+
capacity: number;
|
|
42
|
+
tickets: number[];
|
|
43
|
+
totalCapacity: number;
|
|
44
|
+
}[];
|
|
45
|
+
addQuotas(data: import('@gomus/types').Quotas): void;
|
|
46
|
+
precart: Record<string, number>;
|
|
47
|
+
clearPrecart(): void;
|
|
48
|
+
setPrecartItemQuantity(ticketId: number, quantity: number): void;
|
|
49
|
+
getPrecartItemQuantity(ticketId: number): number;
|
|
50
|
+
timeslots(): {
|
|
51
|
+
timeSlot: string;
|
|
52
|
+
quota: string;
|
|
53
|
+
capacity: number;
|
|
54
|
+
tickets: number[];
|
|
55
|
+
totalCapacity: number;
|
|
56
|
+
}[];
|
|
57
|
+
filterBy({ timeslot, ticketId, date }?: {
|
|
58
|
+
timeslot?: string;
|
|
59
|
+
ticketId?: number;
|
|
60
|
+
}): {
|
|
61
|
+
timeslot: string | undefined;
|
|
62
|
+
ticket: number;
|
|
63
|
+
quota: string;
|
|
64
|
+
capacity: number;
|
|
65
|
+
totalCapacity: number;
|
|
66
|
+
}[];
|
|
67
|
+
ticketCapacity(ticketId: number, timeslot: string): number;
|
|
68
|
+
totalCapacity(ticketId: number, timeslot: string): number;
|
|
69
|
+
timeslotsOn(date: import('@internationalized/date').CalendarDate): {
|
|
70
|
+
timeSlot: string;
|
|
71
|
+
quota: string;
|
|
72
|
+
capacity: number;
|
|
73
|
+
tickets: number[];
|
|
74
|
+
totalCapacity: number;
|
|
75
|
+
}[];
|
|
76
|
+
};
|
|
77
|
+
addQuotas(quotas: import('@gomus/types').Quotas): void;
|
|
78
|
+
addSeats(dateId: number, seats: {
|
|
79
|
+
min?: number;
|
|
80
|
+
max?: number;
|
|
81
|
+
booked?: number;
|
|
82
|
+
available?: number;
|
|
83
|
+
max_per_registration?: number | null;
|
|
84
|
+
overbook?: boolean;
|
|
85
|
+
}): void;
|
|
86
|
+
capacityPolicy(item: import('../models/cart/types').CartItem): "quotas" | "unlimited" | "seats";
|
|
87
|
+
capacity(cart: Cart, item: import('../models/cart/types').CartItem, preCart: Cart): import('../models/cart/capacity/types').Capacity;
|
|
88
|
+
};
|
|
89
|
+
get cart(): {
|
|
90
|
+
items: import('../models/cart/types').CartItem[];
|
|
91
|
+
contingent: number;
|
|
92
|
+
uid: string;
|
|
93
|
+
readonly nonEmptyItems: import('../models/cart/types').CartItem[];
|
|
94
|
+
readonly totalPriceCents: number;
|
|
95
|
+
readonly totalQuantity: number;
|
|
96
|
+
toString(): string;
|
|
97
|
+
orderData(): {
|
|
98
|
+
items: {
|
|
99
|
+
type: import('../models/cart/types').ProductType;
|
|
100
|
+
attributes: {
|
|
101
|
+
shipped_with_merchandise_id: null;
|
|
102
|
+
shipping_mode: string;
|
|
103
|
+
id: number;
|
|
104
|
+
time: string;
|
|
105
|
+
quantity: number;
|
|
106
|
+
} | {
|
|
107
|
+
shipped_with_merchandise_id: null;
|
|
108
|
+
shipping_mode: string;
|
|
109
|
+
id: number;
|
|
110
|
+
quantities: {
|
|
111
|
+
[x: number]: number;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
}[];
|
|
115
|
+
shipping_address_id: null;
|
|
116
|
+
comment: null;
|
|
117
|
+
reference: null;
|
|
118
|
+
payment_mode_id: string;
|
|
119
|
+
coupons: never[];
|
|
120
|
+
donations: never[];
|
|
121
|
+
affiliate: {};
|
|
122
|
+
total: number;
|
|
123
|
+
};
|
|
124
|
+
readonly totalFormatted: string;
|
|
125
|
+
clearItems(): void;
|
|
126
|
+
deleteItem(item: import('../models/cart/types').CartItem): void;
|
|
127
|
+
addItem(item: import('../models/cart/types').CartItem): void;
|
|
128
|
+
addItems(items: import('../models/cart/types').CartItem[]): void;
|
|
129
|
+
addProducts(products: import('../models/cart/types').Product[]): void;
|
|
130
|
+
};
|
|
131
|
+
get auth(): Auth;
|
|
13
132
|
get currentUser(): User | undefined;
|
|
14
133
|
get slug(): string | undefined;
|
|
15
134
|
get client(): OpenApiClient | undefined;
|
|
@@ -119,6 +238,9 @@ export declare class Shop {
|
|
|
119
238
|
customerSalutations?: Salutation[];
|
|
120
239
|
countries?: Country[];
|
|
121
240
|
locales?: LocaleOptions;
|
|
241
|
+
cart?: Cart;
|
|
242
|
+
auth?: Auth;
|
|
243
|
+
capacityManager?: CapacityManager;
|
|
122
244
|
};
|
|
123
245
|
ticketsCalendar(params: TicketsCalendarParams): CalendarDates;
|
|
124
246
|
calendar(params: TicketsCalendarParams): CalendarDates;
|
|
@@ -528,6 +650,11 @@ export declare class Shop {
|
|
|
528
650
|
params?: Record<string, unknown>;
|
|
529
651
|
requiredFields?: string[];
|
|
530
652
|
}): Promise<T>;
|
|
653
|
+
/**
|
|
654
|
+
* Executes the provided method asynchronously, waits for all dependent fetch operations to complete,
|
|
655
|
+
* and returns the result of the method execution.
|
|
656
|
+
*/
|
|
657
|
+
asyncFetch<T>(method: () => T): Promise<T>;
|
|
531
658
|
waitForAllFetches(...variables: unknown[]): Promise<void>;
|
|
532
659
|
apiGet(path: `/api${string}`, query?: Record<string, unknown>, pathOptions?: Record<string, unknown>): Promise<unknown>;
|
|
533
660
|
}
|
|
@@ -13,10 +13,10 @@ export declare const MSWMocks: {
|
|
|
13
13
|
mockPersonalizationFormSubmit: () => void;
|
|
14
14
|
tickets: {
|
|
15
15
|
mockTwoTickets: (options?: Record<string, any>) => void;
|
|
16
|
-
|
|
16
|
+
mockTwoDayTickets: (options?: Record<string, any>) => void;
|
|
17
17
|
};
|
|
18
18
|
events: {
|
|
19
19
|
mockTwoScaledPrices: (options?: Record<string, any>) => void;
|
|
20
|
-
|
|
20
|
+
mockFourTickets: (options?: Record<string, any>) => void;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export declare const TicketMocks: {
|
|
2
|
+
dayTicket(options: Record<string, unknown>): {
|
|
3
|
+
id: number;
|
|
4
|
+
title: string;
|
|
5
|
+
ticket_type: string;
|
|
6
|
+
bookable: boolean;
|
|
7
|
+
museum_ids: number[];
|
|
8
|
+
exhibition_ids: never[];
|
|
9
|
+
price_cents: number;
|
|
10
|
+
discount: number;
|
|
11
|
+
vat_pct: number;
|
|
12
|
+
tax_included: boolean;
|
|
13
|
+
entry_duration: null;
|
|
14
|
+
min_persons: number;
|
|
15
|
+
max_persons: number;
|
|
16
|
+
quota_ids: number[];
|
|
17
|
+
first_entry: number;
|
|
18
|
+
last_entry: number;
|
|
19
|
+
personalizeable: boolean;
|
|
20
|
+
attendees: boolean;
|
|
21
|
+
identification: boolean;
|
|
22
|
+
free_timing: boolean;
|
|
23
|
+
is_collective: boolean;
|
|
24
|
+
is_upgrade: boolean;
|
|
25
|
+
is_mantle: boolean;
|
|
26
|
+
description: string;
|
|
27
|
+
sub_ticket_ids: never[];
|
|
28
|
+
sub_tickets: {};
|
|
29
|
+
is_sub_ticket: boolean;
|
|
30
|
+
created_at: string;
|
|
31
|
+
updated_at: string;
|
|
32
|
+
cash_point_order: number;
|
|
33
|
+
shop_order: number;
|
|
34
|
+
shipped_with_merchandise_id: null;
|
|
35
|
+
restricted_shop_account: boolean;
|
|
36
|
+
dynamic_prices: null;
|
|
37
|
+
};
|
|
38
|
+
timeslotTicket(options: Record<string, unknown>): {
|
|
39
|
+
id: number;
|
|
40
|
+
title: string;
|
|
41
|
+
ticket_type: string;
|
|
42
|
+
bookable: boolean;
|
|
43
|
+
museum_ids: number[];
|
|
44
|
+
exhibition_ids: never[];
|
|
45
|
+
price_cents: number;
|
|
46
|
+
discount: number;
|
|
47
|
+
vat_pct: number;
|
|
48
|
+
tax_included: boolean;
|
|
49
|
+
entry_duration: null;
|
|
50
|
+
min_persons: number;
|
|
51
|
+
max_persons: number;
|
|
52
|
+
quota_ids: number[];
|
|
53
|
+
first_entry: number;
|
|
54
|
+
last_entry: number;
|
|
55
|
+
personalizeable: boolean;
|
|
56
|
+
attendees: boolean;
|
|
57
|
+
identification: boolean;
|
|
58
|
+
free_timing: boolean;
|
|
59
|
+
is_collective: boolean;
|
|
60
|
+
is_upgrade: boolean;
|
|
61
|
+
is_mantle: boolean;
|
|
62
|
+
description: string;
|
|
63
|
+
sub_ticket_ids: never[];
|
|
64
|
+
sub_tickets: {};
|
|
65
|
+
is_sub_ticket: boolean;
|
|
66
|
+
created_at: string;
|
|
67
|
+
updated_at: string;
|
|
68
|
+
cash_point_order: number;
|
|
69
|
+
shop_order: number;
|
|
70
|
+
shipped_with_merchandise_id: null;
|
|
71
|
+
restricted_shop_account: boolean;
|
|
72
|
+
dynamic_prices: null;
|
|
73
|
+
};
|
|
74
|
+
};
|