includio-cms 0.36.9 → 0.37.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/API.md +178 -3
- package/CHANGELOG.md +54 -0
- package/DOCS.md +28 -3
- package/ROADMAP.md +18 -0
- package/dist/admin/client/booking/booking-dashboard.svelte +40 -0
- package/dist/admin/client/booking/booking-dashboard.svelte.d.ts +3 -0
- package/dist/admin/client/booking/customer-panel.svelte +102 -0
- package/dist/admin/client/booking/customer-panel.svelte.d.ts +11 -0
- package/dist/admin/client/booking/customer-view.d.ts +52 -0
- package/dist/admin/client/booking/customer-view.js +134 -0
- package/dist/admin/client/booking/participant-data-panel.svelte +330 -0
- package/dist/admin/client/booking/participant-data-panel.svelte.d.ts +22 -0
- package/dist/admin/client/booking/reservation-detail-page.svelte +637 -0
- package/dist/admin/client/booking/reservation-detail-page.svelte.d.ts +3 -0
- package/dist/admin/client/booking/reservations-page.svelte +221 -0
- package/dist/admin/client/booking/reservations-page.svelte.d.ts +3 -0
- package/dist/admin/client/collection/collection-entries.svelte +1 -1
- package/dist/admin/client/collection/entry-link.svelte +6 -4
- package/dist/admin/client/collection/entry-link.svelte.d.ts +3 -1
- package/dist/admin/client/collection/status-badge.svelte +39 -3
- package/dist/admin/client/collection/status-badge.svelte.d.ts +5 -3
- package/dist/admin/client/entry/entry.svelte +26 -9
- package/dist/admin/client/entry/hybrid/hybrid-preview.svelte +73 -10
- package/dist/admin/client/entry/hybrid/hybrid-preview.svelte.d.ts +6 -5
- package/dist/admin/client/entry/preview-views-context.svelte.d.ts +22 -0
- package/dist/admin/client/entry/preview-views-context.svelte.js +58 -0
- package/dist/admin/client/entry/preview-views.d.ts +27 -0
- package/dist/admin/client/entry/preview-views.js +33 -0
- package/dist/admin/client/index.d.ts +3 -0
- package/dist/admin/client/index.js +3 -0
- package/dist/admin/client/modules/dashboard-registry.d.ts +7 -0
- package/dist/admin/client/modules/dashboard-registry.js +11 -0
- package/dist/admin/client/modules/module-dashboard-page.svelte +26 -0
- package/dist/admin/client/modules/module-dashboard-page.svelte.d.ts +6 -0
- package/dist/admin/client/modules/stat-card.svelte +22 -0
- package/dist/admin/client/modules/stat-card.svelte.d.ts +10 -0
- package/dist/admin/client/shop/shop-dashboard.svelte +29 -0
- package/dist/admin/client/shop/shop-dashboard.svelte.d.ts +3 -0
- package/dist/admin/components/fields/relation-field.svelte +11 -2
- package/dist/admin/components/icons/icon-map.js +8 -0
- package/dist/admin/components/layout/app-sidebar.svelte +45 -14
- package/dist/admin/components/layout/context-switcher.svelte +90 -0
- package/dist/admin/components/layout/context-switcher.svelte.d.ts +3 -0
- package/dist/admin/components/layout/lang.d.ts +4 -0
- package/dist/admin/components/layout/lang.js +8 -0
- package/dist/admin/components/layout/layout-renderer.svelte +2 -1
- package/dist/admin/components/layout/layout-tabs.svelte +14 -0
- package/dist/admin/components/layout/layout-tabs.svelte.d.ts +2 -0
- package/dist/admin/components/layout/nav-collections.svelte +16 -9
- package/dist/admin/components/layout/nav-collections.svelte.d.ts +5 -1
- package/dist/admin/components/layout/nav-global.svelte +45 -0
- package/dist/admin/components/layout/nav-global.svelte.d.ts +3 -0
- package/dist/admin/components/layout/nav-main.svelte +8 -32
- package/dist/admin/components/layout/nav-main.svelte.d.ts +6 -1
- package/dist/admin/components/layout/nav-module.svelte +57 -0
- package/dist/admin/components/layout/nav-module.svelte.d.ts +7 -0
- package/dist/admin/components/layout/nav-section.svelte +1 -1
- package/dist/admin/components/layout/nav-section.svelte.d.ts +1 -1
- package/dist/admin/components/layout/nav-singletons.svelte +14 -7
- package/dist/admin/components/layout/nav-singletons.svelte.d.ts +5 -1
- package/dist/admin/remote/booking.remote.d.ts +244 -0
- package/dist/admin/remote/booking.remote.js +283 -0
- package/dist/admin/remote/index.d.ts +2 -0
- package/dist/admin/remote/index.js +2 -0
- package/dist/admin/remote/modules.remote.d.ts +10 -0
- package/dist/admin/remote/modules.remote.js +14 -0
- package/dist/admin/state/active-context-resolve.d.ts +37 -0
- package/dist/admin/state/active-context-resolve.js +66 -0
- package/dist/admin/state/active-context.svelte.d.ts +8 -0
- package/dist/admin/state/active-context.svelte.js +27 -0
- package/dist/booking/adjustments.d.ts +33 -0
- package/dist/booking/adjustments.js +26 -0
- package/dist/booking/capacity.d.ts +12 -0
- package/dist/booking/capacity.js +10 -0
- package/dist/booking/client/index.d.ts +39 -0
- package/dist/booking/client/index.js +44 -0
- package/dist/booking/client/use-booking.svelte.d.ts +25 -0
- package/dist/booking/client/use-booking.svelte.js +56 -0
- package/dist/booking/config.d.ts +156 -0
- package/dist/booking/config.js +36 -0
- package/dist/booking/draft.d.ts +77 -0
- package/dist/booking/draft.js +67 -0
- package/dist/booking/expiry-logic.d.ts +30 -0
- package/dist/booking/expiry-logic.js +33 -0
- package/dist/booking/index.d.ts +18 -0
- package/dist/booking/index.js +52 -0
- package/dist/booking/ledger.d.ts +46 -0
- package/dist/booking/ledger.js +60 -0
- package/dist/booking/number.d.ts +2 -0
- package/dist/booking/number.js +11 -0
- package/dist/booking/participant-fields/access.d.ts +10 -0
- package/dist/booking/participant-fields/access.js +14 -0
- package/dist/booking/participant-fields/age.d.ts +12 -0
- package/dist/booking/participant-fields/age.js +28 -0
- package/dist/booking/participant-fields/completeness.d.ts +8 -0
- package/dist/booking/participant-fields/completeness.js +13 -0
- package/dist/booking/participant-fields/group.d.ts +6 -0
- package/dist/booking/participant-fields/group.js +15 -0
- package/dist/booking/participant-fields/index.d.ts +6 -0
- package/dist/booking/participant-fields/index.js +6 -0
- package/dist/booking/participant-fields/types.d.ts +50 -0
- package/dist/booking/participant-fields/types.js +5 -0
- package/dist/booking/participant-fields/validate.d.ts +7 -0
- package/dist/booking/participant-fields/validate.js +44 -0
- package/dist/booking/participant-pricing.d.ts +93 -0
- package/dist/booking/participant-pricing.js +91 -0
- package/dist/booking/participants-view.d.ts +32 -0
- package/dist/booking/participants-view.js +22 -0
- package/dist/booking/payment-context.d.ts +19 -0
- package/dist/booking/payment-context.js +29 -0
- package/dist/booking/pricing-inputs.d.ts +28 -0
- package/dist/booking/pricing-inputs.js +35 -0
- package/dist/booking/pricing.d.ts +86 -0
- package/dist/booking/pricing.js +125 -0
- package/dist/booking/recompute.d.ts +22 -0
- package/dist/booking/recompute.js +31 -0
- package/dist/booking/reminders-schedule.d.ts +11 -0
- package/dist/booking/reminders-schedule.js +28 -0
- package/dist/booking/server/adjustments.d.ts +27 -0
- package/dist/booking/server/adjustments.js +136 -0
- package/dist/booking/server/bookings.d.ts +45 -0
- package/dist/booking/server/bookings.js +288 -0
- package/dist/booking/server/catalog.d.ts +9 -0
- package/dist/booking/server/catalog.js +20 -0
- package/dist/booking/server/db.d.ts +7 -0
- package/dist/booking/server/db.js +18 -0
- package/dist/booking/server/email.d.ts +23 -0
- package/dist/booking/server/email.js +59 -0
- package/dist/booking/server/emailTemplateRegistry.d.ts +29 -0
- package/dist/booking/server/emailTemplateRegistry.js +125 -0
- package/dist/booking/server/http/create-handler.d.ts +5 -0
- package/dist/booking/server/http/create-handler.js +68 -0
- package/dist/booking/server/http/index.d.ts +4 -0
- package/dist/booking/server/http/index.js +4 -0
- package/dist/booking/server/http/maintenance-handler.d.ts +9 -0
- package/dist/booking/server/http/maintenance-handler.js +36 -0
- package/dist/booking/server/http/portal-handler.d.ts +13 -0
- package/dist/booking/server/http/portal-handler.js +99 -0
- package/dist/booking/server/http/webhook-handler.d.ts +9 -0
- package/dist/booking/server/http/webhook-handler.js +39 -0
- package/dist/booking/server/index.d.ts +12 -0
- package/dist/booking/server/index.js +14 -0
- package/dist/booking/server/maintenance.d.ts +28 -0
- package/dist/booking/server/maintenance.js +134 -0
- package/dist/booking/server/participants.d.ts +26 -0
- package/dist/booking/server/participants.js +92 -0
- package/dist/booking/server/payments.d.ts +34 -0
- package/dist/booking/server/payments.js +207 -0
- package/dist/booking/server/portal-session.d.ts +16 -0
- package/dist/booking/server/portal-session.js +42 -0
- package/dist/booking/server/portal.d.ts +207 -0
- package/dist/booking/server/portal.js +234 -0
- package/dist/booking/server/refunds.d.ts +7 -0
- package/dist/booking/server/refunds.js +58 -0
- package/dist/booking/server/reminders.d.ts +9 -0
- package/dist/booking/server/reminders.js +24 -0
- package/dist/booking/server/validation.d.ts +17 -0
- package/dist/booking/server/validation.js +55 -0
- package/dist/booking/state-machine.d.ts +41 -0
- package/dist/booking/state-machine.js +73 -0
- package/dist/booking/templates/_partials/footer.en.html +4 -0
- package/dist/booking/templates/_partials/footer.pl.html +4 -0
- package/dist/booking/templates/_partials/header.en.html +4 -0
- package/dist/booking/templates/_partials/header.pl.html +4 -0
- package/dist/booking/templates/balance-due.en.html +10 -0
- package/dist/booking/templates/balance-due.pl.html +10 -0
- package/dist/booking/templates/balance-overdue-cancelled.en.html +5 -0
- package/dist/booking/templates/balance-overdue-cancelled.pl.html +5 -0
- package/dist/booking/templates/booking-received.en.html +9 -0
- package/dist/booking/templates/booking-received.pl.html +9 -0
- package/dist/booking/templates/deposit-paid.en.html +6 -0
- package/dist/booking/templates/deposit-paid.pl.html +6 -0
- package/dist/booking/templates/payment-link.en.html +5 -0
- package/dist/booking/templates/payment-link.pl.html +5 -0
- package/dist/booking/templates/payment-received.en.html +10 -0
- package/dist/booking/templates/payment-received.pl.html +10 -0
- package/dist/booking/totals.d.ts +38 -0
- package/dist/booking/totals.js +61 -0
- package/dist/booking/webhook-logic.d.ts +28 -0
- package/dist/booking/webhook-logic.js +50 -0
- package/dist/cli/create-user.d.ts +7 -1
- package/dist/cli/create-user.js +23 -15
- package/dist/cli/index.js +55 -7
- package/dist/cli/scaffold/admin.d.ts +6 -0
- package/dist/cli/scaffold/admin.js +5 -3
- package/dist/cli/scaffold/booking.d.ts +12 -0
- package/dist/cli/scaffold/booking.js +103 -0
- package/dist/core/cms.d.ts +24 -9
- package/dist/core/cms.js +72 -34
- package/dist/core/config/validatePreviews.d.ts +12 -0
- package/dist/core/config/validatePreviews.js +90 -0
- package/dist/core/fields/slugPath.d.ts +9 -1
- package/dist/core/fields/slugPath.js +16 -2
- package/dist/core/server/fields/resolveRelationFields.d.ts +11 -2
- package/dist/core/server/fields/resolveRelationFields.js +12 -3
- package/dist/core/server/generator/generator.js +7 -2
- package/dist/db-postgres/schema/booking/bookingAdjustments.d.ts +186 -0
- package/dist/db-postgres/schema/booking/bookingAdjustments.js +22 -0
- package/dist/db-postgres/schema/booking/bookingItemPersons.d.ts +117 -0
- package/dist/db-postgres/schema/booking/bookingItemPersons.js +22 -0
- package/dist/db-postgres/schema/booking/bookingItems.d.ts +181 -0
- package/dist/db-postgres/schema/booking/bookingItems.js +22 -0
- package/dist/db-postgres/schema/booking/bookingPayments.d.ts +204 -0
- package/dist/db-postgres/schema/booking/bookingPayments.js +25 -0
- package/dist/db-postgres/schema/booking/bookingPersons.d.ts +99 -0
- package/dist/db-postgres/schema/booking/bookingPersons.js +17 -0
- package/dist/db-postgres/schema/booking/bookingReminders.d.ts +131 -0
- package/dist/db-postgres/schema/booking/bookingReminders.js +18 -0
- package/dist/db-postgres/schema/booking/bookings.d.ts +307 -0
- package/dist/db-postgres/schema/booking/bookings.js +40 -0
- package/dist/db-postgres/schema/booking/index.d.ts +7 -0
- package/dist/db-postgres/schema/booking/index.js +7 -0
- package/dist/db-postgres/schema/index.d.ts +1 -0
- package/dist/db-postgres/schema/index.js +1 -0
- package/dist/db-postgres/schema-booking.d.ts +1 -0
- package/dist/db-postgres/schema-booking.js +1 -0
- package/dist/server/security/rate-limit-handler.d.ts +19 -0
- package/dist/server/security/rate-limit-handler.js +34 -0
- package/dist/shop/adapters/payu/client.js +3 -1
- package/dist/shop/adapters/payu/index.js +37 -17
- package/dist/shop/adapters/payu/payload.d.ts +6 -0
- package/dist/shop/adapters/payu/payload.js +1 -1
- package/dist/shop/adapters/stripe/index.js +36 -21
- package/dist/shop/index.d.ts +11 -2
- package/dist/shop/index.js +43 -1
- package/dist/shop/rate-limit.d.ts +1 -9
- package/dist/shop/rate-limit.js +3 -28
- package/dist/shop/types.d.ts +19 -0
- package/dist/sveltekit/config.d.ts +4 -0
- package/dist/sveltekit/config.js +6 -0
- package/dist/types/cms.d.ts +15 -1
- package/dist/types/cms.schema.d.ts +96 -2
- package/dist/types/cms.schema.js +84 -1
- package/dist/types/config.d.ts +33 -0
- package/dist/types/layout.d.ts +6 -0
- package/dist/types/modules.d.ts +133 -0
- package/dist/types/modules.js +27 -0
- package/dist/updates/0.37.0/index.d.ts +2 -0
- package/dist/updates/0.37.0/index.js +52 -0
- package/dist/updates/index.js +3 -1
- package/package.json +19 -1
- package/dist/admin/components/layout/nav-shop.svelte +0 -33
- package/dist/admin/components/layout/nav-shop.svelte.d.ts +0 -3
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { sidebarLang } from './lang.js';
|
|
3
|
+
import { useInterfaceLanguage } from '../../state/interface-language.svelte.js';
|
|
4
|
+
import CameraIcon from '@tabler/icons-svelte/icons/camera';
|
|
5
|
+
import UsersIcon from '@tabler/icons-svelte/icons/users';
|
|
6
|
+
import SettingsIcon from '@tabler/icons-svelte/icons/settings';
|
|
7
|
+
import { page } from '$app/state';
|
|
8
|
+
import { authClient } from '../../auth-client.js';
|
|
9
|
+
import NavSection, { type NavSectionItem } from './nav-section.svelte';
|
|
10
|
+
|
|
11
|
+
const interfaceLanguage = useInterfaceLanguage();
|
|
12
|
+
let session = authClient.useSession();
|
|
13
|
+
|
|
14
|
+
const isAdmin = $derived($session.data?.user?.role === 'admin');
|
|
15
|
+
|
|
16
|
+
const items: NavSectionItem[] = $derived([
|
|
17
|
+
{
|
|
18
|
+
title: sidebarLang[interfaceLanguage.current].main.media,
|
|
19
|
+
url: '/admin/media',
|
|
20
|
+
icon: CameraIcon
|
|
21
|
+
},
|
|
22
|
+
...(isAdmin
|
|
23
|
+
? [
|
|
24
|
+
{
|
|
25
|
+
title: sidebarLang[interfaceLanguage.current].main.users,
|
|
26
|
+
url: '/admin/users',
|
|
27
|
+
icon: UsersIcon
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: sidebarLang[interfaceLanguage.current].main.maintenance,
|
|
31
|
+
url: '/admin/maintenance',
|
|
32
|
+
icon: SettingsIcon
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
: [])
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
function isActive(url: string) {
|
|
39
|
+
return page.url.pathname.startsWith(url);
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<div class="mt-auto">
|
|
44
|
+
<NavSection {items} {isActive} withTopBorder />
|
|
45
|
+
</div>
|
|
@@ -1,49 +1,25 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { sidebarLang } from './lang.js';
|
|
3
3
|
import { useInterfaceLanguage } from '../../state/interface-language.svelte.js';
|
|
4
|
-
import CameraIcon from '@tabler/icons-svelte/icons/camera';
|
|
5
4
|
import LayoutDashboardIcon from '@tabler/icons-svelte/icons/layout-dashboard';
|
|
6
|
-
import UsersIcon from '@tabler/icons-svelte/icons/users';
|
|
7
|
-
import SettingsIcon from '@tabler/icons-svelte/icons/settings';
|
|
8
5
|
import { page } from '$app/state';
|
|
9
|
-
import {
|
|
6
|
+
import type { Icon } from '@tabler/icons-svelte';
|
|
10
7
|
import NavSection, { type NavSectionItem } from './nav-section.svelte';
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
let session = authClient.useSession();
|
|
9
|
+
let { url = '/admin', icon = LayoutDashboardIcon }: { url?: string; icon?: Icon } = $props();
|
|
14
10
|
|
|
15
|
-
const
|
|
11
|
+
const interfaceLanguage = useInterfaceLanguage();
|
|
16
12
|
|
|
17
13
|
const items: NavSectionItem[] = $derived([
|
|
18
14
|
{
|
|
19
15
|
title: sidebarLang[interfaceLanguage.current].main.dashboard,
|
|
20
|
-
url
|
|
21
|
-
icon
|
|
22
|
-
}
|
|
23
|
-
{
|
|
24
|
-
title: sidebarLang[interfaceLanguage.current].main.media,
|
|
25
|
-
url: '/admin/media',
|
|
26
|
-
icon: CameraIcon
|
|
27
|
-
},
|
|
28
|
-
...(isAdmin
|
|
29
|
-
? [
|
|
30
|
-
{
|
|
31
|
-
title: sidebarLang[interfaceLanguage.current].main.users,
|
|
32
|
-
url: '/admin/users',
|
|
33
|
-
icon: UsersIcon
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
title: sidebarLang[interfaceLanguage.current].main.maintenance,
|
|
37
|
-
url: '/admin/maintenance',
|
|
38
|
-
icon: SettingsIcon
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
: [])
|
|
16
|
+
url,
|
|
17
|
+
icon
|
|
18
|
+
}
|
|
42
19
|
]);
|
|
43
20
|
|
|
44
|
-
function isActive(
|
|
45
|
-
|
|
46
|
-
return page.url.pathname.startsWith(url);
|
|
21
|
+
function isActive(u: string) {
|
|
22
|
+
return page.url.pathname === u.split('?')[0];
|
|
47
23
|
}
|
|
48
24
|
</script>
|
|
49
25
|
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Icon } from '@tabler/icons-svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
url?: string;
|
|
4
|
+
icon?: Icon;
|
|
5
|
+
};
|
|
6
|
+
declare const NavMain: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
2
7
|
type NavMain = ReturnType<typeof NavMain>;
|
|
3
8
|
export default NavMain;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { useInterfaceLanguage } from '../../state/interface-language.svelte.js';
|
|
3
|
+
import { getLocalizedLabel } from '../../utils/collectionLabel.js';
|
|
4
|
+
import { getIcon } from '../icons/icon-map.js';
|
|
5
|
+
import { getRemotes } from '../../../sveltekit/index.js';
|
|
6
|
+
import { page } from '$app/state';
|
|
7
|
+
import BoxIcon from '@tabler/icons-svelte/icons/box';
|
|
8
|
+
import NavSection, { type NavSectionItem } from './nav-section.svelte';
|
|
9
|
+
import type { CMSModuleDescriptor } from '../../../types/modules.js';
|
|
10
|
+
import type { Localized } from '../../../types/languages.js';
|
|
11
|
+
|
|
12
|
+
let { module }: { module: CMSModuleDescriptor } = $props();
|
|
13
|
+
|
|
14
|
+
const interfaceLanguage = useInterfaceLanguage();
|
|
15
|
+
const remotes = getRemotes();
|
|
16
|
+
|
|
17
|
+
function isActive(url: string) {
|
|
18
|
+
const pathname = page.url.pathname;
|
|
19
|
+
const base = url.split('?')[0];
|
|
20
|
+
return pathname === base || pathname.startsWith(base + '/');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Optional reactive badges for sections declaring a `countSource` remote
|
|
24
|
+
// query (mirrors nav-collections' entry-count pattern). Dormant otherwise.
|
|
25
|
+
let countsMap: Map<string, number> = $state(new Map());
|
|
26
|
+
$effect(() => {
|
|
27
|
+
const map = new Map<string, number>();
|
|
28
|
+
for (const section of module.context.sections) {
|
|
29
|
+
if (!section.countSource) continue;
|
|
30
|
+
const fn = (remotes as Record<string, unknown>)[section.countSource];
|
|
31
|
+
if (typeof fn !== 'function') continue;
|
|
32
|
+
const q = (fn as () => { ready: boolean; current: unknown })();
|
|
33
|
+
if (q.ready && typeof q.current === 'number') map.set(section.key, q.current);
|
|
34
|
+
}
|
|
35
|
+
countsMap = map;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const label = $derived(
|
|
39
|
+
getLocalizedLabel(module.label as Localized, interfaceLanguage.current) || module.id
|
|
40
|
+
);
|
|
41
|
+
const items: NavSectionItem[] = $derived(
|
|
42
|
+
module.context.sections.map((s) => ({
|
|
43
|
+
title: getLocalizedLabel(s.title as Localized, interfaceLanguage.current) || s.url,
|
|
44
|
+
url: s.url,
|
|
45
|
+
icon: getIcon(s.icon) ?? BoxIcon,
|
|
46
|
+
count: countsMap.get(s.key)
|
|
47
|
+
}))
|
|
48
|
+
);
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<NavSection
|
|
52
|
+
{items}
|
|
53
|
+
{label}
|
|
54
|
+
labelIcon={getIcon(module.icon) ?? BoxIcon}
|
|
55
|
+
{isActive}
|
|
56
|
+
withTopBorder
|
|
57
|
+
/>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CMSModuleDescriptor } from '../../../types/modules.js';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
module: CMSModuleDescriptor;
|
|
4
|
+
};
|
|
5
|
+
declare const NavModule: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type NavModule = ReturnType<typeof NavModule>;
|
|
7
|
+
export default NavModule;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
|
-
* Internal helper — DRY for sidebar nav-* sections (NavMain, NavCollections, NavSingletons, NavForms,
|
|
4
|
+
* Internal helper — DRY for sidebar nav-* sections (NavMain, NavCollections, NavSingletons, NavForms, NavModule).
|
|
5
5
|
* Not exported publicly. Sesja 4 (UI Normalization → 0.26.0).
|
|
6
6
|
*/
|
|
7
7
|
import type { Icon } from '@tabler/icons-svelte';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @internal
|
|
3
|
-
* Internal helper — DRY for sidebar nav-* sections (NavMain, NavCollections, NavSingletons, NavForms,
|
|
3
|
+
* Internal helper — DRY for sidebar nav-* sections (NavMain, NavCollections, NavSingletons, NavForms, NavModule).
|
|
4
4
|
* Not exported publicly. Sesja 4 (UI Normalization → 0.26.0).
|
|
5
5
|
*/
|
|
6
6
|
import type { Icon } from '@tabler/icons-svelte';
|
|
@@ -10,26 +10,33 @@
|
|
|
10
10
|
import { getIcon } from '../icons/icon-map.js';
|
|
11
11
|
import NavSection, { type NavSectionItem } from './nav-section.svelte';
|
|
12
12
|
|
|
13
|
+
let { filterSlugs, ctx }: { filterSlugs?: string[]; ctx?: string } = $props();
|
|
14
|
+
|
|
13
15
|
const interfaceLanguage = useInterfaceLanguage();
|
|
14
16
|
const remotes = getRemotes();
|
|
15
17
|
|
|
16
18
|
function isActive(url: string) {
|
|
19
|
+
const base = url.split('?')[0];
|
|
17
20
|
const pathname = page.url.pathname;
|
|
18
|
-
return pathname ===
|
|
21
|
+
return pathname === base || pathname.startsWith(base + '/');
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
const query = $derived(remotes.getSingles());
|
|
22
25
|
|
|
23
26
|
const items: NavSectionItem[] = $derived(
|
|
24
|
-
query.current
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
(query.current ?? [])
|
|
28
|
+
.filter((item) => !filterSlugs || filterSlugs.includes(item.slug))
|
|
29
|
+
.map((item) => ({
|
|
30
|
+
title: getLocalizedLabel(item.label, interfaceLanguage.current) ?? item.slug,
|
|
31
|
+
url: `/admin/entries/${item.slug}${ctx ? `?ctx=${ctx}` : ''}`,
|
|
32
|
+
icon: getIcon(item.sidebarIcon) ?? SettingsIcon
|
|
33
|
+
}))
|
|
29
34
|
);
|
|
30
35
|
</script>
|
|
31
36
|
|
|
32
|
-
{#if
|
|
37
|
+
{#if filterSlugs && filterSlugs.length === 0}
|
|
38
|
+
<!-- no surfaced singletons in this context -->
|
|
39
|
+
{:else if !query.ready}
|
|
33
40
|
<Sidebar.Group class="border-sidebar-border mt-1 border-t px-0 pt-2 pb-1">
|
|
34
41
|
<Sidebar.GroupLabel
|
|
35
42
|
>{sidebarLang[interfaceLanguage.current].singletons.title}</Sidebar.GroupLabel
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
filterSlugs?: string[];
|
|
3
|
+
ctx?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const NavSingletons: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
2
6
|
type NavSingletons = ReturnType<typeof NavSingletons>;
|
|
3
7
|
export default NavSingletons;
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { bookingsTable } from '../../db-postgres/schema/booking/index.js';
|
|
2
|
+
import { type BookingStatus } from '../../booking/state-machine.js';
|
|
3
|
+
import type { FieldDef } from '../../booking/participant-fields/types.js';
|
|
4
|
+
/** Whether the booking module is registered. @public */
|
|
5
|
+
export declare const getBookingEnabled: import("@sveltejs/kit").RemoteQueryFunction<void, boolean>;
|
|
6
|
+
/**
|
|
7
|
+
* Lists active (non-deleted) bookings, newest first — paginated server-side.
|
|
8
|
+
*
|
|
9
|
+
* Search spans the booking number AND the `customer` bag. The bag's shape is defined by the
|
|
10
|
+
* consumer, not by the core, so we match against its text form instead of guessing key names.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare const listBookings: import("@sveltejs/kit").RemoteQueryFunction<{
|
|
15
|
+
status?: "paid" | "cancelled" | "draft" | "reserved" | "partially_paid" | "completed" | undefined;
|
|
16
|
+
search?: string | undefined;
|
|
17
|
+
limit?: number | undefined;
|
|
18
|
+
offset?: number | undefined;
|
|
19
|
+
} | undefined, {
|
|
20
|
+
items: {
|
|
21
|
+
id: string;
|
|
22
|
+
number: string;
|
|
23
|
+
status: BookingStatus;
|
|
24
|
+
currency: string;
|
|
25
|
+
customer: Record<string, unknown>;
|
|
26
|
+
totals: import("../../db-postgres/schema/booking/index.js").BookingTotals;
|
|
27
|
+
accessToken: string;
|
|
28
|
+
staffNotes: string | null;
|
|
29
|
+
language: string | null;
|
|
30
|
+
balanceDueAt: Date | null;
|
|
31
|
+
holdExpiresAt: Date | null;
|
|
32
|
+
cancelReason: string | null;
|
|
33
|
+
deletedAt: Date | null;
|
|
34
|
+
deletedBy: string | null;
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
updatedAt: Date;
|
|
37
|
+
}[];
|
|
38
|
+
total: number;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Aggregate stats for the booking dashboard, computed in SQL.
|
|
42
|
+
*
|
|
43
|
+
* Deliberately NOT derived from {@link listBookings}: that query is paginated, so summing its rows
|
|
44
|
+
* would silently report stats for the first page only.
|
|
45
|
+
*
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
export declare const getBookingStats: import("@sveltejs/kit").RemoteQueryFunction<void, {
|
|
49
|
+
active: number;
|
|
50
|
+
outstanding: number;
|
|
51
|
+
toConfirm: number;
|
|
52
|
+
currency: string;
|
|
53
|
+
}>;
|
|
54
|
+
/** Full booking detail (booking + items + participants + ledger + reminders). @public */
|
|
55
|
+
export declare const getBooking: import("@sveltejs/kit").RemoteQueryFunction<string, {
|
|
56
|
+
booking: {
|
|
57
|
+
id: string;
|
|
58
|
+
number: string;
|
|
59
|
+
status: BookingStatus;
|
|
60
|
+
currency: string;
|
|
61
|
+
customer: Record<string, unknown>;
|
|
62
|
+
totals: import("../../db-postgres/schema/booking/index.js").BookingTotals;
|
|
63
|
+
accessToken: string;
|
|
64
|
+
staffNotes: string | null;
|
|
65
|
+
language: string | null;
|
|
66
|
+
balanceDueAt: Date | null;
|
|
67
|
+
holdExpiresAt: Date | null;
|
|
68
|
+
cancelReason: string | null;
|
|
69
|
+
deletedAt: Date | null;
|
|
70
|
+
deletedBy: string | null;
|
|
71
|
+
createdAt: Date;
|
|
72
|
+
updatedAt: Date;
|
|
73
|
+
};
|
|
74
|
+
items: {
|
|
75
|
+
participantFields: FieldDef[];
|
|
76
|
+
/** Human title of the catalog entry; falls back to the raw ref when unresolvable. */
|
|
77
|
+
tripTitle: string;
|
|
78
|
+
id: string;
|
|
79
|
+
bookingId: string;
|
|
80
|
+
tripRef: string;
|
|
81
|
+
departureDate: Date | null;
|
|
82
|
+
participantsCount: number;
|
|
83
|
+
unitPriceSnapshot: number;
|
|
84
|
+
subtotalSnapshot: number | null;
|
|
85
|
+
appliedDiscounts: import("../../booking/pricing.js").AppliedRule[];
|
|
86
|
+
createdAt: Date;
|
|
87
|
+
updatedAt: Date;
|
|
88
|
+
}[];
|
|
89
|
+
participants: import("../../booking/participants-view.js").FlatParticipant[];
|
|
90
|
+
persons: {
|
|
91
|
+
id: string;
|
|
92
|
+
bookingId: string;
|
|
93
|
+
data: Record<string, unknown>;
|
|
94
|
+
createdAt: Date;
|
|
95
|
+
updatedAt: Date;
|
|
96
|
+
}[];
|
|
97
|
+
assignments: {
|
|
98
|
+
id: string;
|
|
99
|
+
itemId: string;
|
|
100
|
+
personId: string;
|
|
101
|
+
data: Record<string, unknown>;
|
|
102
|
+
createdAt: Date;
|
|
103
|
+
updatedAt: Date;
|
|
104
|
+
}[];
|
|
105
|
+
payments: {
|
|
106
|
+
id: string;
|
|
107
|
+
bookingId: string;
|
|
108
|
+
kind: import("../../booking/ledger.js").PaymentKind;
|
|
109
|
+
amount: number;
|
|
110
|
+
status: import("../../booking/ledger.js").PaymentStatus;
|
|
111
|
+
providerRef: string | null;
|
|
112
|
+
paymentLink: string | null;
|
|
113
|
+
createdBy: string;
|
|
114
|
+
paidAt: Date | null;
|
|
115
|
+
createdAt: Date;
|
|
116
|
+
updatedAt: Date;
|
|
117
|
+
}[];
|
|
118
|
+
reminders: {
|
|
119
|
+
id: string;
|
|
120
|
+
bookingId: string;
|
|
121
|
+
type: string;
|
|
122
|
+
templateKey: string;
|
|
123
|
+
scheduledFor: Date;
|
|
124
|
+
sentAt: Date | null;
|
|
125
|
+
createdAt: Date;
|
|
126
|
+
}[];
|
|
127
|
+
adjustments: {
|
|
128
|
+
id: string;
|
|
129
|
+
bookingId: string;
|
|
130
|
+
kind: import("../../booking/adjustments.js").AdjustmentKind;
|
|
131
|
+
amount: number;
|
|
132
|
+
label: string;
|
|
133
|
+
reason: string | null;
|
|
134
|
+
createdBy: string;
|
|
135
|
+
createdAt: Date;
|
|
136
|
+
voidedAt: Date | null;
|
|
137
|
+
voidedBy: string | null;
|
|
138
|
+
}[];
|
|
139
|
+
ageFlag: import("../../booking/participant-fields/types.js").AgeFlagConfig | null;
|
|
140
|
+
/**
|
|
141
|
+
* Anchor-date key inside the `customer` bag. The only piece of that bag's semantics the
|
|
142
|
+
* core knows on its own — everything else the customer panel infers from values.
|
|
143
|
+
*/
|
|
144
|
+
arrivalDateField: string | null;
|
|
145
|
+
/** Optional presentation hints for the `customer` bag (labels + `birthDate` role). */
|
|
146
|
+
customerFields: FieldDef[];
|
|
147
|
+
} | null>;
|
|
148
|
+
/** Published catalog trips for the staff item-editor picker (ref + best-effort title). @public */
|
|
149
|
+
export declare const listBookingCatalog: import("@sveltejs/kit").RemoteQueryFunction<void, {
|
|
150
|
+
ref: string;
|
|
151
|
+
title: string;
|
|
152
|
+
}[]>;
|
|
153
|
+
/** Staff: create a booking from the admin panel. @public */
|
|
154
|
+
export declare const createBookingStaff: import("@sveltejs/kit").RemoteCommand<any, Promise<{
|
|
155
|
+
booking: typeof bookingsTable.$inferSelect;
|
|
156
|
+
accessToken: string;
|
|
157
|
+
}>>;
|
|
158
|
+
/** Staff: edit a booking's items/customer (full edit power). @public */
|
|
159
|
+
export declare const editBookingStaff: import("@sveltejs/kit").RemoteCommand<{
|
|
160
|
+
bookingId: string;
|
|
161
|
+
changes: any;
|
|
162
|
+
}, Promise<{
|
|
163
|
+
number: string;
|
|
164
|
+
id: string;
|
|
165
|
+
createdAt: Date;
|
|
166
|
+
status: BookingStatus;
|
|
167
|
+
currency: string;
|
|
168
|
+
language: string | null;
|
|
169
|
+
accessToken: string;
|
|
170
|
+
deletedAt: Date | null;
|
|
171
|
+
deletedBy: string | null;
|
|
172
|
+
updatedAt: Date;
|
|
173
|
+
customer: Record<string, unknown>;
|
|
174
|
+
totals: import("../../db-postgres/schema/booking/index.js").BookingTotals;
|
|
175
|
+
staffNotes: string | null;
|
|
176
|
+
balanceDueAt: Date | null;
|
|
177
|
+
holdExpiresAt: Date | null;
|
|
178
|
+
cancelReason: string | null;
|
|
179
|
+
}>>;
|
|
180
|
+
/** Staff: generate an installment/balance payment link for any amount. @public */
|
|
181
|
+
export declare const addPaymentLink: import("@sveltejs/kit").RemoteCommand<{
|
|
182
|
+
bookingId: string;
|
|
183
|
+
amount: number;
|
|
184
|
+
}, Promise<{
|
|
185
|
+
paymentLink: string | null;
|
|
186
|
+
}>>;
|
|
187
|
+
/** Staff: record a manual cash payment. @public */
|
|
188
|
+
export declare const recordCashPayment: import("@sveltejs/kit").RemoteCommand<{
|
|
189
|
+
bookingId: string;
|
|
190
|
+
amount: number;
|
|
191
|
+
}, Promise<{
|
|
192
|
+
ok: boolean;
|
|
193
|
+
}>>;
|
|
194
|
+
/** Staff: refund a paid ledger entry via the adapter. @public */
|
|
195
|
+
export declare const refundBookingPayment: import("@sveltejs/kit").RemoteCommand<{
|
|
196
|
+
paymentId: string;
|
|
197
|
+
amount?: number | undefined;
|
|
198
|
+
}, Promise<{
|
|
199
|
+
ok: boolean;
|
|
200
|
+
}>>;
|
|
201
|
+
/** Staff: change booking status (validated transition). @public */
|
|
202
|
+
export declare const changeBookingStatus: import("@sveltejs/kit").RemoteCommand<{
|
|
203
|
+
bookingId: string;
|
|
204
|
+
to: string;
|
|
205
|
+
}, Promise<{
|
|
206
|
+
ok: boolean;
|
|
207
|
+
}>>;
|
|
208
|
+
/** Staff: cancel a booking (manual). @public */
|
|
209
|
+
export declare const cancelBooking: import("@sveltejs/kit").RemoteCommand<{
|
|
210
|
+
bookingId: string;
|
|
211
|
+
reason?: "manual" | undefined;
|
|
212
|
+
}, Promise<{
|
|
213
|
+
ok: boolean;
|
|
214
|
+
}>>;
|
|
215
|
+
/** Staff: send a transactional booking email manually. @public */
|
|
216
|
+
export declare const sendBookingEmailCmd: import("@sveltejs/kit").RemoteCommand<{
|
|
217
|
+
bookingId: string;
|
|
218
|
+
kind: string;
|
|
219
|
+
}, Promise<{
|
|
220
|
+
ok: boolean;
|
|
221
|
+
}>>;
|
|
222
|
+
/** Staff: edit a participant's custom-field data (schema-validated). @public */
|
|
223
|
+
export declare const updateParticipantData: import("@sveltejs/kit").RemoteCommand<{
|
|
224
|
+
participantId: string;
|
|
225
|
+
data: Record<string, unknown>;
|
|
226
|
+
}, Promise<{
|
|
227
|
+
ok: boolean;
|
|
228
|
+
}>>;
|
|
229
|
+
/** Staff: add a manual adjustment (surcharge/discount). Amount is a positive magnitude in minor units. @public */
|
|
230
|
+
export declare const addAdjustment: import("@sveltejs/kit").RemoteCommand<{
|
|
231
|
+
bookingId: string;
|
|
232
|
+
kind: "manual_surcharge" | "manual_discount";
|
|
233
|
+
amount: number;
|
|
234
|
+
label: string;
|
|
235
|
+
reason?: string | undefined;
|
|
236
|
+
}, Promise<{
|
|
237
|
+
ok: boolean;
|
|
238
|
+
}>>;
|
|
239
|
+
/** Staff: void (soft-delete) a manual adjustment. @public */
|
|
240
|
+
export declare const voidAdjustment: import("@sveltejs/kit").RemoteCommand<{
|
|
241
|
+
adjustmentId: string;
|
|
242
|
+
}, Promise<{
|
|
243
|
+
ok: boolean;
|
|
244
|
+
}>>;
|