recal-sdk 0.2.7 → 0.2.9
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 +27 -7
- package/dist/services/scheduling.service.d.ts +7 -4
- package/dist/services/scheduling.service.d.ts.map +1 -1
- package/dist/services/scheduling.service.js +10 -7
- package/dist/services/scheduling.service.js.map +1 -1
- package/dist/typebox/scheduling.tb.d.ts +9 -17
- package/dist/typebox/scheduling.tb.d.ts.map +1 -1
- package/dist/typebox/scheduling.tb.js +11 -35
- package/dist/typebox/scheduling.tb.js.map +1 -1
- package/dist/types/scheduling.types.d.ts +10 -22
- package/dist/types/scheduling.types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -273,7 +273,7 @@ await recal.calendar.deleteEventByMetaId(
|
|
|
273
273
|
|
|
274
274
|
```typescript
|
|
275
275
|
// Find available time slots (minimal config)
|
|
276
|
-
const availability = await recal.scheduling.
|
|
276
|
+
const availability = await recal.scheduling.user(
|
|
277
277
|
'user_id',
|
|
278
278
|
new Date('2024-01-15'),
|
|
279
279
|
new Date('2024-01-20'),
|
|
@@ -283,7 +283,7 @@ const availability = await recal.scheduling.userSchedulingBasic(
|
|
|
283
283
|
)
|
|
284
284
|
|
|
285
285
|
// Or with more options
|
|
286
|
-
const availabilityDetailed = await recal.scheduling.
|
|
286
|
+
const availabilityDetailed = await recal.scheduling.user(
|
|
287
287
|
'user_id',
|
|
288
288
|
new Date('2024-01-15'),
|
|
289
289
|
new Date('2024-01-20'),
|
|
@@ -298,6 +298,26 @@ const availabilityDetailed = await recal.scheduling.userSchedulingBasic(
|
|
|
298
298
|
)
|
|
299
299
|
```
|
|
300
300
|
|
|
301
|
+
#### Allow Overlapping Events
|
|
302
|
+
|
|
303
|
+
```typescript
|
|
304
|
+
// Find availability even when user already has events scheduled
|
|
305
|
+
const availabilityWithOverlaps = await recal.scheduling.user(
|
|
306
|
+
'user_id',
|
|
307
|
+
new Date('2024-01-15'),
|
|
308
|
+
new Date('2024-01-20'),
|
|
309
|
+
{
|
|
310
|
+
slotDuration: 30,
|
|
311
|
+
maxOverlaps: 2, // Allow up to 2 overlapping events per slot
|
|
312
|
+
timeZone: 'America/New_York'
|
|
313
|
+
}
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
// maxOverlaps: 2, means 1 slot is still available even if the user has 2 existing events at the same time.
|
|
317
|
+
// This enables booking a n concurrent events - useful for optional meetings,
|
|
318
|
+
// tentative invites, or users who can handle multiple events simultaneous, like a team that has just one calendar.
|
|
319
|
+
```
|
|
320
|
+
|
|
301
321
|
#### Get User Availability (Advanced)
|
|
302
322
|
|
|
303
323
|
```typescript
|
|
@@ -312,7 +332,7 @@ const schedules = [
|
|
|
312
332
|
]
|
|
313
333
|
|
|
314
334
|
// Minimal config
|
|
315
|
-
const availability = await recal.scheduling.
|
|
335
|
+
const availability = await recal.scheduling.userAdvanced(
|
|
316
336
|
'user_id',
|
|
317
337
|
schedules,
|
|
318
338
|
new Date('2024-01-15'),
|
|
@@ -321,7 +341,7 @@ const availability = await recal.scheduling.userSchedulingAdvanced(
|
|
|
321
341
|
)
|
|
322
342
|
|
|
323
343
|
// Or with more options
|
|
324
|
-
const availabilityDetailed = await recal.scheduling.
|
|
344
|
+
const availabilityDetailed = await recal.scheduling.userAdvanced(
|
|
325
345
|
'user_id',
|
|
326
346
|
schedules,
|
|
327
347
|
new Date('2024-01-15'),
|
|
@@ -339,7 +359,7 @@ const availabilityDetailed = await recal.scheduling.userSchedulingAdvanced(
|
|
|
339
359
|
|
|
340
360
|
```typescript
|
|
341
361
|
// Find organization-wide available time slots (minimal)
|
|
342
|
-
const orgAvailability = await recal.scheduling.
|
|
362
|
+
const orgAvailability = await recal.scheduling.organization(
|
|
343
363
|
'org-slug',
|
|
344
364
|
new Date('2024-01-15'),
|
|
345
365
|
new Date('2024-01-20'),
|
|
@@ -347,7 +367,7 @@ const orgAvailability = await recal.scheduling.getOrgWideAvailability(
|
|
|
347
367
|
)
|
|
348
368
|
|
|
349
369
|
// Or with constraints
|
|
350
|
-
const orgAvailabilityConstrained = await recal.scheduling.
|
|
370
|
+
const orgAvailabilityConstrained = await recal.scheduling.organization(
|
|
351
371
|
'org-slug',
|
|
352
372
|
new Date('2024-01-15'),
|
|
353
373
|
new Date('2024-01-20'),
|
|
@@ -678,7 +698,7 @@ const recal = new RecalClient({
|
|
|
678
698
|
|
|
679
699
|
```typescript
|
|
680
700
|
// 1. Check availability
|
|
681
|
-
const availability = await recal.scheduling.
|
|
701
|
+
const availability = await recal.scheduling.user(
|
|
682
702
|
'consultant_id',
|
|
683
703
|
new Date(),
|
|
684
704
|
new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // Next 7 days
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OrgSchedulingOptions, OrgSchedulingResponse, Schedule, UserAdvancedSchedulingResponse, UserSchedulingAdvancedOptions, UserSchedulingBasicOptions, UserSchedulingResponse } from '../types/scheduling.types.js';
|
|
2
2
|
import { type FetchHelper } from '../utils/fetch.helper.js';
|
|
3
3
|
export declare class SchedulingService {
|
|
4
4
|
private fetchHelper;
|
|
@@ -15,9 +15,10 @@ export declare class SchedulingService {
|
|
|
15
15
|
* - earliestTimeEachDay: Earliest time each day (HH:mm format) (optional)
|
|
16
16
|
* - latestTimeEachDay: Latest time each day (HH:mm format) (optional)
|
|
17
17
|
* - timeZone: Time zone for the request (optional)
|
|
18
|
+
* - maxOverlaps: Maximum number of overlaps allowed (optional)
|
|
18
19
|
* @returns Available time slots with basic scheduling options
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
+
user(userId: string, startDate: Date, endDate: Date, options: UserSchedulingBasicOptions): Promise<UserSchedulingResponse>;
|
|
21
22
|
/**
|
|
22
23
|
* Get available time slots based on busy data with advanced parameters
|
|
23
24
|
* @param userId The ID of the user
|
|
@@ -29,9 +30,10 @@ export declare class SchedulingService {
|
|
|
29
30
|
* - padding: Minutes of padding between slots (optional)
|
|
30
31
|
* - slotDuration: Duration of each slot in minutes (optional)
|
|
31
32
|
* - timeZone: Time zone for the request (optional)
|
|
33
|
+
* - maxOverlaps: Maximum number of overlaps allowed (optional)
|
|
32
34
|
* @returns Available time slots with advanced scheduling options
|
|
33
35
|
*/
|
|
34
|
-
|
|
36
|
+
userAdvanced(userId: string, schedules: Schedule[], startDate: Date, endDate: Date, options: UserSchedulingAdvancedOptions): Promise<UserAdvancedSchedulingResponse>;
|
|
35
37
|
/**
|
|
36
38
|
* Get available time slots based on busy data for an organization
|
|
37
39
|
* @param orgSlug The slug of the organization
|
|
@@ -44,8 +46,9 @@ export declare class SchedulingService {
|
|
|
44
46
|
* - earliestTimeEachDay: Earliest time each day (HH:mm format) (optional)
|
|
45
47
|
* - latestTimeEachDay: Latest time each day (HH:mm format) (optional)
|
|
46
48
|
* - timeZone: Time zone for the request (optional)
|
|
49
|
+
* - maxOverlaps: Maximum number of overlaps allowed (optional)
|
|
47
50
|
* @returns Available time slots for the organization
|
|
48
51
|
*/
|
|
49
|
-
|
|
52
|
+
organization(orgSlug: string, startDate: Date, endDate: Date, options: OrgSchedulingOptions): Promise<OrgSchedulingResponse>;
|
|
50
53
|
}
|
|
51
54
|
//# sourceMappingURL=scheduling.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduling.service.d.ts","sourceRoot":"","sources":["../../src/services/scheduling.service.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACR,
|
|
1
|
+
{"version":3,"file":"scheduling.service.d.ts","sourceRoot":"","sources":["../../src/services/scheduling.service.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACR,oBAAoB,EACpB,qBAAqB,EACrB,QAAQ,EACR,8BAA8B,EAC9B,6BAA6B,EAC7B,0BAA0B,EAC1B,sBAAsB,EACzB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAGxE,qBAAa,iBAAiB;IACd,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAE5C;;;;;;;;;;;;;;OAcG;IACU,IAAI,CACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,0BAA0B,GACpC,OAAO,CAAC,sBAAsB,CAAC;IA0BlC;;;;;;;;;;;;;OAaG;IACU,YAAY,CACrB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EAAE,EACrB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,6BAA6B,GACvC,OAAO,CAAC,8BAA8B,CAAC;IA2B1C;;;;;;;;;;;;;;OAcG;IACU,YAAY,CACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,oBAAoB,GAC9B,OAAO,CAAC,qBAAqB,CAAC;CAkCpC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OAuthConnectionNotFoundError, OrganizationNotFoundError, UserNotFoundError } from '../errors.js';
|
|
2
|
-
import {
|
|
2
|
+
import { orgSchedulingResponseSchema, userAdvancedSchedulingResponseSchema, userSchedulingResponseSchema, } from '../typebox/scheduling.tb.js';
|
|
3
3
|
import { errorHandler } from '../utils/fetch.helper.js';
|
|
4
4
|
import { omit } from '../utils/omit.js';
|
|
5
5
|
export class SchedulingService {
|
|
@@ -19,12 +19,13 @@ export class SchedulingService {
|
|
|
19
19
|
* - earliestTimeEachDay: Earliest time each day (HH:mm format) (optional)
|
|
20
20
|
* - latestTimeEachDay: Latest time each day (HH:mm format) (optional)
|
|
21
21
|
* - timeZone: Time zone for the request (optional)
|
|
22
|
+
* - maxOverlaps: Maximum number of overlaps allowed (optional)
|
|
22
23
|
* @returns Available time slots with basic scheduling options
|
|
23
24
|
*/
|
|
24
|
-
async
|
|
25
|
+
async user(userId, startDate, endDate, options) {
|
|
25
26
|
return this.fetchHelper
|
|
26
27
|
.get(`/v1/users/${userId}/scheduling`, {
|
|
27
|
-
schema:
|
|
28
|
+
schema: userSchedulingResponseSchema,
|
|
28
29
|
searchParams: {
|
|
29
30
|
...omit(options, ['timeZone']),
|
|
30
31
|
startDate,
|
|
@@ -52,12 +53,13 @@ export class SchedulingService {
|
|
|
52
53
|
* - padding: Minutes of padding between slots (optional)
|
|
53
54
|
* - slotDuration: Duration of each slot in minutes (optional)
|
|
54
55
|
* - timeZone: Time zone for the request (optional)
|
|
56
|
+
* - maxOverlaps: Maximum number of overlaps allowed (optional)
|
|
55
57
|
* @returns Available time slots with advanced scheduling options
|
|
56
58
|
*/
|
|
57
|
-
async
|
|
59
|
+
async userAdvanced(userId, schedules, startDate, endDate, options) {
|
|
58
60
|
return this.fetchHelper
|
|
59
61
|
.post(`/v1/users/${userId}/scheduling`, {
|
|
60
|
-
schema:
|
|
62
|
+
schema: userAdvancedSchedulingResponseSchema,
|
|
61
63
|
searchParams: {
|
|
62
64
|
...omit(options, ['timeZone']),
|
|
63
65
|
startDate,
|
|
@@ -87,12 +89,13 @@ export class SchedulingService {
|
|
|
87
89
|
* - earliestTimeEachDay: Earliest time each day (HH:mm format) (optional)
|
|
88
90
|
* - latestTimeEachDay: Latest time each day (HH:mm format) (optional)
|
|
89
91
|
* - timeZone: Time zone for the request (optional)
|
|
92
|
+
* - maxOverlaps: Maximum number of overlaps allowed (optional)
|
|
90
93
|
* @returns Available time slots for the organization
|
|
91
94
|
*/
|
|
92
|
-
async
|
|
95
|
+
async organization(orgSlug, startDate, endDate, options) {
|
|
93
96
|
return this.fetchHelper
|
|
94
97
|
.get(`/v1/organizations/${orgSlug}/scheduling`, {
|
|
95
|
-
schema:
|
|
98
|
+
schema: orgSchedulingResponseSchema,
|
|
96
99
|
searchParams: {
|
|
97
100
|
...omit(options, ['timeZone']),
|
|
98
101
|
startDate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduling.service.js","sourceRoot":"","sources":["../../src/services/scheduling.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACxG,OAAO,EACH,
|
|
1
|
+
{"version":3,"file":"scheduling.service.js","sourceRoot":"","sources":["../../src/services/scheduling.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACxG,OAAO,EACH,2BAA2B,EAC3B,oCAAoC,EACpC,4BAA4B,GAC/B,MAAM,4BAA4B,CAAA;AAUnC,OAAO,EAAE,YAAY,EAAoB,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,MAAM,OAAO,iBAAiB;IACN;IAApB,YAAoB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAEhD;;;;;;;;;;;;;;OAcG;IACI,KAAK,CAAC,IAAI,CACb,MAAc,EACd,SAAe,EACf,OAAa,EACb,OAAmC;QAEnC,OAAO,IAAI,CAAC,WAAW;aAClB,GAAG,CAAC,aAAa,MAAM,aAAa,EAAE;YACnC,MAAM,EAAE,4BAA4B;YACpC,YAAY,EAAE;gBACV,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC;gBAC9B,SAAS;gBACT,OAAO;aACV;YACD,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;SAC7E,CAAC;aACD,KAAK,CACF,YAAY,CAAC;YACT;gBACI,IAAI,EAAE,GAAG;gBACT,KAAK,EAAE,IAAI,4BAA4B,CACnC,MAAM,EACN,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC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EACf,OAAa,EACb,OAA6B;QAE7B,OAAO,IAAI,CAAC,WAAW;aAClB,GAAG,CAAC,qBAAqB,OAAO,aAAa,EAAE;YAC5C,MAAM,EAAE,2BAA2B;YACnC,YAAY,EAAE;gBACV,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC;gBAC9B,SAAS;gBACT,OAAO;aACV;YACD,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;SAC7E,CAAC;aACD,KAAK,CACF,YAAY,CAAC;YACT;gBACI,IAAI,EAAE,GAAG;gBACT,oBAAoB,EAAE,iCAAiC;gBACvD,KAAK,EAAE,IAAI,4BAA4B,CACnC,cAAc,EACd,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,IAAI,SAAS,CAC/F;aACJ;YACD;gBACI,IAAI,EAAE,GAAG;gBACT,oBAAoB,EAAE,wBAAwB;gBAC9C,KAAK,EAAE,IAAI,yBAAyB,CAAC,OAAO,CAAC;aAChD;YACD;gBACI,IAAI,EAAE,GAAG;gBACT,oBAAoB,EAAE,qCAAqC;gBAC3D,KAAK,EAAE,IAAI,iBAAiB,CAAC,cAAc,CAAC;aAC/C;SACJ,CAAC,CACL,CAAA;IACT,CAAC;CACJ"}
|
|
@@ -16,17 +16,7 @@ export declare const schedulingOptionsSchema: import("@sinclair/typebox").TObjec
|
|
|
16
16
|
endDate: import("@sinclair/typebox").TDate;
|
|
17
17
|
earliestTimeEachDay: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
18
18
|
latestTimeEachDay: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Schema for output scheduling options
|
|
22
|
-
*/
|
|
23
|
-
export declare const outputSchedulingOptionsSchema: import("@sinclair/typebox").TObject<{
|
|
24
|
-
padding: import("@sinclair/typebox").TNumber;
|
|
25
|
-
slotDuration: import("@sinclair/typebox").TNumber;
|
|
26
|
-
startDate: import("@sinclair/typebox").TDate;
|
|
27
|
-
endDate: import("@sinclair/typebox").TDate;
|
|
28
|
-
earliestTimeEachDay: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
29
|
-
latestTimeEachDay: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
19
|
+
maxOverlaps: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
30
20
|
}>;
|
|
31
21
|
/**
|
|
32
22
|
* Schema for time range with user information
|
|
@@ -37,9 +27,9 @@ export declare const timeRangeWithUserSchema: import("@sinclair/typebox").TObjec
|
|
|
37
27
|
userId: import("@sinclair/typebox").TString;
|
|
38
28
|
}>;
|
|
39
29
|
/**
|
|
40
|
-
* Schema for the response of the scheduling endpoint
|
|
30
|
+
* Schema for the response of the user scheduling endpoint
|
|
41
31
|
*/
|
|
42
|
-
export declare const
|
|
32
|
+
export declare const userSchedulingResponseSchema: import("@sinclair/typebox").TObject<{
|
|
43
33
|
availableSlots: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
44
34
|
start: import("@sinclair/typebox").TDate;
|
|
45
35
|
end: import("@sinclair/typebox").TDate;
|
|
@@ -51,12 +41,13 @@ export declare const schedulingResponseSchema: import("@sinclair/typebox").TObje
|
|
|
51
41
|
endDate: import("@sinclair/typebox").TDate;
|
|
52
42
|
earliestTimeEachDay: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
53
43
|
latestTimeEachDay: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
44
|
+
maxOverlaps: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
54
45
|
}>;
|
|
55
46
|
}>;
|
|
56
47
|
/**
|
|
57
|
-
* Schema for the response of the advanced scheduling endpoint
|
|
48
|
+
* Schema for the response of the user advanced scheduling endpoint
|
|
58
49
|
*/
|
|
59
|
-
export declare const
|
|
50
|
+
export declare const userAdvancedSchedulingResponseSchema: import("@sinclair/typebox").TObject<{
|
|
60
51
|
availableSlots: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
61
52
|
start: import("@sinclair/typebox").TDate;
|
|
62
53
|
end: import("@sinclair/typebox").TDate;
|
|
@@ -74,9 +65,9 @@ export declare const advancedSchedulingResponseSchema: import("@sinclair/typebox
|
|
|
74
65
|
}>;
|
|
75
66
|
}>;
|
|
76
67
|
/**
|
|
77
|
-
* Schema for the response of the
|
|
68
|
+
* Schema for the response of the organization scheduling endpoint
|
|
78
69
|
*/
|
|
79
|
-
export declare const
|
|
70
|
+
export declare const orgSchedulingResponseSchema: import("@sinclair/typebox").TObject<{
|
|
80
71
|
availableSlots: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
81
72
|
start: import("@sinclair/typebox").TDate;
|
|
82
73
|
end: import("@sinclair/typebox").TDate;
|
|
@@ -89,6 +80,7 @@ export declare const subOrgSchedulingResponseSchema: import("@sinclair/typebox")
|
|
|
89
80
|
endDate: import("@sinclair/typebox").TDate;
|
|
90
81
|
earliestTimeEachDay: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
91
82
|
latestTimeEachDay: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
83
|
+
maxOverlaps: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
92
84
|
}>;
|
|
93
85
|
}>;
|
|
94
86
|
//# sourceMappingURL=scheduling.tb.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduling.tb.d.ts","sourceRoot":"","sources":["../../src/typebox/scheduling.tb.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;EAmB3B,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"scheduling.tb.d.ts","sourceRoot":"","sources":["../../src/typebox/scheduling.tb.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;EAmB3B,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;EAgClC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;EAUlC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;EAGvC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;EAM/C,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;EAGtC,CAAA"}
|
|
@@ -49,32 +49,8 @@ export const schedulingOptionsSchema = T.Object({
|
|
|
49
49
|
latestTimeEachDay: T.Optional(timeString({
|
|
50
50
|
description: 'Requested latest time of each day (in the time zone of the request) (e.g., 16:00)',
|
|
51
51
|
})),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
* Schema for output scheduling options
|
|
55
|
-
*/
|
|
56
|
-
export const outputSchedulingOptionsSchema = T.Object({
|
|
57
|
-
padding: T.Number({
|
|
58
|
-
default: 0,
|
|
59
|
-
description: 'Padding in minutes to add before and after busy times',
|
|
60
|
-
}),
|
|
61
|
-
slotDuration: T.Number({
|
|
62
|
-
default: 30,
|
|
63
|
-
description: 'Duration of each slot in minutes',
|
|
64
|
-
}),
|
|
65
|
-
startDate: T.Date({
|
|
66
|
-
description: 'Start of the time range to scan for availability (inclusive)',
|
|
67
|
-
examples: [exampleStartDate],
|
|
68
|
-
}),
|
|
69
|
-
endDate: T.Date({
|
|
70
|
-
description: 'End of the time range to scan for availability (inclusive)',
|
|
71
|
-
examples: [exampleEndDate],
|
|
72
|
-
}),
|
|
73
|
-
earliestTimeEachDay: T.Optional(timeString({
|
|
74
|
-
description: 'Requested earliest time of each day (in the time zone of the request) (e.g., 10:00)',
|
|
75
|
-
})),
|
|
76
|
-
latestTimeEachDay: T.Optional(timeString({
|
|
77
|
-
description: 'Requested latest time of each day (in the time zone of the request) (e.g., 16:00)',
|
|
52
|
+
maxOverlaps: T.Optional(T.Number({
|
|
53
|
+
description: 'Maximum number of overlaps allowed',
|
|
78
54
|
})),
|
|
79
55
|
});
|
|
80
56
|
/**
|
|
@@ -92,27 +68,27 @@ export const timeRangeWithUserSchema = T.Object({
|
|
|
92
68
|
userId: T.String(),
|
|
93
69
|
});
|
|
94
70
|
/**
|
|
95
|
-
* Schema for the response of the scheduling endpoint
|
|
71
|
+
* Schema for the response of the user scheduling endpoint
|
|
96
72
|
*/
|
|
97
|
-
export const
|
|
73
|
+
export const userSchedulingResponseSchema = T.Object({
|
|
98
74
|
availableSlots: T.Array(timeRangeSchema),
|
|
99
|
-
options:
|
|
75
|
+
options: schedulingOptionsSchema,
|
|
100
76
|
});
|
|
101
77
|
/**
|
|
102
|
-
* Schema for the response of the advanced scheduling endpoint
|
|
78
|
+
* Schema for the response of the user advanced scheduling endpoint
|
|
103
79
|
*/
|
|
104
|
-
export const
|
|
80
|
+
export const userAdvancedSchedulingResponseSchema = T.Object({
|
|
105
81
|
availableSlots: T.Array(timeRangeSchema),
|
|
106
82
|
options: T.Object({
|
|
107
|
-
...T.Omit(schedulingOptionsSchema, ['earliestTimeEachDay', 'latestTimeEachDay']).properties,
|
|
83
|
+
...T.Omit(schedulingOptionsSchema, ['earliestTimeEachDay', 'latestTimeEachDay', 'maxOverlaps']).properties,
|
|
108
84
|
schedules: T.Array(schedulingSchema),
|
|
109
85
|
}),
|
|
110
86
|
});
|
|
111
87
|
/**
|
|
112
|
-
* Schema for the response of the
|
|
88
|
+
* Schema for the response of the organization scheduling endpoint
|
|
113
89
|
*/
|
|
114
|
-
export const
|
|
90
|
+
export const orgSchedulingResponseSchema = T.Object({
|
|
115
91
|
availableSlots: T.Array(timeRangeWithUserSchema),
|
|
116
|
-
options:
|
|
92
|
+
options: schedulingOptionsSchema,
|
|
117
93
|
});
|
|
118
94
|
//# sourceMappingURL=scheduling.tb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduling.tb.js","sourceRoot":"","sources":["../../src/typebox/scheduling.tb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,CAAC,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/C,MAAM,gBAAgB,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAA;AAC/C,MAAM,cAAc,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAA;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,CAAC,CAAC,KAAK,CACT,CAAC,CAAC,KAAK,CAAC;QACJ,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QACnB,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;QACpB,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;QACtB,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;QACrB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QACnB,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;QACrB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;KACtB,CAAC,EACF,EAAE,WAAW,EAAE,8CAA8C,EAAE,CAClE;IACD,KAAK,EAAE,UAAU,CAAC;QACd,WAAW,EAAE,qCAAqC;KACrD,CAAC;IACF,GAAG,EAAE,UAAU,CAAC;QACZ,WAAW,EAAE,mCAAmC;KACnD,CAAC;CACL,CAAC,CAAA;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB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';
|
|
2
|
-
import type {
|
|
2
|
+
import type { orgSchedulingResponseSchema, schedulingSchema, userAdvancedSchedulingResponseSchema, userSchedulingResponseSchema } from '../typebox/scheduling.tb.js';
|
|
3
3
|
import type { Provider, TimeRange } from './calendar.types.js';
|
|
4
|
-
export interface SchedulingOptions {
|
|
5
|
-
padding: number;
|
|
6
|
-
slotDuration: number;
|
|
7
|
-
startDate: Date;
|
|
8
|
-
endDate: Date;
|
|
9
|
-
earliestTimeEachDay?: string;
|
|
10
|
-
latestTimeEachDay?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface OutputsSchedulingOptions {
|
|
13
|
-
padding: number;
|
|
14
|
-
slotDuration: number;
|
|
15
|
-
startDate: string;
|
|
16
|
-
endDate: string;
|
|
17
|
-
schedules: Schedule[];
|
|
18
|
-
}
|
|
19
4
|
export interface TimeRangeWithUser extends TimeRange {
|
|
20
5
|
userId: string;
|
|
21
6
|
}
|
|
22
7
|
export type Schedule = Static<typeof schedulingSchema>;
|
|
23
|
-
export type
|
|
24
|
-
export type
|
|
25
|
-
export type
|
|
26
|
-
export interface
|
|
8
|
+
export type UserSchedulingResponse = Static<typeof userSchedulingResponseSchema>;
|
|
9
|
+
export type UserAdvancedSchedulingResponse = Static<typeof userAdvancedSchedulingResponseSchema>;
|
|
10
|
+
export type OrgSchedulingResponse = Static<typeof orgSchedulingResponseSchema>;
|
|
11
|
+
export interface UserSchedulingBasicOptions {
|
|
27
12
|
provider?: Provider | Provider[];
|
|
28
13
|
padding?: number;
|
|
29
14
|
slotDuration?: number;
|
|
30
15
|
earliestTimeEachDay?: string;
|
|
31
16
|
latestTimeEachDay?: string;
|
|
32
17
|
timeZone?: string;
|
|
18
|
+
maxOverlaps?: number;
|
|
33
19
|
}
|
|
34
|
-
export interface
|
|
20
|
+
export interface UserSchedulingAdvancedOptions {
|
|
35
21
|
provider?: Provider | Provider[];
|
|
36
22
|
padding?: number;
|
|
37
23
|
slotDuration?: number;
|
|
38
24
|
timeZone?: string;
|
|
25
|
+
maxOverlaps?: number;
|
|
39
26
|
}
|
|
40
|
-
export interface
|
|
27
|
+
export interface OrgSchedulingOptions {
|
|
41
28
|
provider?: Provider | Provider[];
|
|
42
29
|
padding?: number;
|
|
43
30
|
slotDuration?: number;
|
|
44
31
|
earliestTimeEachDay?: string;
|
|
45
32
|
latestTimeEachDay?: string;
|
|
46
33
|
timeZone?: string;
|
|
34
|
+
maxOverlaps?: number;
|
|
47
35
|
}
|
|
48
36
|
//# sourceMappingURL=scheduling.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduling.types.d.ts","sourceRoot":"","sources":["../../src/types/scheduling.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EACR,
|
|
1
|
+
{"version":3,"file":"scheduling.types.d.ts","sourceRoot":"","sources":["../../src/types/scheduling.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EACR,2BAA2B,EAC3B,gBAAgB,EAChB,oCAAoC,EACpC,4BAA4B,EAC/B,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAM9D,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAChD,MAAM,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAMtD,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEhF,MAAM,MAAM,8BAA8B,GAAG,MAAM,CAAC,OAAO,oCAAoC,CAAC,CAAA;AAEhG,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAM9E,MAAM,WAAW,0BAA0B;IACvC,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