@vicacha-devs/strapi-plugin-events 0.0.0-stage → 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.
Files changed (89) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +121 -2
  3. package/dist/admin/CalendarPage-CwCvPDRx.js +1215 -0
  4. package/dist/admin/CalendarPage-Dz7g19qp.mjs +1215 -0
  5. package/dist/admin/RRuleInput-BQl-siRj.js +11 -0
  6. package/dist/admin/RRuleInput-C8bR37X9.mjs +6 -0
  7. package/dist/admin/SettingsPage-CNG9AEO_.mjs +415 -0
  8. package/dist/admin/SettingsPage-DhjtKDmY.js +415 -0
  9. package/dist/admin/ar-mMKUXxch.js +216 -0
  10. package/dist/admin/ar-tWKEvJLB.mjs +216 -0
  11. package/dist/admin/de-CGk8UZ3W.js +216 -0
  12. package/dist/admin/de-OdbJEFs0.mjs +216 -0
  13. package/dist/admin/en-Dskn9ZPa.mjs +216 -0
  14. package/dist/admin/en-imdSlLhJ.js +216 -0
  15. package/dist/admin/es-DcMsMHrI.mjs +216 -0
  16. package/dist/admin/es-DkqqxUJQ.js +216 -0
  17. package/dist/admin/fr-BTEIPOFw.mjs +216 -0
  18. package/dist/admin/fr-D92B_ZTv.js +216 -0
  19. package/dist/admin/index-BTq_X4uT.js +1005 -0
  20. package/dist/admin/index-BatOiwBu.mjs +1006 -0
  21. package/dist/admin/index.js +6 -0
  22. package/dist/admin/index.mjs +6 -0
  23. package/dist/admin/it-CAxPpL_9.mjs +216 -0
  24. package/dist/admin/it-ClKaSCgv.js +216 -0
  25. package/dist/admin/nl-CS1aUfT7.mjs +216 -0
  26. package/dist/admin/nl-F6FIi7zw.js +216 -0
  27. package/dist/admin/pl-BfmBU9FW.mjs +216 -0
  28. package/dist/admin/pl-p8VLXi02.js +216 -0
  29. package/dist/admin/pt-BUdH0uSw.js +216 -0
  30. package/dist/admin/pt-DdulKcbk.mjs +216 -0
  31. package/dist/admin/src/components/EventSidePanel.d.ts +13 -0
  32. package/dist/admin/src/components/Initializer.d.ts +5 -0
  33. package/dist/admin/src/components/PluginIcon.d.ts +2 -0
  34. package/dist/admin/src/components/RRuleInput.d.ts +3 -0
  35. package/dist/admin/src/components/events/AttendeesManagerPanel.d.ts +15 -0
  36. package/dist/admin/src/components/events/EventsDirectoryPanel.d.ts +11 -0
  37. package/dist/admin/src/components/events/EventsKpiCards.d.ts +16 -0
  38. package/dist/admin/src/components/events/QuickCreateEventPanel.d.ts +21 -0
  39. package/dist/admin/src/components/events/calendarPageHelpers.d.ts +8 -0
  40. package/dist/admin/src/fields/rruleField.d.ts +41 -0
  41. package/dist/admin/src/index.d.ts +15 -0
  42. package/dist/admin/src/pages/CalendarPage.d.ts +3 -0
  43. package/dist/admin/src/pages/SettingsPage.d.ts +3 -0
  44. package/dist/admin/src/permissions.d.ts +15 -0
  45. package/dist/admin/src/translations/cmLabels.d.ts +1 -0
  46. package/dist/admin/src/translations/cmPlaceholders.d.ts +1 -0
  47. package/dist/admin/tr-Bp50qvL8.mjs +216 -0
  48. package/dist/admin/tr-C7G9mPtg.js +216 -0
  49. package/dist/server/index.js +3709 -0
  50. package/dist/server/index.mjs +3705 -0
  51. package/dist/server/src/bootstrap.d.ts +5 -0
  52. package/dist/server/src/config/index.d.ts +7 -0
  53. package/dist/server/src/content-types/event/schema.json.d.ts +279 -0
  54. package/dist/server/src/content-types/index.d.ts +366 -0
  55. package/dist/server/src/content-types/registration/schema.json.d.ts +86 -0
  56. package/dist/server/src/controllers/admin.d.ts +17 -0
  57. package/dist/server/src/controllers/content-api.d.ts +14 -0
  58. package/dist/server/src/controllers/index.d.ts +28 -0
  59. package/dist/server/src/destroy.d.ts +5 -0
  60. package/dist/server/src/index.d.ts +551 -0
  61. package/dist/server/src/middlewares/index.d.ts +2 -0
  62. package/dist/server/src/policies/index.d.ts +2 -0
  63. package/dist/server/src/register.d.ts +5 -0
  64. package/dist/server/src/routes/admin.d.ts +17 -0
  65. package/dist/server/src/routes/content-api.d.ts +12 -0
  66. package/dist/server/src/routes/index.d.ts +30 -0
  67. package/dist/server/src/services/ical.d.ts +18 -0
  68. package/dist/server/src/services/index.d.ts +110 -0
  69. package/dist/server/src/services/occurrence.d.ts +44 -0
  70. package/dist/server/src/services/occurrenceHelpers.d.ts +16 -0
  71. package/dist/server/src/services/occurrencePayloadHelpers.d.ts +30 -0
  72. package/dist/server/src/services/occurrenceRsvpBatch.d.ts +25 -0
  73. package/dist/server/src/services/rsvp.d.ts +51 -0
  74. package/dist/server/src/services/rsvpHelpers.d.ts +52 -0
  75. package/dist/server/src/services/rsvpMutations.d.ts +34 -0
  76. package/dist/server/src/services/rsvpSecurity.d.ts +22 -0
  77. package/dist/server/src/services/settings.d.ts +10 -0
  78. package/dist/server/src/types.d.ts +171 -0
  79. package/dist/shared/calendarSystems.d.ts +6 -0
  80. package/dist/shared/icalGenerator.d.ts +25 -0
  81. package/dist/shared/index.d.ts +6 -0
  82. package/dist/shared/index.js +753 -0
  83. package/dist/shared/index.mjs +727 -0
  84. package/dist/shared/pluginId.d.ts +4 -0
  85. package/dist/shared/rruleEngine.d.ts +20 -0
  86. package/dist/shared/spotlightHelpers.d.ts +17 -0
  87. package/dist/shared/types.d.ts +309 -0
  88. package/dist/shared/urlAndPosterHelpers.d.ts +18 -0
  89. package/package.json +109 -3
@@ -0,0 +1,110 @@
1
+ declare const _default: {
2
+ settings: ({ strapi }: {
3
+ strapi: import("@strapi/strapi").Core.Strapi;
4
+ }) => {
5
+ ensureInitialized(): Promise<import('..').EventsPluginSettings>;
6
+ getSettings(): Promise<import('..').EventsPluginSettings>;
7
+ updateSettings(patch: Partial<import('..').EventsPluginSettings>): Promise<import('..').EventsPluginSettings>;
8
+ };
9
+ occurrence: ({ strapi }: {
10
+ strapi: import("@strapi/strapi").Core.Strapi;
11
+ }) => {
12
+ registerCalendarFormatter(calendarId: string, formatter: import('../../../shared/types').CalendarSystemFormatterFn): void;
13
+ unregisterCalendarFormatter(calendarId: string): void;
14
+ formatDateInCalendarSystem(isoOrDateKey: string, system: import('../../../shared/types').CalendarSystemConfig, locale?: string, options?: {
15
+ compact?: boolean;
16
+ }): string;
17
+ getOccurrences(params: import('./occurrencePayloadHelpers').GetOccurrencesParams): Promise<import('..').ExpandedOccurrence[]>;
18
+ getActiveSpotlights(params?: {
19
+ date?: string;
20
+ locale?: string;
21
+ sourceId?: string;
22
+ category?: string;
23
+ includeDrafts?: boolean;
24
+ } & import('../types').PaginationParams): Promise<import('..').ExpandedOccurrence[]>;
25
+ rescheduleOccurrence(params: {
26
+ sourceId?: string;
27
+ uid?: string;
28
+ documentId: string;
29
+ occurrenceDate: string;
30
+ newStartDate: string;
31
+ newEndDate?: string;
32
+ applyToSeries?: boolean;
33
+ cancelOccurrence?: boolean;
34
+ }): Promise<Record<string, unknown>>;
35
+ quickCreateEvent(params: {
36
+ sourceId?: string;
37
+ title: string;
38
+ startDate: string;
39
+ endDate?: string;
40
+ location?: string;
41
+ category?: string;
42
+ summary?: string;
43
+ rrule?: string;
44
+ rsvpEnabled?: boolean;
45
+ capacity?: number;
46
+ }): Promise<Record<string, unknown>>;
47
+ };
48
+ rsvp: ({ strapi }: {
49
+ strapi: import("@strapi/strapi").Core.Strapi;
50
+ }) => {
51
+ getEventStats(params: {
52
+ eventUid?: string;
53
+ eventDocumentId: string;
54
+ occurrenceDate?: string | null;
55
+ capacityOverride?: number | null;
56
+ waitlistOverride?: boolean;
57
+ rsvpEnabledOverride?: boolean;
58
+ includeDrafts?: boolean;
59
+ }): Promise<import('..').RsvpStats>;
60
+ registerAttendee(eventDocumentId: string, input: import('..').RsvpRegistrationInput): Promise<import('..').RsvpRegistrationRecord & {
61
+ cancellationToken: string;
62
+ }>;
63
+ promoteFromWaitlist(params: {
64
+ eventUid: string;
65
+ eventDocumentId: string;
66
+ occurrenceDate: string;
67
+ }): Promise<import('..').RsvpRegistrationRecord[]>;
68
+ cancelByToken(token: string): Promise<{
69
+ cancelled: import('..').RsvpRegistrationRecord;
70
+ promotedCount: number;
71
+ }>;
72
+ updateRegistrationStatus(registrationDocumentId: string, newStatus: import('..').RsvpStatus): Promise<{
73
+ registration: import('..').RsvpRegistrationRecord;
74
+ promotedCount: number;
75
+ }>;
76
+ checkInAttendee(identifier: {
77
+ documentId?: string;
78
+ token?: string;
79
+ }): Promise<import('..').RsvpRegistrationRecord>;
80
+ listRegistrations(filters?: {
81
+ eventDocumentId?: string;
82
+ occurrenceDate?: string;
83
+ status?: import('..').RsvpStatus;
84
+ search?: string;
85
+ } & import('../types').PaginationParams): Promise<import('..').RsvpRegistrationRecord[]>;
86
+ exportRegistrationsCsv(filters?: {
87
+ eventDocumentId?: string;
88
+ occurrenceDate?: string;
89
+ status?: import('..').RsvpStatus;
90
+ }): Promise<string>;
91
+ formatRegistrationRecord: typeof import('./rsvpHelpers').formatRegistrationRecord;
92
+ };
93
+ ical: ({ strapi }: {
94
+ strapi: import("@strapi/strapi").Core.Strapi;
95
+ }) => {
96
+ generateFeedIcs(params?: {
97
+ from?: string;
98
+ to?: string;
99
+ category?: string;
100
+ sourceId?: string;
101
+ locale?: string;
102
+ }): Promise<string>;
103
+ generateEventInviteIcs(params: {
104
+ documentId: string;
105
+ occurrenceDate?: string;
106
+ locale?: string;
107
+ }): Promise<string>;
108
+ };
109
+ };
110
+ export default _default;
@@ -0,0 +1,44 @@
1
+ import { Core } from '@strapi/strapi';
2
+ import { CalendarSystemConfig, CalendarSystemFormatterFn, ExpandedOccurrence } from '../../../shared/types';
3
+ import { PaginationParams } from '../types';
4
+ import { GetOccurrencesParams } from './occurrenceHelpers';
5
+ declare const _default: ({ strapi }: {
6
+ strapi: Core.Strapi;
7
+ }) => {
8
+ registerCalendarFormatter(calendarId: string, formatter: CalendarSystemFormatterFn): void;
9
+ unregisterCalendarFormatter(calendarId: string): void;
10
+ formatDateInCalendarSystem(isoOrDateKey: string, system: CalendarSystemConfig, locale?: string, options?: {
11
+ compact?: boolean;
12
+ }): string;
13
+ getOccurrences(params: GetOccurrencesParams): Promise<ExpandedOccurrence[]>;
14
+ getActiveSpotlights(params?: {
15
+ date?: string;
16
+ locale?: string;
17
+ sourceId?: string;
18
+ category?: string;
19
+ includeDrafts?: boolean;
20
+ } & PaginationParams): Promise<ExpandedOccurrence[]>;
21
+ rescheduleOccurrence(params: {
22
+ sourceId?: string;
23
+ uid?: string;
24
+ documentId: string;
25
+ occurrenceDate: string;
26
+ newStartDate: string;
27
+ newEndDate?: string;
28
+ applyToSeries?: boolean;
29
+ cancelOccurrence?: boolean;
30
+ }): Promise<Record<string, unknown>>;
31
+ quickCreateEvent(params: {
32
+ sourceId?: string;
33
+ title: string;
34
+ startDate: string;
35
+ endDate?: string;
36
+ location?: string;
37
+ category?: string;
38
+ summary?: string;
39
+ rrule?: string;
40
+ rsvpEnabled?: boolean;
41
+ capacity?: number;
42
+ }): Promise<Record<string, unknown>>;
43
+ };
44
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { Core } from '@strapi/strapi';
2
+ import { EventSourceMapping, EventsPluginSettings, ExpandedOccurrence } from '../../../shared/types';
3
+ import { GetOccurrencesParams, assertValidIsoDateTime, buildQuickCreatePayload, resolveOccurrenceWindow, resolveQuickCreateSource } from './occurrencePayloadHelpers';
4
+ import { PendingOccurrenceRsvpMeta } from './occurrenceRsvpBatch';
5
+ export { type GetOccurrencesParams, assertValidIsoDateTime, buildQuickCreatePayload, resolveOccurrenceWindow, resolveQuickCreateSource, };
6
+ export declare function fetchDocumentsForSource(strapi: Core.Strapi, source: EventSourceMapping, params: GetOccurrencesParams, settings: EventsPluginSettings): Promise<Array<Record<string, unknown>>>;
7
+ export declare function expandDocumentOccurrencesSync(args: {
8
+ strapi: Core.Strapi;
9
+ doc: Record<string, unknown>;
10
+ source: EventSourceMapping;
11
+ params: GetOccurrencesParams;
12
+ settings: EventsPluginSettings;
13
+ windowStart: string;
14
+ windowEnd: string;
15
+ pendingRsvpMap: Map<string, PendingOccurrenceRsvpMeta>;
16
+ }): ExpandedOccurrence[];
@@ -0,0 +1,30 @@
1
+ import { EventSourceMapping, EventsPluginSettings } from '../../../shared/types';
2
+ import { PaginationParams } from '../types';
3
+ export interface GetOccurrencesParams extends PaginationParams {
4
+ from?: string;
5
+ to?: string;
6
+ locale?: string;
7
+ category?: string;
8
+ sourceId?: string;
9
+ documentId?: string;
10
+ includeDrafts?: boolean;
11
+ onlySpotlights?: boolean;
12
+ }
13
+ export declare function assertValidIsoDateTime(raw: unknown, fieldName: string): number;
14
+ export declare function resolveOccurrenceWindow(params: GetOccurrencesParams): {
15
+ windowStart: string;
16
+ windowEnd: string;
17
+ isEmptyWindow: boolean;
18
+ };
19
+ export declare function resolveQuickCreateSource(settings: EventsPluginSettings, sourceId?: string): EventSourceMapping;
20
+ export declare function buildQuickCreatePayload(source: EventSourceMapping, settings: EventsPluginSettings, params: {
21
+ title: string;
22
+ startDate: string;
23
+ endDate?: string;
24
+ location?: string;
25
+ category?: string;
26
+ summary?: string;
27
+ rrule?: string;
28
+ rsvpEnabled?: boolean;
29
+ capacity?: number;
30
+ }): Record<string, unknown>;
@@ -0,0 +1,25 @@
1
+ import { Core } from '@strapi/strapi';
2
+ import { ExpandedOccurrence } from '../../../shared/types';
3
+ /**
4
+ * Strictly restricts mapped event sources to `api::*` content types
5
+ * and the built-in `plugin::events.event` collection type.
6
+ */
7
+ export declare function isAllowedEventSourceUid(uid: unknown): uid is string;
8
+ /**
9
+ * Extracts configured custom fields while stripping `private: true` schema
10
+ * attributes, sensitive credential/token fields, and prototype-pollution keys.
11
+ */
12
+ export declare function extractCustomFields(strapi: Core.Strapi, sourceUid: string, doc: Record<string, unknown>, customFieldKeys?: string[]): Record<string, unknown> | undefined;
13
+ export interface PendingOccurrenceRsvpMeta {
14
+ eventUid: string;
15
+ eventDocumentId: string;
16
+ occurrenceDate: string;
17
+ capacity: number | null;
18
+ waitlistEnabled: boolean;
19
+ rsvpEnabled: boolean;
20
+ }
21
+ /**
22
+ * Populates `occ.rsvp` across all expanded occurrences using a single batched
23
+ * database query aggregated in memory in O(N) instead of N+1 queries.
24
+ */
25
+ export declare function attachBatchedRsvpStats(strapi: Core.Strapi, occurrences: ExpandedOccurrence[], pendingByOccurrenceId: Map<string, PendingOccurrenceRsvpMeta>): Promise<void>;
@@ -0,0 +1,51 @@
1
+ import { Core } from '@strapi/strapi';
2
+ import { RsvpRegistrationInput, RsvpRegistrationRecord, RsvpStats, RsvpStatus } from '../../../shared/types';
3
+ import { PaginationParams } from '../types';
4
+ import { formatRegistrationRecord, maskEmail } from './rsvpHelpers';
5
+ export { maskEmail };
6
+ declare const _default: ({ strapi }: {
7
+ strapi: Core.Strapi;
8
+ }) => {
9
+ getEventStats(params: {
10
+ eventUid?: string;
11
+ eventDocumentId: string;
12
+ occurrenceDate?: string | null;
13
+ capacityOverride?: number | null;
14
+ waitlistOverride?: boolean;
15
+ rsvpEnabledOverride?: boolean;
16
+ includeDrafts?: boolean;
17
+ }): Promise<RsvpStats>;
18
+ registerAttendee(eventDocumentId: string, input: RsvpRegistrationInput): Promise<RsvpRegistrationRecord & {
19
+ cancellationToken: string;
20
+ }>;
21
+ promoteFromWaitlist(params: {
22
+ eventUid: string;
23
+ eventDocumentId: string;
24
+ occurrenceDate: string;
25
+ }): Promise<RsvpRegistrationRecord[]>;
26
+ cancelByToken(token: string): Promise<{
27
+ cancelled: RsvpRegistrationRecord;
28
+ promotedCount: number;
29
+ }>;
30
+ updateRegistrationStatus(registrationDocumentId: string, newStatus: RsvpStatus): Promise<{
31
+ registration: RsvpRegistrationRecord;
32
+ promotedCount: number;
33
+ }>;
34
+ checkInAttendee(identifier: {
35
+ documentId?: string;
36
+ token?: string;
37
+ }): Promise<RsvpRegistrationRecord>;
38
+ listRegistrations(filters?: {
39
+ eventDocumentId?: string;
40
+ occurrenceDate?: string;
41
+ status?: RsvpStatus;
42
+ search?: string;
43
+ } & PaginationParams): Promise<RsvpRegistrationRecord[]>;
44
+ exportRegistrationsCsv(filters?: {
45
+ eventDocumentId?: string;
46
+ occurrenceDate?: string;
47
+ status?: RsvpStatus;
48
+ }): Promise<string>;
49
+ formatRegistrationRecord: typeof formatRegistrationRecord;
50
+ };
51
+ export default _default;
@@ -0,0 +1,52 @@
1
+ import { Core } from '@strapi/strapi';
2
+ import { EventLifecycleStatus, RRuleFieldValue, RsvpRegistrationInput, RsvpRegistrationRecord, RsvpStats, RsvpStatus } from '../../../shared/types';
3
+ export interface ResolvedTargetEvent {
4
+ uid: string;
5
+ documentId: string;
6
+ title: string;
7
+ startDate: string;
8
+ endDate: string | null;
9
+ allDay: boolean;
10
+ recurrence: RRuleFieldValue;
11
+ eventStatus: EventLifecycleStatus;
12
+ rsvpEnabled: boolean;
13
+ capacity: number | null;
14
+ waitlistEnabled: boolean;
15
+ maxGuestsPerRegistration: number;
16
+ registrationDeadline: string | null;
17
+ }
18
+ export declare function maskEmail(email: string): string;
19
+ export declare function readNullablePositiveInt(val: unknown): number | null;
20
+ export declare function resolveTargetEvent(strapi: Core.Strapi, eventDocumentId: string, preferredUid?: string, options?: {
21
+ includeDrafts?: boolean;
22
+ }): Promise<ResolvedTargetEvent | null>;
23
+ export declare function readStoredGuestsCount(val: unknown): number;
24
+ export declare function assertValidGuestsCount(val: unknown): number;
25
+ export declare function formatRegistrationRecord(raw: Record<string, unknown>): RsvpRegistrationRecord;
26
+ export declare function aggregateRsvpCounts(records: Array<Record<string, unknown>>): Pick<RsvpStats, "confirmedCount" | "confirmedSeats" | "checkedInSeats" | "waitlistedCount" | "waitlistedSeats" | "cancelledCount">;
27
+ export declare function validateRegistrationInputAndEvent(input: RsvpRegistrationInput, targetEvent: ResolvedTargetEvent): {
28
+ attendeeName: string;
29
+ attendeeEmail: string;
30
+ guestsCount: number;
31
+ };
32
+ export declare function resolveAssignedRsvpStatus(targetEvent: ResolvedTargetEvent, confirmedSeats: number, guestsCount: number): RsvpStatus;
33
+ export declare function trySendNotificationEmail(strapi: Core.Strapi, payload: {
34
+ to: string;
35
+ attendeeName: string;
36
+ eventTitle: string;
37
+ occurrenceDate: string;
38
+ guestsCount: number;
39
+ status: RsvpStatus;
40
+ promotedFromWaitlist?: boolean;
41
+ }): Promise<void>;
42
+ export declare function buildRegistrationCreateData(args: {
43
+ targetEvent: ResolvedTargetEvent;
44
+ eventDocumentId: string;
45
+ occurrenceDate: string;
46
+ attendeeName: string;
47
+ attendeeEmail: string;
48
+ guestsCount: number;
49
+ assignedStatus: RsvpStatus;
50
+ tokenHash: string;
51
+ input: RsvpRegistrationInput;
52
+ }): Record<string, unknown>;
@@ -0,0 +1,34 @@
1
+ import { Core } from '@strapi/strapi';
2
+ import { RsvpRegistrationRecord, RsvpStatus } from '../../../shared/types';
3
+ import { ResolvedTargetEvent } from './rsvpHelpers';
4
+ export interface EmailQueueItem {
5
+ to: string;
6
+ attendeeName: string;
7
+ eventTitle: string;
8
+ occurrenceDate: string;
9
+ guestsCount: number;
10
+ status: RsvpStatus;
11
+ promotedFromWaitlist?: boolean;
12
+ }
13
+ export declare function fetchRegistrationRecordsSafe(strapi: Core.Strapi, eventDocumentId: string, occurrenceDate: string | null): Promise<Array<Record<string, unknown>>>;
14
+ export declare function promoteFromWaitlistUnlocked(strapi: Core.Strapi, params: {
15
+ eventUid: string;
16
+ eventDocumentId: string;
17
+ occurrenceDate: string;
18
+ targetEventOverride?: ResolvedTargetEvent | null;
19
+ }): Promise<{
20
+ promoted: RsvpRegistrationRecord[];
21
+ emails: EmailQueueItem[];
22
+ }>;
23
+ export declare function executeCancelByToken(strapi: Core.Strapi, token: string): Promise<{
24
+ cancelled: RsvpRegistrationRecord;
25
+ promotedCount: number;
26
+ }>;
27
+ export declare function executeUpdateRegistrationStatus(strapi: Core.Strapi, registrationDocumentId: string, newStatus: RsvpStatus): Promise<{
28
+ registration: RsvpRegistrationRecord;
29
+ promotedCount: number;
30
+ }>;
31
+ export declare function executeCheckInAttendee(strapi: Core.Strapi, identifier: {
32
+ documentId?: string;
33
+ token?: string;
34
+ }): Promise<RsvpRegistrationRecord>;
@@ -0,0 +1,22 @@
1
+ import { Core } from '@strapi/strapi';
2
+ import { ResolvedTargetEvent } from './rsvpHelpers';
3
+ export declare function generateRawRsvpToken(): string;
4
+ export declare function hashRsvpToken(rawToken: string): string;
5
+ export declare function verifyTokenHashConstantTime(candidateHash: string, storedValue: unknown): boolean;
6
+ export declare function findRegistrationByRawToken(strapi: Core.Strapi, rawToken: string): Promise<{
7
+ record: Record<string, unknown>;
8
+ tokenHash: string;
9
+ } | null>;
10
+ export declare function clearOccurrenceLocks(strapi: Core.Strapi): void;
11
+ /**
12
+ * Serializes mutations per `(eventDocumentId, occurrenceDate)` scoped per
13
+ * Strapi instance and wraps inside `strapi.db.transaction` when available.
14
+ */
15
+ export declare function withOccurrenceLock<T>(strapi: Core.Strapi, eventDocumentId: string, occurrenceDate: string, fn: () => Promise<T>): Promise<T>;
16
+ /**
17
+ * Verifies that `occurrenceDate` is a valid calendar YYYY-MM-DD and matches
18
+ * an actual scheduled (non-excluded, non-cancelled) occurrence of `targetEvent`.
19
+ * Returns the occurrence's effective end timestamp in ms when determinable.
20
+ */
21
+ export declare function assertScheduledOccurrence(targetEvent: ResolvedTargetEvent, occurrenceDate: string): number | null;
22
+ export declare function resolveValidatedOccurrenceDate(inputDate: string | undefined, targetEvent: ResolvedTargetEvent): string;
@@ -0,0 +1,10 @@
1
+ import { Core } from '@strapi/strapi';
2
+ import { EventsPluginSettings } from '../../../shared/types';
3
+ declare const _default: ({ strapi }: {
4
+ strapi: Core.Strapi;
5
+ }) => {
6
+ ensureInitialized(): Promise<EventsPluginSettings>;
7
+ getSettings(): Promise<EventsPluginSettings>;
8
+ updateSettings(patch: Partial<EventsPluginSettings>): Promise<EventsPluginSettings>;
9
+ };
10
+ export default _default;
@@ -0,0 +1,171 @@
1
+ import { Core } from '@strapi/strapi';
2
+ import { CalendarSystemConfig, CalendarSystemFormatterFn, EventsPluginSettings, ExpandedOccurrence, RsvpRegistrationInput, RsvpRegistrationRecord, RsvpStats, RsvpStatus } from '../../shared/types';
3
+ export declare class PluginValidationError extends Error {
4
+ readonly statusCode = 400;
5
+ constructor(message: string);
6
+ }
7
+ export declare class PluginNotFoundError extends Error {
8
+ readonly statusCode = 404;
9
+ constructor(message: string);
10
+ }
11
+ export interface StrapiKoaContext {
12
+ query?: Record<string, unknown>;
13
+ params?: Record<string, string | undefined>;
14
+ request?: {
15
+ body?: Record<string, unknown>;
16
+ };
17
+ status?: number;
18
+ body?: unknown;
19
+ set: (header: string, value: string) => void;
20
+ badRequest: (message: string, details?: unknown) => unknown;
21
+ notFound?: (message?: string, details?: unknown) => unknown;
22
+ }
23
+ export interface PaginationParams {
24
+ limit?: number;
25
+ page?: number;
26
+ pageSize?: number;
27
+ }
28
+ export interface StrapiDocumentQueryOptions {
29
+ filters?: Record<string, unknown>;
30
+ sort?: string | string[] | Record<string, "asc" | "desc">;
31
+ limit?: number;
32
+ locale?: string;
33
+ status?: "draft" | "published";
34
+ populate?: Record<string, unknown> | string[];
35
+ }
36
+ export interface StrapiDocumentServiceClient {
37
+ findMany: (options?: StrapiDocumentQueryOptions) => Promise<Array<Record<string, unknown>>>;
38
+ findOne: (options: {
39
+ documentId: string;
40
+ locale?: string;
41
+ status?: "draft" | "published";
42
+ }) => Promise<Record<string, unknown> | null>;
43
+ create: (options: {
44
+ data: Record<string, unknown>;
45
+ locale?: string;
46
+ status?: "draft" | "published";
47
+ }) => Promise<Record<string, unknown>>;
48
+ update: (options: {
49
+ documentId: string;
50
+ data: Record<string, unknown>;
51
+ locale?: string;
52
+ status?: "draft" | "published";
53
+ }) => Promise<Record<string, unknown>>;
54
+ }
55
+ export interface EventsSettingsService {
56
+ ensureInitialized: () => Promise<EventsPluginSettings>;
57
+ getSettings: () => Promise<EventsPluginSettings>;
58
+ updateSettings: (patch: Partial<EventsPluginSettings>) => Promise<EventsPluginSettings>;
59
+ }
60
+ export interface EventsOccurrenceService {
61
+ registerCalendarFormatter: (calendarId: string, formatter: CalendarSystemFormatterFn) => void;
62
+ unregisterCalendarFormatter: (calendarId: string) => void;
63
+ formatDateInCalendarSystem: (isoOrDateKey: string, system: CalendarSystemConfig, locale?: string, options?: {
64
+ compact?: boolean;
65
+ }) => string;
66
+ getOccurrences: (params: {
67
+ from?: string;
68
+ to?: string;
69
+ locale?: string;
70
+ category?: string;
71
+ sourceId?: string;
72
+ documentId?: string;
73
+ includeDrafts?: boolean;
74
+ onlySpotlights?: boolean;
75
+ } & PaginationParams) => Promise<ExpandedOccurrence[]>;
76
+ getActiveSpotlights: (params?: {
77
+ date?: string;
78
+ locale?: string;
79
+ sourceId?: string;
80
+ category?: string;
81
+ includeDrafts?: boolean;
82
+ } & PaginationParams) => Promise<ExpandedOccurrence[]>;
83
+ rescheduleOccurrence: (params: {
84
+ sourceId?: string;
85
+ uid?: string;
86
+ documentId: string;
87
+ occurrenceDate: string;
88
+ newStartDate: string;
89
+ newEndDate?: string;
90
+ applyToSeries?: boolean;
91
+ cancelOccurrence?: boolean;
92
+ }) => Promise<Record<string, unknown>>;
93
+ quickCreateEvent: (params: {
94
+ sourceId?: string;
95
+ title: string;
96
+ startDate: string;
97
+ endDate?: string;
98
+ location?: string;
99
+ category?: string;
100
+ summary?: string;
101
+ rrule?: string;
102
+ rsvpEnabled?: boolean;
103
+ capacity?: number;
104
+ }) => Promise<Record<string, unknown>>;
105
+ }
106
+ export interface EventsRsvpService {
107
+ getEventStats: (params: {
108
+ eventUid?: string;
109
+ eventDocumentId: string;
110
+ occurrenceDate?: string | null;
111
+ capacityOverride?: number | null;
112
+ waitlistOverride?: boolean;
113
+ rsvpEnabledOverride?: boolean;
114
+ includeDrafts?: boolean;
115
+ }) => Promise<RsvpStats>;
116
+ registerAttendee: (eventDocumentId: string, input: RsvpRegistrationInput) => Promise<RsvpRegistrationRecord & {
117
+ cancellationToken: string;
118
+ }>;
119
+ promoteFromWaitlist: (params: {
120
+ eventUid: string;
121
+ eventDocumentId: string;
122
+ occurrenceDate: string;
123
+ }) => Promise<RsvpRegistrationRecord[]>;
124
+ cancelByToken: (token: string) => Promise<{
125
+ cancelled: RsvpRegistrationRecord;
126
+ promotedCount: number;
127
+ }>;
128
+ updateRegistrationStatus: (registrationDocumentId: string, newStatus: RsvpStatus) => Promise<{
129
+ registration: RsvpRegistrationRecord;
130
+ promotedCount: number;
131
+ }>;
132
+ checkInAttendee: (identifier: {
133
+ documentId?: string;
134
+ token?: string;
135
+ }) => Promise<RsvpRegistrationRecord>;
136
+ listRegistrations: (filters?: {
137
+ eventDocumentId?: string;
138
+ occurrenceDate?: string;
139
+ status?: RsvpStatus;
140
+ search?: string;
141
+ } & PaginationParams) => Promise<RsvpRegistrationRecord[]>;
142
+ exportRegistrationsCsv: (filters?: {
143
+ eventDocumentId?: string;
144
+ occurrenceDate?: string;
145
+ status?: RsvpStatus;
146
+ }) => Promise<string>;
147
+ }
148
+ export interface EventsIcalService {
149
+ generateFeedIcs: (params?: {
150
+ from?: string;
151
+ to?: string;
152
+ category?: string;
153
+ sourceId?: string;
154
+ locale?: string;
155
+ }) => Promise<string>;
156
+ generateEventInviteIcs: (params: {
157
+ documentId: string;
158
+ occurrenceDate?: string;
159
+ locale?: string;
160
+ }) => Promise<string>;
161
+ }
162
+ export declare function getDocumentsClient(strapi: Core.Strapi, uid: string): StrapiDocumentServiceClient;
163
+ export declare function getSettingsService(strapi: Core.Strapi): EventsSettingsService;
164
+ export declare function getOccurrenceService(strapi: Core.Strapi): EventsOccurrenceService;
165
+ export declare function getRsvpService(strapi: Core.Strapi): EventsRsvpService;
166
+ export declare function getIcalService(strapi: Core.Strapi): EventsIcalService;
167
+ export declare function clampPaginatedSlice<T>(items: T[], params?: PaginationParams & {
168
+ defaultLimit?: number;
169
+ maxLimit?: number;
170
+ }): T[];
171
+ export declare function handleControllerError(strapi: Core.Strapi, ctx: StrapiKoaContext, err: unknown, fallbackMessage: string): unknown;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Re-exports multi-calendar systems (CLDR + custom formatters) from
3
+ * @vicacha-devs/strapi-plugin-calendar so strapi-plugin-events shares a single
4
+ * calendar engine across the monorepo.
5
+ */
6
+ export { SUPPORTED_INTL_CALENDARS, applyDayOffset, extractCalendarParts, formatDateInCalendarSystem, getRegisteredCalendarFormatters, registerCalendarSystemFormatter, resolveOccurrenceAlternateDates, unregisterCalendarSystemFormatter, } from '../../strapi-plugin-calendar/shared/index.ts';
@@ -0,0 +1,25 @@
1
+ import { CalendarLinkSet, ExpandedOccurrence, RsvpRegistrationRecord } from './types';
2
+ export declare function toIcsTimestamp(isoString: string, allDay?: boolean): string;
3
+ export declare function escapeIcsText(value: string | undefined | null): string;
4
+ /**
5
+ * Folds an iCalendar line at 75 UTF-8 octets per RFC 5545 Section 3.1,
6
+ * iterating over Unicode code points so surrogate pairs are never split.
7
+ */
8
+ export declare function foldIcsLine(line: string): string;
9
+ export declare function buildCalendarLinks(params: {
10
+ documentId: string;
11
+ title: string;
12
+ startDate: string;
13
+ endDate: string;
14
+ allDay?: boolean;
15
+ summary?: string;
16
+ location?: string;
17
+ occurrenceDate?: string;
18
+ }): CalendarLinkSet;
19
+ export declare function generateIcsCalendar(occurrences: ExpandedOccurrence[], feedTitle?: string): string;
20
+ /**
21
+ * Prevents CSV Formula Injection (CWE-1236) including leading-whitespace
22
+ * bypasses and escapes quotes/newlines.
23
+ */
24
+ export declare function sanitizeCsvCell(raw: unknown): string;
25
+ export declare function generateRegistrationsCsv(records: RsvpRegistrationRecord[]): string;
@@ -0,0 +1,6 @@
1
+ export * from './calendarSystems';
2
+ export * from './icalGenerator';
3
+ export * from './pluginId';
4
+ export * from './rruleEngine';
5
+ export * from './spotlightHelpers';
6
+ export * from './types';