@superdurable/connector-google-gmail 0.1.2 → 0.2.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/README.md CHANGED
@@ -11,6 +11,10 @@ This package provides typed `getMessage`, `sendMessage`, and `replyToMessage` op
11
11
  The checked-in `src/generated/` contracts come from `connector.yaml` and the
12
12
  Go operation structs. Run `go run ./cmd/connectorctl generate --lang typescript connectors/google/gmail/connector.yaml` from the repository root after either source changes. `src/models.ts` keeps credential requirements specific to Google OAuth and Workspace delegation, plus the public non-null send recipient arrays. `src/steps.ts` delegates to generated factories while requiring `GmailConnection` at compile time; `src/mock/index.ts` re-exports matching generated scenarios and validates send scenarios against the public result type. `src/project.ts` keeps the refresh codec and public connection constructor.
13
13
 
14
+ Version 0.2.0 requires Connector SDK 0.6.0. Generated private and shared
15
+ credential decoders validate project material, and the refresh driver reads
16
+ generated manifest grants with Gmail-specific delegation checks.
17
+
14
18
  Send and reply recipients are validated as mailboxes and returned in canonical header form, such as `<ada@example.com>` or `"Ada" <ada@example.com>`.
15
19
  Decoded messages omit absent optional metadata and body fields, matching the Go connector's JSON output.
16
20
 
@@ -22,7 +26,7 @@ For personal Gmail or ordinary Workspace accounts, select **Google OAuth**. In [
22
26
 
23
27
  For administrator-managed Workspace delegation, use [Google Cloud service accounts](https://console.cloud.google.com/iam-admin/serviceaccounts) to create a service account and download its JSON key. In [Workspace domain-wide delegation](https://admin.google.com/ac/owl/domainwidedelegation), authorize that account's OAuth client ID for the Gmail readonly and send scopes. Put the JSON key and one managed mailbox in the connection form. The connector mints short-lived delegated tokens and uses that mailbox as the sender.
24
28
 
25
- `sendMessage` and `replyToMessage` use synchronous Execute and claim a Dex heartbeat checkpoint before POST. They search Sent Mail under a run-specific RFC `Message-ID` after an ambiguous send. A confirmed match returns `sent`; a miss retries read-back within the manifest budget without another POST. A conclusive 429 or 503 can permit another attempt after its own read-back; delayed Sent Mail indexing after a 503 can still cause duplicate delivery. An accepted 2xx never resends merely because its response body is unusable.
29
+ `sendMessage` and `replyToMessage` use synchronous Execute and claim a Dex heartbeat checkpoint before POST. They search Sent Mail under a run-specific RFC `Message-ID` after an ambiguous send. A confirmed match returns `sent`; a miss retries read-back within the manifest budget without another POST. A conclusive 429 or a failure proven to precede dispatch can permit another POST. A 503 may have been processed, so like any 5xx it keeps the claim and later attempts only read back. An accepted 2xx never resends merely because its response body is unusable.
26
30
 
27
31
  ## Run the example
28
32
 
@@ -1,16 +1,27 @@
1
1
  {
2
2
  "connectorId": "gmail",
3
- "releaseTag": "connectors/google/gmail/go/v0.25.2",
3
+ "releaseTag": "connectors/google/gmail/go/v0.26.0",
4
4
  "package": {
5
5
  "ecosystem": "npm",
6
6
  "name": "@superdurable/connector-google-gmail",
7
- "version": "0.1.2"
7
+ "version": "0.2.0"
8
8
  },
9
9
  "factories": [
10
10
  {
11
11
  "name": "newGetMessageStep",
12
12
  "kind": "query",
13
13
  "operationId": "getMessage",
14
+ "inputType": "GetMessageInput",
15
+ "description": "Read one Gmail message from the connected mailbox by its Gmail message ID, returning its sender, recipients, subject, threading headers, labels, and decoded text and HTML bodies.",
16
+ "agent": {
17
+ "exposed": true,
18
+ "branches": {
19
+ "defect": "rejected",
20
+ "invalidResponse": "rejected",
21
+ "notFound": "rejected",
22
+ "providerRejected": "rejected"
23
+ }
24
+ },
14
25
  "fields": {
15
26
  "stepType": "stepType",
16
27
  "annotations": "annotations",
@@ -43,12 +54,36 @@
43
54
  "field": "defect",
44
55
  "optional": true
45
56
  }
46
- ]
57
+ ],
58
+ "inputSchema": {
59
+ "additionalProperties": false,
60
+ "description": "GetMessageInput identifies one Gmail message.",
61
+ "properties": {
62
+ "messageId": {
63
+ "description": "MessageID is the provider message identifier.",
64
+ "type": "string"
65
+ }
66
+ },
67
+ "required": [
68
+ "messageId"
69
+ ],
70
+ "type": "object"
71
+ }
47
72
  },
48
73
  {
49
74
  "name": "newSendMessageStep",
50
75
  "kind": "mutation",
51
76
  "operationId": "sendMessage",
77
+ "inputType": "SendMessageInput",
78
+ "description": "Send one new email from the connected Gmail account. Give the recipient email addresses, a one-line subject, and the plain-text body; an HTML body is optional.",
79
+ "agent": {
80
+ "exposed": true,
81
+ "approval": "recommended",
82
+ "branches": {
83
+ "defect": "unknown",
84
+ "providerRejected": "rejected"
85
+ }
86
+ },
52
87
  "fields": {
53
88
  "stepType": "stepType",
54
89
  "annotations": "annotations",
@@ -71,12 +106,57 @@
71
106
  "field": "defect",
72
107
  "optional": true
73
108
  }
74
- ]
109
+ ],
110
+ "inputSchema": {
111
+ "additionalProperties": false,
112
+ "description": "SendMessageInput contains the provider request fields for send message.",
113
+ "properties": {
114
+ "htmlBody": {
115
+ "description": "HTMLBody is the optional HTML message body.",
116
+ "type": "string"
117
+ },
118
+ "subject": {
119
+ "description": "Subject is the message subject.",
120
+ "type": "string"
121
+ },
122
+ "textBody": {
123
+ "description": "TextBody is the plain-text message body.",
124
+ "type": "string"
125
+ },
126
+ "to": {
127
+ "description": "To lists recipient addresses.",
128
+ "items": {
129
+ "type": "string"
130
+ },
131
+ "type": [
132
+ "array",
133
+ "null"
134
+ ]
135
+ }
136
+ },
137
+ "required": [
138
+ "subject",
139
+ "textBody",
140
+ "to"
141
+ ],
142
+ "type": "object"
143
+ }
75
144
  },
76
145
  {
77
146
  "name": "newReplyToMessageStep",
78
147
  "kind": "mutation",
79
148
  "operationId": "replyToMessage",
149
+ "inputType": "ReplyToMessageInput",
150
+ "description": "Reply in its existing Gmail thread to one message in the connected mailbox, addressed to that message's Reply-To or sender. Give the Gmail message ID to answer and the plain-text reply body; an HTML body is optional.",
151
+ "agent": {
152
+ "exposed": true,
153
+ "approval": "recommended",
154
+ "branches": {
155
+ "defect": "unknown",
156
+ "invalidResponse": "rejected",
157
+ "providerRejected": "rejected"
158
+ }
159
+ },
80
160
  "fields": {
81
161
  "stepType": "stepType",
82
162
  "annotations": "annotations",
@@ -104,7 +184,30 @@
104
184
  "field": "defect",
105
185
  "optional": true
106
186
  }
107
- ]
187
+ ],
188
+ "inputSchema": {
189
+ "additionalProperties": false,
190
+ "description": "ReplyToMessageInput identifies a message and supplies the reply body.",
191
+ "properties": {
192
+ "htmlBody": {
193
+ "description": "HTMLBody is the optional HTML message body.",
194
+ "type": "string"
195
+ },
196
+ "messageId": {
197
+ "description": "MessageID is the provider message identifier.",
198
+ "type": "string"
199
+ },
200
+ "textBody": {
201
+ "description": "TextBody is the plain-text message body.",
202
+ "type": "string"
203
+ }
204
+ },
205
+ "required": [
206
+ "messageId",
207
+ "textBody"
208
+ ],
209
+ "type": "object"
210
+ }
108
211
  }
109
212
  ]
110
213
  }