recal-sdk 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +488 -199
  2. package/dist/entities/organization.d.ts +2 -2
  3. package/dist/entities/organization.d.ts.map +1 -1
  4. package/dist/entities/organization.js +32 -0
  5. package/dist/entities/organization.js.map +1 -0
  6. package/dist/entities/user.d.ts +2 -2
  7. package/dist/entities/user.d.ts.map +1 -1
  8. package/dist/entities/user.js +45 -0
  9. package/dist/entities/user.js.map +1 -0
  10. package/dist/errors.js +36 -0
  11. package/dist/errors.js.map +1 -0
  12. package/dist/index.d.ts +7 -3
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +52 -7046
  15. package/dist/index.js.map +1 -1
  16. package/dist/services/calendar.service.d.ts +82 -35
  17. package/dist/services/calendar.service.d.ts.map +1 -1
  18. package/dist/services/calendar.service.js +292 -0
  19. package/dist/services/calendar.service.js.map +1 -0
  20. package/dist/services/oauth.service.d.ts +2 -1
  21. package/dist/services/oauth.service.d.ts.map +1 -1
  22. package/dist/services/oauth.service.js +168 -0
  23. package/dist/services/oauth.service.js.map +1 -0
  24. package/dist/services/organizations.service.d.ts +1 -1
  25. package/dist/services/organizations.service.d.ts.map +1 -1
  26. package/dist/services/organizations.service.js +132 -0
  27. package/dist/services/organizations.service.js.map +1 -0
  28. package/dist/services/scheduling.service.d.ts +32 -29
  29. package/dist/services/scheduling.service.d.ts.map +1 -1
  30. package/dist/services/scheduling.service.js +122 -0
  31. package/dist/services/scheduling.service.js.map +1 -0
  32. package/dist/services/users.service.js +93 -0
  33. package/dist/services/users.service.js.map +1 -0
  34. package/dist/typebox/calendar.tb.d.ts +7 -6
  35. package/dist/typebox/calendar.tb.d.ts.map +1 -1
  36. package/dist/typebox/calendar.tb.js +92 -0
  37. package/dist/typebox/calendar.tb.js.map +1 -0
  38. package/dist/typebox/oauth.tb.d.ts +2 -2
  39. package/dist/typebox/oauth.tb.js +16 -0
  40. package/dist/typebox/oauth.tb.js.map +1 -0
  41. package/dist/typebox/organization.stripped.tb.js +7 -0
  42. package/dist/typebox/organization.stripped.tb.js.map +1 -0
  43. package/dist/typebox/organization.tb.js +8 -0
  44. package/dist/typebox/organization.tb.js.map +1 -0
  45. package/dist/typebox/scheduling.tb.js +118 -0
  46. package/dist/typebox/scheduling.tb.js.map +1 -0
  47. package/dist/typebox/timeString.tb.js +7 -0
  48. package/dist/typebox/timeString.tb.js.map +1 -0
  49. package/dist/typebox/user.stripped.tb.js +6 -0
  50. package/dist/typebox/user.stripped.tb.js.map +1 -0
  51. package/dist/typebox/user.tb.d.ts +1 -1
  52. package/dist/typebox/user.tb.js +10 -0
  53. package/dist/typebox/user.tb.js.map +1 -0
  54. package/dist/types/calendar.types.d.ts +5 -7
  55. package/dist/types/calendar.types.d.ts.map +1 -1
  56. package/dist/types/calendar.types.js +27 -56
  57. package/dist/types/calendar.types.js.map +1 -1
  58. package/dist/types/internal.types.js +2 -0
  59. package/dist/types/internal.types.js.map +1 -0
  60. package/dist/types/oauth.types.d.ts +1 -1
  61. package/dist/types/oauth.types.d.ts.map +1 -1
  62. package/dist/types/oauth.types.js +2 -0
  63. package/dist/types/oauth.types.js.map +1 -0
  64. package/dist/types/scheduling.types.js +2 -0
  65. package/dist/types/scheduling.types.js.map +1 -0
  66. package/dist/utils/fetch.helper.d.ts +1 -1
  67. package/dist/utils/fetch.helper.d.ts.map +1 -1
  68. package/dist/utils/fetch.helper.js +93 -0
  69. package/dist/utils/fetch.helper.js.map +1 -0
  70. package/dist/utils/fetchErrorHandler.js +32 -0
  71. package/dist/utils/fetchErrorHandler.js.map +1 -0
  72. package/dist/utils/functionize.js +6 -0
  73. package/dist/utils/functionize.js.map +1 -0
  74. package/dist/utils/includes.helper.js +10 -0
  75. package/dist/utils/includes.helper.js.map +1 -0
  76. package/dist/utils/omit.js +4 -0
  77. package/dist/utils/omit.js.map +1 -0
  78. package/package.json +7 -5
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/types/calendar.types.ts"],"sourcesContent":["import type { Organization } from './types/entity.types'\n\ninterface RecalOptions {\n token?: string\n baseURL?: string\n}\n\n/**\n * Recal SDK\n * @description Recal SDK for Node.js\n * @version 0.1.0\n * @author Recal <team@recal.dev>\n * @license MIT\n */\nexport class Recal {\n // MARK: States\n private token: string\n private baseURL: string\n\n /**\n * Recal SDK constructor\n * @param token Recal API token\n */\n constructor(options?: RecalOptions) {\n let envToken: string\n if (!options?.token) {\n const _envToken = process.env.RECAL_TOKEN\n if (!_envToken)\n throw new Error('[Recal] No token provided by constructor or environment variable (RECAL_TOKEN)')\n envToken = _envToken\n }\n this.token = options?.token || envToken!\n this.baseURL = options?.baseURL || process.env.RECAL_BASE_URL || 'https://api.recal.dev'\n }\n\n // MARK: Functions\n /**\n * Fetch function with Recal authentication\n * @param input Request input\n * @param init Request init\n * @returns Promise<Response>\n */\n private _fetch = async (input: string, init?: RequestInit): Promise<Response> => {\n const url = new URL(`${this.baseURL}/v1${input.startsWith('/') ? '' : '/'}${input}`)\n return await fetch(url, {\n method: init?.method || 'GET',\n headers: {\n ...init?.headers,\n Authorization: `Bearer ${this.token}`,\n 'Content-Type': 'application/json',\n },\n credentials: 'include',\n mode: 'cors',\n ...init,\n }).catch((error) => {\n throw new Error(`[Recal] Fetch error: ${error}`)\n })\n }\n\n private fetch = (input: string, init?: RequestInit): Promise<Response> => {\n return this._fetch(input, init)\n }\n\n // Organization\n /**\n * Get all organizations\n * @returns Promise<PublicOrganization[]>\n */\n async listOrganizations(): Promise<Organization[]> {\n const response = await this.fetch('/organizations')\n if (!response.ok) throw new Error(`[Recal] HTTP error! status: ${response.status}`)\n return response.json() as Promise<Organization[]>\n }\n\n /**\n * Get organization by slug\n * @param slug Organization slug\n * @returns Promise<Organization>\n */\n async getOrganization(slug: string): Promise<Organization> {\n const response = await this.fetch(`/organizations/${slug}`)\n if (!response.ok) throw new Error(`[Recal] HTTP error! status: ${response.status}`)\n return response.json() as Promise<Organization>\n }\n\n // Member\n\n // Calendar\n}\n\nexport * from './types'\nexport default Recal\n\nconst test = new Recal()\ntest.listOrganizations().then((organizations) => console.log(organizations))\n","// Enums\nexport enum Provider {\n GOOGLE = 'google',\n MICROSOFT = 'microsoft',\n}\n\nexport enum CalendarAccessRoles {\n FreeBusyReader = 'freeBusyReader',\n Reader = 'reader',\n Writer = 'writer',\n Owner = 'owner',\n}\n\nexport enum AttendeeResponseStatus {\n NeedsAction = 'needsAction',\n Accepted = 'accepted',\n Tentative = 'tentative',\n Declined = 'declined',\n}\n\n// Types\n\nexport type Calendar = {\n id: string\n timeZone?: string\n subject?: string\n backgroundColor?: string\n foregroundColor?: string\n selected?: boolean\n accessRole?: CalendarAccessRoles\n original?: unknown\n}\n\nexport type Meeting = {\n url: string\n}\n\nexport type Attendee = {\n email: string\n original: unknown\n} & (\n | {\n responseStatus?: AttendeeResponseStatus\n }\n | {\n self: true\n }\n)\n\nexport type Event = {\n id: string\n metaId?: string\n subject?: string\n description?: string\n start?: Date\n end?: Date\n location?: string\n attendees: Attendee[]\n meeting?: Meeting\n original: unknown\n}\n\nexport type TimeRange = {\n start: Date\n end: Date\n}\n\nexport type FreeBusy = {\n calendarId: string\n busy: TimeRange[]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCO,IAAK,WAAL,kBAAKA,cAAL;AACH,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,eAAY;AAFJ,SAAAA;AAAA,GAAA;AAKL,IAAK,sBAAL,kBAAKC,yBAAL;AACH,EAAAA,qBAAA,oBAAiB;AACjB,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,WAAQ;AAJA,SAAAA;AAAA,GAAA;AAOL,IAAK,yBAAL,kBAAKC,4BAAL;AACH,EAAAA,wBAAA,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-1,5 +1,5 @@
1
- import type { CreateEvent, CreateEventAcrossCalendars, Event, FreeBusy, Provider, TimeRange, UpdateEvent, UpdateEventAcrossCalendars } from 'src/types/calendar.types';
2
- import type { FetchHelper } from 'src/utils/fetch.helper';
1
+ import type { Busy, CreateEvent, CreateEventAcrossCalendars, Event, Provider, TimeRange, UpdateEvent, UpdateEventAcrossCalendars } from '../types/calendar.types';
2
+ import type { FetchHelper } from '../utils/fetch.helper';
3
3
  export declare class CalendarService {
4
4
  private fetchHelper;
5
5
  constructor(fetchHelper: FetchHelper);
@@ -7,100 +7,147 @@ export declare class CalendarService {
7
7
  * @param userId The ID of the user
8
8
  * @param minDate The start date of the free/busy period
9
9
  * @param maxDate The end date of the free/busy period
10
- * @param provider The provider(s) of the calendar (optional, can be array)
11
- * @param timeZone The time zone of the calendar (optional)
10
+ * @param options The options for the free/busy query (optional)
12
11
  * @returns The free/busy period
13
12
  */
14
- getFreeBusy(userId: string, minDate: Date, maxDate: Date, provider?: Provider | Provider[], timeZone?: string): Promise<FreeBusy>;
13
+ getBusy(userId: string, minDate: Date, maxDate: Date, options?: {
14
+ provider?: Provider | Provider[];
15
+ timeZone?: string;
16
+ }): Promise<Busy>;
15
17
  /**
16
18
  * @param userId The ID of the user
17
19
  * @param minDate The start date of the events
18
20
  * @param maxDate The end date of the events
19
- * @param provider The provider(s) of the calendar (optional, can be array)
20
- * @param timeZone The time zone of the calendar (optional)
21
+ * @param options The options for the events query (optional)
21
22
  * @returns The events
22
23
  */
23
- getEvents(userId: string, minDate: Date, maxDate: Date, provider?: Provider | Provider[], timeZone?: string): Promise<Event[]>;
24
+ getEvents(userId: string, minDate: Date, maxDate: Date, options?: {
25
+ provider?: Provider | Provider[];
26
+ timeZone?: string;
27
+ }): Promise<Event[]>;
24
28
  /**
25
29
  * @param userId The ID of the user
26
30
  * @param metaId The meta ID of the event
27
- * @param provider The provider(s) of the calendar (optional, can be array)
28
- * @param timeZone The time zone of the calendar (optional)
31
+ * @param options The options for the event query (optional)
29
32
  * @returns The event
30
33
  */
31
- getEventByMetaId(userId: string, metaId: string, provider?: Provider | Provider[], timeZone?: string): Promise<Event>;
34
+ getEventByMetaId(userId: string, metaId: string, options?: {
35
+ provider?: Provider | Provider[];
36
+ timeZone?: string;
37
+ }): Promise<Event>;
32
38
  /**
33
39
  * @param userId The ID of the user
34
40
  * @param event The event to create
35
- * @param provider The provider(s) of the calendar (optional, can be array)
36
- * @param timeZone The time zone of the calendar (optional)
41
+ * @param options The options for the event creation (optional)
37
42
  * @returns The created event
38
43
  */
39
- createEventByMetaId(userId: string, event: CreateEventAcrossCalendars, provider?: Provider | Provider[], timeZone?: string): Promise<Event>;
44
+ createEventByMetaId(userId: string, event: CreateEventAcrossCalendars, options?: {
45
+ provider?: Provider | Provider[];
46
+ timeZone?: string;
47
+ }): Promise<Event>;
40
48
  /**
41
49
  * @param userId The ID of the user
42
50
  * @param metaId The meta ID of the event
43
51
  * @param event The updated event
44
- * @param provider The provider(s) of the calendar (optional, can be array)
45
- * @param timeZone The time zone of the calendar (optional)
52
+ * @param options The options for the event update (optional)
46
53
  * @returns The updated event
47
54
  */
48
- updateEventByMetaId(userId: string, metaId: string, event: UpdateEventAcrossCalendars, provider?: Provider | Provider[], timeZone?: string): Promise<Event>;
55
+ updateEventByMetaId(userId: string, metaId: string, event: UpdateEventAcrossCalendars, options?: {
56
+ provider?: Provider | Provider[];
57
+ timeZone?: string;
58
+ }): Promise<Event>;
49
59
  /**
50
60
  * @param userId The ID of the user
51
61
  * @param metaId The meta ID of the event
52
- * @param provider The provider(s) of the calendar (optional, can be array)
53
- * @param timeZone The time zone of the calendar (optional)
54
- * @returns The deleted event
62
+ * @param options The options for the event deletion (optional)
63
+ * @returns void
55
64
  */
56
- deleteEventByMetaId(userId: string, metaId: string, provider?: Provider | Provider[], timeZone?: string): Promise<void>;
65
+ deleteEventByMetaId(userId: string, metaId: string, options?: {
66
+ provider?: Provider | Provider[];
67
+ timeZone?: string;
68
+ }): Promise<void>;
57
69
  /**
58
70
  * @param userId The ID of the user
59
71
  * @param provider The provider of the calendar
60
72
  * @param calendarId The ID of the calendar
61
73
  * @param eventId The ID of the event
62
- * @param timeZone The time zone of the calendar (optional)
74
+ * @param options The options for the event query (optional)
63
75
  * @returns The event
64
76
  */
65
- getEvent(userId: string, provider: Provider, calendarId: string, eventId: string, timeZone?: string): Promise<Event>;
77
+ getEvent({ userId, provider, calendarId, eventId, options, }: {
78
+ userId: string;
79
+ provider: Provider;
80
+ calendarId?: string;
81
+ eventId: string;
82
+ options?: {
83
+ timeZone?: string;
84
+ };
85
+ }): Promise<Event>;
66
86
  /**
67
87
  * @param userId The ID of the user
68
88
  * @param provider The provider of the calendar
69
89
  * @param calendarId The ID of the calendar
70
90
  * @param event The event to create
71
- * @param timeZone The time zone of the calendar (optional)
91
+ * @param options The options for the event creation (optional)
72
92
  * @returns The created event
73
93
  */
74
- createEvent(userId: string, provider: Provider, calendarId: string, event: CreateEvent, timeZone?: string): Promise<Event>;
94
+ createEvent({ userId, provider, calendarId, event, options, }: {
95
+ userId: string;
96
+ provider: Provider;
97
+ calendarId?: string;
98
+ event: CreateEvent;
99
+ options?: {
100
+ timeZone?: string;
101
+ };
102
+ }): Promise<Event>;
75
103
  /**
76
104
  * @param userId The ID of the user
77
105
  * @param provider The provider of the calendar
78
106
  * @param calendarId The ID of the calendar
79
107
  * @param eventId The ID of the event
80
108
  * @param event The updated event
81
- * @param timeZone The time zone of the calendar (optional)
109
+ * @param options The options for the event update (optional)
82
110
  * @returns The updated event
83
111
  */
84
- updateEvent(userId: string, provider: Provider, calendarId: string, eventId: string, event: UpdateEvent, timeZone?: string): Promise<Event>;
112
+ updateEvent({ userId, provider, calendarId, eventId, event, options, }: {
113
+ userId: string;
114
+ provider: Provider;
115
+ calendarId?: string;
116
+ eventId: string;
117
+ event: UpdateEvent;
118
+ options?: {
119
+ timeZone?: string;
120
+ };
121
+ }): Promise<Event>;
85
122
  /**
86
123
  * @param userId The ID of the user
87
124
  * @param provider The provider of the calendar
88
125
  * @param calendarId The ID of the calendar
89
126
  * @param eventId The ID of the event
90
- * @param timeZone The time zone of the calendar (optional)
91
- * @returns The deleted event
127
+ * @param options The options for the event deletion (optional)
128
+ * @returns void
92
129
  */
93
- deleteEvent(userId: string, provider: Provider, calendarId: string, eventId: string, timeZone?: string): Promise<void>;
130
+ deleteEvent({ userId, provider, calendarId, eventId, options, }: {
131
+ userId: string;
132
+ provider: Provider;
133
+ calendarId?: string;
134
+ eventId: string;
135
+ options?: {
136
+ timeZone?: string;
137
+ };
138
+ }): Promise<void>;
94
139
  /**
95
- * Get the org-wide free/busy period
140
+ * Get the org-wide busy period
96
141
  * @param slug The slug of the organization
97
142
  * @param minDate The minimum date
98
143
  * @param maxDate The maximum date
99
- * @param primaryOnly Whether to only include the primary calendar
100
- * @param provider The provider(s) of the calendar (optional, can be array)
101
- * @param timeZone The time zone
144
+ * @param primaryOnly Whether to only include the primary calendar (default: true)
145
+ * @param options The options for the org-wide free/busy query (optional)
102
146
  * @returns The org-wide free/busy period
103
147
  */
104
- getOrgWideFreeBusy(slug: string, minDate: Date, maxDate: Date, primaryOnly?: boolean, provider?: Provider | Provider[], timeZone?: string): Promise<TimeRange[]>;
148
+ getOrgWideBusy(slug: string, minDate: Date, maxDate: Date, primaryOnly?: boolean, options?: {
149
+ provider?: Provider | Provider[];
150
+ timeZone?: string;
151
+ }): Promise<TimeRange[]>;
105
152
  }
106
153
  //# sourceMappingURL=calendar.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.service.d.ts","sourceRoot":"","sources":["../../src/services/calendar.service.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACR,WAAW,EACX,0BAA0B,EAC1B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,WAAW,EACX,0BAA0B,EAC7B,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAGzD,qBAAa,eAAe;I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AO,EACP,KAAK,EACL,OAAO,GACV,EAAE;QACC,MAAM,EAAE,MAAM,CAAA;QACd,QAAQ,EAAE,QAAQ,CAAA;QAClB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,OAAO,EAAE,MAAM,CAAA;QACf,KAAK,EAAE,WAAW,CAAA;QAClB,OAAO,CAAC,EAAE;YACN,QAAQ,CAAC,EAAE,MAAM,CAAA;SACpB,CAAA;KACJ,GAAG,OAAO,CAAC,KAAK,CAAC;IAqBlB;;;;;;;OAOG;IACU,WAAW,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,UAAsB,EACtB,OAAO,EACP,OAAO,GACV,EAAE;QACC,MAAM,EAAE,MAAM,CAAA;QACd,QAAQ,EAAE,QAAQ,CAAA;QAClB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,CAAC,EAAE;YACN,QAAQ,CAAC,EAAE,MAAM,CAAA;SACpB,CAAA;KACJ,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBjB;;;;;;;;OAQG;IACU,cAAc,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,EACb,WAAW,CAAC,EAAE,OAAO,EACrB,OAAO,CAAC,EAAE;QACN,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAA;QAChC,QAAQ,CAAC,EAAE,MAAM,CAAA;KACpB,GACF,OAAO,CAAC,SAAS,EAAE,CAAC;CAkB1B"}
@@ -0,0 +1,292 @@
1
+ import { Type as T } from '@sinclair/typebox';
2
+ import { EventNotFoundError, OAuthConnectionNotFoundError, OrganizationNotFoundError, ProviderCredentialsNotSetError, UserNotFoundError, } from '../errors.js';
3
+ import { busySchema, eventSchema, timeRangeSchema } from '../typebox/calendar.tb.js';
4
+ import { errorHandler } from '../utils/fetch.helper.js';
5
+ export class CalendarService {
6
+ fetchHelper;
7
+ constructor(fetchHelper) {
8
+ this.fetchHelper = fetchHelper;
9
+ }
10
+ // ==========================================
11
+ // MARK: User Calendar - Busy & Events
12
+ // ==========================================
13
+ /**
14
+ * @param userId The ID of the user
15
+ * @param minDate The start date of the free/busy period
16
+ * @param maxDate The end date of the free/busy period
17
+ * @param options The options for the free/busy query (optional)
18
+ * @returns The free/busy period
19
+ */
20
+ async getBusy(userId, minDate, maxDate, options) {
21
+ const { provider, timeZone } = options || {};
22
+ return this.fetchHelper
23
+ .get(`/v1/users/${userId}/calendar/busy`, {
24
+ schema: busySchema,
25
+ searchParams: { minDate, maxDate, provider },
26
+ headers: timeZone ? { 'x-timezone': timeZone } : undefined,
27
+ })
28
+ .catch(errorHandler([
29
+ {
30
+ code: 400,
31
+ error: new OAuthConnectionNotFoundError(userId, Array.isArray(provider) ? provider.join(',') : provider || 'all'),
32
+ },
33
+ { code: 404, error: new UserNotFoundError(userId) },
34
+ ]));
35
+ }
36
+ /**
37
+ * @param userId The ID of the user
38
+ * @param minDate The start date of the events
39
+ * @param maxDate The end date of the events
40
+ * @param options The options for the events query (optional)
41
+ * @returns The events
42
+ */
43
+ async getEvents(userId, minDate, maxDate, options) {
44
+ const { provider, timeZone } = options || {};
45
+ return this.fetchHelper
46
+ .get(`/v1/users/${userId}/calendar/events`, {
47
+ schema: T.Array(eventSchema),
48
+ searchParams: { minDate, maxDate, provider },
49
+ headers: timeZone ? { 'x-timezone': timeZone } : undefined,
50
+ })
51
+ .catch(errorHandler([
52
+ {
53
+ code: 400,
54
+ error: new OAuthConnectionNotFoundError(userId, Array.isArray(provider) ? provider.join(',') : provider || 'unknown'),
55
+ statusTextInclFilter: 'User has not the needed calendars connected',
56
+ },
57
+ { code: 404, error: new UserNotFoundError(userId) },
58
+ ]));
59
+ }
60
+ // ==========================================
61
+ // MARK: Meta Event Operations (Cross-Calendar)
62
+ // ==========================================
63
+ /**
64
+ * @param userId The ID of the user
65
+ * @param metaId The meta ID of the event
66
+ * @param options The options for the event query (optional)
67
+ * @returns The event
68
+ */
69
+ async getEventByMetaId(userId, metaId, options) {
70
+ const { provider, timeZone } = options || {};
71
+ return this.fetchHelper
72
+ .get(`/v1/users/${userId}/calendar/events/meta/${metaId}`, {
73
+ schema: eventSchema,
74
+ searchParams: { provider },
75
+ headers: timeZone ? { 'x-timezone': timeZone } : undefined,
76
+ })
77
+ .catch(errorHandler([
78
+ {
79
+ code: 400,
80
+ error: new OAuthConnectionNotFoundError(userId, Array.isArray(provider) ? provider.join(',') : provider || 'unknown'),
81
+ },
82
+ { code: 404, error: new UserNotFoundError(userId), statusTextInclFilter: 'User not found' },
83
+ { code: 404, error: new EventNotFoundError(metaId) },
84
+ ]));
85
+ }
86
+ /**
87
+ * @param userId The ID of the user
88
+ * @param event The event to create
89
+ * @param options The options for the event creation (optional)
90
+ * @returns The created event
91
+ */
92
+ async createEventByMetaId(userId, event, options) {
93
+ const { provider, timeZone } = options || {};
94
+ return this.fetchHelper
95
+ .post(`/v1/users/${userId}/calendar/events/meta`, {
96
+ schema: eventSchema,
97
+ searchParams: { provider },
98
+ headers: timeZone ? { 'x-timezone': timeZone } : undefined,
99
+ body: { event },
100
+ })
101
+ .catch(errorHandler([
102
+ {
103
+ code: 400,
104
+ error: new OAuthConnectionNotFoundError(userId, Array.isArray(provider) ? provider.join(',') : provider || 'unknown'),
105
+ },
106
+ { code: 404, error: new UserNotFoundError(userId) },
107
+ ]));
108
+ }
109
+ /**
110
+ * @param userId The ID of the user
111
+ * @param metaId The meta ID of the event
112
+ * @param event The updated event
113
+ * @param options The options for the event update (optional)
114
+ * @returns The updated event
115
+ */
116
+ async updateEventByMetaId(userId, metaId, event, options) {
117
+ const { provider, timeZone } = options || {};
118
+ return this.fetchHelper
119
+ .put(`/v1/users/${userId}/calendar/events/meta/${metaId}`, {
120
+ schema: eventSchema,
121
+ searchParams: { provider },
122
+ headers: timeZone ? { 'x-timezone': timeZone } : undefined,
123
+ body: { event },
124
+ })
125
+ .catch(errorHandler([
126
+ {
127
+ code: 400,
128
+ error: new OAuthConnectionNotFoundError(userId, Array.isArray(provider) ? provider.join(',') : provider || 'unknown'),
129
+ },
130
+ { code: 404, error: new UserNotFoundError(userId), statusTextInclFilter: 'User not found' },
131
+ { code: 404, error: new EventNotFoundError(metaId) },
132
+ ]));
133
+ }
134
+ /**
135
+ * @param userId The ID of the user
136
+ * @param metaId The meta ID of the event
137
+ * @param options The options for the event deletion (optional)
138
+ * @returns void
139
+ */
140
+ async deleteEventByMetaId(userId, metaId, options) {
141
+ const { provider, timeZone } = options || {};
142
+ return this.fetchHelper
143
+ .delete(`/v1/users/${userId}/calendar/events/meta/${metaId}`, {
144
+ searchParams: { provider },
145
+ headers: timeZone ? { 'x-timezone': timeZone } : undefined,
146
+ schema: T.Void(),
147
+ })
148
+ .catch(errorHandler([
149
+ {
150
+ code: 400,
151
+ error: new OAuthConnectionNotFoundError(userId, Array.isArray(provider) ? provider.join(',') : provider || 'unknown'),
152
+ },
153
+ { code: 404, error: new UserNotFoundError(userId) },
154
+ ]));
155
+ }
156
+ // ==========================================
157
+ // MARK: Provider-Specific Event Operations
158
+ // ==========================================
159
+ /**
160
+ * @param userId The ID of the user
161
+ * @param provider The provider of the calendar
162
+ * @param calendarId The ID of the calendar
163
+ * @param eventId The ID of the event
164
+ * @param options The options for the event query (optional)
165
+ * @returns The event
166
+ */
167
+ async getEvent({ userId, provider, calendarId = 'primary', eventId, options, }) {
168
+ const { timeZone } = options || {};
169
+ return this.fetchHelper
170
+ .get(`/v1/users/${userId}/calendar/events/${provider}/${calendarId}/${eventId}`, {
171
+ schema: eventSchema,
172
+ headers: timeZone ? { 'x-timezone': timeZone } : undefined,
173
+ })
174
+ .catch(errorHandler([
175
+ {
176
+ code: 400,
177
+ error: new OAuthConnectionNotFoundError(userId, provider),
178
+ statusTextInclFilter: 'User has not connected this calendar provider',
179
+ },
180
+ { code: 404, error: new UserNotFoundError(userId), statusTextInclFilter: 'User not found' },
181
+ { code: 404, error: new EventNotFoundError(eventId), statusTextInclFilter: 'Event not found' },
182
+ { code: 404, error: new ProviderCredentialsNotSetError(provider) },
183
+ ]));
184
+ }
185
+ /**
186
+ * @param userId The ID of the user
187
+ * @param provider The provider of the calendar
188
+ * @param calendarId The ID of the calendar
189
+ * @param event The event to create
190
+ * @param options The options for the event creation (optional)
191
+ * @returns The created event
192
+ */
193
+ async createEvent({ userId, provider, calendarId = 'primary', event, options, }) {
194
+ const { timeZone } = options || {};
195
+ return this.fetchHelper
196
+ .post(`/v1/users/${userId}/calendar/events/${provider}/${calendarId}`, {
197
+ schema: eventSchema,
198
+ headers: timeZone ? { 'x-timezone': timeZone } : undefined,
199
+ body: { event },
200
+ })
201
+ .catch(errorHandler([
202
+ {
203
+ code: 400,
204
+ error: new OAuthConnectionNotFoundError(userId, provider),
205
+ statusTextInclFilter: 'User has not connected this calendar provider',
206
+ },
207
+ { code: 404, error: new UserNotFoundError(userId), statusTextInclFilter: 'User not found' },
208
+ { code: 404, error: new ProviderCredentialsNotSetError(provider) },
209
+ ]));
210
+ }
211
+ /**
212
+ * @param userId The ID of the user
213
+ * @param provider The provider of the calendar
214
+ * @param calendarId The ID of the calendar
215
+ * @param eventId The ID of the event
216
+ * @param event The updated event
217
+ * @param options The options for the event update (optional)
218
+ * @returns The updated event
219
+ */
220
+ async updateEvent({ userId, provider, calendarId = 'primary', eventId, event, options, }) {
221
+ const { timeZone } = options || {};
222
+ return this.fetchHelper
223
+ .put(`/v1/users/${userId}/calendar/events/${provider}/${calendarId}/${eventId}`, {
224
+ schema: eventSchema,
225
+ headers: timeZone ? { 'x-timezone': timeZone } : undefined,
226
+ body: { event },
227
+ })
228
+ .catch(errorHandler([
229
+ {
230
+ code: 400,
231
+ error: new OAuthConnectionNotFoundError(userId, provider),
232
+ statusTextInclFilter: 'User has not connected this calendar provider',
233
+ },
234
+ { code: 404, error: new UserNotFoundError(userId), statusTextInclFilter: 'User not found' },
235
+ { code: 404, error: new ProviderCredentialsNotSetError(provider) },
236
+ ]));
237
+ }
238
+ /**
239
+ * @param userId The ID of the user
240
+ * @param provider The provider of the calendar
241
+ * @param calendarId The ID of the calendar
242
+ * @param eventId The ID of the event
243
+ * @param options The options for the event deletion (optional)
244
+ * @returns void
245
+ */
246
+ async deleteEvent({ userId, provider, calendarId = 'primary', eventId, options, }) {
247
+ const { timeZone } = options || {};
248
+ return this.fetchHelper
249
+ .delete(`/v1/users/${userId}/calendar/events/${provider}/${calendarId}/${eventId}`, {
250
+ headers: timeZone ? { 'x-timezone': timeZone } : undefined,
251
+ schema: T.Void(),
252
+ })
253
+ .catch(errorHandler([
254
+ {
255
+ code: 400,
256
+ error: new OAuthConnectionNotFoundError(userId, provider),
257
+ statusTextInclFilter: 'User has not connected this calendar provider',
258
+ },
259
+ { code: 404, error: new UserNotFoundError(userId) },
260
+ { code: 404, error: new EventNotFoundError(eventId) },
261
+ ]));
262
+ }
263
+ // ==========================================
264
+ // MARK: Organization-Wide Operations
265
+ // ==========================================
266
+ /**
267
+ * Get the org-wide busy period
268
+ * @param slug The slug of the organization
269
+ * @param minDate The minimum date
270
+ * @param maxDate The maximum date
271
+ * @param primaryOnly Whether to only include the primary calendar (default: true)
272
+ * @param options The options for the org-wide free/busy query (optional)
273
+ * @returns The org-wide free/busy period
274
+ */
275
+ async getOrgWideBusy(slug, minDate, maxDate, primaryOnly, options) {
276
+ const { provider, timeZone } = options || {};
277
+ return this.fetchHelper
278
+ .get(`/v1/organizations/${slug}/calendar/busy`, {
279
+ schema: T.Array(timeRangeSchema),
280
+ searchParams: { minDate, maxDate, primaryOnly, provider },
281
+ headers: timeZone ? { 'x-timezone': timeZone } : undefined,
282
+ })
283
+ .catch(errorHandler([
284
+ {
285
+ code: 400,
286
+ error: new Error(`OAuth credentials for provider ${provider} not found for the user`),
287
+ },
288
+ { code: 404, error: new OrganizationNotFoundError(slug) },
289
+ ]));
290
+ }
291
+ }
292
+ //# sourceMappingURL=calendar.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.service.js","sourceRoot":"","sources":["../../src/services/calendar.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AyB,CAAC,IAAI,CAAC,EAAE;SAC5D,CAAC,CACL,CAAA;IACT,CAAC;CACJ"}
@@ -67,11 +67,12 @@ export declare class OAuthService {
67
67
  * Verify OAuth code (used in OAuth callback flow)
68
68
  * @param provider The provider of the OAuth connection
69
69
  * @param code The OAuth code
70
+ * @param scope The OAuth scope (free-busy or edit)
70
71
  * @param state The OAuth state
71
72
  * @param redirectUrl The redirect URL
72
73
  * @returns The OAuth verification result
73
74
  */
74
- verify(provider: Provider, code: string, scope: string[], state: string, redirectUrl?: string): Promise<{
75
+ verify(provider: Provider, code: string, scope: 'edit' | 'free-busy', state: string, redirectUrl?: string): Promise<{
75
76
  success: boolean;
76
77
  }>;
77
78
  }
@@ -1 +1 @@
1
- {"version":3,"file":"oauth.service.d.ts","sourceRoot":"","sources":["../../src/services/oauth.service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEtE,qBAAa,YAAY;IACT,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAE5C;;;;;OAKG;IACU,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,UAAO,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAS3F;;;;;;OAMG;IACU,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,UAAO,GAAG,OAAO,CAAC,eAAe,CAAC;IAkBzG;;;;;OAKG;IACU,YAAY,CACrB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;QACN,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAA;QAChC,KAAK,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;QAC5B,UAAU,CAAC,EAAE,S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