recal-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/LICENSE +21 -0
  2. package/dist/entities/organization.d.ts +21 -0
  3. package/dist/entities/organization.d.ts.map +1 -0
  4. package/dist/entities/user.d.ts +23 -0
  5. package/dist/entities/user.d.ts.map +1 -0
  6. package/dist/errors.d.ts +22 -0
  7. package/dist/errors.d.ts.map +1 -0
  8. package/dist/index.d.mts +55 -0
  9. package/dist/index.d.ts +28 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +7046 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/index.mjs +99 -0
  14. package/dist/index.mjs.map +1 -0
  15. package/dist/services/calendar.service.d.ts +106 -0
  16. package/dist/services/calendar.service.d.ts.map +1 -0
  17. package/dist/services/oauth.service.d.ts +78 -0
  18. package/dist/services/oauth.service.d.ts.map +1 -0
  19. package/dist/services/organizations.service.d.ts +63 -0
  20. package/dist/services/organizations.service.d.ts.map +1 -0
  21. package/dist/services/scheduling.service.d.ts +48 -0
  22. package/dist/services/scheduling.service.d.ts.map +1 -0
  23. package/dist/services/users.service.d.ts +46 -0
  24. package/dist/services/users.service.d.ts.map +1 -0
  25. package/dist/typebox/calendar.tb.d.ts +112 -0
  26. package/dist/typebox/calendar.tb.d.ts.map +1 -0
  27. package/dist/typebox/oauth.tb.d.ts +14 -0
  28. package/dist/typebox/oauth.tb.d.ts.map +1 -0
  29. package/dist/typebox/organization.stripped.tb.d.ts +6 -0
  30. package/dist/typebox/organization.stripped.tb.d.ts.map +1 -0
  31. package/dist/typebox/organization.tb.d.ts +10 -0
  32. package/dist/typebox/organization.tb.d.ts.map +1 -0
  33. package/dist/typebox/scheduling.tb.d.ts +94 -0
  34. package/dist/typebox/scheduling.tb.d.ts.map +1 -0
  35. package/dist/typebox/timeString.tb.d.ts +3 -0
  36. package/dist/typebox/timeString.tb.d.ts.map +1 -0
  37. package/dist/typebox/user.stripped.tb.d.ts +5 -0
  38. package/dist/typebox/user.stripped.tb.d.ts.map +1 -0
  39. package/dist/typebox/user.tb.d.ts +19 -0
  40. package/dist/typebox/user.tb.d.ts.map +1 -0
  41. package/dist/typedi.d.ts +3 -0
  42. package/dist/typedi.d.ts.map +1 -0
  43. package/dist/types/calendar.types.d.mts +72 -0
  44. package/dist/types/calendar.types.d.ts +125 -0
  45. package/dist/types/calendar.types.d.ts.map +1 -0
  46. package/dist/types/calendar.types.js +56 -0
  47. package/dist/types/calendar.types.js.map +1 -0
  48. package/dist/types/calendar.types.mjs +22 -0
  49. package/dist/types/calendar.types.mjs.map +1 -0
  50. package/dist/types/entity.types.d.mts +11 -0
  51. package/dist/types/entity.types.d.ts +11 -0
  52. package/dist/types/entity.types.js +22 -0
  53. package/dist/types/entity.types.js.map +1 -0
  54. package/dist/types/entity.types.mjs +1 -0
  55. package/dist/types/entity.types.mjs.map +1 -0
  56. package/dist/types/index.d.mts +12 -0
  57. package/dist/types/index.d.ts +12 -0
  58. package/dist/types/index.js +58 -0
  59. package/dist/types/index.js.map +1 -0
  60. package/dist/types/index.mjs +22 -0
  61. package/dist/types/index.mjs.map +1 -0
  62. package/dist/types/internal.types.d.ts +7 -0
  63. package/dist/types/internal.types.d.ts.map +1 -0
  64. package/dist/types/oauth.types.d.ts +15 -0
  65. package/dist/types/oauth.types.d.ts.map +1 -0
  66. package/dist/types/scheduling.types.d.ts +48 -0
  67. package/dist/types/scheduling.types.d.ts.map +1 -0
  68. package/dist/utils/fetch.helper.d.ts +59 -0
  69. package/dist/utils/fetch.helper.d.ts.map +1 -0
  70. package/dist/utils/fetchErrorHandler.d.ts +22 -0
  71. package/dist/utils/fetchErrorHandler.d.ts.map +1 -0
  72. package/dist/utils/functionize.d.ts +5 -0
  73. package/dist/utils/functionize.d.ts.map +1 -0
  74. package/dist/utils/includes.helper.d.ts +4 -0
  75. package/dist/utils/includes.helper.d.ts.map +1 -0
  76. package/dist/utils/omit.d.ts +2 -0
  77. package/dist/utils/omit.d.ts.map +1 -0
  78. package/package.json +37 -0
@@ -0,0 +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,I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I,MAAM,+BAA+B,SAAS,MAAM,EAAE;AAClF,WAAO,SAAS,KAAK;AAAA,EACzB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,gBAAgB,MAAqC;AACvD,UAAM,WAAW,MAAM,KAAK,MAAM,kBAAkB,IAAI,EAAE;AAC1D,QAAI,CAAC,SAAS,GAAI,OAAM,IAAI,MAAM,+BAA+B,SAAS,MAAM,EAAE;AAClF,WAAO,SAAS,KAAK;AAAA,EACzB;AAAA;AAAA;AAKJ;AAGA,IAAO,gBAAQ;AAEf,IAAM,OAAO,IAAI,MAAM;AACvB,KAAK,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,QAAQ,IAAI,aAAa,CAAC;","names":["Provider","CalendarAccessRoles","AttendeeResponseStatus"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,99 @@
1
+ // src/types/calendar.types.ts
2
+ var Provider = /* @__PURE__ */ ((Provider2) => {
3
+ Provider2.GOOGLE = 'google'
4
+ Provider2.MICROSOFT = 'microsoft'
5
+ return Provider2
6
+ })(Provider || {})
7
+ var CalendarAccessRoles = /* @__PURE__ */ ((CalendarAccessRoles2) => {
8
+ CalendarAccessRoles2.FreeBusyReader = 'freeBusyReader'
9
+ CalendarAccessRoles2.Reader = 'reader'
10
+ CalendarAccessRoles2.Writer = 'writer'
11
+ CalendarAccessRoles2.Owner = 'owner'
12
+ return CalendarAccessRoles2
13
+ })(CalendarAccessRoles || {})
14
+ var AttendeeResponseStatus = /* @__PURE__ */ ((AttendeeResponseStatus2) => {
15
+ AttendeeResponseStatus2.NeedsAction = 'needsAction'
16
+ AttendeeResponseStatus2.Accepted = 'accepted'
17
+ AttendeeResponseStatus2.Tentative = 'tentative'
18
+ AttendeeResponseStatus2.Declined = 'declined'
19
+ return AttendeeResponseStatus2
20
+ })(AttendeeResponseStatus || {})
21
+
22
+ // src/index.ts
23
+ var Recal = class {
24
+ /**
25
+ * Recal SDK constructor
26
+ * @param token Recal API token
27
+ */
28
+ constructor(options) {
29
+ // MARK: Functions
30
+ /**
31
+ * Fetch function with Recal authentication
32
+ * @param input Request input
33
+ * @param init Request init
34
+ * @returns Promise<Response>
35
+ */
36
+ this._fetch = async (input, init) => {
37
+ const url = new URL(`${this.baseURL}/v1${input.startsWith('/') ? '' : '/'}${input}`)
38
+ return await fetch(url, {
39
+ method: init?.method || 'GET',
40
+ headers: {
41
+ ...init?.headers,
42
+ Authorization: `Bearer ${this.token}`,
43
+ 'Content-Type': 'application/json',
44
+ },
45
+ credentials: 'include',
46
+ mode: 'cors',
47
+ ...init,
48
+ }).catch((error) => {
49
+ throw new Error(`[Recal] Fetch error: ${error}`)
50
+ })
51
+ }
52
+ this.fetch = (input, init) => {
53
+ return this._fetch(input, init)
54
+ }
55
+ let envToken
56
+ if (!options?.token) {
57
+ const _envToken = process.env.RECAL_TOKEN
58
+ if (!_envToken)
59
+ throw new Error('[Recal] No token provided by constructor or environment variable (RECAL_TOKEN)')
60
+ envToken = _envToken
61
+ }
62
+ this.token = options?.token || envToken
63
+ this.baseURL = options?.baseURL || process.env.RECAL_BASE_URL || 'https://api.recal.dev'
64
+ }
65
+ // Organization
66
+ /**
67
+ * Get all organizations
68
+ * @returns Promise<PublicOrganization[]>
69
+ */
70
+ async listOrganizations() {
71
+ const response = await this.fetch('/organizations')
72
+ if (!response.ok) throw new Error(`[Recal] HTTP error! status: ${response.status}`)
73
+ return response.json()
74
+ }
75
+ /**
76
+ * Get organization by slug
77
+ * @param slug Organization slug
78
+ * @returns Promise<Organization>
79
+ */
80
+ async getOrganization(slug) {
81
+ const response = await this.fetch(`/organizations/${slug}`)
82
+ if (!response.ok) throw new Error(`[Recal] HTTP error! status: ${response.status}`)
83
+ return response.json()
84
+ }
85
+ // Member
86
+ // Calendar
87
+ }
88
+ var index_default = Recal
89
+ var test = new Recal()
90
+ test.listOrganizations().then((organizations) => console.log(organizations))
91
+ export { AttendeeResponseStatus, CalendarAccessRoles, Provider, Recal, index_default as default }
92
+ /**
93
+ * Recal SDK
94
+ * @description Recal SDK for Node.js
95
+ * @version 0.1.0
96
+ * @author Recal <team@recal.dev>
97
+ * @license MIT
98
+ */
99
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/calendar.types.ts","../src/index.ts"],"sourcesContent":["// 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","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"],"mappings":";AACO,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,4BA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AAM,EAAE;AAClF,WAAO,SAAS,KAAK;AAAA,EACzB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,gBAAgB,MAAqC;AACvD,UAAM,WAAW,MAAM,KAAK,MAAM,kBAAkB,IAAI,EAAE;AAC1D,QAAI,CAAC,SAAS,GAAI,OAAM,IAAI,MAAM,+BAA+B,SAAS,MAAM,EAAE;AAClF,WAAO,SAAS,KAAK;AAAA,EACzB;AAAA;AAAA;AAKJ;AAGA,IAAO,gBAAQ;AAEf,IAAM,OAAO,IAAI,MAAM;AACvB,KAAK,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,QAAQ,IAAI,aAAa,CAAC;","names":["Provider","CalendarAccessRoles","AttendeeResponseStatus"]}
@@ -0,0 +1,106 @@
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';
3
+ export declare class CalendarService {
4
+ private fetchHelper;
5
+ constructor(fetchHelper: FetchHelper);
6
+ /**
7
+ * @param userId The ID of the user
8
+ * @param minDate The start date of the free/busy period
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)
12
+ * @returns The free/busy period
13
+ */
14
+ getFreeBusy(userId: string, minDate: Date, maxDate: Date, provider?: Provider | Provider[], timeZone?: string): Promise<FreeBusy>;
15
+ /**
16
+ * @param userId The ID of the user
17
+ * @param minDate The start date of the events
18
+ * @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
+ * @returns The events
22
+ */
23
+ getEvents(userId: string, minDate: Date, maxDate: Date, provider?: Provider | Provider[], timeZone?: string): Promise<Event[]>;
24
+ /**
25
+ * @param userId The ID of the user
26
+ * @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)
29
+ * @returns The event
30
+ */
31
+ getEventByMetaId(userId: string, metaId: string, provider?: Provider | Provider[], timeZone?: string): Promise<Event>;
32
+ /**
33
+ * @param userId The ID of the user
34
+ * @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)
37
+ * @returns The created event
38
+ */
39
+ createEventByMetaId(userId: string, event: CreateEventAcrossCalendars, provider?: Provider | Provider[], timeZone?: string): Promise<Event>;
40
+ /**
41
+ * @param userId The ID of the user
42
+ * @param metaId The meta ID of the event
43
+ * @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)
46
+ * @returns The updated event
47
+ */
48
+ updateEventByMetaId(userId: string, metaId: string, event: UpdateEventAcrossCalendars, provider?: Provider | Provider[], timeZone?: string): Promise<Event>;
49
+ /**
50
+ * @param userId The ID of the user
51
+ * @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
55
+ */
56
+ deleteEventByMetaId(userId: string, metaId: string, provider?: Provider | Provider[], timeZone?: string): Promise<void>;
57
+ /**
58
+ * @param userId The ID of the user
59
+ * @param provider The provider of the calendar
60
+ * @param calendarId The ID of the calendar
61
+ * @param eventId The ID of the event
62
+ * @param timeZone The time zone of the calendar (optional)
63
+ * @returns The event
64
+ */
65
+ getEvent(userId: string, provider: Provider, calendarId: string, eventId: string, timeZone?: string): Promise<Event>;
66
+ /**
67
+ * @param userId The ID of the user
68
+ * @param provider The provider of the calendar
69
+ * @param calendarId The ID of the calendar
70
+ * @param event The event to create
71
+ * @param timeZone The time zone of the calendar (optional)
72
+ * @returns The created event
73
+ */
74
+ createEvent(userId: string, provider: Provider, calendarId: string, event: CreateEvent, timeZone?: string): Promise<Event>;
75
+ /**
76
+ * @param userId The ID of the user
77
+ * @param provider The provider of the calendar
78
+ * @param calendarId The ID of the calendar
79
+ * @param eventId The ID of the event
80
+ * @param event The updated event
81
+ * @param timeZone The time zone of the calendar (optional)
82
+ * @returns The updated event
83
+ */
84
+ updateEvent(userId: string, provider: Provider, calendarId: string, eventId: string, event: UpdateEvent, timeZone?: string): Promise<Event>;
85
+ /**
86
+ * @param userId The ID of the user
87
+ * @param provider The provider of the calendar
88
+ * @param calendarId The ID of the calendar
89
+ * @param eventId The ID of the event
90
+ * @param timeZone The time zone of the calendar (optional)
91
+ * @returns The deleted event
92
+ */
93
+ deleteEvent(userId: string, provider: Provider, calendarId: string, eventId: string, timeZone?: string): Promise<void>;
94
+ /**
95
+ * Get the org-wide free/busy period
96
+ * @param slug The slug of the organization
97
+ * @param minDate The minimum date
98
+ * @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
102
+ * @returns The org-wide free/busy period
103
+ */
104
+ getOrgWideFreeBusy(slug: string, minDate: Date, maxDate: Date, primaryOnly?: boolean, provider?: Provider | Provider[], timeZone?: string): Promise<TimeRange[]>;
105
+ }
106
+ //# sourceMappingURL=calendar.service.d.ts.map
@@ -0,0 +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;IACZ,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAM5C;;;;;;;OAOG;IACU,WAAW,CACpB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,EACb,QAAQ,C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EAClB,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,KAAK,CAAC;IAoBjB;;;;;;;OAOG;IACU,WAAW,CACpB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,WAAW,EAClB,QAAQ,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,KAAK,CAAC;IAoBjB;;;;;;;;OAQG;IACU,WAAW,CACpB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,WAAW,EAClB,QAAQ,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,KAAK,CAAC;IAoBjB;;;;;;;OAOG;IACU,WAAW,CACpB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAuBhB;;;;;;;;;OASG;IACU,kBAAkB,CAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,EACb,WAAW,CAAC,EAAE,OAAO,EACrB,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,EAChC,QAAQ,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,SAAS,EAAE,CAAC;CAiB1B"}
@@ -0,0 +1,78 @@
1
+ import type { Provider } from '../types/calendar.types';
2
+ import type { OAuthConnection, OAuthLink } from '../types/oauth.types';
3
+ import { type FetchHelper } from '../utils/fetch.helper';
4
+ export declare class OAuthService {
5
+ private fetchHelper;
6
+ constructor(fetchHelper: FetchHelper);
7
+ /**
8
+ * Get all OAuth connections for a user
9
+ * @param userId The ID of the user
10
+ * @param redacted Whether to redact the OAuth connections
11
+ * @returns An array of OAuth connections
12
+ */
13
+ getAllConnections(userId: string, redacted?: boolean): Promise<OAuthConnection[]>;
14
+ /**
15
+ * Get OAuth connection for a specific provider
16
+ * @param userId The ID of the user
17
+ * @param provider The provider of the OAuth connection
18
+ * @param redacted Whether to redact the OAuth connection
19
+ * @returns The OAuth connection
20
+ */
21
+ getConnection(userId: string, provider: Provider, redacted?: boolean): Promise<OAuthConnection>;
22
+ /**
23
+ * Get OAuth authorization URLs for all providers
24
+ * @param userId The ID of the user
25
+ * @param options Options for the OAuth authorization URLs
26
+ * @returns An array of OAuth authorization URLs
27
+ */
28
+ getBulkLinks(userId: string, options?: {
29
+ provider?: Provider | Provider[];
30
+ scope?: 'edit' | 'free-busy';
31
+ accessType?: 'offline' | 'online';
32
+ }): Promise<OAuthLink[]>;
33
+ /**
34
+ * Get OAuth authorization URL for a specific provider
35
+ * @param userId The ID of the user
36
+ * @param provider The provider of the OAuth connection
37
+ * @param options Options for the OAuth authorization URL
38
+ * @returns The OAuth authorization URL
39
+ */
40
+ getLink(userId: string, provider: Provider, options?: {
41
+ scope?: 'edit' | 'free-busy';
42
+ accessType?: 'offline' | 'online';
43
+ redirectUrl?: string;
44
+ }): Promise<OAuthLink>;
45
+ /**
46
+ * Set OAuth tokens for a provider
47
+ * @param userId The ID of the user
48
+ * @param provider The provider of the OAuth connection
49
+ * @param connection The OAuth connection to set
50
+ * @returns The OAuth connection
51
+ */
52
+ setConnection(userId: string, provider: Provider, connection: {
53
+ accessToken: string;
54
+ refreshToken?: string;
55
+ scope: string[];
56
+ expiresAt?: Date | string | number;
57
+ email?: string;
58
+ }): Promise<OAuthConnection>;
59
+ /**
60
+ * Delete OAuth connection for a provider
61
+ * @param userId The ID of the user
62
+ * @param provider The provider of the OAuth connection
63
+ * @returns Promise that resolves when the connection is deleted
64
+ */
65
+ disconnect(userId: string, provider: Provider): Promise<void>;
66
+ /**
67
+ * Verify OAuth code (used in OAuth callback flow)
68
+ * @param provider The provider of the OAuth connection
69
+ * @param code The OAuth code
70
+ * @param state The OAuth state
71
+ * @param redirectUrl The redirect URL
72
+ * @returns The OAuth verification result
73
+ */
74
+ verify(provider: Provider, code: string, scope: string[], state: string, redirectUrl?: string): Promise<{
75
+ success: boolean;
76
+ }>;
77
+ }
78
+ //# sourceMappingURL=oauth.service.d.ts.map
@@ -0,0 +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,SAAS,GAAG,QAAQ,CAAA;KACpC,GACF,OAAO,CAAC,SAAS,EAAE,CAAC;IAavB;;;;;;OAMG;IACU,OAAO,CAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;QAC5B,UAAU,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;QACjC,WAAW,CAAC,EAAE,MAAM,CAAA;KACvB,GACF,OAAO,CAAC,SAAS,CAAC;IAuBrB;;;;;;OAMG;IACU,aAAa,CACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE;QACR,WAAW,EAAE,MAAM,CAAA;QACnB,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,KAAK,EAAE,MAAM,EAAE,CAAA;QACf,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;QAClC,KAAK,CAAC,EAAE,MAAM,CAAA;KACjB,GACF,OAAO,CAAC,eAAe,CAAC;IAkB3B;;;;;OAKG;IACU,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB1E;;;;;;;OAOG;IACU,MAAM,CACf,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EAAE,EACf,KAAK,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CA2BnC"}
@@ -0,0 +1,63 @@
1
+ import { User } from 'src/entities/user';
2
+ import { Organization } from '../entities/organization';
3
+ import { type FetchHelper } from '../utils/fetch.helper';
4
+ export declare class OrganizationsService {
5
+ private fetchHelper;
6
+ constructor(fetchHelper: FetchHelper);
7
+ /**
8
+ * List all organizations
9
+ * @returns An array of organizations
10
+ */
11
+ listAll(): Promise<Organization[]>;
12
+ listAllFromUser(userId: string): Promise<Organization[] | null>;
13
+ /**
14
+ * Get an organization by slug
15
+ * @param slug The slug of the organization
16
+ * @returns The organization
17
+ */
18
+ get(slug: string): Promise<Organization>;
19
+ /**
20
+ * Create an organization
21
+ * @param slug The slug of the organization
22
+ * @param name The name of the organization
23
+ * @returns The created organization
24
+ */
25
+ create(slug: string, name: string): Promise<Organization>;
26
+ /**
27
+ * Update an organization
28
+ * @param slug The slug of the organization
29
+ * @param updatedOrganizationData The updated organization data
30
+ * @returns The updated organization
31
+ */
32
+ update(slug: string, updatedOrganizationData: {
33
+ slug: string;
34
+ name: string;
35
+ }): Promise<Organization>;
36
+ /**
37
+ * Delete an organization
38
+ * @param slug The slug of the organization
39
+ * @returns The deleted organization
40
+ */
41
+ delete(slug: string): Promise<Organization>;
42
+ /**
43
+ * Get the members of an organization
44
+ * @param slug The slug of the organization
45
+ * @returns The members of the organization
46
+ */
47
+ getMembers(slug: string): Promise<User[]>;
48
+ /**
49
+ * Add members to an organization
50
+ * @param slug The slug of the organization
51
+ * @param userIds The IDs of the users to add
52
+ * @returns The added users
53
+ */
54
+ addMembers(slug: string, userIds: string[]): Promise<unknown>;
55
+ /**
56
+ * Remove members from an organization
57
+ * @param slug The slug of the organization
58
+ * @param userIds The IDs of the users to remove
59
+ * @returns Success message
60
+ */
61
+ removeMembers(slug: string, userIds: string[]): Promise<string>;
62
+ }
63
+ //# sourceMappingURL=organizations.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organizations.service.d.ts","sourceRoot":"","sources":["../../src/services/organizations.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGvD,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEtE,qBAAa,oBAAoB;IACjB,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAE5C;;;OAGG;IACU,OAAO,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAQlC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC;IAS5E;;;;OAIG;IACU,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IASrD;;;;;OAKG;IACU,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAUtE;;;;;OAKG;IACU,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,uBAAuB,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IAejH;;;;OAIG;IACU,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IASxD;;;;OAIG;IACU,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAStD;;;;;OAKG;IACU,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;IAQvD;;;;;OAKG;IACU,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;CAQ/E"}
@@ -0,0 +1,48 @@
1
+ import type { AdvancedSchedulingResponse, OrgSchedulingParams, Schedule, SchedulingResponse, SubOrgSchedulingResponse, UserSchedulingAdvancedParams, UserSchedulingBasicParams } from 'src/types/scheduling.types';
2
+ import { type FetchHelper } from 'src/utils/fetch.helper';
3
+ export declare class SchedulingService {
4
+ private fetchHelper;
5
+ constructor(fetchHelper: FetchHelper);
6
+ /**
7
+ * Get available time slots based on free-busy data with basic parameters
8
+ * @param userId The ID of the user
9
+ * @param provider The provider(s) of the calendar (optional, can be array)
10
+ * @param padding The padding for the time slots
11
+ * @param slotDuration The duration of each slot
12
+ * @param startDate The start date
13
+ * @param endDate The end date
14
+ * @param earliestTimeEachDay The earliest time each day
15
+ * @param latestTimeEachDay The latest time each day
16
+ * @param timeZone The time zone for the request
17
+ * @returns Available time slots with basic scheduling options
18
+ */
19
+ userSchedulingBasic(userId: string, startDate: Date, endDate: Date, options: UserSchedulingBasicParams): Promise<SchedulingResponse>;
20
+ /**
21
+ * Get available time slots based on free-busy data with advanced parameters
22
+ * @param userId The ID of the user
23
+ * @param schedules The schedules of the user
24
+ * @param provider The provider(s) of the calendar (optional, can be array)
25
+ * @param padding The padding for the time slots
26
+ * @param slotDuration The duration of each slot
27
+ * @param startDate The start date
28
+ * @param endDate The end date
29
+ * @param timeZone The time zone for the request
30
+ * @returns Available time slots with advanced scheduling options
31
+ */
32
+ userSchedulingAdvanced(userId: string, schedules: Schedule[], startDate: Date, endDate: Date, options: UserSchedulingAdvancedParams): Promise<AdvancedSchedulingResponse>;
33
+ /**
34
+ * Get available time slots based on free-busy data for an organization
35
+ * @param orgSlug The slug of the organization
36
+ * @param provider The provider(s) of the calendar (optional, can be array)
37
+ * @param padding The padding for the time slots
38
+ * @param slotDuration The duration of each slot
39
+ * @param startDate The start date
40
+ * @param endDate The end date
41
+ * @param earliestTimeEachDay The earliest time each day
42
+ * @param latestTimeEachDay The latest time each day
43
+ * @param timeZone The time zone for the request
44
+ * @returns Available time slots with basic scheduling options
45
+ */
46
+ getOrgWideAvailability(orgSlug: string, startDate: Date, endDate: Date, options: OrgSchedulingParams): Promise<SubOrgSchedulingResponse>;
47
+ }
48
+ //# sourceMappingURL=scheduling.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduling.service.d.ts","sourceRoot":"","sources":["../../src/services/scheduling.service.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACR,0BAA0B,EAC1B,mBAAmB,EACnB,QAAQ,EACR,kBAAkB,EAClB,wBAAwB,EACxB,4BAA4B,EAC5B,yBAAyB,EAC5B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAIvE,qBAAa,iBAAiB;IACd,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAE5C;;;;;;;;;;;;OAYG;IACU,mBAAmB,CAC5B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,yBAAyB,GACnC,OAAO,CAAC,kBAAkB,CAAC;IA0B9B;;;;;;;;;;;OAWG;IACU,sBAAsB,CAC/B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EAAE,EACrB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,4BAA4B,GACtC,OAAO,CAAC,0BAA0B,CAAC;IA2BtC;;;;;;;;;;;;OAYG;IACU,sBAAsB,CAC/B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,mBAAmB,GAC7B,OAAO,CAAC,wBAAwB,CAAC;CAkCvC"}
@@ -0,0 +1,46 @@
1
+ import { User } from '../entities/user';
2
+ import { type FetchHelper } from '../utils/fetch.helper';
3
+ interface UserOptions {
4
+ includeOrgs?: boolean;
5
+ includeOAuth?: boolean;
6
+ }
7
+ export declare class UsersService {
8
+ private fetchHelper;
9
+ constructor(fetchHelper: FetchHelper);
10
+ /**
11
+ * List all users
12
+ * @returns An array of users
13
+ */
14
+ listAll(): Promise<User[]>;
15
+ /**
16
+ * Get a user by ID
17
+ * @param id The ID of the user
18
+ * @param options Options for the user
19
+ * @returns The user
20
+ */
21
+ get(id: string, { includeOrgs, includeOAuth }: UserOptions): Promise<User | null>;
22
+ /**
23
+ * Create a new user
24
+ * @param id The ID of the user
25
+ * @param organizationSlugs The slugs of the organizations the user is a member of
26
+ * @returns The new user
27
+ */
28
+ create(id: string, organizationSlugs?: string[]): Promise<User>;
29
+ /**
30
+ * Update a user
31
+ * @param id The ID of the user
32
+ * @param updatedUserData The updated user data
33
+ * @returns The updated user
34
+ */
35
+ update(id: string, updatedUserData: {
36
+ id: string;
37
+ }): Promise<User | null>;
38
+ /**
39
+ * Delete a user
40
+ * @param id The ID of the user
41
+ * @returns The deleted user
42
+ */
43
+ delete(id: string): Promise<User>;
44
+ }
45
+ export {};
46
+ //# sourceMappingURL=users.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users.service.d.ts","sourceRoot":"","sources":["../../src/services/users.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAEvC,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEtE,UAAU,WAAW;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,qBAAa,YAAY;IACT,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAE5C;;;OAGG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAMvC;;;;;OAKG;IACU,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,WAAmB,EAAE,YAAoB,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAe9G;;;;;OAKG;IACU,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAe5E;;;;;OAKG;IACU,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAiBtF;;;;OAIG;IACU,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAQjD"}
@@ -0,0 +1,112 @@
1
+ import { AttendeeResponseStatus, Provider } from '../types/calendar.types';
2
+ export declare const providerSchema: import("@sinclair/typebox").TEnum<typeof Provider>;
3
+ export declare const attendeeResponseStatusSchema: import("@sinclair/typebox").TEnum<typeof AttendeeResponseStatus>;
4
+ export declare const calendarSchema: import("@sinclair/typebox").TObject<{
5
+ id: import("@sinclair/typebox").TString;
6
+ timeZone: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
7
+ subject: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
8
+ backgroundColor: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
9
+ foregroundColor: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
10
+ selected: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
11
+ accessRole: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
12
+ original: import("@sinclair/typebox").TAny;
13
+ }>;
14
+ export declare const meetingSchema: import("@sinclair/typebox").TObject<{
15
+ url: import("@sinclair/typebox").TString;
16
+ }>;
17
+ export declare const attendeeSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
18
+ email: import("@sinclair/typebox").TString;
19
+ responseStatus: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof AttendeeResponseStatus>>;
20
+ }>, import("@sinclair/typebox").TObject<{
21
+ email: import("@sinclair/typebox").TString;
22
+ self: import("@sinclair/typebox").TBoolean;
23
+ }>]>;
24
+ export declare const createAttendeeSchema: import("@sinclair/typebox").TObject<{
25
+ email: import("@sinclair/typebox").TString;
26
+ }>;
27
+ export declare const eventSchema: import("@sinclair/typebox").TObject<{
28
+ id: import("@sinclair/typebox").TString;
29
+ metaId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
30
+ subject: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
31
+ description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
32
+ start: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
33
+ end: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
34
+ location: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
35
+ attendees: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
36
+ email: import("@sinclair/typebox").TString;
37
+ responseStatus: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof AttendeeResponseStatus>>;
38
+ }>, import("@sinclair/typebox").TObject<{
39
+ email: import("@sinclair/typebox").TString;
40
+ self: import("@sinclair/typebox").TBoolean;
41
+ }>]>>;
42
+ original: import("@sinclair/typebox").TAny;
43
+ }>;
44
+ export declare const createEventSchema: import("@sinclair/typebox").TObject<{
45
+ metaId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
46
+ subject: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
47
+ description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
48
+ start: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
49
+ end: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
50
+ location: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
51
+ attendees: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
52
+ email: import("@sinclair/typebox").TString;
53
+ }>>>;
54
+ sendNotifications: import("@sinclair/typebox").TBoolean;
55
+ meeting: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TObject<{
56
+ url: import("@sinclair/typebox").TString;
57
+ }>]>>;
58
+ }>;
59
+ export declare const createEventAcrossCalendarsSchema: import("@sinclair/typebox").TObject<{
60
+ id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
61
+ subject: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
62
+ description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
63
+ start: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
64
+ end: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
65
+ location: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
66
+ attendees: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
67
+ email: import("@sinclair/typebox").TString;
68
+ }>>>;
69
+ sendNotificationsFor: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TEnum<typeof Provider>>>;
70
+ meeting: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TObject<{
71
+ url: import("@sinclair/typebox").TString;
72
+ }>]>>;
73
+ }>;
74
+ export declare const updateEventSchema: import("@sinclair/typebox").TObject<{
75
+ id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
76
+ subject: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
77
+ description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
78
+ start: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
79
+ end: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
80
+ location: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
81
+ attendees: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
82
+ email: import("@sinclair/typebox").TString;
83
+ }>>>;
84
+ sendNotifications: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
85
+ meeting: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TObject<{
86
+ url: import("@sinclair/typebox").TString;
87
+ }>]>>;
88
+ }>;
89
+ export declare const updateEventAcrossCalendarsSchema: import("@sinclair/typebox").TObject<{
90
+ metaId: import("@sinclair/typebox").TString;
91
+ subject: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
92
+ description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
93
+ start: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
94
+ end: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
95
+ location: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
96
+ attendees: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
97
+ email: import("@sinclair/typebox").TString;
98
+ }>>>;
99
+ sendNotificationsFor: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TEnum<typeof Provider>>>;
100
+ meeting: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TObject<{
101
+ url: import("@sinclair/typebox").TString;
102
+ }>]>>;
103
+ }>;
104
+ export declare const timeRangeSchema: import("@sinclair/typebox").TObject<{
105
+ start: import("@sinclair/typebox").TDate;
106
+ end: import("@sinclair/typebox").TDate;
107
+ }>;
108
+ export declare const freeBusySchema: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
109
+ start: import("@sinclair/typebox").TDate;
110
+ end: import("@sinclair/typebox").TDate;
111
+ }>>;
112
+ //# sourceMappingURL=calendar.tb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.tb.d.ts","sourceRoot":"","sources":["../../src/typebox/calendar.tb.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAE1E,eAAO,MAAM,cAAc,oDAAmB,CAAA;AAE9C,eAAO,MAAM,4BAA4B,kEAAiC,CAAA;AAE1E,eAAO,MAAM,cAAc;;;;;;;;;EASzB,CAAA;AAEF,eAAO,MAAM,aAAa;;EAExB,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;IASzB,CAAA;AAEF,eAAO,MAAM,oBAAoB;;EAE/B,CAAA;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;EAUtB,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;EAU5B,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;EAU3C,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;EAU5B,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;EAU3C,CAAA;AAEF,eAAO,MAAM,eAAe;;;EAG1B,CAAA;AAEF,eAAO,MAAM,cAAc;;;GAA2B,CAAA"}
@@ -0,0 +1,14 @@
1
+ export declare const oauthConnectionSchema: import("@sinclair/typebox").TObject<{
2
+ expiresAt: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TDate, import("@sinclair/typebox").TNull]>;
3
+ provider: import("@sinclair/typebox").TEnum<typeof import("../types/calendar.types").Provider>;
4
+ accessToken: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
5
+ refreshToken: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
6
+ email: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
7
+ scope: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
8
+ alive: import("@sinclair/typebox").TBoolean;
9
+ }>;
10
+ export declare const oauthLinkSchema: import("@sinclair/typebox").TObject<{
11
+ provider: import("@sinclair/typebox").TEnum<typeof import("../types/calendar.types").Provider>;
12
+ url: import("@sinclair/typebox").TString;
13
+ }>;
14
+ //# sourceMappingURL=oauth.tb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.tb.d.ts","sourceRoot":"","sources":["../../src/typebox/oauth.tb.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB;;;;;;;;EAQhC,CAAA;AAEF,eAAO,MAAM,eAAe;;;EAG1B,CAAA"}