@corsair-dev/googlecalendar 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.
- package/LICENSE +191 -0
- package/dist/client.d.ts +28 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/endpoints/calendar.d.ts +3 -0
- package/dist/endpoints/calendar.d.ts.map +1 -0
- package/dist/endpoints/events.d.ts +7 -0
- package/dist/endpoints/events.d.ts.map +1 -0
- package/dist/endpoints/index.d.ts +162 -0
- package/dist/endpoints/index.d.ts.map +1 -0
- package/dist/endpoints/types.d.ts +2318 -0
- package/dist/endpoints/types.d.ts.map +1 -0
- package/dist/index.d.ts +2388 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/schema/database.d.ts +333 -0
- package/dist/schema/database.d.ts.map +1 -0
- package/dist/schema/index.d.ts +335 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/setup.d.ts +9 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/tsup.config.d.ts +3 -0
- package/dist/tsup.config.d.ts.map +1 -0
- package/dist/types.d.ts +182 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/webhooks/events.d.ts +3 -0
- package/dist/webhooks/events.d.ts.map +1 -0
- package/dist/webhooks/index.d.ts +38 -0
- package/dist/webhooks/index.d.ts.map +1 -0
- package/dist/webhooks/types.d.ts +196 -0
- package/dist/webhooks/types.d.ts.map +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CorsairWebhookMatcher } from 'corsair/core';
|
|
3
|
+
import type { Event } from '../types';
|
|
4
|
+
export declare const PubSubMessageSchema: z.ZodObject<{
|
|
5
|
+
data: z.ZodOptional<z.ZodString>;
|
|
6
|
+
attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
8
|
+
publishTime: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
data?: string | undefined;
|
|
11
|
+
attributes?: Record<string, string> | undefined;
|
|
12
|
+
messageId?: string | undefined;
|
|
13
|
+
publishTime?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
data?: string | undefined;
|
|
16
|
+
attributes?: Record<string, string> | undefined;
|
|
17
|
+
messageId?: string | undefined;
|
|
18
|
+
publishTime?: string | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
export type PubSubMessage = z.infer<typeof PubSubMessageSchema>;
|
|
21
|
+
export declare const PubSubNotificationSchema: z.ZodObject<{
|
|
22
|
+
message: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
data: z.ZodOptional<z.ZodString>;
|
|
24
|
+
attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
25
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
26
|
+
publishTime: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
data?: string | undefined;
|
|
29
|
+
attributes?: Record<string, string> | undefined;
|
|
30
|
+
messageId?: string | undefined;
|
|
31
|
+
publishTime?: string | undefined;
|
|
32
|
+
}, {
|
|
33
|
+
data?: string | undefined;
|
|
34
|
+
attributes?: Record<string, string> | undefined;
|
|
35
|
+
messageId?: string | undefined;
|
|
36
|
+
publishTime?: string | undefined;
|
|
37
|
+
}>>;
|
|
38
|
+
subscription: z.ZodOptional<z.ZodString>;
|
|
39
|
+
event: z.ZodOptional<z.ZodUnknown>;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
message?: {
|
|
42
|
+
data?: string | undefined;
|
|
43
|
+
attributes?: Record<string, string> | undefined;
|
|
44
|
+
messageId?: string | undefined;
|
|
45
|
+
publishTime?: string | undefined;
|
|
46
|
+
} | undefined;
|
|
47
|
+
event?: unknown;
|
|
48
|
+
subscription?: string | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
message?: {
|
|
51
|
+
data?: string | undefined;
|
|
52
|
+
attributes?: Record<string, string> | undefined;
|
|
53
|
+
messageId?: string | undefined;
|
|
54
|
+
publishTime?: string | undefined;
|
|
55
|
+
} | undefined;
|
|
56
|
+
event?: unknown;
|
|
57
|
+
subscription?: string | undefined;
|
|
58
|
+
}>;
|
|
59
|
+
export type PubSubNotification<TEvent = unknown> = Omit<z.infer<typeof PubSubNotificationSchema>, 'event'> & {
|
|
60
|
+
event?: TEvent;
|
|
61
|
+
};
|
|
62
|
+
export declare const GoogleCalendarPushNotificationSchema: z.ZodObject<{
|
|
63
|
+
resourceId: z.ZodOptional<z.ZodString>;
|
|
64
|
+
resourceState: z.ZodOptional<z.ZodString>;
|
|
65
|
+
resourceUri: z.ZodOptional<z.ZodString>;
|
|
66
|
+
channelId: z.ZodOptional<z.ZodString>;
|
|
67
|
+
channelExpiration: z.ZodOptional<z.ZodString>;
|
|
68
|
+
channelToken: z.ZodOptional<z.ZodString>;
|
|
69
|
+
changed: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
resourceId?: string | undefined;
|
|
72
|
+
resourceState?: string | undefined;
|
|
73
|
+
resourceUri?: string | undefined;
|
|
74
|
+
channelId?: string | undefined;
|
|
75
|
+
channelExpiration?: string | undefined;
|
|
76
|
+
channelToken?: string | undefined;
|
|
77
|
+
changed?: string | undefined;
|
|
78
|
+
}, {
|
|
79
|
+
resourceId?: string | undefined;
|
|
80
|
+
resourceState?: string | undefined;
|
|
81
|
+
resourceUri?: string | undefined;
|
|
82
|
+
channelId?: string | undefined;
|
|
83
|
+
channelExpiration?: string | undefined;
|
|
84
|
+
channelToken?: string | undefined;
|
|
85
|
+
changed?: string | undefined;
|
|
86
|
+
}>;
|
|
87
|
+
export type GoogleCalendarPushNotification = z.infer<typeof GoogleCalendarPushNotificationSchema>;
|
|
88
|
+
export declare const EventCreatedEventSchema: z.ZodObject<{
|
|
89
|
+
type: z.ZodLiteral<"eventCreated">;
|
|
90
|
+
calendarId: z.ZodString;
|
|
91
|
+
event: z.ZodType<Event, z.ZodTypeDef, Event>;
|
|
92
|
+
timestamp: z.ZodString;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
type: "eventCreated";
|
|
95
|
+
calendarId: string;
|
|
96
|
+
event: Event;
|
|
97
|
+
timestamp: string;
|
|
98
|
+
}, {
|
|
99
|
+
type: "eventCreated";
|
|
100
|
+
calendarId: string;
|
|
101
|
+
event: Event;
|
|
102
|
+
timestamp: string;
|
|
103
|
+
}>;
|
|
104
|
+
export type EventCreatedEvent = z.infer<typeof EventCreatedEventSchema>;
|
|
105
|
+
export declare const EventUpdatedEventSchema: z.ZodObject<{
|
|
106
|
+
type: z.ZodLiteral<"eventUpdated">;
|
|
107
|
+
calendarId: z.ZodString;
|
|
108
|
+
event: z.ZodType<Event, z.ZodTypeDef, Event>;
|
|
109
|
+
timestamp: z.ZodString;
|
|
110
|
+
}, "strip", z.ZodTypeAny, {
|
|
111
|
+
type: "eventUpdated";
|
|
112
|
+
calendarId: string;
|
|
113
|
+
event: Event;
|
|
114
|
+
timestamp: string;
|
|
115
|
+
}, {
|
|
116
|
+
type: "eventUpdated";
|
|
117
|
+
calendarId: string;
|
|
118
|
+
event: Event;
|
|
119
|
+
timestamp: string;
|
|
120
|
+
}>;
|
|
121
|
+
export type EventUpdatedEvent = z.infer<typeof EventUpdatedEventSchema>;
|
|
122
|
+
export declare const EventDeletedEventSchema: z.ZodObject<{
|
|
123
|
+
type: z.ZodLiteral<"eventDeleted">;
|
|
124
|
+
calendarId: z.ZodString;
|
|
125
|
+
eventId: z.ZodString;
|
|
126
|
+
timestamp: z.ZodString;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
type: "eventDeleted";
|
|
129
|
+
calendarId: string;
|
|
130
|
+
timestamp: string;
|
|
131
|
+
eventId: string;
|
|
132
|
+
}, {
|
|
133
|
+
type: "eventDeleted";
|
|
134
|
+
calendarId: string;
|
|
135
|
+
timestamp: string;
|
|
136
|
+
eventId: string;
|
|
137
|
+
}>;
|
|
138
|
+
export type EventDeletedEvent = z.infer<typeof EventDeletedEventSchema>;
|
|
139
|
+
export declare const GoogleCalendarWebhookEventSchema: z.ZodUnion<[z.ZodObject<{
|
|
140
|
+
type: z.ZodLiteral<"eventCreated">;
|
|
141
|
+
calendarId: z.ZodString;
|
|
142
|
+
event: z.ZodType<Event, z.ZodTypeDef, Event>;
|
|
143
|
+
timestamp: z.ZodString;
|
|
144
|
+
}, "strip", z.ZodTypeAny, {
|
|
145
|
+
type: "eventCreated";
|
|
146
|
+
calendarId: string;
|
|
147
|
+
event: Event;
|
|
148
|
+
timestamp: string;
|
|
149
|
+
}, {
|
|
150
|
+
type: "eventCreated";
|
|
151
|
+
calendarId: string;
|
|
152
|
+
event: Event;
|
|
153
|
+
timestamp: string;
|
|
154
|
+
}>, z.ZodObject<{
|
|
155
|
+
type: z.ZodLiteral<"eventUpdated">;
|
|
156
|
+
calendarId: z.ZodString;
|
|
157
|
+
event: z.ZodType<Event, z.ZodTypeDef, Event>;
|
|
158
|
+
timestamp: z.ZodString;
|
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
|
160
|
+
type: "eventUpdated";
|
|
161
|
+
calendarId: string;
|
|
162
|
+
event: Event;
|
|
163
|
+
timestamp: string;
|
|
164
|
+
}, {
|
|
165
|
+
type: "eventUpdated";
|
|
166
|
+
calendarId: string;
|
|
167
|
+
event: Event;
|
|
168
|
+
timestamp: string;
|
|
169
|
+
}>, z.ZodObject<{
|
|
170
|
+
type: z.ZodLiteral<"eventDeleted">;
|
|
171
|
+
calendarId: z.ZodString;
|
|
172
|
+
eventId: z.ZodString;
|
|
173
|
+
timestamp: z.ZodString;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
type: "eventDeleted";
|
|
176
|
+
calendarId: string;
|
|
177
|
+
timestamp: string;
|
|
178
|
+
eventId: string;
|
|
179
|
+
}, {
|
|
180
|
+
type: "eventDeleted";
|
|
181
|
+
calendarId: string;
|
|
182
|
+
timestamp: string;
|
|
183
|
+
eventId: string;
|
|
184
|
+
}>]>;
|
|
185
|
+
export type GoogleCalendarWebhookEvent = z.infer<typeof GoogleCalendarWebhookEventSchema>;
|
|
186
|
+
export type GoogleCalendarEventName = 'eventChanged';
|
|
187
|
+
export interface GoogleCalendarEventMap {
|
|
188
|
+
eventChanged: EventCreatedEvent | EventUpdatedEvent | EventDeletedEvent;
|
|
189
|
+
}
|
|
190
|
+
export type GoogleCalendarWebhookPayload<TEvent = unknown> = PubSubNotification<TEvent>;
|
|
191
|
+
export type GoogleCalendarWebhookOutputs = {
|
|
192
|
+
eventChanged: EventCreatedEvent | EventUpdatedEvent | EventDeletedEvent;
|
|
193
|
+
};
|
|
194
|
+
export declare function decodePubSubMessage(data: string): GoogleCalendarPushNotification;
|
|
195
|
+
export declare function createGoogleCalendarWebhookMatcher(eventType: GoogleCalendarEventName): CorsairWebhookMatcher;
|
|
196
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../webhooks/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACX,qBAAqB,EAErB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAMtC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;EAK9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAInC,CAAC;AACH,MAAM,MAAM,kBAAkB,CAAC,MAAM,GAAG,OAAO,IAAI,IAAI,CACtD,CAAC,CAAC,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,8BAA8B,CAGhC;AAED,wBAAgB,kCAAkC,CACjD,SAAS,EAAE,uBAAuB,GAChC,qBAAqB,CAoBvB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@corsair-dev/googlecalendar",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Googlecalendar plugin for Corsair",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"dev-source": "./index.ts",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"corsair": ">=0.1.0",
|
|
18
|
+
"zod": "^3.0.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"tsup": "^8.0.1",
|
|
22
|
+
"typescript": "^5.9.3",
|
|
23
|
+
"zod": "^3.25.76",
|
|
24
|
+
"corsair": "0.1.48"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"corsair",
|
|
28
|
+
"googlecalendar",
|
|
29
|
+
"plugin"
|
|
30
|
+
],
|
|
31
|
+
"author": "",
|
|
32
|
+
"license": "Apache-2.0",
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "rm -rf dist && tsc --build --force && tsup",
|
|
38
|
+
"typecheck": "tsc --noEmit"
|
|
39
|
+
}
|
|
40
|
+
}
|