@arbidocs/react 0.5.150 → 0.5.152

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.
Files changed (61) hide show
  1. package/dist/{chunk-VAHVEHKM.cjs → chunk-6RRKO4ZK.cjs} +3 -3
  2. package/dist/{chunk-VAHVEHKM.cjs.map → chunk-6RRKO4ZK.cjs.map} +1 -1
  3. package/dist/chunk-BI7HFGXF.cjs +507 -0
  4. package/dist/chunk-BI7HFGXF.cjs.map +1 -0
  5. package/dist/{chunk-HCUPZGAY.cjs → chunk-SKJWJ3OY.cjs} +26 -249
  6. package/dist/chunk-SKJWJ3OY.cjs.map +1 -0
  7. package/dist/{chunk-BCUKXFB6.cjs → chunk-WJIRX5MS.cjs} +5 -5
  8. package/dist/chunk-WJIRX5MS.cjs.map +1 -0
  9. package/dist/datasets/rows-source.js.map +2 -2
  10. package/dist/datasets/sources/activity.js +1 -1
  11. package/dist/datasets/sources/activity.js.map +2 -2
  12. package/dist/datasets/sources/conversations.js +1 -1
  13. package/dist/datasets/sources/conversations.js.map +2 -2
  14. package/dist/datasets/sources/database.js +17 -9
  15. package/dist/datasets/sources/database.js.map +2 -2
  16. package/dist/datasets/sources/documents.js +1 -1
  17. package/dist/datasets/sources/documents.js.map +2 -2
  18. package/dist/datasets/sources/facts.js +1 -1
  19. package/dist/datasets/sources/facts.js.map +2 -2
  20. package/dist/datasets/sources/projects.js +1 -1
  21. package/dist/datasets/sources/projects.js.map +2 -2
  22. package/dist/datasets/sources/tags.js +1 -1
  23. package/dist/datasets/sources/tags.js.map +2 -2
  24. package/dist/datasets/sources/usage.js +5 -4
  25. package/dist/datasets/sources/usage.js.map +2 -2
  26. package/dist/datasets/sources/workflows.js +1 -1
  27. package/dist/datasets/sources/workflows.js.map +2 -2
  28. package/dist/datasets/sources/workspaces.js +1 -1
  29. package/dist/datasets/sources/workspaces.js.map +2 -2
  30. package/dist/datasets/types.js.map +1 -1
  31. package/dist/directmessages/file-shares.js +88 -0
  32. package/dist/directmessages/file-shares.js.map +7 -0
  33. package/dist/directmessages/index.js +8 -0
  34. package/dist/directmessages/index.js.map +2 -2
  35. package/dist/document-tools/core.cjs +157 -149
  36. package/dist/document-tools/core.d.ts +5 -477
  37. package/dist/document-tools/core.js +4 -0
  38. package/dist/document-tools/core.js.map +2 -2
  39. package/dist/document-tools/file-shares.js +24 -5
  40. package/dist/document-tools/file-shares.js.map +2 -2
  41. package/dist/document-tools/index.cjs +159 -151
  42. package/dist/document-tools/index.d.ts +5 -5
  43. package/dist/{query-keys.d-BZolSssa.d.ts → file-shares.d-CamKxNLC.d.ts} +517 -1
  44. package/dist/index.cjs +431 -326
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/{index.d-DbcrFwS6.d.ts → index.d-Dy_Pz6Vl.d.ts} +4 -0
  47. package/dist/index.d.ts +125 -15
  48. package/dist/notifications/index.js +2 -0
  49. package/dist/notifications/index.js.map +2 -2
  50. package/dist/notifications/server-notifications.js +29 -7
  51. package/dist/notifications/server-notifications.js.map +2 -2
  52. package/dist/shell/index.cjs +38 -38
  53. package/dist/ui/card.js +2 -2
  54. package/dist/ui/card.js.map +2 -2
  55. package/dist/ui/index.cjs +160 -160
  56. package/dist/ui/index.d.ts +1 -1
  57. package/package.json +3 -3
  58. package/dist/chunk-ASL7H2TF.cjs +0 -264
  59. package/dist/chunk-ASL7H2TF.cjs.map +0 -1
  60. package/dist/chunk-BCUKXFB6.cjs.map +0 -1
  61. package/dist/chunk-HCUPZGAY.cjs.map +0 -1
@@ -1,137 +1,12 @@
1
- import * as React from 'react';
2
- import { ReactNode } from 'react';
3
- import { ArbiClient, operations, components, KeyPair } from '@arbidocs/client';
1
+ import { c as DocumentToolsClient, d as DocumentToolsEnvironment, a as DocumentBytesKind } from '../file-shares.d-CamKxNLC.js';
2
+ export { A as AdoptedSignature, C as CreateFileShare, D as DEFAULT_FIELD_SIZE, b as DocumentChange, e as DocumentToolsNoticeKind, f as DocumentToolsNoticeOptions, g as DocumentToolsNotify, h as DocumentToolsProvider, i as DocumentToolsProviderProps, j as DocumentToolsUser, k as DocumentUploadQuery, l as DocumentUploadRequest, F as FIELD_TYPE_LABELS, m as FileShare, M as MARK_FIELD_TYPES, N as NamedSigner, R as ResolvedDocumentToolsEnvironment, S as SIGNATURE_FIELD_TYPES, n as SIGNER_PROGRESS_LABELS, o as SaveSignatureRequestVars, p as SignRequestSignResponse, q as SignRequestVars, r as SignatureField, s as SignatureFieldSuggestions, t as SignatureFieldType, u as SignatureRequest, v as SignatureRequestSigner, w as SignerCandidate, x as SignerProgress, y as SuggestedSignatureField, H as certificateLink, I as clientUpload, K as createFileShare, L as defaultCertificateUrl, O as documentBytesKey, P as downloadBlob, Q as fetchDocumentSignatureRequests, T as fieldsFromSuggestions, U as fieldsInSigningOrder, V as fileShareBytes, W as fileShareSigningRequest, X as getFileShare, Y as initialsOf, Z as inviteSigners, _ as isEmailSigner, a1 as newFieldId, a2 as publishFileShare, a3 as saveSignatureRequest, a4 as sendBlocker, a5 as signFileShare, a6 as signSignatureRequest, a7 as signatureFieldSuggestions, a8 as splitSuggestions, a9 as suggestSignatureFields, aa as uploadQueryString, ab as useDeclineSignatureRequest, ac as useDocumentSignatureRequests, ad as useDocumentTools, ae as useFileShare, af as useFileSharePdf, ag as useFileShares, ah as useInviteSigners, ai as useOptionalDocumentTools, aj as useRefreshFileShares, ak as useSaveSignatureRequest, al as useSignSignatureRequest, am as useSignerCandidates, an as useVoidSignatureRequest } from '../file-shares.d-CamKxNLC.js';
4
3
  import { A as AnnotationStore } from '../store.d-DkFXbWDk.js';
5
4
  import { A as Annotation, b as AnnotationLayer } from '../model.d-CNtRWKVK.js';
5
+ import * as React from 'react';
6
6
  import * as _tanstack_react_query from '@tanstack/react-query';
7
- import { D as DocumentBytesKind } from '../query-keys.d-BZolSssa.js';
8
- export { f as documentBytesKey } from '../query-keys.d-BZolSssa.js';
7
+ import { components, KeyPair } from '@arbidocs/client';
9
8
  import '@arbidocs/sdk/browser';
10
9
 
11
- type DocumentToolsClient = ArbiClient['fetch'];
12
- type DocumentToolsNoticeKind = 'success' | 'error' | 'info' | 'warning';
13
- interface DocumentToolsNoticeOptions {
14
- /** A second line under the message. */
15
- description?: string;
16
- /** One action button on the notice ("Email it"). */
17
- action?: {
18
- label: string;
19
- onClick: () => void;
20
- };
21
- }
22
- type DocumentToolsNotify = (message: string, kind: DocumentToolsNoticeKind, options?: DocumentToolsNoticeOptions) => void;
23
- interface DocumentToolsUser {
24
- /** The name marks are authored as and the signer's name is prefilled with. */
25
- name: string;
26
- /** The sign-in email: signing re-derives the user's key from it and the password. */
27
- email?: string | null;
28
- /** The user's id (usr-*): which fields of a signature request are theirs. */
29
- externalId?: string | null;
30
- }
31
- /** What changed about a document, so the host can refresh its own lists and caches. */
32
- type DocumentChange =
33
- /** A version's markup got its first mark or lost its last one. */
34
- 'markup'
35
- /** A signature was added: the document has a new current version. */
36
- | 'signed'
37
- /** A new document was made from it (a frozen copy). The ids are the NEW documents. */
38
- | 'copy'
39
- /** A new version was saved (the Word editor's Save version): the document's current version. */
40
- | 'version';
41
- /**
42
- * The `/v1/document/upload` query, typed from the API schema: `derived_from` is a list (a
43
- * production set is derived from every document in it), `shared` a boolean.
44
- */
45
- type DocumentUploadQuery = NonNullable<operations['upload_documents']['parameters']['query']>;
46
- interface DocumentUploadRequest {
47
- file: File;
48
- /** `/v1/document/upload` query: `derived_from`, `derived_role`, `shared`, `folder`. */
49
- query: DocumentUploadQuery;
50
- }
51
- /**
52
- * The upload query as a URL query string, for a host that posts the upload itself (an XHR with
53
- * progress): a list repeats its key (`derived_from=a&derived_from=b`), empty values are left out.
54
- */
55
- declare function uploadQueryString(query: DocumentUploadQuery): string;
56
- interface DocumentToolsEnvironment {
57
- client: DocumentToolsClient;
58
- /**
59
- * The deployment domain the user's keys are derived for. Needed for signing. Default: the one
60
- * the host's `Arbi` computes (`arbi.getDeploymentDomain()`), if any.
61
- */
62
- deploymentDomain?: string;
63
- /** The signed-in user; marks are authored as "You" without one, and signing is unavailable. */
64
- user?: DocumentToolsUser | null;
65
- /** Surface a transient message. Default: none (errors still show inline where they can). */
66
- notify?: DocumentToolsNotify;
67
- /** Open a document or a version reference (`doc-…@v2`): the copy just made, the signed copy. */
68
- openDocument?: (documentRef: string) => void;
69
- /**
70
- * Documents changed on the server (see {@link DocumentChange}); refresh the host's lists. The
71
- * tools wait for it before opening the document, so a copy is listed when it opens.
72
- */
73
- onDocumentsChanged?: (documentIds: string[], change: DocumentChange) => void | Promise<void>;
74
- /** Upload a derived copy. Default: `POST /v1/document/upload` through `client`. */
75
- uploadDocument?: (request: DocumentUploadRequest) => Promise<{
76
- doc_ext_ids?: string[];
77
- } | undefined>;
78
- /** Save a file to the user's computer. Default: a temporary download link. */
79
- saveFile?: (blob: Blob, fileName: string) => void;
80
- /** Email a document (offered once it is signed). Omitted: no "Email it". */
81
- emailDocument?: (documentRef: string) => void;
82
- /**
83
- * The public page that checks a signature (the certificate) in this app. When given, "View
84
- * certificate" opens it in preference to the backend's `certificate_url` (which is on the
85
- * deployment domain, like the link embedded in the signed PDF). Without it: the backend's
86
- * `certificate_url`, else `/verify/{reference}` on this origin.
87
- */
88
- certificateUrl?: (reference: string) => string;
89
- }
90
- /** The environment with every default filled in. */
91
- interface ResolvedDocumentToolsEnvironment extends DocumentToolsEnvironment {
92
- prepareFileShare: (documentId: string) => Promise<void>;
93
- registerBeforeFileShare: (documentId: string, flush: () => Promise<void>) => () => void;
94
- notify: DocumentToolsNotify;
95
- saveFile: (blob: Blob, fileName: string) => void;
96
- uploadDocument: (request: DocumentUploadRequest) => Promise<{
97
- doc_ext_ids?: string[];
98
- } | undefined>;
99
- }
100
- /**
101
- * Save a blob through a temporary `<a download>`. The object URL is revoked a minute later, not at
102
- * once: revoking straight after `click()` can cancel the download (Safari, and large files
103
- * elsewhere) before the browser has read the blob.
104
- */
105
- declare function downloadBlob(blob: Blob, fileName: string): void;
106
- /** The default upload: multipart `files` to `/v1/document/upload` through the API client. */
107
- declare function clientUpload(client: DocumentToolsClient): ({ file, query }: DocumentUploadRequest) => Promise<{
108
- doc_ext_ids?: string[] | undefined;
109
- version?: number | null | undefined;
110
- autosave?: boolean | null | undefined;
111
- batch_id?: string | null | undefined;
112
- skipped?: {
113
- file_name: string;
114
- reason: string;
115
- }[] | undefined;
116
- } | undefined>;
117
- declare function defaultCertificateUrl(reference: string): string;
118
- /**
119
- * Where "View certificate" goes for a signature: the host's `certificateUrl(reference)` when it
120
- * gives one, else the `certificate_url` the backend returned, else `/verify/{reference}` here.
121
- */
122
- declare function certificateLink(signature: {
123
- reference: string;
124
- certificate_url?: string | null;
125
- }, certificateUrl?: (reference: string) => string): string;
126
- interface DocumentToolsProviderProps extends DocumentToolsEnvironment {
127
- children: ReactNode;
128
- }
129
- declare function DocumentToolsProvider({ children, ...env }: DocumentToolsProviderProps): React.JSX.Element;
130
- /** The host's environment, or `null` outside a `<DocumentToolsProvider>`. */
131
- declare function useOptionalDocumentTools(): ResolvedDocumentToolsEnvironment | null;
132
- /** The host's environment; throws outside a `<DocumentToolsProvider>`. */
133
- declare function useDocumentTools(): ResolvedDocumentToolsEnvironment;
134
-
135
10
  /**
136
11
  * A document's bytes, through the host's API client: the PDF the viewer and the tools draw on
137
12
  * (`/view`: the file itself for a PDF, its PDF rendering for a Word or text file) and the stored
@@ -508,262 +383,6 @@ type CopyMatch = {
508
383
  /** Compare a file with the signed PDF and its signed revisions. Hashed here; nothing is uploaded. */
509
384
  declare function matchSignedCopy(file: Blob, verification: Pick<SignatureVerification, 'document_sha256' | 'signatures'>): Promise<CopyMatch>;
510
385
 
511
- type SignatureField = components['schemas']['SignatureField'];
512
- type SignatureFieldType = SignatureField['type'];
513
- type SignatureRequest = components['schemas']['SignatureRequestResponse'];
514
- type SignatureRequestSigner = components['schemas']['SignatureRequestSigner'];
515
- type SignerProgress = components['schemas']['SignerProgress'];
516
- type SuggestedSignatureField = components['schemas']['SuggestedSignatureField'];
517
- type AdoptedSignature = components['schemas']['AdoptedSignature'];
518
- type SignRequestSignResponse = components['schemas']['SignRequestSignResponse'];
519
- /** Field types in the order the editor offers them. */
520
- declare const SIGNATURE_FIELD_TYPES: readonly SignatureFieldType[];
521
- declare const FIELD_TYPE_LABELS: Record<SignatureFieldType, string>;
522
- /**
523
- * Default size of a new field, as fractions of the page (the backend draws to fit the box). The
524
- * same sizes the server's suggester places fields in (`esign_suggest._SIZE`).
525
- */
526
- declare const DEFAULT_FIELD_SIZE: Record<SignatureFieldType, {
527
- width: number;
528
- height: number;
529
- }>;
530
- /** How far each signer has got, as the request's sender sees it. */
531
- declare const SIGNER_PROGRESS_LABELS: Record<SignerProgress, string>;
532
- /** Whether a field's signer is an email (someone to invite) rather than a member or request signer. */
533
- declare const isEmailSigner: (signer: string) => boolean;
534
- /** The fields carrying a signer's mark: every signer needs at least one to be sent the request. */
535
- declare const MARK_FIELD_TYPES: readonly SignatureFieldType[];
536
- /** A short unique id for a new field (the server only needs it unique within the request). */
537
- declare function newFieldId(): string;
538
- /** Initials from a name: "Olive M. Owner" -> "OMO". */
539
- declare function initialsOf(name: string): string;
540
- /** The fields a signer completes, in the order they are walked through: page, then top to bottom. */
541
- declare function fieldsInSigningOrder(fields: SignatureField[], signer: string): SignatureField[];
542
- /** Why a draft cannot be sent yet, or null when it can. Mirrors the server's checks. */
543
- declare function sendBlocker(fields: SignatureField[]): string | null;
544
- /**
545
- * Suggested fields grouped by signature block; `assign` maps a block (`group`) to the signer its
546
- * fields go to. A field placed in the Word document that names its signer goes to them: the
547
- * member with that email (`members`, by lowercased email), else the email itself (an invitee).
548
- * Unassigned blocks are left out.
549
- */
550
- declare function fieldsFromSuggestions(suggestions: SuggestedSignatureField[], assign: Record<number, string | undefined>, members?: ReadonlyMap<string, string>): SignatureField[];
551
- /** The Word document's own fields (found by their anchors) and the optional layout suggestions. */
552
- declare function splitSuggestions(suggestions: SuggestedSignatureField[]): {
553
- placed: {
554
- type: "signature" | "initials" | "date" | "name";
555
- page: number;
556
- x: number;
557
- y: number;
558
- width: number;
559
- height: number;
560
- group: number;
561
- role?: string | null;
562
- anchor: string;
563
- source: "anchor" | "layout";
564
- signer_email?: string | null;
565
- signer_name?: string | null;
566
- required: boolean;
567
- }[];
568
- extras: {
569
- type: "signature" | "initials" | "date" | "name";
570
- page: number;
571
- x: number;
572
- y: number;
573
- width: number;
574
- height: number;
575
- group: number;
576
- role?: string | null;
577
- anchor: string;
578
- source: "anchor" | "layout";
579
- signer_email?: string | null;
580
- signer_name?: string | null;
581
- required: boolean;
582
- }[];
583
- };
584
- declare function fetchDocumentSignatureRequests(client: DocumentToolsClient, documentId: string): Promise<SignatureRequest[]>;
585
- /** A document's signature requests, newest first. */
586
- declare function useDocumentSignatureRequests(documentId: string | null | undefined, enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<{
587
- external_id: string;
588
- doc_ext_id: string | null;
589
- version: number;
590
- source_sha256: string;
591
- status: components["schemas"]["SignatureRequestStatus"];
592
- message?: string | null;
593
- fields: components["schemas"]["SignatureField"][];
594
- signers: components["schemas"]["SignatureRequestSigner"][];
595
- created_by?: string | null;
596
- created_at: string;
597
- sent_at?: string | null;
598
- completed_at?: string | null;
599
- signed_version?: number | null;
600
- stale: boolean;
601
- }[]>, Error>;
602
- /** A signer the Word document's placed fields name, with the name they give. */
603
- interface NamedSigner {
604
- email: string;
605
- name: string;
606
- }
607
- /** What a document asks to be signed: the fields found, and the signers its Word fields name. */
608
- interface SignatureFieldSuggestions {
609
- fields: SuggestedSignatureField[];
610
- /**
611
- * Named even when the PDF shows none of the Word fields' anchors (the fields are then placed by
612
- * hand): who each email belongs to. Empty from a server that does not report them.
613
- */
614
- signers: NamedSigner[];
615
- }
616
- declare function signatureFieldSuggestions(client: DocumentToolsClient, documentId: string, version?: number): Promise<SignatureFieldSuggestions>;
617
- declare function suggestSignatureFields(client: DocumentToolsClient, documentId: string, version?: number): Promise<SuggestedSignatureField[]>;
618
- interface SaveSignatureRequestVars {
619
- documentId: string;
620
- /** The version the fields were placed on (the PDF shown). Omitted = current. */
621
- version?: number;
622
- fields: SignatureField[];
623
- message?: string;
624
- /** Existing draft to update instead of creating a new request. */
625
- requestId?: string;
626
- /** Send it to the signers (else it is saved as a draft). */
627
- send: boolean;
628
- }
629
- declare function saveSignatureRequest(client: DocumentToolsClient, { documentId, version, fields, message, requestId, send }: SaveSignatureRequestVars): Promise<SignatureRequest>;
630
- declare function useSaveSignatureRequest(): _tanstack_react_query.UseMutationResult<{
631
- external_id: string;
632
- doc_ext_id: string | null;
633
- version: number;
634
- source_sha256: string;
635
- status: components["schemas"]["SignatureRequestStatus"];
636
- message?: string | null;
637
- fields: components["schemas"]["SignatureField"][];
638
- signers: components["schemas"]["SignatureRequestSigner"][];
639
- created_by?: string | null;
640
- created_at: string;
641
- sent_at?: string | null;
642
- completed_at?: string | null;
643
- signed_version?: number | null;
644
- stale: boolean;
645
- }, Error, SaveSignatureRequestVars, unknown>;
646
- declare function useVoidSignatureRequest(): _tanstack_react_query.UseMutationResult<{
647
- external_id: string;
648
- doc_ext_id: string | null;
649
- version: number;
650
- source_sha256: string;
651
- status: components["schemas"]["SignatureRequestStatus"];
652
- message?: string | null | undefined;
653
- fields: {
654
- id: string;
655
- type: "signature" | "initials" | "date" | "name";
656
- page: number;
657
- x: number;
658
- y: number;
659
- width: number;
660
- height: number;
661
- signer: string;
662
- required: boolean;
663
- }[];
664
- signers: {
665
- external_id: string;
666
- user_ext_id?: string | null | undefined;
667
- name: string;
668
- email?: string | null | undefined;
669
- status: components["schemas"]["SignerStatus"];
670
- progress: components["schemas"]["SignerProgress"];
671
- viewed_at?: string | null | undefined;
672
- signed_at?: string | null | undefined;
673
- reference?: string | null | undefined;
674
- fields: number;
675
- }[];
676
- created_by?: string | null | undefined;
677
- created_at: string;
678
- sent_at?: string | null | undefined;
679
- completed_at?: string | null | undefined;
680
- signed_version?: number | null | undefined;
681
- stale: boolean;
682
- }, Error, string, unknown>;
683
- declare function useDeclineSignatureRequest(): _tanstack_react_query.UseMutationResult<{
684
- external_id: string;
685
- doc_ext_id: string | null;
686
- version: number;
687
- source_sha256: string;
688
- status: components["schemas"]["SignatureRequestStatus"];
689
- message?: string | null | undefined;
690
- fields: {
691
- id: string;
692
- type: "signature" | "initials" | "date" | "name";
693
- page: number;
694
- x: number;
695
- y: number;
696
- width: number;
697
- height: number;
698
- signer: string;
699
- required: boolean;
700
- }[];
701
- signers: {
702
- external_id: string;
703
- user_ext_id?: string | null | undefined;
704
- name: string;
705
- email?: string | null | undefined;
706
- status: components["schemas"]["SignerStatus"];
707
- progress: components["schemas"]["SignerProgress"];
708
- viewed_at?: string | null | undefined;
709
- signed_at?: string | null | undefined;
710
- reference?: string | null | undefined;
711
- fields: number;
712
- }[];
713
- created_by?: string | null | undefined;
714
- created_at: string;
715
- sent_at?: string | null | undefined;
716
- completed_at?: string | null | undefined;
717
- signed_version?: number | null | undefined;
718
- stale: boolean;
719
- }, Error, {
720
- requestId: string;
721
- reason?: string;
722
- }, unknown>;
723
- interface SignRequestVars {
724
- request: SignatureRequest;
725
- /** The PDF the signer was walked through (`GET /view?version=` of the request's version). */
726
- pdfBlob: Blob;
727
- email: string;
728
- password: string;
729
- adopted: AdoptedSignature;
730
- /** The ids of the fields the signer applied: every required one of theirs. */
731
- fields: string[];
732
- }
733
- /**
734
- * Sign all of the signer's fields at once: the server prepares the statement, the browser checks
735
- * it covers the PDF on screen under the wording the signer read, re-derives the Ed25519 key from
736
- * the password and signs. Resolves with `completed` when this was the last signature.
737
- */
738
- declare function signSignatureRequest(client: DocumentToolsClient, deploymentDomain: string, { request, pdfBlob, email, password, adopted, fields }: SignRequestVars): Promise<SignRequestSignResponse>;
739
- declare function useSignSignatureRequest(): _tanstack_react_query.UseMutationResult<{
740
- request: components["schemas"]["SignatureRequestResponse"];
741
- completed: boolean;
742
- signed_version?: number | null;
743
- }, Error, SignRequestVars, unknown>;
744
- interface SignerCandidate {
745
- externalId: string;
746
- name: string;
747
- email: string;
748
- role: string;
749
- }
750
- /**
751
- * The people in the active workspace who may sign: owners, collaborators and guests (an agent never
752
- * does). The first one listed is the current user when they are a member.
753
- */
754
- declare function useSignerCandidates(enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<SignerCandidate[]>, Error>;
755
- /**
756
- * Invite signers who are not in the workspace yet, as guests, through the workspace's own invite
757
- * (`POST /v1/workspace/users` with `confirm_invite`): a registered person is added at once, anyone
758
- * else is emailed an invitation that lands on the document. Each is asked to sign when they join.
759
- * Only a workspace owner can invite.
760
- */
761
- declare function inviteSigners(client: DocumentToolsClient, documentId: string, emails: string[]): Promise<void>;
762
- declare function useInviteSigners(): _tanstack_react_query.UseMutationResult<void, Error, {
763
- documentId: string;
764
- emails: string[];
765
- }, unknown>;
766
-
767
386
  interface SavedSignature {
768
387
  name: string;
769
388
  initials: string;
@@ -795,95 +414,4 @@ declare function pngSize(base64: string): {
795
414
  height: number;
796
415
  };
797
416
 
798
- type FileShare = components['schemas']['FileShareResponse'];
799
- type CreateFileShare = components['schemas']['CreateFileShare'];
800
- declare function createFileShare(client: DocumentToolsClient, documentId: string, body: CreateFileShare): Promise<{
801
- external_id: string;
802
- document_ext_id: string;
803
- version: number;
804
- file_name: string;
805
- status: string;
806
- source_sha256: string;
807
- fields: {
808
- id: string;
809
- type: "signature" | "initials" | "date" | "name";
810
- page: number;
811
- x: number;
812
- y: number;
813
- width: number;
814
- height: number;
815
- signer: string;
816
- required: boolean;
817
- }[];
818
- message: string;
819
- owner: boolean;
820
- can_sign: boolean;
821
- can_preview: boolean;
822
- recipients: {
823
- email: string;
824
- permission: string;
825
- status: string;
826
- expires_at: string | null;
827
- delivery_status: string;
828
- reference?: string | null | undefined;
829
- }[];
830
- published_version?: number | null | undefined;
831
- owner_workspace_ext_id?: string | null | undefined;
832
- }>;
833
- declare function getFileShare(client: DocumentToolsClient, id: string): Promise<FileShare>;
834
- declare function fileShareBytes(client: DocumentToolsClient, id: string, kind: 'view' | 'original' | 'signed'): Promise<Blob>;
835
- /** Adapt only the guided viewer's presentation data; sharing uses its own authorization endpoints. */
836
- declare function fileShareSigningRequest(share: FileShare): SignatureRequest;
837
- declare function signFileShare(client: DocumentToolsClient, domain: string, vars: SignRequestVars): Promise<SignRequestSignResponse>;
838
- declare function useFileShare(client: DocumentToolsClient, shareId: string, signing: boolean): _tanstack_react_query.UseQueryResult<NoInfer<{
839
- external_id: string;
840
- document_ext_id: string;
841
- version: number;
842
- file_name: string;
843
- status: string;
844
- source_sha256: string;
845
- fields: components["schemas"]["SignatureField"][];
846
- message: string;
847
- owner: boolean;
848
- can_sign: boolean;
849
- can_preview: boolean;
850
- recipients: components["schemas"]["FileShareRecipientResponse"][];
851
- published_version?: number | null;
852
- owner_workspace_ext_id?: string | null;
853
- }>, Error>;
854
- declare function useFileSharePdf(client: DocumentToolsClient, shareId: string, share?: FileShare): _tanstack_react_query.UseQueryResult<NoInfer<Blob>, Error>;
855
- declare function useFileShares(client: DocumentToolsClient): _tanstack_react_query.UseQueryResult<NoInfer<{
856
- external_id: string;
857
- document_ext_id: string;
858
- version: number;
859
- file_name: string;
860
- status: string;
861
- source_sha256: string;
862
- fields: {
863
- id: string;
864
- type: "signature" | "initials" | "date" | "name";
865
- page: number;
866
- x: number;
867
- y: number;
868
- width: number;
869
- height: number;
870
- signer: string;
871
- required: boolean;
872
- }[];
873
- message: string;
874
- owner: boolean;
875
- can_sign: boolean;
876
- can_preview: boolean;
877
- recipients: {
878
- email: string;
879
- permission: string;
880
- status: string;
881
- expires_at: string | null;
882
- delivery_status: string;
883
- reference?: string | null | undefined;
884
- }[];
885
- published_version?: number | null | undefined;
886
- owner_workspace_ext_id?: string | null | undefined;
887
- }[]>, Error>;
888
-
889
- export { type AdoptedSignature, type AnnotatableState, type CopyMatch, type CreateFileShare, DEFAULT_FIELD_SIZE, DocumentBytesKind, type DocumentChange, DocumentFetchError, type DocumentFetchOptions, type DocumentToolsClient, type DocumentToolsEnvironment, type DocumentToolsNoticeKind, type DocumentToolsNoticeOptions, type DocumentToolsNotify, DocumentToolsProvider, type DocumentToolsProviderProps, type DocumentToolsUser, type DocumentUploadQuery, type DocumentUploadRequest, FIELD_TYPE_LABELS, type FileShare, type FrozenCopySource, INFORMAL_SIGNATURE_NOTE, type KeypairSource, LEGACY_LAYER_PREFIX, type LegacyPrompt, MARK_FIELD_TYPES, MAX_MERGE_ATTEMPTS, type MarkupDocument, MarkupDownloadError, type MarkupSnapshot, type MarkupStore, MarkupStoreError, type MarkupStoreOptions, type NamedSigner, type OlderMarkupNote, type ResolvedDocumentToolsEnvironment, SIGNATURE_FIELD_TYPES, SIGNED_LOCKED_REASON, SIGNED_UNCHANGED, SIGNER_PROGRESS_LABELS, type SaveSignatureRequestVars, type SavedSignature, type SignDocumentResponse, type SignDocumentVars, type SignRequestSignResponse, type SignRequestVars, type SignatureAppearance, type SignatureField, type SignatureFieldSuggestions, type SignatureFieldType, type SignatureRecord, type SignatureRequest, type SignatureRequestSigner, type SignatureStatusResponse, type SignatureVerification, SignatureVerificationError, type SignerCandidate, type SignerDetails, type SignerProgress, SigningError, type SigningErrorReason, type SuggestedSignatureField, type UseDocumentBytesOptions, VERIFY_PATH, type VerifiedSignature, type VersionInfo, addToMarkup, canAnnotate, certificateLink, clientUpload, contentDispositionFileName, copyOpenThreads, createFileShare, createMarkupStore, currentHasMarkup, defaultCertificateUrl, deleteSavedSignature, downloadBlob, fetchDocumentFile, fetchDocumentPdf, fetchDocumentSignatureRequests, fetchDocumentSignatures, fetchMarkupPdf, fetchSavedSignature, fetchSignatureVerification, fieldsFromSuggestions, fieldsInSigningOrder, fileShareBytes, fileShareSigningRequest, forgetLegacyLayer, frozenCopyName, getFileShare, initialsOf, intentText, inviteSigners, isEmailSigner, isLegibleSignatureBox, isSignatureReference, isSignedVersion, marksByVersion, matchSignedCopy, migrateLegacyLayer, newFieldId, openThreadsOf, pngBytes, pngSize, readLegacyLayer, redactionLogName, saveSignatureRequest, sendBlocker, sha256Hex, signDocument, signFileShare, signSignatureRequest, signatureFieldSuggestions, splitSuggestions, storeSavedSignature, suggestSignatureFields, toAppearance, uploadFrozenCopy, uploadQueryString, useDeclineSignatureRequest, useDeleteSavedSignature, useDocumentBytes, useDocumentMarkup, useDocumentSignatureRequests, useDocumentSignatures, useDocumentTools, useFileShare, useFileSharePdf, useFileShares, useInviteSigners, useIsOnline, useOptionalDocumentTools, useSaveSignatureRequest, useSavedSignature, useSignDocument, useSignSignatureRequest, useSignatureVerification, useSignerCandidates, useStoreSavedSignature, useVoidSignatureRequest, versionsWithMarkup };
417
+ export { type AnnotatableState, type CopyMatch, DocumentBytesKind, DocumentFetchError, type DocumentFetchOptions, DocumentToolsClient, DocumentToolsEnvironment, type FrozenCopySource, INFORMAL_SIGNATURE_NOTE, type KeypairSource, LEGACY_LAYER_PREFIX, type LegacyPrompt, MAX_MERGE_ATTEMPTS, type MarkupDocument, MarkupDownloadError, type MarkupSnapshot, type MarkupStore, MarkupStoreError, type MarkupStoreOptions, type OlderMarkupNote, SIGNED_LOCKED_REASON, SIGNED_UNCHANGED, type SavedSignature, type SignDocumentResponse, type SignDocumentVars, type SignatureAppearance, type SignatureRecord, type SignatureStatusResponse, type SignatureVerification, SignatureVerificationError, type SignerDetails, SigningError, type SigningErrorReason, type UseDocumentBytesOptions, VERIFY_PATH, type VerifiedSignature, type VersionInfo, addToMarkup, canAnnotate, contentDispositionFileName, copyOpenThreads, createMarkupStore, currentHasMarkup, deleteSavedSignature, fetchDocumentFile, fetchDocumentPdf, fetchDocumentSignatures, fetchMarkupPdf, fetchSavedSignature, fetchSignatureVerification, forgetLegacyLayer, frozenCopyName, intentText, isLegibleSignatureBox, isSignatureReference, isSignedVersion, marksByVersion, matchSignedCopy, migrateLegacyLayer, openThreadsOf, pngBytes, pngSize, readLegacyLayer, redactionLogName, sha256Hex, signDocument, storeSavedSignature, toAppearance, uploadFrozenCopy, useDeleteSavedSignature, useDocumentBytes, useDocumentMarkup, useDocumentSignatures, useIsOnline, useSavedSignature, useSignDocument, useSignatureVerification, useStoreSavedSignature, versionsWithMarkup };
@@ -115,6 +115,8 @@ import {
115
115
  useFileShare,
116
116
  useFileSharePdf,
117
117
  useFileShares,
118
+ useRefreshFileShares,
119
+ publishFileShare,
118
120
  fileShareBytes,
119
121
  fileShareSigningRequest,
120
122
  signFileShare
@@ -178,6 +180,7 @@ export {
178
180
  openThreadsOf,
179
181
  pngBytes,
180
182
  pngSize,
183
+ publishFileShare,
181
184
  readLegacyLayer,
182
185
  redactionLogName,
183
186
  saveSignatureRequest,
@@ -206,6 +209,7 @@ export {
206
209
  useInviteSigners,
207
210
  useIsOnline,
208
211
  useOptionalDocumentTools,
212
+ useRefreshFileShares,
209
213
  useSaveSignatureRequest,
210
214
  useSavedSignature,
211
215
  useSignDocument,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/document-tools/core.ts"],
4
- "sourcesContent": ["/** Document data, downloads and host context without optional PDF production peers. */\nexport {\n DocumentToolsProvider,\n certificateLink,\n clientUpload,\n defaultCertificateUrl,\n downloadBlob,\n uploadQueryString,\n useDocumentTools,\n useOptionalDocumentTools,\n type DocumentChange,\n type DocumentToolsClient,\n type DocumentToolsEnvironment,\n type DocumentToolsNoticeKind,\n type DocumentToolsNoticeOptions,\n type DocumentToolsNotify,\n type DocumentToolsProviderProps,\n type DocumentToolsUser,\n type DocumentUploadQuery,\n type DocumentUploadRequest,\n type ResolvedDocumentToolsEnvironment,\n} from './environment'\nexport {\n DocumentFetchError,\n contentDispositionFileName,\n fetchDocumentFile,\n fetchDocumentPdf,\n type DocumentFetchOptions,\n} from './document-pdf'\n\nexport {\n MAX_MERGE_ATTEMPTS,\n MarkupStoreError,\n createMarkupStore,\n type MarkupSnapshot,\n type MarkupStore,\n type MarkupStoreOptions,\n} from './markup-store'\nexport {\n LEGACY_LAYER_PREFIX,\n addToMarkup,\n copyOpenThreads,\n forgetLegacyLayer,\n marksByVersion,\n migrateLegacyLayer,\n openThreadsOf,\n readLegacyLayer,\n versionsWithMarkup,\n type VersionInfo,\n} from './markup-transfer'\nexport {\n MarkupDownloadError,\n SIGNED_LOCKED_REASON,\n currentHasMarkup,\n fetchMarkupPdf,\n isSignedVersion,\n} from './markup-download'\nexport {\n SIGNED_UNCHANGED,\n useDocumentMarkup,\n type LegacyPrompt,\n type MarkupDocument,\n type OlderMarkupNote,\n} from './useDocumentMarkup'\nexport {\n frozenCopyName,\n redactionLogName,\n uploadFrozenCopy,\n type FrozenCopySource,\n} from './frozen-copy'\nexport { canAnnotate, type AnnotatableState } from './can-annotate'\nexport { useIsOnline } from './useIsOnline'\nexport {\n documentBytesKey,\n useDocumentBytes,\n type DocumentBytesKind,\n type UseDocumentBytesOptions,\n} from './useDocumentBytes'\nexport {\n fetchDocumentSignatures,\n intentText,\n isLegibleSignatureBox,\n sha256Hex,\n signDocument,\n SigningError,\n toAppearance,\n useDocumentSignatures,\n useSignDocument,\n type SignDocumentResponse,\n type SignDocumentVars,\n type SigningErrorReason,\n type SignatureAppearance,\n type SignatureRecord,\n type SignatureStatusResponse,\n type SignerDetails,\n} from './signing'\nexport {\n SignatureVerificationError,\n VERIFY_PATH,\n fetchSignatureVerification,\n isSignatureReference,\n matchSignedCopy,\n useSignatureVerification,\n type CopyMatch,\n type SignatureVerification,\n type VerifiedSignature,\n} from './verification'\nexport {\n DEFAULT_FIELD_SIZE,\n FIELD_TYPE_LABELS,\n MARK_FIELD_TYPES,\n SIGNATURE_FIELD_TYPES,\n SIGNER_PROGRESS_LABELS,\n fetchDocumentSignatureRequests,\n fieldsFromSuggestions,\n fieldsInSigningOrder,\n initialsOf,\n inviteSigners,\n isEmailSigner,\n newFieldId,\n saveSignatureRequest,\n sendBlocker,\n signSignatureRequest,\n signatureFieldSuggestions,\n splitSuggestions,\n suggestSignatureFields,\n useDeclineSignatureRequest,\n useDocumentSignatureRequests,\n useInviteSigners,\n useSaveSignatureRequest,\n useSignSignatureRequest,\n useSignerCandidates,\n useVoidSignatureRequest,\n type AdoptedSignature,\n type SaveSignatureRequestVars,\n type SignRequestSignResponse,\n type SignRequestVars,\n type SignatureField,\n type SignatureFieldType,\n type SignatureRequest,\n type SignatureRequestSigner,\n type SignerCandidate,\n type SignerProgress,\n type NamedSigner,\n type SignatureFieldSuggestions,\n type SuggestedSignatureField,\n} from './signature-requests'\nexport {\n INFORMAL_SIGNATURE_NOTE,\n deleteSavedSignature,\n fetchSavedSignature,\n pngBytes,\n pngSize,\n storeSavedSignature,\n useDeleteSavedSignature,\n useSavedSignature,\n useStoreSavedSignature,\n type KeypairSource,\n type SavedSignature,\n} from './saved-signature'\n\nexport {\n createFileShare,\n getFileShare,\n useFileShare,\n useFileSharePdf,\n useFileShares,\n fileShareBytes,\n fileShareSigningRequest,\n signFileShare,\n type FileShare,\n type CreateFileShare,\n} from './file-shares'\n"],
5
- "mappings": "AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAYK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,mBAA0C;AACnD,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAQK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAcK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;",
4
+ "sourcesContent": ["/** Document data, downloads and host context without optional PDF production peers. */\nexport {\n DocumentToolsProvider,\n certificateLink,\n clientUpload,\n defaultCertificateUrl,\n downloadBlob,\n uploadQueryString,\n useDocumentTools,\n useOptionalDocumentTools,\n type DocumentChange,\n type DocumentToolsClient,\n type DocumentToolsEnvironment,\n type DocumentToolsNoticeKind,\n type DocumentToolsNoticeOptions,\n type DocumentToolsNotify,\n type DocumentToolsProviderProps,\n type DocumentToolsUser,\n type DocumentUploadQuery,\n type DocumentUploadRequest,\n type ResolvedDocumentToolsEnvironment,\n} from './environment'\nexport {\n DocumentFetchError,\n contentDispositionFileName,\n fetchDocumentFile,\n fetchDocumentPdf,\n type DocumentFetchOptions,\n} from './document-pdf'\n\nexport {\n MAX_MERGE_ATTEMPTS,\n MarkupStoreError,\n createMarkupStore,\n type MarkupSnapshot,\n type MarkupStore,\n type MarkupStoreOptions,\n} from './markup-store'\nexport {\n LEGACY_LAYER_PREFIX,\n addToMarkup,\n copyOpenThreads,\n forgetLegacyLayer,\n marksByVersion,\n migrateLegacyLayer,\n openThreadsOf,\n readLegacyLayer,\n versionsWithMarkup,\n type VersionInfo,\n} from './markup-transfer'\nexport {\n MarkupDownloadError,\n SIGNED_LOCKED_REASON,\n currentHasMarkup,\n fetchMarkupPdf,\n isSignedVersion,\n} from './markup-download'\nexport {\n SIGNED_UNCHANGED,\n useDocumentMarkup,\n type LegacyPrompt,\n type MarkupDocument,\n type OlderMarkupNote,\n} from './useDocumentMarkup'\nexport {\n frozenCopyName,\n redactionLogName,\n uploadFrozenCopy,\n type FrozenCopySource,\n} from './frozen-copy'\nexport { canAnnotate, type AnnotatableState } from './can-annotate'\nexport { useIsOnline } from './useIsOnline'\nexport {\n documentBytesKey,\n useDocumentBytes,\n type DocumentBytesKind,\n type UseDocumentBytesOptions,\n} from './useDocumentBytes'\nexport {\n fetchDocumentSignatures,\n intentText,\n isLegibleSignatureBox,\n sha256Hex,\n signDocument,\n SigningError,\n toAppearance,\n useDocumentSignatures,\n useSignDocument,\n type SignDocumentResponse,\n type SignDocumentVars,\n type SigningErrorReason,\n type SignatureAppearance,\n type SignatureRecord,\n type SignatureStatusResponse,\n type SignerDetails,\n} from './signing'\nexport {\n SignatureVerificationError,\n VERIFY_PATH,\n fetchSignatureVerification,\n isSignatureReference,\n matchSignedCopy,\n useSignatureVerification,\n type CopyMatch,\n type SignatureVerification,\n type VerifiedSignature,\n} from './verification'\nexport {\n DEFAULT_FIELD_SIZE,\n FIELD_TYPE_LABELS,\n MARK_FIELD_TYPES,\n SIGNATURE_FIELD_TYPES,\n SIGNER_PROGRESS_LABELS,\n fetchDocumentSignatureRequests,\n fieldsFromSuggestions,\n fieldsInSigningOrder,\n initialsOf,\n inviteSigners,\n isEmailSigner,\n newFieldId,\n saveSignatureRequest,\n sendBlocker,\n signSignatureRequest,\n signatureFieldSuggestions,\n splitSuggestions,\n suggestSignatureFields,\n useDeclineSignatureRequest,\n useDocumentSignatureRequests,\n useInviteSigners,\n useSaveSignatureRequest,\n useSignSignatureRequest,\n useSignerCandidates,\n useVoidSignatureRequest,\n type AdoptedSignature,\n type SaveSignatureRequestVars,\n type SignRequestSignResponse,\n type SignRequestVars,\n type SignatureField,\n type SignatureFieldType,\n type SignatureRequest,\n type SignatureRequestSigner,\n type SignerCandidate,\n type SignerProgress,\n type NamedSigner,\n type SignatureFieldSuggestions,\n type SuggestedSignatureField,\n} from './signature-requests'\nexport {\n INFORMAL_SIGNATURE_NOTE,\n deleteSavedSignature,\n fetchSavedSignature,\n pngBytes,\n pngSize,\n storeSavedSignature,\n useDeleteSavedSignature,\n useSavedSignature,\n useStoreSavedSignature,\n type KeypairSource,\n type SavedSignature,\n} from './saved-signature'\n\nexport {\n createFileShare,\n getFileShare,\n useFileShare,\n useFileSharePdf,\n useFileShares,\n useRefreshFileShares,\n publishFileShare,\n fileShareBytes,\n fileShareSigningRequest,\n signFileShare,\n type FileShare,\n type CreateFileShare,\n} from './file-shares'\n"],
5
+ "mappings": "AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAYK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,mBAA0C;AACnD,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAQK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAcK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,5 @@
1
- import { useQuery } from "@tanstack/react-query";
1
+ import { useCallback } from "react";
2
+ import { useQuery, useQueryClient } from "@tanstack/react-query";
2
3
  import { arbiQueryKeys } from "../query-keys.js";
3
4
  import { signMessage, unlockIdentityWithPassword } from "@arbidocs/client";
4
5
  import { intentText, sha256Hex } from "./signing.js";
@@ -93,20 +94,38 @@ function useFileShares(client) {
93
94
  return useQuery({
94
95
  queryKey: arbiQueryKeys.fileShares(),
95
96
  queryFn: async () => {
96
- const result = await client.GET("/v1/file-shares");
97
- if (!result.data) throw new Error("Could not load shared files");
97
+ const result = await client?.GET("/v1/file-shares");
98
+ if (!result?.data) throw new Error("Could not load shared files");
98
99
  return result.data;
99
- }
100
+ },
101
+ enabled: !!client
100
102
  });
101
103
  }
104
+ function useRefreshFileShares() {
105
+ const queryClient = useQueryClient();
106
+ return useCallback(
107
+ () => queryClient.invalidateQueries({ queryKey: arbiQueryKeys.fileShares() }),
108
+ [queryClient]
109
+ );
110
+ }
111
+ async function publishFileShare(client, share) {
112
+ const result = await client.POST(
113
+ "/v1/document/{document_ext_id}/file-shares/{share_id}/publish",
114
+ { params: { path: { document_ext_id: share.document_ext_id, share_id: share.external_id } } }
115
+ );
116
+ if (!result.data) throw new Error("Could not save the signed version to its workspace");
117
+ return result.data;
118
+ }
102
119
  export {
103
120
  createFileShare,
104
121
  fileShareBytes,
105
122
  fileShareSigningRequest,
106
123
  getFileShare,
124
+ publishFileShare,
107
125
  signFileShare,
108
126
  useFileShare,
109
127
  useFileSharePdf,
110
- useFileShares
128
+ useFileShares,
129
+ useRefreshFileShares
111
130
  };
112
131
  //# sourceMappingURL=file-shares.js.map