@arbidocs/react 0.5.149 → 0.5.151
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/dist/chunk-BI7HFGXF.cjs +507 -0
- package/dist/chunk-BI7HFGXF.cjs.map +1 -0
- package/dist/{chunk-YNOKH4FX.cjs → chunk-SKJWJ3OY.cjs} +25 -248
- package/dist/chunk-SKJWJ3OY.cjs.map +1 -0
- package/dist/directmessages/file-shares.js +88 -0
- package/dist/directmessages/file-shares.js.map +7 -0
- package/dist/directmessages/index.js +8 -0
- package/dist/directmessages/index.js.map +2 -2
- package/dist/document-tools/core.cjs +155 -147
- package/dist/document-tools/core.d.ts +5 -477
- package/dist/document-tools/core.js +4 -0
- package/dist/document-tools/core.js.map +2 -2
- package/dist/document-tools/file-shares.js +24 -5
- package/dist/document-tools/file-shares.js.map +2 -2
- package/dist/document-tools/index.cjs +157 -149
- package/dist/document-tools/index.d.ts +5 -5
- package/dist/{query-keys.d-BZolSssa.d.ts → file-shares.d-CamKxNLC.d.ts} +517 -1
- package/dist/index.cjs +112 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +118 -13
- package/dist/notifications/index.js +2 -0
- package/dist/notifications/index.js.map +2 -2
- package/dist/notifications/server-notifications.js +29 -7
- package/dist/notifications/server-notifications.js.map +2 -2
- package/package.json +3 -3
- package/dist/chunk-ASL7H2TF.cjs +0 -264
- package/dist/chunk-ASL7H2TF.cjs.map +0 -1
- package/dist/chunk-YNOKH4FX.cjs.map +0 -1
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ListEventsParams, RoomQuery, CalendarWindow, OverlayLayerName } from '@arbidocs/sdk/browser';
|
|
2
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
|
+
import { ArbiClient, operations, components } from '@arbidocs/client';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
2
6
|
|
|
3
7
|
/**
|
|
4
8
|
* The one query-key factory of the ARBI front end: every React Query key and mutation key the
|
|
@@ -348,4 +352,516 @@ declare const documentBytesKey: (documentRef: string, version?: number | null, k
|
|
|
348
352
|
/** Whether `queryKey` lies under `prefix` (a factory key): React Query's own prefix match. */
|
|
349
353
|
declare function isUnderQueryKey(queryKey: readonly unknown[], prefix: readonly unknown[]): boolean;
|
|
350
354
|
|
|
351
|
-
|
|
355
|
+
type DocumentToolsClient = ArbiClient['fetch'];
|
|
356
|
+
type DocumentToolsNoticeKind = 'success' | 'error' | 'info' | 'warning';
|
|
357
|
+
interface DocumentToolsNoticeOptions {
|
|
358
|
+
/** A second line under the message. */
|
|
359
|
+
description?: string;
|
|
360
|
+
/** One action button on the notice ("Email it"). */
|
|
361
|
+
action?: {
|
|
362
|
+
label: string;
|
|
363
|
+
onClick: () => void;
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
type DocumentToolsNotify = (message: string, kind: DocumentToolsNoticeKind, options?: DocumentToolsNoticeOptions) => void;
|
|
367
|
+
interface DocumentToolsUser {
|
|
368
|
+
/** The name marks are authored as and the signer's name is prefilled with. */
|
|
369
|
+
name: string;
|
|
370
|
+
/** The sign-in email: signing re-derives the user's key from it and the password. */
|
|
371
|
+
email?: string | null;
|
|
372
|
+
/** The user's id (usr-*): which fields of a signature request are theirs. */
|
|
373
|
+
externalId?: string | null;
|
|
374
|
+
}
|
|
375
|
+
/** What changed about a document, so the host can refresh its own lists and caches. */
|
|
376
|
+
type DocumentChange =
|
|
377
|
+
/** A version's markup got its first mark or lost its last one. */
|
|
378
|
+
'markup'
|
|
379
|
+
/** A signature was added: the document has a new current version. */
|
|
380
|
+
| 'signed'
|
|
381
|
+
/** A new document was made from it (a frozen copy). The ids are the NEW documents. */
|
|
382
|
+
| 'copy'
|
|
383
|
+
/** A new version was saved (the Word editor's Save version): the document's current version. */
|
|
384
|
+
| 'version';
|
|
385
|
+
/**
|
|
386
|
+
* The `/v1/document/upload` query, typed from the API schema: `derived_from` is a list (a
|
|
387
|
+
* production set is derived from every document in it), `shared` a boolean.
|
|
388
|
+
*/
|
|
389
|
+
type DocumentUploadQuery = NonNullable<operations['upload_documents']['parameters']['query']>;
|
|
390
|
+
interface DocumentUploadRequest {
|
|
391
|
+
file: File;
|
|
392
|
+
/** `/v1/document/upload` query: `derived_from`, `derived_role`, `shared`, `folder`. */
|
|
393
|
+
query: DocumentUploadQuery;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* The upload query as a URL query string, for a host that posts the upload itself (an XHR with
|
|
397
|
+
* progress): a list repeats its key (`derived_from=a&derived_from=b`), empty values are left out.
|
|
398
|
+
*/
|
|
399
|
+
declare function uploadQueryString(query: DocumentUploadQuery): string;
|
|
400
|
+
interface DocumentToolsEnvironment {
|
|
401
|
+
client: DocumentToolsClient;
|
|
402
|
+
/**
|
|
403
|
+
* The deployment domain the user's keys are derived for. Needed for signing. Default: the one
|
|
404
|
+
* the host's `Arbi` computes (`arbi.getDeploymentDomain()`), if any.
|
|
405
|
+
*/
|
|
406
|
+
deploymentDomain?: string;
|
|
407
|
+
/** The signed-in user; marks are authored as "You" without one, and signing is unavailable. */
|
|
408
|
+
user?: DocumentToolsUser | null;
|
|
409
|
+
/** Surface a transient message. Default: none (errors still show inline where they can). */
|
|
410
|
+
notify?: DocumentToolsNotify;
|
|
411
|
+
/** Open a document or a version reference (`doc-…@v2`): the copy just made, the signed copy. */
|
|
412
|
+
openDocument?: (documentRef: string) => void;
|
|
413
|
+
/**
|
|
414
|
+
* Documents changed on the server (see {@link DocumentChange}); refresh the host's lists. The
|
|
415
|
+
* tools wait for it before opening the document, so a copy is listed when it opens.
|
|
416
|
+
*/
|
|
417
|
+
onDocumentsChanged?: (documentIds: string[], change: DocumentChange) => void | Promise<void>;
|
|
418
|
+
/** Upload a derived copy. Default: `POST /v1/document/upload` through `client`. */
|
|
419
|
+
uploadDocument?: (request: DocumentUploadRequest) => Promise<{
|
|
420
|
+
doc_ext_ids?: string[];
|
|
421
|
+
} | undefined>;
|
|
422
|
+
/** Save a file to the user's computer. Default: a temporary download link. */
|
|
423
|
+
saveFile?: (blob: Blob, fileName: string) => void;
|
|
424
|
+
/** Email a document (offered once it is signed). Omitted: no "Email it". */
|
|
425
|
+
emailDocument?: (documentRef: string) => void;
|
|
426
|
+
/**
|
|
427
|
+
* The public page that checks a signature (the certificate) in this app. When given, "View
|
|
428
|
+
* certificate" opens it in preference to the backend's `certificate_url` (which is on the
|
|
429
|
+
* deployment domain, like the link embedded in the signed PDF). Without it: the backend's
|
|
430
|
+
* `certificate_url`, else `/verify/{reference}` on this origin.
|
|
431
|
+
*/
|
|
432
|
+
certificateUrl?: (reference: string) => string;
|
|
433
|
+
}
|
|
434
|
+
/** The environment with every default filled in. */
|
|
435
|
+
interface ResolvedDocumentToolsEnvironment extends DocumentToolsEnvironment {
|
|
436
|
+
prepareFileShare: (documentId: string) => Promise<void>;
|
|
437
|
+
registerBeforeFileShare: (documentId: string, flush: () => Promise<void>) => () => void;
|
|
438
|
+
notify: DocumentToolsNotify;
|
|
439
|
+
saveFile: (blob: Blob, fileName: string) => void;
|
|
440
|
+
uploadDocument: (request: DocumentUploadRequest) => Promise<{
|
|
441
|
+
doc_ext_ids?: string[];
|
|
442
|
+
} | undefined>;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Save a blob through a temporary `<a download>`. The object URL is revoked a minute later, not at
|
|
446
|
+
* once: revoking straight after `click()` can cancel the download (Safari, and large files
|
|
447
|
+
* elsewhere) before the browser has read the blob.
|
|
448
|
+
*/
|
|
449
|
+
declare function downloadBlob(blob: Blob, fileName: string): void;
|
|
450
|
+
/** The default upload: multipart `files` to `/v1/document/upload` through the API client. */
|
|
451
|
+
declare function clientUpload(client: DocumentToolsClient): ({ file, query }: DocumentUploadRequest) => Promise<{
|
|
452
|
+
doc_ext_ids?: string[] | undefined;
|
|
453
|
+
version?: number | null | undefined;
|
|
454
|
+
autosave?: boolean | null | undefined;
|
|
455
|
+
batch_id?: string | null | undefined;
|
|
456
|
+
skipped?: {
|
|
457
|
+
file_name: string;
|
|
458
|
+
reason: string;
|
|
459
|
+
}[] | undefined;
|
|
460
|
+
} | undefined>;
|
|
461
|
+
declare function defaultCertificateUrl(reference: string): string;
|
|
462
|
+
/**
|
|
463
|
+
* Where "View certificate" goes for a signature: the host's `certificateUrl(reference)` when it
|
|
464
|
+
* gives one, else the `certificate_url` the backend returned, else `/verify/{reference}` here.
|
|
465
|
+
*/
|
|
466
|
+
declare function certificateLink(signature: {
|
|
467
|
+
reference: string;
|
|
468
|
+
certificate_url?: string | null;
|
|
469
|
+
}, certificateUrl?: (reference: string) => string): string;
|
|
470
|
+
interface DocumentToolsProviderProps extends DocumentToolsEnvironment {
|
|
471
|
+
children: ReactNode;
|
|
472
|
+
}
|
|
473
|
+
declare function DocumentToolsProvider({ children, ...env }: DocumentToolsProviderProps): React.JSX.Element;
|
|
474
|
+
/** The host's environment, or `null` outside a `<DocumentToolsProvider>`. */
|
|
475
|
+
declare function useOptionalDocumentTools(): ResolvedDocumentToolsEnvironment | null;
|
|
476
|
+
/** The host's environment; throws outside a `<DocumentToolsProvider>`. */
|
|
477
|
+
declare function useDocumentTools(): ResolvedDocumentToolsEnvironment;
|
|
478
|
+
|
|
479
|
+
type SignatureField = components['schemas']['SignatureField'];
|
|
480
|
+
type SignatureFieldType = SignatureField['type'];
|
|
481
|
+
type SignatureRequest = components['schemas']['SignatureRequestResponse'];
|
|
482
|
+
type SignatureRequestSigner = components['schemas']['SignatureRequestSigner'];
|
|
483
|
+
type SignerProgress = components['schemas']['SignerProgress'];
|
|
484
|
+
type SuggestedSignatureField = components['schemas']['SuggestedSignatureField'];
|
|
485
|
+
type AdoptedSignature = components['schemas']['AdoptedSignature'];
|
|
486
|
+
type SignRequestSignResponse = components['schemas']['SignRequestSignResponse'];
|
|
487
|
+
/** Field types in the order the editor offers them. */
|
|
488
|
+
declare const SIGNATURE_FIELD_TYPES: readonly SignatureFieldType[];
|
|
489
|
+
declare const FIELD_TYPE_LABELS: Record<SignatureFieldType, string>;
|
|
490
|
+
/**
|
|
491
|
+
* Default size of a new field, as fractions of the page (the backend draws to fit the box). The
|
|
492
|
+
* same sizes the server's suggester places fields in (`esign_suggest._SIZE`).
|
|
493
|
+
*/
|
|
494
|
+
declare const DEFAULT_FIELD_SIZE: Record<SignatureFieldType, {
|
|
495
|
+
width: number;
|
|
496
|
+
height: number;
|
|
497
|
+
}>;
|
|
498
|
+
/** How far each signer has got, as the request's sender sees it. */
|
|
499
|
+
declare const SIGNER_PROGRESS_LABELS: Record<SignerProgress, string>;
|
|
500
|
+
/** Whether a field's signer is an email (someone to invite) rather than a member or request signer. */
|
|
501
|
+
declare const isEmailSigner: (signer: string) => boolean;
|
|
502
|
+
/** The fields carrying a signer's mark: every signer needs at least one to be sent the request. */
|
|
503
|
+
declare const MARK_FIELD_TYPES: readonly SignatureFieldType[];
|
|
504
|
+
/** A short unique id for a new field (the server only needs it unique within the request). */
|
|
505
|
+
declare function newFieldId(): string;
|
|
506
|
+
/** Initials from a name: "Olive M. Owner" -> "OMO". */
|
|
507
|
+
declare function initialsOf(name: string): string;
|
|
508
|
+
/** The fields a signer completes, in the order they are walked through: page, then top to bottom. */
|
|
509
|
+
declare function fieldsInSigningOrder(fields: SignatureField[], signer: string): SignatureField[];
|
|
510
|
+
/** Why a draft cannot be sent yet, or null when it can. Mirrors the server's checks. */
|
|
511
|
+
declare function sendBlocker(fields: SignatureField[]): string | null;
|
|
512
|
+
/**
|
|
513
|
+
* Suggested fields grouped by signature block; `assign` maps a block (`group`) to the signer its
|
|
514
|
+
* fields go to. A field placed in the Word document that names its signer goes to them: the
|
|
515
|
+
* member with that email (`members`, by lowercased email), else the email itself (an invitee).
|
|
516
|
+
* Unassigned blocks are left out.
|
|
517
|
+
*/
|
|
518
|
+
declare function fieldsFromSuggestions(suggestions: SuggestedSignatureField[], assign: Record<number, string | undefined>, members?: ReadonlyMap<string, string>): SignatureField[];
|
|
519
|
+
/** The Word document's own fields (found by their anchors) and the optional layout suggestions. */
|
|
520
|
+
declare function splitSuggestions(suggestions: SuggestedSignatureField[]): {
|
|
521
|
+
placed: {
|
|
522
|
+
type: "signature" | "initials" | "date" | "name";
|
|
523
|
+
page: number;
|
|
524
|
+
x: number;
|
|
525
|
+
y: number;
|
|
526
|
+
width: number;
|
|
527
|
+
height: number;
|
|
528
|
+
group: number;
|
|
529
|
+
role?: string | null;
|
|
530
|
+
anchor: string;
|
|
531
|
+
source: "anchor" | "layout";
|
|
532
|
+
signer_email?: string | null;
|
|
533
|
+
signer_name?: string | null;
|
|
534
|
+
required: boolean;
|
|
535
|
+
}[];
|
|
536
|
+
extras: {
|
|
537
|
+
type: "signature" | "initials" | "date" | "name";
|
|
538
|
+
page: number;
|
|
539
|
+
x: number;
|
|
540
|
+
y: number;
|
|
541
|
+
width: number;
|
|
542
|
+
height: number;
|
|
543
|
+
group: number;
|
|
544
|
+
role?: string | null;
|
|
545
|
+
anchor: string;
|
|
546
|
+
source: "anchor" | "layout";
|
|
547
|
+
signer_email?: string | null;
|
|
548
|
+
signer_name?: string | null;
|
|
549
|
+
required: boolean;
|
|
550
|
+
}[];
|
|
551
|
+
};
|
|
552
|
+
declare function fetchDocumentSignatureRequests(client: DocumentToolsClient, documentId: string): Promise<SignatureRequest[]>;
|
|
553
|
+
/** A document's signature requests, newest first. */
|
|
554
|
+
declare function useDocumentSignatureRequests(documentId: string | null | undefined, enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<{
|
|
555
|
+
external_id: string;
|
|
556
|
+
doc_ext_id: string | null;
|
|
557
|
+
version: number;
|
|
558
|
+
source_sha256: string;
|
|
559
|
+
status: components["schemas"]["SignatureRequestStatus"];
|
|
560
|
+
message?: string | null;
|
|
561
|
+
fields: components["schemas"]["SignatureField"][];
|
|
562
|
+
signers: components["schemas"]["SignatureRequestSigner"][];
|
|
563
|
+
created_by?: string | null;
|
|
564
|
+
created_at: string;
|
|
565
|
+
sent_at?: string | null;
|
|
566
|
+
completed_at?: string | null;
|
|
567
|
+
signed_version?: number | null;
|
|
568
|
+
stale: boolean;
|
|
569
|
+
}[]>, Error>;
|
|
570
|
+
/** A signer the Word document's placed fields name, with the name they give. */
|
|
571
|
+
interface NamedSigner {
|
|
572
|
+
email: string;
|
|
573
|
+
name: string;
|
|
574
|
+
}
|
|
575
|
+
/** What a document asks to be signed: the fields found, and the signers its Word fields name. */
|
|
576
|
+
interface SignatureFieldSuggestions {
|
|
577
|
+
fields: SuggestedSignatureField[];
|
|
578
|
+
/**
|
|
579
|
+
* Named even when the PDF shows none of the Word fields' anchors (the fields are then placed by
|
|
580
|
+
* hand): who each email belongs to. Empty from a server that does not report them.
|
|
581
|
+
*/
|
|
582
|
+
signers: NamedSigner[];
|
|
583
|
+
}
|
|
584
|
+
declare function signatureFieldSuggestions(client: DocumentToolsClient, documentId: string, version?: number): Promise<SignatureFieldSuggestions>;
|
|
585
|
+
declare function suggestSignatureFields(client: DocumentToolsClient, documentId: string, version?: number): Promise<SuggestedSignatureField[]>;
|
|
586
|
+
interface SaveSignatureRequestVars {
|
|
587
|
+
documentId: string;
|
|
588
|
+
/** The version the fields were placed on (the PDF shown). Omitted = current. */
|
|
589
|
+
version?: number;
|
|
590
|
+
fields: SignatureField[];
|
|
591
|
+
message?: string;
|
|
592
|
+
/** Existing draft to update instead of creating a new request. */
|
|
593
|
+
requestId?: string;
|
|
594
|
+
/** Send it to the signers (else it is saved as a draft). */
|
|
595
|
+
send: boolean;
|
|
596
|
+
}
|
|
597
|
+
declare function saveSignatureRequest(client: DocumentToolsClient, { documentId, version, fields, message, requestId, send }: SaveSignatureRequestVars): Promise<SignatureRequest>;
|
|
598
|
+
declare function useSaveSignatureRequest(): _tanstack_react_query.UseMutationResult<{
|
|
599
|
+
external_id: string;
|
|
600
|
+
doc_ext_id: string | null;
|
|
601
|
+
version: number;
|
|
602
|
+
source_sha256: string;
|
|
603
|
+
status: components["schemas"]["SignatureRequestStatus"];
|
|
604
|
+
message?: string | null;
|
|
605
|
+
fields: components["schemas"]["SignatureField"][];
|
|
606
|
+
signers: components["schemas"]["SignatureRequestSigner"][];
|
|
607
|
+
created_by?: string | null;
|
|
608
|
+
created_at: string;
|
|
609
|
+
sent_at?: string | null;
|
|
610
|
+
completed_at?: string | null;
|
|
611
|
+
signed_version?: number | null;
|
|
612
|
+
stale: boolean;
|
|
613
|
+
}, Error, SaveSignatureRequestVars, unknown>;
|
|
614
|
+
declare function useVoidSignatureRequest(): _tanstack_react_query.UseMutationResult<{
|
|
615
|
+
external_id: string;
|
|
616
|
+
doc_ext_id: string | null;
|
|
617
|
+
version: number;
|
|
618
|
+
source_sha256: string;
|
|
619
|
+
status: components["schemas"]["SignatureRequestStatus"];
|
|
620
|
+
message?: string | null | undefined;
|
|
621
|
+
fields: {
|
|
622
|
+
id: string;
|
|
623
|
+
type: "signature" | "initials" | "date" | "name";
|
|
624
|
+
page: number;
|
|
625
|
+
x: number;
|
|
626
|
+
y: number;
|
|
627
|
+
width: number;
|
|
628
|
+
height: number;
|
|
629
|
+
signer: string;
|
|
630
|
+
required: boolean;
|
|
631
|
+
}[];
|
|
632
|
+
signers: {
|
|
633
|
+
external_id: string;
|
|
634
|
+
user_ext_id?: string | null | undefined;
|
|
635
|
+
name: string;
|
|
636
|
+
email?: string | null | undefined;
|
|
637
|
+
status: components["schemas"]["SignerStatus"];
|
|
638
|
+
progress: components["schemas"]["SignerProgress"];
|
|
639
|
+
viewed_at?: string | null | undefined;
|
|
640
|
+
signed_at?: string | null | undefined;
|
|
641
|
+
reference?: string | null | undefined;
|
|
642
|
+
fields: number;
|
|
643
|
+
}[];
|
|
644
|
+
created_by?: string | null | undefined;
|
|
645
|
+
created_at: string;
|
|
646
|
+
sent_at?: string | null | undefined;
|
|
647
|
+
completed_at?: string | null | undefined;
|
|
648
|
+
signed_version?: number | null | undefined;
|
|
649
|
+
stale: boolean;
|
|
650
|
+
}, Error, string, unknown>;
|
|
651
|
+
declare function useDeclineSignatureRequest(): _tanstack_react_query.UseMutationResult<{
|
|
652
|
+
external_id: string;
|
|
653
|
+
doc_ext_id: string | null;
|
|
654
|
+
version: number;
|
|
655
|
+
source_sha256: string;
|
|
656
|
+
status: components["schemas"]["SignatureRequestStatus"];
|
|
657
|
+
message?: string | null | undefined;
|
|
658
|
+
fields: {
|
|
659
|
+
id: string;
|
|
660
|
+
type: "signature" | "initials" | "date" | "name";
|
|
661
|
+
page: number;
|
|
662
|
+
x: number;
|
|
663
|
+
y: number;
|
|
664
|
+
width: number;
|
|
665
|
+
height: number;
|
|
666
|
+
signer: string;
|
|
667
|
+
required: boolean;
|
|
668
|
+
}[];
|
|
669
|
+
signers: {
|
|
670
|
+
external_id: string;
|
|
671
|
+
user_ext_id?: string | null | undefined;
|
|
672
|
+
name: string;
|
|
673
|
+
email?: string | null | undefined;
|
|
674
|
+
status: components["schemas"]["SignerStatus"];
|
|
675
|
+
progress: components["schemas"]["SignerProgress"];
|
|
676
|
+
viewed_at?: string | null | undefined;
|
|
677
|
+
signed_at?: string | null | undefined;
|
|
678
|
+
reference?: string | null | undefined;
|
|
679
|
+
fields: number;
|
|
680
|
+
}[];
|
|
681
|
+
created_by?: string | null | undefined;
|
|
682
|
+
created_at: string;
|
|
683
|
+
sent_at?: string | null | undefined;
|
|
684
|
+
completed_at?: string | null | undefined;
|
|
685
|
+
signed_version?: number | null | undefined;
|
|
686
|
+
stale: boolean;
|
|
687
|
+
}, Error, {
|
|
688
|
+
requestId: string;
|
|
689
|
+
reason?: string;
|
|
690
|
+
}, unknown>;
|
|
691
|
+
interface SignRequestVars {
|
|
692
|
+
request: SignatureRequest;
|
|
693
|
+
/** The PDF the signer was walked through (`GET /view?version=` of the request's version). */
|
|
694
|
+
pdfBlob: Blob;
|
|
695
|
+
email: string;
|
|
696
|
+
password: string;
|
|
697
|
+
adopted: AdoptedSignature;
|
|
698
|
+
/** The ids of the fields the signer applied: every required one of theirs. */
|
|
699
|
+
fields: string[];
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Sign all of the signer's fields at once: the server prepares the statement, the browser checks
|
|
703
|
+
* it covers the PDF on screen under the wording the signer read, re-derives the Ed25519 key from
|
|
704
|
+
* the password and signs. Resolves with `completed` when this was the last signature.
|
|
705
|
+
*/
|
|
706
|
+
declare function signSignatureRequest(client: DocumentToolsClient, deploymentDomain: string, { request, pdfBlob, email, password, adopted, fields }: SignRequestVars): Promise<SignRequestSignResponse>;
|
|
707
|
+
declare function useSignSignatureRequest(): _tanstack_react_query.UseMutationResult<{
|
|
708
|
+
request: components["schemas"]["SignatureRequestResponse"];
|
|
709
|
+
completed: boolean;
|
|
710
|
+
signed_version?: number | null;
|
|
711
|
+
}, Error, SignRequestVars, unknown>;
|
|
712
|
+
interface SignerCandidate {
|
|
713
|
+
externalId: string;
|
|
714
|
+
name: string;
|
|
715
|
+
email: string;
|
|
716
|
+
role: string;
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* The people in the active workspace who may sign: owners, collaborators and guests (an agent never
|
|
720
|
+
* does). The first one listed is the current user when they are a member.
|
|
721
|
+
*/
|
|
722
|
+
declare function useSignerCandidates(enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<SignerCandidate[]>, Error>;
|
|
723
|
+
/**
|
|
724
|
+
* Invite signers who are not in the workspace yet, as guests, through the workspace's own invite
|
|
725
|
+
* (`POST /v1/workspace/users` with `confirm_invite`): a registered person is added at once, anyone
|
|
726
|
+
* else is emailed an invitation that lands on the document. Each is asked to sign when they join.
|
|
727
|
+
* Only a workspace owner can invite.
|
|
728
|
+
*/
|
|
729
|
+
declare function inviteSigners(client: DocumentToolsClient, documentId: string, emails: string[]): Promise<void>;
|
|
730
|
+
declare function useInviteSigners(): _tanstack_react_query.UseMutationResult<void, Error, {
|
|
731
|
+
documentId: string;
|
|
732
|
+
emails: string[];
|
|
733
|
+
}, unknown>;
|
|
734
|
+
|
|
735
|
+
type FileShare = components['schemas']['FileShareResponse'];
|
|
736
|
+
type CreateFileShare = components['schemas']['CreateFileShare'];
|
|
737
|
+
declare function createFileShare(client: DocumentToolsClient, documentId: string, body: CreateFileShare): Promise<{
|
|
738
|
+
external_id: string;
|
|
739
|
+
document_ext_id: string;
|
|
740
|
+
version: number;
|
|
741
|
+
file_name: string;
|
|
742
|
+
status: string;
|
|
743
|
+
source_sha256: string;
|
|
744
|
+
fields: {
|
|
745
|
+
id: string;
|
|
746
|
+
type: "signature" | "initials" | "date" | "name";
|
|
747
|
+
page: number;
|
|
748
|
+
x: number;
|
|
749
|
+
y: number;
|
|
750
|
+
width: number;
|
|
751
|
+
height: number;
|
|
752
|
+
signer: string;
|
|
753
|
+
required: boolean;
|
|
754
|
+
}[];
|
|
755
|
+
message: string;
|
|
756
|
+
owner: boolean;
|
|
757
|
+
can_sign: boolean;
|
|
758
|
+
can_preview: boolean;
|
|
759
|
+
recipients: {
|
|
760
|
+
email: string;
|
|
761
|
+
permission: string;
|
|
762
|
+
status: string;
|
|
763
|
+
expires_at: string | null;
|
|
764
|
+
delivery_status: string;
|
|
765
|
+
reference?: string | null | undefined;
|
|
766
|
+
}[];
|
|
767
|
+
published_version?: number | null | undefined;
|
|
768
|
+
owner_workspace_ext_id?: string | null | undefined;
|
|
769
|
+
}>;
|
|
770
|
+
declare function getFileShare(client: DocumentToolsClient, id: string): Promise<FileShare>;
|
|
771
|
+
declare function fileShareBytes(client: DocumentToolsClient, id: string, kind: 'view' | 'original' | 'signed'): Promise<Blob>;
|
|
772
|
+
/** Adapt only the guided viewer's presentation data; sharing uses its own authorization endpoints. */
|
|
773
|
+
declare function fileShareSigningRequest(share: FileShare): SignatureRequest;
|
|
774
|
+
declare function signFileShare(client: DocumentToolsClient, domain: string, vars: SignRequestVars): Promise<SignRequestSignResponse>;
|
|
775
|
+
declare function useFileShare(client: DocumentToolsClient, shareId: string, signing: boolean): _tanstack_react_query.UseQueryResult<NoInfer<{
|
|
776
|
+
external_id: string;
|
|
777
|
+
document_ext_id: string;
|
|
778
|
+
version: number;
|
|
779
|
+
file_name: string;
|
|
780
|
+
status: string;
|
|
781
|
+
source_sha256: string;
|
|
782
|
+
fields: components["schemas"]["SignatureField"][];
|
|
783
|
+
message: string;
|
|
784
|
+
owner: boolean;
|
|
785
|
+
can_sign: boolean;
|
|
786
|
+
can_preview: boolean;
|
|
787
|
+
recipients: components["schemas"]["FileShareRecipientResponse"][];
|
|
788
|
+
published_version?: number | null;
|
|
789
|
+
owner_workspace_ext_id?: string | null;
|
|
790
|
+
}>, Error>;
|
|
791
|
+
declare function useFileSharePdf(client: DocumentToolsClient, shareId: string, share?: FileShare): _tanstack_react_query.UseQueryResult<NoInfer<Blob>, Error>;
|
|
792
|
+
/** The shares I created or was invited to (revoked and expired ones are not listed). Listing does
|
|
793
|
+
* not open a share, so it never starts a recipient's access window. Null client: not loaded. */
|
|
794
|
+
declare function useFileShares(client: DocumentToolsClient | null): _tanstack_react_query.UseQueryResult<NoInfer<{
|
|
795
|
+
external_id: string;
|
|
796
|
+
document_ext_id: string;
|
|
797
|
+
version: number;
|
|
798
|
+
file_name: string;
|
|
799
|
+
status: string;
|
|
800
|
+
source_sha256: string;
|
|
801
|
+
fields: {
|
|
802
|
+
id: string;
|
|
803
|
+
type: "signature" | "initials" | "date" | "name";
|
|
804
|
+
page: number;
|
|
805
|
+
x: number;
|
|
806
|
+
y: number;
|
|
807
|
+
width: number;
|
|
808
|
+
height: number;
|
|
809
|
+
signer: string;
|
|
810
|
+
required: boolean;
|
|
811
|
+
}[];
|
|
812
|
+
message: string;
|
|
813
|
+
owner: boolean;
|
|
814
|
+
can_sign: boolean;
|
|
815
|
+
can_preview: boolean;
|
|
816
|
+
recipients: {
|
|
817
|
+
email: string;
|
|
818
|
+
permission: string;
|
|
819
|
+
status: string;
|
|
820
|
+
expires_at: string | null;
|
|
821
|
+
delivery_status: string;
|
|
822
|
+
reference?: string | null | undefined;
|
|
823
|
+
}[];
|
|
824
|
+
published_version?: number | null | undefined;
|
|
825
|
+
owner_workspace_ext_id?: string | null | undefined;
|
|
826
|
+
}[]>, Error>;
|
|
827
|
+
/** Read the share list again (after a change made to a share: signed, declined, saved, revoked). */
|
|
828
|
+
declare function useRefreshFileShares(): () => Promise<void>;
|
|
829
|
+
/**
|
|
830
|
+
* Save a completed share's signed PDF as its document's next version, in the share's workspace
|
|
831
|
+
* (its key must be on the session: open that workspace first).
|
|
832
|
+
*/
|
|
833
|
+
declare function publishFileShare(client: DocumentToolsClient, share: FileShare): Promise<{
|
|
834
|
+
external_id: string;
|
|
835
|
+
document_ext_id: string;
|
|
836
|
+
version: number;
|
|
837
|
+
file_name: string;
|
|
838
|
+
status: string;
|
|
839
|
+
source_sha256: string;
|
|
840
|
+
fields: {
|
|
841
|
+
id: string;
|
|
842
|
+
type: "signature" | "initials" | "date" | "name";
|
|
843
|
+
page: number;
|
|
844
|
+
x: number;
|
|
845
|
+
y: number;
|
|
846
|
+
width: number;
|
|
847
|
+
height: number;
|
|
848
|
+
signer: string;
|
|
849
|
+
required: boolean;
|
|
850
|
+
}[];
|
|
851
|
+
message: string;
|
|
852
|
+
owner: boolean;
|
|
853
|
+
can_sign: boolean;
|
|
854
|
+
can_preview: boolean;
|
|
855
|
+
recipients: {
|
|
856
|
+
email: string;
|
|
857
|
+
permission: string;
|
|
858
|
+
status: string;
|
|
859
|
+
expires_at: string | null;
|
|
860
|
+
delivery_status: string;
|
|
861
|
+
reference?: string | null | undefined;
|
|
862
|
+
}[];
|
|
863
|
+
published_version?: number | null | undefined;
|
|
864
|
+
owner_workspace_ext_id?: string | null | undefined;
|
|
865
|
+
}>;
|
|
866
|
+
|
|
867
|
+
export { isUnderQueryKey as $, type AdoptedSignature as A, arbiQueryKeys as B, type CreateFileShare as C, DEFAULT_FIELD_SIZE as D, calendarQueryKeys as E, FIELD_TYPE_LABELS as F, callQueryKeys as G, certificateLink as H, clientUpload as I, connectorQueryKeys as J, createFileShare as K, defaultCertificateUrl as L, MARK_FIELD_TYPES as M, type NamedSigner as N, documentBytesKey as O, downloadBlob as P, fetchDocumentSignatureRequests as Q, type ResolvedDocumentToolsEnvironment as R, SIGNATURE_FIELD_TYPES as S, fieldsFromSuggestions as T, fieldsInSigningOrder as U, fileShareBytes as V, fileShareSigningRequest as W, getFileShare as X, initialsOf as Y, inviteSigners as Z, isEmailSigner as _, type DocumentBytesKind as a, mailQueryKeys as a0, newFieldId as a1, publishFileShare as a2, saveSignatureRequest as a3, sendBlocker as a4, signFileShare as a5, signSignatureRequest as a6, signatureFieldSuggestions as a7, splitSuggestions as a8, suggestSignatureFields as a9, uploadQueryString as aa, useDeclineSignatureRequest as ab, useDocumentSignatureRequests as ac, useDocumentTools as ad, useFileShare as ae, useFileSharePdf as af, useFileShares as ag, useInviteSigners as ah, useOptionalDocumentTools as ai, useRefreshFileShares as aj, useSaveSignatureRequest as ak, useSignSignatureRequest as al, useSignerCandidates as am, useVoidSignatureRequest as an, type DocumentChange as b, type DocumentToolsClient as c, type DocumentToolsEnvironment as d, type DocumentToolsNoticeKind as e, type DocumentToolsNoticeOptions as f, type DocumentToolsNotify as g, DocumentToolsProvider as h, type DocumentToolsProviderProps as i, type DocumentToolsUser as j, type DocumentUploadQuery as k, type DocumentUploadRequest as l, type FileShare as m, SIGNER_PROGRESS_LABELS as n, type SaveSignatureRequestVars as o, type SignRequestSignResponse as p, type SignRequestVars as q, type SignatureField as r, type SignatureFieldSuggestions as s, type SignatureFieldType as t, type SignatureRequest as u, type SignatureRequestSigner as v, type SignerCandidate as w, type SignerProgress as x, type SuggestedSignatureField as y, arbiMutationKeys as z };
|