@waterlock/gateway 0.0.0-stage → 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 +21 -0
- package/README.md +15 -2
- package/dist/checks/index.d.ts +35 -0
- package/dist/checks/index.js +47 -0
- package/dist/codegen/cli.d.ts +2 -0
- package/dist/codegen/cli.js +60 -0
- package/dist/codegen/config.d.ts +19 -0
- package/dist/codegen/config.js +1 -0
- package/dist/codegen/discovery.d.ts +42 -0
- package/dist/codegen/discovery.js +78 -0
- package/dist/codegen/generate.d.ts +9 -0
- package/dist/codegen/generate.js +77 -0
- package/dist/codegen/index.d.ts +5 -0
- package/dist/codegen/index.js +4 -0
- package/dist/codegen/model.d.ts +21 -0
- package/dist/codegen/model.js +1 -0
- package/dist/codegen/openapi.d.ts +33 -0
- package/dist/codegen/openapi.js +73 -0
- package/dist/core/credentials.d.ts +24 -0
- package/dist/core/credentials.js +41 -0
- package/dist/core/evaluate.d.ts +41 -0
- package/dist/core/evaluate.js +99 -0
- package/dist/core/gateway.d.ts +21 -0
- package/dist/core/gateway.js +152 -0
- package/dist/core/match.d.ts +16 -0
- package/dist/core/match.js +97 -0
- package/dist/core/policy.d.ts +42 -0
- package/dist/core/policy.js +10 -0
- package/dist/core/provider.d.ts +50 -0
- package/dist/core/provider.js +20 -0
- package/dist/core/session.d.ts +59 -0
- package/dist/core/session.js +66 -0
- package/dist/core/store.d.ts +44 -0
- package/dist/core/store.js +18 -0
- package/dist/core/types.d.ts +40 -0
- package/dist/core/types.js +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +8 -0
- package/dist/providers/gmail/decode.d.ts +38 -0
- package/dist/providers/gmail/decode.js +85 -0
- package/dist/providers/gmail/generated.d.ts +323 -0
- package/dist/providers/gmail/generated.js +113 -0
- package/dist/providers/gmail/gmail.config.d.ts +5 -0
- package/dist/providers/gmail/gmail.config.js +16 -0
- package/dist/providers/gmail/index.d.ts +23 -0
- package/dist/providers/gmail/index.js +21 -0
- package/package.json +67 -3
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// GENERATED by waterlock codegen. Do not edit by hand.
|
|
2
|
+
// Source: Gmail API v1 (revision 20261102)
|
|
3
|
+
// Regenerate with the codegen CLI after changing gmail.config.ts or the pinned spec.
|
|
4
|
+
export const gmailTable = {
|
|
5
|
+
provider: "gmail",
|
|
6
|
+
source: { "kind": "discovery", "title": "Gmail API", "version": "v1", "revision": "20261102", "url": "https://gmail.googleapis.com/$discovery/rest?version=v1" },
|
|
7
|
+
globalQueryParams: [
|
|
8
|
+
{ "name": "upload_protocol", "in": "query", "type": "string" },
|
|
9
|
+
{ "name": "key", "in": "query", "type": "string" },
|
|
10
|
+
{ "name": "access_token", "in": "query", "type": "string" },
|
|
11
|
+
{ "name": "oauth_token", "in": "query", "type": "string" },
|
|
12
|
+
{ "name": "callback", "in": "query", "type": "string" },
|
|
13
|
+
{ "name": "alt", "in": "query", "type": "string", "enum": ["json", "media", "proto"] },
|
|
14
|
+
{ "name": "prettyPrint", "in": "query", "type": "boolean" },
|
|
15
|
+
{ "name": "fields", "in": "query", "type": "string" },
|
|
16
|
+
{ "name": "quotaUser", "in": "query", "type": "string" },
|
|
17
|
+
{ "name": "uploadType", "in": "query", "type": "string" },
|
|
18
|
+
{ "name": "$.xgafv", "in": "query", "type": "string", "enum": ["1", "2"] },
|
|
19
|
+
],
|
|
20
|
+
operations: [
|
|
21
|
+
{ "action": "gmail.users.drafts.create", "method": "POST", "path": "/gmail/v1/users/{userId}/drafts", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
22
|
+
{ "action": "gmail.users.drafts.create", "method": "POST", "path": "/upload/gmail/v1/users/{userId}/drafts", "variant": "upload", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
23
|
+
{ "action": "gmail.users.drafts.create", "method": "POST", "path": "/resumable/upload/gmail/v1/users/{userId}/drafts", "variant": "resumable", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
24
|
+
{ "action": "gmail.users.drafts.delete", "method": "DELETE", "path": "/gmail/v1/users/{userId}/drafts/{id}", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
25
|
+
{ "action": "gmail.users.drafts.get", "method": "GET", "path": "/gmail/v1/users/{userId}/drafts/{id}", "variant": "standard", "params": [{ "name": "format", "in": "query", "type": "string", "enum": ["minimal", "full", "raw", "metadata"] }, { "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
26
|
+
{ "action": "gmail.users.drafts.list", "method": "GET", "path": "/gmail/v1/users/{userId}/drafts", "variant": "standard", "params": [{ "name": "includeSpamTrash", "in": "query", "type": "boolean" }, { "name": "maxResults", "in": "query", "type": "integer" }, { "name": "pageToken", "in": "query", "type": "string" }, { "name": "q", "in": "query", "type": "string" }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
27
|
+
{ "action": "gmail.users.drafts.send", "method": "POST", "path": "/gmail/v1/users/{userId}/drafts/send", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
28
|
+
{ "action": "gmail.users.drafts.send", "method": "POST", "path": "/upload/gmail/v1/users/{userId}/drafts/send", "variant": "upload", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
29
|
+
{ "action": "gmail.users.drafts.send", "method": "POST", "path": "/resumable/upload/gmail/v1/users/{userId}/drafts/send", "variant": "resumable", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
30
|
+
{ "action": "gmail.users.drafts.update", "method": "PUT", "path": "/gmail/v1/users/{userId}/drafts/{id}", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
31
|
+
{ "action": "gmail.users.drafts.update", "method": "PUT", "path": "/upload/gmail/v1/users/{userId}/drafts/{id}", "variant": "upload", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
32
|
+
{ "action": "gmail.users.drafts.update", "method": "PUT", "path": "/resumable/upload/gmail/v1/users/{userId}/drafts/{id}", "variant": "resumable", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
33
|
+
{ "action": "gmail.users.getProfile", "method": "GET", "path": "/gmail/v1/users/{userId}/profile", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
34
|
+
{ "action": "gmail.users.history.list", "method": "GET", "path": "/gmail/v1/users/{userId}/history", "variant": "standard", "params": [{ "name": "historyTypes", "in": "query", "type": "string", "repeated": true, "enum": ["messageAdded", "messageDeleted", "labelAdded", "labelRemoved"] }, { "name": "labelId", "in": "query", "type": "string" }, { "name": "maxResults", "in": "query", "type": "integer" }, { "name": "pageToken", "in": "query", "type": "string" }, { "name": "startHistoryId", "in": "query", "type": "string" }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
35
|
+
{ "action": "gmail.users.labels.create", "method": "POST", "path": "/gmail/v1/users/{userId}/labels", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
36
|
+
{ "action": "gmail.users.labels.delete", "method": "DELETE", "path": "/gmail/v1/users/{userId}/labels/{id}", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
37
|
+
{ "action": "gmail.users.labels.get", "method": "GET", "path": "/gmail/v1/users/{userId}/labels/{id}", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
38
|
+
{ "action": "gmail.users.labels.list", "method": "GET", "path": "/gmail/v1/users/{userId}/labels", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
39
|
+
{ "action": "gmail.users.labels.patch", "method": "PATCH", "path": "/gmail/v1/users/{userId}/labels/{id}", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
40
|
+
{ "action": "gmail.users.labels.update", "method": "PUT", "path": "/gmail/v1/users/{userId}/labels/{id}", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
41
|
+
{ "action": "gmail.users.messages.attachments.get", "method": "GET", "path": "/gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "messageId", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
42
|
+
{ "action": "gmail.users.messages.batchDelete", "method": "POST", "path": "/gmail/v1/users/{userId}/messages/batchDelete", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
43
|
+
{ "action": "gmail.users.messages.batchModify", "method": "POST", "path": "/gmail/v1/users/{userId}/messages/batchModify", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
44
|
+
{ "action": "gmail.users.messages.delete", "method": "DELETE", "path": "/gmail/v1/users/{userId}/messages/{id}", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
45
|
+
{ "action": "gmail.users.messages.get", "method": "GET", "path": "/gmail/v1/users/{userId}/messages/{id}", "variant": "standard", "params": [{ "name": "format", "in": "query", "type": "string", "enum": ["minimal", "full", "raw", "metadata"] }, { "name": "id", "in": "path", "type": "string", "required": true }, { "name": "metadataHeaders", "in": "query", "type": "string", "repeated": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
46
|
+
{ "action": "gmail.users.messages.import", "method": "POST", "path": "/gmail/v1/users/{userId}/messages/import", "variant": "standard", "params": [{ "name": "deleted", "in": "query", "type": "boolean" }, { "name": "internalDateSource", "in": "query", "type": "string", "enum": ["receivedTime", "dateHeader"] }, { "name": "neverMarkSpam", "in": "query", "type": "boolean" }, { "name": "processForCalendar", "in": "query", "type": "boolean" }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
47
|
+
{ "action": "gmail.users.messages.import", "method": "POST", "path": "/upload/gmail/v1/users/{userId}/messages/import", "variant": "upload", "params": [{ "name": "deleted", "in": "query", "type": "boolean" }, { "name": "internalDateSource", "in": "query", "type": "string", "enum": ["receivedTime", "dateHeader"] }, { "name": "neverMarkSpam", "in": "query", "type": "boolean" }, { "name": "processForCalendar", "in": "query", "type": "boolean" }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
48
|
+
{ "action": "gmail.users.messages.import", "method": "POST", "path": "/resumable/upload/gmail/v1/users/{userId}/messages/import", "variant": "resumable", "params": [{ "name": "deleted", "in": "query", "type": "boolean" }, { "name": "internalDateSource", "in": "query", "type": "string", "enum": ["receivedTime", "dateHeader"] }, { "name": "neverMarkSpam", "in": "query", "type": "boolean" }, { "name": "processForCalendar", "in": "query", "type": "boolean" }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
49
|
+
{ "action": "gmail.users.messages.insert", "method": "POST", "path": "/gmail/v1/users/{userId}/messages", "variant": "standard", "params": [{ "name": "deleted", "in": "query", "type": "boolean" }, { "name": "internalDateSource", "in": "query", "type": "string", "enum": ["receivedTime", "dateHeader"] }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
50
|
+
{ "action": "gmail.users.messages.insert", "method": "POST", "path": "/upload/gmail/v1/users/{userId}/messages", "variant": "upload", "params": [{ "name": "deleted", "in": "query", "type": "boolean" }, { "name": "internalDateSource", "in": "query", "type": "string", "enum": ["receivedTime", "dateHeader"] }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
51
|
+
{ "action": "gmail.users.messages.insert", "method": "POST", "path": "/resumable/upload/gmail/v1/users/{userId}/messages", "variant": "resumable", "params": [{ "name": "deleted", "in": "query", "type": "boolean" }, { "name": "internalDateSource", "in": "query", "type": "string", "enum": ["receivedTime", "dateHeader"] }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
52
|
+
{ "action": "gmail.users.messages.list", "method": "GET", "path": "/gmail/v1/users/{userId}/messages", "variant": "standard", "params": [{ "name": "includeSpamTrash", "in": "query", "type": "boolean" }, { "name": "labelIds", "in": "query", "type": "string", "repeated": true }, { "name": "maxResults", "in": "query", "type": "integer" }, { "name": "pageToken", "in": "query", "type": "string" }, { "name": "q", "in": "query", "type": "string" }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
53
|
+
{ "action": "gmail.users.messages.modify", "method": "POST", "path": "/gmail/v1/users/{userId}/messages/{id}/modify", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
54
|
+
{ "action": "gmail.users.messages.send", "method": "POST", "path": "/gmail/v1/users/{userId}/messages/send", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
55
|
+
{ "action": "gmail.users.messages.send", "method": "POST", "path": "/upload/gmail/v1/users/{userId}/messages/send", "variant": "upload", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
56
|
+
{ "action": "gmail.users.messages.send", "method": "POST", "path": "/resumable/upload/gmail/v1/users/{userId}/messages/send", "variant": "resumable", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
57
|
+
{ "action": "gmail.users.messages.trash", "method": "POST", "path": "/gmail/v1/users/{userId}/messages/{id}/trash", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
58
|
+
{ "action": "gmail.users.messages.untrash", "method": "POST", "path": "/gmail/v1/users/{userId}/messages/{id}/untrash", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
59
|
+
{ "action": "gmail.users.settings.cse.identities.create", "method": "POST", "path": "/gmail/v1/users/{userId}/settings/cse/identities", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
60
|
+
{ "action": "gmail.users.settings.cse.identities.delete", "method": "DELETE", "path": "/gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}", "variant": "standard", "params": [{ "name": "cseEmailAddress", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
61
|
+
{ "action": "gmail.users.settings.cse.identities.get", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}", "variant": "standard", "params": [{ "name": "cseEmailAddress", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
62
|
+
{ "action": "gmail.users.settings.cse.identities.list", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/cse/identities", "variant": "standard", "params": [{ "name": "pageSize", "in": "query", "type": "integer" }, { "name": "pageToken", "in": "query", "type": "string" }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
63
|
+
{ "action": "gmail.users.settings.cse.identities.patch", "method": "PATCH", "path": "/gmail/v1/users/{userId}/settings/cse/identities/{emailAddress}", "variant": "standard", "params": [{ "name": "emailAddress", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
64
|
+
{ "action": "gmail.users.settings.cse.keypairs.create", "method": "POST", "path": "/gmail/v1/users/{userId}/settings/cse/keypairs", "variant": "standard", "params": [{ "name": "chainValidation", "in": "query", "type": "string", "enum": ["all", "none"] }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
65
|
+
{ "action": "gmail.users.settings.cse.keypairs.disable", "method": "POST", "path": "/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:disable", "variant": "standard", "params": [{ "name": "keyPairId", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
66
|
+
{ "action": "gmail.users.settings.cse.keypairs.enable", "method": "POST", "path": "/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:enable", "variant": "standard", "params": [{ "name": "keyPairId", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
67
|
+
{ "action": "gmail.users.settings.cse.keypairs.get", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}", "variant": "standard", "params": [{ "name": "keyPairId", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
68
|
+
{ "action": "gmail.users.settings.cse.keypairs.list", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/cse/keypairs", "variant": "standard", "params": [{ "name": "pageSize", "in": "query", "type": "integer" }, { "name": "pageToken", "in": "query", "type": "string" }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
69
|
+
{ "action": "gmail.users.settings.cse.keypairs.obliterate", "method": "POST", "path": "/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:obliterate", "variant": "standard", "params": [{ "name": "keyPairId", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
70
|
+
{ "action": "gmail.users.settings.delegates.create", "method": "POST", "path": "/gmail/v1/users/{userId}/settings/delegates", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
71
|
+
{ "action": "gmail.users.settings.delegates.delete", "method": "DELETE", "path": "/gmail/v1/users/{userId}/settings/delegates/{delegateEmail}", "variant": "standard", "params": [{ "name": "delegateEmail", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
72
|
+
{ "action": "gmail.users.settings.delegates.get", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/delegates/{delegateEmail}", "variant": "standard", "params": [{ "name": "delegateEmail", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
73
|
+
{ "action": "gmail.users.settings.delegates.list", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/delegates", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
74
|
+
{ "action": "gmail.users.settings.filters.create", "method": "POST", "path": "/gmail/v1/users/{userId}/settings/filters", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
75
|
+
{ "action": "gmail.users.settings.filters.delete", "method": "DELETE", "path": "/gmail/v1/users/{userId}/settings/filters/{id}", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
76
|
+
{ "action": "gmail.users.settings.filters.get", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/filters/{id}", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
77
|
+
{ "action": "gmail.users.settings.filters.list", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/filters", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
78
|
+
{ "action": "gmail.users.settings.forwardingAddresses.create", "method": "POST", "path": "/gmail/v1/users/{userId}/settings/forwardingAddresses", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
79
|
+
{ "action": "gmail.users.settings.forwardingAddresses.delete", "method": "DELETE", "path": "/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}", "variant": "standard", "params": [{ "name": "forwardingEmail", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
80
|
+
{ "action": "gmail.users.settings.forwardingAddresses.get", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}", "variant": "standard", "params": [{ "name": "forwardingEmail", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
81
|
+
{ "action": "gmail.users.settings.forwardingAddresses.list", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/forwardingAddresses", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
82
|
+
{ "action": "gmail.users.settings.getAutoForwarding", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/autoForwarding", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
83
|
+
{ "action": "gmail.users.settings.getImap", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/imap", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
84
|
+
{ "action": "gmail.users.settings.getLanguage", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/language", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
85
|
+
{ "action": "gmail.users.settings.getPop", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/pop", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
86
|
+
{ "action": "gmail.users.settings.getVacation", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/vacation", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
87
|
+
{ "action": "gmail.users.settings.sendAs.create", "method": "POST", "path": "/gmail/v1/users/{userId}/settings/sendAs", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
88
|
+
{ "action": "gmail.users.settings.sendAs.delete", "method": "DELETE", "path": "/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}", "variant": "standard", "params": [{ "name": "sendAsEmail", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
89
|
+
{ "action": "gmail.users.settings.sendAs.get", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}", "variant": "standard", "params": [{ "name": "sendAsEmail", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
90
|
+
{ "action": "gmail.users.settings.sendAs.list", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/sendAs", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
91
|
+
{ "action": "gmail.users.settings.sendAs.patch", "method": "PATCH", "path": "/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}", "variant": "standard", "params": [{ "name": "sendAsEmail", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
92
|
+
{ "action": "gmail.users.settings.sendAs.smimeInfo.delete", "method": "DELETE", "path": "/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "sendAsEmail", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
93
|
+
{ "action": "gmail.users.settings.sendAs.smimeInfo.get", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "sendAsEmail", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
94
|
+
{ "action": "gmail.users.settings.sendAs.smimeInfo.insert", "method": "POST", "path": "/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo", "variant": "standard", "params": [{ "name": "sendAsEmail", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
95
|
+
{ "action": "gmail.users.settings.sendAs.smimeInfo.list", "method": "GET", "path": "/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo", "variant": "standard", "params": [{ "name": "sendAsEmail", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
96
|
+
{ "action": "gmail.users.settings.sendAs.smimeInfo.setDefault", "method": "POST", "path": "/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "sendAsEmail", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
97
|
+
{ "action": "gmail.users.settings.sendAs.update", "method": "PUT", "path": "/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}", "variant": "standard", "params": [{ "name": "sendAsEmail", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
98
|
+
{ "action": "gmail.users.settings.sendAs.verify", "method": "POST", "path": "/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify", "variant": "standard", "params": [{ "name": "sendAsEmail", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
99
|
+
{ "action": "gmail.users.settings.updateAutoForwarding", "method": "PUT", "path": "/gmail/v1/users/{userId}/settings/autoForwarding", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
100
|
+
{ "action": "gmail.users.settings.updateImap", "method": "PUT", "path": "/gmail/v1/users/{userId}/settings/imap", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
101
|
+
{ "action": "gmail.users.settings.updateLanguage", "method": "PUT", "path": "/gmail/v1/users/{userId}/settings/language", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
102
|
+
{ "action": "gmail.users.settings.updatePop", "method": "PUT", "path": "/gmail/v1/users/{userId}/settings/pop", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
103
|
+
{ "action": "gmail.users.settings.updateVacation", "method": "PUT", "path": "/gmail/v1/users/{userId}/settings/vacation", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
104
|
+
{ "action": "gmail.users.stop", "method": "POST", "path": "/gmail/v1/users/{userId}/stop", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
105
|
+
{ "action": "gmail.users.threads.delete", "method": "DELETE", "path": "/gmail/v1/users/{userId}/threads/{id}", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
106
|
+
{ "action": "gmail.users.threads.get", "method": "GET", "path": "/gmail/v1/users/{userId}/threads/{id}", "variant": "standard", "params": [{ "name": "format", "in": "query", "type": "string", "enum": ["full", "metadata", "minimal"] }, { "name": "id", "in": "path", "type": "string", "required": true }, { "name": "metadataHeaders", "in": "query", "type": "string", "repeated": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
107
|
+
{ "action": "gmail.users.threads.list", "method": "GET", "path": "/gmail/v1/users/{userId}/threads", "variant": "standard", "params": [{ "name": "includeSpamTrash", "in": "query", "type": "boolean" }, { "name": "labelIds", "in": "query", "type": "string", "repeated": true }, { "name": "maxResults", "in": "query", "type": "integer" }, { "name": "pageToken", "in": "query", "type": "string" }, { "name": "q", "in": "query", "type": "string" }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
108
|
+
{ "action": "gmail.users.threads.modify", "method": "POST", "path": "/gmail/v1/users/{userId}/threads/{id}/modify", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
109
|
+
{ "action": "gmail.users.threads.trash", "method": "POST", "path": "/gmail/v1/users/{userId}/threads/{id}/trash", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
110
|
+
{ "action": "gmail.users.threads.untrash", "method": "POST", "path": "/gmail/v1/users/{userId}/threads/{id}/untrash", "variant": "standard", "params": [{ "name": "id", "in": "path", "type": "string", "required": true }, { "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": false },
|
|
111
|
+
{ "action": "gmail.users.watch", "method": "POST", "path": "/gmail/v1/users/{userId}/watch", "variant": "standard", "params": [{ "name": "userId", "in": "path", "type": "string", "required": true }], "hasBody": true },
|
|
112
|
+
],
|
|
113
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineCodegenConfig } from "../../codegen/config.js";
|
|
2
|
+
/**
|
|
3
|
+
* Codegen config for the Gmail Discovery doc. Review codegen-report.md after any change to spec.json.
|
|
4
|
+
*/
|
|
5
|
+
export default defineCodegenConfig({
|
|
6
|
+
provider: "gmail",
|
|
7
|
+
typePrefix: "Gmail",
|
|
8
|
+
source: {
|
|
9
|
+
kind: "discovery",
|
|
10
|
+
file: "./spec.json",
|
|
11
|
+
url: "https://gmail.googleapis.com/$discovery/rest?version=v1",
|
|
12
|
+
},
|
|
13
|
+
out: "./generated.ts",
|
|
14
|
+
report: "./codegen-report.md",
|
|
15
|
+
typesImport: "../../core/types.js",
|
|
16
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CredentialSource } from "../../core/credentials.js";
|
|
2
|
+
import type { ProviderRequest } from "../../core/policy.js";
|
|
3
|
+
import type { GmailDraftSendContext, GmailMessageContext } from "./decode.js";
|
|
4
|
+
import { type GmailAction, type GmailParams } from "./generated.js";
|
|
5
|
+
export type { GmailAction, GmailParams } from "./generated.js";
|
|
6
|
+
export type { GmailAttachment, GmailDraftSendContext, GmailMessageContext } from "./decode.js";
|
|
7
|
+
export { gmailTable } from "./generated.js";
|
|
8
|
+
/** Hand-written: what each decoder adds to `context`. Everything else has an empty context. */
|
|
9
|
+
export interface GmailDecoded {
|
|
10
|
+
"gmail.users.messages.send": GmailMessageContext;
|
|
11
|
+
"gmail.users.drafts.create": GmailMessageContext;
|
|
12
|
+
"gmail.users.drafts.update": GmailMessageContext;
|
|
13
|
+
"gmail.users.drafts.send": GmailDraftSendContext;
|
|
14
|
+
}
|
|
15
|
+
type ContextFor<A extends GmailAction> = A extends keyof GmailDecoded ? GmailDecoded[A] : Record<string, never>;
|
|
16
|
+
/** What Gmail rules see. Narrow on `action` to get typed params/context. */
|
|
17
|
+
export type GmailRequest = {
|
|
18
|
+
[A in GmailAction]: ProviderRequest<"gmail", A, GmailParams[A], ContextFor<A>>;
|
|
19
|
+
}[GmailAction];
|
|
20
|
+
export declare function gmail(opts: {
|
|
21
|
+
credentials: CredentialSource;
|
|
22
|
+
upstream?: string;
|
|
23
|
+
}): import("../../core/provider.js").ProviderDefinition<GmailRequest>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createProvider } from "../../core/provider.js";
|
|
2
|
+
import { decodeDraftSend, decodeDraftWrite, decodeMessageSend } from "./decode.js";
|
|
3
|
+
import { gmailTable } from "./generated.js";
|
|
4
|
+
export { gmailTable } from "./generated.js";
|
|
5
|
+
export function gmail(opts) {
|
|
6
|
+
return createProvider({
|
|
7
|
+
id: "gmail",
|
|
8
|
+
upstream: opts.upstream ?? "https://gmail.googleapis.com",
|
|
9
|
+
table: gmailTable,
|
|
10
|
+
// Google system params. Excluded on purpose: key, access_token, oauth_token
|
|
11
|
+
// (credentials in the URL), callback (JSONP), uploadType/upload_protocol.
|
|
12
|
+
allowedGlobalQueryParams: ["alt", "fields", "prettyPrint", "quotaUser", "$.xgafv"],
|
|
13
|
+
decoders: {
|
|
14
|
+
"gmail.users.messages.send": ({ body }) => decodeMessageSend(body),
|
|
15
|
+
"gmail.users.drafts.create": ({ body }) => decodeDraftWrite(body),
|
|
16
|
+
"gmail.users.drafts.update": ({ body }) => decodeDraftWrite(body),
|
|
17
|
+
"gmail.users.drafts.send": ({ body }) => decodeDraftSend(body),
|
|
18
|
+
},
|
|
19
|
+
credentials: opts.credentials,
|
|
20
|
+
});
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,70 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waterlock/gateway",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Credential-injecting policy gateway for AI agent tool calls",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/waterlockcc/waterlock.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/waterlockcc/waterlock#readme",
|
|
12
|
+
"bugs": "https://github.com/waterlockcc/waterlock/issues",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=24"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./codegen": {
|
|
25
|
+
"types": "./dist/codegen/index.d.ts",
|
|
26
|
+
"default": "./dist/codegen/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./providers/gmail": {
|
|
29
|
+
"types": "./dist/providers/gmail/index.d.ts",
|
|
30
|
+
"default": "./dist/providers/gmail/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./checks": {
|
|
33
|
+
"types": "./dist/checks/index.d.ts",
|
|
34
|
+
"default": "./dist/checks/index.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"postal-mime": "4.2.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"zod": "^4.0.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependenciesMeta": {
|
|
47
|
+
"zod": {
|
|
48
|
+
"optional": true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@ai-sdk/openai": "^4.0.110",
|
|
53
|
+
"@googleapis/gmail": "^22.0.2",
|
|
54
|
+
"@hono/node-server": "^2.1.6",
|
|
55
|
+
"@types/node": "^26.6.6",
|
|
56
|
+
"ai": "^7.0.164",
|
|
57
|
+
"ai-sdk-provider-claude-code": "^4.4.1",
|
|
58
|
+
"tsx": "^4.23.15",
|
|
59
|
+
"typescript": "^7.0.2",
|
|
60
|
+
"vitest": "^5.1.0",
|
|
61
|
+
"zod": "^4.6.7"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
65
|
+
"gen:gmail": "tsx src/codegen/cli.ts src/providers/gmail/gmail.config.ts",
|
|
66
|
+
"gen:gmail:fetch": "tsx src/codegen/cli.ts src/providers/gmail/gmail.config.ts --fetch",
|
|
67
|
+
"test": "vitest run",
|
|
68
|
+
"typecheck": "tsc --noEmit"
|
|
69
|
+
}
|
|
6
70
|
}
|