@squidcloud/google-calendar-client 1.0.407

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.
@@ -0,0 +1,48 @@
1
+ import { Squid } from '@squidcloud/client';
2
+ import { CalendarEvent, GetCalendarEventsRequest, UpsertCalendarEventRequest } from '../../common/src/google-calendar-types';
3
+ /**
4
+ * Client for interacting with the Google Calendar connector.
5
+ * Provides methods to save OAuth tokens and constants for OAuth setup.
6
+ */
7
+ export declare class SquidGoogleCalendarClient {
8
+ private readonly squid;
9
+ private readonly integrationId;
10
+ /**
11
+ * OAuth2 scopes required for Google Calendar integration.
12
+ * Use these when generating the OAuth authorization URL.
13
+ */
14
+ static readonly SCOPES: readonly ["openid", "email", "https://www.googleapis.com/auth/calendar.events"];
15
+ /**
16
+ * Creates a new Google Calendar client instance.
17
+ *
18
+ * @param squid - Squid client instance
19
+ * @param integrationId - The ID of the Google Calendar integration in the Squid console
20
+ */
21
+ constructor(squid: Squid, integrationId: string);
22
+ /**
23
+ * Save an OAuth authorization code and exchange it for access/refresh tokens.
24
+ * Call this after the user completes the OAuth flow and receive the auth code.
25
+ * Squid will save the access/refresh tokens for future use when requesting Calendar data from Google
26
+ *
27
+ * @param authCode - OAuth2 authorization code from Google
28
+ * @param identifier - User-specific identifier (e.g., user ID)
29
+ */
30
+ saveAuthCode(authCode: string, identifier: string): Promise<void>;
31
+ /**
32
+ * Retrieve calendar events within a specified time range.
33
+ * Returns structured event data including details like summary, description, start/end times, location, and attendees.
34
+ *
35
+ * @param request - Request parameters for retrieving calendar events
36
+ * @returns Array of calendar events with detailed information
37
+ */
38
+ getCalendarEvents(request: Omit<GetCalendarEventsRequest, 'integrationId'>): Promise<Array<CalendarEvent>>;
39
+ /**
40
+ * Upsert (create or update) a calendar event.
41
+ * If eventId is provided in the request, updates the existing event. Otherwise, creates a new event.
42
+ * Supports both timed events and all-day events.
43
+ *
44
+ * @param request - Event details and metadata
45
+ * @returns The ID of the created or updated event
46
+ */
47
+ upsertCalendarEvent(request: Omit<UpsertCalendarEventRequest, 'integrationId'>): Promise<string>;
48
+ }
@@ -0,0 +1,2 @@
1
+ export { GOOGLE_CALENDAR_SCOPES, SaveAuthCodeRequest } from '../../common/src/google-calendar-types';
2
+ export * from './google-calendar-client';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e={d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{GOOGLE_CALENDAR_SCOPES:()=>n,SquidGoogleCalendarClient:()=>i});const n=["openid","email","https://www.googleapis.com/auth/calendar.events"];class i{static{this.SCOPES=n}constructor(e,t){this.squid=e,this.integrationId=t}async saveAuthCode(e,t){const n={authCode:e,integrationId:this.integrationId,identifier:t};await this.squid.executeFunction("saveAuthCode",n)}async getCalendarEvents(e){const t={...e,integrationId:this.integrationId};return await this.squid.executeFunction("getCalendarEvents",t)}async upsertCalendarEvent(e){const t={...e,integrationId:this.integrationId};return await this.squid.executeFunction("upsertCalendarEvent",t)}}var a=exports;for(var o in t)a[o]=t[o];t.__esModule&&Object.defineProperty(a,"__esModule",{value:!0})})();
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@squidcloud/google-calendar-client",
3
+ "version": "1.0.407",
4
+ "description": "Squid Google Calendar Client",
5
+ "main": "dist/index.js",
6
+ "types": "dist/client/src/index.d.ts",
7
+ "scripts": {
8
+ "prebuild": "del-cli dist",
9
+ "build": "webpack --mode=production",
10
+ "lint": "eslint",
11
+ "publish:public": "npm run build && npm publish --access public"
12
+ },
13
+ "files": [
14
+ "dist/**/*"
15
+ ],
16
+ "keywords": [],
17
+ "author": "",
18
+ "license": "ISC",
19
+ "dependencies": {
20
+ "assertic": "^1.3.0",
21
+ "lodash": "^4.17.21",
22
+ "@squidcloud/client": "^1.0.407"
23
+ },
24
+ "engines": {
25
+ "node": ">=20.0.0"
26
+ }
27
+ }