moonhead 1.0.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/README.md +32 -0
- package/dist/components/layout/app-header.d.ts +1 -0
- package/dist/components/layout/app-header.js +1 -0
- package/dist/components/layout/app-sidebar.d.ts +9 -0
- package/dist/components/layout/app-sidebar.js +1 -0
- package/dist/components/layout/brand-logo.d.ts +2 -0
- package/dist/components/layout/brand-logo.js +1 -0
- package/dist/components/layout/user-menu.d.ts +6 -0
- package/dist/components/layout/user-menu.js +1 -0
- package/dist/components/ui/action-form.d.ts +10 -0
- package/dist/components/ui/action-form.js +1 -0
- package/dist/components/ui/alert-dialog.d.ts +14 -0
- package/dist/components/ui/alert-dialog.js +1 -0
- package/dist/components/ui/alert.d.ts +12 -0
- package/dist/components/ui/alert.js +1 -0
- package/dist/components/ui/avatar.d.ts +12 -0
- package/dist/components/ui/avatar.js +1 -0
- package/dist/components/ui/badge.d.ts +2 -0
- package/dist/components/ui/badge.js +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.js +1 -0
- package/dist/components/ui/card.d.ts +2 -0
- package/dist/components/ui/card.js +1 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.js +1 -0
- package/dist/components/ui/combobox.d.ts +18 -0
- package/dist/components/ui/combobox.js +1 -0
- package/dist/components/ui/copy-button.d.ts +8 -0
- package/dist/components/ui/copy-button.js +1 -0
- package/dist/components/ui/country-select.d.ts +12 -0
- package/dist/components/ui/country-select.js +1 -0
- package/dist/components/ui/data-table.d.ts +11 -0
- package/dist/components/ui/data-table.js +1 -0
- package/dist/components/ui/date-range-picker.d.ts +25 -0
- package/dist/components/ui/date-range-picker.js +1 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dialog.js +1 -0
- package/dist/components/ui/drawer.d.ts +24 -0
- package/dist/components/ui/drawer.js +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +17 -0
- package/dist/components/ui/dropdown-menu.js +1 -0
- package/dist/components/ui/field.d.ts +7 -0
- package/dist/components/ui/field.js +1 -0
- package/dist/components/ui/fieldset.d.ts +4 -0
- package/dist/components/ui/fieldset.js +1 -0
- package/dist/components/ui/form-field.d.ts +17 -0
- package/dist/components/ui/form-field.js +1 -0
- package/dist/components/ui/form.d.ts +3 -0
- package/dist/components/ui/form.js +1 -0
- package/dist/components/ui/icon-tile.d.ts +5 -0
- package/dist/components/ui/icon-tile.js +1 -0
- package/dist/components/ui/identity.d.ts +6 -0
- package/dist/components/ui/identity.js +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.js +1 -0
- package/dist/components/ui/number-input.d.ts +19 -0
- package/dist/components/ui/number-input.js +1 -0
- package/dist/components/ui/otp-field.d.ts +6 -0
- package/dist/components/ui/otp-field.js +1 -0
- package/dist/components/ui/page-toolbar.d.ts +9 -0
- package/dist/components/ui/page-toolbar.js +1 -0
- package/dist/components/ui/password-input.d.ts +7 -0
- package/dist/components/ui/password-input.js +1 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group.js +1 -0
- package/dist/components/ui/search-input.d.ts +4 -0
- package/dist/components/ui/search-input.js +1 -0
- package/dist/components/ui/section-card.d.ts +7 -0
- package/dist/components/ui/section-card.js +1 -0
- package/dist/components/ui/select-field.d.ts +19 -0
- package/dist/components/ui/select-field.js +1 -0
- package/dist/components/ui/select.d.ts +17 -0
- package/dist/components/ui/select.js +1 -0
- package/dist/components/ui/sidebar.d.ts +27 -0
- package/dist/components/ui/sidebar.js +1 -0
- package/dist/components/ui/slider.d.ts +10 -0
- package/dist/components/ui/slider.js +1 -0
- package/dist/components/ui/sort-button.d.ts +5 -0
- package/dist/components/ui/sort-button.js +1 -0
- package/dist/components/ui/spinner.d.ts +4 -0
- package/dist/components/ui/spinner.js +1 -0
- package/dist/components/ui/status-badge.d.ts +11 -0
- package/dist/components/ui/status-badge.js +1 -0
- package/dist/components/ui/switch-field.d.ts +18 -0
- package/dist/components/ui/switch-field.js +1 -0
- package/dist/components/ui/switch.d.ts +3 -0
- package/dist/components/ui/switch.js +1 -0
- package/dist/components/ui/table-pagination.d.ts +9 -0
- package/dist/components/ui/table-pagination.js +1 -0
- package/dist/components/ui/table.d.ts +18 -0
- package/dist/components/ui/table.js +1 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.js +1 -0
- package/dist/components/ui/tag-input.d.ts +9 -0
- package/dist/components/ui/tag-input.js +1 -0
- package/dist/components/ui/text-link.d.ts +10 -0
- package/dist/components/ui/text-link.js +1 -0
- package/dist/components/ui/textarea.d.ts +2 -0
- package/dist/components/ui/textarea.js +1 -0
- package/dist/components/ui/toast.d.ts +1 -0
- package/dist/components/ui/toast.js +1 -0
- package/dist/components/ui/tree.d.ts +32 -0
- package/dist/components/ui/tree.js +1 -0
- package/dist/db/client.d.ts +8 -0
- package/dist/db/client.js +1 -0
- package/dist/db/index.d.ts +3 -0
- package/dist/db/index.js +1 -0
- package/dist/db/logger.d.ts +2 -0
- package/dist/db/logger.js +1 -0
- package/dist/db/migrations/20260628182304_wonderful_groot/migration.sql +289 -0
- package/dist/db/migrations/20260628182304_wonderful_groot/snapshot.json +3750 -0
- package/dist/db/migrations/20260630082829_wet_robin_chapel/migration.sql +2 -0
- package/dist/db/migrations/20260630082829_wet_robin_chapel/snapshot.json +3791 -0
- package/dist/db/migrations/20260702132335_wooden_iron_monger/migration.sql +48 -0
- package/dist/db/migrations/20260702132335_wooden_iron_monger/snapshot.json +4407 -0
- package/dist/db/migrations/20260702142948_vengeful_rhino/migration.sql +1 -0
- package/dist/db/migrations/20260702142948_vengeful_rhino/snapshot.json +4420 -0
- package/dist/db/migrations/20260702185813_curved_pyro/migration.sql +16 -0
- package/dist/db/migrations/20260702185813_curved_pyro/snapshot.json +4646 -0
- package/dist/db/migrations/20260702192041_shiny_franklin_storm/migration.sql +16 -0
- package/dist/db/migrations/20260702192041_shiny_franklin_storm/snapshot.json +4872 -0
- package/dist/db/migrations/20260704101548_bizarre_namorita/migration.sql +1 -0
- package/dist/db/migrations/20260704101548_bizarre_namorita/snapshot.json +4885 -0
- package/dist/db/migrations/20260704105911_sleepy_juggernaut/migration.sql +1 -0
- package/dist/db/migrations/20260704105911_sleepy_juggernaut/snapshot.json +4898 -0
- package/dist/db/migrations/20260704115959_lean_sandman/migration.sql +1 -0
- package/dist/db/migrations/20260704115959_lean_sandman/snapshot.json +4885 -0
- package/dist/db/migrations/20260707231532_daffy_captain_stacy/migration.sql +10 -0
- package/dist/db/migrations/20260707231532_daffy_captain_stacy/snapshot.json +4919 -0
- package/dist/db/migrations/20260708190355_spooky_jimmy_woo/migration.sql +3 -0
- package/dist/db/migrations/20260708190355_spooky_jimmy_woo/snapshot.json +4970 -0
- package/dist/db/migrations/20260711145212_drop_legacy_earning_status/migration.sql +7 -0
- package/dist/db/migrations/20260711145212_drop_legacy_earning_status/snapshot.json +4968 -0
- package/dist/db/migrations/20260712161249_dashboard_stat_indexes/migration.sql +3 -0
- package/dist/db/migrations/20260712161249_dashboard_stat_indexes/snapshot.json +5038 -0
- package/dist/db/migrations/20260713013911_add_payout_paid_at/migration.sql +2 -0
- package/dist/db/migrations/20260713013911_add_payout_paid_at/snapshot.json +5072 -0
- package/dist/db/schema/analytics-outbox.d.ts +145 -0
- package/dist/db/schema/analytics-outbox.js +1 -0
- package/dist/db/schema/audit-logs.d.ts +204 -0
- package/dist/db/schema/audit-logs.js +1 -0
- package/dist/db/schema/campaigns.d.ts +180 -0
- package/dist/db/schema/campaigns.js +1 -0
- package/dist/db/schema/casinos.d.ts +129 -0
- package/dist/db/schema/casinos.js +1 -0
- package/dist/db/schema/commission-rule-groups.d.ts +84 -0
- package/dist/db/schema/commission-rule-groups.js +1 -0
- package/dist/db/schema/commission-rules.d.ts +145 -0
- package/dist/db/schema/commission-rules.js +1 -0
- package/dist/db/schema/commissions.d.ts +242 -0
- package/dist/db/schema/commissions.js +1 -0
- package/dist/db/schema/conversions.d.ts +302 -0
- package/dist/db/schema/conversions.js +1 -0
- package/dist/db/schema/deals.d.ts +180 -0
- package/dist/db/schema/deals.js +1 -0
- package/dist/db/schema/earnings.d.ts +262 -0
- package/dist/db/schema/earnings.js +1 -0
- package/dist/db/schema/groups.d.ts +214 -0
- package/dist/db/schema/groups.js +1 -0
- package/dist/db/schema/index.d.ts +18 -0
- package/dist/db/schema/index.js +1 -0
- package/dist/db/schema/payouts.d.ts +182 -0
- package/dist/db/schema/payouts.js +1 -0
- package/dist/db/schema/platform-settings.d.ts +84 -0
- package/dist/db/schema/platform-settings.js +1 -0
- package/dist/db/schema/player-activity.d.ts +159 -0
- package/dist/db/schema/player-activity.js +1 -0
- package/dist/db/schema/revshare-carryover.d.ts +129 -0
- package/dist/db/schema/revshare-carryover.js +1 -0
- package/dist/db/schema/sessions.d.ts +213 -0
- package/dist/db/schema/sessions.js +1 -0
- package/dist/db/schema/table.d.ts +1 -0
- package/dist/db/schema/table.js +1 -0
- package/dist/db/schema/users.d.ts +609 -0
- package/dist/db/schema/users.js +1 -0
- package/dist/db/schema/verification-tokens.d.ts +106 -0
- package/dist/db/schema/verification-tokens.js +1 -0
- package/dist/db/types/branded.d.ts +3 -0
- package/dist/db/types/branded.js +0 -0
- package/dist/db/types/commission-rules.d.ts +70 -0
- package/dist/db/types/commission-rules.js +1 -0
- package/dist/db/types/index.d.ts +2 -0
- package/dist/db/types/index.js +1 -0
- package/dist/emails/admin/support-message.d.ts +39 -0
- package/dist/emails/admin/support-message.js +5 -0
- package/dist/emails/affiliate/activated.d.ts +33 -0
- package/dist/emails/affiliate/activated.js +1 -0
- package/dist/emails/affiliate/deal-notice.d.ts +35 -0
- package/dist/emails/affiliate/deal-notice.js +1 -0
- package/dist/emails/affiliate/invite.d.ts +35 -0
- package/dist/emails/affiliate/invite.js +1 -0
- package/dist/emails/affiliate/signup-verify.d.ts +35 -0
- package/dist/emails/affiliate/signup-verify.js +1 -0
- package/dist/emails/auth/password-reset.d.ts +37 -0
- package/dist/emails/auth/password-reset.js +1 -0
- package/dist/emails/layout.d.ts +10 -0
- package/dist/emails/layout.js +1 -0
- package/dist/emails/manager/affiliate-activated.d.ts +33 -0
- package/dist/emails/manager/affiliate-activated.js +1 -0
- package/dist/emails/manager/bulk-affiliates-activated.d.ts +33 -0
- package/dist/emails/manager/bulk-affiliates-activated.js +1 -0
- package/dist/emails/manager/invite.d.ts +35 -0
- package/dist/emails/manager/invite.js +1 -0
- package/dist/emails/manager/pending-approval.d.ts +33 -0
- package/dist/emails/manager/pending-approval.js +1 -0
- package/dist/emails/preview-env.d.ts +2 -0
- package/dist/emails/preview-env.js +1 -0
- package/dist/features/affiliates/actions.d.ts +60 -0
- package/dist/features/affiliates/actions.js +1 -0
- package/dist/features/affiliates/activation-email.d.ts +8 -0
- package/dist/features/affiliates/activation-email.js +1 -0
- package/dist/features/affiliates/bulk-approve.d.ts +2 -0
- package/dist/features/affiliates/bulk-approve.js +1 -0
- package/dist/features/affiliates/components/affiliate-actions-menu.d.ts +6 -0
- package/dist/features/affiliates/components/affiliate-actions-menu.js +1 -0
- package/dist/features/affiliates/components/affiliate-create-button.d.ts +1 -0
- package/dist/features/affiliates/components/affiliate-create-button.js +1 -0
- package/dist/features/affiliates/components/affiliate-detail-tabs.d.ts +6 -0
- package/dist/features/affiliates/components/affiliate-detail-tabs.js +1 -0
- package/dist/features/affiliates/components/affiliate-dialog.d.ts +11 -0
- package/dist/features/affiliates/components/affiliate-dialog.js +1 -0
- package/dist/features/affiliates/components/affiliate-profile-fields.d.ts +6 -0
- package/dist/features/affiliates/components/affiliate-profile-fields.js +1 -0
- package/dist/features/affiliates/components/affiliate-status-badge.d.ts +4 -0
- package/dist/features/affiliates/components/affiliate-status-badge.js +1 -0
- package/dist/features/affiliates/components/affiliate-status-tabs.d.ts +4 -0
- package/dist/features/affiliates/components/affiliate-status-tabs.js +1 -0
- package/dist/features/affiliates/components/affiliates-table.d.ts +10 -0
- package/dist/features/affiliates/components/affiliates-table.js +1 -0
- package/dist/features/affiliates/components/assign-parent-dialog.d.ts +5 -0
- package/dist/features/affiliates/components/assign-parent-dialog.js +1 -0
- package/dist/features/affiliates/components/detach-affiliate-confirm.d.ts +5 -0
- package/dist/features/affiliates/components/detach-affiliate-confirm.js +1 -0
- package/dist/features/affiliates/components/reject-affiliate-confirm.d.ts +5 -0
- package/dist/features/affiliates/components/reject-affiliate-confirm.js +1 -0
- package/dist/features/affiliates/components/sub-affiliate-invite-button.d.ts +3 -0
- package/dist/features/affiliates/components/sub-affiliate-invite-button.js +1 -0
- package/dist/features/affiliates/invite.d.ts +6 -0
- package/dist/features/affiliates/invite.js +1 -0
- package/dist/features/affiliates/list-params.d.ts +27 -0
- package/dist/features/affiliates/list-params.js +1 -0
- package/dist/features/affiliates/pending-notification.d.ts +18 -0
- package/dist/features/affiliates/pending-notification.js +1 -0
- package/dist/features/affiliates/sub-invite.d.ts +7 -0
- package/dist/features/affiliates/sub-invite.js +1 -0
- package/dist/features/audit/action-labels.d.ts +15 -0
- package/dist/features/audit/action-labels.js +1 -0
- package/dist/features/audit/components/audit-log-table.d.ts +5 -0
- package/dist/features/audit/components/audit-log-table.js +1 -0
- package/dist/features/audit/list-params.d.ts +2 -0
- package/dist/features/audit/list-params.js +1 -0
- package/dist/features/audit/read.d.ts +27 -0
- package/dist/features/audit/read.js +1 -0
- package/dist/features/auth/actions.d.ts +33 -0
- package/dist/features/auth/actions.js +1 -0
- package/dist/features/auth/authorization.d.ts +14 -0
- package/dist/features/auth/authorization.js +1 -0
- package/dist/features/auth/components/accept-invite-form.d.ts +3 -0
- package/dist/features/auth/components/accept-invite-form.js +1 -0
- package/dist/features/auth/components/forgot-password-form.d.ts +1 -0
- package/dist/features/auth/components/forgot-password-form.js +1 -0
- package/dist/features/auth/components/permissions-form.d.ts +5 -0
- package/dist/features/auth/components/permissions-form.js +1 -0
- package/dist/features/auth/components/reset-password-form.d.ts +3 -0
- package/dist/features/auth/components/reset-password-form.js +1 -0
- package/dist/features/auth/components/signin-form.d.ts +5 -0
- package/dist/features/auth/components/signin-form.js +1 -0
- package/dist/features/auth/components/signup-form.d.ts +1 -0
- package/dist/features/auth/components/signup-form.js +1 -0
- package/dist/features/auth/components/verify-email-form.d.ts +3 -0
- package/dist/features/auth/components/verify-email-form.js +1 -0
- package/dist/features/auth/password-reset.d.ts +6 -0
- package/dist/features/auth/password-reset.js +1 -0
- package/dist/features/auth/permissions.d.ts +49 -0
- package/dist/features/auth/permissions.js +1 -0
- package/dist/features/auth/require.d.ts +3 -0
- package/dist/features/auth/require.js +1 -0
- package/dist/features/auth/signup-email.d.ts +6 -0
- package/dist/features/auth/signup-email.js +1 -0
- package/dist/features/campaigns/actions.d.ts +53 -0
- package/dist/features/campaigns/actions.js +1 -0
- package/dist/features/campaigns/components/campaign-dialog.d.ts +7 -0
- package/dist/features/campaigns/components/campaign-dialog.js +1 -0
- package/dist/features/campaigns/components/campaign-row-actions.d.ts +8 -0
- package/dist/features/campaigns/components/campaign-row-actions.js +1 -0
- package/dist/features/campaigns/components/campaign-status-badge.d.ts +6 -0
- package/dist/features/campaigns/components/campaign-status-badge.js +1 -0
- package/dist/features/campaigns/components/campaign-status-tabs.d.ts +1 -0
- package/dist/features/campaigns/components/campaign-status-tabs.js +1 -0
- package/dist/features/campaigns/components/campaigns-table.d.ts +7 -0
- package/dist/features/campaigns/components/campaigns-table.js +1 -0
- package/dist/features/campaigns/components/create-campaign-button.d.ts +5 -0
- package/dist/features/campaigns/components/create-campaign-button.js +1 -0
- package/dist/features/campaigns/components/sub-id-builder.d.ts +4 -0
- package/dist/features/campaigns/components/sub-id-builder.js +1 -0
- package/dist/features/campaigns/components/tracking-link-box.d.ts +3 -0
- package/dist/features/campaigns/components/tracking-link-box.js +1 -0
- package/dist/features/campaigns/components/tracking-link-cell.d.ts +4 -0
- package/dist/features/campaigns/components/tracking-link-cell.js +1 -0
- package/dist/features/campaigns/components/tracking-link-dialog.d.ts +6 -0
- package/dist/features/campaigns/components/tracking-link-dialog.js +1 -0
- package/dist/features/campaigns/list-params.d.ts +14 -0
- package/dist/features/campaigns/list-params.js +1 -0
- package/dist/features/campaigns/tracking-url.d.ts +8 -0
- package/dist/features/campaigns/tracking-url.js +1 -0
- package/dist/features/casinos/actions.d.ts +39 -0
- package/dist/features/casinos/actions.js +1 -0
- package/dist/features/casinos/components/casino-create-button.d.ts +1 -0
- package/dist/features/casinos/components/casino-create-button.js +1 -0
- package/dist/features/casinos/components/casino-dialog.d.ts +11 -0
- package/dist/features/casinos/components/casino-dialog.js +1 -0
- package/dist/features/casinos/components/casino-form-fields.d.ts +7 -0
- package/dist/features/casinos/components/casino-form-fields.js +1 -0
- package/dist/features/casinos/components/casino-status-tabs.d.ts +1 -0
- package/dist/features/casinos/components/casino-status-tabs.js +1 -0
- package/dist/features/casinos/components/casinos-table.d.ts +6 -0
- package/dist/features/casinos/components/casinos-table.js +1 -0
- package/dist/features/casinos/components/delete-casino-confirm.d.ts +5 -0
- package/dist/features/casinos/components/delete-casino-confirm.js +1 -0
- package/dist/features/casinos/list-params.d.ts +14 -0
- package/dist/features/casinos/list-params.js +1 -0
- package/dist/features/commissions/actions.d.ts +76 -0
- package/dist/features/commissions/actions.js +1 -0
- package/dist/features/commissions/components/casino-bindings-field.d.ts +10 -0
- package/dist/features/commissions/components/casino-bindings-field.js +1 -0
- package/dist/features/commissions/components/commission-create-button.d.ts +1 -0
- package/dist/features/commissions/components/commission-create-button.js +1 -0
- package/dist/features/commissions/components/commission-detail-dialog.d.ts +5 -0
- package/dist/features/commissions/components/commission-detail-dialog.js +1 -0
- package/dist/features/commissions/components/commission-editor.d.ts +8 -0
- package/dist/features/commissions/components/commission-editor.js +1 -0
- package/dist/features/commissions/components/commission-read-view.d.ts +5 -0
- package/dist/features/commissions/components/commission-read-view.js +1 -0
- package/dist/features/commissions/components/commission-status-badge.d.ts +4 -0
- package/dist/features/commissions/components/commission-status-badge.js +1 -0
- package/dist/features/commissions/components/commission-status-tabs.d.ts +1 -0
- package/dist/features/commissions/components/commission-status-tabs.js +1 -0
- package/dist/features/commissions/components/commissions-table.d.ts +14 -0
- package/dist/features/commissions/components/commissions-table.js +1 -0
- package/dist/features/commissions/components/delete-commission-confirm.d.ts +5 -0
- package/dist/features/commissions/components/delete-commission-confirm.js +1 -0
- package/dist/features/commissions/components/duplicate-commission-dialog.d.ts +6 -0
- package/dist/features/commissions/components/duplicate-commission-dialog.js +1 -0
- package/dist/features/commissions/components/rule-editor/conditions-block.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/conditions-block.js +1 -0
- package/dist/features/commissions/components/rule-editor/modifiers-block.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/modifiers-block.js +1 -0
- package/dist/features/commissions/components/rule-editor/qualifiers-block.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/qualifiers-block.js +1 -0
- package/dist/features/commissions/components/rule-editor/reducer.d.ts +102 -0
- package/dist/features/commissions/components/rule-editor/reducer.js +1 -0
- package/dist/features/commissions/components/rule-editor/rewards-block.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/rewards-block.js +1 -0
- package/dist/features/commissions/components/rule-editor/rule-card.d.ts +10 -0
- package/dist/features/commissions/components/rule-editor/rule-card.js +1 -0
- package/dist/features/commissions/components/rule-editor/rule-editor.d.ts +7 -0
- package/dist/features/commissions/components/rule-editor/rule-editor.js +1 -0
- package/dist/features/commissions/components/rule-editor/rule-group-card.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/rule-group-card.js +1 -0
- package/dist/features/commissions/components/rule-editor/state.d.ts +21 -0
- package/dist/features/commissions/components/rule-editor/state.js +1 -0
- package/dist/features/commissions/components/rule-groups-read-view.d.ts +4 -0
- package/dist/features/commissions/components/rule-groups-read-view.js +1 -0
- package/dist/features/commissions/list-params.d.ts +14 -0
- package/dist/features/commissions/list-params.js +1 -0
- package/dist/features/commissions/rule-validation.d.ts +173 -0
- package/dist/features/commissions/rule-validation.js +1 -0
- package/dist/features/dashboard/affiliate-queries.d.ts +14 -0
- package/dist/features/dashboard/affiliate-queries.js +1 -0
- package/dist/features/dashboard/clickhouse.d.ts +3 -0
- package/dist/features/dashboard/clickhouse.js +2 -0
- package/dist/features/dashboard/components/affiliate-charts.d.ts +5 -0
- package/dist/features/dashboard/components/affiliate-charts.js +1 -0
- package/dist/features/dashboard/components/affiliate-stats.d.ts +5 -0
- package/dist/features/dashboard/components/affiliate-stats.js +1 -0
- package/dist/features/dashboard/components/charts/funnel-chart.d.ts +11 -0
- package/dist/features/dashboard/components/charts/funnel-chart.js +1 -0
- package/dist/features/dashboard/components/charts/rank-bar-chart.d.ts +10 -0
- package/dist/features/dashboard/components/charts/rank-bar-chart.js +1 -0
- package/dist/features/dashboard/components/charts/time-series-chart.d.ts +12 -0
- package/dist/features/dashboard/components/charts/time-series-chart.js +1 -0
- package/dist/features/dashboard/components/charts-grid.d.ts +8 -0
- package/dist/features/dashboard/components/charts-grid.js +1 -0
- package/dist/features/dashboard/components/dashboard-charts.d.ts +4 -0
- package/dist/features/dashboard/components/dashboard-charts.js +1 -0
- package/dist/features/dashboard/components/dashboard-period-tabs.d.ts +1 -0
- package/dist/features/dashboard/components/dashboard-period-tabs.js +1 -0
- package/dist/features/dashboard/components/money-stat-card.d.ts +6 -0
- package/dist/features/dashboard/components/money-stat-card.js +1 -0
- package/dist/features/dashboard/components/stat-card.d.ts +6 -0
- package/dist/features/dashboard/components/stat-card.js +1 -0
- package/dist/features/dashboard/components/top-affiliates.d.ts +4 -0
- package/dist/features/dashboard/components/top-affiliates.js +1 -0
- package/dist/features/dashboard/list-params.d.ts +24 -0
- package/dist/features/dashboard/list-params.js +1 -0
- package/dist/features/dashboard/queries.d.ts +63 -0
- package/dist/features/dashboard/queries.js +1 -0
- package/dist/features/dashboard/series.d.ts +32 -0
- package/dist/features/dashboard/series.js +1 -0
- package/dist/features/deals/actions.d.ts +60 -0
- package/dist/features/deals/actions.js +1 -0
- package/dist/features/deals/components/affiliate-deals.d.ts +10 -0
- package/dist/features/deals/components/affiliate-deals.js +1 -0
- package/dist/features/deals/components/assign-deal-button.d.ts +9 -0
- package/dist/features/deals/components/assign-deal-button.js +1 -0
- package/dist/features/deals/components/deal-dialog.d.ts +19 -0
- package/dist/features/deals/components/deal-dialog.js +1 -0
- package/dist/features/deals/components/deal-row-actions.d.ts +6 -0
- package/dist/features/deals/components/deal-row-actions.js +1 -0
- package/dist/features/deals/components/deal-status-badge.d.ts +10 -0
- package/dist/features/deals/components/deal-status-badge.js +1 -0
- package/dist/features/deals/components/deal-status-tabs.d.ts +1 -0
- package/dist/features/deals/components/deal-status-tabs.js +1 -0
- package/dist/features/deals/components/delegate-deal-button.d.ts +8 -0
- package/dist/features/deals/components/delegate-deal-button.js +1 -0
- package/dist/features/deals/deal-assigned-email.d.ts +11 -0
- package/dist/features/deals/deal-assigned-email.js +1 -0
- package/dist/features/deals/deal-delegated-email.d.ts +13 -0
- package/dist/features/deals/deal-delegated-email.js +1 -0
- package/dist/features/deals/list-params.d.ts +14 -0
- package/dist/features/deals/list-params.js +1 -0
- package/dist/features/earnings/components/earnings-balances.d.ts +4 -0
- package/dist/features/earnings/components/earnings-balances.js +1 -0
- package/dist/features/earnings/components/earnings-ledger.d.ts +5 -0
- package/dist/features/earnings/components/earnings-ledger.js +1 -0
- package/dist/features/earnings/components/earnings-status-badge.d.ts +4 -0
- package/dist/features/earnings/components/earnings-status-badge.js +1 -0
- package/dist/features/earnings/components/earnings-status-tabs.d.ts +1 -0
- package/dist/features/earnings/components/earnings-status-tabs.js +1 -0
- package/dist/features/earnings/components/sub-affiliate-earnings.d.ts +4 -0
- package/dist/features/earnings/components/sub-affiliate-earnings.js +1 -0
- package/dist/features/earnings/list-params.d.ts +14 -0
- package/dist/features/earnings/list-params.js +1 -0
- package/dist/features/earnings/queries.d.ts +30 -0
- package/dist/features/earnings/queries.js +1 -0
- package/dist/features/groups/actions.d.ts +36 -0
- package/dist/features/groups/actions.js +1 -0
- package/dist/features/groups/components/delete-group-confirm.d.ts +5 -0
- package/dist/features/groups/components/delete-group-confirm.js +1 -0
- package/dist/features/groups/components/group-create-button.d.ts +1 -0
- package/dist/features/groups/components/group-create-button.js +1 -0
- package/dist/features/groups/components/group-dialog.d.ts +11 -0
- package/dist/features/groups/components/group-dialog.js +1 -0
- package/dist/features/groups/components/group-form-fields.d.ts +10 -0
- package/dist/features/groups/components/group-form-fields.js +1 -0
- package/dist/features/groups/components/group-status-tabs.d.ts +1 -0
- package/dist/features/groups/components/group-status-tabs.js +1 -0
- package/dist/features/groups/components/groups-table.d.ts +9 -0
- package/dist/features/groups/components/groups-table.js +1 -0
- package/dist/features/groups/list-params.d.ts +14 -0
- package/dist/features/groups/list-params.js +1 -0
- package/dist/features/managers/actions.d.ts +43 -0
- package/dist/features/managers/actions.js +1 -0
- package/dist/features/managers/components/manager-create-button.d.ts +1 -0
- package/dist/features/managers/components/manager-create-button.js +1 -0
- package/dist/features/managers/components/manager-dialog.d.ts +11 -0
- package/dist/features/managers/components/manager-dialog.js +1 -0
- package/dist/features/managers/components/manager-permissions-dialog.d.ts +7 -0
- package/dist/features/managers/components/manager-permissions-dialog.js +1 -0
- package/dist/features/managers/components/manager-profile-fields.d.ts +7 -0
- package/dist/features/managers/components/manager-profile-fields.js +1 -0
- package/dist/features/managers/components/manager-status-tabs.d.ts +1 -0
- package/dist/features/managers/components/manager-status-tabs.js +1 -0
- package/dist/features/managers/components/managers-table.d.ts +8 -0
- package/dist/features/managers/components/managers-table.js +1 -0
- package/dist/features/managers/invite.d.ts +6 -0
- package/dist/features/managers/invite.js +1 -0
- package/dist/features/managers/list-params.d.ts +14 -0
- package/dist/features/managers/list-params.js +1 -0
- package/dist/features/payouts/actions.d.ts +12 -0
- package/dist/features/payouts/actions.js +1 -0
- package/dist/features/payouts/balance.d.ts +2 -0
- package/dist/features/payouts/balance.js +1 -0
- package/dist/features/payouts/components/my-payouts-table.d.ts +5 -0
- package/dist/features/payouts/components/my-payouts-table.js +1 -0
- package/dist/features/payouts/components/payout-row-actions.d.ts +5 -0
- package/dist/features/payouts/components/payout-row-actions.js +1 -0
- package/dist/features/payouts/components/payout-status-badge.d.ts +4 -0
- package/dist/features/payouts/components/payout-status-badge.js +1 -0
- package/dist/features/payouts/components/payout-status-tabs.d.ts +1 -0
- package/dist/features/payouts/components/payout-status-tabs.js +1 -0
- package/dist/features/payouts/components/payouts-table.d.ts +6 -0
- package/dist/features/payouts/components/payouts-table.js +1 -0
- package/dist/features/payouts/components/request-payout-dialog.d.ts +4 -0
- package/dist/features/payouts/components/request-payout-dialog.js +1 -0
- package/dist/features/payouts/constants.d.ts +2 -0
- package/dist/features/payouts/constants.js +1 -0
- package/dist/features/payouts/list-params.d.ts +14 -0
- package/dist/features/payouts/list-params.js +1 -0
- package/dist/features/payouts/my-queries.d.ts +14 -0
- package/dist/features/payouts/my-queries.js +1 -0
- package/dist/features/payouts/queries.d.ts +14 -0
- package/dist/features/payouts/queries.js +1 -0
- package/dist/features/postbacks/actions.d.ts +27 -0
- package/dist/features/postbacks/actions.js +1 -0
- package/dist/features/postbacks/components/integration-dialog.d.ts +6 -0
- package/dist/features/postbacks/components/integration-dialog.js +1 -0
- package/dist/features/postbacks/components/postback-editor.d.ts +5 -0
- package/dist/features/postbacks/components/postback-editor.js +1 -0
- package/dist/features/postbacks/components/postbacks-table.d.ts +4 -0
- package/dist/features/postbacks/components/postbacks-table.js +1 -0
- package/dist/features/settings/actions.d.ts +2 -0
- package/dist/features/settings/actions.js +1 -0
- package/dist/features/settings/components/affiliate-approval-setting.d.ts +3 -0
- package/dist/features/settings/components/affiliate-approval-setting.js +1 -0
- package/dist/features/settings/components/manager-totp-setting.d.ts +3 -0
- package/dist/features/settings/components/manager-totp-setting.js +1 -0
- package/dist/features/support/actions.d.ts +12 -0
- package/dist/features/support/actions.js +1 -0
- package/dist/features/support/components/support-page.d.ts +4 -0
- package/dist/features/support/components/support-page.js +1 -0
- package/dist/features/support/email.d.ts +13 -0
- package/dist/features/support/email.js +1 -0
- package/dist/features/users/actions.d.ts +4 -0
- package/dist/features/users/actions.js +1 -0
- package/dist/features/users/components/password-section.d.ts +1 -0
- package/dist/features/users/components/password-section.js +1 -0
- package/dist/features/users/components/preferences-section.d.ts +4 -0
- package/dist/features/users/components/preferences-section.js +1 -0
- package/dist/features/users/components/settings-tabs.d.ts +1 -0
- package/dist/features/users/components/settings-tabs.js +1 -0
- package/dist/features/users/components/totp-section.d.ts +4 -0
- package/dist/features/users/components/totp-section.js +1 -0
- package/dist/features/users/list-params.d.ts +12 -0
- package/dist/features/users/list-params.js +1 -0
- package/dist/features/users/totp.d.ts +7 -0
- package/dist/features/users/totp.js +1 -0
- package/dist/i18n/config.d.ts +5 -0
- package/dist/i18n/config.js +1 -0
- package/dist/i18n/get-locale.d.ts +3 -0
- package/dist/i18n/get-locale.js +1 -0
- package/dist/i18n/locale.d.ts +2 -0
- package/dist/i18n/locale.js +1 -0
- package/dist/lib/actions/parse-form.d.ts +3 -0
- package/dist/lib/actions/parse-form.js +1 -0
- package/dist/lib/actions/state.d.ts +22 -0
- package/dist/lib/actions/state.js +0 -0
- package/dist/lib/audit/actions.d.ts +9 -0
- package/dist/lib/audit/actions.js +1 -0
- package/dist/lib/audit/record.d.ts +4 -0
- package/dist/lib/audit/record.js +1 -0
- package/dist/lib/auth/action.d.ts +45 -0
- package/dist/lib/auth/action.js +1 -0
- package/dist/lib/auth/config.d.ts +24 -0
- package/dist/lib/auth/config.js +1 -0
- package/dist/lib/auth/jwt.d.ts +17 -0
- package/dist/lib/auth/jwt.js +1 -0
- package/dist/lib/auth/password-options.d.ts +6 -0
- package/dist/lib/auth/password-options.js +1 -0
- package/dist/lib/auth/password.d.ts +3 -0
- package/dist/lib/auth/password.js +1 -0
- package/dist/lib/auth/session.d.ts +26 -0
- package/dist/lib/auth/session.js +1 -0
- package/dist/lib/auth/tokens.d.ts +43 -0
- package/dist/lib/auth/tokens.js +1 -0
- package/dist/lib/auth/totp-challenge.d.ts +4 -0
- package/dist/lib/auth/totp-challenge.js +1 -0
- package/dist/lib/auth/totp.d.ts +7 -0
- package/dist/lib/auth/totp.js +1 -0
- package/dist/lib/auth/verification-tokens.d.ts +19 -0
- package/dist/lib/auth/verification-tokens.js +1 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/cn.js +1 -0
- package/dist/lib/countries.d.ts +18 -0
- package/dist/lib/countries.js +1 -0
- package/dist/lib/currencies.d.ts +6 -0
- package/dist/lib/currencies.js +1 -0
- package/dist/lib/data/countries-by-continent.json +257 -0
- package/dist/lib/db/errors.d.ts +4 -0
- package/dist/lib/db/errors.js +1 -0
- package/dist/lib/email/client.d.ts +6 -0
- package/dist/lib/email/client.js +1 -0
- package/dist/lib/email/env.d.ts +12 -0
- package/dist/lib/email/env.js +1 -0
- package/dist/lib/email/format.d.ts +5 -0
- package/dist/lib/email/format.js +1 -0
- package/dist/lib/email/locale.d.ts +3 -0
- package/dist/lib/email/locale.js +1 -0
- package/dist/lib/email/send.d.ts +12 -0
- package/dist/lib/email/send.js +1 -0
- package/dist/lib/env.d.ts +20 -0
- package/dist/lib/env.js +1 -0
- package/dist/lib/errors/codes.d.ts +72 -0
- package/dist/lib/errors/codes.js +1 -0
- package/dist/lib/errors/server.d.ts +10 -0
- package/dist/lib/errors/server.js +1 -0
- package/dist/lib/format.d.ts +3 -0
- package/dist/lib/format.js +1 -0
- package/dist/lib/hooks/use-deferred-dialog.d.ts +11 -0
- package/dist/lib/hooks/use-deferred-dialog.js +1 -0
- package/dist/lib/hooks/use-form-reset.d.ts +2 -0
- package/dist/lib/hooks/use-form-reset.js +1 -0
- package/dist/lib/hooks/use-form-toast.d.ts +2 -0
- package/dist/lib/hooks/use-form-toast.js +1 -0
- package/dist/lib/i18n/format-datetime.d.ts +1 -0
- package/dist/lib/i18n/format-datetime.js +1 -0
- package/dist/lib/i18n/relative-time.d.ts +1 -0
- package/dist/lib/i18n/relative-time.js +1 -0
- package/dist/lib/list-params.d.ts +51 -0
- package/dist/lib/list-params.js +1 -0
- package/dist/lib/money.d.ts +2 -0
- package/dist/lib/money.js +1 -0
- package/dist/lib/platform-settings.d.ts +5 -0
- package/dist/lib/platform-settings.js +1 -0
- package/dist/lib/preferences/actions.d.ts +1 -0
- package/dist/lib/preferences/actions.js +1 -0
- package/dist/lib/preferences/index.d.ts +15 -0
- package/dist/lib/preferences/index.js +1 -0
- package/dist/lib/preferences/read.d.ts +2 -0
- package/dist/lib/preferences/read.js +1 -0
- package/dist/lib/slug.d.ts +1 -0
- package/dist/lib/slug.js +1 -0
- package/dist/lib/toast.d.ts +13 -0
- package/dist/lib/toast.js +1 -0
- package/dist/lib/tracking-cache.d.ts +2 -0
- package/dist/lib/tracking-cache.js +1 -0
- package/dist/lib/users.d.ts +12 -0
- package/dist/lib/users.js +1 -0
- package/dist/lib/validation/zod.d.ts +30 -0
- package/dist/lib/validation/zod.js +1 -0
- package/dist/messages/de/emails.json +136 -0
- package/dist/messages/de/index.json +1104 -0
- package/dist/messages/en/emails.json +136 -0
- package/dist/messages/en/index.json +1104 -0
- package/dist/theme/config.d.ts +8 -0
- package/dist/theme/config.js +1 -0
- package/dist/theme/get-theme.d.ts +3 -0
- package/dist/theme/get-theme.js +1 -0
- package/dist/theme/theme.d.ts +2 -0
- package/dist/theme/theme.js +1 -0
- package/package.json +131 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"server-only";import{z as r}from"zod";const i=r.object({SMTP_HOST:r.string().min(1),SMTP_PORT:r.coerce.number().int().positive().default(587),SMTP_USER:r.string().min(1),SMTP_PASSWORD:r.string().min(1),EMAIL_FROM:r.string().min(1)});function o(){const e=i.safeParse(process.env);if(!e.success)throw new Error(`Invalid email environment variables: ${JSON.stringify(r.treeifyError(e.error))}`);return e.data}export{o as emailEnv};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"server-only";function o(t,e){return e.dateTime(t,{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"})}export{o as formatTokenExpiry};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"server-only";import{db as l}from"../../db/index.js";import{userPreferences as r}from"../../db/schema/index.js";import{eq as t}from"drizzle-orm";import{defaultLocale as a,locales as c}from"../../i18n/config.js";async function p(o){const[e]=await l.select({locale:r.locale}).from(r).where(t(r.userId,o)).limit(1);return e?.locale&&c.includes(e.locale)?e.locale:a}export{p as resolveUserLocale};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
import type { ReactElement } from "react";
|
|
3
|
+
type SendEmailArgs = {
|
|
4
|
+
to: string;
|
|
5
|
+
subject: string;
|
|
6
|
+
react: ReactElement;
|
|
7
|
+
text?: string;
|
|
8
|
+
bcc?: string | string[];
|
|
9
|
+
replyTo?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function sendEmail({ to, subject, react, text, bcc, replyTo, }: SendEmailArgs): Promise<void>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"server-only";import{render as n}from"@react-email/render";import{getTransporter as g}from"./client.js";async function E({to:i,subject:a,react:t,text:o,bcc:r,replyTo:e}){const{transporter:s,from:m}=g(),p=await n(t),c=o??await n(t,{plainText:!0});await s.sendMail({from:m,to:i,subject:a,html:p,text:c,...r?{bcc:r}:{},...e?{replyTo:e}:{}})}export{E as sendEmail};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const EnvSchema: z.ZodObject<{
|
|
3
|
+
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
4
|
+
production: "production";
|
|
5
|
+
development: "development";
|
|
6
|
+
}>>;
|
|
7
|
+
DATABASE_URL: z.ZodURL;
|
|
8
|
+
JWT_SECRET: z.ZodString;
|
|
9
|
+
TOTP_ENCRYPTION_KEY: z.ZodString;
|
|
10
|
+
APP_URL: z.ZodURL;
|
|
11
|
+
BRAND_NAME: z.ZodDefault<z.ZodString>;
|
|
12
|
+
TRACKER_BASE_URL: z.ZodURL;
|
|
13
|
+
CLICKHOUSE_URL: z.ZodOptional<z.ZodURL>;
|
|
14
|
+
CLICKHOUSE_DATABASE: z.ZodDefault<z.ZodString>;
|
|
15
|
+
CLICKHOUSE_USER: z.ZodOptional<z.ZodString>;
|
|
16
|
+
CLICKHOUSE_PASSWORD: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type Env = z.infer<typeof EnvSchema>;
|
|
19
|
+
export declare const env: Env;
|
|
20
|
+
export {};
|
package/dist/lib/env.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"zod";const t=e.object({NODE_ENV:e.enum(["development","production"]).default("development"),DATABASE_URL:e.url(),JWT_SECRET:e.string().regex(/^[A-Za-z0-9_-]{64,}$/,"must be \u226564 base64url chars (use crypto.randomBytes(48).toString('base64url'))"),TOTP_ENCRYPTION_KEY:e.string().regex(/^[A-Za-z0-9_-]{43}$/,"must be 32 base64url-encoded bytes (use crypto.randomBytes(32).toString('base64url'))"),APP_URL:e.url(),BRAND_NAME:e.string().trim().min(1).default("Myfiliate"),TRACKER_BASE_URL:e.url(),CLICKHOUSE_URL:e.url().optional(),CLICKHOUSE_DATABASE:e.string().default("analytics"),CLICKHOUSE_USER:e.string().optional(),CLICKHOUSE_PASSWORD:e.string().optional()}),n=process.env.SKIP_ENV_VALIDATION==="1",s=n?t.partial():t,r=s.safeParse(process.env);if(!r.success)throw new Error(`Invalid environment variables: ${JSON.stringify(e.treeifyError(r.error))}`);const a=r.data;export{a as env};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
declare const ERROR_I18N_KEY: {
|
|
2
|
+
readonly unauthorized: "Errors.unauthorized";
|
|
3
|
+
readonly forbidden: "Errors.forbidden";
|
|
4
|
+
readonly not_found: "Errors.notFound";
|
|
5
|
+
readonly service_unavailable: "Errors.serviceUnavailable";
|
|
6
|
+
readonly invalid_input: "Errors.invalidInput";
|
|
7
|
+
readonly payout_no_balance: "Errors.payoutNoBalance";
|
|
8
|
+
readonly payout_amount_exceeds_balance: "Errors.payoutAmountExceedsBalance";
|
|
9
|
+
readonly payout_not_found: "Errors.payoutNotFound";
|
|
10
|
+
readonly payout_invalid_status: "Errors.payoutInvalidStatus";
|
|
11
|
+
readonly invalid_credentials: "Errors.invalidCredentials";
|
|
12
|
+
readonly user_blocked: "Errors.userBlocked";
|
|
13
|
+
readonly email_already_exists: "Errors.emailAlreadyExists";
|
|
14
|
+
readonly user_not_found: "Errors.userNotFound";
|
|
15
|
+
readonly group_not_found: "Errors.groupNotFound";
|
|
16
|
+
readonly group_name_exists: "Errors.groupNameExists";
|
|
17
|
+
readonly group_has_members: "Errors.groupHasMembers";
|
|
18
|
+
readonly invalid_token: "Errors.invalidToken";
|
|
19
|
+
readonly cannot_target_self: "Errors.cannotTargetSelf";
|
|
20
|
+
readonly cannot_edit_own_group: "Errors.cannotEditOwnGroup";
|
|
21
|
+
readonly invite_already_accepted: "Errors.inviteAlreadyAccepted";
|
|
22
|
+
readonly totp_already_enabled: "Errors.totpAlreadyEnabled";
|
|
23
|
+
readonly totp_invalid_code: "Errors.totpInvalidCode";
|
|
24
|
+
readonly totp_challenge_expired: "Errors.totpChallengeExpired";
|
|
25
|
+
readonly totp_disable_blocked: "Errors.totpDisableBlocked";
|
|
26
|
+
readonly email_not_verified: "Errors.emailNotVerified";
|
|
27
|
+
readonly affiliate_not_approved: "Errors.affiliateNotApproved";
|
|
28
|
+
readonly affiliate_already_approved: "Errors.affiliateAlreadyApproved";
|
|
29
|
+
readonly affiliate_not_pending: "Errors.affiliateNotPending";
|
|
30
|
+
readonly affiliate_not_rejected: "Errors.affiliateNotRejected";
|
|
31
|
+
readonly user_invite_pending: "Errors.userInvitePending";
|
|
32
|
+
readonly casino_name_exists: "Errors.casinoNameExists";
|
|
33
|
+
readonly casino_not_found: "Errors.casinoNotFound";
|
|
34
|
+
readonly casino_already_active: "Errors.casinoAlreadyActive";
|
|
35
|
+
readonly casino_already_inactive: "Errors.casinoAlreadyInactive";
|
|
36
|
+
readonly casino_has_campaigns: "Errors.casinoHasCampaigns";
|
|
37
|
+
readonly casino_in_commission: "Errors.casinoInCommission";
|
|
38
|
+
readonly casino_in_use: "Errors.casinoInUse";
|
|
39
|
+
readonly commission_not_found: "Errors.commissionNotFound";
|
|
40
|
+
readonly commission_not_draft: "Errors.commissionNotDraft";
|
|
41
|
+
readonly commission_not_published: "Errors.commissionNotPublished";
|
|
42
|
+
readonly commission_not_deactivated: "Errors.commissionNotDeactivated";
|
|
43
|
+
readonly deal_not_found: "Errors.dealNotFound";
|
|
44
|
+
readonly deal_not_active: "Errors.dealNotActive";
|
|
45
|
+
readonly deal_not_deactivated: "Errors.dealNotDeactivated";
|
|
46
|
+
readonly deal_commission_not_published: "Errors.dealCommissionNotPublished";
|
|
47
|
+
readonly deal_invalid_date_range: "Errors.dealInvalidDateRange";
|
|
48
|
+
readonly deal_start_in_past: "Errors.dealStartInPast";
|
|
49
|
+
readonly sub_affiliates_not_allowed: "Errors.subAffiliatesNotAllowed";
|
|
50
|
+
readonly affiliate_has_sub_affiliates: "Errors.affiliateHasSubAffiliates";
|
|
51
|
+
readonly affiliate_not_sub: "Errors.affiliateNotSub";
|
|
52
|
+
readonly campaign_not_found: "Errors.campaignNotFound";
|
|
53
|
+
readonly campaign_invalid_commission: "Errors.campaignInvalidCommission";
|
|
54
|
+
readonly campaign_not_active: "Errors.campaignNotActive";
|
|
55
|
+
readonly campaign_not_deactivated: "Errors.campaignNotDeactivated";
|
|
56
|
+
};
|
|
57
|
+
export type ErrorCode = keyof typeof ERROR_I18N_KEY;
|
|
58
|
+
export type AppErrorOptions = {
|
|
59
|
+
field?: string;
|
|
60
|
+
fieldErrors?: Record<string, string[]>;
|
|
61
|
+
toast?: boolean;
|
|
62
|
+
};
|
|
63
|
+
export type AppError = Error & {
|
|
64
|
+
code: ErrorCode;
|
|
65
|
+
} & AppErrorOptions;
|
|
66
|
+
export declare function appError(code: ErrorCode, options?: AppErrorOptions): AppError;
|
|
67
|
+
export declare function isAppError(err: unknown, code?: ErrorCode): err is AppError;
|
|
68
|
+
export declare function isKnownErrorCode(value: string): value is ErrorCode;
|
|
69
|
+
export type ErrorI18nKey = (typeof ERROR_I18N_KEY)[ErrorCode];
|
|
70
|
+
export declare function errorI18nKey(code: ErrorCode): ErrorI18nKey;
|
|
71
|
+
export declare const UNKNOWN_ERROR_I18N_KEY: "Errors.unknown";
|
|
72
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a={unauthorized:"Errors.unauthorized",forbidden:"Errors.forbidden",not_found:"Errors.notFound",service_unavailable:"Errors.serviceUnavailable",invalid_input:"Errors.invalidInput",payout_no_balance:"Errors.payoutNoBalance",payout_amount_exceeds_balance:"Errors.payoutAmountExceedsBalance",payout_not_found:"Errors.payoutNotFound",payout_invalid_status:"Errors.payoutInvalidStatus",invalid_credentials:"Errors.invalidCredentials",user_blocked:"Errors.userBlocked",email_already_exists:"Errors.emailAlreadyExists",user_not_found:"Errors.userNotFound",group_not_found:"Errors.groupNotFound",group_name_exists:"Errors.groupNameExists",group_has_members:"Errors.groupHasMembers",invalid_token:"Errors.invalidToken",cannot_target_self:"Errors.cannotTargetSelf",cannot_edit_own_group:"Errors.cannotEditOwnGroup",invite_already_accepted:"Errors.inviteAlreadyAccepted",totp_already_enabled:"Errors.totpAlreadyEnabled",totp_invalid_code:"Errors.totpInvalidCode",totp_challenge_expired:"Errors.totpChallengeExpired",totp_disable_blocked:"Errors.totpDisableBlocked",email_not_verified:"Errors.emailNotVerified",affiliate_not_approved:"Errors.affiliateNotApproved",affiliate_already_approved:"Errors.affiliateAlreadyApproved",affiliate_not_pending:"Errors.affiliateNotPending",affiliate_not_rejected:"Errors.affiliateNotRejected",user_invite_pending:"Errors.userInvitePending",casino_name_exists:"Errors.casinoNameExists",casino_not_found:"Errors.casinoNotFound",casino_already_active:"Errors.casinoAlreadyActive",casino_already_inactive:"Errors.casinoAlreadyInactive",casino_has_campaigns:"Errors.casinoHasCampaigns",casino_in_commission:"Errors.casinoInCommission",casino_in_use:"Errors.casinoInUse",commission_not_found:"Errors.commissionNotFound",commission_not_draft:"Errors.commissionNotDraft",commission_not_published:"Errors.commissionNotPublished",commission_not_deactivated:"Errors.commissionNotDeactivated",deal_not_found:"Errors.dealNotFound",deal_not_active:"Errors.dealNotActive",deal_not_deactivated:"Errors.dealNotDeactivated",deal_commission_not_published:"Errors.dealCommissionNotPublished",deal_invalid_date_range:"Errors.dealInvalidDateRange",deal_start_in_past:"Errors.dealStartInPast",sub_affiliates_not_allowed:"Errors.subAffiliatesNotAllowed",affiliate_has_sub_affiliates:"Errors.affiliateHasSubAffiliates",affiliate_not_sub:"Errors.affiliateNotSub",campaign_not_found:"Errors.campaignNotFound",campaign_invalid_commission:"Errors.campaignInvalidCommission",campaign_not_active:"Errors.campaignNotActive",campaign_not_deactivated:"Errors.campaignNotDeactivated"},i=new Set(Object.keys(a));function t(r,e){const o=new Error(r);return o.name=r,o.digest=r,o.code=r,e?.field&&(o.field=e.field),e?.fieldErrors&&(o.fieldErrors=e.fieldErrors),e?.toast&&(o.toast=!0),o}function n(r,e){if(!(r instanceof Error))return!1;const o=r.code;return typeof o!="string"?!1:e!==void 0?o===e:i.has(o)}function s(r){return i.has(r)}function d(r){return a[r]}const _="Errors.unknown";export{_ as UNKNOWN_ERROR_I18N_KEY,t as appError,d as errorI18nKey,n as isAppError,s as isKnownErrorCode};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
import type messages from "../../messages/en/index.json";
|
|
3
|
+
type ToastKey = `Toasts.${Extract<keyof (typeof messages)["Toasts"], string>}`;
|
|
4
|
+
export declare function success(toastKey: ToastKey): Promise<{
|
|
5
|
+
message: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function success<T extends object>(data: T, toastKey: ToastKey): Promise<T & {
|
|
8
|
+
message: string;
|
|
9
|
+
}>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"server-only";import{getTranslations as o}from"next-intl/server";async function r(s,t){const e=await o();return typeof s=="string"?{message:e(s)}:{...s,message:e(t)}}export{r as success};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function i(t,r=4){return r<=0?t:t.match(new RegExp(`.{1,${r}}`,"g"))?.join(" ")??t}function e(t,r,n){return`${t.number(Number(r),{minimumFractionDigits:2,maximumFractionDigits:2})} ${n}`}export{i as chunkString,e as formatMoney};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type DeferredDialogController<T> = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
setOpen: (open: boolean) => void;
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
promise: Promise<T> | null;
|
|
6
|
+
/** Increments on every trigger; use as a `key` to remount the body per open. */
|
|
7
|
+
renderKey: number;
|
|
8
|
+
trigger: () => void;
|
|
9
|
+
reset: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function useDeferredDialog<T>(loader: () => Promise<T>): DeferredDialogController<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useCallback as i,useRef as T,useState as o,useTransition as D}from"react";function y(r){const[l,e]=o(!1),[a,u]=D(),[c,n]=o(null),[p,d]=o(0),t=T(r);t.current=r;const f=i(()=>{u(async()=>{const s=t.current();n(s),d(m=>m+1),await s,e(!0)})},[]),g=i(()=>{e(!1),n(null)},[]);return{open:l,setOpen:e,isLoading:a,promise:c,renderKey:p,trigger:f,reset:g}}export{y as useDeferredDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useCallback as l,useLayoutEffect as o,useRef as u}from"react";function f(e){const r=u(e);return o(()=>{r.current=e},[e]),l(s=>{const t=s?.closest("form");if(!t)return;const n=()=>r.current();return t.addEventListener("reset",n),()=>t.removeEventListener("reset",n)},[])}export{f as useFormReset};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useEffect as e,useRef as f}from"react";import{errorToast as i,successToast as t}from"../toast.js";function n(r){const o=f(void 0);e(()=>{if(!(!r||r===o.current)){if(o.current=r,r.ok){r.message&&t(r.message);return}r.toast&&i(r.error)}},[r])}export{n as useFormToast};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useFormatDateTime(): (date: Date) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useFormatter as m}from"next-intl";import{useCallback as i}from"react";function a(t,e){const r=t.dateTime(e,{day:"numeric",month:"short",year:"numeric"}),o=t.dateTime(e,{hour:"2-digit",minute:"2-digit"});return`${r}, ${o}`}function s(){const t=m();return i(e=>a(t,e),[t])}export{s as useFormatDateTime};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatRelative(locale: string, date: Date, now: Date): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const m=[["year",31536e6],["month",2592e6],["week",6048e5],["day",864e5],["hour",36e5],["minute",6e4]];function _(r,i,a){const e=new Intl.RelativeTimeFormat(r,{numeric:"auto"}),n=i.getTime()-a.getTime(),t=m.find(([,o])=>Math.abs(n)>=o);return t?e.format(Math.round(n/t[1]),t[0]):e.format(0,"minute")}export{_ as formatRelative};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const PAGE_SIZE_OPTIONS: readonly [10, 25, 50, 100];
|
|
2
|
+
export type SortDir = "asc" | "desc";
|
|
3
|
+
export declare const listSearchParsers: {
|
|
4
|
+
page: Omit<import("nuqs/server").SingleParserBuilder<number>, "parseServerSide"> & {
|
|
5
|
+
readonly defaultValue: number;
|
|
6
|
+
parseServerSide(value: string | string[] | undefined): number;
|
|
7
|
+
};
|
|
8
|
+
pageSize: Omit<import("nuqs/server").SingleParserBuilder<number>, "parseServerSide"> & {
|
|
9
|
+
readonly defaultValue: number;
|
|
10
|
+
parseServerSide(value: string | string[] | undefined): number;
|
|
11
|
+
};
|
|
12
|
+
q: Omit<import("nuqs/server").SingleParserBuilder<string>, "parseServerSide"> & {
|
|
13
|
+
readonly defaultValue: string;
|
|
14
|
+
parseServerSide(value: string | string[] | undefined): string;
|
|
15
|
+
};
|
|
16
|
+
sort: Omit<import("nuqs/server").SingleParserBuilder<string>, "parseServerSide"> & {
|
|
17
|
+
readonly defaultValue: string;
|
|
18
|
+
parseServerSide(value: string | string[] | undefined): string;
|
|
19
|
+
};
|
|
20
|
+
dir: import("nuqs/server").SingleParserBuilder<"asc" | "desc">;
|
|
21
|
+
};
|
|
22
|
+
export type PageInput = {
|
|
23
|
+
page: number;
|
|
24
|
+
pageSize: number;
|
|
25
|
+
};
|
|
26
|
+
export type ListParams<SortKey extends string> = PageInput & {
|
|
27
|
+
q: string;
|
|
28
|
+
sort: SortKey;
|
|
29
|
+
dir: SortDir;
|
|
30
|
+
};
|
|
31
|
+
export type ListResult<T> = PageInput & {
|
|
32
|
+
rows: T[];
|
|
33
|
+
total: number;
|
|
34
|
+
totalPages: number;
|
|
35
|
+
hasPrev: boolean;
|
|
36
|
+
hasNext: boolean;
|
|
37
|
+
};
|
|
38
|
+
type SearchParamsInput = Record<string, string | string[] | undefined> | Promise<Record<string, string | string[] | undefined>>;
|
|
39
|
+
export declare function parseListParams<SortKey extends string>(searchParams: SearchParamsInput, opts: {
|
|
40
|
+
sortKeys: readonly SortKey[];
|
|
41
|
+
defaultSort: SortKey;
|
|
42
|
+
defaultDir?: SortDir;
|
|
43
|
+
}): Promise<ListParams<SortKey>>;
|
|
44
|
+
export declare function paginate<T>(params: PageInput, ops: {
|
|
45
|
+
count: () => Promise<number>;
|
|
46
|
+
fetch: (args: {
|
|
47
|
+
offset: number;
|
|
48
|
+
limit: number;
|
|
49
|
+
}) => Promise<readonly T[]>;
|
|
50
|
+
}): Promise<ListResult<T>>;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createLoader as g,parseAsInteger as i,parseAsString as n,parseAsStringLiteral as S}from"nuqs/server";const c=50,p=[10,25,50,100],u=new Set(p),l=200,d=["asc","desc"],P={page:i.withDefault(1),pageSize:i.withDefault(c),q:n.withDefault(""),sort:n.withDefault(""),dir:S(d)},m=g(P);async function h(t,r){const a=await t,e=m(a),s=r.sortKeys.includes(e.sort)?e.sort:r.defaultSort,o=u.has(e.pageSize)?e.pageSize:c;return{page:Math.max(1,Math.floor(e.page)),pageSize:o,q:e.q.trim().slice(0,l),sort:s,dir:e.dir??r.defaultDir??"asc"}}async function y(t,r){const a=await r.count(),e=Math.max(1,Math.ceil(a/t.pageSize)),s=Math.min(Math.max(1,t.page),e);return{rows:(a===0?[]:await r.fetch({offset:(s-1)*t.pageSize,limit:t.pageSize})).slice(0,t.pageSize),page:s,pageSize:t.pageSize,total:a,totalPages:e,hasPrev:s>1,hasNext:s<e}}export{p as PAGE_SIZE_OPTIONS,P as listSearchParsers,y as paginate,h as parseListParams};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function u(t){return Math.round(Number(t)*100)}function o(t){const r=t<0?"-":"",n=Math.abs(t);return`${r}${Math.trunc(n/100)}.${String(n%100).padStart(2,"0")}`}export{o as formatCentsAmount,u as toCents};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
import { type Executor } from "../db/index.js";
|
|
3
|
+
import { type NewPlatformSettings, type PlatformSettings } from "../db/schema/index.js";
|
|
4
|
+
export declare const getPlatformSettings: () => Promise<PlatformSettings>;
|
|
5
|
+
export declare function updatePlatformSettings(changes: Omit<Partial<NewPlatformSettings>, "id" | "updatedAt" | "updatedBy">, updatedBy: string, executor?: Executor): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"server-only";import{db as r}from"../db/index.js";import{platformSettings as e}from"../db/schema/index.js";import{cache as a}from"react";const p=a(async()=>{const[t]=await r.select().from(e).limit(1);return t});async function l(t,o,i=r){await i.insert(e).values({...t,updatedBy:o}).onConflictDoUpdate({target:e.id,set:{...t,updatedBy:o,updatedAt:new Date}})}export{p as getPlatformSettings,l as updatePlatformSettings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setUserSidebarCollapsed(collapsed: boolean): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use server";import{cookies as o}from"next/headers";import{getCurrentUser as t}from"../auth/session.js";import{PREFERENCE_COOKIE_OPTIONS as s,SIDEBAR_COOKIE as i,writePreferencesForUser as a}from"./index.js";async function C(e){(await o()).set(i,String(e),s);const r=await t();r&&await a(r.id,{sidebarCollapsed:e})}export{C as setUserSidebarCollapsed};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
import { type Locale } from "../../i18n/config.js";
|
|
3
|
+
import { type Theme } from "../../theme/config.js";
|
|
4
|
+
export declare const SIDEBAR_COOKIE = "SIDEBAR";
|
|
5
|
+
export declare const PREFERENCE_COOKIE_OPTIONS: {
|
|
6
|
+
readonly path: "/";
|
|
7
|
+
readonly maxAge: number;
|
|
8
|
+
readonly sameSite: "lax";
|
|
9
|
+
};
|
|
10
|
+
export declare function writePreferencesForUser(userId: string, patch: {
|
|
11
|
+
locale?: Locale;
|
|
12
|
+
theme?: Theme;
|
|
13
|
+
sidebarCollapsed?: boolean;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
export declare function hydratePreferencesToCookies(userId: string): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"server-only";import{db as i}from"../../db/index.js";import{userPreferences as o}from"../../db/schema/index.js";import{eq as a}from"drizzle-orm";import{cookies as l}from"next/headers";import{LOCALE_COOKIE as m,locales as n}from"../../i18n/config.js";import{THEME_COOKIE as c,themes as f}from"../../theme/config.js";const p="SIDEBAR",s={path:"/",maxAge:3600*24*365,sameSite:"lax"};async function w(t,e){await i.insert(o).values({userId:t,...e}).onConflictDoUpdate({target:o.userId,set:e})}async function x(t){const[e]=await i.select().from(o).where(a(o.userId,t)).limit(1);if(!e)return;const r=await l();e.locale&&n.includes(e.locale)&&r.set(m,e.locale,s),e.theme&&f.includes(e.theme)&&r.set(c,e.theme,s),r.set(p,String(e.sidebarCollapsed),s)}export{s as PREFERENCE_COOKIE_OPTIONS,p as SIDEBAR_COOKIE,x as hydratePreferencesToCookies,w as writePreferencesForUser};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"server-only";import{cookies as o}from"next/headers";import{SIDEBAR_COOKIE as e}from"./index.js";async function a(){return(await o()).get(e)?.value==="true"}export{a as getUserSidebarCollapsed};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateSlug: (size?: number) => string;
|
package/dist/lib/slug.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{customAlphabet as t}from"nanoid";const o=t("abcdefghijkmnpqrstuvwxyz23456789",8);export{o as generateSlug};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ToastData = {
|
|
2
|
+
kind: "success" | "error";
|
|
3
|
+
};
|
|
4
|
+
export declare const toast: import("@base-ui/react").ToastManager<ToastData>;
|
|
5
|
+
export declare function successToast(description: string): void;
|
|
6
|
+
export declare function errorToast(description: string): void;
|
|
7
|
+
export declare function toastActionResult(result: {
|
|
8
|
+
ok: true;
|
|
9
|
+
message?: string;
|
|
10
|
+
} | {
|
|
11
|
+
ok: false;
|
|
12
|
+
error: string;
|
|
13
|
+
}): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Toast as r}from"@base-ui/react/toast";const t=r.createToastManager();function s(o){t.add({description:o,data:{kind:"success"}})}function a(o){t.add({description:o,data:{kind:"error"}})}function i(o){if(o.ok){o.message&&s(o.message);return}a(o.error)}export{a as errorToast,s as successToast,t as toast,i as toastActionResult};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{db as f}from"../db/index.js";import{campaigns as a}from"../db/schema/index.js";import{eq as g}from"drizzle-orm";import l from"ioredis";const r=globalThis,m=250,d=250,u=[100,250,500];function R(n){return new Promise(e=>setTimeout(e,n))}function T(){if(!r.__affTrackingRedis){const n=new l(process.env.REDIS_URL??"redis://localhost:6379",{commandTimeout:m,connectTimeout:d,enableOfflineQueue:!1,maxRetriesPerRequest:1,enableReadyCheck:!1});n.on("error",()=>{}),r.__affTrackingRedis=n}return r.__affTrackingRedis}function t(n){return`campaign:${n}`}async function o(n){if(n.length===0)return;let e;for(const i of[0,...u]){i>0&&await R(i);try{await T().del(...n);return}catch(c){e=c}}throw e}function s(n,e){const i=e instanceof Error?e.message:String(e);console.warn(`[tracking:campaign-cache] ${n} invalidation skipped: ${i}`)}async function k(n){try{await o([t(n)])}catch(e){s(n,e)}}async function C(n){try{const e=await f.select({slug:a.slug}).from(a).where(g(a.casinoId,n));if(e.length===0)return;await o(e.map(i=>t(i.slug)))}catch(e){s(`casino:${n}`,e)}}export{k as invalidateCampaignTrackingCache,C as invalidateCasinoCampaignTrackingCache};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
import { type UserRole } from "../db/schema/index.js";
|
|
3
|
+
import { type SQL } from "drizzle-orm";
|
|
4
|
+
export type UserListSortKey = "email" | "firstName" | "lastName" | "createdAt";
|
|
5
|
+
export declare function orderByUser(sort: UserListSortKey, direction: "asc" | "desc"): [SQL, SQL];
|
|
6
|
+
export declare function userSearchFilter(q: string): SQL | undefined;
|
|
7
|
+
export declare function findUserOfRole(userId: string, role: UserRole): Promise<{
|
|
8
|
+
id: string;
|
|
9
|
+
} | null>;
|
|
10
|
+
export declare function requireUserOfRole(userId: string, role: UserRole): Promise<{
|
|
11
|
+
id: string;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"server-only";import{db as n}from"../db/index.js";import{users as t}from"../db/schema/index.js";import{asc as s,desc as a,eq as m,ilike as o,or as l}from"drizzle-orm";import{appError as u}from"./errors/codes.js";function g(i,r){const e=t[i];return[r==="asc"?s(e):a(e),s(t.id)]}function L(i){if(!i)return;const r=`%${i}%`;return l(o(t.email,r),o(t.firstName,r),o(t.lastName,r))}async function c(i,r){const[e]=await n.select({id:t.id,role:t.role}).from(t).where(m(t.id,i)).limit(1);return!e||e.role!==r?null:{id:e.id}}async function w(i,r){const e=await c(i,r);if(!e)throw u("user_not_found",{toast:!0});return e}export{c as findUserOfRole,g as orderByUser,w as requireUserOfRole,L as userSearchFilter};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const NAME_MAX = 120;
|
|
3
|
+
export declare const DESCRIPTION_MAX = 500;
|
|
4
|
+
export declare const PASSWORD_MIN = 8;
|
|
5
|
+
export declare const PASSWORD_MAX = 200;
|
|
6
|
+
export declare const SUPPORT_SUBJECT_MAX = 120;
|
|
7
|
+
export declare const SUPPORT_MESSAGE_MAX = 2000;
|
|
8
|
+
export declare const V: {
|
|
9
|
+
readonly fieldRequired: "Validation.fieldRequired";
|
|
10
|
+
readonly nameRequired: "Validation.nameRequired";
|
|
11
|
+
readonly firstNameRequired: "Validation.firstNameRequired";
|
|
12
|
+
readonly lastNameRequired: "Validation.lastNameRequired";
|
|
13
|
+
readonly groupNameRequired: "Validation.groupNameRequired";
|
|
14
|
+
readonly passwordTooShort: "Validation.passwordTooShort";
|
|
15
|
+
readonly passwordsMustMatch: "Validation.passwordsMustMatch";
|
|
16
|
+
readonly unsupportedCurrency: "Validation.unsupportedCurrency";
|
|
17
|
+
readonly tosRequired: "Validation.tosRequired";
|
|
18
|
+
readonly incompleteRules: "Validation.incompleteRules";
|
|
19
|
+
readonly noReward: "Validation.noReward";
|
|
20
|
+
readonly percentPerPlayerGate: "Validation.percentPerPlayerGate";
|
|
21
|
+
};
|
|
22
|
+
export declare function formDataToObject(fd: FormData): Record<string, FormDataEntryValue | FormDataEntryValue[]>;
|
|
23
|
+
export declare function arrayField<T extends z.ZodTypeAny>(schema: T): z.ZodPreprocess<z.ZodArray<T>>;
|
|
24
|
+
export declare const optionalTrimmed: (max: number) => z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
25
|
+
export declare const optionalUuid: z.ZodPreprocess<z.ZodOptional<z.ZodUUID>>;
|
|
26
|
+
export declare const UserProfileSchema: z.ZodObject<{
|
|
27
|
+
email: z.ZodEmail;
|
|
28
|
+
firstName: z.ZodString;
|
|
29
|
+
lastName: z.ZodString;
|
|
30
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"zod";const n=120,p=500,m=8,l=200,c=120,R=2e3,s={fieldRequired:"Validation.fieldRequired",nameRequired:"Validation.nameRequired",firstNameRequired:"Validation.firstNameRequired",lastNameRequired:"Validation.lastNameRequired",groupNameRequired:"Validation.groupNameRequired",passwordTooShort:"Validation.passwordTooShort",passwordsMustMatch:"Validation.passwordsMustMatch",unsupportedCurrency:"Validation.unsupportedCurrency",tosRequired:"Validation.tosRequired",incompleteRules:"Validation.incompleteRules",noReward:"Validation.noReward",percentPerPlayerGate:"Validation.percentPerPlayerGate"};function f(r){const t={};for(const[a,i]of r.entries()){const o=t[a];o===void 0?t[a]=i:Array.isArray(o)?o.push(i):t[a]=[o,i]}return t}function y(r){return e.preprocess(t=>t===void 0?[]:Array.isArray(t)?t:[t],e.array(r))}const d=r=>typeof r=="string"&&r.trim()===""?void 0:r,x=r=>e.preprocess(d,e.string().trim().min(1).max(r).optional()),V=e.preprocess(d,e.uuid().optional()),q=e.object({email:e.email().trim().toLowerCase(),firstName:e.string().trim().min(1,s.firstNameRequired).max(n),lastName:e.string().trim().min(1,s.lastNameRequired).max(n)});export{p as DESCRIPTION_MAX,n as NAME_MAX,l as PASSWORD_MAX,m as PASSWORD_MIN,R as SUPPORT_MESSAGE_MAX,c as SUPPORT_SUBJECT_MAX,q as UserProfileSchema,s as V,y as arrayField,f as formDataToObject,x as optionalTrimmed,V as optionalUuid};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Common": {
|
|
3
|
+
"footerNote": "Dies ist eine automatische Nachricht. Bitte antworte nicht direkt auf diese E-Mail."
|
|
4
|
+
},
|
|
5
|
+
"ManagerInvite": {
|
|
6
|
+
"subject": "Du wurdest zu {brandName} eingeladen",
|
|
7
|
+
"preview": "Du wurdest eingeladen, {brandName} zu managen",
|
|
8
|
+
"heading": "Du bist eingeladen",
|
|
9
|
+
"greeting": "Hallo,",
|
|
10
|
+
"greetingNamed": "Hallo {name},",
|
|
11
|
+
"body": "Du wurdest eingeladen, {brandName} als Manager beizutreten. Klicke auf den Button unten, um ein Passwort festzulegen und dein Konto zu aktivieren.",
|
|
12
|
+
"cta": "Konto einrichten",
|
|
13
|
+
"expiresAt": "Diese Einladung läuft am {date} ab.",
|
|
14
|
+
"fallback": "Falls der Button nicht funktioniert, kopiere diesen Link in deinen Browser:"
|
|
15
|
+
},
|
|
16
|
+
"AffiliateInvite": {
|
|
17
|
+
"subject": "Du wurdest zu {brandName} eingeladen",
|
|
18
|
+
"preview": "Du wurdest zu {brandName} eingeladen",
|
|
19
|
+
"heading": "Du bist eingeladen",
|
|
20
|
+
"greeting": "Hallo,",
|
|
21
|
+
"greetingNamed": "Hallo {name},",
|
|
22
|
+
"body": "Du wurdest eingeladen, {brandName} als Affiliate beizutreten. Klicke auf den Button unten, um ein Passwort festzulegen und dein Konto zu aktivieren.",
|
|
23
|
+
"cta": "Konto einrichten",
|
|
24
|
+
"expiresAt": "Diese Einladung läuft am {date} ab.",
|
|
25
|
+
"fallback": "Falls der Button nicht funktioniert, kopiere diesen Link in deinen Browser:"
|
|
26
|
+
},
|
|
27
|
+
"SubAffiliateInvite": {
|
|
28
|
+
"subject": "{parentName} hat dich zu {brandName} eingeladen",
|
|
29
|
+
"preview": "{parentName} hat dich zu {brandName} eingeladen",
|
|
30
|
+
"heading": "Du bist eingeladen",
|
|
31
|
+
"greeting": "Hallo,",
|
|
32
|
+
"greetingNamed": "Hallo {name},",
|
|
33
|
+
"body": "{parentName} hat dich eingeladen, {brandName} als Sub-Affiliate beizutreten. Klicke auf den Button unten, um ein Passwort festzulegen. Anschließend prüft ein Manager deine Anmeldung und schaltet dein Konto frei.",
|
|
34
|
+
"cta": "Konto einrichten",
|
|
35
|
+
"expiresAt": "Diese Einladung läuft am {date} ab.",
|
|
36
|
+
"fallback": "Falls der Button nicht funktioniert, kopiere diesen Link in deinen Browser:"
|
|
37
|
+
},
|
|
38
|
+
"AffiliateSignupVerify": {
|
|
39
|
+
"subject": "Willkommen bei {brandName}: bitte E-Mail bestätigen",
|
|
40
|
+
"preview": "Willkommen bei {brandName}: bitte E-Mail bestätigen",
|
|
41
|
+
"heading": "Willkommen bei {brandName}",
|
|
42
|
+
"greeting": "Hallo,",
|
|
43
|
+
"greetingNamed": "Hallo {name},",
|
|
44
|
+
"body": "Danke für deine Registrierung! Klicke auf den Button unten, um deine E-Mail zu bestätigen und auf dein Affiliate-Konto zuzugreifen.",
|
|
45
|
+
"cta": "Bestätigen und fortfahren",
|
|
46
|
+
"expiresAt": "Dieser Bestätigungslink läuft am {date} ab.",
|
|
47
|
+
"fallback": "Falls der Button nicht funktioniert, kopiere diesen Link in deinen Browser:"
|
|
48
|
+
},
|
|
49
|
+
"AffiliateActivated": {
|
|
50
|
+
"subject": "Dein {brandName}-Konto ist jetzt aktiv",
|
|
51
|
+
"preview": "Dein {brandName}-Konto ist jetzt aktiv",
|
|
52
|
+
"heading": "Dein Konto ist aktiv",
|
|
53
|
+
"greeting": "Hallo,",
|
|
54
|
+
"greetingNamed": "Hallo {name},",
|
|
55
|
+
"body": "Ein Manager hat dein Affiliate-Konto freigeschaltet. Du kannst dich jetzt anmelden und die Plattform nutzen.",
|
|
56
|
+
"cta": "Bei {brandName} anmelden",
|
|
57
|
+
"fallback": "Falls der Button nicht funktioniert, kopiere diesen Link in deinen Browser:"
|
|
58
|
+
},
|
|
59
|
+
"AffiliatePendingApproval": {
|
|
60
|
+
"subject": "Neuer Affiliate wartet auf Freischaltung",
|
|
61
|
+
"preview": "Ein neuer Affiliate wartet auf Freischaltung",
|
|
62
|
+
"heading": "Neuer Affiliate wartet auf Freischaltung",
|
|
63
|
+
"greeting": "Hallo,",
|
|
64
|
+
"greetingNamed": "Hallo {name},",
|
|
65
|
+
"body": "{name} ({email}) hat sich als Affiliate registriert und wartet auf deine Freischaltung. Öffne die Affiliates-Liste, um die Anfrage zu aktivieren oder zu entfernen.",
|
|
66
|
+
"cta": "Affiliates prüfen",
|
|
67
|
+
"fallback": "Falls der Button nicht funktioniert, kopiere diesen Link in deinen Browser:"
|
|
68
|
+
},
|
|
69
|
+
"ManagerAffiliateActivated": {
|
|
70
|
+
"subject": "Neuer Affiliate ist jetzt aktiv",
|
|
71
|
+
"preview": "Ein neuer Affiliate ist jetzt aktiv",
|
|
72
|
+
"heading": "Neuer Affiliate ist jetzt aktiv",
|
|
73
|
+
"greeting": "Hallo,",
|
|
74
|
+
"greetingNamed": "Hallo {name},",
|
|
75
|
+
"body": "{name} ({email}) ist jetzt als Affiliate aktiv und hat Zugriff auf die Plattform.",
|
|
76
|
+
"cta": "Affiliates ansehen",
|
|
77
|
+
"fallback": "Falls der Button nicht funktioniert, kopiere diesen Link in deinen Browser:"
|
|
78
|
+
},
|
|
79
|
+
"ManagerBulkAffiliatesActivated": {
|
|
80
|
+
"subject": "{count} Affiliates wurden freigeschaltet",
|
|
81
|
+
"preview": "{count} Affiliates sind jetzt aktiv",
|
|
82
|
+
"heading": "{count} Affiliates sind jetzt aktiv",
|
|
83
|
+
"greeting": "Hallo,",
|
|
84
|
+
"greetingNamed": "Hallo {name},",
|
|
85
|
+
"body": "Die automatische Freischaltung wurde in den Plattform-Einstellungen aktiviert. Daher wurden {count} ausstehende Affiliates freigeschaltet und haben jetzt Zugriff auf die Plattform.",
|
|
86
|
+
"cta": "Affiliates ansehen",
|
|
87
|
+
"fallback": "Falls der Button nicht funktioniert, kopiere diesen Link in deinen Browser:"
|
|
88
|
+
},
|
|
89
|
+
"PasswordReset": {
|
|
90
|
+
"subject": "{brandName}-Passwort zurücksetzen",
|
|
91
|
+
"preview": "Setze dein {brandName}-Passwort zurück",
|
|
92
|
+
"heading": "Passwort zurücksetzen",
|
|
93
|
+
"greeting": "Hallo,",
|
|
94
|
+
"greetingNamed": "Hallo {name},",
|
|
95
|
+
"body": "Wir haben eine Anfrage erhalten, das Passwort für dein {brandName}-Konto zurückzusetzen. Klicke auf den Button unten, um ein neues Passwort zu wählen.",
|
|
96
|
+
"cta": "Passwort zurücksetzen",
|
|
97
|
+
"expiresAt": "Dieser Link läuft am {date} ab.",
|
|
98
|
+
"ignoreNotice": "Wenn du kein Zurücksetzen angefordert hast, kannst du diese E-Mail ignorieren. Dein Passwort bleibt unverändert.",
|
|
99
|
+
"fallback": "Falls der Button nicht funktioniert, kopiere diesen Link in deinen Browser:"
|
|
100
|
+
},
|
|
101
|
+
"AdminSupportMessage": {
|
|
102
|
+
"subject": "Support-Nachricht: {subject}",
|
|
103
|
+
"preview": "Support-Nachricht: {subject}",
|
|
104
|
+
"heading": "Support-Nachricht",
|
|
105
|
+
"intro": "Eine Support-Nachricht wurde über {brandName} gesendet.",
|
|
106
|
+
"fromLabel": "Von",
|
|
107
|
+
"subjectLabel": "Betreff",
|
|
108
|
+
"messageLabel": "Nachricht"
|
|
109
|
+
},
|
|
110
|
+
"DealAssigned": {
|
|
111
|
+
"subject": "Dir wurde eine Commission auf {brandName} zugewiesen",
|
|
112
|
+
"preview": "Dir wurde ein neuer Commission-Deal zugewiesen",
|
|
113
|
+
"heading": "Neue Commission zugewiesen",
|
|
114
|
+
"greetingNamed": "Hallo {name},",
|
|
115
|
+
"body": "Ein Manager hat dir auf {brandName} einen neuen Commission-Deal zugewiesen.",
|
|
116
|
+
"detail": "{commission} · gültig {period}",
|
|
117
|
+
"periodRange": "{from} – {until}",
|
|
118
|
+
"periodFrom": "ab {from}",
|
|
119
|
+
"untitled": "Unbenannte Commission",
|
|
120
|
+
"cta": "Zu deinen Deals",
|
|
121
|
+
"fallback": "Falls der Button nicht funktioniert, kopiere diesen Link in deinen Browser:"
|
|
122
|
+
},
|
|
123
|
+
"DealDelegated": {
|
|
124
|
+
"subject": "{parentName} hat dir eine Commission auf {brandName} delegiert",
|
|
125
|
+
"preview": "{parentName} hat dir einen Commission-Anteil delegiert",
|
|
126
|
+
"heading": "Dir wurde eine Commission delegiert",
|
|
127
|
+
"greetingNamed": "Hallo {name},",
|
|
128
|
+
"body": "{parentName} hat dir auf {brandName} eine Commission delegiert.",
|
|
129
|
+
"detail": "{commission} · {percent}% Anteil · gültig {period}",
|
|
130
|
+
"periodRange": "{from} – {until}",
|
|
131
|
+
"periodFrom": "ab {from}",
|
|
132
|
+
"untitled": "Unbenannte Commission",
|
|
133
|
+
"cta": "Zu deinen Deals",
|
|
134
|
+
"fallback": "Falls der Button nicht funktioniert, kopiere diesen Link in deinen Browser:"
|
|
135
|
+
}
|
|
136
|
+
}
|