@corsair-dev/gmail 0.1.0 → 0.1.2
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/dist/api.test.d.ts +2 -0
- package/dist/api.test.d.ts.map +1 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/endpoints/drafts.d.ts +1 -1
- package/dist/endpoints/drafts.d.ts.map +1 -1
- package/dist/endpoints/index.d.ts +3 -3
- package/dist/endpoints/labels.d.ts +1 -1
- package/dist/endpoints/labels.d.ts.map +1 -1
- package/dist/endpoints/messages.d.ts +1 -1
- package/dist/endpoints/messages.d.ts.map +1 -1
- package/dist/endpoints/threads.d.ts +1 -1
- package/dist/endpoints/threads.d.ts.map +1 -1
- package/dist/endpoints/types.d.ts +222 -1388
- package/dist/endpoints/types.d.ts.map +1 -1
- package/dist/index.d.ts +224 -1337
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/integration.test.d.ts +2 -0
- package/dist/integration.test.d.ts.map +1 -0
- package/dist/schema/database.d.ts +23 -83
- package/dist/schema/database.d.ts.map +1 -1
- package/dist/schema/index.d.ts +24 -94
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/webhooks/index.d.ts +12 -12
- package/dist/webhooks/messages.d.ts +1 -1
- package/dist/webhooks/messages.d.ts.map +1 -1
- package/dist/webhooks/types.d.ts +22 -134
- package/dist/webhooks/types.d.ts.map +1 -1
- package/package.json +15 -5
package/dist/webhooks/types.d.ts
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import type { CorsairWebhookMatcher } from 'corsair/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
3
|
import type { Message } from '../types';
|
|
4
4
|
export declare const PubSubMessageSchema: z.ZodObject<{
|
|
5
5
|
data: z.ZodOptional<z.ZodString>;
|
|
6
6
|
attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7
7
|
messageId: z.ZodOptional<z.ZodString>;
|
|
8
8
|
publishTime: z.ZodOptional<z.ZodString>;
|
|
9
|
-
},
|
|
10
|
-
data?: string | undefined;
|
|
11
|
-
messageId?: string | undefined;
|
|
12
|
-
attributes?: Record<string, string> | undefined;
|
|
13
|
-
publishTime?: string | undefined;
|
|
14
|
-
}, {
|
|
15
|
-
data?: string | undefined;
|
|
16
|
-
messageId?: string | undefined;
|
|
17
|
-
attributes?: Record<string, string> | undefined;
|
|
18
|
-
publishTime?: string | undefined;
|
|
19
|
-
}>;
|
|
9
|
+
}, z.core.$strip>;
|
|
20
10
|
export type PubSubMessage = z.infer<typeof PubSubMessageSchema>;
|
|
21
11
|
export declare const PubSubNotificationSchema: z.ZodObject<{
|
|
22
12
|
message: z.ZodOptional<z.ZodObject<{
|
|
@@ -24,161 +14,59 @@ export declare const PubSubNotificationSchema: z.ZodObject<{
|
|
|
24
14
|
attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
25
15
|
messageId: z.ZodOptional<z.ZodString>;
|
|
26
16
|
publishTime: z.ZodOptional<z.ZodString>;
|
|
27
|
-
},
|
|
28
|
-
data?: string | undefined;
|
|
29
|
-
messageId?: string | undefined;
|
|
30
|
-
attributes?: Record<string, string> | undefined;
|
|
31
|
-
publishTime?: string | undefined;
|
|
32
|
-
}, {
|
|
33
|
-
data?: string | undefined;
|
|
34
|
-
messageId?: string | undefined;
|
|
35
|
-
attributes?: Record<string, string> | undefined;
|
|
36
|
-
publishTime?: string | undefined;
|
|
37
|
-
}>>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
38
18
|
subscription: z.ZodOptional<z.ZodString>;
|
|
39
19
|
event: z.ZodOptional<z.ZodUnknown>;
|
|
40
|
-
},
|
|
41
|
-
message?: {
|
|
42
|
-
data?: string | undefined;
|
|
43
|
-
messageId?: string | undefined;
|
|
44
|
-
attributes?: Record<string, string> | undefined;
|
|
45
|
-
publishTime?: string | undefined;
|
|
46
|
-
} | undefined;
|
|
47
|
-
subscription?: string | undefined;
|
|
48
|
-
event?: unknown;
|
|
49
|
-
}, {
|
|
50
|
-
message?: {
|
|
51
|
-
data?: string | undefined;
|
|
52
|
-
messageId?: string | undefined;
|
|
53
|
-
attributes?: Record<string, string> | undefined;
|
|
54
|
-
publishTime?: string | undefined;
|
|
55
|
-
} | undefined;
|
|
56
|
-
subscription?: string | undefined;
|
|
57
|
-
event?: unknown;
|
|
58
|
-
}>;
|
|
20
|
+
}, z.core.$strip>;
|
|
59
21
|
export type PubSubNotification<TEvent = unknown> = Omit<z.infer<typeof PubSubNotificationSchema>, 'event'> & {
|
|
60
22
|
event?: TEvent;
|
|
61
23
|
};
|
|
62
24
|
export declare const GmailPushNotificationSchema: z.ZodObject<{
|
|
63
25
|
emailAddress: z.ZodOptional<z.ZodString>;
|
|
64
26
|
historyId: z.ZodOptional<z.ZodString>;
|
|
65
|
-
},
|
|
66
|
-
historyId?: string | undefined;
|
|
67
|
-
emailAddress?: string | undefined;
|
|
68
|
-
}, {
|
|
69
|
-
historyId?: string | undefined;
|
|
70
|
-
emailAddress?: string | undefined;
|
|
71
|
-
}>;
|
|
27
|
+
}, z.core.$strip>;
|
|
72
28
|
export type GmailPushNotification = z.infer<typeof GmailPushNotificationSchema>;
|
|
73
29
|
export declare const MessageReceivedEventSchema: z.ZodObject<{
|
|
74
30
|
type: z.ZodLiteral<"messageReceived">;
|
|
75
31
|
emailAddress: z.ZodString;
|
|
76
32
|
historyId: z.ZodString;
|
|
77
|
-
message: z.
|
|
78
|
-
},
|
|
79
|
-
message: Message;
|
|
80
|
-
type: "messageReceived";
|
|
81
|
-
historyId: string;
|
|
82
|
-
emailAddress: string;
|
|
83
|
-
}, {
|
|
84
|
-
message: Message;
|
|
85
|
-
type: "messageReceived";
|
|
86
|
-
historyId: string;
|
|
87
|
-
emailAddress: string;
|
|
88
|
-
}>;
|
|
33
|
+
message: z.ZodCustom<Message, Message>;
|
|
34
|
+
}, z.core.$strip>;
|
|
89
35
|
export type MessageReceivedEvent = z.infer<typeof MessageReceivedEventSchema>;
|
|
90
36
|
export declare const MessageDeletedEventSchema: z.ZodObject<{
|
|
91
37
|
type: z.ZodLiteral<"messageDeleted">;
|
|
92
38
|
emailAddress: z.ZodString;
|
|
93
39
|
historyId: z.ZodString;
|
|
94
|
-
message: z.
|
|
95
|
-
},
|
|
96
|
-
message: Message;
|
|
97
|
-
type: "messageDeleted";
|
|
98
|
-
historyId: string;
|
|
99
|
-
emailAddress: string;
|
|
100
|
-
}, {
|
|
101
|
-
message: Message;
|
|
102
|
-
type: "messageDeleted";
|
|
103
|
-
historyId: string;
|
|
104
|
-
emailAddress: string;
|
|
105
|
-
}>;
|
|
40
|
+
message: z.ZodCustom<Message, Message>;
|
|
41
|
+
}, z.core.$strip>;
|
|
106
42
|
export type MessageDeletedEvent = z.infer<typeof MessageDeletedEventSchema>;
|
|
107
43
|
export declare const MessageLabelChangedEventSchema: z.ZodObject<{
|
|
108
44
|
type: z.ZodLiteral<"messageLabelChanged">;
|
|
109
45
|
emailAddress: z.ZodString;
|
|
110
46
|
historyId: z.ZodString;
|
|
111
|
-
message: z.
|
|
112
|
-
labelsAdded: z.ZodOptional<z.ZodArray<z.ZodString
|
|
113
|
-
labelsRemoved: z.ZodOptional<z.ZodArray<z.ZodString
|
|
114
|
-
},
|
|
115
|
-
message: Message;
|
|
116
|
-
type: "messageLabelChanged";
|
|
117
|
-
historyId: string;
|
|
118
|
-
emailAddress: string;
|
|
119
|
-
labelsAdded?: string[] | undefined;
|
|
120
|
-
labelsRemoved?: string[] | undefined;
|
|
121
|
-
}, {
|
|
122
|
-
message: Message;
|
|
123
|
-
type: "messageLabelChanged";
|
|
124
|
-
historyId: string;
|
|
125
|
-
emailAddress: string;
|
|
126
|
-
labelsAdded?: string[] | undefined;
|
|
127
|
-
labelsRemoved?: string[] | undefined;
|
|
128
|
-
}>;
|
|
47
|
+
message: z.ZodCustom<Message, Message>;
|
|
48
|
+
labelsAdded: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
+
labelsRemoved: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
129
51
|
export type MessageLabelChangedEvent = z.infer<typeof MessageLabelChangedEventSchema>;
|
|
130
|
-
export declare const GmailWebhookEventSchema: z.ZodUnion<[z.ZodObject<{
|
|
52
|
+
export declare const GmailWebhookEventSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
131
53
|
type: z.ZodLiteral<"messageReceived">;
|
|
132
54
|
emailAddress: z.ZodString;
|
|
133
55
|
historyId: z.ZodString;
|
|
134
|
-
message: z.
|
|
135
|
-
},
|
|
136
|
-
message: Message;
|
|
137
|
-
type: "messageReceived";
|
|
138
|
-
historyId: string;
|
|
139
|
-
emailAddress: string;
|
|
140
|
-
}, {
|
|
141
|
-
message: Message;
|
|
142
|
-
type: "messageReceived";
|
|
143
|
-
historyId: string;
|
|
144
|
-
emailAddress: string;
|
|
145
|
-
}>, z.ZodObject<{
|
|
56
|
+
message: z.ZodCustom<Message, Message>;
|
|
57
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
146
58
|
type: z.ZodLiteral<"messageDeleted">;
|
|
147
59
|
emailAddress: z.ZodString;
|
|
148
60
|
historyId: z.ZodString;
|
|
149
|
-
message: z.
|
|
150
|
-
},
|
|
151
|
-
message: Message;
|
|
152
|
-
type: "messageDeleted";
|
|
153
|
-
historyId: string;
|
|
154
|
-
emailAddress: string;
|
|
155
|
-
}, {
|
|
156
|
-
message: Message;
|
|
157
|
-
type: "messageDeleted";
|
|
158
|
-
historyId: string;
|
|
159
|
-
emailAddress: string;
|
|
160
|
-
}>, z.ZodObject<{
|
|
61
|
+
message: z.ZodCustom<Message, Message>;
|
|
62
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
161
63
|
type: z.ZodLiteral<"messageLabelChanged">;
|
|
162
64
|
emailAddress: z.ZodString;
|
|
163
65
|
historyId: z.ZodString;
|
|
164
|
-
message: z.
|
|
165
|
-
labelsAdded: z.ZodOptional<z.ZodArray<z.ZodString
|
|
166
|
-
labelsRemoved: z.ZodOptional<z.ZodArray<z.ZodString
|
|
167
|
-
},
|
|
168
|
-
message: Message;
|
|
169
|
-
type: "messageLabelChanged";
|
|
170
|
-
historyId: string;
|
|
171
|
-
emailAddress: string;
|
|
172
|
-
labelsAdded?: string[] | undefined;
|
|
173
|
-
labelsRemoved?: string[] | undefined;
|
|
174
|
-
}, {
|
|
175
|
-
message: Message;
|
|
176
|
-
type: "messageLabelChanged";
|
|
177
|
-
historyId: string;
|
|
178
|
-
emailAddress: string;
|
|
179
|
-
labelsAdded?: string[] | undefined;
|
|
180
|
-
labelsRemoved?: string[] | undefined;
|
|
181
|
-
}>]>;
|
|
66
|
+
message: z.ZodCustom<Message, Message>;
|
|
67
|
+
labelsAdded: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
|
+
labelsRemoved: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
69
|
+
}, z.core.$strip>]>;
|
|
182
70
|
export type GmailWebhookEvent = z.infer<typeof GmailWebhookEventSchema>;
|
|
183
71
|
export type GmailEventName = 'messageChanged';
|
|
184
72
|
export type GmailWebhookPayload<TEvent = unknown> = PubSubNotification<TEvent>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../webhooks/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../webhooks/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAqB,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAMxC,eAAO,MAAM,mBAAmB;;;;;iBAK9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAA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BAAyB,CACxC,SAAS,EAAE,cAAc,GACvB,qBAAqB,CAcvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corsair-dev/gmail",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Gmail plugin for Corsair",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,17 +11,23 @@
|
|
|
11
11
|
"dev-source": "./index.ts",
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./types": {
|
|
16
|
+
"dev-source": "./types.ts",
|
|
17
|
+
"types": "./dist/types.d.ts"
|
|
14
18
|
}
|
|
15
19
|
},
|
|
16
20
|
"peerDependencies": {
|
|
17
21
|
"corsair": ">=0.1.0",
|
|
18
|
-
"zod": "^
|
|
22
|
+
"zod": "^4.1.13"
|
|
19
23
|
},
|
|
20
24
|
"devDependencies": {
|
|
25
|
+
"@types/jest": "^29.5.14",
|
|
26
|
+
"ts-jest": "^29.4.9",
|
|
21
27
|
"tsup": "^8.0.1",
|
|
22
28
|
"typescript": "^5.9.3",
|
|
23
|
-
"zod": "^
|
|
24
|
-
"corsair": "0.1.
|
|
29
|
+
"zod": "^4.1.13",
|
|
30
|
+
"corsair": "0.1.69"
|
|
25
31
|
},
|
|
26
32
|
"keywords": [
|
|
27
33
|
"corsair",
|
|
@@ -33,8 +39,12 @@
|
|
|
33
39
|
"files": [
|
|
34
40
|
"dist"
|
|
35
41
|
],
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"jest": "^29.7.0"
|
|
44
|
+
},
|
|
36
45
|
"scripts": {
|
|
37
46
|
"build": "rm -rf dist && tsc --build --force && tsup",
|
|
38
|
-
"typecheck": "tsc --noEmit"
|
|
47
|
+
"typecheck": "tsc --noEmit",
|
|
48
|
+
"test": "jest"
|
|
39
49
|
}
|
|
40
50
|
}
|