@vicacha-devs/strapi-plugin-bookings 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.
- package/LICENSE.md +21 -0
- package/README.md +23 -2
- package/dist/admin/App-BrB9n7EO.mjs +371 -0
- package/dist/admin/App-ZlqOsILc.js +371 -0
- package/dist/admin/SettingsPage-LR6F2vyx.js +410 -0
- package/dist/admin/SettingsPage-Xas3gvn4.mjs +410 -0
- package/dist/admin/ar-9_2mxMp2.js +339 -0
- package/dist/admin/ar-CrM4yxqb.mjs +339 -0
- package/dist/admin/de-D3NbAP6M.mjs +339 -0
- package/dist/admin/de-DBaO-D7Z.js +339 -0
- package/dist/admin/en-Cu-rn_xM.mjs +339 -0
- package/dist/admin/en-DAoI7qkk.js +339 -0
- package/dist/admin/es-DUqsu82s.js +339 -0
- package/dist/admin/es-Y0zfya4P.mjs +339 -0
- package/dist/admin/fr-BkLta_o8.js +339 -0
- package/dist/admin/fr-BrzKRqet.mjs +339 -0
- package/dist/admin/getTranslation-CZAJyMSt.mjs +5 -0
- package/dist/admin/getTranslation-Cd0_4UtW.js +4 -0
- package/dist/admin/id-BZz53ViW.mjs +339 -0
- package/dist/admin/id-ByxSagzq.js +339 -0
- package/dist/admin/index.js +1497 -0
- package/dist/admin/index.mjs +1492 -0
- package/dist/admin/pt-BSCDUkdd.js +339 -0
- package/dist/admin/pt-DUfISuZf.mjs +339 -0
- package/dist/admin/src/components/Initializer.d.ts +6 -0
- package/dist/admin/src/components/PluginIcon.d.ts +3 -0
- package/dist/admin/src/components/RRuleInput.d.ts +3 -0
- package/dist/admin/src/components/bookings/BookingSidePanel.d.ts +10 -0
- package/dist/admin/src/components/bookings/BookingsGridCanvas.d.ts +20 -0
- package/dist/admin/src/components/bookings/QuickCreateBookingModal.d.ts +11 -0
- package/dist/admin/src/index.d.ts +24 -0
- package/dist/admin/src/pages/App.d.ts +3 -0
- package/dist/admin/src/pages/CalendarPage.d.ts +3 -0
- package/dist/admin/src/pages/SettingsPage.d.ts +3 -0
- package/dist/admin/src/permissions.d.ts +29 -0
- package/dist/admin/src/pluginId.d.ts +1 -0
- package/dist/admin/src/translations/cmLabels.d.ts +1 -0
- package/dist/admin/src/translations/cmPlaceholders.d.ts +1 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/admin/tr-_nhc9hk6.mjs +339 -0
- package/dist/admin/tr-r17l5F2K.js +339 -0
- package/dist/admin/ur-8edBd0Qo.mjs +339 -0
- package/dist/admin/ur-Dw_TAOZ3.js +339 -0
- package/dist/admin/zh-CeR0swEm.mjs +339 -0
- package/dist/admin/zh-D0z5sxxN.js +339 -0
- package/dist/server/index.js +3547 -0
- package/dist/server/index.mjs +3545 -0
- package/dist/server/src/bootstrap.d.ts +6 -0
- package/dist/server/src/config/index.d.ts +6 -0
- package/dist/server/src/content-types/booking/schema.json.d.ts +117 -0
- package/dist/server/src/content-types/index.d.ts +265 -0
- package/dist/server/src/content-types/resource/schema.json.d.ts +147 -0
- package/dist/server/src/controllers/admin.d.ts +30 -0
- package/dist/server/src/controllers/content-api.d.ts +32 -0
- package/dist/server/src/controllers/index.d.ts +28 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/errors.d.ts +18 -0
- package/dist/server/src/index.d.ts +347 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/admin.d.ts +14 -0
- package/dist/server/src/routes/content-api.d.ts +9 -0
- package/dist/server/src/routes/index.d.ts +30 -0
- package/dist/server/src/services/availability.d.ts +8 -0
- package/dist/server/src/services/index.d.ts +12 -0
- package/dist/server/src/services/reservation.d.ts +6 -0
- package/dist/server/src/services/reservationHelpers.d.ts +41 -0
- package/dist/server/src/services/reservationHostCapacity.d.ts +16 -0
- package/dist/server/src/services/reservationMutations.d.ts +32 -0
- package/dist/server/src/services/reservationSources.d.ts +4 -0
- package/dist/server/src/services/reservationValidators.d.ts +27 -0
- package/dist/server/src/services/settings.d.ts +8 -0
- package/dist/server/src/types.d.ts +99 -0
- package/dist/shared/calendarSystems.d.ts +3 -0
- package/dist/shared/icalAndCsv.d.ts +16 -0
- package/dist/shared/index.d.ts +6 -0
- package/dist/shared/index.js +752 -0
- package/dist/shared/index.mjs +729 -0
- package/dist/shared/pluginId.d.ts +2 -0
- package/dist/shared/slotEngine.d.ts +19 -0
- package/dist/shared/slotTimezone.d.ts +45 -0
- package/dist/shared/types.d.ts +245 -0
- package/package.json +111 -3
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
register: ({ strapi }: {
|
|
3
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
4
|
+
}) => void;
|
|
5
|
+
bootstrap: ({ strapi }: {
|
|
6
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
7
|
+
}) => Promise<void>;
|
|
8
|
+
destroy: ({ strapi }: {
|
|
9
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
10
|
+
}) => void;
|
|
11
|
+
config: {
|
|
12
|
+
default: import('./types').BookingsPluginConfig;
|
|
13
|
+
validator(config: unknown): void;
|
|
14
|
+
};
|
|
15
|
+
controllers: {
|
|
16
|
+
admin: ({ strapi }: {
|
|
17
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
18
|
+
}) => {
|
|
19
|
+
getSettings(ctx: import('./controllers/admin').AdminContext): Promise<void>;
|
|
20
|
+
updateSettings(ctx: import('./controllers/admin').AdminContext): Promise<unknown>;
|
|
21
|
+
discoverSchemas(ctx: import('./controllers/admin').AdminContext): Promise<void>;
|
|
22
|
+
listResources(ctx: import('./controllers/admin').AdminContext): Promise<void>;
|
|
23
|
+
saveResource(ctx: import('./controllers/admin').AdminContext): Promise<unknown>;
|
|
24
|
+
getCalendar(ctx: import('./controllers/admin').AdminContext): Promise<void>;
|
|
25
|
+
createBooking(ctx: import('./controllers/admin').AdminContext): Promise<unknown>;
|
|
26
|
+
updateBookingStatus(ctx: import('./controllers/admin').AdminContext): Promise<unknown>;
|
|
27
|
+
rescheduleBooking(ctx: import('./controllers/admin').AdminContext): Promise<unknown>;
|
|
28
|
+
exportCsv(ctx: import('./controllers/admin').AdminContext): Promise<void>;
|
|
29
|
+
exportICal(ctx: import('./controllers/admin').AdminContext): Promise<void>;
|
|
30
|
+
};
|
|
31
|
+
"content-api": ({ strapi }: {
|
|
32
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
33
|
+
}) => {
|
|
34
|
+
listPublicResources(ctx: import('./controllers/content-api').ContentApiContext): Promise<void>;
|
|
35
|
+
getAvailableSlots(ctx: import('./controllers/content-api').ContentApiContext): Promise<unknown>;
|
|
36
|
+
createReservation(ctx: import('./controllers/content-api').ContentApiContext): Promise<unknown>;
|
|
37
|
+
rescheduleReservation(ctx: import('./controllers/content-api').ContentApiContext): Promise<unknown>;
|
|
38
|
+
cancelReservation(ctx: import('./controllers/content-api').ContentApiContext): Promise<unknown>;
|
|
39
|
+
getICalFeed(ctx: import('./controllers/content-api').ContentApiContext): Promise<unknown>;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
routes: {
|
|
43
|
+
admin: {
|
|
44
|
+
type: string;
|
|
45
|
+
routes: {
|
|
46
|
+
method: string;
|
|
47
|
+
path: string;
|
|
48
|
+
handler: string;
|
|
49
|
+
config: {
|
|
50
|
+
policies: (string | {
|
|
51
|
+
name: string;
|
|
52
|
+
config: {
|
|
53
|
+
actions: string[];
|
|
54
|
+
};
|
|
55
|
+
})[];
|
|
56
|
+
};
|
|
57
|
+
}[];
|
|
58
|
+
};
|
|
59
|
+
"content-api": {
|
|
60
|
+
type: string;
|
|
61
|
+
routes: {
|
|
62
|
+
method: string;
|
|
63
|
+
path: string;
|
|
64
|
+
handler: string;
|
|
65
|
+
config: {
|
|
66
|
+
policies: never[];
|
|
67
|
+
};
|
|
68
|
+
}[];
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
services: {
|
|
72
|
+
settings: ({ strapi }: {
|
|
73
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
74
|
+
}) => import('./types').SettingsService;
|
|
75
|
+
availability: ({ strapi }: {
|
|
76
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
77
|
+
}) => import('./types').AvailabilityService;
|
|
78
|
+
reservation: ({ strapi }: {
|
|
79
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
80
|
+
}) => import('./types').ReservationService;
|
|
81
|
+
};
|
|
82
|
+
contentTypes: {
|
|
83
|
+
resource: {
|
|
84
|
+
schema: {
|
|
85
|
+
kind: string;
|
|
86
|
+
collectionName: string;
|
|
87
|
+
info: {
|
|
88
|
+
singularName: string;
|
|
89
|
+
pluralName: string;
|
|
90
|
+
displayName: string;
|
|
91
|
+
description: string;
|
|
92
|
+
};
|
|
93
|
+
options: {
|
|
94
|
+
draftAndPublish: boolean;
|
|
95
|
+
};
|
|
96
|
+
pluginOptions: {
|
|
97
|
+
"content-manager": {
|
|
98
|
+
visible: boolean;
|
|
99
|
+
};
|
|
100
|
+
"content-type-builder": {
|
|
101
|
+
visible: boolean;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
attributes: {
|
|
105
|
+
name: {
|
|
106
|
+
type: string;
|
|
107
|
+
required: boolean;
|
|
108
|
+
maxLength: number;
|
|
109
|
+
};
|
|
110
|
+
slug: {
|
|
111
|
+
type: string;
|
|
112
|
+
targetField: string;
|
|
113
|
+
required: boolean;
|
|
114
|
+
};
|
|
115
|
+
resourceType: {
|
|
116
|
+
type: string;
|
|
117
|
+
enum: string[];
|
|
118
|
+
default: string;
|
|
119
|
+
required: boolean;
|
|
120
|
+
};
|
|
121
|
+
description: {
|
|
122
|
+
type: string;
|
|
123
|
+
};
|
|
124
|
+
color: {
|
|
125
|
+
type: string;
|
|
126
|
+
default: string;
|
|
127
|
+
maxLength: number;
|
|
128
|
+
};
|
|
129
|
+
timezone: {
|
|
130
|
+
type: string;
|
|
131
|
+
default: string;
|
|
132
|
+
maxLength: number;
|
|
133
|
+
};
|
|
134
|
+
slotDurationMinutes: {
|
|
135
|
+
type: string;
|
|
136
|
+
default: number;
|
|
137
|
+
min: number;
|
|
138
|
+
max: number;
|
|
139
|
+
required: boolean;
|
|
140
|
+
};
|
|
141
|
+
bufferBeforeMinutes: {
|
|
142
|
+
type: string;
|
|
143
|
+
default: number;
|
|
144
|
+
min: number;
|
|
145
|
+
max: number;
|
|
146
|
+
};
|
|
147
|
+
bufferAfterMinutes: {
|
|
148
|
+
type: string;
|
|
149
|
+
default: number;
|
|
150
|
+
min: number;
|
|
151
|
+
max: number;
|
|
152
|
+
};
|
|
153
|
+
capacityPerSlot: {
|
|
154
|
+
type: string;
|
|
155
|
+
default: number;
|
|
156
|
+
min: number;
|
|
157
|
+
required: boolean;
|
|
158
|
+
};
|
|
159
|
+
maxPartySize: {
|
|
160
|
+
type: string;
|
|
161
|
+
default: number;
|
|
162
|
+
min: number;
|
|
163
|
+
};
|
|
164
|
+
minLeadTimeHours: {
|
|
165
|
+
type: string;
|
|
166
|
+
default: number;
|
|
167
|
+
min: number;
|
|
168
|
+
};
|
|
169
|
+
maxAdvanceDays: {
|
|
170
|
+
type: string;
|
|
171
|
+
default: number;
|
|
172
|
+
min: number;
|
|
173
|
+
};
|
|
174
|
+
requiresApproval: {
|
|
175
|
+
type: string;
|
|
176
|
+
default: boolean;
|
|
177
|
+
};
|
|
178
|
+
weeklySchedule: {
|
|
179
|
+
type: string;
|
|
180
|
+
};
|
|
181
|
+
seasonalSchedules: {
|
|
182
|
+
type: string;
|
|
183
|
+
};
|
|
184
|
+
holidayRules: {
|
|
185
|
+
type: string;
|
|
186
|
+
};
|
|
187
|
+
blackoutDates: {
|
|
188
|
+
type: string;
|
|
189
|
+
};
|
|
190
|
+
recurrenceRule: {
|
|
191
|
+
type: string;
|
|
192
|
+
};
|
|
193
|
+
supportedLanguages: {
|
|
194
|
+
type: string;
|
|
195
|
+
};
|
|
196
|
+
assignedHosts: {
|
|
197
|
+
type: string;
|
|
198
|
+
};
|
|
199
|
+
location: {
|
|
200
|
+
type: string;
|
|
201
|
+
maxLength: number;
|
|
202
|
+
};
|
|
203
|
+
price: {
|
|
204
|
+
type: string;
|
|
205
|
+
default: number;
|
|
206
|
+
min: number;
|
|
207
|
+
};
|
|
208
|
+
currency: {
|
|
209
|
+
type: string;
|
|
210
|
+
default: string;
|
|
211
|
+
maxLength: number;
|
|
212
|
+
};
|
|
213
|
+
isActive: {
|
|
214
|
+
type: string;
|
|
215
|
+
default: boolean;
|
|
216
|
+
};
|
|
217
|
+
metadata: {
|
|
218
|
+
type: string;
|
|
219
|
+
};
|
|
220
|
+
bookings: {
|
|
221
|
+
type: string;
|
|
222
|
+
relation: string;
|
|
223
|
+
target: string;
|
|
224
|
+
mappedBy: string;
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
booking: {
|
|
230
|
+
schema: {
|
|
231
|
+
kind: string;
|
|
232
|
+
collectionName: string;
|
|
233
|
+
info: {
|
|
234
|
+
singularName: string;
|
|
235
|
+
pluralName: string;
|
|
236
|
+
displayName: string;
|
|
237
|
+
description: string;
|
|
238
|
+
};
|
|
239
|
+
options: {
|
|
240
|
+
draftAndPublish: boolean;
|
|
241
|
+
};
|
|
242
|
+
pluginOptions: {
|
|
243
|
+
"content-manager": {
|
|
244
|
+
visible: boolean;
|
|
245
|
+
};
|
|
246
|
+
"content-type-builder": {
|
|
247
|
+
visible: boolean;
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
attributes: {
|
|
251
|
+
bookingCode: {
|
|
252
|
+
type: string;
|
|
253
|
+
required: boolean;
|
|
254
|
+
unique: boolean;
|
|
255
|
+
maxLength: number;
|
|
256
|
+
};
|
|
257
|
+
title: {
|
|
258
|
+
type: string;
|
|
259
|
+
maxLength: number;
|
|
260
|
+
};
|
|
261
|
+
resource: {
|
|
262
|
+
type: string;
|
|
263
|
+
relation: string;
|
|
264
|
+
target: string;
|
|
265
|
+
inversedBy: string;
|
|
266
|
+
};
|
|
267
|
+
customerName: {
|
|
268
|
+
type: string;
|
|
269
|
+
required: boolean;
|
|
270
|
+
maxLength: number;
|
|
271
|
+
};
|
|
272
|
+
customerEmail: {
|
|
273
|
+
type: string;
|
|
274
|
+
required: boolean;
|
|
275
|
+
};
|
|
276
|
+
customerPhone: {
|
|
277
|
+
type: string;
|
|
278
|
+
maxLength: number;
|
|
279
|
+
};
|
|
280
|
+
organization: {
|
|
281
|
+
type: string;
|
|
282
|
+
maxLength: number;
|
|
283
|
+
};
|
|
284
|
+
startDate: {
|
|
285
|
+
type: string;
|
|
286
|
+
required: boolean;
|
|
287
|
+
};
|
|
288
|
+
endDate: {
|
|
289
|
+
type: string;
|
|
290
|
+
required: boolean;
|
|
291
|
+
};
|
|
292
|
+
slotLabel: {
|
|
293
|
+
type: string;
|
|
294
|
+
maxLength: number;
|
|
295
|
+
};
|
|
296
|
+
timezone: {
|
|
297
|
+
type: string;
|
|
298
|
+
default: string;
|
|
299
|
+
maxLength: number;
|
|
300
|
+
};
|
|
301
|
+
partySize: {
|
|
302
|
+
type: string;
|
|
303
|
+
required: boolean;
|
|
304
|
+
default: number;
|
|
305
|
+
min: number;
|
|
306
|
+
};
|
|
307
|
+
status: {
|
|
308
|
+
type: string;
|
|
309
|
+
enum: string[];
|
|
310
|
+
default: string;
|
|
311
|
+
required: boolean;
|
|
312
|
+
};
|
|
313
|
+
preferredLanguage: {
|
|
314
|
+
type: string;
|
|
315
|
+
maxLength: number;
|
|
316
|
+
};
|
|
317
|
+
assignedHost: {
|
|
318
|
+
type: string;
|
|
319
|
+
maxLength: number;
|
|
320
|
+
};
|
|
321
|
+
notes: {
|
|
322
|
+
type: string;
|
|
323
|
+
maxLength: number;
|
|
324
|
+
};
|
|
325
|
+
internalNotes: {
|
|
326
|
+
type: string;
|
|
327
|
+
maxLength: number;
|
|
328
|
+
private: boolean;
|
|
329
|
+
};
|
|
330
|
+
cancelTokenHash: {
|
|
331
|
+
type: string;
|
|
332
|
+
maxLength: number;
|
|
333
|
+
private: boolean;
|
|
334
|
+
};
|
|
335
|
+
sourceCollection: {
|
|
336
|
+
type: string;
|
|
337
|
+
default: string;
|
|
338
|
+
};
|
|
339
|
+
metadata: {
|
|
340
|
+
type: string;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
admin: {
|
|
3
|
+
type: string;
|
|
4
|
+
routes: {
|
|
5
|
+
method: string;
|
|
6
|
+
path: string;
|
|
7
|
+
handler: string;
|
|
8
|
+
config: {
|
|
9
|
+
policies: (string | {
|
|
10
|
+
name: string;
|
|
11
|
+
config: {
|
|
12
|
+
actions: string[];
|
|
13
|
+
};
|
|
14
|
+
})[];
|
|
15
|
+
};
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
"content-api": {
|
|
19
|
+
type: string;
|
|
20
|
+
routes: {
|
|
21
|
+
method: string;
|
|
22
|
+
path: string;
|
|
23
|
+
handler: string;
|
|
24
|
+
config: {
|
|
25
|
+
policies: never[];
|
|
26
|
+
};
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Core } from '@strapi/strapi';
|
|
2
|
+
import { BookingResource } from '../../../shared/types';
|
|
3
|
+
import { AvailabilityService } from '../types';
|
|
4
|
+
export declare function normalizeResourceRecord(raw: Record<string, unknown>): BookingResource;
|
|
5
|
+
declare const _default: ({ strapi }: {
|
|
6
|
+
strapi: Core.Strapi;
|
|
7
|
+
}) => AvailabilityService;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
settings: ({ strapi }: {
|
|
3
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
4
|
+
}) => import('../types').SettingsService;
|
|
5
|
+
availability: ({ strapi }: {
|
|
6
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
7
|
+
}) => import('../types').AvailabilityService;
|
|
8
|
+
reservation: ({ strapi }: {
|
|
9
|
+
strapi: import("@strapi/strapi").Core.Strapi;
|
|
10
|
+
}) => import('../types').ReservationService;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BookingRecord, BookingResource, BookingStatus, BookingsPluginSettings, CreateReservationInput, RescheduleBookingInput } from '../../../shared/types';
|
|
2
|
+
import { filterAndSortBookings, mapExternalSourceRowToBooking, parseBoundaryMs } from './reservationSources';
|
|
3
|
+
export { filterAndSortBookings, mapExternalSourceRowToBooking, parseBoundaryMs, };
|
|
4
|
+
export declare const VALID_BOOKING_STATUSES: Set<BookingStatus>;
|
|
5
|
+
export declare function isValidBookingStatus(raw: unknown): raw is BookingStatus;
|
|
6
|
+
export declare function parseStrictBookingStatus(raw: unknown): BookingStatus;
|
|
7
|
+
export declare function normalizeStatus(raw: unknown): BookingStatus;
|
|
8
|
+
export declare function hashCancelToken(token: string): string;
|
|
9
|
+
export declare function verifyCancelToken(token: string | undefined, expectedHash: string | undefined): boolean;
|
|
10
|
+
export declare function verifySecretToken(provided: string | undefined, expected: string | undefined): boolean;
|
|
11
|
+
export declare function computeOpaqueBookingUid(booking: BookingRecord): string;
|
|
12
|
+
export declare function generateRawCancelToken(): string;
|
|
13
|
+
export declare function generateBookingCode(now?: Date): string;
|
|
14
|
+
export declare function formatBookingDefaultTitle(customerName: string, resourceName: string | undefined, partySize: number): string;
|
|
15
|
+
export declare function normalizeBookingRecord(raw: Record<string, unknown>, resourceMap: Map<string, BookingResource>): BookingRecord;
|
|
16
|
+
export declare function trimOrUndefined(val: unknown): string | undefined;
|
|
17
|
+
export declare function buildBookingCreatePayload(params: {
|
|
18
|
+
bookingCode: string;
|
|
19
|
+
customerName: string;
|
|
20
|
+
customerEmail: string;
|
|
21
|
+
startMs: number;
|
|
22
|
+
endMs: number;
|
|
23
|
+
partySize: number;
|
|
24
|
+
status: BookingStatus;
|
|
25
|
+
assignedHost: string | undefined;
|
|
26
|
+
cancelTokenHash: string;
|
|
27
|
+
resource: BookingResource | null;
|
|
28
|
+
settings: BookingsPluginSettings;
|
|
29
|
+
input: CreateReservationInput;
|
|
30
|
+
}): Record<string, unknown>;
|
|
31
|
+
export declare function buildCapacityWindowQuery(resourceDocumentId: string | undefined, startMs: number, endMs: number): {
|
|
32
|
+
resourceDocumentId: string | undefined;
|
|
33
|
+
from: string;
|
|
34
|
+
to: string;
|
|
35
|
+
activeOnly: boolean;
|
|
36
|
+
limit: number;
|
|
37
|
+
};
|
|
38
|
+
export declare function computeRescheduleWindow(targetRaw: Record<string, unknown>, input: RescheduleBookingInput): {
|
|
39
|
+
newStartMs: number;
|
|
40
|
+
newEndMs: number;
|
|
41
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BookingRecord, BookingResource, BookingsPluginSettings } from '../../../shared/types';
|
|
2
|
+
export interface VerifyCapacityAndHostParams {
|
|
3
|
+
existing: BookingRecord[];
|
|
4
|
+
startMs: number;
|
|
5
|
+
endMs: number;
|
|
6
|
+
partySize: number;
|
|
7
|
+
resource: BookingResource | null;
|
|
8
|
+
settings: BookingsPluginSettings;
|
|
9
|
+
preferredLanguage?: string;
|
|
10
|
+
explicitHostRaw?: string;
|
|
11
|
+
isAdmin?: boolean;
|
|
12
|
+
hostResolutionMode?: "strict" | "reschedule";
|
|
13
|
+
windowCapacityOverride?: number;
|
|
14
|
+
excludeDocumentId?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function verifySlotCapacityAndResolveHost(params: VerifyCapacityAndHostParams): string | undefined;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Core } from '@strapi/strapi';
|
|
2
|
+
import { BookingRecord, BookingStatus, CancelBookingInput, RescheduleBookingInput } from '../../../shared/types';
|
|
3
|
+
import { ReservationService } from '../types';
|
|
4
|
+
export declare function resolveBookingLockKey(resourceDocumentId: string | undefined): string;
|
|
5
|
+
export declare function findRawBookingOrThrow(strapi: Core.Strapi, key: string | undefined): Promise<Record<string, unknown>>;
|
|
6
|
+
export declare function executeUpdateBookingStatus(params: {
|
|
7
|
+
strapi: Core.Strapi;
|
|
8
|
+
reservationService: ReservationService;
|
|
9
|
+
documentId: string;
|
|
10
|
+
status: BookingStatus;
|
|
11
|
+
options?: {
|
|
12
|
+
assignedHost?: string;
|
|
13
|
+
internalNotes?: string;
|
|
14
|
+
};
|
|
15
|
+
}): Promise<BookingRecord>;
|
|
16
|
+
export declare function executeRescheduleBooking(params: {
|
|
17
|
+
strapi: Core.Strapi;
|
|
18
|
+
reservationService: ReservationService;
|
|
19
|
+
input: RescheduleBookingInput;
|
|
20
|
+
options?: {
|
|
21
|
+
isAdmin?: boolean;
|
|
22
|
+
referenceNow?: Date;
|
|
23
|
+
};
|
|
24
|
+
}): Promise<BookingRecord>;
|
|
25
|
+
export declare function executeCancelBooking(params: {
|
|
26
|
+
strapi: Core.Strapi;
|
|
27
|
+
input: CancelBookingInput;
|
|
28
|
+
options?: {
|
|
29
|
+
isAdmin?: boolean;
|
|
30
|
+
referenceNow?: Date;
|
|
31
|
+
};
|
|
32
|
+
}): Promise<BookingRecord>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BookingFilterQuery, BookingRecord, BookingResource, BookingSourceMapping } from '../../../shared/types';
|
|
2
|
+
export declare function mapExternalSourceRowToBooking(row: Record<string, unknown>, source: BookingSourceMapping): BookingRecord | null;
|
|
3
|
+
export declare function parseBoundaryMs(isoOrDate: string | undefined, endOfDay: boolean): number | null;
|
|
4
|
+
export declare function filterAndSortBookings(allBookings: BookingRecord[], resources: BookingResource[], query: BookingFilterQuery): BookingRecord[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BookingResource, BookingsPluginSettings, CreateReservationInput } from '../../../shared/types';
|
|
2
|
+
import { verifySlotCapacityAndResolveHost, VerifyCapacityAndHostParams } from './reservationHostCapacity';
|
|
3
|
+
export { verifySlotCapacityAndResolveHost, type VerifyCapacityAndHostParams };
|
|
4
|
+
export declare function parseStrictPartySize(val: unknown, defaultValue?: number): number;
|
|
5
|
+
export declare function resolveEffectiveMaxPartySize(resource: BookingResource | null | undefined, settings: BookingsPluginSettings): number;
|
|
6
|
+
export declare function validateReservationCustomerAndStart(input: CreateReservationInput): {
|
|
7
|
+
customerName: string;
|
|
8
|
+
customerEmail: string;
|
|
9
|
+
startMs: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function computeReservationTimingAndParty(input: CreateReservationInput, startMs: number, resource: BookingResource | null, settings: BookingsPluginSettings): {
|
|
12
|
+
endMs: number;
|
|
13
|
+
partySize: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Enforces blackouts, lead time, advance horizon, open daily schedule windows,
|
|
17
|
+
* holiday closures, exact interval slot-boundary alignment, and max duration.
|
|
18
|
+
*/
|
|
19
|
+
export declare function validateBookingOperatingWindow(params: {
|
|
20
|
+
resource: BookingResource | null | undefined;
|
|
21
|
+
settings: BookingsPluginSettings;
|
|
22
|
+
startMs: number;
|
|
23
|
+
endMs: number;
|
|
24
|
+
isAdmin?: boolean;
|
|
25
|
+
skipLeadTimeCheck?: boolean;
|
|
26
|
+
referenceNow?: Date;
|
|
27
|
+
}): number | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Core } from '@strapi/strapi';
|
|
2
|
+
import { SettingsService } from '../types';
|
|
3
|
+
export declare function clearRuntimeSettingsState(strapi: Core.Strapi): void;
|
|
4
|
+
export declare function isDiscoverableCollectionUid(uid: unknown, kind?: string): uid is string;
|
|
5
|
+
declare const _default: ({ strapi }: {
|
|
6
|
+
strapi: Core.Strapi;
|
|
7
|
+
}) => SettingsService;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ExpandedCalendarOccurrence as CalendarOccurrence } from '../../../../strapi-plugin-calendar/shared/index.ts';
|
|
2
|
+
import { CalendarSystemFormatterFn as CalendarSystemFormatter } from '../../shared/calendarSystems';
|
|
3
|
+
import { AvailableSlot, BookingFilterQuery, BookingRecord, BookingResource, BookingsPluginSettings, BookingSourceMapping, BookingStats, BookingStatus, CancelBookingInput, CreateReservationInput, CreateReservationResult, HolidayScheduleRule, RescheduleBookingInput, SeasonalScheduleOverride, SecondaryCalendarConfig } from '../../shared/types';
|
|
4
|
+
export interface CustomFieldRegistration {
|
|
5
|
+
name: string;
|
|
6
|
+
type: "string" | "text" | "richtext" | "integer" | "biginteger" | "float" | "decimal" | "date" | "time" | "datetime" | "boolean" | "enumeration" | "json" | "email" | "password" | "uid";
|
|
7
|
+
}
|
|
8
|
+
export interface BookingsPluginConfig {
|
|
9
|
+
defaultTimezone?: string;
|
|
10
|
+
defaultLocale?: string;
|
|
11
|
+
theme?: "breeze" | "emerald" | "sand" | "midnight" | "classic";
|
|
12
|
+
secondaryCalendarLanguage?: "local" | "ar" | "off";
|
|
13
|
+
defaultSlotDurationMinutes?: number;
|
|
14
|
+
defaultBufferBeforeMinutes?: number;
|
|
15
|
+
defaultBufferAfterMinutes?: number;
|
|
16
|
+
defaultCapacityPerSlot?: number;
|
|
17
|
+
defaultMinLeadTimeHours?: number;
|
|
18
|
+
defaultMaxAdvanceDays?: number;
|
|
19
|
+
defaultRequiresApproval?: boolean;
|
|
20
|
+
sendEmailNotifications?: boolean;
|
|
21
|
+
icalFeedToken?: string;
|
|
22
|
+
secondaryCalendars?: SecondaryCalendarConfig[];
|
|
23
|
+
defaultSeasonalSchedules?: SeasonalScheduleOverride[];
|
|
24
|
+
holidays?: HolidayScheduleRule[];
|
|
25
|
+
sources?: BookingSourceMapping[];
|
|
26
|
+
calendarSystems?: Record<string, CalendarSystemFormatter>;
|
|
27
|
+
schemaExtensions?: {
|
|
28
|
+
resource?: Record<string, Record<string, unknown>>;
|
|
29
|
+
booking?: Record<string, Record<string, unknown>>;
|
|
30
|
+
};
|
|
31
|
+
customFields?: CustomFieldRegistration[];
|
|
32
|
+
}
|
|
33
|
+
export interface DiscoveredCollectionField {
|
|
34
|
+
name: string;
|
|
35
|
+
type: string;
|
|
36
|
+
}
|
|
37
|
+
export interface DiscoveredCollectionSchema {
|
|
38
|
+
uid: string;
|
|
39
|
+
displayName: string;
|
|
40
|
+
singularName: string;
|
|
41
|
+
pluralName: string;
|
|
42
|
+
dateFields: string[];
|
|
43
|
+
stringFields: string[];
|
|
44
|
+
numberFields: string[];
|
|
45
|
+
enumFields: string[];
|
|
46
|
+
fields: DiscoveredCollectionField[];
|
|
47
|
+
}
|
|
48
|
+
export interface SettingsService {
|
|
49
|
+
getSettings(): Promise<BookingsPluginSettings>;
|
|
50
|
+
updateSettings(partial: Partial<BookingsPluginSettings>): Promise<BookingsPluginSettings>;
|
|
51
|
+
discoverSchemas(): Promise<DiscoveredCollectionSchema[]>;
|
|
52
|
+
registerSource(source: BookingSourceMapping): void;
|
|
53
|
+
}
|
|
54
|
+
export interface AvailabilityService {
|
|
55
|
+
listResources(activeOnly?: boolean, limit?: number): Promise<BookingResource[]>;
|
|
56
|
+
getResource(idOrSlug: string): Promise<BookingResource | null>;
|
|
57
|
+
saveResource(payload: Partial<BookingResource> & {
|
|
58
|
+
name: string;
|
|
59
|
+
}): Promise<BookingResource>;
|
|
60
|
+
getAvailableSlots(params: {
|
|
61
|
+
resourceDocumentId?: string;
|
|
62
|
+
resourceSlug?: string;
|
|
63
|
+
from: string;
|
|
64
|
+
to: string;
|
|
65
|
+
partySize?: number;
|
|
66
|
+
preferredLanguage?: string;
|
|
67
|
+
referenceNow?: Date;
|
|
68
|
+
}): Promise<AvailableSlot[]>;
|
|
69
|
+
getCalendarOccurrences(query: BookingFilterQuery): Promise<{
|
|
70
|
+
occurrences: CalendarOccurrence[];
|
|
71
|
+
bookings: BookingRecord[];
|
|
72
|
+
stats: BookingStats;
|
|
73
|
+
}>;
|
|
74
|
+
}
|
|
75
|
+
export interface ReservationService {
|
|
76
|
+
listBookings(query?: BookingFilterQuery): Promise<BookingRecord[]>;
|
|
77
|
+
getBooking(documentIdOrCode: string): Promise<BookingRecord | null>;
|
|
78
|
+
createReservation(input: CreateReservationInput, options?: {
|
|
79
|
+
isAdmin?: boolean;
|
|
80
|
+
skipLeadTimeCheck?: boolean;
|
|
81
|
+
referenceNow?: Date;
|
|
82
|
+
}): Promise<CreateReservationResult>;
|
|
83
|
+
updateBookingStatus(documentId: string, status: BookingStatus, options?: {
|
|
84
|
+
assignedHost?: string;
|
|
85
|
+
internalNotes?: string;
|
|
86
|
+
}): Promise<BookingRecord>;
|
|
87
|
+
rescheduleBooking(input: RescheduleBookingInput, options?: {
|
|
88
|
+
isAdmin?: boolean;
|
|
89
|
+
referenceNow?: Date;
|
|
90
|
+
}): Promise<BookingRecord>;
|
|
91
|
+
cancelBooking(input: CancelBookingInput, options?: {
|
|
92
|
+
isAdmin?: boolean;
|
|
93
|
+
referenceNow?: Date;
|
|
94
|
+
}): Promise<BookingRecord>;
|
|
95
|
+
exportCsv(query?: BookingFilterQuery): Promise<string>;
|
|
96
|
+
exportICal(query?: BookingFilterQuery, options?: {
|
|
97
|
+
anonymize?: boolean;
|
|
98
|
+
}): Promise<string>;
|
|
99
|
+
}
|