@burdenoff/microfe-calendar 2026.510.109
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 +88 -0
- package/dist/CalendarRoot.d.ts +33 -0
- package/dist/CalendarRoot.d.ts.map +1 -0
- package/dist/CalendarRoot.js +81 -0
- package/dist/CalendarRoot.js.map +1 -0
- package/dist/CalendarRoutes.d.ts +21 -0
- package/dist/CalendarRoutes.d.ts.map +1 -0
- package/dist/CalendarRoutes.js +69 -0
- package/dist/CalendarRoutes.js.map +1 -0
- package/dist/components/AgendaView.d.ts +6 -0
- package/dist/components/AgendaView.d.ts.map +1 -0
- package/dist/components/AgendaView.js +102 -0
- package/dist/components/AgendaView.js.map +1 -0
- package/dist/components/ConfirmDialog.d.ts +16 -0
- package/dist/components/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/ConfirmDialog.js +79 -0
- package/dist/components/ConfirmDialog.js.map +1 -0
- package/dist/components/DayView.d.ts +6 -0
- package/dist/components/DayView.d.ts.map +1 -0
- package/dist/components/DayView.js +73 -0
- package/dist/components/DayView.js.map +1 -0
- package/dist/components/EventBlock.d.ts +8 -0
- package/dist/components/EventBlock.d.ts.map +1 -0
- package/dist/components/EventBlock.js +38 -0
- package/dist/components/EventBlock.js.map +1 -0
- package/dist/components/EventFormModal.d.ts +14 -0
- package/dist/components/EventFormModal.d.ts.map +1 -0
- package/dist/components/EventFormModal.js +545 -0
- package/dist/components/EventFormModal.js.map +1 -0
- package/dist/components/MiniCalendar.d.ts +6 -0
- package/dist/components/MiniCalendar.d.ts.map +1 -0
- package/dist/components/MiniCalendar.js +73 -0
- package/dist/components/MiniCalendar.js.map +1 -0
- package/dist/components/MonthView.d.ts +6 -0
- package/dist/components/MonthView.d.ts.map +1 -0
- package/dist/components/MonthView.js +70 -0
- package/dist/components/MonthView.js.map +1 -0
- package/dist/components/TimelineView.d.ts +6 -0
- package/dist/components/TimelineView.d.ts.map +1 -0
- package/dist/components/TimelineView.js +99 -0
- package/dist/components/TimelineView.js.map +1 -0
- package/dist/components/ViewSwitcher.d.ts +6 -0
- package/dist/components/ViewSwitcher.d.ts.map +1 -0
- package/dist/components/ViewSwitcher.js +51 -0
- package/dist/components/ViewSwitcher.js.map +1 -0
- package/dist/components/WeekView.d.ts +6 -0
- package/dist/components/WeekView.d.ts.map +1 -0
- package/dist/components/WeekView.js +77 -0
- package/dist/components/WeekView.js.map +1 -0
- package/dist/components/YearView.d.ts +6 -0
- package/dist/components/YearView.d.ts.map +1 -0
- package/dist/components/YearView.js +69 -0
- package/dist/components/YearView.js.map +1 -0
- package/dist/constants/permissions.d.ts +90 -0
- package/dist/constants/permissions.d.ts.map +1 -0
- package/dist/constants/permissions.js +70 -0
- package/dist/constants/permissions.js.map +1 -0
- package/dist/dev/main.d.ts +2 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/generated/global-operations.d.ts +2 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-types.d.ts +20716 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +906 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-operations.js +456 -0
- package/dist/generated/wspace-operations.js.map +1 -0
- package/dist/generated/wspace-types.d.ts +53363 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/graphql/calendarDocuments.d.ts +25 -0
- package/dist/graphql/calendarDocuments.d.ts.map +1 -0
- package/dist/graphql/calendarDocuments.js +360 -0
- package/dist/graphql/calendarDocuments.js.map +1 -0
- package/dist/hooks/index.d.ts +11 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useCalendarPermissions.d.ts +14 -0
- package/dist/hooks/useCalendarPermissions.d.ts.map +1 -0
- package/dist/hooks/useCalendarPermissions.js +48 -0
- package/dist/hooks/useCalendarPermissions.js.map +1 -0
- package/dist/hooks/useEventPermissions.d.ts +15 -0
- package/dist/hooks/useEventPermissions.d.ts.map +1 -0
- package/dist/hooks/useEventPermissions.js +34 -0
- package/dist/hooks/useEventPermissions.js.map +1 -0
- package/dist/hooks/useEvents.d.ts +15 -0
- package/dist/hooks/useEvents.d.ts.map +1 -0
- package/dist/hooks/useEvents.js +199 -0
- package/dist/hooks/useEvents.js.map +1 -0
- package/dist/hooks/useSafePermissions.d.ts +6 -0
- package/dist/hooks/useSafePermissions.d.ts.map +1 -0
- package/dist/hooks/useSafePermissions.js +17 -0
- package/dist/hooks/useSafePermissions.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/pages/CalendarPage.d.ts +5 -0
- package/dist/pages/CalendarPage.d.ts.map +1 -0
- package/dist/pages/CalendarPage.js +239 -0
- package/dist/pages/CalendarPage.js.map +1 -0
- package/dist/pages/EventDetailsPage.d.ts +6 -0
- package/dist/pages/EventDetailsPage.d.ts.map +1 -0
- package/dist/pages/EventDetailsPage.js +625 -0
- package/dist/pages/EventDetailsPage.js.map +1 -0
- package/dist/pages/ResourcesPage.d.ts +6 -0
- package/dist/pages/ResourcesPage.d.ts.map +1 -0
- package/dist/pages/ResourcesPage.js +391 -0
- package/dist/pages/ResourcesPage.js.map +1 -0
- package/dist/pages/SettingsPage.d.ts +2 -0
- package/dist/pages/SettingsPage.d.ts.map +1 -0
- package/dist/pages/SettingsPage.js +798 -0
- package/dist/pages/SettingsPage.js.map +1 -0
- package/dist/pages/SubscriptionsPage.d.ts +6 -0
- package/dist/pages/SubscriptionsPage.d.ts.map +1 -0
- package/dist/pages/SubscriptionsPage.js +170 -0
- package/dist/pages/SubscriptionsPage.js.map +1 -0
- package/dist/providers/CalendarProvider.d.ts +31 -0
- package/dist/providers/CalendarProvider.d.ts.map +1 -0
- package/dist/providers/CalendarProvider.js +53 -0
- package/dist/providers/CalendarProvider.js.map +1 -0
- package/dist/store/calendarStore.d.ts +69 -0
- package/dist/store/calendarStore.d.ts.map +1 -0
- package/dist/store/calendarStore.js +82 -0
- package/dist/store/calendarStore.js.map +1 -0
- package/dist/types/index.d.ts +341 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/dateHelpers.d.ts +115 -0
- package/dist/utils/dateHelpers.d.ts.map +1 -0
- package/dist/utils/dateHelpers.js +86 -0
- package/dist/utils/dateHelpers.js.map +1 -0
- package/dist/utils/icalHelpers.d.ts +19 -0
- package/dist/utils/icalHelpers.d.ts.map +1 -0
- package/dist/utils/icalHelpers.js +57 -0
- package/dist/utils/icalHelpers.js.map +1 -0
- package/dist/utils/nativeBridge.d.ts +3 -0
- package/dist/utils/nativeBridge.d.ts.map +1 -0
- package/dist/utils/nativeBridge.js +2 -0
- package/dist/utils/recurrenceHelpers.d.ts +15 -0
- package/dist/utils/recurrenceHelpers.d.ts.map +1 -0
- package/dist/utils/timezoneHelpers.d.ts +39 -0
- package/dist/utils/timezoneHelpers.d.ts.map +1 -0
- package/package.json +109 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const EVENTS_IN_RANGE_QUERY: import('graphql').DocumentNode;
|
|
2
|
+
export declare const SCHEDULED_JOBS_QUERY: import('graphql').DocumentNode;
|
|
3
|
+
export declare const CALENDAR_DETAILS_QUERY: import('graphql').DocumentNode;
|
|
4
|
+
export declare const AVAILABILITY_RULES_QUERY: import('graphql').DocumentNode;
|
|
5
|
+
export declare const BLACKOUT_DATES_QUERY: import('graphql').DocumentNode;
|
|
6
|
+
export declare const EXTERNAL_SYNCS_QUERY: import('graphql').DocumentNode;
|
|
7
|
+
export declare const SHARE_CALENDAR_MUTATION: import('graphql').DocumentNode;
|
|
8
|
+
export declare const REVOKE_CALENDAR_SHARE_MUTATION: import('graphql').DocumentNode;
|
|
9
|
+
export declare const CREATE_AVAILABILITY_RULE_MUTATION: import('graphql').DocumentNode;
|
|
10
|
+
export declare const DELETE_AVAILABILITY_RULE_MUTATION: import('graphql').DocumentNode;
|
|
11
|
+
export declare const CREATE_BLACKOUT_DATE_MUTATION: import('graphql').DocumentNode;
|
|
12
|
+
export declare const DELETE_BLACKOUT_DATE_MUTATION: import('graphql').DocumentNode;
|
|
13
|
+
export declare const CREATE_BOOKING_PAGE_MUTATION: import('graphql').DocumentNode;
|
|
14
|
+
export declare const DELETE_BOOKING_PAGE_MUTATION: import('graphql').DocumentNode;
|
|
15
|
+
export declare const CONNECT_EXTERNAL_CALENDAR_MUTATION: import('graphql').DocumentNode;
|
|
16
|
+
export declare const TRIGGER_SYNC_MUTATION: import('graphql').DocumentNode;
|
|
17
|
+
export declare const PAUSE_SYNC_MUTATION: import('graphql').DocumentNode;
|
|
18
|
+
export declare const RESUME_SYNC_MUTATION: import('graphql').DocumentNode;
|
|
19
|
+
export declare const DISCONNECT_EXTERNAL_CALENDAR_MUTATION: import('graphql').DocumentNode;
|
|
20
|
+
export declare const ADD_ATTENDEE_MUTATION: import('graphql').DocumentNode;
|
|
21
|
+
export declare const REMOVE_ATTENDEE_MUTATION: import('graphql').DocumentNode;
|
|
22
|
+
export declare const RESPOND_TO_EVENT_MUTATION: import('graphql').DocumentNode;
|
|
23
|
+
export declare const CREATE_REMINDER_MUTATION: import('graphql').DocumentNode;
|
|
24
|
+
export declare const DELETE_REMINDER_MUTATION: import('graphql').DocumentNode;
|
|
25
|
+
//# sourceMappingURL=calendarDocuments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendarDocuments.d.ts","sourceRoot":"","sources":["../../src/graphql/calendarDocuments.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,gCAmEjC,CAAC;AAEF,eAAO,MAAM,oBAAoB,gCA8BhC,CAAC;AAEF,eAAO,MAAM,sBAAsB,gCAiClC,CAAC;AAEF,eAAO,MAAM,wBAAwB,gCAkBpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,gCAYhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,gCAqBhC,CAAC;AAEF,eAAO,MAAM,uBAAuB,gCA0BnC,CAAC;AAEF,eAAO,MAAM,8BAA8B,gCAI1C,CAAC;AAEF,eAAO,MAAM,iCAAiC,gCAiB7C,CAAC;AAEF,eAAO,MAAM,iCAAiC,gCAI7C,CAAC;AAEF,eAAO,MAAM,6BAA6B,gCAYzC,CAAC;AAEF,eAAO,MAAM,6BAA6B,gCAIzC,CAAC;AAEF,eAAO,MAAM,4BAA4B,gCAexC,CAAC;AAEF,eAAO,MAAM,4BAA4B,gCAIxC,CAAC;AAEF,eAAO,MAAM,kCAAkC,gCAiB9C,CAAC;AAEF,eAAO,MAAM,qBAAqB,gCAWjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,gCAQ/B,CAAC;AAEF,eAAO,MAAM,oBAAoB,gCAQhC,CAAC;AAEF,eAAO,MAAM,qCAAqC,gCAIjD,CAAC;AAEF,eAAO,MAAM,qBAAqB,gCAWjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,gCAIpC,CAAC;AAEF,eAAO,MAAM,yBAAyB,gCAWrC,CAAC;AAEF,eAAO,MAAM,wBAAwB,gCAQpC,CAAC;AAEF,eAAO,MAAM,wBAAwB,gCAIpC,CAAC"}
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { gql as e } from "@apollo/client";
|
|
2
|
+
//#region src/graphql/calendarDocuments.ts
|
|
3
|
+
var t = e`
|
|
4
|
+
query CalendarEventsInRange($calendarId: ID!, $startDate: DateTime!, $endDate: DateTime!) {
|
|
5
|
+
eventsInRange(calendarId: $calendarId, startDate: $startDate, endDate: $endDate) {
|
|
6
|
+
id
|
|
7
|
+
calendarId
|
|
8
|
+
workspaceId
|
|
9
|
+
title
|
|
10
|
+
description
|
|
11
|
+
location
|
|
12
|
+
locationAddress
|
|
13
|
+
locationType
|
|
14
|
+
locationUrl
|
|
15
|
+
startTime
|
|
16
|
+
endTime
|
|
17
|
+
allDay
|
|
18
|
+
timezone
|
|
19
|
+
status
|
|
20
|
+
visibility
|
|
21
|
+
eventType
|
|
22
|
+
isRecurring
|
|
23
|
+
rrule
|
|
24
|
+
tags
|
|
25
|
+
maxAttendees
|
|
26
|
+
currentAttendeeCount
|
|
27
|
+
checkInEnabled
|
|
28
|
+
onlineMeetingUrl
|
|
29
|
+
onlineMeetingProvider
|
|
30
|
+
metadata
|
|
31
|
+
createdBy
|
|
32
|
+
createdAt
|
|
33
|
+
updatedAt
|
|
34
|
+
calendar {
|
|
35
|
+
id
|
|
36
|
+
name
|
|
37
|
+
color
|
|
38
|
+
}
|
|
39
|
+
attendees {
|
|
40
|
+
id
|
|
41
|
+
userId
|
|
42
|
+
email
|
|
43
|
+
name
|
|
44
|
+
rsvpStatus
|
|
45
|
+
isOptional
|
|
46
|
+
}
|
|
47
|
+
reminders {
|
|
48
|
+
id
|
|
49
|
+
minutesBefore
|
|
50
|
+
channel
|
|
51
|
+
}
|
|
52
|
+
resourceBookings {
|
|
53
|
+
id
|
|
54
|
+
resourceId
|
|
55
|
+
startTime
|
|
56
|
+
endTime
|
|
57
|
+
status
|
|
58
|
+
notes
|
|
59
|
+
resource {
|
|
60
|
+
id
|
|
61
|
+
name
|
|
62
|
+
resourceType
|
|
63
|
+
location
|
|
64
|
+
capacity
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
attachments
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
`, n = e`
|
|
71
|
+
query CalendarScheduledJobs(
|
|
72
|
+
$workspaceId: ID!
|
|
73
|
+
$nextExecutionAfter: DateTime
|
|
74
|
+
$nextExecutionBefore: DateTime
|
|
75
|
+
) {
|
|
76
|
+
scheduledJobs(
|
|
77
|
+
workspaceId: $workspaceId
|
|
78
|
+
filter: { nextExecutionAfter: $nextExecutionAfter, nextExecutionBefore: $nextExecutionBefore }
|
|
79
|
+
pagination: { limit: 100, offset: 0 }
|
|
80
|
+
) {
|
|
81
|
+
scheduledJobs {
|
|
82
|
+
id
|
|
83
|
+
name
|
|
84
|
+
description
|
|
85
|
+
scheduleType
|
|
86
|
+
status
|
|
87
|
+
priority
|
|
88
|
+
scheduledAt
|
|
89
|
+
nextExecutionAt
|
|
90
|
+
lastExecutionAt
|
|
91
|
+
timezone
|
|
92
|
+
tags
|
|
93
|
+
actionId
|
|
94
|
+
metadata
|
|
95
|
+
createdAt
|
|
96
|
+
updatedAt
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
`, r = e`
|
|
101
|
+
query CalendarDetails($id: ID!) {
|
|
102
|
+
calendar(id: $id) {
|
|
103
|
+
id
|
|
104
|
+
name
|
|
105
|
+
description
|
|
106
|
+
color
|
|
107
|
+
timezone
|
|
108
|
+
calendarType
|
|
109
|
+
isPublic
|
|
110
|
+
isDefault
|
|
111
|
+
shares {
|
|
112
|
+
id
|
|
113
|
+
userId
|
|
114
|
+
teamId
|
|
115
|
+
canView
|
|
116
|
+
canEdit
|
|
117
|
+
canManage
|
|
118
|
+
createdAt
|
|
119
|
+
}
|
|
120
|
+
bookingPages {
|
|
121
|
+
id
|
|
122
|
+
name
|
|
123
|
+
slug
|
|
124
|
+
pageType
|
|
125
|
+
eventDuration
|
|
126
|
+
isActive
|
|
127
|
+
isPublic
|
|
128
|
+
requireApproval
|
|
129
|
+
maxAttendees
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
`, i = e`
|
|
134
|
+
query CalendarAvailabilityRules($calendarId: ID!) {
|
|
135
|
+
getAvailabilityRules(calendarId: $calendarId) {
|
|
136
|
+
id
|
|
137
|
+
dayOfWeek
|
|
138
|
+
isAvailable
|
|
139
|
+
startTime
|
|
140
|
+
endTime
|
|
141
|
+
timezone
|
|
142
|
+
bufferBefore
|
|
143
|
+
bufferAfter
|
|
144
|
+
minGapBetweenEvents
|
|
145
|
+
slotIncrement
|
|
146
|
+
minNotice
|
|
147
|
+
maxNotice
|
|
148
|
+
priority
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
`, a = e`
|
|
152
|
+
query CalendarBlackoutDates($calendarId: ID!, $startDate: DateTime!, $endDate: DateTime!) {
|
|
153
|
+
getBlackoutDates(calendarId: $calendarId, startDate: $startDate, endDate: $endDate) {
|
|
154
|
+
id
|
|
155
|
+
startDate
|
|
156
|
+
endDate
|
|
157
|
+
reason
|
|
158
|
+
isRecurring
|
|
159
|
+
recurrencePattern
|
|
160
|
+
createdAt
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
`, o = e`
|
|
164
|
+
query CalendarExternalSyncs($calendarId: ID!) {
|
|
165
|
+
getExternalCalendarSyncs(calendarId: $calendarId) {
|
|
166
|
+
id
|
|
167
|
+
calendarId
|
|
168
|
+
provider
|
|
169
|
+
externalCalendarId
|
|
170
|
+
externalCalendarName
|
|
171
|
+
direction
|
|
172
|
+
syncEnabled
|
|
173
|
+
syncFrequency
|
|
174
|
+
conflictResolution
|
|
175
|
+
status
|
|
176
|
+
lastSyncAt
|
|
177
|
+
lastSyncStatus
|
|
178
|
+
lastSyncError
|
|
179
|
+
nextSyncAt
|
|
180
|
+
createdAt
|
|
181
|
+
updatedAt
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
`, s = e`
|
|
185
|
+
mutation ShareCalendar(
|
|
186
|
+
$calendarId: ID!
|
|
187
|
+
$userId: String
|
|
188
|
+
$teamId: String
|
|
189
|
+
$canView: Boolean!
|
|
190
|
+
$canEdit: Boolean!
|
|
191
|
+
$canManage: Boolean!
|
|
192
|
+
) {
|
|
193
|
+
shareCalendar(
|
|
194
|
+
calendarId: $calendarId
|
|
195
|
+
userId: $userId
|
|
196
|
+
teamId: $teamId
|
|
197
|
+
canView: $canView
|
|
198
|
+
canEdit: $canEdit
|
|
199
|
+
canManage: $canManage
|
|
200
|
+
) {
|
|
201
|
+
id
|
|
202
|
+
userId
|
|
203
|
+
teamId
|
|
204
|
+
canView
|
|
205
|
+
canEdit
|
|
206
|
+
canManage
|
|
207
|
+
createdAt
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
`, c = e`
|
|
211
|
+
mutation RevokeCalendarShare($shareId: ID!) {
|
|
212
|
+
revokeCalendarShare(shareId: $shareId)
|
|
213
|
+
}
|
|
214
|
+
`, l = e`
|
|
215
|
+
mutation CreateAvailabilityRule($input: CreateAvailabilityRuleInput!) {
|
|
216
|
+
createAvailabilityRule(input: $input) {
|
|
217
|
+
id
|
|
218
|
+
dayOfWeek
|
|
219
|
+
isAvailable
|
|
220
|
+
startTime
|
|
221
|
+
endTime
|
|
222
|
+
timezone
|
|
223
|
+
bufferBefore
|
|
224
|
+
bufferAfter
|
|
225
|
+
slotIncrement
|
|
226
|
+
minNotice
|
|
227
|
+
maxNotice
|
|
228
|
+
priority
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
`, u = e`
|
|
232
|
+
mutation DeleteAvailabilityRule($id: ID!) {
|
|
233
|
+
deleteAvailabilityRule(id: $id)
|
|
234
|
+
}
|
|
235
|
+
`, d = e`
|
|
236
|
+
mutation CreateBlackoutDate($input: CreateBlackoutDateInput!) {
|
|
237
|
+
createBlackoutDate(input: $input) {
|
|
238
|
+
id
|
|
239
|
+
startDate
|
|
240
|
+
endDate
|
|
241
|
+
reason
|
|
242
|
+
isRecurring
|
|
243
|
+
recurrencePattern
|
|
244
|
+
createdAt
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
`, f = e`
|
|
248
|
+
mutation DeleteBlackoutDate($id: ID!) {
|
|
249
|
+
deleteBlackoutDate(id: $id)
|
|
250
|
+
}
|
|
251
|
+
`, p = e`
|
|
252
|
+
mutation CreateBookingPage($input: CreateBookingPageInput!) {
|
|
253
|
+
createBookingPage(input: $input) {
|
|
254
|
+
id
|
|
255
|
+
calendarId
|
|
256
|
+
name
|
|
257
|
+
slug
|
|
258
|
+
pageType
|
|
259
|
+
eventDuration
|
|
260
|
+
isActive
|
|
261
|
+
isPublic
|
|
262
|
+
requireApproval
|
|
263
|
+
maxAttendees
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
`, m = e`
|
|
267
|
+
mutation DeleteBookingPage($id: ID!) {
|
|
268
|
+
deleteBookingPage(id: $id)
|
|
269
|
+
}
|
|
270
|
+
`, h = e`
|
|
271
|
+
mutation ConnectExternalCalendar($input: ConnectExternalCalendarInput!) {
|
|
272
|
+
connectExternalCalendar(input: $input) {
|
|
273
|
+
id
|
|
274
|
+
provider
|
|
275
|
+
externalCalendarId
|
|
276
|
+
externalCalendarName
|
|
277
|
+
direction
|
|
278
|
+
syncEnabled
|
|
279
|
+
syncFrequency
|
|
280
|
+
conflictResolution
|
|
281
|
+
status
|
|
282
|
+
lastSyncStatus
|
|
283
|
+
lastSyncError
|
|
284
|
+
nextSyncAt
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
`, g = e`
|
|
288
|
+
mutation TriggerExternalCalendarSync($syncId: ID!) {
|
|
289
|
+
triggerSync(syncId: $syncId) {
|
|
290
|
+
id
|
|
291
|
+
status
|
|
292
|
+
lastSyncAt
|
|
293
|
+
lastSyncStatus
|
|
294
|
+
lastSyncError
|
|
295
|
+
nextSyncAt
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
`, _ = e`
|
|
299
|
+
mutation PauseExternalCalendarSync($syncId: ID!) {
|
|
300
|
+
pauseSync(syncId: $syncId) {
|
|
301
|
+
id
|
|
302
|
+
status
|
|
303
|
+
syncEnabled
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
`, v = e`
|
|
307
|
+
mutation ResumeExternalCalendarSync($syncId: ID!) {
|
|
308
|
+
resumeSync(syncId: $syncId) {
|
|
309
|
+
id
|
|
310
|
+
status
|
|
311
|
+
syncEnabled
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
`, y = e`
|
|
315
|
+
mutation DisconnectExternalCalendar($syncId: ID!) {
|
|
316
|
+
disconnectExternalCalendar(syncId: $syncId)
|
|
317
|
+
}
|
|
318
|
+
`, b = e`
|
|
319
|
+
mutation AddCalendarAttendee($eventId: ID!, $userId: String, $email: String, $name: String) {
|
|
320
|
+
addAttendee(eventId: $eventId, userId: $userId, email: $email, name: $name) {
|
|
321
|
+
id
|
|
322
|
+
userId
|
|
323
|
+
email
|
|
324
|
+
name
|
|
325
|
+
rsvpStatus
|
|
326
|
+
isOptional
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
`, x = e`
|
|
330
|
+
mutation RemoveCalendarAttendee($attendeeId: ID!) {
|
|
331
|
+
removeAttendee(attendeeId: $attendeeId)
|
|
332
|
+
}
|
|
333
|
+
`, S = e`
|
|
334
|
+
mutation RespondToCalendarEvent($eventId: ID!, $status: RSVPStatus!) {
|
|
335
|
+
respondToEvent(eventId: $eventId, status: $status) {
|
|
336
|
+
id
|
|
337
|
+
userId
|
|
338
|
+
email
|
|
339
|
+
name
|
|
340
|
+
rsvpStatus
|
|
341
|
+
isOptional
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
`, C = e`
|
|
345
|
+
mutation CreateCalendarReminder($input: CreateReminderInput!) {
|
|
346
|
+
createReminder(input: $input) {
|
|
347
|
+
id
|
|
348
|
+
minutesBefore
|
|
349
|
+
channel
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
`, w = e`
|
|
353
|
+
mutation DeleteCalendarReminder($id: ID!) {
|
|
354
|
+
deleteReminder(id: $id)
|
|
355
|
+
}
|
|
356
|
+
`;
|
|
357
|
+
//#endregion
|
|
358
|
+
export { b as ADD_ATTENDEE_MUTATION, i as AVAILABILITY_RULES_QUERY, a as BLACKOUT_DATES_QUERY, r as CALENDAR_DETAILS_QUERY, h as CONNECT_EXTERNAL_CALENDAR_MUTATION, l as CREATE_AVAILABILITY_RULE_MUTATION, d as CREATE_BLACKOUT_DATE_MUTATION, p as CREATE_BOOKING_PAGE_MUTATION, C as CREATE_REMINDER_MUTATION, u as DELETE_AVAILABILITY_RULE_MUTATION, f as DELETE_BLACKOUT_DATE_MUTATION, m as DELETE_BOOKING_PAGE_MUTATION, w as DELETE_REMINDER_MUTATION, y as DISCONNECT_EXTERNAL_CALENDAR_MUTATION, t as EVENTS_IN_RANGE_QUERY, o as EXTERNAL_SYNCS_QUERY, _ as PAUSE_SYNC_MUTATION, x as REMOVE_ATTENDEE_MUTATION, S as RESPOND_TO_EVENT_MUTATION, v as RESUME_SYNC_MUTATION, c as REVOKE_CALENDAR_SHARE_MUTATION, n as SCHEDULED_JOBS_QUERY, s as SHARE_CALENDAR_MUTATION, g as TRIGGER_SYNC_MUTATION };
|
|
359
|
+
|
|
360
|
+
//# sourceMappingURL=calendarDocuments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendarDocuments.js","names":[],"sources":["../../src/graphql/calendarDocuments.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nexport const EVENTS_IN_RANGE_QUERY = gql`\n query CalendarEventsInRange($calendarId: ID!, $startDate: DateTime!, $endDate: DateTime!) {\n eventsInRange(calendarId: $calendarId, startDate: $startDate, endDate: $endDate) {\n id\n calendarId\n workspaceId\n title\n description\n location\n locationAddress\n locationType\n locationUrl\n startTime\n endTime\n allDay\n timezone\n status\n visibility\n eventType\n isRecurring\n rrule\n tags\n maxAttendees\n currentAttendeeCount\n checkInEnabled\n onlineMeetingUrl\n onlineMeetingProvider\n metadata\n createdBy\n createdAt\n updatedAt\n calendar {\n id\n name\n color\n }\n attendees {\n id\n userId\n email\n name\n rsvpStatus\n isOptional\n }\n reminders {\n id\n minutesBefore\n channel\n }\n resourceBookings {\n id\n resourceId\n startTime\n endTime\n status\n notes\n resource {\n id\n name\n resourceType\n location\n capacity\n }\n }\n attachments\n }\n }\n`;\n\nexport const SCHEDULED_JOBS_QUERY = gql`\n query CalendarScheduledJobs(\n $workspaceId: ID!\n $nextExecutionAfter: DateTime\n $nextExecutionBefore: DateTime\n ) {\n scheduledJobs(\n workspaceId: $workspaceId\n filter: { nextExecutionAfter: $nextExecutionAfter, nextExecutionBefore: $nextExecutionBefore }\n pagination: { limit: 100, offset: 0 }\n ) {\n scheduledJobs {\n id\n name\n description\n scheduleType\n status\n priority\n scheduledAt\n nextExecutionAt\n lastExecutionAt\n timezone\n tags\n actionId\n metadata\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const CALENDAR_DETAILS_QUERY = gql`\n query CalendarDetails($id: ID!) {\n calendar(id: $id) {\n id\n name\n description\n color\n timezone\n calendarType\n isPublic\n isDefault\n shares {\n id\n userId\n teamId\n canView\n canEdit\n canManage\n createdAt\n }\n bookingPages {\n id\n name\n slug\n pageType\n eventDuration\n isActive\n isPublic\n requireApproval\n maxAttendees\n }\n }\n }\n`;\n\nexport const AVAILABILITY_RULES_QUERY = gql`\n query CalendarAvailabilityRules($calendarId: ID!) {\n getAvailabilityRules(calendarId: $calendarId) {\n id\n dayOfWeek\n isAvailable\n startTime\n endTime\n timezone\n bufferBefore\n bufferAfter\n minGapBetweenEvents\n slotIncrement\n minNotice\n maxNotice\n priority\n }\n }\n`;\n\nexport const BLACKOUT_DATES_QUERY = gql`\n query CalendarBlackoutDates($calendarId: ID!, $startDate: DateTime!, $endDate: DateTime!) {\n getBlackoutDates(calendarId: $calendarId, startDate: $startDate, endDate: $endDate) {\n id\n startDate\n endDate\n reason\n isRecurring\n recurrencePattern\n createdAt\n }\n }\n`;\n\nexport const EXTERNAL_SYNCS_QUERY = gql`\n query CalendarExternalSyncs($calendarId: ID!) {\n getExternalCalendarSyncs(calendarId: $calendarId) {\n id\n calendarId\n provider\n externalCalendarId\n externalCalendarName\n direction\n syncEnabled\n syncFrequency\n conflictResolution\n status\n lastSyncAt\n lastSyncStatus\n lastSyncError\n nextSyncAt\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const SHARE_CALENDAR_MUTATION = gql`\n mutation ShareCalendar(\n $calendarId: ID!\n $userId: String\n $teamId: String\n $canView: Boolean!\n $canEdit: Boolean!\n $canManage: Boolean!\n ) {\n shareCalendar(\n calendarId: $calendarId\n userId: $userId\n teamId: $teamId\n canView: $canView\n canEdit: $canEdit\n canManage: $canManage\n ) {\n id\n userId\n teamId\n canView\n canEdit\n canManage\n createdAt\n }\n }\n`;\n\nexport const REVOKE_CALENDAR_SHARE_MUTATION = gql`\n mutation RevokeCalendarShare($shareId: ID!) {\n revokeCalendarShare(shareId: $shareId)\n }\n`;\n\nexport const CREATE_AVAILABILITY_RULE_MUTATION = gql`\n mutation CreateAvailabilityRule($input: CreateAvailabilityRuleInput!) {\n createAvailabilityRule(input: $input) {\n id\n dayOfWeek\n isAvailable\n startTime\n endTime\n timezone\n bufferBefore\n bufferAfter\n slotIncrement\n minNotice\n maxNotice\n priority\n }\n }\n`;\n\nexport const DELETE_AVAILABILITY_RULE_MUTATION = gql`\n mutation DeleteAvailabilityRule($id: ID!) {\n deleteAvailabilityRule(id: $id)\n }\n`;\n\nexport const CREATE_BLACKOUT_DATE_MUTATION = gql`\n mutation CreateBlackoutDate($input: CreateBlackoutDateInput!) {\n createBlackoutDate(input: $input) {\n id\n startDate\n endDate\n reason\n isRecurring\n recurrencePattern\n createdAt\n }\n }\n`;\n\nexport const DELETE_BLACKOUT_DATE_MUTATION = gql`\n mutation DeleteBlackoutDate($id: ID!) {\n deleteBlackoutDate(id: $id)\n }\n`;\n\nexport const CREATE_BOOKING_PAGE_MUTATION = gql`\n mutation CreateBookingPage($input: CreateBookingPageInput!) {\n createBookingPage(input: $input) {\n id\n calendarId\n name\n slug\n pageType\n eventDuration\n isActive\n isPublic\n requireApproval\n maxAttendees\n }\n }\n`;\n\nexport const DELETE_BOOKING_PAGE_MUTATION = gql`\n mutation DeleteBookingPage($id: ID!) {\n deleteBookingPage(id: $id)\n }\n`;\n\nexport const CONNECT_EXTERNAL_CALENDAR_MUTATION = gql`\n mutation ConnectExternalCalendar($input: ConnectExternalCalendarInput!) {\n connectExternalCalendar(input: $input) {\n id\n provider\n externalCalendarId\n externalCalendarName\n direction\n syncEnabled\n syncFrequency\n conflictResolution\n status\n lastSyncStatus\n lastSyncError\n nextSyncAt\n }\n }\n`;\n\nexport const TRIGGER_SYNC_MUTATION = gql`\n mutation TriggerExternalCalendarSync($syncId: ID!) {\n triggerSync(syncId: $syncId) {\n id\n status\n lastSyncAt\n lastSyncStatus\n lastSyncError\n nextSyncAt\n }\n }\n`;\n\nexport const PAUSE_SYNC_MUTATION = gql`\n mutation PauseExternalCalendarSync($syncId: ID!) {\n pauseSync(syncId: $syncId) {\n id\n status\n syncEnabled\n }\n }\n`;\n\nexport const RESUME_SYNC_MUTATION = gql`\n mutation ResumeExternalCalendarSync($syncId: ID!) {\n resumeSync(syncId: $syncId) {\n id\n status\n syncEnabled\n }\n }\n`;\n\nexport const DISCONNECT_EXTERNAL_CALENDAR_MUTATION = gql`\n mutation DisconnectExternalCalendar($syncId: ID!) {\n disconnectExternalCalendar(syncId: $syncId)\n }\n`;\n\nexport const ADD_ATTENDEE_MUTATION = gql`\n mutation AddCalendarAttendee($eventId: ID!, $userId: String, $email: String, $name: String) {\n addAttendee(eventId: $eventId, userId: $userId, email: $email, name: $name) {\n id\n userId\n email\n name\n rsvpStatus\n isOptional\n }\n }\n`;\n\nexport const REMOVE_ATTENDEE_MUTATION = gql`\n mutation RemoveCalendarAttendee($attendeeId: ID!) {\n removeAttendee(attendeeId: $attendeeId)\n }\n`;\n\nexport const RESPOND_TO_EVENT_MUTATION = gql`\n mutation RespondToCalendarEvent($eventId: ID!, $status: RSVPStatus!) {\n respondToEvent(eventId: $eventId, status: $status) {\n id\n userId\n email\n name\n rsvpStatus\n isOptional\n }\n }\n`;\n\nexport const CREATE_REMINDER_MUTATION = gql`\n mutation CreateCalendarReminder($input: CreateReminderInput!) {\n createReminder(input: $input) {\n id\n minutesBefore\n channel\n }\n }\n`;\n\nexport const DELETE_REMINDER_MUTATION = gql`\n mutation DeleteCalendarReminder($id: ID!) {\n deleteReminder(id: $id)\n }\n`;\n"],"mappings":";;AAEA,IAAa,IAAwB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqE3B,IAAuB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgC1B,IAAyB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmC5B,IAA2B,CAAG;;;;;;;;;;;;;;;;;;GAoB9B,IAAuB,CAAG;;;;;;;;;;;;GAc1B,IAAuB,CAAG;;;;;;;;;;;;;;;;;;;;;GAuB1B,IAA0B,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;GA4B7B,IAAiC,CAAG;;;;GAMpC,IAAoC,CAAG;;;;;;;;;;;;;;;;;GAmBvC,IAAoC,CAAG;;;;GAMvC,IAAgC,CAAG;;;;;;;;;;;;GAcnC,IAAgC,CAAG;;;;GAMnC,IAA+B,CAAG;;;;;;;;;;;;;;;GAiBlC,IAA+B,CAAG;;;;GAMlC,IAAqC,CAAG;;;;;;;;;;;;;;;;;GAmBxC,IAAwB,CAAG;;;;;;;;;;;GAa3B,IAAsB,CAAG;;;;;;;;GAUzB,IAAuB,CAAG;;;;;;;;GAU1B,IAAwC,CAAG;;;;GAM3C,IAAwB,CAAG;;;;;;;;;;;GAa3B,IAA2B,CAAG;;;;GAM9B,IAA4B,CAAG;;;;;;;;;;;GAa/B,IAA2B,CAAG;;;;;;;;GAU9B,IAA2B,CAAG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar hooks
|
|
3
|
+
*/
|
|
4
|
+
export { useCalendarStore } from '../store/calendarStore';
|
|
5
|
+
export { useCalendar } from '../providers/CalendarProvider';
|
|
6
|
+
export { useCalendarPermissions } from './useCalendarPermissions';
|
|
7
|
+
export { useEventPermissions } from './useEventPermissions';
|
|
8
|
+
export { useEvents } from './useEvents';
|
|
9
|
+
export type { CalendarPermissions } from './useCalendarPermissions';
|
|
10
|
+
export type { EventPermissions } from './useEventPermissions';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Calendar } from '../types';
|
|
2
|
+
|
|
3
|
+
export interface CalendarPermissions {
|
|
4
|
+
canRead: boolean;
|
|
5
|
+
canWrite: boolean;
|
|
6
|
+
canShare: boolean;
|
|
7
|
+
canDelete: boolean;
|
|
8
|
+
permissionLevel: 'owner' | 'admin' | 'edit' | 'view' | 'none';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Hook to check permissions for a calendar
|
|
12
|
+
*/
|
|
13
|
+
export declare function useCalendarPermissions(calendar: Calendar | null | undefined): CalendarPermissions;
|
|
14
|
+
//# sourceMappingURL=useCalendarPermissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCalendarPermissions.d.ts","sourceRoot":"","sources":["../../src/hooks/useCalendarPermissions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAC/D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,mBAAmB,CA0DjG"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useCalendar as e } from "../providers/CalendarProvider.js";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
//#region src/hooks/useCalendarPermissions.ts
|
|
4
|
+
function n(n) {
|
|
5
|
+
let { currentUser: r } = e();
|
|
6
|
+
return t(() => {
|
|
7
|
+
if (!n || !r) return {
|
|
8
|
+
canRead: !1,
|
|
9
|
+
canWrite: !1,
|
|
10
|
+
canShare: !1,
|
|
11
|
+
canDelete: !1,
|
|
12
|
+
permissionLevel: "none"
|
|
13
|
+
};
|
|
14
|
+
let e = n.ownerId === r.id, t = n.shares?.find((e) => e.userId === r.id);
|
|
15
|
+
if (e) return {
|
|
16
|
+
canRead: !0,
|
|
17
|
+
canWrite: !0,
|
|
18
|
+
canShare: !0,
|
|
19
|
+
canDelete: !0,
|
|
20
|
+
permissionLevel: "owner"
|
|
21
|
+
};
|
|
22
|
+
if (!t) return n.visibility === "PUBLIC" ? {
|
|
23
|
+
canRead: !0,
|
|
24
|
+
canWrite: !1,
|
|
25
|
+
canShare: !1,
|
|
26
|
+
canDelete: !1,
|
|
27
|
+
permissionLevel: "view"
|
|
28
|
+
} : {
|
|
29
|
+
canRead: !1,
|
|
30
|
+
canWrite: !1,
|
|
31
|
+
canShare: !1,
|
|
32
|
+
canDelete: !1,
|
|
33
|
+
permissionLevel: "none"
|
|
34
|
+
};
|
|
35
|
+
let i = t.permission;
|
|
36
|
+
return {
|
|
37
|
+
canRead: !0,
|
|
38
|
+
canWrite: i === "EDIT" || i === "ADMIN",
|
|
39
|
+
canShare: i === "ADMIN",
|
|
40
|
+
canDelete: !1,
|
|
41
|
+
permissionLevel: i.toLowerCase()
|
|
42
|
+
};
|
|
43
|
+
}, [n, r]);
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { n as useCalendarPermissions };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=useCalendarPermissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCalendarPermissions.js","names":[],"sources":["../../src/hooks/useCalendarPermissions.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { Calendar } from '../types';\nimport { useCalendar } from '../providers/CalendarProvider';\n\nexport interface CalendarPermissions {\n canRead: boolean;\n canWrite: boolean;\n canShare: boolean;\n canDelete: boolean;\n permissionLevel: 'owner' | 'admin' | 'edit' | 'view' | 'none';\n}\n\n/**\n * Hook to check permissions for a calendar\n */\nexport function useCalendarPermissions(calendar: Calendar | null | undefined): CalendarPermissions {\n const { currentUser } = useCalendar();\n\n return useMemo(() => {\n if (!calendar || !currentUser) {\n return {\n canRead: false,\n canWrite: false,\n canShare: false,\n canDelete: false,\n permissionLevel: 'none',\n };\n }\n\n const isOwner = calendar.ownerId === currentUser.id;\n const share = calendar.shares?.find((s) => s.userId === currentUser.id);\n\n if (isOwner) {\n return {\n canRead: true,\n canWrite: true,\n canShare: true,\n canDelete: true,\n permissionLevel: 'owner',\n };\n }\n\n if (!share) {\n // Check visibility\n if (calendar.visibility === 'PUBLIC') {\n return {\n canRead: true,\n canWrite: false,\n canShare: false,\n canDelete: false,\n permissionLevel: 'view',\n };\n }\n\n return {\n canRead: false,\n canWrite: false,\n canShare: false,\n canDelete: false,\n permissionLevel: 'none',\n };\n }\n\n const permission = share.permission;\n\n return {\n canRead: true,\n canWrite: permission === 'EDIT' || permission === 'ADMIN',\n canShare: permission === 'ADMIN',\n canDelete: false, // Only owner can delete\n permissionLevel: permission.toLowerCase() as 'admin' | 'edit' | 'view',\n };\n }, [calendar, currentUser]);\n}\n"],"mappings":";;;AAeA,SAAgB,EAAuB,GAA4D;CACjG,IAAM,EAAE,mBAAgB,GAAa;AAErC,QAAO,QAAc;AACnB,MAAI,CAAC,KAAY,CAAC,EAChB,QAAO;GACL,SAAS;GACT,UAAU;GACV,UAAU;GACV,WAAW;GACX,iBAAiB;GAClB;EAGH,IAAM,IAAU,EAAS,YAAY,EAAY,IAC3C,IAAQ,EAAS,QAAQ,MAAM,MAAM,EAAE,WAAW,EAAY,GAAG;AAEvE,MAAI,EACF,QAAO;GACL,SAAS;GACT,UAAU;GACV,UAAU;GACV,WAAW;GACX,iBAAiB;GAClB;AAGH,MAAI,CAAC,EAYH,QAVI,EAAS,eAAe,WACnB;GACL,SAAS;GACT,UAAU;GACV,UAAU;GACV,WAAW;GACX,iBAAiB;GAClB,GAGI;GACL,SAAS;GACT,UAAU;GACV,UAAU;GACV,WAAW;GACX,iBAAiB;GAClB;EAGH,IAAM,IAAa,EAAM;AAEzB,SAAO;GACL,SAAS;GACT,UAAU,MAAe,UAAU,MAAe;GAClD,UAAU,MAAe;GACzB,WAAW;GACX,iBAAiB,EAAW,aAAa;GAC1C;IACA,CAAC,GAAU,EAAY,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CalendarEvent, Calendar } from '../types';
|
|
2
|
+
|
|
3
|
+
export interface EventPermissions {
|
|
4
|
+
canEdit: boolean;
|
|
5
|
+
canDelete: boolean;
|
|
6
|
+
canManageAttendees: boolean;
|
|
7
|
+
canRSVP: boolean;
|
|
8
|
+
canViewAttendees: boolean;
|
|
9
|
+
canSetReminders: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Hook to check permissions for a calendar event
|
|
13
|
+
*/
|
|
14
|
+
export declare function useEventPermissions(event: CalendarEvent | null | undefined, calendar?: Calendar | null): EventPermissions;
|
|
15
|
+
//# sourceMappingURL=useEventPermissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEventPermissions.d.ts","sourceRoot":"","sources":["../../src/hooks/useEventPermissions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIxD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,EACvC,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,GACzB,gBAAgB,CA4BlB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useCalendar as e } from "../providers/CalendarProvider.js";
|
|
2
|
+
import { useCalendarPermissions as t } from "./useCalendarPermissions.js";
|
|
3
|
+
import { useMemo as n } from "react";
|
|
4
|
+
//#region src/hooks/useEventPermissions.ts
|
|
5
|
+
function r(r, i) {
|
|
6
|
+
let { currentUser: a } = e(), o = t(i);
|
|
7
|
+
return n(() => {
|
|
8
|
+
if (!r || !a) return {
|
|
9
|
+
canEdit: !1,
|
|
10
|
+
canDelete: !1,
|
|
11
|
+
canManageAttendees: !1,
|
|
12
|
+
canRSVP: !1,
|
|
13
|
+
canViewAttendees: !1,
|
|
14
|
+
canSetReminders: !1
|
|
15
|
+
};
|
|
16
|
+
let e = r.organizerId === a.id, t = r.attendees?.some((e) => e.userId === a.id) ?? !1;
|
|
17
|
+
return {
|
|
18
|
+
canEdit: e || o.canWrite,
|
|
19
|
+
canDelete: e || o.canShare,
|
|
20
|
+
canManageAttendees: e || o.canWrite,
|
|
21
|
+
canRSVP: t,
|
|
22
|
+
canViewAttendees: e || t || r.privacy === "PUBLIC",
|
|
23
|
+
canSetReminders: t
|
|
24
|
+
};
|
|
25
|
+
}, [
|
|
26
|
+
r,
|
|
27
|
+
a,
|
|
28
|
+
o
|
|
29
|
+
]);
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { r as useEventPermissions };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=useEventPermissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEventPermissions.js","names":[],"sources":["../../src/hooks/useEventPermissions.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { CalendarEvent, Calendar } from '../types';\nimport { useCalendar } from '../providers/CalendarProvider';\nimport { useCalendarPermissions } from './useCalendarPermissions';\n\nexport interface EventPermissions {\n canEdit: boolean;\n canDelete: boolean;\n canManageAttendees: boolean;\n canRSVP: boolean;\n canViewAttendees: boolean;\n canSetReminders: boolean;\n}\n\n/**\n * Hook to check permissions for a calendar event\n */\nexport function useEventPermissions(\n event: CalendarEvent | null | undefined,\n calendar?: Calendar | null\n): EventPermissions {\n const { currentUser } = useCalendar();\n const calendarPerms = useCalendarPermissions(calendar);\n\n return useMemo(() => {\n if (!event || !currentUser) {\n return {\n canEdit: false,\n canDelete: false,\n canManageAttendees: false,\n canRSVP: false,\n canViewAttendees: false,\n canSetReminders: false,\n };\n }\n\n const isOrganizer = event.organizerId === currentUser.id;\n const isAttendee = event.attendees?.some((a) => a.userId === currentUser.id) ?? false;\n\n return {\n canEdit: isOrganizer || calendarPerms.canWrite,\n canDelete: isOrganizer || calendarPerms.canShare,\n canManageAttendees: isOrganizer || calendarPerms.canWrite,\n canRSVP: isAttendee,\n canViewAttendees: isOrganizer || isAttendee || event.privacy === 'PUBLIC',\n canSetReminders: isAttendee,\n };\n }, [event, currentUser, calendarPerms]);\n}\n"],"mappings":";;;;AAiBA,SAAgB,EACd,GACA,GACkB;CAClB,IAAM,EAAE,mBAAgB,GAAa,EAC/B,IAAgB,EAAuB,EAAS;AAEtD,QAAO,QAAc;AACnB,MAAI,CAAC,KAAS,CAAC,EACb,QAAO;GACL,SAAS;GACT,WAAW;GACX,oBAAoB;GACpB,SAAS;GACT,kBAAkB;GAClB,iBAAiB;GAClB;EAGH,IAAM,IAAc,EAAM,gBAAgB,EAAY,IAChD,IAAa,EAAM,WAAW,MAAM,MAAM,EAAE,WAAW,EAAY,GAAG,IAAI;AAEhF,SAAO;GACL,SAAS,KAAe,EAAc;GACtC,WAAW,KAAe,EAAc;GACxC,oBAAoB,KAAe,EAAc;GACjD,SAAS;GACT,kBAAkB,KAAe,KAAc,EAAM,YAAY;GACjE,iBAAiB;GAClB;IACA;EAAC;EAAO;EAAa;EAAc,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CalendarEvent } from '../types';
|
|
2
|
+
|
|
3
|
+
interface UseEventsOptions {
|
|
4
|
+
startDate: Date;
|
|
5
|
+
endDate: Date;
|
|
6
|
+
skip?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function useEvents({ startDate, endDate, skip }: UseEventsOptions): {
|
|
9
|
+
events: CalendarEvent[];
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
error: string | null;
|
|
12
|
+
refetch: () => Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=useEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEvents.d.ts","sourceRoot":"","sources":["../../src/hooks/useEvents.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,aAAa,EAKd,MAAM,UAAU,CAAC;AAGlB,UAAU,gBAAgB;IACxB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA6QD,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAY,EAAE,EAAE,gBAAgB;;;;;EAoI/E"}
|