@superdurable/connector-docusign 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.
@@ -0,0 +1,402 @@
1
+ import { C as CreateEnvelopeFromTemplateInput, a as CreatedEnvelope, b as Connection, D as DownloadCombinedDocumentInput, c as CombinedDocument, G as GetEnvelopeInput, E as Envelope, L as ListEnvelopeRecipientsInput, d as EnvelopeRecipients, V as VoidEnvelopeInput, e as VoidedEnvelope, f as CredentialSource, g as Config, h as Credentials, O as Operations } from './connection-YEptevxS.js';
2
+ export { i as CombinedDocumentSchema, j as ConfigSchema, k as CreateEnvelopeFromTemplateInputSchema, l as CreatedEnvelopeSchema, m as DownloadCombinedDocumentInputSchema, n as EnvelopeCustomField, o as EnvelopeCustomFieldSchema, p as EnvelopeRecipientsSchema, q as EnvelopeSchema, r as GetEnvelopeInputSchema, s as ListEnvelopeRecipientsInputSchema, R as Recipient, t as RecipientSchema, T as TemplateRole, u as TemplateRoleSchema, v as VoidEnvelopeInputSchema, w as VoidedEnvelopeSchema, x as decodeCredentials, y as decodeSharedCredentials, z as newConnection, A as newConnectionWithOperations } from './connection-YEptevxS.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, Failure, 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 = "docusign";
12
+ /** Provider identity for named connections. */
13
+ declare const ProviderID = "docusign";
14
+ /** Branch IDs for createEnvelopeFromTemplate. */
15
+ declare const CreateEnvelopeFromTemplateBranch: {
16
+ readonly Created: "created";
17
+ readonly ProviderRejected: "providerRejected";
18
+ readonly Uncertain: "uncertain";
19
+ readonly Defect: "defect";
20
+ };
21
+ /** DocuSign holds the envelope this Step execution created; wasRecovered tells whether a later attempt found it by its custom field after an interrupted one. */
22
+ declare const CreateEnvelopeFromTemplateBranchCreated: "created";
23
+ /** DocuSign conclusively rejected the envelope, such as an unknown template, an unfilled or unknown role, an invalid email address, an exhausted envelope allowance, or a user who may not send; nothing was created. */
24
+ declare const CreateEnvelopeFromTemplateBranchProviderRejected: "providerRejected";
25
+ /** The create request was sent but DocuSign's answer was lost, a server error, or unreadable, and no envelope with this Step's custom field could be found, so an envelope may exist that this Result does not name; do not create another automatically. */
26
+ declare const CreateEnvelopeFromTemplateBranchUncertain: "uncertain";
27
+ /** Local input, connection configuration, or connector definition is invalid. */
28
+ declare const CreateEnvelopeFromTemplateBranchDefect: "defect";
29
+ /** Manifest definition for createEnvelopeFromTemplate. */
30
+ declare const CreateEnvelopeFromTemplateDefinition: MutationDefinition;
31
+ /** Manifest metadata for createEnvelopeFromTemplate. */
32
+ declare const CreateEnvelopeFromTemplateMetadata: {
33
+ readonly kind: "mutation";
34
+ readonly idempotency: "required";
35
+ readonly authorization: "required";
36
+ };
37
+ /** Branch IDs for getEnvelope. */
38
+ declare const GetEnvelopeBranch: {
39
+ readonly Found: "found";
40
+ readonly NotFound: "notFound";
41
+ readonly ProviderRejected: "providerRejected";
42
+ readonly InvalidResponse: "invalidResponse";
43
+ readonly Defect: "defect";
44
+ };
45
+ /** DocuSign returned the envelope. */
46
+ declare const GetEnvelopeBranchFound: "found";
47
+ /** The envelope does not exist in the connection's account or the user may not see it. */
48
+ declare const GetEnvelopeBranchNotFound: "notFound";
49
+ /** DocuSign conclusively rejected the read, such as a revoked consent or a user without access to the account. */
50
+ declare const GetEnvelopeBranchProviderRejected: "providerRejected";
51
+ /** DocuSign returned a malformed or oversized response. */
52
+ declare const GetEnvelopeBranchInvalidResponse: "invalidResponse";
53
+ /** Local input, connection configuration, or connector definition is invalid. */
54
+ declare const GetEnvelopeBranchDefect: "defect";
55
+ /** Manifest definition for getEnvelope. */
56
+ declare const GetEnvelopeDefinition: QueryDefinition;
57
+ /** Manifest metadata for getEnvelope. */
58
+ declare const GetEnvelopeMetadata: {
59
+ readonly kind: "query";
60
+ readonly idempotency: "none";
61
+ readonly authorization: "required";
62
+ };
63
+ /** Branch IDs for listEnvelopeRecipients. */
64
+ declare const ListEnvelopeRecipientsBranch: {
65
+ readonly Listed: "listed";
66
+ readonly NotFound: "notFound";
67
+ readonly ProviderRejected: "providerRejected";
68
+ readonly InvalidResponse: "invalidResponse";
69
+ readonly Defect: "defect";
70
+ };
71
+ /** DocuSign returned the envelope's recipients. */
72
+ declare const ListEnvelopeRecipientsBranchListed: "listed";
73
+ /** The envelope does not exist in the connection's account or the user may not see it. */
74
+ declare const ListEnvelopeRecipientsBranchNotFound: "notFound";
75
+ /** DocuSign conclusively rejected the read, such as a revoked consent or a user without access to the account. */
76
+ declare const ListEnvelopeRecipientsBranchProviderRejected: "providerRejected";
77
+ /** DocuSign returned a malformed or oversized response. */
78
+ declare const ListEnvelopeRecipientsBranchInvalidResponse: "invalidResponse";
79
+ /** Local input, connection configuration, or connector definition is invalid. */
80
+ declare const ListEnvelopeRecipientsBranchDefect: "defect";
81
+ /** Manifest definition for listEnvelopeRecipients. */
82
+ declare const ListEnvelopeRecipientsDefinition: QueryDefinition;
83
+ /** Manifest metadata for listEnvelopeRecipients. */
84
+ declare const ListEnvelopeRecipientsMetadata: {
85
+ readonly kind: "query";
86
+ readonly idempotency: "none";
87
+ readonly authorization: "required";
88
+ };
89
+ /** Branch IDs for voidEnvelope. */
90
+ declare const VoidEnvelopeBranch: {
91
+ readonly Voided: "voided";
92
+ readonly NotVoidable: "notVoidable";
93
+ readonly NotFound: "notFound";
94
+ readonly ProviderRejected: "providerRejected";
95
+ readonly InvalidResponse: "invalidResponse";
96
+ readonly Defect: "defect";
97
+ };
98
+ /** The envelope is voided, by this call or earlier; wasAlreadyVoided tells which. */
99
+ declare const VoidEnvelopeBranchVoided: "voided";
100
+ /** The envelope is completed, declined, or still a draft, which DocuSign does not void; status names which. */
101
+ declare const VoidEnvelopeBranchNotVoidable: "notVoidable";
102
+ /** The envelope does not exist in the connection's account or the user may not see it. */
103
+ declare const VoidEnvelopeBranchNotFound: "notFound";
104
+ /** DocuSign conclusively rejected the void, such as a user who is not the sender or lacks permission. */
105
+ declare const VoidEnvelopeBranchProviderRejected: "providerRejected";
106
+ /** DocuSign returned a malformed or oversized response. */
107
+ declare const VoidEnvelopeBranchInvalidResponse: "invalidResponse";
108
+ /** Local input, connection configuration, or connector definition is invalid. */
109
+ declare const VoidEnvelopeBranchDefect: "defect";
110
+ /** Manifest definition for voidEnvelope. */
111
+ declare const VoidEnvelopeDefinition: MutationDefinition;
112
+ /** Manifest metadata for voidEnvelope. */
113
+ declare const VoidEnvelopeMetadata: {
114
+ readonly kind: "mutation";
115
+ readonly idempotency: "required";
116
+ readonly authorization: "required";
117
+ };
118
+ /** Branch IDs for downloadCombinedDocument. */
119
+ declare const DownloadCombinedDocumentBranch: {
120
+ readonly Downloaded: "downloaded";
121
+ readonly NotFound: "notFound";
122
+ readonly TooLarge: "tooLarge";
123
+ readonly ProviderRejected: "providerRejected";
124
+ readonly InvalidResponse: "invalidResponse";
125
+ readonly Defect: "defect";
126
+ };
127
+ /** DocuSign returned the combined PDF and its digest was recorded, and stored when the client has a CombinedDocumentStore. */
128
+ declare const DownloadCombinedDocumentBranchDownloaded: "downloaded";
129
+ /** The envelope does not exist in the connection's account or the user may not see it. */
130
+ declare const DownloadCombinedDocumentBranchNotFound: "notFound";
131
+ /** The combined PDF exceeds the connection's maxDocumentBytes; nothing was stored. */
132
+ declare const DownloadCombinedDocumentBranchTooLarge: "tooLarge";
133
+ /** DocuSign conclusively rejected the download, such as a revoked consent or a user without access to the envelope. */
134
+ declare const DownloadCombinedDocumentBranchProviderRejected: "providerRejected";
135
+ /** DocuSign returned something other than a complete PDF, or the CombinedDocumentStore rejected it. */
136
+ declare const DownloadCombinedDocumentBranchInvalidResponse: "invalidResponse";
137
+ /** Local input, connection configuration, or connector definition is invalid. */
138
+ declare const DownloadCombinedDocumentBranchDefect: "defect";
139
+ /** Manifest definition for downloadCombinedDocument. */
140
+ declare const DownloadCombinedDocumentDefinition: QueryDefinition;
141
+ /** Manifest metadata for downloadCombinedDocument. */
142
+ declare const DownloadCombinedDocumentMetadata: {
143
+ readonly kind: "query";
144
+ readonly idempotency: "none";
145
+ readonly authorization: "required";
146
+ };
147
+
148
+ /** Configuration for the createEnvelopeFromTemplate connector Step. */
149
+ interface CreateEnvelopeFromTemplateStepConfig<StepInput, OperationInput = CreateEnvelopeFromTemplateInput, OperationOutput = CreatedEnvelope> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
150
+ /** Named connection supplying this operation. */
151
+ connection: Connection<{
152
+ createEnvelopeFromTemplate(): Mutation<OperationInput, OperationOutput>;
153
+ }>;
154
+ /** Name matching the bound connection. */
155
+ connectionName: string;
156
+ /** DocuSign holds the envelope this Step execution created; wasRecovered tells whether a later attempt found it by its custom field after an interrupted one. */
157
+ created: StepTarget<MutationResult<OperationOutput>>;
158
+ /** DocuSign conclusively rejected the envelope, such as an unknown template, an unfilled or unknown role, an invalid email address, an exhausted envelope allowance, or a user who may not send; nothing was created. */
159
+ providerRejected?: StepTarget<MutationResult<OperationOutput>>;
160
+ /** The create request was sent but DocuSign's answer was lost, a server error, or unreadable, and no envelope with this Step's custom field could be found, so an envelope may exist that this Result does not name; do not create another automatically. */
161
+ uncertain?: StepTarget<MutationResult<OperationOutput>>;
162
+ /** Local input, connection configuration, or connector definition is invalid. */
163
+ defect?: StepTarget<MutationResult<OperationOutput>>;
164
+ }
165
+ /** Build the createEnvelopeFromTemplate Step from a named connection. */
166
+ declare function newCreateEnvelopeFromTemplateStep<StepInput, OperationInput = CreateEnvelopeFromTemplateInput, OperationOutput = CreatedEnvelope>(configuration: CreateEnvelopeFromTemplateStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
167
+ /** Configuration for the getEnvelope connector Step. */
168
+ interface GetEnvelopeStepConfig<StepInput, OperationInput = GetEnvelopeInput, OperationOutput = Envelope> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
169
+ /** Named connection supplying this operation. */
170
+ connection: Connection<{
171
+ getEnvelope(): Query<OperationInput, OperationOutput>;
172
+ }>;
173
+ /** Name matching the bound connection. */
174
+ connectionName: string;
175
+ /** DocuSign returned the envelope. */
176
+ found: StepTarget<QueryResult<OperationOutput>>;
177
+ /** The envelope does not exist in the connection's account or the user may not see it. */
178
+ notFound?: StepTarget<QueryResult<OperationOutput>>;
179
+ /** DocuSign conclusively rejected the read, such as a revoked consent or a user without access to the account. */
180
+ providerRejected?: StepTarget<QueryResult<OperationOutput>>;
181
+ /** DocuSign returned a malformed or oversized response. */
182
+ invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
183
+ /** Local input, connection configuration, or connector definition is invalid. */
184
+ defect?: StepTarget<QueryResult<OperationOutput>>;
185
+ }
186
+ /** Build the getEnvelope Step from a named connection. */
187
+ declare function newGetEnvelopeStep<StepInput, OperationInput = GetEnvelopeInput, OperationOutput = Envelope>(configuration: GetEnvelopeStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
188
+ /** Configuration for the listEnvelopeRecipients connector Step. */
189
+ interface ListEnvelopeRecipientsStepConfig<StepInput, OperationInput = ListEnvelopeRecipientsInput, OperationOutput = EnvelopeRecipients> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
190
+ /** Named connection supplying this operation. */
191
+ connection: Connection<{
192
+ listEnvelopeRecipients(): Query<OperationInput, OperationOutput>;
193
+ }>;
194
+ /** Name matching the bound connection. */
195
+ connectionName: string;
196
+ /** DocuSign returned the envelope's recipients. */
197
+ listed: StepTarget<QueryResult<OperationOutput>>;
198
+ /** The envelope does not exist in the connection's account or the user may not see it. */
199
+ notFound?: StepTarget<QueryResult<OperationOutput>>;
200
+ /** DocuSign conclusively rejected the read, such as a revoked consent or a user without access to the account. */
201
+ providerRejected?: StepTarget<QueryResult<OperationOutput>>;
202
+ /** DocuSign returned a malformed or oversized response. */
203
+ invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
204
+ /** Local input, connection configuration, or connector definition is invalid. */
205
+ defect?: StepTarget<QueryResult<OperationOutput>>;
206
+ }
207
+ /** Build the listEnvelopeRecipients Step from a named connection. */
208
+ declare function newListEnvelopeRecipientsStep<StepInput, OperationInput = ListEnvelopeRecipientsInput, OperationOutput = EnvelopeRecipients>(configuration: ListEnvelopeRecipientsStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
209
+ /** Configuration for the voidEnvelope connector Step. */
210
+ interface VoidEnvelopeStepConfig<StepInput, OperationInput = VoidEnvelopeInput, OperationOutput = VoidedEnvelope> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
211
+ /** Named connection supplying this operation. */
212
+ connection: Connection<{
213
+ voidEnvelope(): Mutation<OperationInput, OperationOutput>;
214
+ }>;
215
+ /** Name matching the bound connection. */
216
+ connectionName: string;
217
+ /** The envelope is voided, by this call or earlier; wasAlreadyVoided tells which. */
218
+ voided: StepTarget<MutationResult<OperationOutput>>;
219
+ /** The envelope is completed, declined, or still a draft, which DocuSign does not void; status names which. */
220
+ notVoidable?: StepTarget<MutationResult<OperationOutput>>;
221
+ /** The envelope does not exist in the connection's account or the user may not see it. */
222
+ notFound?: StepTarget<MutationResult<OperationOutput>>;
223
+ /** DocuSign conclusively rejected the void, such as a user who is not the sender or lacks permission. */
224
+ providerRejected?: StepTarget<MutationResult<OperationOutput>>;
225
+ /** DocuSign returned a malformed or oversized response. */
226
+ invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
227
+ /** Local input, connection configuration, or connector definition is invalid. */
228
+ defect?: StepTarget<MutationResult<OperationOutput>>;
229
+ }
230
+ /** Build the voidEnvelope Step from a named connection. */
231
+ declare function newVoidEnvelopeStep<StepInput, OperationInput = VoidEnvelopeInput, OperationOutput = VoidedEnvelope>(configuration: VoidEnvelopeStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
232
+ /** Configuration for the downloadCombinedDocument connector Step. */
233
+ interface DownloadCombinedDocumentStepConfig<StepInput, OperationInput = DownloadCombinedDocumentInput, OperationOutput = CombinedDocument> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
234
+ /** Named connection supplying this operation. */
235
+ connection: Connection<{
236
+ downloadCombinedDocument(): Query<OperationInput, OperationOutput>;
237
+ }>;
238
+ /** Name matching the bound connection. */
239
+ connectionName: string;
240
+ /** DocuSign returned the combined PDF and its digest was recorded, and stored when the client has a CombinedDocumentStore. */
241
+ downloaded: StepTarget<QueryResult<OperationOutput>>;
242
+ /** The envelope does not exist in the connection's account or the user may not see it. */
243
+ notFound?: StepTarget<QueryResult<OperationOutput>>;
244
+ /** The combined PDF exceeds the connection's maxDocumentBytes; nothing was stored. */
245
+ tooLarge?: StepTarget<QueryResult<OperationOutput>>;
246
+ /** DocuSign conclusively rejected the download, such as a revoked consent or a user without access to the envelope. */
247
+ providerRejected?: StepTarget<QueryResult<OperationOutput>>;
248
+ /** DocuSign returned something other than a complete PDF, or the CombinedDocumentStore rejected it. */
249
+ invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
250
+ /** Local input, connection configuration, or connector definition is invalid. */
251
+ defect?: StepTarget<QueryResult<OperationOutput>>;
252
+ }
253
+ /** Build the downloadCombinedDocument Step from a named connection. */
254
+ declare function newDownloadCombinedDocumentStep<StepInput, OperationInput = DownloadCombinedDocumentInput, OperationOutput = CombinedDocument>(configuration: DownloadCombinedDocumentStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
255
+
256
+ /** Create a server-template envelope with read-back after an unconfirmed POST. */
257
+ declare class CreateEnvelopeFromTemplateOperation implements Mutation<CreateEnvelopeFromTemplateInput, CreatedEnvelope> {
258
+ private readonly client;
259
+ /** Bind the authenticated DocuSign client. */
260
+ constructor(client: DocuSignClient);
261
+ /** Return manifest routes and Execute defaults. */
262
+ definition(): _superdurable_connectors_sdk.QueryDefinition;
263
+ /** Use the stable Dex Call ID as the hidden deduplication marker. */
264
+ idempotencyKey(callId: string): string;
265
+ /** Invoke one safe-to-classify create attempt. */
266
+ invoke(call: Call, input: CreateEnvelopeFromTemplateInput): Promise<MutationAttempt<CreatedEnvelope>>;
267
+ }
268
+ /** Read one envelope with custom fields. */
269
+ declare class GetEnvelopeOperation implements Query<GetEnvelopeInput, Envelope> {
270
+ private readonly client;
271
+ /** Bind the authenticated DocuSign client. */
272
+ constructor(client: DocuSignClient);
273
+ /** Return manifest routes and Execute defaults. */
274
+ definition(): _superdurable_connectors_sdk.QueryDefinition;
275
+ /** Invoke one envelope read. */
276
+ invoke(call: Call, input: GetEnvelopeInput): Promise<QueryAttempt<Envelope>>;
277
+ }
278
+ /** Flatten DocuSign recipient collections into routing order. */
279
+ declare class ListEnvelopeRecipientsOperation implements Query<ListEnvelopeRecipientsInput, EnvelopeRecipients> {
280
+ private readonly client;
281
+ /** Bind the authenticated DocuSign client. */
282
+ constructor(client: DocuSignClient);
283
+ /** Return manifest routes and Execute defaults. */
284
+ definition(): _superdurable_connectors_sdk.QueryDefinition;
285
+ /** Invoke one recipients read. */
286
+ invoke(call: Call, input: ListEnvelopeRecipientsInput): Promise<QueryAttempt<EnvelopeRecipients>>;
287
+ }
288
+ /** Void an envelope or read back a status refusal. */
289
+ declare class VoidEnvelopeOperation implements Mutation<VoidEnvelopeInput, VoidedEnvelope> {
290
+ private readonly client;
291
+ /** Bind the authenticated DocuSign client. */
292
+ constructor(client: DocuSignClient);
293
+ /** Return manifest routes and Execute defaults. */
294
+ definition(): _superdurable_connectors_sdk.QueryDefinition;
295
+ /** Use the stable Call ID for this safely repeatable PUT. */
296
+ idempotencyKey(callId: string): string;
297
+ /** Invoke one void attempt. */
298
+ invoke(call: Call, input: VoidEnvelopeInput): Promise<MutationAttempt<VoidedEnvelope>>;
299
+ }
300
+ /** Download and digest a combined PDF without persisting its bytes in Dex. */
301
+ declare class DownloadCombinedDocumentOperation implements Query<DownloadCombinedDocumentInput, CombinedDocument> {
302
+ private readonly client;
303
+ /** Bind the authenticated DocuSign client. */
304
+ constructor(client: DocuSignClient);
305
+ /** Return manifest routes and Execute defaults. */
306
+ definition(): _superdurable_connectors_sdk.QueryDefinition;
307
+ /** Invoke one combined PDF read. */
308
+ invoke(call: Call, input: DownloadCombinedDocumentInput): Promise<QueryAttempt<CombinedDocument>>;
309
+ }
310
+
311
+ /** Reference handed to an application-owned combined PDF store. */
312
+ interface CombinedDocumentReference {
313
+ /** Account that owns the PDF. */ accountId: string;
314
+ /** Envelope whose documents were combined. */ envelopeId: string;
315
+ /** Whether the certificate of completion is included. */ includesCertificate: boolean;
316
+ }
317
+ /** Store a complete PDF outside Dex payloads and return a safe, stable location. */
318
+ interface CombinedDocumentStore {
319
+ /** Consume the whole stream atomically and return a repeat-safe location. */
320
+ storeCombinedDocument(reference: CombinedDocumentReference, content: AsyncIterable<Uint8Array>): Promise<string>;
321
+ }
322
+ /** Replace the transport, clock, or document store for an application or provider test. */
323
+ interface DocuSignClientOptions {
324
+ /** Override the bounded JSON request transport. */
325
+ send?: (request: ProviderRequest) => Promise<ProviderResponse>;
326
+ /** Override the clock used for receipts and rate limits. */
327
+ now?: () => Date;
328
+ /** Persist a combined PDF outside Dex payloads. */
329
+ documentStore?: CombinedDocumentStore;
330
+ }
331
+ /** One provider answer; oversized applies only to successful JSON bodies. */
332
+ interface DocuSignResponse {
333
+ /** HTTP status. */ status: number;
334
+ /** Response headers. */ headers: ProviderResponse['headers'];
335
+ /** Bounded response bytes. */ body: Uint8Array;
336
+ /** Whether a successful body exceeded its limit. */ isTooLarge: boolean;
337
+ }
338
+ /** Open successful PDF stream or a bounded non-success answer. */
339
+ type DocumentResponse = {
340
+ stream: AsyncIterable<Uint8Array>;
341
+ headers: ProviderResponse['headers'];
342
+ close(): Promise<void>;
343
+ } | {
344
+ rejected: DocuSignResponse;
345
+ };
346
+ /** Session credentials and the account selected by DocuSign userinfo. */
347
+ interface DocuSignSession {
348
+ /** Credentials for this call. */ credentials: Credentials;
349
+ /** Selected API account ID. */ accountId: string;
350
+ /** Validated regional API base URI. */ baseUri: string;
351
+ }
352
+ /** Sanitized classification of a provider refusal. */
353
+ interface DocuSignOutcome {
354
+ /** Whether Dex can safely retry. */ retry: boolean;
355
+ /** Whether the provider found no matching object. */ notFound: boolean;
356
+ /** Provider requested retry delay in milliseconds. */ retryAfterMs: number;
357
+ /** Safe provider error code. */ errorCode: string;
358
+ /** Persistable failure without provider message text. */ failure: Failure;
359
+ }
360
+ /** Authenticated DocuSign eSignature client bound to one Dex connection. */
361
+ declare class DocuSignClient {
362
+ readonly credentials: CredentialSource;
363
+ readonly maxResponseBytes: number;
364
+ readonly maxDocumentBytes: number;
365
+ readonly documentStore: CombinedDocumentStore | undefined;
366
+ private readonly accountId;
367
+ private readonly send;
368
+ private readonly hasCustomSend;
369
+ private readonly now;
370
+ private readonly accountCache;
371
+ private readonly refreshDriver;
372
+ /** Validate connection settings and bind host-owned renewable credentials. */
373
+ constructor(config: Config, credentials: CredentialSource, options?: DocuSignClientOptions);
374
+ /** Bind the template creation Mutation. */
375
+ createEnvelopeFromTemplate(): CreateEnvelopeFromTemplateOperation;
376
+ /** Bind the envelope Query. */
377
+ getEnvelope(): GetEnvelopeOperation;
378
+ /** Bind the recipients Query. */
379
+ listEnvelopeRecipients(): ListEnvelopeRecipientsOperation;
380
+ /** Bind the void Mutation. */
381
+ voidEnvelope(): VoidEnvelopeOperation;
382
+ /** Bind the combined PDF Query. */
383
+ downloadCombinedDocument(): DownloadCombinedDocumentOperation;
384
+ /** Resolve renewable credentials and DocuSign's own account host. */
385
+ openSession(call: Call, operation: string): Promise<DocuSignSession>;
386
+ /** Send one eSignature request after account selection. */
387
+ requestAPI(call: Call, session: DocuSignSession, method: string, path: string, query?: Record<string, string>, body?: unknown, accept?: string, limit?: number, timeoutMs?: number): Promise<DocuSignResponse>;
388
+ /** Open the combined PDF without buffering a successful response in Dex memory. */
389
+ openDocument(call: Call, session: DocuSignSession, envelopeId: string, includeCertificate: boolean): Promise<DocumentResponse>;
390
+ /** Classify one conclusive refusal without exposing provider messages. */
391
+ classify(operation: string, response: DocuSignResponse): DocuSignOutcome;
392
+ /** Build a provider receipt with only safe envelope identity and error code. */
393
+ receipt(envelopeId: string, errorCode?: string): ReceiptDraft;
394
+ /** Return the injected clock for recovery windows and receipts. */
395
+ currentTime(): Date;
396
+ private request;
397
+ }
398
+
399
+ /** Open a named DocuSign connection with generated private and shared credential decoders. */
400
+ declare function newProjectConnection(project: LoadedProject, connectionName: string, options?: DocuSignClientOptions): Connection<Operations>;
401
+
402
+ export { CombinedDocument, type CombinedDocumentReference, type CombinedDocumentStore, Config, Connection, ConnectorID, CreateEnvelopeFromTemplateBranch, CreateEnvelopeFromTemplateBranchCreated, CreateEnvelopeFromTemplateBranchDefect, CreateEnvelopeFromTemplateBranchProviderRejected, CreateEnvelopeFromTemplateBranchUncertain, CreateEnvelopeFromTemplateDefinition, CreateEnvelopeFromTemplateInput, CreateEnvelopeFromTemplateMetadata, CreateEnvelopeFromTemplateOperation, type CreateEnvelopeFromTemplateStepConfig, CreatedEnvelope, CredentialSource, Credentials, DocuSignClient, type DocuSignClientOptions, DownloadCombinedDocumentBranch, DownloadCombinedDocumentBranchDefect, DownloadCombinedDocumentBranchDownloaded, DownloadCombinedDocumentBranchInvalidResponse, DownloadCombinedDocumentBranchNotFound, DownloadCombinedDocumentBranchProviderRejected, DownloadCombinedDocumentBranchTooLarge, DownloadCombinedDocumentDefinition, DownloadCombinedDocumentInput, DownloadCombinedDocumentMetadata, DownloadCombinedDocumentOperation, type DownloadCombinedDocumentStepConfig, Envelope, EnvelopeRecipients, GetEnvelopeBranch, GetEnvelopeBranchDefect, GetEnvelopeBranchFound, GetEnvelopeBranchInvalidResponse, GetEnvelopeBranchNotFound, GetEnvelopeBranchProviderRejected, GetEnvelopeDefinition, GetEnvelopeInput, GetEnvelopeMetadata, GetEnvelopeOperation, type GetEnvelopeStepConfig, ListEnvelopeRecipientsBranch, ListEnvelopeRecipientsBranchDefect, ListEnvelopeRecipientsBranchInvalidResponse, ListEnvelopeRecipientsBranchListed, ListEnvelopeRecipientsBranchNotFound, ListEnvelopeRecipientsBranchProviderRejected, ListEnvelopeRecipientsDefinition, ListEnvelopeRecipientsInput, ListEnvelopeRecipientsMetadata, ListEnvelopeRecipientsOperation, type ListEnvelopeRecipientsStepConfig, ProviderID, VoidEnvelopeBranch, VoidEnvelopeBranchDefect, VoidEnvelopeBranchInvalidResponse, VoidEnvelopeBranchNotFound, VoidEnvelopeBranchNotVoidable, VoidEnvelopeBranchProviderRejected, VoidEnvelopeBranchVoided, VoidEnvelopeDefinition, VoidEnvelopeInput, VoidEnvelopeMetadata, VoidEnvelopeOperation, type VoidEnvelopeStepConfig, VoidedEnvelope, newCreateEnvelopeFromTemplateStep, newDownloadCombinedDocumentStep, newGetEnvelopeStep, newListEnvelopeRecipientsStep, newProjectConnection, newVoidEnvelopeStep };