@superdurable/connector-google-docs 0.0.0-stage → 0.1.1
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 +19 -2
- package/dex-connector.json +327 -0
- package/dist/chunk-2AMHZOKT.js +381 -0
- package/dist/connection-CAHPwRm8.d.ts +307 -0
- package/dist/index.d.ts +316 -0
- package/dist/index.js +1432 -0
- package/dist/mock.d.ts +142 -0
- package/dist/mock.js +338 -0
- package/package.json +58 -4
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { RefreshingCredentialProvider, SecretString, Query, Mutation, ConnectionRef } from '@superdurable/connectors-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
/** Connector configuration; omitted fields use manifest defaults. */
|
|
5
|
+
interface Config {
|
|
6
|
+
/** Google Docs API root URL to which the connector appends /v1/documents; leave blank for Google's public API. Enter an absolute HTTPS URL only for an explicitly supported compatible gateway. */
|
|
7
|
+
docsEndpoint?: string;
|
|
8
|
+
/** Google Drive API root URL to which createDocument appends /drive/v3 and /upload/drive/v3; leave blank for Google's public API. Enter an absolute HTTPS URL only for an explicitly supported compatible gateway. */
|
|
9
|
+
driveEndpoint?: string;
|
|
10
|
+
/** Maximum complete Google Docs document or Drive response in bytes; a document's JSON is several times larger than its text, so enter a positive integer only to read larger documents. A larger document read by getDocumentText selects tooLarge, and any other oversized response selects invalidResponse. */
|
|
11
|
+
maxResponseBytes?: number;
|
|
12
|
+
/** Maximum UTF-8 text in bytes that getDocumentText returns and that createDocument, replaceDocumentText, and appendText accept in one call; enter a positive integer no larger than 4 MiB only to change the safety limit. Longer rendered text selects tooLarge, and longer input selects defect before any request. */
|
|
13
|
+
maxTextBytes?: number;
|
|
14
|
+
}
|
|
15
|
+
/** Runtime schema for manifest configuration. */
|
|
16
|
+
declare const ConfigSchema: z.ZodObject<{
|
|
17
|
+
docsEndpoint: z.ZodOptional<z.ZodString>;
|
|
18
|
+
driveEndpoint: z.ZodOptional<z.ZodString>;
|
|
19
|
+
maxResponseBytes: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
maxTextBytes: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
/** Private connector credentials resolved by the host. */
|
|
23
|
+
interface Credentials {
|
|
24
|
+
/** Selected authorization method. */
|
|
25
|
+
authMethodId?: string;
|
|
26
|
+
/** Secret short-lived delegated access token minted automatically from the service-account assertion; never paste a token, and blank causes Dex to mint one before the next call. */
|
|
27
|
+
accessToken?: SecretString;
|
|
28
|
+
/** Complete Workspace user address whose documents the Flows read and edit, chosen by an administrator after authorizing the service account client ID at https://admin.google.com/ac/owl/domainwidedelegation; the value must be one user@example.com address and blank means no user can be impersonated. */
|
|
29
|
+
delegatedUser?: string;
|
|
30
|
+
/** Non-secret OAuth client ID copied from https://console.cloud.google.com/apis/credentials after opening APIs & Services > Credentials > OAuth 2.0 Client IDs; the value ends in .apps.googleusercontent.com and blank means authorization or refresh cannot start. */
|
|
31
|
+
oauthClientId?: string;
|
|
32
|
+
/** Secret OAuth client secret copied once from the selected Web application at https://console.cloud.google.com/apis/credentials; store it only in the credential form and blank means authorization or refresh cannot start. */
|
|
33
|
+
oauthClientSecret?: SecretString;
|
|
34
|
+
/** Secret long-lived refresh token returned by Google because offline access is requested; Dex stores and rotates it automatically, and blank means reauthorization is required. */
|
|
35
|
+
refreshToken?: SecretString;
|
|
36
|
+
/** Secret service-account JSON key downloaded from https://console.cloud.google.com/iam-admin/serviceaccounts after selecting the account > Keys > Add key > Create new key > JSON; blank means delegated token minting cannot start. */
|
|
37
|
+
serviceAccountKey?: SecretString;
|
|
38
|
+
}
|
|
39
|
+
/** Stored credential material that fails the connector credential checks, so no retry can succeed. */
|
|
40
|
+
declare class CredentialMaterialError extends TypeError {
|
|
41
|
+
constructor(message: string);
|
|
42
|
+
}
|
|
43
|
+
/** Report malformed stored credential material, also behind the SDK provider's decoding TypeError. */
|
|
44
|
+
declare function isCredentialMaterialError(error: unknown): boolean;
|
|
45
|
+
/** Decode private credential fields for the selected authorization method. */
|
|
46
|
+
declare function decodeCredentials(value: unknown): Credentials;
|
|
47
|
+
/** Decode shared credential fields for the selected authorization method. */
|
|
48
|
+
declare function decodeSharedCredentials(value: unknown): Credentials;
|
|
49
|
+
/** Host-owned source of private connector credentials. */
|
|
50
|
+
type CredentialSource = RefreshingCredentialProvider<Credentials>;
|
|
51
|
+
/** GetDocumentTextInput identifies the document whose first tab is read. */
|
|
52
|
+
interface GetDocumentTextInput {
|
|
53
|
+
/** DocumentID is the Google Docs document ID, the part of a
|
|
54
|
+
* docs.google.com/document/d/{documentId}/edit link after /d/. */
|
|
55
|
+
"documentId": string;
|
|
56
|
+
/** Format is markdown or plainText; blank renders Markdown. */
|
|
57
|
+
"format"?: "markdown" | "plainText" | (string & {}) | undefined;
|
|
58
|
+
}
|
|
59
|
+
/** GetDocumentTextOutput is the bounded text of a document's first tab, read
|
|
60
|
+
* with every pending suggestion rejected. The tooLarge branch returns the
|
|
61
|
+
* identity fields without Text. */
|
|
62
|
+
interface GetDocumentTextOutput {
|
|
63
|
+
/** DocumentID is the document that was read. */
|
|
64
|
+
"documentId": string;
|
|
65
|
+
/** Title is the document title shown in Google Docs and Drive. */
|
|
66
|
+
"title": string;
|
|
67
|
+
/** RevisionID identifies the revision that Text renders. Pass it as
|
|
68
|
+
* RequiredRevisionID to replaceDocumentText or appendText to write only
|
|
69
|
+
* over this revision. Google returns it only to a connection with edit
|
|
70
|
+
* access and guarantees it for 24 hours; it is empty for a viewer. */
|
|
71
|
+
"revisionId"?: string | undefined;
|
|
72
|
+
/** Format is the rendering of Text. */
|
|
73
|
+
"format": "markdown" | "plainText" | (string & {});
|
|
74
|
+
/** Text is the rendered body without headers, footers, footnote text,
|
|
75
|
+
* tables of contents, images, or equations. */
|
|
76
|
+
"text"?: string | undefined;
|
|
77
|
+
/** ByteCount is the UTF-8 byte length of Text. */
|
|
78
|
+
"byteCount": number;
|
|
79
|
+
/** HasOtherTabs reports that the document has tabs after the first, which
|
|
80
|
+
* this operation does not read. */
|
|
81
|
+
"hasOtherTabs"?: boolean | undefined;
|
|
82
|
+
}
|
|
83
|
+
/** CreateDocumentInput describes one new Google Doc. */
|
|
84
|
+
interface CreateDocumentInput {
|
|
85
|
+
/** Title is the new document's title; it must not be blank or contain line breaks. */
|
|
86
|
+
"title": string;
|
|
87
|
+
/** ParentFolderID is the destination Drive folder ID; blank creates the
|
|
88
|
+
* document in the My Drive root of the connection's account. */
|
|
89
|
+
"parentFolderId"?: string | undefined;
|
|
90
|
+
/** InitialText is the document's first content; blank creates an empty document. */
|
|
91
|
+
"initialText"?: string | undefined;
|
|
92
|
+
/** InitialTextFormat is plainText or markdown; blank imports plain text.
|
|
93
|
+
* Markdown asks Drive's Markdown import to create headings, lists, and tables. */
|
|
94
|
+
"initialTextFormat"?: "markdown" | "plainText" | (string & {}) | undefined;
|
|
95
|
+
}
|
|
96
|
+
/** CreatedDocument is the Drive metadata of a document createDocument created. */
|
|
97
|
+
interface CreatedDocument {
|
|
98
|
+
/** DocumentID is the Google Docs document ID, which is also its Drive file ID. */
|
|
99
|
+
"documentId": string;
|
|
100
|
+
/** Title is the document title. */
|
|
101
|
+
"title": string;
|
|
102
|
+
/** Parents lists the parent folder ID; Drive allows at most one parent. */
|
|
103
|
+
"parents"?: Array<string> | undefined;
|
|
104
|
+
/** WebViewLink opens the document in a browser for a user who can access it. */
|
|
105
|
+
"webViewLink"?: string | undefined;
|
|
106
|
+
/** CreatedTime is the creation time reported by Drive. */
|
|
107
|
+
"createdTime"?: string | undefined;
|
|
108
|
+
/** IsTrashed reports that someone moved the document to the trash after an earlier attempt created it. */
|
|
109
|
+
"isTrashed"?: boolean | undefined;
|
|
110
|
+
}
|
|
111
|
+
/** CreateDocumentOutput identifies the created document. */
|
|
112
|
+
interface CreateDocumentOutput {
|
|
113
|
+
/** Document is the created document's Drive metadata. */
|
|
114
|
+
"document": CreatedDocument;
|
|
115
|
+
/** IsFromEarlierAttempt reports that an earlier attempt of the same Step
|
|
116
|
+
* execution had already created Document, so this attempt created nothing. */
|
|
117
|
+
"isFromEarlierAttempt"?: boolean | undefined;
|
|
118
|
+
}
|
|
119
|
+
/** PlaceholderReplacement is one named text placeholder and its replacement. */
|
|
120
|
+
interface PlaceholderReplacement {
|
|
121
|
+
/** Placeholder is the exact, case-sensitive text to replace, such as
|
|
122
|
+
* {{effectiveDate}}. It is 1 to 256 bytes on one line. */
|
|
123
|
+
"placeholder": string;
|
|
124
|
+
/** Text replaces every occurrence; blank removes the placeholder. It cannot
|
|
125
|
+
* contain any requested placeholder. */
|
|
126
|
+
"text": string;
|
|
127
|
+
}
|
|
128
|
+
/** ReplaceDocumentTextInput describes one guarded replacement in a document's first tab. */
|
|
129
|
+
interface ReplaceDocumentTextInput {
|
|
130
|
+
/** DocumentID is the Google Docs document ID. */
|
|
131
|
+
"documentId": string;
|
|
132
|
+
/** RequiredRevisionID is the revision the replacement applies to, normally
|
|
133
|
+
* the RevisionID of a getDocumentText Step. Google applies the change only
|
|
134
|
+
* while the document is still at this revision. */
|
|
135
|
+
"requiredRevisionId": string;
|
|
136
|
+
/** Target is wholeBody or placeholders. */
|
|
137
|
+
"target": "placeholders" | "wholeBody" | (string & {});
|
|
138
|
+
/** Text is the new body text for wholeBody; blank empties the body. It is
|
|
139
|
+
* inserted literally, so Markdown markup is not interpreted. */
|
|
140
|
+
"text"?: string | undefined;
|
|
141
|
+
/** Placeholders lists the placeholders to replace for placeholders, such as
|
|
142
|
+
* {{effectiveDate}}; every one must occur in the body at RequiredRevisionID. */
|
|
143
|
+
"placeholders"?: Array<PlaceholderReplacement> | undefined;
|
|
144
|
+
}
|
|
145
|
+
/** PlaceholderReplacementResult is Google's count of replaced occurrences of one placeholder. */
|
|
146
|
+
interface PlaceholderReplacementResult {
|
|
147
|
+
/** Placeholder is the replaced placeholder. */
|
|
148
|
+
"placeholder": string;
|
|
149
|
+
/** OccurrencesChanged is the number of occurrences Google replaced. */
|
|
150
|
+
"occurrencesChanged": number;
|
|
151
|
+
}
|
|
152
|
+
/** ReplaceDocumentTextOutput reports the document after the replacement. */
|
|
153
|
+
interface ReplaceDocumentTextOutput {
|
|
154
|
+
/** DocumentID is the document that was changed. */
|
|
155
|
+
"documentId": string;
|
|
156
|
+
/** RevisionID is the document's revision after the replacement; on
|
|
157
|
+
* revisionChanged it is the current revision that blocked the write. It is
|
|
158
|
+
* empty only when Google omits it from a successful update response. */
|
|
159
|
+
"revisionId"?: string | undefined;
|
|
160
|
+
/** Replacements reports Google's occurrence count per placeholder when this attempt wrote. */
|
|
161
|
+
"replacements"?: Array<PlaceholderReplacementResult> | undefined;
|
|
162
|
+
/** MissingPlaceholders lists the placeholders absent on placeholderNotFound. */
|
|
163
|
+
"missingPlaceholders"?: Array<string> | undefined;
|
|
164
|
+
/** WasAlreadyApplied reports that this attempt wrote nothing because the
|
|
165
|
+
* document already held the requested text, normally written by an earlier
|
|
166
|
+
* attempt of the same Step execution whose response was lost or slow. */
|
|
167
|
+
"wasAlreadyApplied"?: boolean | undefined;
|
|
168
|
+
}
|
|
169
|
+
/** AppendTextInput describes text appended to the end of a document's first tab. */
|
|
170
|
+
interface AppendTextInput {
|
|
171
|
+
/** DocumentID is the Google Docs document ID. */
|
|
172
|
+
"documentId": string;
|
|
173
|
+
/** RequiredRevisionID is the revision the text is appended to, normally the
|
|
174
|
+
* RevisionID of a getDocumentText or replaceDocumentText Step. Google
|
|
175
|
+
* appends only while the document is still at this revision. */
|
|
176
|
+
"requiredRevisionId": string;
|
|
177
|
+
/** Text is appended as one or more plain normal-style paragraphs, one per
|
|
178
|
+
* line, after the body's last paragraph. It must not be blank. */
|
|
179
|
+
"text": string;
|
|
180
|
+
}
|
|
181
|
+
/** AppendTextOutput reports the document after the append. */
|
|
182
|
+
interface AppendTextOutput {
|
|
183
|
+
/** DocumentID is the document that was changed. */
|
|
184
|
+
"documentId": string;
|
|
185
|
+
/** RevisionID is the document's revision after the append; on
|
|
186
|
+
* revisionChanged it is the current revision that blocked the write. It is
|
|
187
|
+
* empty only when Google omits it from a successful update response. */
|
|
188
|
+
"revisionId"?: string | undefined;
|
|
189
|
+
/** WasAlreadyApplied reports that this attempt wrote nothing because the
|
|
190
|
+
* changed document already ends with the text, normally appended by an
|
|
191
|
+
* earlier attempt of the same Step execution whose response was lost or slow. */
|
|
192
|
+
"wasAlreadyApplied"?: boolean | undefined;
|
|
193
|
+
}
|
|
194
|
+
/** Runtime validator for GetDocumentTextInput. */
|
|
195
|
+
declare const GetDocumentTextInputSchema: z.ZodObject<{
|
|
196
|
+
documentId: z.ZodString;
|
|
197
|
+
format: z.ZodOptional<z.ZodString>;
|
|
198
|
+
}, z.core.$strict>;
|
|
199
|
+
/** Runtime validator for GetDocumentTextOutput. */
|
|
200
|
+
declare const GetDocumentTextOutputSchema: z.ZodObject<{
|
|
201
|
+
documentId: z.ZodString;
|
|
202
|
+
title: z.ZodString;
|
|
203
|
+
revisionId: z.ZodOptional<z.ZodString>;
|
|
204
|
+
format: z.ZodString;
|
|
205
|
+
text: z.ZodOptional<z.ZodString>;
|
|
206
|
+
byteCount: z.ZodNumber;
|
|
207
|
+
hasOtherTabs: z.ZodOptional<z.ZodBoolean>;
|
|
208
|
+
}, z.core.$strict>;
|
|
209
|
+
/** Runtime validator for CreateDocumentInput. */
|
|
210
|
+
declare const CreateDocumentInputSchema: z.ZodObject<{
|
|
211
|
+
title: z.ZodString;
|
|
212
|
+
parentFolderId: z.ZodOptional<z.ZodString>;
|
|
213
|
+
initialText: z.ZodOptional<z.ZodString>;
|
|
214
|
+
initialTextFormat: z.ZodOptional<z.ZodString>;
|
|
215
|
+
}, z.core.$strict>;
|
|
216
|
+
/** Runtime validator for CreatedDocument. */
|
|
217
|
+
declare const CreatedDocumentSchema: z.ZodObject<{
|
|
218
|
+
documentId: z.ZodString;
|
|
219
|
+
title: z.ZodString;
|
|
220
|
+
parents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
221
|
+
webViewLink: z.ZodOptional<z.ZodString>;
|
|
222
|
+
createdTime: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
223
|
+
isTrashed: z.ZodOptional<z.ZodBoolean>;
|
|
224
|
+
}, z.core.$strict>;
|
|
225
|
+
/** Runtime validator for CreateDocumentOutput. */
|
|
226
|
+
declare const CreateDocumentOutputSchema: z.ZodObject<{
|
|
227
|
+
document: z.ZodObject<{
|
|
228
|
+
documentId: z.ZodString;
|
|
229
|
+
title: z.ZodString;
|
|
230
|
+
parents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
231
|
+
webViewLink: z.ZodOptional<z.ZodString>;
|
|
232
|
+
createdTime: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
233
|
+
isTrashed: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
+
}, z.core.$strict>;
|
|
235
|
+
isFromEarlierAttempt: z.ZodOptional<z.ZodBoolean>;
|
|
236
|
+
}, z.core.$strict>;
|
|
237
|
+
/** Runtime validator for PlaceholderReplacement. */
|
|
238
|
+
declare const PlaceholderReplacementSchema: z.ZodObject<{
|
|
239
|
+
placeholder: z.ZodString;
|
|
240
|
+
text: z.ZodString;
|
|
241
|
+
}, z.core.$strict>;
|
|
242
|
+
/** Runtime validator for ReplaceDocumentTextInput. */
|
|
243
|
+
declare const ReplaceDocumentTextInputSchema: z.ZodObject<{
|
|
244
|
+
documentId: z.ZodString;
|
|
245
|
+
requiredRevisionId: z.ZodString;
|
|
246
|
+
target: z.ZodString;
|
|
247
|
+
text: z.ZodOptional<z.ZodString>;
|
|
248
|
+
placeholders: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
249
|
+
placeholder: z.ZodString;
|
|
250
|
+
text: z.ZodString;
|
|
251
|
+
}, z.core.$strict>>>;
|
|
252
|
+
}, z.core.$strict>;
|
|
253
|
+
/** Runtime validator for PlaceholderReplacementResult. */
|
|
254
|
+
declare const PlaceholderReplacementResultSchema: z.ZodObject<{
|
|
255
|
+
placeholder: z.ZodString;
|
|
256
|
+
occurrencesChanged: z.ZodNumber;
|
|
257
|
+
}, z.core.$strict>;
|
|
258
|
+
/** Runtime validator for ReplaceDocumentTextOutput. */
|
|
259
|
+
declare const ReplaceDocumentTextOutputSchema: z.ZodObject<{
|
|
260
|
+
documentId: z.ZodString;
|
|
261
|
+
revisionId: z.ZodOptional<z.ZodString>;
|
|
262
|
+
replacements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
263
|
+
placeholder: z.ZodString;
|
|
264
|
+
occurrencesChanged: z.ZodNumber;
|
|
265
|
+
}, z.core.$strict>>>;
|
|
266
|
+
missingPlaceholders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
267
|
+
wasAlreadyApplied: z.ZodOptional<z.ZodBoolean>;
|
|
268
|
+
}, z.core.$strict>;
|
|
269
|
+
/** Runtime validator for AppendTextInput. */
|
|
270
|
+
declare const AppendTextInputSchema: z.ZodObject<{
|
|
271
|
+
documentId: z.ZodString;
|
|
272
|
+
requiredRevisionId: z.ZodString;
|
|
273
|
+
text: z.ZodString;
|
|
274
|
+
}, z.core.$strict>;
|
|
275
|
+
/** Runtime validator for AppendTextOutput. */
|
|
276
|
+
declare const AppendTextOutputSchema: z.ZodObject<{
|
|
277
|
+
documentId: z.ZodString;
|
|
278
|
+
revisionId: z.ZodOptional<z.ZodString>;
|
|
279
|
+
wasAlreadyApplied: z.ZodOptional<z.ZodBoolean>;
|
|
280
|
+
}, z.core.$strict>;
|
|
281
|
+
|
|
282
|
+
/** Typed operations supplied by a client or mock. */
|
|
283
|
+
interface Operations {
|
|
284
|
+
/** Invoke getDocumentText through this connection. */
|
|
285
|
+
getDocumentText(): Query<GetDocumentTextInput, GetDocumentTextOutput>;
|
|
286
|
+
/** Invoke createDocument through this connection. */
|
|
287
|
+
createDocument(): Mutation<CreateDocumentInput, CreateDocumentOutput>;
|
|
288
|
+
/** Invoke replaceDocumentText through this connection. */
|
|
289
|
+
replaceDocumentText(): Mutation<ReplaceDocumentTextInput, ReplaceDocumentTextOutput>;
|
|
290
|
+
/** Invoke appendText through this connection. */
|
|
291
|
+
appendText(): Mutation<AppendTextInput, AppendTextOutput>;
|
|
292
|
+
}
|
|
293
|
+
/** Named connector connection kept outside Flow state. */
|
|
294
|
+
declare class Connection<BoundOperations = Operations> {
|
|
295
|
+
/** Stable provider and connection name. */
|
|
296
|
+
readonly reference: ConnectionRef;
|
|
297
|
+
/** Bound provider operations. */
|
|
298
|
+
readonly operations: BoundOperations;
|
|
299
|
+
/** Validate a reference and bind operations. */
|
|
300
|
+
constructor(reference: ConnectionRef, operations: BoundOperations);
|
|
301
|
+
}
|
|
302
|
+
/** Bind a client to a named connection. */
|
|
303
|
+
declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
|
|
304
|
+
/** Bind scripted operations to a named connection. */
|
|
305
|
+
declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
|
|
306
|
+
|
|
307
|
+
export { type AppendTextInput as A, newConnection as B, Connection as C, newConnectionWithOperations as D, type GetDocumentTextInput as G, type Operations as O, type PlaceholderReplacement as P, type ReplaceDocumentTextInput as R, type AppendTextOutput as a, type CreateDocumentInput as b, type CreateDocumentOutput as c, type GetDocumentTextOutput as d, type ReplaceDocumentTextOutput as e, type Config as f, type CredentialSource as g, type Credentials as h, AppendTextInputSchema as i, AppendTextOutputSchema as j, ConfigSchema as k, CreateDocumentInputSchema as l, CreateDocumentOutputSchema as m, type CreatedDocument as n, CreatedDocumentSchema as o, CredentialMaterialError as p, GetDocumentTextInputSchema as q, GetDocumentTextOutputSchema as r, type PlaceholderReplacementResult as s, PlaceholderReplacementResultSchema as t, PlaceholderReplacementSchema as u, ReplaceDocumentTextInputSchema as v, ReplaceDocumentTextOutputSchema as w, decodeCredentials as x, decodeSharedCredentials as y, isCredentialMaterialError as z };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { A as AppendTextInput, a as AppendTextOutput, C as Connection, b as CreateDocumentInput, c as CreateDocumentOutput, G as GetDocumentTextInput, d as GetDocumentTextOutput, R as ReplaceDocumentTextInput, e as ReplaceDocumentTextOutput, f as Config, g as CredentialSource, h as Credentials, O as Operations } from './connection-CAHPwRm8.js';
|
|
2
|
+
export { i as AppendTextInputSchema, j as AppendTextOutputSchema, k as ConfigSchema, l as CreateDocumentInputSchema, m as CreateDocumentOutputSchema, n as CreatedDocument, o as CreatedDocumentSchema, p as CredentialMaterialError, q as GetDocumentTextInputSchema, r as GetDocumentTextOutputSchema, P as PlaceholderReplacement, s as PlaceholderReplacementResult, t as PlaceholderReplacementResultSchema, u as PlaceholderReplacementSchema, v as ReplaceDocumentTextInputSchema, w as ReplaceDocumentTextOutputSchema, x as decodeCredentials, y as decodeSharedCredentials, z as isCredentialMaterialError, B as newConnection, D as newConnectionWithOperations } from './connection-CAHPwRm8.js';
|
|
3
|
+
import * as _superdurable_connectors_sdk from '@superdurable/connectors-sdk';
|
|
4
|
+
import { MutationDefinition, QueryDefinition, MutationStepConfig, Mutation, MutationResult, QueryStepConfig, Query, QueryResult, MutationStep, QueryStep, Call, QueryAttempt, MutationAttempt, CredentialRefreshDriver, ReceiptDraft } from '@superdurable/connectors-sdk';
|
|
5
|
+
import { StepTarget } from '@superdurable/dex';
|
|
6
|
+
import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
|
|
7
|
+
import { ProviderRequest, ProviderResponse } from '@superdurable/connectors-sdk/providerhttp';
|
|
8
|
+
import 'zod';
|
|
9
|
+
|
|
10
|
+
/** Stable connector identity. */
|
|
11
|
+
declare const ConnectorID = "google-docs";
|
|
12
|
+
/** Provider identity for named connections. */
|
|
13
|
+
declare const ProviderID = "google";
|
|
14
|
+
/** Branch IDs for getDocumentText. */
|
|
15
|
+
declare const GetDocumentTextBranch: {
|
|
16
|
+
readonly Read: "read";
|
|
17
|
+
readonly NotFound: "notFound";
|
|
18
|
+
readonly TooLarge: "tooLarge";
|
|
19
|
+
readonly ProviderRejected: "providerRejected";
|
|
20
|
+
readonly InvalidResponse: "invalidResponse";
|
|
21
|
+
readonly Defect: "defect";
|
|
22
|
+
};
|
|
23
|
+
/** The document text was rendered within the configured limit. */
|
|
24
|
+
declare const GetDocumentTextBranchRead: "read";
|
|
25
|
+
/** The document does not exist or the connection cannot see it. */
|
|
26
|
+
declare const GetDocumentTextBranchNotFound: "notFound";
|
|
27
|
+
/** The document response or its rendered text exceeds the configured limit. */
|
|
28
|
+
declare const GetDocumentTextBranchTooLarge: "tooLarge";
|
|
29
|
+
/** Google conclusively rejected the read, such as a revoked grant or a missing permission. */
|
|
30
|
+
declare const GetDocumentTextBranchProviderRejected: "providerRejected";
|
|
31
|
+
/** Google returned an invalid document response. */
|
|
32
|
+
declare const GetDocumentTextBranchInvalidResponse: "invalidResponse";
|
|
33
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
34
|
+
declare const GetDocumentTextBranchDefect: "defect";
|
|
35
|
+
/** Manifest definition for getDocumentText. */
|
|
36
|
+
declare const GetDocumentTextDefinition: QueryDefinition;
|
|
37
|
+
/** Manifest metadata for getDocumentText. */
|
|
38
|
+
declare const GetDocumentTextMetadata: {
|
|
39
|
+
readonly kind: "query";
|
|
40
|
+
readonly idempotency: "none";
|
|
41
|
+
readonly authorization: "required";
|
|
42
|
+
};
|
|
43
|
+
/** Branch IDs for createDocument. */
|
|
44
|
+
declare const CreateDocumentBranch: {
|
|
45
|
+
readonly Created: "created";
|
|
46
|
+
readonly ProviderRejected: "providerRejected";
|
|
47
|
+
readonly InvalidResponse: "invalidResponse";
|
|
48
|
+
readonly Uncertain: "uncertain";
|
|
49
|
+
readonly Defect: "defect";
|
|
50
|
+
};
|
|
51
|
+
/** Google created the document or returned the one an earlier attempt of the same Step execution created. */
|
|
52
|
+
declare const CreateDocumentBranchCreated: "created";
|
|
53
|
+
/** Google conclusively rejected the creation or the duplicate lookup, such as a missing parent folder; no document was created. */
|
|
54
|
+
declare const CreateDocumentBranchProviderRejected: "providerRejected";
|
|
55
|
+
/** Google returned an invalid or oversized duplicate-lookup response before the creation was sent. */
|
|
56
|
+
declare const CreateDocumentBranchInvalidResponse: "invalidResponse";
|
|
57
|
+
/** A creation may have been sent and cannot be confirmed: the duplicate lookup found nothing when the send cap was reached, including after Google accepted it with an unusable response that carries no file ID, Google refused a resend, or the connection needed reauthorization after a possible send; the document may exist, and the connector sends nothing after selecting this branch. */
|
|
58
|
+
declare const CreateDocumentBranchUncertain: "uncertain";
|
|
59
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
60
|
+
declare const CreateDocumentBranchDefect: "defect";
|
|
61
|
+
/** Manifest definition for createDocument. */
|
|
62
|
+
declare const CreateDocumentDefinition: MutationDefinition;
|
|
63
|
+
/** Manifest metadata for createDocument. */
|
|
64
|
+
declare const CreateDocumentMetadata: {
|
|
65
|
+
readonly kind: "mutation";
|
|
66
|
+
readonly idempotency: "required";
|
|
67
|
+
readonly authorization: "required";
|
|
68
|
+
};
|
|
69
|
+
/** Branch IDs for replaceDocumentText. */
|
|
70
|
+
declare const ReplaceDocumentTextBranch: {
|
|
71
|
+
readonly Replaced: "replaced";
|
|
72
|
+
readonly PlaceholderNotFound: "placeholderNotFound";
|
|
73
|
+
readonly RevisionChanged: "revisionChanged";
|
|
74
|
+
readonly NotFound: "notFound";
|
|
75
|
+
readonly ProviderRejected: "providerRejected";
|
|
76
|
+
readonly InvalidResponse: "invalidResponse";
|
|
77
|
+
readonly Defect: "defect";
|
|
78
|
+
};
|
|
79
|
+
/** The document holds the requested text, written by this attempt or an earlier attempt of the same Step execution. */
|
|
80
|
+
declare const ReplaceDocumentTextBranchReplaced: "replaced";
|
|
81
|
+
/** A requested placeholder does not occur in the body at the required revision; nothing was written. */
|
|
82
|
+
declare const ReplaceDocumentTextBranchPlaceholderNotFound: "placeholderNotFound";
|
|
83
|
+
/** The document changed after the required revision and does not hold the requested text; nothing was written. */
|
|
84
|
+
declare const ReplaceDocumentTextBranchRevisionChanged: "revisionChanged";
|
|
85
|
+
/** The document does not exist or the connection cannot see it. */
|
|
86
|
+
declare const ReplaceDocumentTextBranchNotFound: "notFound";
|
|
87
|
+
/** Google conclusively rejected the change, such as a connection without edit access. */
|
|
88
|
+
declare const ReplaceDocumentTextBranchProviderRejected: "providerRejected";
|
|
89
|
+
/** Google returned an invalid or oversized document response. */
|
|
90
|
+
declare const ReplaceDocumentTextBranchInvalidResponse: "invalidResponse";
|
|
91
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
92
|
+
declare const ReplaceDocumentTextBranchDefect: "defect";
|
|
93
|
+
/** Manifest definition for replaceDocumentText. */
|
|
94
|
+
declare const ReplaceDocumentTextDefinition: MutationDefinition;
|
|
95
|
+
/** Manifest metadata for replaceDocumentText. */
|
|
96
|
+
declare const ReplaceDocumentTextMetadata: {
|
|
97
|
+
readonly kind: "mutation";
|
|
98
|
+
readonly idempotency: "required";
|
|
99
|
+
readonly authorization: "required";
|
|
100
|
+
};
|
|
101
|
+
/** Branch IDs for appendText. */
|
|
102
|
+
declare const AppendTextBranch: {
|
|
103
|
+
readonly Appended: "appended";
|
|
104
|
+
readonly RevisionChanged: "revisionChanged";
|
|
105
|
+
readonly NotFound: "notFound";
|
|
106
|
+
readonly ProviderRejected: "providerRejected";
|
|
107
|
+
readonly InvalidResponse: "invalidResponse";
|
|
108
|
+
readonly Defect: "defect";
|
|
109
|
+
};
|
|
110
|
+
/** The document ends with the requested text, appended by this attempt or an earlier attempt of the same Step execution. */
|
|
111
|
+
declare const AppendTextBranchAppended: "appended";
|
|
112
|
+
/** The document changed after the required revision and does not end with the requested text; nothing was written. */
|
|
113
|
+
declare const AppendTextBranchRevisionChanged: "revisionChanged";
|
|
114
|
+
/** The document does not exist or the connection cannot see it. */
|
|
115
|
+
declare const AppendTextBranchNotFound: "notFound";
|
|
116
|
+
/** Google conclusively rejected the change, such as a connection without edit access. */
|
|
117
|
+
declare const AppendTextBranchProviderRejected: "providerRejected";
|
|
118
|
+
/** Google returned an invalid or oversized document response. */
|
|
119
|
+
declare const AppendTextBranchInvalidResponse: "invalidResponse";
|
|
120
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
121
|
+
declare const AppendTextBranchDefect: "defect";
|
|
122
|
+
/** Manifest definition for appendText. */
|
|
123
|
+
declare const AppendTextDefinition: MutationDefinition;
|
|
124
|
+
/** Manifest metadata for appendText. */
|
|
125
|
+
declare const AppendTextMetadata: {
|
|
126
|
+
readonly kind: "mutation";
|
|
127
|
+
readonly idempotency: "required";
|
|
128
|
+
readonly authorization: "required";
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/** Configuration for the getDocumentText connector Step. */
|
|
132
|
+
interface GetDocumentTextStepConfig<StepInput, OperationInput = GetDocumentTextInput, OperationOutput = GetDocumentTextOutput> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
133
|
+
/** Named connection supplying this operation. */
|
|
134
|
+
connection: Connection<{
|
|
135
|
+
getDocumentText(): Query<OperationInput, OperationOutput>;
|
|
136
|
+
}>;
|
|
137
|
+
/** Name matching the bound connection. */
|
|
138
|
+
connectionName: string;
|
|
139
|
+
/** The document text was rendered within the configured limit. */
|
|
140
|
+
read: StepTarget<QueryResult<OperationOutput>>;
|
|
141
|
+
/** The document does not exist or the connection cannot see it. */
|
|
142
|
+
notFound?: StepTarget<QueryResult<OperationOutput>>;
|
|
143
|
+
/** The document response or its rendered text exceeds the configured limit. */
|
|
144
|
+
tooLarge?: StepTarget<QueryResult<OperationOutput>>;
|
|
145
|
+
/** Google conclusively rejected the read, such as a revoked grant or a missing permission. */
|
|
146
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
147
|
+
/** Google returned an invalid document response. */
|
|
148
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
149
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
150
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
151
|
+
}
|
|
152
|
+
/** Build the getDocumentText Step from a named connection. */
|
|
153
|
+
declare function newGetDocumentTextStep<StepInput, OperationInput = GetDocumentTextInput, OperationOutput = GetDocumentTextOutput>(configuration: GetDocumentTextStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
154
|
+
/** Configuration for the createDocument connector Step. */
|
|
155
|
+
interface CreateDocumentStepConfig<StepInput, OperationInput = CreateDocumentInput, OperationOutput = CreateDocumentOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
156
|
+
/** Named connection supplying this operation. */
|
|
157
|
+
connection: Connection<{
|
|
158
|
+
createDocument(): Mutation<OperationInput, OperationOutput>;
|
|
159
|
+
}>;
|
|
160
|
+
/** Name matching the bound connection. */
|
|
161
|
+
connectionName: string;
|
|
162
|
+
/** Google created the document or returned the one an earlier attempt of the same Step execution created. */
|
|
163
|
+
created: StepTarget<MutationResult<OperationOutput>>;
|
|
164
|
+
/** Google conclusively rejected the creation or the duplicate lookup, such as a missing parent folder; no document was created. */
|
|
165
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
166
|
+
/** Google returned an invalid or oversized duplicate-lookup response before the creation was sent. */
|
|
167
|
+
invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
|
|
168
|
+
/** A creation may have been sent and cannot be confirmed: the duplicate lookup found nothing when the send cap was reached, including after Google accepted it with an unusable response that carries no file ID, Google refused a resend, or the connection needed reauthorization after a possible send; the document may exist, and the connector sends nothing after selecting this branch. */
|
|
169
|
+
uncertain?: StepTarget<MutationResult<OperationOutput>>;
|
|
170
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
171
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
172
|
+
}
|
|
173
|
+
/** Build the createDocument Step from a named connection. */
|
|
174
|
+
declare function newCreateDocumentStep<StepInput, OperationInput = CreateDocumentInput, OperationOutput = CreateDocumentOutput>(configuration: CreateDocumentStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
175
|
+
/** Configuration for the replaceDocumentText connector Step. */
|
|
176
|
+
interface ReplaceDocumentTextStepConfig<StepInput, OperationInput = ReplaceDocumentTextInput, OperationOutput = ReplaceDocumentTextOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
177
|
+
/** Named connection supplying this operation. */
|
|
178
|
+
connection: Connection<{
|
|
179
|
+
replaceDocumentText(): Mutation<OperationInput, OperationOutput>;
|
|
180
|
+
}>;
|
|
181
|
+
/** Name matching the bound connection. */
|
|
182
|
+
connectionName: string;
|
|
183
|
+
/** The document holds the requested text, written by this attempt or an earlier attempt of the same Step execution. */
|
|
184
|
+
replaced: StepTarget<MutationResult<OperationOutput>>;
|
|
185
|
+
/** A requested placeholder does not occur in the body at the required revision; nothing was written. */
|
|
186
|
+
placeholderNotFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
187
|
+
/** The document changed after the required revision and does not hold the requested text; nothing was written. */
|
|
188
|
+
revisionChanged?: StepTarget<MutationResult<OperationOutput>>;
|
|
189
|
+
/** The document does not exist or the connection cannot see it. */
|
|
190
|
+
notFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
191
|
+
/** Google conclusively rejected the change, such as a connection without edit access. */
|
|
192
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
193
|
+
/** Google returned an invalid or oversized document response. */
|
|
194
|
+
invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
|
|
195
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
196
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
197
|
+
/** Accepted for compatibility; ignored because the operation is safe to repeat. */
|
|
198
|
+
maxSends?: number;
|
|
199
|
+
}
|
|
200
|
+
/** Build the replaceDocumentText Step from a named connection. */
|
|
201
|
+
declare function newReplaceDocumentTextStep<StepInput, OperationInput = ReplaceDocumentTextInput, OperationOutput = ReplaceDocumentTextOutput>(configuration: ReplaceDocumentTextStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
202
|
+
/** Configuration for the appendText connector Step. */
|
|
203
|
+
interface AppendTextStepConfig<StepInput, OperationInput = AppendTextInput, OperationOutput = AppendTextOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
204
|
+
/** Named connection supplying this operation. */
|
|
205
|
+
connection: Connection<{
|
|
206
|
+
appendText(): Mutation<OperationInput, OperationOutput>;
|
|
207
|
+
}>;
|
|
208
|
+
/** Name matching the bound connection. */
|
|
209
|
+
connectionName: string;
|
|
210
|
+
/** The document ends with the requested text, appended by this attempt or an earlier attempt of the same Step execution. */
|
|
211
|
+
appended: StepTarget<MutationResult<OperationOutput>>;
|
|
212
|
+
/** The document changed after the required revision and does not end with the requested text; nothing was written. */
|
|
213
|
+
revisionChanged?: StepTarget<MutationResult<OperationOutput>>;
|
|
214
|
+
/** The document does not exist or the connection cannot see it. */
|
|
215
|
+
notFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
216
|
+
/** Google conclusively rejected the change, such as a connection without edit access. */
|
|
217
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
218
|
+
/** Google returned an invalid or oversized document response. */
|
|
219
|
+
invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
|
|
220
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
221
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
222
|
+
/** Accepted for compatibility; ignored because the operation is safe to repeat. */
|
|
223
|
+
maxSends?: number;
|
|
224
|
+
}
|
|
225
|
+
/** Build the appendText Step from a named connection. */
|
|
226
|
+
declare function newAppendTextStep<StepInput, OperationInput = AppendTextInput, OperationOutput = AppendTextOutput>(configuration: AppendTextStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
227
|
+
|
|
228
|
+
/** Read the first tab as Markdown or plain text. */
|
|
229
|
+
declare class GetDocumentTextOperation implements Query<GetDocumentTextInput, GetDocumentTextOutput> {
|
|
230
|
+
private readonly client;
|
|
231
|
+
/** Bind a validated Docs client. */
|
|
232
|
+
constructor(client: DocsClient);
|
|
233
|
+
/** Return the immutable operation definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
234
|
+
/** Validate, read, and render one Google Docs revision. */
|
|
235
|
+
invoke(call: Call, input: GetDocumentTextInput): Promise<QueryAttempt<GetDocumentTextOutput>>;
|
|
236
|
+
}
|
|
237
|
+
/** Replace the first-tab body or named placeholders under a required revision. */
|
|
238
|
+
declare class ReplaceDocumentTextOperation implements Mutation<ReplaceDocumentTextInput, ReplaceDocumentTextOutput> {
|
|
239
|
+
private readonly client;
|
|
240
|
+
/** Bind a validated Docs client. */
|
|
241
|
+
constructor(client: DocsClient);
|
|
242
|
+
/** Return the immutable operation definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
|
|
243
|
+
/** Use the stable Dex Call ID; the revision guards the write. */ idempotencyKey(callId: string): string;
|
|
244
|
+
/** Validate and run one revision-guarded replacement. */
|
|
245
|
+
invoke(call: Call, input: ReplaceDocumentTextInput): Promise<MutationAttempt<ReplaceDocumentTextOutput>>;
|
|
246
|
+
}
|
|
247
|
+
/** Append paragraphs under a required revision. */
|
|
248
|
+
declare class AppendTextOperation implements Mutation<AppendTextInput, AppendTextOutput> {
|
|
249
|
+
private readonly client;
|
|
250
|
+
/** Bind a validated Docs client. */
|
|
251
|
+
constructor(client: DocsClient);
|
|
252
|
+
/** Return the immutable operation definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
|
|
253
|
+
/** Use the stable Dex Call ID; the revision guards the write. */ idempotencyKey(callId: string): string;
|
|
254
|
+
/** Validate and run one revision-guarded append. */
|
|
255
|
+
invoke(call: Call, input: AppendTextInput): Promise<MutationAttempt<AppendTextOutput>>;
|
|
256
|
+
}
|
|
257
|
+
/** Create one document with a single-dispatch fence and duplicate lookup. */
|
|
258
|
+
declare class CreateDocumentOperation implements Mutation<CreateDocumentInput, CreateDocumentOutput> {
|
|
259
|
+
private readonly client;
|
|
260
|
+
/** Bind a validated Docs client. */
|
|
261
|
+
constructor(client: DocsClient);
|
|
262
|
+
/** Return the immutable operation definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
|
|
263
|
+
/** Use the stable Dex Call ID as Drive's private app-property value. */ idempotencyKey(callId: string): string;
|
|
264
|
+
/** Validate, reconcile, and create no more than once per Dex Call. */
|
|
265
|
+
invoke(call: Call, input: CreateDocumentInput): Promise<MutationAttempt<CreateDocumentOutput>>;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/** Replaceable bounded transport for an in-process provider stand-in. */
|
|
269
|
+
type DocsTransport = (request: ProviderRequest) => Promise<ProviderResponse>;
|
|
270
|
+
/** A bounded Google response, marking a non-2xx body dropped for its size. */
|
|
271
|
+
interface DocsResponse extends ProviderResponse {
|
|
272
|
+
/** The non-2xx body exceeded the error limit, so it could hide a created object. */ isErrorBodyTooLarge?: boolean;
|
|
273
|
+
}
|
|
274
|
+
/** Constructor-injected transport, clock, and manifest refresh driver. */
|
|
275
|
+
interface DocsClientOptions {
|
|
276
|
+
/** Provider transport; defaults to the SDK's policy-checked HTTP sender. */
|
|
277
|
+
transport?: DocsTransport;
|
|
278
|
+
/** Clock used for receipts and Retry-After dates. */
|
|
279
|
+
now?: () => Date;
|
|
280
|
+
/** Optional refresh driver override for tests. */
|
|
281
|
+
refreshDriver?: CredentialRefreshDriver<Credentials>;
|
|
282
|
+
}
|
|
283
|
+
/** Validated Google Docs and Drive client bound to host-managed credentials. */
|
|
284
|
+
declare class DocsClient {
|
|
285
|
+
#private;
|
|
286
|
+
/** Documents API root including /v1/documents. */ readonly documentsBaseURL: string;
|
|
287
|
+
/** Drive files API root. */ readonly driveBaseURL: string;
|
|
288
|
+
/** Drive upload API root. */ readonly driveUploadBaseURL: string;
|
|
289
|
+
/** Maximum accepted successful response size. */ readonly maxResponseBytes: number;
|
|
290
|
+
/** Maximum UTF-8 text size. */ readonly maxTextBytes: number;
|
|
291
|
+
/** Apply manifest defaults and bind required host dependencies. */
|
|
292
|
+
constructor(config: Config, credentials: CredentialSource, options?: DocsClientOptions);
|
|
293
|
+
/** Bind the getDocumentText operation. */ getDocumentText(): GetDocumentTextOperation;
|
|
294
|
+
/** Bind the createDocument operation. */ createDocument(): CreateDocumentOperation;
|
|
295
|
+
/** Bind the replaceDocumentText operation. */ replaceDocumentText(): ReplaceDocumentTextOperation;
|
|
296
|
+
/** Bind the appendText operation. */ appendText(): AppendTextOperation;
|
|
297
|
+
/** Resolve the current access token, including a host-coordinated refresh. */
|
|
298
|
+
/**
|
|
299
|
+
* Resolve one call's credentials. Throws ReauthorizationRequiredError when the connection must be
|
|
300
|
+
* reconnected or holds an unusable credential, and a TypeError for an outage a later attempt may clear.
|
|
301
|
+
*/
|
|
302
|
+
resolveCredentials(call: Call): Promise<Credentials>;
|
|
303
|
+
/** Ask the host to refresh after one rejected access token. */
|
|
304
|
+
/** Throws ReauthorizationRequiredError for a terminal or unusable refresh, and a TypeError for a transient one. */
|
|
305
|
+
refreshCredentialsAfterRejection(call: Call): Promise<Credentials>;
|
|
306
|
+
/** Send one request; an idempotent request may refresh once after a 401. */
|
|
307
|
+
request(call: Call, credentials: Credentials, method: string, url: string, body?: Uint8Array, contentType?: string, singleDispatch?: boolean, signal?: AbortSignal): Promise<DocsResponse>;
|
|
308
|
+
/** Return a receipt with only provider-safe identifiers. */
|
|
309
|
+
receipt(call: Call, response: ProviderResponse | undefined, objectID?: string): ReceiptDraft;
|
|
310
|
+
/** Return the observation clock for Retry-After dates. */ now(): Date;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/** Open a statically named Google Docs connection from a loaded Dex project. */
|
|
314
|
+
declare function newProjectConnection(project: LoadedProject, connectionName: string, options?: DocsClientOptions): Connection<Operations>;
|
|
315
|
+
|
|
316
|
+
export { AppendTextBranch, AppendTextBranchAppended, AppendTextBranchDefect, AppendTextBranchInvalidResponse, AppendTextBranchNotFound, AppendTextBranchProviderRejected, AppendTextBranchRevisionChanged, AppendTextDefinition, AppendTextInput, AppendTextMetadata, AppendTextOperation, AppendTextOutput, type AppendTextStepConfig, Config, Connection, ConnectorID, CreateDocumentBranch, CreateDocumentBranchCreated, CreateDocumentBranchDefect, CreateDocumentBranchInvalidResponse, CreateDocumentBranchProviderRejected, CreateDocumentBranchUncertain, CreateDocumentDefinition, CreateDocumentInput, CreateDocumentMetadata, CreateDocumentOperation, CreateDocumentOutput, type CreateDocumentStepConfig, CredentialSource, Credentials, DocsClient, type DocsClientOptions, type DocsTransport, GetDocumentTextBranch, GetDocumentTextBranchDefect, GetDocumentTextBranchInvalidResponse, GetDocumentTextBranchNotFound, GetDocumentTextBranchProviderRejected, GetDocumentTextBranchRead, GetDocumentTextBranchTooLarge, GetDocumentTextDefinition, GetDocumentTextInput, GetDocumentTextMetadata, GetDocumentTextOperation, GetDocumentTextOutput, type GetDocumentTextStepConfig, ProviderID, ReplaceDocumentTextBranch, ReplaceDocumentTextBranchDefect, ReplaceDocumentTextBranchInvalidResponse, ReplaceDocumentTextBranchNotFound, ReplaceDocumentTextBranchPlaceholderNotFound, ReplaceDocumentTextBranchProviderRejected, ReplaceDocumentTextBranchReplaced, ReplaceDocumentTextBranchRevisionChanged, ReplaceDocumentTextDefinition, ReplaceDocumentTextInput, ReplaceDocumentTextMetadata, ReplaceDocumentTextOperation, ReplaceDocumentTextOutput, type ReplaceDocumentTextStepConfig, newAppendTextStep, newCreateDocumentStep, newGetDocumentTextStep, newProjectConnection, newReplaceDocumentTextStep };
|