@framers/agentos-ext-gmail-source 0.2.0 → 0.4.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 +75 -2
- package/dist/gmail.d.ts +182 -0
- package/dist/gmail.d.ts.map +1 -0
- package/dist/gmail.js +568 -0
- package/dist/gmail.js.map +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/mapThread.d.ts +66 -0
- package/dist/mapThread.d.ts.map +1 -0
- package/dist/mapThread.js +228 -0
- package/dist/mapThread.js.map +1 -0
- package/dist/mime.d.ts +141 -0
- package/dist/mime.d.ts.map +1 -0
- package/dist/mime.js +377 -0
- package/dist/mime.js.map +1 -0
- package/dist/retry.d.ts +44 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +102 -0
- package/dist/retry.js.map +1 -0
- package/manifest.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Gmail source
|
|
2
2
|
|
|
3
|
-
This library provides read-only Gmail authorization on the AgentOS redirect grant and sealed-token contracts,
|
|
3
|
+
This library provides read-only Gmail authorization on the AgentOS redirect grant and sealed-token contracts, text helpers that sanitize and trim mail before it is stored (see Text ingestion below), a bounded mapper that turns one thread response into a sanitized source document (see Thread documents below), and a capped read-only API client that sends every call through the host's quota and grant services (see Read-only API below). It requests the sole Gmail read-only scope, offline access and incremental consent. It exports no send, reply, label-modification or attachment-download tool.
|
|
4
4
|
|
|
5
|
-
Install it next to `@framers/agentos` 0.13.134 or later and `@framers/agentos-ext-account-sources` 0.
|
|
5
|
+
Install it next to `@framers/agentos` 0.13.134 or later and `@framers/agentos-ext-account-sources` 0.7.0 or later. Both are peer dependencies with a floor and no upper bound. Node.js 20.19 or later is required.
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
import { GmailOAuthFlow } from '@framers/agentos-ext-gmail-source';
|
|
@@ -59,3 +59,76 @@ const filename = sanitizeMailMetadata(decodedFilename, { ...policy, maxOutputCha
|
|
|
59
59
|
`messageText(input, policy)` sanitizes first, trims recognized reply history and short signatures, then applies the output cap. Explicit forwarded content and ambiguous prose are retained. Its `trimmedQuote`, `trimmedSignature` and `truncated` flags describe omissions. Quote spans must refer to its returned string, without inserted summaries or an ellipsis presented as source text. A host should disclose that attachments are listed and their contents are not read when its mapper implements that boundary.
|
|
60
60
|
|
|
61
61
|
The functions return text and counts only. They do not store raw values or a reverse-redaction map, log matches, fetch URLs, interpret mail as instructions or invoke a model. Sanitization can remove benign text and cannot identify every possible secret. It does not make personal mail anonymous or authorize model processing, sharing or retention. Hosts must preserve the source's privacy, expiry and deletion rules for both text and derived results.
|
|
62
|
+
|
|
63
|
+
## Thread documents
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
import { GmailThreadMapper } from '@framers/agentos-ext-gmail-source';
|
|
67
|
+
|
|
68
|
+
const mapper = new GmailThreadMapper({
|
|
69
|
+
maxResponseBytes: 2_097_152, maxDecodedBytes: 2_097_152, maxMimeDepth: 20, maxMimeParts: 1_000,
|
|
70
|
+
maxMessages: 100, maxMessageCharacters: 20_000, maxThreadCharacters: 200_000,
|
|
71
|
+
maxMetadataCharacters: 200_000, maxInputCharacters: 2_097_152, maxLineCharacters: 65_536,
|
|
72
|
+
maximumCacheMs: 86_400_000,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// `response` is the parsed threads.get (format=full) body from a transport that capped its bytes.
|
|
76
|
+
const result = await mapper.map(response, {
|
|
77
|
+
sourceId: response.id,
|
|
78
|
+
sourceDetailUrl: detailPath, // the host's authenticated source-detail route, never a Gmail link
|
|
79
|
+
cutoff, windowMs: 30 * 86_400_000, readStartedAt, receivedAt,
|
|
80
|
+
permission, cacheHeaders, labelNames, labelCache, signal,
|
|
81
|
+
});
|
|
82
|
+
// result.kind is 'document' (text, message spans, metadata, cache expiry) or 'skipped' with a fixed reason.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Construct `GmailThreadMapper(bounds)` with explicit response, decoded-byte, MIME depth/part, retained-message, message/thread text, metadata, sanitizer and cache ceilings. `map(thread, options)` returns the account-source `SourceSyncReadResult` union. The input is the parsed response from a transport that already enforced its byte cap before JSON decoding. The mapper separately checks recognized MIME data and the entire part tree before decoding any selected body. A parsed object alone cannot establish its original wire size.
|
|
86
|
+
|
|
87
|
+
Supply a fixed selection cutoff, message window, original read start and completion times, actual response cache headers, independently established cache permission and a host-generated relative detail path. The path must resolve authentication and current source generation in the host. It is never a Gmail deep link or a request-derived external URL. A successful OAuth grant does not establish cache or model-processing permission.
|
|
88
|
+
Pass `labelCache` as the separate labels response’s cache decision. Missing, refused or expired label permission keeps ids without names. Permitted names shorten the entire document’s expiry when their allowed lifetime ends first.
|
|
89
|
+
|
|
90
|
+
Each message is filtered by its internal timestamp and excluded labels. Retained messages are selected newest first with stable id ties, within the explicit cap, and rendered chronologically. Plain text wins within a MIME alternative. Other multipart containers retain their non-attachment text children in MIME order. HTML uses the public AgentOS `HtmlLoader` with an in-memory Buffer. No browser or remote resource is loaded. The resulting text, structured headers, filenames, media types and label names all pass the text sanitizer.
|
|
91
|
+
|
|
92
|
+
Attachments are listed; their contents are not read. An external body or attachment contributes only sanitized filename, media type and size. Inline attachment bytes and attachment ids are discarded. Bcc, raw payloads, snippets and unknown fields are not returned. The mapper never calls any Gmail endpoint. Unsupported charset, invalid bytes and omitted content have fixed counted reasons. Invalid protocol shape is a failure rather than an empty successful source.
|
|
93
|
+
|
|
94
|
+
A returned document has matching item/ref versions, a normalized-content hash, message ids and body spans, earliest allowed expiry and explicit omission/truncation metadata. Spans count UTF-16 code units in the returned text and exclude the header prefix. Quote trimming preserves normalized source text; no generated summary or ellipsis is inserted into a quote. Header-only messages can have an empty body span. Render structured metadata as escaped text and treat all mail as untrusted data.
|
|
95
|
+
|
|
96
|
+
A history-only change does not extend cache life or change the normalized hash. Storage still requires the account-source transactional fence, fresh expiry checks and host allowances. Derived results retain the whole source's personal-use, expiry and deletion restrictions. Never persist the transient MIME types or bypass the account-source store with a mapper result.
|
|
97
|
+
|
|
98
|
+
## Read-only API
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { GmailApi } from '@framers/agentos-ext-gmail-source';
|
|
102
|
+
|
|
103
|
+
// `revocations` is the host's SourceRevocations and `quota` its SourceQuota, on the tables its coordinator uses.
|
|
104
|
+
const api = new GmailApi({
|
|
105
|
+
client, revocations, quota,
|
|
106
|
+
currentHandle: () => handle, // the sync handle that holds this connection's lease now
|
|
107
|
+
projectKey: 'project-1', mailboxKey, // a stable keyed hash for the mailbox, never its address
|
|
108
|
+
bounds, // the thread mapper's bounds (see Thread documents)
|
|
109
|
+
limits: { timeoutMs: 15_000, maxLabels: 1_000, maxHistoryReferences: 10_000, maxPageTokenCharacters: 4_096 },
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const profile = await api.profile(signal); // compare profile.emailAddress privately; keep profile.historyId
|
|
113
|
+
const labels = await api.labels(permission, signal);
|
|
114
|
+
const page = await api.list(cutoff, 30 * 86_400_000, 100, null, signal); // { kind: 'scan', ids, nextPageToken }
|
|
115
|
+
for (const id of page.ids) {
|
|
116
|
+
const result = await api.readThread(id, {
|
|
117
|
+
cutoff, windowMs: 30 * 86_400_000, sourceDetailUrl: detailPath(id), permission, labels, signal,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
const changes = await api.history(profile.historyId, 100, null, signal); // { kind: 'history', ids, nextPageToken, cursor }
|
|
121
|
+
// A failure is a SourceSyncFault with a fixed code and, for a wait, the time to try again in retryAt.
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`GmailApi(options)` uses the account-source quota and grant services supplied by the host. Pass a live `currentHandle` getter, stable opaque project/mailbox quota keys, the dedicated OAuth client, mapper bounds and explicit transport limits. The client constructs each OAuth flow inside the grant service's callback. It retains no flow or sealed-store callback between operations. Production uses fixed Google origins and only profile, labels, threads list/get and history list. CI may configure loopback or reserved fixture origins; HTTP redirects and arbitrary paths are refused.
|
|
125
|
+
|
|
126
|
+
`profile(signal?)` returns a server-memory address and history id for private account binding. Never store its address in a source or log it. `list(cutoff, windowMs, pageSize, pageToken, signal?)` returns a bounded scan page. The query uses epoch seconds and excludes spam, trash and drafts; exact message eligibility remains the mapper's responsibility. `history(fromCursor, pageSize, pageToken, signal?)` returns deduplicated changed thread ids and the string response cursor. The host must persist pending work and commit a terminal cursor only after all work has completed. Neither method claims mailbox-wide completeness.
|
|
127
|
+
|
|
128
|
+
`labels(permission, signal?)` returns sanitized names and the cache decision from that labels response. A refused decision contains no names. `readThread(sourceId, options)` accepts cutoff/window, a trusted private detail path, cache permission, the independent label snapshot and optional signal. It passes the actual thread response headers and times to the mapper and returns only the account-source read-result union. It never returns raw MIME. A labels response cannot borrow a thread response's longer cache lifetime.
|
|
129
|
+
|
|
130
|
+
One provider operation makes one attempt, with one fresh-token retry permitted after 401. Every HTTP dispatch is separately metered. Token refreshes also use the one-unit profile reservation as conservative local accounting; this does not assert a Gmail quota cost for the OAuth endpoint. The durable account-source coordinator owns retry episodes, exponential backoff and exhaustion. The client persists provider waits through the quota service and never sleeps or buys capacity. A quota deferral, or a start that missed the quota's send window, sends nothing and throws `rate_limited` with the time to try again; only a reused attempt id is `invalid_response`. A retry time the client hands back is always after its own clock, even when the quota's database clock lags it; give the client the clock the host's sync store reads (`Date.now` for both unless given). Unknown errors become fixed failures without retaining their messages or causes.
|
|
131
|
+
|
|
132
|
+
A canonical thread 404 means gone. History 404 means the history anchor expired and bounded recovery is required. Domain policy is a fixed failure. Missing or explicitly invalid grants and insufficient scope are passed to the coordinator's fenced grant-loss lifecycle. Client configuration errors and transient network/provider failures are not reported as revoked mailboxes. Oversized successful thread responses are counted skips; oversized control pages fail without a cursor advance. Response streams are capped before decoding and are cancelled on size, deadline or caller cancellation.
|
|
133
|
+
|
|
134
|
+
The client performs no storage write, purge, logging, model request or attachment fetch. Its successful result is still untrusted source material and needs the host's fresh owner/generation/expiry checks before storage, preparation or delivery. Limits are defensive library policy, not provider maxima; hosts must record any live compatibility failure before changing them.
|
package/dist/gmail.d.ts
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { type SourceQuota, type SourceRevocations, type SourceSyncHandle, type SourceSyncScanPage, type SourceSyncHistoryPage, type SourceSyncReadResult, type SourceCachePermission, type SourceCacheDecision } from '@framers/agentos-ext-account-sources';
|
|
2
|
+
import type { GmailOAuthClient, GmailOAuthEndpoints } from './types.js';
|
|
3
|
+
import { type GmailMappingBounds } from './mime.js';
|
|
4
|
+
/**
|
|
5
|
+
* The client's defensive transport limits, each a positive safe integer no greater than the value in brackets. They
|
|
6
|
+
* are library choices, not Google maxima: a control page past one fails without a partial page.
|
|
7
|
+
*/
|
|
8
|
+
export interface GmailApiLimits {
|
|
9
|
+
/** Milliseconds one call and the reading of its body may take (15,000). */
|
|
10
|
+
readonly timeoutMs: number;
|
|
11
|
+
/** Labels one labels response may hold (1,000). */
|
|
12
|
+
readonly maxLabels: number;
|
|
13
|
+
/** Message references one history page may hold across its five event fields (10,000). */
|
|
14
|
+
readonly maxHistoryReferences: number;
|
|
15
|
+
/** Characters of one page token, given or returned (4,096). */
|
|
16
|
+
readonly maxPageTokenCharacters: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* What a `GmailApi` is built from. Every value comes from trusted server configuration and the host's released
|
|
20
|
+
* account-source services; none comes from a browser request.
|
|
21
|
+
*
|
|
22
|
+
* @typeParam Prepared - The host's prepared-document type of its `SourceRevocations`.
|
|
23
|
+
*/
|
|
24
|
+
export interface GmailApiOptions<Prepared = unknown> {
|
|
25
|
+
/** The dedicated OAuth client the grant was issued to. */
|
|
26
|
+
readonly client: GmailOAuthClient;
|
|
27
|
+
/** The host's revocation service; its `withGrant` serializes every refresh under the durable grant lease. */
|
|
28
|
+
readonly revocations: Pick<SourceRevocations<Prepared>, 'withGrant'>;
|
|
29
|
+
/** Answers the sync handle current for this connection at each call, so a superseded handle is refused. */
|
|
30
|
+
readonly currentHandle: () => SourceSyncHandle;
|
|
31
|
+
/** The shared quota: each token refresh and each HTTP dispatch is one `run`, and provider waits go to `defer`. */
|
|
32
|
+
readonly quota: Pick<SourceQuota, 'run' | 'defer'>;
|
|
33
|
+
/** The opaque quota key of the project, 1 to 512 letters, digits, `:`, `_` or `-`. */
|
|
34
|
+
readonly projectKey: string;
|
|
35
|
+
/** Stable host HMAC key, never an address or a rotating connection id. */
|
|
36
|
+
readonly mailboxKey: string;
|
|
37
|
+
/** The thread mapper's bounds; `maxResponseBytes` also caps every API response before decoding. */
|
|
38
|
+
readonly bounds: GmailMappingBounds;
|
|
39
|
+
/** The transport and control-page limits. */
|
|
40
|
+
readonly limits: GmailApiLimits;
|
|
41
|
+
/** The fetch every token and API call goes through; the global fetch by default. */
|
|
42
|
+
readonly fetchImpl?: typeof fetch;
|
|
43
|
+
/**
|
|
44
|
+
* Epoch milliseconds; `Date.now` unless given. Give it the clock the host's sync store reads: a retry time this
|
|
45
|
+
* client hands back is always at least one millisecond after it, whichever clock produced the time.
|
|
46
|
+
*/
|
|
47
|
+
readonly clock?: () => number;
|
|
48
|
+
/** CI-only transport endpoints. No request-supplied origin or client value. */
|
|
49
|
+
readonly apiOrigin?: string;
|
|
50
|
+
/** CI-only OAuth stand-in endpoints, checked as `GmailOAuthFlow` checks them. */
|
|
51
|
+
readonly oauthEndpoints?: GmailOAuthEndpoints;
|
|
52
|
+
}
|
|
53
|
+
/** Server-memory identity result. Never serialize it into a source or telemetry. */
|
|
54
|
+
export interface GmailProfile {
|
|
55
|
+
/** The mailbox address, for the host's private comparison only. */
|
|
56
|
+
readonly emailAddress: string;
|
|
57
|
+
/** The mailbox's current history id as a decimal string. */
|
|
58
|
+
readonly historyId: string;
|
|
59
|
+
}
|
|
60
|
+
/** Sanitized label names and the labels response's own cache decision; a refused decision holds no names. */
|
|
61
|
+
export interface GmailLabels {
|
|
62
|
+
/** Sanitized names by label id. */
|
|
63
|
+
readonly names: Readonly<Record<string, string>>;
|
|
64
|
+
/** The decision for the labels response, independent of any thread response. */
|
|
65
|
+
readonly cache: SourceCacheDecision;
|
|
66
|
+
}
|
|
67
|
+
/** The per-read values of one `readThread` call, passed to the thread mapper with the response's times and headers. */
|
|
68
|
+
export interface GmailReadOptions {
|
|
69
|
+
/** The selection cutoff in epoch milliseconds. */
|
|
70
|
+
readonly cutoff: number;
|
|
71
|
+
/** The message window in milliseconds. */
|
|
72
|
+
readonly windowMs: number;
|
|
73
|
+
/** The host's authenticated relative source-detail path; never a Gmail link. */
|
|
74
|
+
readonly sourceDetailUrl: string;
|
|
75
|
+
/** The host's evidenced cache permission; null refuses durable content. */
|
|
76
|
+
readonly permission: SourceCachePermission | null;
|
|
77
|
+
/** The cycle's label snapshot from `labels`, or null to keep label ids without names. */
|
|
78
|
+
readonly labels: GmailLabels | null;
|
|
79
|
+
/** Cancels the read. */
|
|
80
|
+
readonly signal?: AbortSignal;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A client's fixed refusal; its message is `gmail_api_<reason>`. `configuration` is thrown by the constructor;
|
|
84
|
+
* `response_too_large` stays inside the client, which answers it as a skipped thread or an invalid control page.
|
|
85
|
+
*/
|
|
86
|
+
export declare class GmailApiFault extends Error {
|
|
87
|
+
readonly reason: 'configuration' | 'response_too_large';
|
|
88
|
+
/** @param reason Why the client refused. */
|
|
89
|
+
constructor(reason: 'configuration' | 'response_too_large');
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The capped, read-only Gmail API client. Each provider operation makes one attempt: one OAuth refresh inside the
|
|
93
|
+
* host's grant operation, then one HTTP dispatch, each admitted by the shared quota with a new attempt id; a 401 earns
|
|
94
|
+
* one fresh token and one repeat of the same call. Provider waits are recorded through the quota's `defer` and thrown
|
|
95
|
+
* as `rate_limited` or `provider_unavailable` with their time; the durable coordinator owns retry episodes, backoff
|
|
96
|
+
* and exhaustion. Every failure is a fixed `SourceSyncFault`.
|
|
97
|
+
*
|
|
98
|
+
* @typeParam Prepared - The host's prepared-document type of its `SourceRevocations`.
|
|
99
|
+
*/
|
|
100
|
+
export declare class GmailApi<Prepared = unknown> {
|
|
101
|
+
private readonly options;
|
|
102
|
+
private readonly origin;
|
|
103
|
+
private readonly send;
|
|
104
|
+
private readonly bounds;
|
|
105
|
+
private readonly limits;
|
|
106
|
+
private readonly mapper;
|
|
107
|
+
/**
|
|
108
|
+
* @param options The client, the host's grant and quota services, the quota keys, the bounds and limits, and the
|
|
109
|
+
* optional fetch, clock and CI-only endpoints.
|
|
110
|
+
* @throws {GmailApiFault} `configuration` for an origin override outside CI or not a loopback or `.invalid` origin,
|
|
111
|
+
* a limit outside its ceiling, or a malformed quota key.
|
|
112
|
+
* @throws {GmailMappingFault} `configuration` for invalid bounds.
|
|
113
|
+
*/
|
|
114
|
+
constructor(options: GmailApiOptions<Prepared>);
|
|
115
|
+
private now;
|
|
116
|
+
private later;
|
|
117
|
+
private pageToken;
|
|
118
|
+
private pageSize;
|
|
119
|
+
private quotaValue;
|
|
120
|
+
private reserve;
|
|
121
|
+
private defer;
|
|
122
|
+
private accessToken;
|
|
123
|
+
/** Consume/cancel the whole body within the quota callback, before releasing its slot. */
|
|
124
|
+
private wire;
|
|
125
|
+
private request;
|
|
126
|
+
private control;
|
|
127
|
+
/**
|
|
128
|
+
* The mailbox address and current history id, for the host's private account binding and its history anchor. The
|
|
129
|
+
* answer's other fields are dropped.
|
|
130
|
+
*
|
|
131
|
+
* @param signal Cancels the call.
|
|
132
|
+
* @throws {SourceSyncFault} A fixed failure, `invalid_response` for a malformed answer.
|
|
133
|
+
*/
|
|
134
|
+
profile(signal?: AbortSignal): Promise<GmailProfile>;
|
|
135
|
+
/**
|
|
136
|
+
* The mailbox's labels: sanitized names by id under the labels response's own cache decision. A refused decision
|
|
137
|
+
* keeps no names.
|
|
138
|
+
*
|
|
139
|
+
* @param permission The host's evidenced cache permission; null refuses the names.
|
|
140
|
+
* @param signal Cancels the call.
|
|
141
|
+
* @throws {SourceSyncFault} A fixed failure, `invalid_response` for a malformed or oversized list.
|
|
142
|
+
*/
|
|
143
|
+
labels(permission: SourceCachePermission | null, signal?: AbortSignal): Promise<GmailLabels>;
|
|
144
|
+
/**
|
|
145
|
+
* One page of candidate thread ids between `cutoff - windowMs` and `cutoff`, outside spam, trash and drafts. The
|
|
146
|
+
* query's whole-second bounds are widened by a second each way; the mapper enforces the exact window. Snippets and
|
|
147
|
+
* estimates are dropped, and no mailbox-wide completeness is claimed.
|
|
148
|
+
*
|
|
149
|
+
* @param cutoff The selection cutoff in epoch milliseconds.
|
|
150
|
+
* @param windowMs The window, from 1 millisecond to 90 days.
|
|
151
|
+
* @param pageSize Candidates per page, from 1 to 100.
|
|
152
|
+
* @param pageToken The resume token from the previous page, or null for the first.
|
|
153
|
+
* @param signal Cancels the call.
|
|
154
|
+
* @throws {SourceSyncFault} A fixed failure, `invalid_response` for bad arguments, a malformed page or a repeated
|
|
155
|
+
* page token.
|
|
156
|
+
*/
|
|
157
|
+
list(cutoff: number, windowMs: number, pageSize: number, pageToken: string | null, signal?: AbortSignal): Promise<SourceSyncScanPage>;
|
|
158
|
+
/**
|
|
159
|
+
* One page of history after `fromCursor`: the thread ids of every message addition, deletion and label change, and
|
|
160
|
+
* of generic message entries, deduplicated and sorted, with the page's decimal-string cursor. The host persists the
|
|
161
|
+
* pending work and commits a terminal cursor only once every item is terminal.
|
|
162
|
+
*
|
|
163
|
+
* @param fromCursor The committed history id, a decimal string.
|
|
164
|
+
* @param pageSize Records per page, from 1 to 100.
|
|
165
|
+
* @param pageToken The resume token from the previous page, or null for the first.
|
|
166
|
+
* @param signal Cancels the call.
|
|
167
|
+
* @throws {SourceSyncFault} `history_expired` when Google no longer holds the anchor; `invalid_response` for bad
|
|
168
|
+
* arguments, a malformed or out-of-order page, too many references or a repeated page token; another fixed failure.
|
|
169
|
+
*/
|
|
170
|
+
history(fromCursor: string, pageSize: number, pageToken: string | null, signal?: AbortSignal): Promise<SourceSyncHistoryPage>;
|
|
171
|
+
/**
|
|
172
|
+
* Reads one thread in the `full` format and maps it with its own read times and cache headers and the separate
|
|
173
|
+
* label snapshot. A 404 is `gone`; an oversized successful answer is skipped as `response_too_large`; any other
|
|
174
|
+
* result is the mapper's. The raw response never leaves the client.
|
|
175
|
+
*
|
|
176
|
+
* @param sourceId The thread id, 1 to 64 hexadecimal characters.
|
|
177
|
+
* @param options The cutoff, window, detail path, cache permission, label snapshot and signal.
|
|
178
|
+
* @throws {SourceSyncFault} A fixed failure, `invalid_response` for a malformed id.
|
|
179
|
+
*/
|
|
180
|
+
readThread(sourceId: string, options: GmailReadOptions): Promise<SourceSyncReadResult>;
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=gmail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gmail.d.ts","sourceRoot":"","sources":["../src/gmail.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,WAAW,EAAkD,KAAK,iBAAiB,EACxF,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAC5E,KAAK,qBAAqB,EAAE,KAAK,mBAAmB,EAC9E,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAExE,OAAO,EAA0B,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI5E;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0FAA0F;IAC1F,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,+DAA+D;IAC/D,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;CACzC;A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