pangea-server 3.3.157 → 3.3.158

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.
@@ -39,48 +39,66 @@ class Google {
39
39
  return (response.data.items || []).map(convertEvent);
40
40
  }
41
41
  async createEvent(options) {
42
- const response = await this.__calendar.events.insert({
43
- calendarId: 'primary',
44
- requestBody: {
45
- summary: options.title,
46
- description: options.description,
47
- location: options.location,
48
- start: { dateTime: options.start.toISOString() },
49
- end: { dateTime: options.end.toISOString() },
50
- attendees: options.attendees?.map((email) => ({ email })),
51
- conferenceData: options.meet
52
- ? {
53
- createRequest: {
54
- requestId: `meet-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`,
55
- conferenceSolutionKey: { type: 'hangoutsMeet' },
56
- },
57
- }
58
- : undefined,
59
- },
60
- conferenceDataVersion: options.meet ? 1 : undefined,
61
- });
62
- return convertEvent(response.data);
42
+ try {
43
+ const response = await this.__calendar.events.insert({
44
+ calendarId: 'primary',
45
+ requestBody: {
46
+ summary: options.title,
47
+ description: options.description,
48
+ location: options.location,
49
+ start: { dateTime: options.start.toISOString() },
50
+ end: { dateTime: options.end.toISOString() },
51
+ attendees: options.attendees?.map((email) => ({ email })),
52
+ conferenceData: options.meet
53
+ ? {
54
+ createRequest: {
55
+ requestId: `meet-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`,
56
+ conferenceSolutionKey: { type: 'hangoutsMeet' },
57
+ },
58
+ }
59
+ : undefined,
60
+ },
61
+ conferenceDataVersion: options.meet ? 1 : undefined,
62
+ });
63
+ return convertEvent(response.data);
64
+ }
65
+ catch (err) {
66
+ (0, helpers_1.printDanger)('google', err);
67
+ throw err;
68
+ }
63
69
  }
64
70
  async updateEvent(eventId, options) {
65
- const { title, description, location, start, end, attendees } = options;
66
- const requestBody = {};
67
- if (title !== undefined)
68
- requestBody.summary = title;
69
- if (description !== undefined)
70
- requestBody.description = description;
71
- if (location !== undefined)
72
- requestBody.location = location;
73
- if (start !== undefined)
74
- requestBody.start = { dateTime: start.toISOString() };
75
- if (end !== undefined)
76
- requestBody.end = { dateTime: end.toISOString() };
77
- if (attendees !== undefined)
78
- requestBody.attendees = attendees.map((email) => ({ email }));
79
- const response = await this.__calendar.events.patch({ calendarId: 'primary', eventId, requestBody });
80
- return convertEvent(response.data);
71
+ try {
72
+ const { title, description, location, start, end, attendees } = options;
73
+ const requestBody = {};
74
+ if (title !== undefined)
75
+ requestBody.summary = title;
76
+ if (description !== undefined)
77
+ requestBody.description = description;
78
+ if (location !== undefined)
79
+ requestBody.location = location;
80
+ if (start !== undefined)
81
+ requestBody.start = { dateTime: start.toISOString() };
82
+ if (end !== undefined)
83
+ requestBody.end = { dateTime: end.toISOString() };
84
+ if (attendees !== undefined)
85
+ requestBody.attendees = attendees.map((email) => ({ email }));
86
+ const response = await this.__calendar.events.patch({ calendarId: 'primary', eventId, requestBody });
87
+ return convertEvent(response.data);
88
+ }
89
+ catch (err) {
90
+ (0, helpers_1.printDanger)('google', err);
91
+ throw err;
92
+ }
81
93
  }
82
94
  async deleteEvent(eventId) {
83
- await this.__calendar.events.delete({ calendarId: 'primary', eventId });
95
+ try {
96
+ await this.__calendar.events.delete({ calendarId: 'primary', eventId });
97
+ }
98
+ catch (err) {
99
+ (0, helpers_1.printDanger)('google', err);
100
+ throw err;
101
+ }
84
102
  }
85
103
  }
86
104
  exports.Google = Google;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pangea-server",
3
3
  "description": "",
4
- "version": "3.3.157",
4
+ "version": "3.3.158",
5
5
  "engines": {
6
6
  "node": "22.14.0"
7
7
  },