@veridid/calendar 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +39 -2
  3. package/build/CalendarEvents.d.mts +59 -0
  4. package/build/CalendarEvents.d.mts.map +1 -0
  5. package/build/CalendarEvents.mjs +13 -0
  6. package/build/CalendarEvents.mjs.map +1 -0
  7. package/build/CalendarModule.d.mts +17 -0
  8. package/build/CalendarModule.d.mts.map +1 -0
  9. package/build/CalendarModule.mjs +98 -0
  10. package/build/CalendarModule.mjs.map +1 -0
  11. package/build/CalendarModuleConfig.d.mts +15 -0
  12. package/build/CalendarModuleConfig.d.mts.map +1 -0
  13. package/build/CalendarModuleConfig.mjs +12 -0
  14. package/build/CalendarModuleConfig.mjs.map +1 -0
  15. package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs +10 -0
  16. package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs +7 -0
  17. package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateParam.mjs +9 -0
  18. package/build/api/CalendarApi.d.mts +132 -0
  19. package/build/api/CalendarApi.d.mts.map +1 -0
  20. package/build/api/CalendarApi.mjs +289 -0
  21. package/build/api/CalendarApi.mjs.map +1 -0
  22. package/build/index.d.mts +44 -0
  23. package/build/index.mjs +44 -0
  24. package/build/model/types.d.mts +133 -0
  25. package/build/model/types.d.mts.map +1 -0
  26. package/build/protocol/CalendarMessageTypes.d.mts +23 -0
  27. package/build/protocol/CalendarMessageTypes.d.mts.map +1 -0
  28. package/build/protocol/CalendarMessageTypes.mjs +24 -0
  29. package/build/protocol/CalendarMessageTypes.mjs.map +1 -0
  30. package/build/protocol/handlers/AcceptHandler.d.mts +14 -0
  31. package/build/protocol/handlers/AcceptHandler.d.mts.map +1 -0
  32. package/build/protocol/handlers/AcceptHandler.mjs +57 -0
  33. package/build/protocol/handlers/AcceptHandler.mjs.map +1 -0
  34. package/build/protocol/handlers/AvailabilityHandler.d.mts +14 -0
  35. package/build/protocol/handlers/AvailabilityHandler.d.mts.map +1 -0
  36. package/build/protocol/handlers/AvailabilityHandler.mjs +24 -0
  37. package/build/protocol/handlers/AvailabilityHandler.mjs.map +1 -0
  38. package/build/protocol/handlers/CancelHandler.d.mts +14 -0
  39. package/build/protocol/handlers/CancelHandler.d.mts.map +1 -0
  40. package/build/protocol/handlers/CancelHandler.mjs +60 -0
  41. package/build/protocol/handlers/CancelHandler.mjs.map +1 -0
  42. package/build/protocol/handlers/DeclineHandler.d.mts +14 -0
  43. package/build/protocol/handlers/DeclineHandler.d.mts.map +1 -0
  44. package/build/protocol/handlers/DeclineHandler.mjs +57 -0
  45. package/build/protocol/handlers/DeclineHandler.mjs.map +1 -0
  46. package/build/protocol/handlers/DelegateAcceptHandler.d.mts +14 -0
  47. package/build/protocol/handlers/DelegateAcceptHandler.d.mts.map +1 -0
  48. package/build/protocol/handlers/DelegateAcceptHandler.mjs +37 -0
  49. package/build/protocol/handlers/DelegateAcceptHandler.mjs.map +1 -0
  50. package/build/protocol/handlers/DelegateDeclineHandler.d.mts +14 -0
  51. package/build/protocol/handlers/DelegateDeclineHandler.d.mts.map +1 -0
  52. package/build/protocol/handlers/DelegateDeclineHandler.mjs +45 -0
  53. package/build/protocol/handlers/DelegateDeclineHandler.mjs.map +1 -0
  54. package/build/protocol/handlers/DelegateHandler.d.mts +14 -0
  55. package/build/protocol/handlers/DelegateHandler.d.mts.map +1 -0
  56. package/build/protocol/handlers/DelegateHandler.mjs +90 -0
  57. package/build/protocol/handlers/DelegateHandler.mjs.map +1 -0
  58. package/build/protocol/handlers/InviteHandler.d.mts +14 -0
  59. package/build/protocol/handlers/InviteHandler.d.mts.map +1 -0
  60. package/build/protocol/handlers/InviteHandler.mjs +69 -0
  61. package/build/protocol/handlers/InviteHandler.mjs.map +1 -0
  62. package/build/protocol/handlers/PollResultHandler.d.mts +14 -0
  63. package/build/protocol/handlers/PollResultHandler.d.mts.map +1 -0
  64. package/build/protocol/handlers/PollResultHandler.mjs +34 -0
  65. package/build/protocol/handlers/PollResultHandler.mjs.map +1 -0
  66. package/build/protocol/handlers/PollVoteHandler.d.mts +14 -0
  67. package/build/protocol/handlers/PollVoteHandler.d.mts.map +1 -0
  68. package/build/protocol/handlers/PollVoteHandler.mjs +54 -0
  69. package/build/protocol/handlers/PollVoteHandler.mjs.map +1 -0
  70. package/build/protocol/handlers/ProblemReportHandler.d.mts +14 -0
  71. package/build/protocol/handlers/ProblemReportHandler.d.mts.map +1 -0
  72. package/build/protocol/handlers/ProblemReportHandler.mjs +29 -0
  73. package/build/protocol/handlers/ProblemReportHandler.mjs.map +1 -0
  74. package/build/protocol/handlers/ProposeHandler.d.mts +14 -0
  75. package/build/protocol/handlers/ProposeHandler.d.mts.map +1 -0
  76. package/build/protocol/handlers/ProposeHandler.mjs +64 -0
  77. package/build/protocol/handlers/ProposeHandler.mjs.map +1 -0
  78. package/build/protocol/handlers/QueryAvailabilityHandler.d.mts +15 -0
  79. package/build/protocol/handlers/QueryAvailabilityHandler.d.mts.map +1 -0
  80. package/build/protocol/handlers/QueryAvailabilityHandler.mjs +75 -0
  81. package/build/protocol/handlers/QueryAvailabilityHandler.mjs.map +1 -0
  82. package/build/protocol/handlers/RecurrenceExceptionHandler.d.mts +14 -0
  83. package/build/protocol/handlers/RecurrenceExceptionHandler.d.mts.map +1 -0
  84. package/build/protocol/handlers/RecurrenceExceptionHandler.mjs +57 -0
  85. package/build/protocol/handlers/RecurrenceExceptionHandler.mjs.map +1 -0
  86. package/build/protocol/handlers/ReminderHandler.d.mts +14 -0
  87. package/build/protocol/handlers/ReminderHandler.d.mts.map +1 -0
  88. package/build/protocol/handlers/ReminderHandler.mjs +35 -0
  89. package/build/protocol/handlers/ReminderHandler.mjs.map +1 -0
  90. package/build/protocol/handlers/TentativeHandler.d.mts +14 -0
  91. package/build/protocol/handlers/TentativeHandler.d.mts.map +1 -0
  92. package/build/protocol/handlers/TentativeHandler.mjs +57 -0
  93. package/build/protocol/handlers/TentativeHandler.mjs.map +1 -0
  94. package/build/protocol/handlers/UpdateHandler.d.mts +14 -0
  95. package/build/protocol/handlers/UpdateHandler.d.mts.map +1 -0
  96. package/build/protocol/handlers/UpdateHandler.mjs +57 -0
  97. package/build/protocol/handlers/UpdateHandler.mjs.map +1 -0
  98. package/build/protocol/messages/AcceptMessage.d.mts +22 -0
  99. package/build/protocol/messages/AcceptMessage.d.mts.map +1 -0
  100. package/build/protocol/messages/AcceptMessage.mjs +23 -0
  101. package/build/protocol/messages/AcceptMessage.mjs.map +1 -0
  102. package/build/protocol/messages/AvailabilityMessage.d.mts +23 -0
  103. package/build/protocol/messages/AvailabilityMessage.d.mts.map +1 -0
  104. package/build/protocol/messages/AvailabilityMessage.mjs +23 -0
  105. package/build/protocol/messages/AvailabilityMessage.mjs.map +1 -0
  106. package/build/protocol/messages/CancelMessage.d.mts +24 -0
  107. package/build/protocol/messages/CancelMessage.d.mts.map +1 -0
  108. package/build/protocol/messages/CancelMessage.mjs +23 -0
  109. package/build/protocol/messages/CancelMessage.mjs.map +1 -0
  110. package/build/protocol/messages/DeclineMessage.d.mts +23 -0
  111. package/build/protocol/messages/DeclineMessage.d.mts.map +1 -0
  112. package/build/protocol/messages/DeclineMessage.mjs +23 -0
  113. package/build/protocol/messages/DeclineMessage.mjs.map +1 -0
  114. package/build/protocol/messages/DelegateAcceptMessage.d.mts +22 -0
  115. package/build/protocol/messages/DelegateAcceptMessage.d.mts.map +1 -0
  116. package/build/protocol/messages/DelegateAcceptMessage.mjs +23 -0
  117. package/build/protocol/messages/DelegateAcceptMessage.mjs.map +1 -0
  118. package/build/protocol/messages/DelegateDeclineMessage.d.mts +22 -0
  119. package/build/protocol/messages/DelegateDeclineMessage.d.mts.map +1 -0
  120. package/build/protocol/messages/DelegateDeclineMessage.mjs +23 -0
  121. package/build/protocol/messages/DelegateDeclineMessage.mjs.map +1 -0
  122. package/build/protocol/messages/DelegateMessage.d.mts +25 -0
  123. package/build/protocol/messages/DelegateMessage.d.mts.map +1 -0
  124. package/build/protocol/messages/DelegateMessage.mjs +23 -0
  125. package/build/protocol/messages/DelegateMessage.mjs.map +1 -0
  126. package/build/protocol/messages/InviteMessage.d.mts +38 -0
  127. package/build/protocol/messages/InviteMessage.d.mts.map +1 -0
  128. package/build/protocol/messages/InviteMessage.mjs +23 -0
  129. package/build/protocol/messages/InviteMessage.mjs.map +1 -0
  130. package/build/protocol/messages/PollResultMessage.d.mts +24 -0
  131. package/build/protocol/messages/PollResultMessage.d.mts.map +1 -0
  132. package/build/protocol/messages/PollResultMessage.mjs +23 -0
  133. package/build/protocol/messages/PollResultMessage.mjs.map +1 -0
  134. package/build/protocol/messages/PollVoteMessage.d.mts +21 -0
  135. package/build/protocol/messages/PollVoteMessage.d.mts.map +1 -0
  136. package/build/protocol/messages/PollVoteMessage.mjs +23 -0
  137. package/build/protocol/messages/PollVoteMessage.mjs.map +1 -0
  138. package/build/protocol/messages/ProblemReportMessage.d.mts +21 -0
  139. package/build/protocol/messages/ProblemReportMessage.d.mts.map +1 -0
  140. package/build/protocol/messages/ProblemReportMessage.mjs +23 -0
  141. package/build/protocol/messages/ProblemReportMessage.mjs.map +1 -0
  142. package/build/protocol/messages/ProposeMessage.d.mts +31 -0
  143. package/build/protocol/messages/ProposeMessage.d.mts.map +1 -0
  144. package/build/protocol/messages/ProposeMessage.mjs +23 -0
  145. package/build/protocol/messages/ProposeMessage.mjs.map +1 -0
  146. package/build/protocol/messages/QueryAvailabilityMessage.d.mts +25 -0
  147. package/build/protocol/messages/QueryAvailabilityMessage.d.mts.map +1 -0
  148. package/build/protocol/messages/QueryAvailabilityMessage.mjs +23 -0
  149. package/build/protocol/messages/QueryAvailabilityMessage.mjs.map +1 -0
  150. package/build/protocol/messages/RecurrenceExceptionMessage.d.mts +24 -0
  151. package/build/protocol/messages/RecurrenceExceptionMessage.d.mts.map +1 -0
  152. package/build/protocol/messages/RecurrenceExceptionMessage.mjs +23 -0
  153. package/build/protocol/messages/RecurrenceExceptionMessage.mjs.map +1 -0
  154. package/build/protocol/messages/ReminderMessage.d.mts +26 -0
  155. package/build/protocol/messages/ReminderMessage.d.mts.map +1 -0
  156. package/build/protocol/messages/ReminderMessage.mjs +23 -0
  157. package/build/protocol/messages/ReminderMessage.mjs.map +1 -0
  158. package/build/protocol/messages/TentativeMessage.d.mts +22 -0
  159. package/build/protocol/messages/TentativeMessage.d.mts.map +1 -0
  160. package/build/protocol/messages/TentativeMessage.mjs +23 -0
  161. package/build/protocol/messages/TentativeMessage.mjs.map +1 -0
  162. package/build/protocol/messages/UpdateMessage.d.mts +23 -0
  163. package/build/protocol/messages/UpdateMessage.d.mts.map +1 -0
  164. package/build/protocol/messages/UpdateMessage.mjs +23 -0
  165. package/build/protocol/messages/UpdateMessage.mjs.map +1 -0
  166. package/build/repository/CalendarEventRecord.d.mts +49 -0
  167. package/build/repository/CalendarEventRecord.d.mts.map +1 -0
  168. package/build/repository/CalendarEventRecord.mjs +42 -0
  169. package/build/repository/CalendarEventRecord.mjs.map +1 -0
  170. package/build/repository/CalendarEventRepository.d.mts +18 -0
  171. package/build/repository/CalendarEventRepository.d.mts.map +1 -0
  172. package/build/repository/CalendarEventRepository.mjs +63 -0
  173. package/build/repository/CalendarEventRepository.mjs.map +1 -0
  174. package/build/services/CalendarService.d.mts +222 -0
  175. package/build/services/CalendarService.d.mts.map +1 -0
  176. package/build/services/CalendarService.mjs +587 -0
  177. package/build/services/CalendarService.mjs.map +1 -0
  178. package/package.json +43 -3
@@ -0,0 +1,132 @@
1
+ import { CalendarRole, CancelScope, CounterPropose, DelegationScope, EventDescriptor, PollVoteEntry, TimeOption } from "../model/types.mjs";
2
+ import { CalendarEventRecord } from "../repository/CalendarEventRecord.mjs";
3
+ import { CalendarService } from "../services/CalendarService.mjs";
4
+ import { AgentContext } from "@credo-ts/core";
5
+
6
+ //#region src/api/CalendarApi.d.ts
7
+ declare class CalendarApi {
8
+ private readonly service;
9
+ private readonly agentContext;
10
+ constructor(service: CalendarService, agentContext: AgentContext);
11
+ propose(opts: {
12
+ title: string;
13
+ type: string;
14
+ time_options: TimeOption[];
15
+ participant_dids: string[];
16
+ connection_id: string;
17
+ organizer_did: string;
18
+ event_id?: string;
19
+ description?: unknown;
20
+ location?: unknown;
21
+ quorum?: {
22
+ min_accept: number;
23
+ deadline: string;
24
+ };
25
+ reminders?: EventDescriptor['reminders'];
26
+ recurrence?: EventDescriptor['recurrence'];
27
+ sensitivity?: EventDescriptor['sensitivity'];
28
+ call_config?: EventDescriptor['call_config'];
29
+ tags?: string[];
30
+ }): Promise<CalendarEventRecord>;
31
+ invite(opts: {
32
+ title: string;
33
+ type: string;
34
+ start: string;
35
+ end: string;
36
+ timezone: string;
37
+ participant_dids: string[];
38
+ connection_id: string;
39
+ organizer_did: string;
40
+ event_id?: string;
41
+ description?: unknown;
42
+ location?: unknown;
43
+ reminders?: EventDescriptor['reminders'];
44
+ recurrence?: EventDescriptor['recurrence'];
45
+ sensitivity?: EventDescriptor['sensitivity'];
46
+ call_config?: EventDescriptor['call_config'];
47
+ allow_delegation?: boolean;
48
+ require_signed_rsvp?: boolean;
49
+ vault_ref?: EventDescriptor['vault_ref'];
50
+ tags?: string[];
51
+ }): Promise<CalendarEventRecord>;
52
+ accept(opts: {
53
+ event_id: string;
54
+ comment?: string;
55
+ signed_rsvp?: string;
56
+ }): Promise<CalendarEventRecord>;
57
+ decline(opts: {
58
+ event_id: string;
59
+ reason?: string;
60
+ counter_propose?: CounterPropose;
61
+ }): Promise<CalendarEventRecord>;
62
+ tentative(opts: {
63
+ event_id: string;
64
+ confirm_by?: string;
65
+ comment?: string;
66
+ }): Promise<CalendarEventRecord>;
67
+ update(opts: {
68
+ event_id: string;
69
+ changes: Record<string, unknown>;
70
+ reason?: string;
71
+ require_re_rsvp?: boolean;
72
+ }): Promise<CalendarEventRecord>;
73
+ cancel(opts: {
74
+ event_id: string;
75
+ reason?: string;
76
+ cancel_scope?: CancelScope;
77
+ recurrence_id?: string;
78
+ }): Promise<CalendarEventRecord>;
79
+ queryAvailability(opts: {
80
+ connection_id: string;
81
+ range: {
82
+ start: string;
83
+ end: string;
84
+ };
85
+ timezone: string;
86
+ granularity_minutes?: number;
87
+ purpose?: string;
88
+ }): Promise<void>;
89
+ delegate(opts: {
90
+ event_id: string;
91
+ delegate_to: string;
92
+ scope: DelegationScope;
93
+ reason?: string;
94
+ jws: string;
95
+ }): Promise<CalendarEventRecord>;
96
+ sendReminder(opts: {
97
+ event_id: string;
98
+ connection_id: string;
99
+ offset_minutes: number;
100
+ action?: string;
101
+ ice_servers?: Array<{
102
+ urls: string[];
103
+ username?: string;
104
+ credential?: string;
105
+ }>;
106
+ }): Promise<void>;
107
+ handleRecurrenceException(opts: {
108
+ event_id: string;
109
+ recurrence_id: string;
110
+ action: 'modify' | 'cancel';
111
+ changes?: Record<string, unknown>;
112
+ reason?: string;
113
+ }): Promise<CalendarEventRecord>;
114
+ castPollVote(opts: {
115
+ event_id: string;
116
+ votes: PollVoteEntry[];
117
+ }): Promise<CalendarEventRecord>;
118
+ closePoll(opts: {
119
+ event_id: string;
120
+ selected_option_id: string;
121
+ }): Promise<CalendarEventRecord>;
122
+ getEvent(eventId: string): Promise<CalendarEventRecord>;
123
+ listEvents(filters?: {
124
+ role?: CalendarRole;
125
+ connectionId?: string;
126
+ }): Promise<CalendarEventRecord[]>;
127
+ getUpcomingEvents(): Promise<CalendarEventRecord[]>;
128
+ private sendToConnection;
129
+ }
130
+ //#endregion
131
+ export { CalendarApi };
132
+ //# sourceMappingURL=CalendarApi.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalendarApi.d.mts","names":[],"sources":["../../src/api/CalendarApi.ts"],"mappings":";;;;;;cA+Ba,WAAA;EAAA,iBAEQ,OAAA;EAAA,iBACA,YAAA;cADA,OAAA,EAAS,eAAA,EACT,YAAA,EAAc,YAAA;EAKpB,OAAA,CAAQ,IA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ACA,mBAAA;IACA,OAAA;EAAA,IACE,OAAA;EAgBS,QAAA,CAAS,IAAA;IACpB,QAAA;IACA,WAAA;IACA,KAAA,EAAO,eAAA;IACP,MAAA;IACA,GAAA;EAAA,IACE,OAAA,CAAQ,mBAAA;EAwBC,YAAA,CAAa,IAAA;IACxB,QAAA;IACA,aAAA;IACA,cAAA;IACA,MAAA;IACA,WAAA,GAAc,KAAA;MAAQ,IAAA;MAAgB,QAAA;MAAmB,UAAA;IAAA;EAAA,IACvD,OAAA;EAiCS,yBAAA,CAA0B,IAAA;IACrC,QAAA;IACA,aAAA;IACA,MAAA;IACA,OAAA,GAAU,MAAA;IACV,MAAA;EAAA,IACE,OAAA,CAAQ,mBAAA;EA6BC,YAAA,CAAa,IAAA;IACxB,QAAA;IACA,KAAA,EAAO,aAAA;EAAA,IACL,OAAA,CAAQ,mBAAA;EAoBC,SAAA,CAAU,IAAA;IACrB,QAAA;IACA,kBAAA;EAAA,IACE,OAAA,CAAQ,mBAAA;EAuBL,QAAA,CAAS,OAAA,WAAkB,OAAA,CAAQ,mBAAA;EAInC,UAAA,CAAW,OAAA;IAAY,IAAA,GAAO,YAAA;IAAc,YAAA;EAAA,IAA0B,OAAA,CAAQ,mBAAA;EAI9E,iBAAA,CAAA,GAAqB,OAAA,CAAQ,mBAAA;EAAA,QAMtB,gBAAA;AAAA"}
@@ -0,0 +1,289 @@
1
+ import "../repository/CalendarEventRecord.mjs";
2
+ import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs";
3
+ import { __decorate } from "../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs";
4
+ import { CalendarService } from "../services/CalendarService.mjs";
5
+ import { ProposeMessage } from "../protocol/messages/ProposeMessage.mjs";
6
+ import { InviteMessage } from "../protocol/messages/InviteMessage.mjs";
7
+ import { AcceptMessage } from "../protocol/messages/AcceptMessage.mjs";
8
+ import { DeclineMessage } from "../protocol/messages/DeclineMessage.mjs";
9
+ import { TentativeMessage } from "../protocol/messages/TentativeMessage.mjs";
10
+ import { UpdateMessage } from "../protocol/messages/UpdateMessage.mjs";
11
+ import { CancelMessage } from "../protocol/messages/CancelMessage.mjs";
12
+ import { QueryAvailabilityMessage } from "../protocol/messages/QueryAvailabilityMessage.mjs";
13
+ import { DelegateMessage } from "../protocol/messages/DelegateMessage.mjs";
14
+ import { ReminderMessage } from "../protocol/messages/ReminderMessage.mjs";
15
+ import { RecurrenceExceptionMessage } from "../protocol/messages/RecurrenceExceptionMessage.mjs";
16
+ import { PollVoteMessage } from "../protocol/messages/PollVoteMessage.mjs";
17
+ import { PollResultMessage } from "../protocol/messages/PollResultMessage.mjs";
18
+ import { AgentConfig, AgentContext, injectable } from "@credo-ts/core";
19
+ import { DidCommConnectionService, DidCommMessageSender, DidCommOutboundMessageContext, ReturnRouteTypes } from "@credo-ts/didcomm";
20
+
21
+ //#region src/api/CalendarApi.ts
22
+ var _ref, _ref2;
23
+ let CalendarApi = class CalendarApi {
24
+ constructor(service, agentContext) {
25
+ this.service = service;
26
+ this.agentContext = agentContext;
27
+ }
28
+ async propose(opts) {
29
+ const record = await this.service.createProposal(this.agentContext, opts);
30
+ await this.sendToConnection(opts.connection_id, record.eventId, (thid) => new ProposeMessage({
31
+ thid,
32
+ body: {
33
+ event_id: record.eventId,
34
+ title: opts.title,
35
+ type: opts.type,
36
+ time_options: opts.time_options,
37
+ description: opts.description,
38
+ location: opts.location,
39
+ call_config: opts.call_config,
40
+ quorum: opts.quorum,
41
+ reminders: opts.reminders,
42
+ recurrence: opts.recurrence,
43
+ sensitivity: opts.sensitivity,
44
+ tags: opts.tags
45
+ }
46
+ }));
47
+ return record;
48
+ }
49
+ async invite(opts) {
50
+ const record = await this.service.createInvite(this.agentContext, opts);
51
+ const event = record.event;
52
+ await this.sendToConnection(opts.connection_id, record.eventId, (thid) => new InviteMessage({
53
+ thid,
54
+ body: {
55
+ event_id: event.event_id,
56
+ title: event.title,
57
+ type: event.type,
58
+ start: event.start,
59
+ end: event.end,
60
+ timezone: event.timezone,
61
+ description: event.description,
62
+ location: event.location,
63
+ call_config: event.call_config,
64
+ participants: event.participants,
65
+ reminders: event.reminders,
66
+ recurrence: event.recurrence,
67
+ sequence: event.sequence,
68
+ sensitivity: event.sensitivity,
69
+ allow_delegation: event.allow_delegation,
70
+ require_signed_rsvp: event.require_signed_rsvp,
71
+ vault_ref: event.vault_ref
72
+ }
73
+ }));
74
+ return record;
75
+ }
76
+ async accept(opts) {
77
+ const record = await this.service.respond(this.agentContext, {
78
+ event_id: opts.event_id,
79
+ response: "accept",
80
+ comment: opts.comment,
81
+ signed_rsvp: opts.signed_rsvp
82
+ });
83
+ if (record.connectionId) await this.sendToConnection(record.connectionId, record.eventId, (thid) => new AcceptMessage({
84
+ thid,
85
+ body: {
86
+ event_id: opts.event_id,
87
+ sequence: record.event.sequence,
88
+ comment: opts.comment,
89
+ signed_rsvp: opts.signed_rsvp
90
+ }
91
+ }));
92
+ return record;
93
+ }
94
+ async decline(opts) {
95
+ const record = await this.service.respond(this.agentContext, {
96
+ event_id: opts.event_id,
97
+ response: "decline",
98
+ reason: opts.reason,
99
+ counter_propose: opts.counter_propose
100
+ });
101
+ if (record.connectionId) await this.sendToConnection(record.connectionId, record.eventId, (thid) => new DeclineMessage({
102
+ thid,
103
+ body: {
104
+ event_id: opts.event_id,
105
+ sequence: record.event.sequence,
106
+ reason: opts.reason,
107
+ counter_propose: opts.counter_propose
108
+ }
109
+ }));
110
+ return record;
111
+ }
112
+ async tentative(opts) {
113
+ const record = await this.service.respond(this.agentContext, {
114
+ event_id: opts.event_id,
115
+ response: "tentative",
116
+ confirm_by: opts.confirm_by
117
+ });
118
+ if (record.connectionId) await this.sendToConnection(record.connectionId, record.eventId, (thid) => new TentativeMessage({
119
+ thid,
120
+ body: {
121
+ event_id: opts.event_id,
122
+ sequence: record.event.sequence,
123
+ confirm_by: opts.confirm_by,
124
+ comment: opts.comment
125
+ }
126
+ }));
127
+ return record;
128
+ }
129
+ async update(opts) {
130
+ const record = await this.service.updateEvent(this.agentContext, opts);
131
+ if (record.connectionId) await this.sendToConnection(record.connectionId, record.eventId, (thid) => new UpdateMessage({
132
+ thid,
133
+ body: {
134
+ event_id: opts.event_id,
135
+ sequence: record.event.sequence,
136
+ changes: opts.changes,
137
+ reason: opts.reason,
138
+ require_re_rsvp: opts.require_re_rsvp
139
+ }
140
+ }));
141
+ return record;
142
+ }
143
+ async cancel(opts) {
144
+ const record = await this.service.cancelEvent(this.agentContext, opts);
145
+ if (record.connectionId) await this.sendToConnection(record.connectionId, record.eventId, (thid) => new CancelMessage({
146
+ thid,
147
+ body: {
148
+ event_id: opts.event_id,
149
+ sequence: record.event.sequence,
150
+ reason: opts.reason,
151
+ cancel_scope: opts.cancel_scope || "this",
152
+ recurrence_id: opts.recurrence_id
153
+ }
154
+ }));
155
+ return record;
156
+ }
157
+ async queryAvailability(opts) {
158
+ await this.sendToConnection(opts.connection_id, `avail-${Date.now()}`, (thid) => new QueryAvailabilityMessage({
159
+ thid,
160
+ body: {
161
+ range: opts.range,
162
+ timezone: opts.timezone,
163
+ granularity_minutes: opts.granularity_minutes ?? 30,
164
+ purpose: opts.purpose
165
+ }
166
+ }));
167
+ }
168
+ async delegate(opts) {
169
+ const { record, token } = await this.service.delegate(this.agentContext, opts);
170
+ if (record.connectionId) await this.sendToConnection(record.connectionId, record.eventId, (thid) => new DelegateMessage({
171
+ thid,
172
+ body: {
173
+ event_id: opts.event_id,
174
+ delegator: token.delegator,
175
+ delegate_to: opts.delegate_to,
176
+ scope: opts.scope,
177
+ reason: opts.reason,
178
+ delegation_token: token
179
+ }
180
+ }));
181
+ return record;
182
+ }
183
+ async sendReminder(opts) {
184
+ const record = await this.service.getEvent(this.agentContext, opts.event_id);
185
+ let callTrigger = void 0;
186
+ if (record.event.type === "call" && opts.action === "join_call") {
187
+ const baseConfig = record.event.call_config || {};
188
+ callTrigger = {
189
+ type: "https://didcomm.org/webrtc/1.0/propose",
190
+ preconfig: opts.ice_servers ? {
191
+ ...baseConfig,
192
+ ice_servers: opts.ice_servers
193
+ } : baseConfig
194
+ };
195
+ }
196
+ await this.sendToConnection(opts.connection_id, record.eventId, (thid) => new ReminderMessage({
197
+ thid,
198
+ body: {
199
+ event_id: record.eventId,
200
+ title: record.event.title,
201
+ start: record.event.start || "",
202
+ timezone: record.event.timezone || "UTC",
203
+ offset_minutes: opts.offset_minutes,
204
+ action: opts.action,
205
+ call_trigger: callTrigger
206
+ }
207
+ }));
208
+ }
209
+ async handleRecurrenceException(opts) {
210
+ const record = await this.service.getEvent(this.agentContext, opts.event_id);
211
+ const sequence = record.event.sequence + 1;
212
+ const updated = await this.service.handleRecurrenceException(this.agentContext, {
213
+ ...opts,
214
+ sequence
215
+ });
216
+ if (record.connectionId) await this.sendToConnection(record.connectionId, record.eventId, (thid) => new RecurrenceExceptionMessage({
217
+ thid,
218
+ body: {
219
+ event_id: opts.event_id,
220
+ recurrence_id: opts.recurrence_id,
221
+ action: opts.action,
222
+ changes: opts.changes,
223
+ sequence,
224
+ reason: opts.reason
225
+ }
226
+ }));
227
+ return updated;
228
+ }
229
+ async castPollVote(opts) {
230
+ const record = await this.service.castPollVote(this.agentContext, opts);
231
+ if (record.connectionId) await this.sendToConnection(record.connectionId, record.eventId, (thid) => new PollVoteMessage({
232
+ thid,
233
+ body: {
234
+ event_id: opts.event_id,
235
+ votes: opts.votes
236
+ }
237
+ }));
238
+ return record;
239
+ }
240
+ async closePoll(opts) {
241
+ const { record, tallies } = await this.service.closePoll(this.agentContext, opts);
242
+ if (record.connectionId) await this.sendToConnection(record.connectionId, record.eventId, (thid) => new PollResultMessage({
243
+ thid,
244
+ body: {
245
+ event_id: opts.event_id,
246
+ selected_option: opts.selected_option_id,
247
+ tallies,
248
+ quorum_met: true,
249
+ proceed: true
250
+ }
251
+ }));
252
+ return record;
253
+ }
254
+ getEvent(eventId) {
255
+ return this.service.getEvent(this.agentContext, eventId);
256
+ }
257
+ listEvents(filters) {
258
+ return this.service.listEvents(this.agentContext, filters);
259
+ }
260
+ getUpcomingEvents() {
261
+ return this.service.getUpcomingEvents(this.agentContext);
262
+ }
263
+ async sendToConnection(connectionId, eventId, buildMessage) {
264
+ try {
265
+ const dm = this.agentContext.dependencyManager;
266
+ const connSvc = dm.resolve(DidCommConnectionService);
267
+ const messageSender = dm.resolve(DidCommMessageSender);
268
+ const connection = await connSvc.getById(this.agentContext, connectionId);
269
+ const msg = buildMessage(eventId);
270
+ try {
271
+ msg.setReturnRouting(ReturnRouteTypes.thread, eventId);
272
+ } catch {}
273
+ const outbound = new DidCommOutboundMessageContext(msg, {
274
+ agentContext: this.agentContext,
275
+ connection
276
+ });
277
+ await messageSender.sendMessage(outbound);
278
+ } catch (e) {
279
+ try {
280
+ this.agentContext.dependencyManager.resolve(AgentConfig).logger.warn(`[CalendarApi] send failed: ${e.message}`);
281
+ } catch {}
282
+ }
283
+ }
284
+ };
285
+ CalendarApi = __decorate([injectable(), __decorateMetadata("design:paramtypes", [CalendarService, AgentContext])], CalendarApi);
286
+
287
+ //#endregion
288
+ export { CalendarApi };
289
+ //# sourceMappingURL=CalendarApi.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalendarApi.mjs","names":[],"sources":["../../src/api/CalendarApi.ts"],"sourcesContent":["import type {\n CalendarRole,\n CancelScope,\n CounterPropose,\n DelegationScope,\n EventDescriptor,\n FreeBusySlot,\n PollVoteEntry,\n TimeOption,\n} from '../model/types'\n\nimport { AgentConfig, AgentContext, injectable } from '@credo-ts/core'\nimport { DidCommConnectionService, DidCommMessageSender, DidCommOutboundMessageContext, ReturnRouteTypes } from '@credo-ts/didcomm'\n\nimport { CalendarEventRecord } from '../repository/CalendarEventRecord'\nimport { CalendarService } from '../services/CalendarService'\nimport { ProposeMessage } from '../protocol/messages/ProposeMessage'\nimport { InviteMessage } from '../protocol/messages/InviteMessage'\nimport { AcceptMessage } from '../protocol/messages/AcceptMessage'\nimport { DeclineMessage } from '../protocol/messages/DeclineMessage'\nimport { TentativeMessage } from '../protocol/messages/TentativeMessage'\nimport { UpdateMessage } from '../protocol/messages/UpdateMessage'\nimport { CancelMessage } from '../protocol/messages/CancelMessage'\nimport { QueryAvailabilityMessage } from '../protocol/messages/QueryAvailabilityMessage'\nimport { DelegateMessage } from '../protocol/messages/DelegateMessage'\nimport { ReminderMessage } from '../protocol/messages/ReminderMessage'\nimport { RecurrenceExceptionMessage } from '../protocol/messages/RecurrenceExceptionMessage'\nimport { PollVoteMessage } from '../protocol/messages/PollVoteMessage'\nimport { PollResultMessage } from '../protocol/messages/PollResultMessage'\n\n@injectable()\nexport class CalendarApi {\n public constructor(\n private readonly service: CalendarService,\n private readonly agentContext: AgentContext\n ) {}\n\n // ── Propose (organizer -> invitees) ───────────────────────────────\n\n public async propose(opts: {\n title: string\n type: string\n time_options: TimeOption[]\n participant_dids: string[]\n connection_id: string\n organizer_did: string\n event_id?: string\n description?: unknown\n location?: unknown\n quorum?: { min_accept: number; deadline: string }\n reminders?: EventDescriptor['reminders']\n recurrence?: EventDescriptor['recurrence']\n sensitivity?: EventDescriptor['sensitivity']\n call_config?: EventDescriptor['call_config']\n tags?: string[]\n }): Promise<CalendarEventRecord> {\n const record = await this.service.createProposal(this.agentContext, opts)\n\n // Send propose message to all participants\n await this.sendToConnection(opts.connection_id, record.eventId, (thid) =>\n new ProposeMessage({\n thid,\n body: {\n event_id: record.eventId,\n title: opts.title,\n type: opts.type,\n time_options: opts.time_options,\n description: opts.description as any,\n location: opts.location as any,\n call_config: opts.call_config,\n quorum: opts.quorum,\n reminders: opts.reminders,\n recurrence: opts.recurrence,\n sensitivity: opts.sensitivity,\n tags: opts.tags,\n },\n })\n )\n\n return record\n }\n\n // ── Invite (organizer -> invitees) ────────────────────────────────\n\n public async invite(opts: {\n title: string\n type: string\n start: string\n end: string\n timezone: string\n participant_dids: string[]\n connection_id: string\n organizer_did: string\n event_id?: string\n description?: unknown\n location?: unknown\n reminders?: EventDescriptor['reminders']\n recurrence?: EventDescriptor['recurrence']\n sensitivity?: EventDescriptor['sensitivity']\n call_config?: EventDescriptor['call_config']\n allow_delegation?: boolean\n require_signed_rsvp?: boolean\n vault_ref?: EventDescriptor['vault_ref']\n tags?: string[]\n }): Promise<CalendarEventRecord> {\n const record = await this.service.createInvite(this.agentContext, opts)\n const event = record.event\n\n await this.sendToConnection(opts.connection_id, record.eventId, (thid) =>\n new InviteMessage({\n thid,\n body: {\n event_id: event.event_id,\n title: event.title,\n type: event.type,\n start: event.start!,\n end: event.end!,\n timezone: event.timezone!,\n description: event.description,\n location: event.location,\n call_config: event.call_config,\n participants: event.participants,\n reminders: event.reminders,\n recurrence: event.recurrence,\n sequence: event.sequence,\n sensitivity: event.sensitivity,\n allow_delegation: event.allow_delegation,\n require_signed_rsvp: event.require_signed_rsvp,\n vault_ref: event.vault_ref,\n },\n })\n )\n\n return record\n }\n\n // ── Accept (invitee -> organizer) ─────────────────────────────────\n\n public async accept(opts: {\n event_id: string\n comment?: string\n signed_rsvp?: string\n }): Promise<CalendarEventRecord> {\n const record = await this.service.respond(this.agentContext, {\n event_id: opts.event_id,\n response: 'accept',\n comment: opts.comment,\n signed_rsvp: opts.signed_rsvp,\n })\n\n if (record.connectionId) {\n await this.sendToConnection(record.connectionId, record.eventId, (thid) =>\n new AcceptMessage({\n thid,\n body: {\n event_id: opts.event_id,\n sequence: record.event.sequence,\n comment: opts.comment,\n signed_rsvp: opts.signed_rsvp,\n },\n })\n )\n }\n\n return record\n }\n\n // ── Decline (invitee -> organizer) ────────────────────────────────\n\n public async decline(opts: {\n event_id: string\n reason?: string\n counter_propose?: CounterPropose\n }): Promise<CalendarEventRecord> {\n const record = await this.service.respond(this.agentContext, {\n event_id: opts.event_id,\n response: 'decline',\n reason: opts.reason,\n counter_propose: opts.counter_propose,\n })\n\n if (record.connectionId) {\n await this.sendToConnection(record.connectionId, record.eventId, (thid) =>\n new DeclineMessage({\n thid,\n body: {\n event_id: opts.event_id,\n sequence: record.event.sequence,\n reason: opts.reason,\n counter_propose: opts.counter_propose,\n },\n })\n )\n }\n\n return record\n }\n\n // ── Tentative (invitee -> organizer) ──────────────────────────────\n\n public async tentative(opts: {\n event_id: string\n confirm_by?: string\n comment?: string\n }): Promise<CalendarEventRecord> {\n const record = await this.service.respond(this.agentContext, {\n event_id: opts.event_id,\n response: 'tentative',\n confirm_by: opts.confirm_by,\n })\n\n if (record.connectionId) {\n await this.sendToConnection(record.connectionId, record.eventId, (thid) =>\n new TentativeMessage({\n thid,\n body: {\n event_id: opts.event_id,\n sequence: record.event.sequence,\n confirm_by: opts.confirm_by,\n comment: opts.comment,\n },\n })\n )\n }\n\n return record\n }\n\n // ── Update (organizer -> all participants) ────────────────────────\n\n public async update(opts: {\n event_id: string\n changes: Record<string, unknown>\n reason?: string\n require_re_rsvp?: boolean\n }): Promise<CalendarEventRecord> {\n const record = await this.service.updateEvent(this.agentContext, opts)\n\n if (record.connectionId) {\n await this.sendToConnection(record.connectionId, record.eventId, (thid) =>\n new UpdateMessage({\n thid,\n body: {\n event_id: opts.event_id,\n sequence: record.event.sequence,\n changes: opts.changes,\n reason: opts.reason,\n require_re_rsvp: opts.require_re_rsvp,\n },\n })\n )\n }\n\n return record\n }\n\n // ── Cancel (organizer -> all participants) ────────────────────────\n\n public async cancel(opts: {\n event_id: string\n reason?: string\n cancel_scope?: CancelScope\n recurrence_id?: string\n }): Promise<CalendarEventRecord> {\n const record = await this.service.cancelEvent(this.agentContext, opts)\n\n if (record.connectionId) {\n await this.sendToConnection(record.connectionId, record.eventId, (thid) =>\n new CancelMessage({\n thid,\n body: {\n event_id: opts.event_id,\n sequence: record.event.sequence,\n reason: opts.reason,\n cancel_scope: opts.cancel_scope || 'this',\n recurrence_id: opts.recurrence_id,\n },\n })\n )\n }\n\n return record\n }\n\n // ── Query Availability ────────────────────────────────────────────\n\n public async queryAvailability(opts: {\n connection_id: string\n range: { start: string; end: string }\n timezone: string\n granularity_minutes?: number\n purpose?: string\n }): Promise<void> {\n await this.sendToConnection(opts.connection_id, `avail-${Date.now()}`, (thid) =>\n new QueryAvailabilityMessage({\n thid,\n body: {\n range: opts.range,\n timezone: opts.timezone,\n granularity_minutes: opts.granularity_minutes ?? 30,\n purpose: opts.purpose,\n },\n })\n )\n }\n\n // ── Delegate (invitee -> organizer) ───────────────────────────────\n\n public async delegate(opts: {\n event_id: string\n delegate_to: string\n scope: DelegationScope\n reason?: string\n jws: string\n }): Promise<CalendarEventRecord> {\n const { record, token } = await this.service.delegate(this.agentContext, opts)\n\n if (record.connectionId) {\n await this.sendToConnection(record.connectionId, record.eventId, (thid) =>\n new DelegateMessage({\n thid,\n body: {\n event_id: opts.event_id,\n delegator: token.delegator,\n delegate_to: opts.delegate_to,\n scope: opts.scope,\n reason: opts.reason,\n delegation_token: token,\n },\n })\n )\n }\n\n return record\n }\n\n // ── Send Reminder (organizer/scheduler -> participants) ───────────\n\n public async sendReminder(opts: {\n event_id: string\n connection_id: string\n offset_minutes: number\n action?: string\n ice_servers?: Array<{ urls: string[]; username?: string; credential?: string }>\n }): Promise<void> {\n const record = await this.service.getEvent(this.agentContext, opts.event_id)\n\n // Build call_trigger with fresh ICE credentials if provided\n let callTrigger: any = undefined\n if (record.event.type === 'call' && opts.action === 'join_call') {\n const baseConfig = record.event.call_config || {}\n callTrigger = {\n type: 'https://didcomm.org/webrtc/1.0/propose',\n preconfig: opts.ice_servers\n ? { ...baseConfig, ice_servers: opts.ice_servers }\n : baseConfig,\n }\n }\n\n await this.sendToConnection(opts.connection_id, record.eventId, (thid) =>\n new ReminderMessage({\n thid,\n body: {\n event_id: record.eventId,\n title: record.event.title,\n start: record.event.start || '',\n timezone: record.event.timezone || 'UTC',\n offset_minutes: opts.offset_minutes,\n action: opts.action,\n call_trigger: callTrigger,\n },\n })\n )\n }\n\n // ── Recurrence Exception (organizer -> all participants) ──────────\n\n public async handleRecurrenceException(opts: {\n event_id: string\n recurrence_id: string\n action: 'modify' | 'cancel'\n changes?: Record<string, unknown>\n reason?: string\n }): Promise<CalendarEventRecord> {\n const record = await this.service.getEvent(this.agentContext, opts.event_id)\n const sequence = record.event.sequence + 1\n const updated = await this.service.handleRecurrenceException(this.agentContext, {\n ...opts,\n sequence,\n })\n\n if (record.connectionId) {\n await this.sendToConnection(record.connectionId, record.eventId, (thid) =>\n new RecurrenceExceptionMessage({\n thid,\n body: {\n event_id: opts.event_id,\n recurrence_id: opts.recurrence_id,\n action: opts.action,\n changes: opts.changes,\n sequence,\n reason: opts.reason,\n },\n })\n )\n }\n\n return updated\n }\n\n // ── Poll Vote (invitee -> organizer) ──────────────────────────────\n\n public async castPollVote(opts: {\n event_id: string\n votes: PollVoteEntry[]\n }): Promise<CalendarEventRecord> {\n const record = await this.service.castPollVote(this.agentContext, opts)\n\n if (record.connectionId) {\n await this.sendToConnection(record.connectionId, record.eventId, (thid) =>\n new PollVoteMessage({\n thid,\n body: {\n event_id: opts.event_id,\n votes: opts.votes,\n },\n })\n )\n }\n\n return record\n }\n\n // ── Close Poll (organizer -> all invitees) ────────────────────────\n\n public async closePoll(opts: {\n event_id: string\n selected_option_id: string\n }): Promise<CalendarEventRecord> {\n const { record, tallies } = await this.service.closePoll(this.agentContext, opts)\n\n if (record.connectionId) {\n await this.sendToConnection(record.connectionId, record.eventId, (thid) =>\n new PollResultMessage({\n thid,\n body: {\n event_id: opts.event_id,\n selected_option: opts.selected_option_id,\n tallies,\n quorum_met: true,\n proceed: true,\n },\n })\n )\n }\n\n return record\n }\n\n // ── Queries ───────────────────────────────────────────────────────\n\n public getEvent(eventId: string): Promise<CalendarEventRecord> {\n return this.service.getEvent(this.agentContext, eventId)\n }\n\n public listEvents(filters?: { role?: CalendarRole; connectionId?: string }): Promise<CalendarEventRecord[]> {\n return this.service.listEvents(this.agentContext, filters)\n }\n\n public getUpcomingEvents(): Promise<CalendarEventRecord[]> {\n return this.service.getUpcomingEvents(this.agentContext)\n }\n\n // ── Private: Send DIDComm message to a connection ─────────────────\n\n private async sendToConnection(\n connectionId: string,\n eventId: string,\n buildMessage: (thid: string) => any\n ): Promise<void> {\n try {\n const dm = this.agentContext.dependencyManager\n const connSvc = dm.resolve(DidCommConnectionService)\n const messageSender = dm.resolve(DidCommMessageSender)\n const connection = await connSvc.getById(this.agentContext, connectionId)\n\n const msg = buildMessage(eventId) as any\n try {\n msg.setReturnRouting(ReturnRouteTypes.thread, eventId)\n } catch {\n // ignore\n }\n\n const outbound = new DidCommOutboundMessageContext(msg, { agentContext: this.agentContext, connection })\n await messageSender.sendMessage(outbound)\n } catch (e) {\n try {\n const dm = this.agentContext.dependencyManager\n dm.resolve(AgentConfig).logger.warn(`[CalendarApi] send failed: ${(e as Error).message}`)\n } catch {\n // ignore\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+BO,wBAAM,YAAY;CACvB,AAAO,YACL,AAAiB,SACjB,AAAiB,cACjB;EAFiB;EACA;;CAKnB,MAAa,QAAQ,MAgBY;EAC/B,MAAM,SAAS,MAAM,KAAK,QAAQ,eAAe,KAAK,cAAc,KAAK;AAGzE,QAAM,KAAK,iBAAiB,KAAK,eAAe,OAAO,UAAU,SAC/D,IAAI,eAAe;GACjB;GACA,MAAM;IACJ,UAAU,OAAO;IACjB,OAAO,KAAK;IACZ,MAAM,KAAK;IACX,cAAc,KAAK;IACnB,aAAa,KAAK;IAClB,UAAU,KAAK;IACf,aAAa,KAAK;IAClB,QAAQ,KAAK;IACb,WAAW,KAAK;IAChB,YAAY,KAAK;IACjB,aAAa,KAAK;IAClB,MAAM,KAAK;IACZ;GACF,CAAC,CACH;AAED,SAAO;;CAKT,MAAa,OAAO,MAoBa;EAC/B,MAAM,SAAS,MAAM,KAAK,QAAQ,aAAa,KAAK,cAAc,KAAK;EACvE,MAAM,QAAQ,OAAO;AAErB,QAAM,KAAK,iBAAiB,KAAK,eAAe,OAAO,UAAU,SAC/D,IAAI,cAAc;GAChB;GACA,MAAM;IACJ,UAAU,MAAM;IAChB,OAAO,MAAM;IACb,MAAM,MAAM;IACZ,O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AA+B,EAAY,UAAU;WACnF;;;;0BArdb,YAAY"}
@@ -0,0 +1,44 @@
1
+ import { CalendarModuleConfig, CalendarModuleConfigOptions } from "./CalendarModuleConfig.mjs";
2
+ import { CalendarEventType, CalendarHistoryItem, CalendarRole, CallConfig, CallTrigger, CancelScope, CounterPropose, DelegationScope, DelegationToken, EventDescriptor, FreeBusySlot, InviteeState, OrganizerState, Participant, ParticipantStatus, PollPreference, PollTally, PollVoteEntry, PrivacyLevel, Quorum, RecurrenceException, RecurrenceRule, ReminderSpec, Sensitivity, SlotStatus, TimeOption, VaultOrLiteral, VaultPointer, VaultRef } from "./model/types.mjs";
3
+ import { CalendarEventRecord, CalendarEventRecordProps, DefaultCalendarEventTags } from "./repository/CalendarEventRecord.mjs";
4
+ import { CalendarEventRepository } from "./repository/CalendarEventRepository.mjs";
5
+ import { CalendarService } from "./services/CalendarService.mjs";
6
+ import { CalendarApi } from "./api/CalendarApi.mjs";
7
+ import { CALENDAR_PROTOCOL_URI, CALENDAR_ROLES, CalendarModule } from "./CalendarModule.mjs";
8
+ import { CalendarEventCancelledEvent, CalendarEventStateChangedEvent, CalendarEventTypes, CalendarInviteeStatusChangedEvent, CalendarPollCompletedEvent, CalendarReminderTriggeredEvent } from "./CalendarEvents.mjs";
9
+ import { CalendarMessageType } from "./protocol/CalendarMessageTypes.mjs";
10
+ import { ProposeMessage } from "./protocol/messages/ProposeMessage.mjs";
11
+ import { InviteMessage } from "./protocol/messages/InviteMessage.mjs";
12
+ import { AcceptMessage } from "./protocol/messages/AcceptMessage.mjs";
13
+ import { DeclineMessage } from "./protocol/messages/DeclineMessage.mjs";
14
+ import { TentativeMessage } from "./protocol/messages/TentativeMessage.mjs";
15
+ import { UpdateMessage } from "./protocol/messages/UpdateMessage.mjs";
16
+ import { CancelMessage } from "./protocol/messages/CancelMessage.mjs";
17
+ import { QueryAvailabilityMessage } from "./protocol/messages/QueryAvailabilityMessage.mjs";
18
+ import { AvailabilityMessage } from "./protocol/messages/AvailabilityMessage.mjs";
19
+ import { DelegateMessage } from "./protocol/messages/DelegateMessage.mjs";
20
+ import { DelegateAcceptMessage } from "./protocol/messages/DelegateAcceptMessage.mjs";
21
+ import { DelegateDeclineMessage } from "./protocol/messages/DelegateDeclineMessage.mjs";
22
+ import { ReminderMessage } from "./protocol/messages/ReminderMessage.mjs";
23
+ import { RecurrenceExceptionMessage } from "./protocol/messages/RecurrenceExceptionMessage.mjs";
24
+ import { PollVoteMessage } from "./protocol/messages/PollVoteMessage.mjs";
25
+ import { PollResultMessage } from "./protocol/messages/PollResultMessage.mjs";
26
+ import { ProblemReportMessage } from "./protocol/messages/ProblemReportMessage.mjs";
27
+ import { ProposeHandler } from "./protocol/handlers/ProposeHandler.mjs";
28
+ import { InviteHandler } from "./protocol/handlers/InviteHandler.mjs";
29
+ import { AcceptHandler } from "./protocol/handlers/AcceptHandler.mjs";
30
+ import { DeclineHandler } from "./protocol/handlers/DeclineHandler.mjs";
31
+ import { TentativeHandler } from "./protocol/handlers/TentativeHandler.mjs";
32
+ import { UpdateHandler } from "./protocol/handlers/UpdateHandler.mjs";
33
+ import { CancelHandler } from "./protocol/handlers/CancelHandler.mjs";
34
+ import { QueryAvailabilityHandler } from "./protocol/handlers/QueryAvailabilityHandler.mjs";
35
+ import { AvailabilityHandler } from "./protocol/handlers/AvailabilityHandler.mjs";
36
+ import { DelegateHandler } from "./protocol/handlers/DelegateHandler.mjs";
37
+ import { DelegateAcceptHandler } from "./protocol/handlers/DelegateAcceptHandler.mjs";
38
+ import { DelegateDeclineHandler } from "./protocol/handlers/DelegateDeclineHandler.mjs";
39
+ import { ReminderHandler } from "./protocol/handlers/ReminderHandler.mjs";
40
+ import { RecurrenceExceptionHandler } from "./protocol/handlers/RecurrenceExceptionHandler.mjs";
41
+ import { PollVoteHandler } from "./protocol/handlers/PollVoteHandler.mjs";
42
+ import { PollResultHandler } from "./protocol/handlers/PollResultHandler.mjs";
43
+ import { ProblemReportHandler } from "./protocol/handlers/ProblemReportHandler.mjs";
44
+ export { AcceptHandler, AcceptMessage, AvailabilityHandler, AvailabilityMessage, CALENDAR_PROTOCOL_URI, CALENDAR_ROLES, CalendarApi, CalendarEventCancelledEvent, CalendarEventRecord, CalendarEventRecordProps, CalendarEventRepository, CalendarEventStateChangedEvent, CalendarEventType, CalendarEventTypes, CalendarHistoryItem, CalendarInviteeStatusChangedEvent, CalendarMessageType, CalendarModule, CalendarModuleConfig, CalendarModuleConfigOptions, CalendarPollCompletedEvent, CalendarReminderTriggeredEvent, CalendarRole, CalendarService, CallConfig, CallTrigger, CancelHandler, CancelMessage, CancelScope, CounterPropose, DeclineHandler, DeclineMessage, DefaultCalendarEventTags, DelegateAcceptHandler, DelegateAcceptMessage, DelegateDeclineHandler, DelegateDeclineMessage, DelegateHandler, DelegateMessage, DelegationScope, DelegationToken, EventDescriptor, FreeBusySlot, InviteHandler, InviteMessage, InviteeState, OrganizerState, Participant, ParticipantStatus, PollPreference, PollResultHandler, PollResultMessage, PollTally, PollVoteEntry, PollVoteHandler, PollVoteMessage, PrivacyLevel, ProblemReportHandler, ProblemReportMessage, ProposeHandler, ProposeMessage, QueryAvailabilityHandler, QueryAvailabilityMessage, Quorum, RecurrenceException, RecurrenceExceptionHandler, RecurrenceExceptionMessage, RecurrenceRule, ReminderHandler, ReminderMessage, ReminderSpec, Sensitivity, SlotStatus, TentativeHandler, TentativeMessage, TimeOption, UpdateHandler, UpdateMessage, VaultOrLiteral, VaultPointer, VaultRef };
@@ -0,0 +1,44 @@
1
+ import { CalendarEventRecord } from "./repository/CalendarEventRecord.mjs";
2
+ import { CalendarEventTypes } from "./CalendarEvents.mjs";
3
+ import { CalendarModuleConfig } from "./CalendarModuleConfig.mjs";
4
+ import { CalendarEventRepository } from "./repository/CalendarEventRepository.mjs";
5
+ import { CalendarService } from "./services/CalendarService.mjs";
6
+ import { ProposeMessage } from "./protocol/messages/ProposeMessage.mjs";
7
+ import { InviteMessage } from "./protocol/messages/InviteMessage.mjs";
8
+ import { AcceptMessage } from "./protocol/messages/AcceptMessage.mjs";
9
+ import { DeclineMessage } from "./protocol/messages/DeclineMessage.mjs";
10
+ import { TentativeMessage } from "./protocol/messages/TentativeMessage.mjs";
11
+ import { UpdateMessage } from "./protocol/messages/UpdateMessage.mjs";
12
+ import { CancelMessage } from "./protocol/messages/CancelMessage.mjs";
13
+ import { QueryAvailabilityMessage } from "./protocol/messages/QueryAvailabilityMessage.mjs";
14
+ import { DelegateMessage } from "./protocol/messages/DelegateMessage.mjs";
15
+ import { ReminderMessage } from "./protocol/messages/ReminderMessage.mjs";
16
+ import { RecurrenceExceptionMessage } from "./protocol/messages/RecurrenceExceptionMessage.mjs";
17
+ import { PollVoteMessage } from "./protocol/messages/PollVoteMessage.mjs";
18
+ import { PollResultMessage } from "./protocol/messages/PollResultMessage.mjs";
19
+ import { CalendarApi } from "./api/CalendarApi.mjs";
20
+ import { ProblemReportMessage } from "./protocol/messages/ProblemReportMessage.mjs";
21
+ import { ProposeHandler } from "./protocol/handlers/ProposeHandler.mjs";
22
+ import { InviteHandler } from "./protocol/handlers/InviteHandler.mjs";
23
+ import { AcceptHandler } from "./protocol/handlers/AcceptHandler.mjs";
24
+ import { DeclineHandler } from "./protocol/handlers/DeclineHandler.mjs";
25
+ import { TentativeHandler } from "./protocol/handlers/TentativeHandler.mjs";
26
+ import { UpdateHandler } from "./protocol/handlers/UpdateHandler.mjs";
27
+ import { CancelHandler } from "./protocol/handlers/CancelHandler.mjs";
28
+ import { AvailabilityMessage } from "./protocol/messages/AvailabilityMessage.mjs";
29
+ import { QueryAvailabilityHandler } from "./protocol/handlers/QueryAvailabilityHandler.mjs";
30
+ import { AvailabilityHandler } from "./protocol/handlers/AvailabilityHandler.mjs";
31
+ import { DelegateAcceptMessage } from "./protocol/messages/DelegateAcceptMessage.mjs";
32
+ import { DelegateDeclineMessage } from "./protocol/messages/DelegateDeclineMessage.mjs";
33
+ import { DelegateHandler } from "./protocol/handlers/DelegateHandler.mjs";
34
+ import { DelegateAcceptHandler } from "./protocol/handlers/DelegateAcceptHandler.mjs";
35
+ import { DelegateDeclineHandler } from "./protocol/handlers/DelegateDeclineHandler.mjs";
36
+ import { ReminderHandler } from "./protocol/handlers/ReminderHandler.mjs";
37
+ import { RecurrenceExceptionHandler } from "./protocol/handlers/RecurrenceExceptionHandler.mjs";
38
+ import { PollVoteHandler } from "./protocol/handlers/PollVoteHandler.mjs";
39
+ import { PollResultHandler } from "./protocol/handlers/PollResultHandler.mjs";
40
+ import { ProblemReportHandler } from "./protocol/handlers/ProblemReportHandler.mjs";
41
+ import { CALENDAR_PROTOCOL_URI, CALENDAR_ROLES, CalendarModule } from "./CalendarModule.mjs";
42
+ import { CalendarMessageType } from "./protocol/CalendarMessageTypes.mjs";
43
+
44
+ export { AcceptHandler, AcceptMessage, AvailabilityHandler, AvailabilityMessage, CALENDAR_PROTOCOL_URI, CALENDAR_ROLES, CalendarApi, CalendarEventRecord, CalendarEventRepository, CalendarEventTypes, CalendarMessageType, CalendarModule, CalendarModuleConfig, CalendarService, CancelHandler, CancelMessage, DeclineHandler, DeclineMessage, DelegateAcceptHandler, DelegateAcceptMessage, DelegateDeclineHandler, DelegateDeclineMessage, DelegateHandler, DelegateMessage, InviteHandler, InviteMessage, PollResultHandler, PollResultMessage, PollVoteHandler, PollVoteMessage, ProblemReportHandler, ProblemReportMessage, ProposeHandler, ProposeMessage, QueryAvailabilityHandler, QueryAvailabilityMessage, RecurrenceExceptionHandler, RecurrenceExceptionMessage, ReminderHandler, ReminderMessage, TentativeHandler, TentativeMessage, UpdateHandler, UpdateMessage };