@assinafy/cli 1.0.2 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -38
- package/THIRD_PARTY_NOTICES.md +972 -0
- package/dist/api.cjs +1965 -0
- package/dist/api.cjs.map +1 -0
- package/dist/api.js +1909 -0
- package/dist/api.js.map +1 -0
- package/dist/cli.cjs +3018 -1560
- package/dist/types/api/client.d.ts +88 -0
- package/dist/types/api/client.d.ts.map +1 -0
- package/dist/types/api/errors.d.ts +28 -0
- package/dist/types/api/errors.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +21 -0
- package/dist/types/api/index.d.ts.map +1 -0
- package/dist/types/api/resources/assignments.d.ts +39 -0
- package/dist/types/api/resources/assignments.d.ts.map +1 -0
- package/dist/types/api/resources/authentication.d.ts +55 -0
- package/dist/types/api/resources/authentication.d.ts.map +1 -0
- package/dist/types/api/resources/base.d.ts +35 -0
- package/dist/types/api/resources/base.d.ts.map +1 -0
- package/dist/types/api/resources/documents.d.ts +124 -0
- package/dist/types/api/resources/documents.d.ts.map +1 -0
- package/dist/types/api/resources/fields.d.ts +57 -0
- package/dist/types/api/resources/fields.d.ts.map +1 -0
- package/dist/types/api/resources/signer-documents.d.ts +72 -0
- package/dist/types/api/resources/signer-documents.d.ts.map +1 -0
- package/dist/types/api/resources/signers.d.ts +25 -0
- package/dist/types/api/resources/signers.d.ts.map +1 -0
- package/dist/types/api/resources/tags.d.ts +37 -0
- package/dist/types/api/resources/tags.d.ts.map +1 -0
- package/dist/types/api/resources/templates.d.ts +21 -0
- package/dist/types/api/resources/templates.d.ts.map +1 -0
- package/dist/types/api/resources/users.d.ts +14 -0
- package/dist/types/api/resources/users.d.ts.map +1 -0
- package/dist/types/api/resources/webhooks.d.ts +17 -0
- package/dist/types/api/resources/webhooks.d.ts.map +1 -0
- package/dist/types/api/resources/workspaces.d.ts +32 -0
- package/dist/types/api/resources/workspaces.d.ts.map +1 -0
- package/dist/types/api/support/webhook-verifier.d.ts +43 -0
- package/dist/types/api/support/webhook-verifier.d.ts.map +1 -0
- package/dist/types/api/types.d.ts +926 -0
- package/dist/types/api/types.d.ts.map +1 -0
- package/dist/types/api/utils.d.ts +34 -0
- package/dist/types/api/utils.d.ts.map +1 -0
- package/docs/README.md +9 -1
- package/docs/api-operations.json +718 -0
- package/docs/api-reference.md +7228 -0
- package/docs/assignments.md +21 -1
- package/docs/auth.md +28 -12
- package/docs/config.md +0 -1
- package/docs/docs.md +0 -1
- package/docs/documents.md +45 -6
- package/docs/fields.md +4 -2
- package/docs/login.md +0 -1
- package/docs/logout.md +0 -1
- package/docs/migration-v2.md +20 -0
- package/docs/releasing.md +42 -0
- package/docs/sdk-reference.md +344 -0
- package/docs/send.md +1 -2
- package/docs/signer.md +44 -19
- package/docs/signers.md +2 -3
- package/docs/tags.md +0 -1
- package/docs/templates.md +3 -3
- package/docs/users.md +85 -0
- package/docs/webhooks.md +1 -16
- package/docs/whoami.md +0 -1
- package/docs/workspaces.md +109 -10
- package/install.ps1 +117 -13
- package/install.sh +165 -30
- package/package.json +37 -16
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { type AxiosInstance } from 'axios';
|
|
2
|
+
import { AssignmentResource } from './resources/assignments.js';
|
|
3
|
+
import { AuthenticationResource } from './resources/authentication.js';
|
|
4
|
+
import { DocumentResource, type DocumentUploadSource } from './resources/documents.js';
|
|
5
|
+
import { FieldsResource } from './resources/fields.js';
|
|
6
|
+
import { SignerDocumentsResource } from './resources/signer-documents.js';
|
|
7
|
+
import { SignerResource } from './resources/signers.js';
|
|
8
|
+
import { TagResource } from './resources/tags.js';
|
|
9
|
+
import { TemplateResource } from './resources/templates.js';
|
|
10
|
+
import { UsersResource } from './resources/users.js';
|
|
11
|
+
import { WebhookResource } from './resources/webhooks.js';
|
|
12
|
+
import { WorkspaceResource } from './resources/workspaces.js';
|
|
13
|
+
import { WebhookVerifier } from './support/webhook-verifier.js';
|
|
14
|
+
import type { AssinafyClientOptions, IUploadAndRequestSignaturesResult, IUploadAndRequestSignaturesSigner, Logger } from './types.js';
|
|
15
|
+
/** Flexible input accepted by {@link AssinafyClient.fromConfig} (snake_case or camelCase). */
|
|
16
|
+
export interface ClientConfigInput {
|
|
17
|
+
api_key?: string;
|
|
18
|
+
apiKey?: string;
|
|
19
|
+
token?: string;
|
|
20
|
+
access_token?: string;
|
|
21
|
+
accessToken?: string;
|
|
22
|
+
account_id?: string;
|
|
23
|
+
accountId?: string;
|
|
24
|
+
base_url?: string;
|
|
25
|
+
baseUrl?: string;
|
|
26
|
+
webhook_secret?: string;
|
|
27
|
+
webhookSecret?: string;
|
|
28
|
+
timeout?: number;
|
|
29
|
+
logger?: Logger;
|
|
30
|
+
allow_unauthenticated?: boolean;
|
|
31
|
+
allowUnauthenticated?: boolean;
|
|
32
|
+
allow_insecure_http?: boolean;
|
|
33
|
+
allowInsecureHttp?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Primary entry point for the Assinafy API.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const client = new AssinafyClient({
|
|
41
|
+
* apiKey: process.env.ASSINAFY_API_KEY!,
|
|
42
|
+
* accountId: process.env.ASSINAFY_ACCOUNT_ID!,
|
|
43
|
+
* webhookSecret: process.env.ASSINAFY_WEBHOOK_SECRET,
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* const document = await client.documents.upload({ filePath: './contract.pdf' });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare class AssinafyClient {
|
|
50
|
+
private readonly axiosInstance;
|
|
51
|
+
private readonly defaultAccountId;
|
|
52
|
+
private readonly logger;
|
|
53
|
+
private readonly webhookSecret;
|
|
54
|
+
readonly documents: DocumentResource;
|
|
55
|
+
readonly signers: SignerResource;
|
|
56
|
+
readonly workspaces: WorkspaceResource;
|
|
57
|
+
readonly assignments: AssignmentResource;
|
|
58
|
+
readonly webhooks: WebhookResource;
|
|
59
|
+
readonly templates: TemplateResource;
|
|
60
|
+
readonly tags: TagResource;
|
|
61
|
+
readonly auth: AuthenticationResource;
|
|
62
|
+
readonly fields: FieldsResource;
|
|
63
|
+
readonly users: UsersResource;
|
|
64
|
+
readonly signerDocuments: SignerDocumentsResource;
|
|
65
|
+
readonly webhookVerifier: WebhookVerifier;
|
|
66
|
+
constructor(options: AssinafyClientOptions);
|
|
67
|
+
/** Convenience factory for the common apiKey + accountId setup. */
|
|
68
|
+
static create(apiKey: string, accountId: string, options?: Omit<AssinafyClientOptions, 'apiKey' | 'accountId'>): AssinafyClient;
|
|
69
|
+
/** Build a client from a plain object (supports snake_case and camelCase keys). */
|
|
70
|
+
static fromConfig(config: ClientConfigInput): AssinafyClient;
|
|
71
|
+
/**
|
|
72
|
+
* High-level helper that uploads a PDF, ensures it's processed, creates any
|
|
73
|
+
* missing signers, and kicks off a virtual signature assignment.
|
|
74
|
+
*/
|
|
75
|
+
uploadAndRequestSignatures(options: {
|
|
76
|
+
source: DocumentUploadSource;
|
|
77
|
+
signers: IUploadAndRequestSignaturesSigner[];
|
|
78
|
+
message?: string;
|
|
79
|
+
metadata?: Record<string, unknown>;
|
|
80
|
+
waitForReady?: boolean;
|
|
81
|
+
expiresAt?: string;
|
|
82
|
+
copyReceivers?: string[];
|
|
83
|
+
accountId?: string;
|
|
84
|
+
}): Promise<IUploadAndRequestSignaturesResult>;
|
|
85
|
+
/** Expose the underlying axios instance for advanced use cases (interceptors, custom endpoints). */
|
|
86
|
+
getAxiosInstance(): AxiosInstance;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA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EAAE,iCAAiC,EAAE,CAAC;QAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACnC,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB,SAAS,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,iCAAiC,CAAC,CA2D7C;IAED,oGAAoG;IACpG,gBAAgB,IAAI,aAAa,CAEhC;CACD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Base class for all Assinafy SDK errors. */
|
|
2
|
+
export declare class AssinafyError extends Error {
|
|
3
|
+
readonly context: Record<string, unknown>;
|
|
4
|
+
constructor(message: string, context?: Record<string, unknown>, options?: {
|
|
5
|
+
cause?: unknown;
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
/** Thrown when the API returns a non-success HTTP status. */
|
|
9
|
+
export declare class ApiError extends AssinafyError {
|
|
10
|
+
readonly statusCode: number;
|
|
11
|
+
readonly responseData: unknown;
|
|
12
|
+
constructor(message: string, statusCode: number, responseData?: unknown, options?: {
|
|
13
|
+
cause?: unknown;
|
|
14
|
+
});
|
|
15
|
+
static fromResponse(statusCode: number, responseData: unknown): ApiError;
|
|
16
|
+
}
|
|
17
|
+
/** Thrown when client-side validation fails before the request is sent. */
|
|
18
|
+
export declare class ValidationError extends AssinafyError {
|
|
19
|
+
readonly errors: Record<string, unknown>;
|
|
20
|
+
constructor(message?: string, errors?: Record<string, unknown>);
|
|
21
|
+
}
|
|
22
|
+
/** Thrown when the HTTP transport itself fails (DNS, timeout, etc.). */
|
|
23
|
+
export declare class NetworkError extends AssinafyError {
|
|
24
|
+
constructor(message: string, options?: {
|
|
25
|
+
cause?: unknown;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/api/errors.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,qBAAa,aAAc,SAAQ,KAAK;IACvC,SAAgB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjD,YACC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACrC,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAK7B;CACD;AAED,6DAA6D;AAC7D,qBAAa,QAAS,SAAQ,aAAa;IAC1C,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,YAAY,EAAE,OAAO,CAAC;IAEtC,YACC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,YAAY,GAAE,OAAc,EAC5B,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAM7B;IAED,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,QAAQ,CAWvE;CACD;AAED,2EAA2E;AAC3E,qBAAa,eAAgB,SAAQ,aAAa;IACjD,SAAgB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhD,YAAY,OAAO,SAAsB,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EAI9E;CACD;AAED,wEAAwE;AACxE,qBAAa,YAAa,SAAQ,aAAa;IAC9C,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAGzD;CACD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="node" preserve="true" />
|
|
2
|
+
export type { ClientConfigInput } from './client.js';
|
|
3
|
+
export { AssinafyClient } from './client.js';
|
|
4
|
+
export * from './errors.js';
|
|
5
|
+
export { AssignmentResource, buildAssignmentPayload } from './resources/assignments.js';
|
|
6
|
+
export { AuthenticationResource } from './resources/authentication.js';
|
|
7
|
+
export type { DocumentUploadSource, IDocumentUploadOptions } from './resources/documents.js';
|
|
8
|
+
export { DocumentResource } from './resources/documents.js';
|
|
9
|
+
export { FieldsResource } from './resources/fields.js';
|
|
10
|
+
export { SignerDocumentsResource } from './resources/signer-documents.js';
|
|
11
|
+
export { SignerResource } from './resources/signers.js';
|
|
12
|
+
export { TagResource } from './resources/tags.js';
|
|
13
|
+
export { TemplateResource } from './resources/templates.js';
|
|
14
|
+
export { UsersResource } from './resources/users.js';
|
|
15
|
+
export { WebhookResource } from './resources/webhooks.js';
|
|
16
|
+
export { WorkspaceResource } from './resources/workspaces.js';
|
|
17
|
+
export type { WebhookVerifierOptions } from './support/webhook-verifier.js';
|
|
18
|
+
export { WebhookVerifier } from './support/webhook-verifier.js';
|
|
19
|
+
export * from './types.js';
|
|
20
|
+
export { normalizeBaseUrl } from './utils.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";AAEA,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,YAAY,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { IAssignment, IAssignmentListParams, ICreateAssignmentPayload, ICreateAssignmentResponse, IEstimateCostResponse, IResendCostEstimate, IResendEmailResponse, IWhatsAppNotification, PaginatedResult } from '../types.js';
|
|
2
|
+
import { BaseResource } from './base.js';
|
|
3
|
+
/**
|
|
4
|
+
* Normalise an assignment payload into the shape the API expects:
|
|
5
|
+
* `signers: [{ id }]` plus optional docs-level fields.
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildAssignmentPayload(payload: ICreateAssignmentPayload, options?: {
|
|
8
|
+
allowSignersWithoutId?: boolean;
|
|
9
|
+
allowEmptySigners?: boolean;
|
|
10
|
+
}): Record<string, unknown>;
|
|
11
|
+
export declare class AssignmentResource extends BaseResource {
|
|
12
|
+
/**
|
|
13
|
+
* List assignments across the account (`GET /assignments`).
|
|
14
|
+
*
|
|
15
|
+
* The endpoint is account-scoped via a required `accountId` query parameter
|
|
16
|
+
* (note the camelCase — it differs from the path style used elsewhere).
|
|
17
|
+
* Supports `page` / `per-page`; `created_at` sorting is live-verified.
|
|
18
|
+
*/
|
|
19
|
+
list(params?: IAssignmentListParams, accountId?: string): Promise<PaginatedResult<IAssignment>>;
|
|
20
|
+
/** Create a signing assignment for a document. */
|
|
21
|
+
create(documentId: string, payload: ICreateAssignmentPayload): Promise<ICreateAssignmentResponse>;
|
|
22
|
+
/** Estimate the cost (in credits) of creating the assignment. */
|
|
23
|
+
estimateCost(documentId: string, payload: ICreateAssignmentPayload): Promise<IEstimateCostResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Update the expiration date of an existing assignment.
|
|
26
|
+
* Pass `null` to remove the expiration entirely.
|
|
27
|
+
*/
|
|
28
|
+
resetExpiration(documentId: string, assignmentId: string, expiresAt: string | null): Promise<IAssignment>;
|
|
29
|
+
/** Resend the signing notification to a single signer. */
|
|
30
|
+
resendNotification(documentId: string, assignmentId: string, signerId: string): Promise<IResendEmailResponse>;
|
|
31
|
+
/** Estimate the cost of resending a signer notification. */
|
|
32
|
+
estimateResendCost(documentId: string, assignmentId: string, signerId: string): Promise<IResendCostEstimate>;
|
|
33
|
+
/**
|
|
34
|
+
* `GET /documents/{documentId}/assignments/{assignmentId}/whatsapp-notifications`
|
|
35
|
+
* — list every WhatsApp notification rendered + sent for an assignment.
|
|
36
|
+
*/
|
|
37
|
+
listWhatsAppNotifications(documentId: string, assignmentId: string): Promise<IWhatsAppNotification[]>;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=assignments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignments.d.ts","sourceRoot":"","sources":["../../../../src/api/resources/assignments.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,WAAW,EACX,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EAEf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;;GAGG;AACH,wBAAg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edApiKeyResponse, IStatusResponse, SocialLoginProvider } from '../types.js';
|
|
2
|
+
import { BaseResource } from './base.js';
|
|
3
|
+
/**
|
|
4
|
+
* Authentication endpoints (login, social login, password management) and
|
|
5
|
+
* personal API key management (`/users/api-keys`).
|
|
6
|
+
*
|
|
7
|
+
* Most of these endpoints are intended to bootstrap an authenticated session
|
|
8
|
+
* for a human user. Production server-to-server integrations should use
|
|
9
|
+
* `X-Api-Key` and skip this resource entirely.
|
|
10
|
+
*/
|
|
11
|
+
export declare class AuthenticationResource extends BaseResource {
|
|
12
|
+
/** `POST /login` — exchange email + password for a JWT access token. */
|
|
13
|
+
login(email: string, password: string): Promise<ILoginResponse>;
|
|
14
|
+
/** `POST /authentication/social-login` — exchange a provider token for an Assinafy JWT. */
|
|
15
|
+
socialLogin(payload: {
|
|
16
|
+
provider: string;
|
|
17
|
+
token: string;
|
|
18
|
+
has_accepted_terms: boolean;
|
|
19
|
+
}): Promise<ILoginResponse>;
|
|
20
|
+
/** `POST /auth/link-social-login` — link a Google identity to the current user. */
|
|
21
|
+
linkSocialLogin(payload: {
|
|
22
|
+
provider: SocialLoginProvider;
|
|
23
|
+
token: string;
|
|
24
|
+
}): Promise<IStatusResponse>;
|
|
25
|
+
/** `POST /users/api-keys` — generate (and rotate) the current user's API key. */
|
|
26
|
+
createApiKey(password: string): Promise<IApiKeyResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* `GET /users/api-keys` — fetch a masked version of the current API key, or
|
|
29
|
+
* `null` if no key has been generated yet.
|
|
30
|
+
*/
|
|
31
|
+
getApiKey(): Promise<IMaskedApiKeyResponse>;
|
|
32
|
+
/** `DELETE /users/api-keys` — revoke the current API key. */
|
|
33
|
+
deleteApiKey(): Promise<IEmptyResult>;
|
|
34
|
+
/** `PUT /authentication/change-password` — change the authenticated user's password. */
|
|
35
|
+
changePassword(payload: {
|
|
36
|
+
email: string;
|
|
37
|
+
password: string;
|
|
38
|
+
new_password: string;
|
|
39
|
+
}): Promise<{
|
|
40
|
+
email: string;
|
|
41
|
+
}>;
|
|
42
|
+
/** `PUT /authentication/request-password-reset` — email a reset link to the user. */
|
|
43
|
+
requestPasswordReset(email: string): Promise<{
|
|
44
|
+
email: string;
|
|
45
|
+
}>;
|
|
46
|
+
/** `PUT /authentication/reset-password` — complete a password reset using the emailed token. */
|
|
47
|
+
resetPassword(payload: {
|
|
48
|
+
email: string;
|
|
49
|
+
token?: string;
|
|
50
|
+
new_password: string;
|
|
51
|
+
}): Promise<{
|
|
52
|
+
email: string;
|
|
53
|
+
}>;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=authentication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../../../src/api/resources/authentication.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,eAAe,EACf,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;;;;GAOG;AACH,qBAAa,sBAAuB,SAAQ,YAAY;IACvD,wEAAwE;IAClE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAMpE;IAED,2FAA2F;IACrF,WAAW,CAAC,OAAO,EAAE;QAC1B,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,kBAAkB,EAAE,OAAO,CAAC;KAC5B,GAAG,OAAO,CAAC,cAAc,CAAC,CAM1B;IAED,mFAAmF;IAC7E,eAAe,CAAC,OAAO,EAAE;QAC9B,QAAQ,EAAE,mBAAmB,CAAC;QAC9B,KAAK,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,eAAe,CAAC,CAM3B;IAED,iFAAiF;IAC3E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAK7D;IAED;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAOhD;IAED,6DAA6D;IACvD,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,CAE1C;IAED,wFAAwF;IAClF,cAAc,CAAC,OAAO,EAAE;QAC7B,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;KACrB,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAO7B;IAED,qFAAqF;IAC/E,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAKpE;IAED,gGAAgG;IAC1F,aAAa,CAAC,OAAO,EAAE;QAC5B,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;KACrB,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAM7B;CACD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
+
import type { Logger, PaginatedResult } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Shared plumbing for every Assinafy resource:
|
|
5
|
+
*
|
|
6
|
+
* - holds the axios instance, default account ID, and logger
|
|
7
|
+
* - provides `accountId()` / `requireId()` argument guards
|
|
8
|
+
* - wraps HTTP calls in a single `try/catch` → typed-error pipeline
|
|
9
|
+
* - unwraps the Assinafy response envelope
|
|
10
|
+
* - parses `X-Pagination-*` headers into a typed meta object
|
|
11
|
+
*
|
|
12
|
+
* Resources should never `try/catch` or touch the envelope directly — they call
|
|
13
|
+
* one of `call` / `callBinary` / `callList` instead.
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class BaseResource {
|
|
16
|
+
protected readonly http: AxiosInstance;
|
|
17
|
+
protected readonly defaultAccountId?: string | undefined;
|
|
18
|
+
protected readonly logger: Logger;
|
|
19
|
+
constructor(http: AxiosInstance, defaultAccountId?: string | undefined, logger?: Logger);
|
|
20
|
+
/** Resolve the effective account id, throwing if none is available. */
|
|
21
|
+
protected accountId(explicit?: string): string;
|
|
22
|
+
/** Guard required path arguments (documentId, signerId, …). */
|
|
23
|
+
protected requireId<T extends string>(value: T | undefined | null, name: string): T;
|
|
24
|
+
/** Execute an HTTP call and return the unwrapped envelope body. */
|
|
25
|
+
protected call<T>(label: string, request: RequestFn): Promise<T>;
|
|
26
|
+
/** Like {@link call} but returns `null` when the API responds with 404. */
|
|
27
|
+
protected callOptional<T>(label: string, request: RequestFn): Promise<T | null>;
|
|
28
|
+
/** Execute an HTTP call that returns binary data (artifact downloads). */
|
|
29
|
+
protected callBinary(label: string, request: () => Promise<AxiosResponse<ArrayBuffer>>): Promise<Buffer>;
|
|
30
|
+
/** Execute a paginated list call and attach meta from `X-Pagination-*` headers. */
|
|
31
|
+
protected callList<T>(label: string, request: RequestFn): Promise<PaginatedResult<T>>;
|
|
32
|
+
}
|
|
33
|
+
type RequestFn = () => Promise<AxiosResponse>;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/api/resources/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAwB,MAAM,OAAO,CAAC;AAEhF,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAkB,MAAM,aAAa,CAAC;AAG3E;;;;;;;;;;;GAWG;AACH,8BAAsB,YAAY;IAEhC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,aAAa;IACtC,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM;IAC5C,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IAHlC,YACoB,IAAI,EAAE,aAAa,EACnB,gBAAgB,CAAC,EAAE,MAAM,YAAA,EACzB,MAAM,GAAE,MAA2B,EACnD;IAEJ,uEAAuE;IACvE,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ7C;IAED,+DAA+D;IAC/D,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAKlF;IAED,mEAAmE;IACnE,UAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAOrE;IAED,2EAA2E;IAC3E,UAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAOpF;IAED,0EAA0E;IAC1E,UAAgB,UAAU,CACzB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,GAChD,OAAO,CAAC,MAAM,CAAC,CAOjB;IAED,mFAAmF;IACnF,UAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAqB1F;CACD;AASD,KAAK,SAAS,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { DocumentArtifactName, ICreateDocumentFromTemplateOptions, IDetachTagResponse, IDocumentActivity, IDocumentDetailsResponse, IDocumentListParams, IDocumentListResponse, IDocumentSearchParams, IDocumentStatusInfo, IDocumentUploadResponse, IDocumentVerifyResponse, IEmptyResult, IEstimateCostResponse, IPublicDocumentInfo, ISendTokenResponse, ISigningProgress, ITag, ITemplateCostSigner, ITemplateSigner, SendTokenChannel } from '../types.js';
|
|
2
|
+
import { BaseResource } from './base.js';
|
|
3
|
+
/** Input for uploading a document: either an on-disk file or an in-memory buffer. */
|
|
4
|
+
export type DocumentUploadSource = {
|
|
5
|
+
filePath: string;
|
|
6
|
+
fileName?: string;
|
|
7
|
+
} | {
|
|
8
|
+
buffer: Buffer;
|
|
9
|
+
fileName: string;
|
|
10
|
+
};
|
|
11
|
+
export interface IDocumentUploadOptions {
|
|
12
|
+
/** Document display name. Defaults to the source PDF file name. */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** Optional metadata sent alongside the file (JSON-encoded). */
|
|
15
|
+
metadata?: Record<string, unknown>;
|
|
16
|
+
/** Override the default account ID configured on the client. */
|
|
17
|
+
accountId?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class DocumentResource extends BaseResource {
|
|
20
|
+
/**
|
|
21
|
+
* Upload a PDF to the workspace.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* await client.documents.upload({ filePath: './contract.pdf' });
|
|
26
|
+
* await client.documents.upload({ buffer, fileName: 'contract.pdf' }, { metadata });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
upload(source: DocumentUploadSource, options?: IDocumentUploadOptions): Promise<IDocumentUploadResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* List workspace documents. Pagination info (if any) is attached in `meta`.
|
|
32
|
+
* Supports `status`, `method`, `tags`, `search`, `sort`, `page`, `per_page`.
|
|
33
|
+
*/
|
|
34
|
+
list(params?: IDocumentListParams, accountId?: string): Promise<IDocumentListResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* Lightweight document search (`GET /accounts/{id}/documents/search`).
|
|
37
|
+
*
|
|
38
|
+
* A slimmer counterpart to {@link list} exposed by the API for
|
|
39
|
+
* type-ahead/autocomplete. The published spec documents only `search`,
|
|
40
|
+
* `status`, `page`, `per-page`, but `sort` is also accepted and functional
|
|
41
|
+
* (live-verified against the sandbox).
|
|
42
|
+
*/
|
|
43
|
+
search(params?: IDocumentSearchParams, accountId?: string): Promise<IDocumentListResponse>;
|
|
44
|
+
/** Get document details. */
|
|
45
|
+
details(documentId: string): Promise<IDocumentDetailsResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* Rename a document (`PATCH /documents/{id}`).
|
|
48
|
+
*
|
|
49
|
+
* Only permitted before the signature process starts — the API returns a
|
|
50
|
+
* 400 once an assignment is active.
|
|
51
|
+
*/
|
|
52
|
+
rename(documentId: string, name: string): Promise<IDocumentDetailsResponse>;
|
|
53
|
+
/** Alias for {@link details}. */
|
|
54
|
+
get(documentId: string): Promise<IDocumentDetailsResponse>;
|
|
55
|
+
/** Poll document status until ready (or a terminal status / timeout). */
|
|
56
|
+
waitUntilReady(documentId: string, options?: {
|
|
57
|
+
maxWaitMs?: number;
|
|
58
|
+
pollIntervalMs?: number;
|
|
59
|
+
}): Promise<IDocumentDetailsResponse>;
|
|
60
|
+
private fetchDetails;
|
|
61
|
+
/** Download a document artifact. Defaults to the certificated (signed) PDF. */
|
|
62
|
+
download(documentId: string, artifactName?: DocumentArtifactName): Promise<Buffer>;
|
|
63
|
+
/** Download the document thumbnail. */
|
|
64
|
+
thumbnail(documentId: string): Promise<Buffer>;
|
|
65
|
+
/** Download a single page as a JPEG. */
|
|
66
|
+
downloadPage(documentId: string, pageId: string): Promise<Buffer>;
|
|
67
|
+
/** Fetch the document activity log. */
|
|
68
|
+
activities(documentId: string): Promise<IDocumentActivity[]>;
|
|
69
|
+
/** Delete a document. */
|
|
70
|
+
delete(documentId: string): Promise<IEmptyResult>;
|
|
71
|
+
/** List the tags attached to a document. */
|
|
72
|
+
listTags(documentId: string, accountId?: string): Promise<ITag[]>;
|
|
73
|
+
/**
|
|
74
|
+
* Replace the document's tag set with `tags` (an array of tag names).
|
|
75
|
+
* Unknown names are auto-created; an empty array detaches all tags.
|
|
76
|
+
*/
|
|
77
|
+
replaceTags(documentId: string, tags: string[], accountId?: string): Promise<ITag[]>;
|
|
78
|
+
/** Attach additional tags (by name) without removing existing ones. Idempotent. */
|
|
79
|
+
addTags(documentId: string, tags: string[], accountId?: string): Promise<ITag[]>;
|
|
80
|
+
/** Detach a single tag from a document (the tag itself is not deleted). */
|
|
81
|
+
detachTag(documentId: string, tagId: string, accountId?: string): Promise<IDetachTagResponse>;
|
|
82
|
+
/**
|
|
83
|
+
* Create a document from a template.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* await client.documents.createFromTemplate('tmpl_id', [
|
|
88
|
+
* { role_id: 'role_id', id: 'signer_id', verification_method: 'Email', notification_methods: ['Email'] },
|
|
89
|
+
* ], { name: 'My Contract' });
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
createFromTemplate(templateId: string, signers: ITemplateSigner[], options?: ICreateDocumentFromTemplateOptions, accountId?: string): Promise<IDocumentDetailsResponse>;
|
|
93
|
+
/** Estimate the credit cost of creating a document from a template. */
|
|
94
|
+
estimateCostFromTemplate(templateId: string, signers: ITemplateCostSigner[], accountId?: string): Promise<IEstimateCostResponse>;
|
|
95
|
+
/**
|
|
96
|
+
* Verify a document by its signature hash. Always resolves (the API
|
|
97
|
+
* returns `200` even for an unknown hash, with `is_valid: false`).
|
|
98
|
+
*/
|
|
99
|
+
verify(hash: string): Promise<IDocumentVerifyResponse>;
|
|
100
|
+
/**
|
|
101
|
+
* `GET /documents/statuses` — list every possible document status with
|
|
102
|
+
* its description and whether documents in that status can be deleted.
|
|
103
|
+
*/
|
|
104
|
+
statuses(): Promise<IDocumentStatusInfo[]>;
|
|
105
|
+
/**
|
|
106
|
+
* `GET /public/documents/{document_id}` — public, unauthenticated lookup of
|
|
107
|
+
* basic document info (used by the signing portal before the signer
|
|
108
|
+
* authenticates via the access code).
|
|
109
|
+
*/
|
|
110
|
+
getPublic(documentId: string): Promise<IPublicDocumentInfo>;
|
|
111
|
+
/**
|
|
112
|
+
* `PUT /public/documents/{document_id}/send-token` — send the 6-digit
|
|
113
|
+
* verification token to the signer's email / WhatsApp. Pass `{ email }` for
|
|
114
|
+
* the published OpenAPI body or a string plus channel for the live legacy body.
|
|
115
|
+
*/
|
|
116
|
+
sendToken(documentId: string, recipient: string | {
|
|
117
|
+
email: string;
|
|
118
|
+
}, channel?: SendTokenChannel): Promise<ISendTokenResponse>;
|
|
119
|
+
/** Quick check: has every signer completed their assignment? */
|
|
120
|
+
isFullySigned(documentId: string): Promise<boolean>;
|
|
121
|
+
/** Summarise signing progress for UI display. */
|
|
122
|
+
getSigningProgress(documentId: string): Promise<ISigningProgress>;
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=documents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../../../src/api/resources/documents.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,oBAAoB,EAEpB,kCAAkC,EAClC,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EAExB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,IAAI,EACJ,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,MAAM,aAAa,CAAC;AAQrB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAiBzC,qFAAqF;AACrF,MAAM,MAAM,oBAAoB,GAC7B;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAExC,MAAM,WAAW,sBAAsB;IACtC,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,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GG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAK3D;IAED;;;OAGG;IACG,QAAQ,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAI/C;IAED;;;;OAIG;IACG,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAKhE;IAED;;;;OAIG;IACG,SAAS,CACd,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,EACrC,OAAO,GAAE,gBAA0B,GACjC,OAAO,CAAC,kBAAkB,CAAC,CAoB7B;IAED,gEAAgE;IAC1D,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQxD;IAED,iDAAiD;IAC3C,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAQtE;CACD"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ICreateFieldPayload, IEmptyResult, IFieldDefinition, IFieldType, IFieldValidateMultipleEntry, IFieldValidationResult, IUpdateFieldPayload } from '../types.js';
|
|
2
|
+
import { BaseResource } from './base.js';
|
|
3
|
+
/**
|
|
4
|
+
* Custom field definitions used by `collect` assignments.
|
|
5
|
+
*
|
|
6
|
+
* Covers the full Field Definition section of the API docs:
|
|
7
|
+
* - `POST /accounts/{id}/fields`
|
|
8
|
+
* - `GET /accounts/{id}/fields`
|
|
9
|
+
* - `GET /accounts/{id}/fields/{id}`
|
|
10
|
+
* - `PUT /accounts/{id}/fields/{id}`
|
|
11
|
+
* - `DELETE /accounts/{id}/fields/{id}`
|
|
12
|
+
* - `POST /accounts/{id}/fields/{id}/validate?signer-access-code=…`
|
|
13
|
+
* - `POST /accounts/{id}/fields/validate-multiple?signer-access-code=…`
|
|
14
|
+
* - `GET /field-types`
|
|
15
|
+
*
|
|
16
|
+
* The `signer-access-code` query param on the two `validate*` endpoints isn't
|
|
17
|
+
* in the published OpenAPI spec but is live-verified against the sandbox: a
|
|
18
|
+
* bogus code returns 401, matching every other signer-access-code endpoint.
|
|
19
|
+
*/
|
|
20
|
+
export declare class FieldsResource extends BaseResource {
|
|
21
|
+
/** Create a field definition. */
|
|
22
|
+
create(payload: ICreateFieldPayload, accountId?: string): Promise<IFieldDefinition>;
|
|
23
|
+
/**
|
|
24
|
+
* List field definitions for the workspace.
|
|
25
|
+
*
|
|
26
|
+
* @param params.include_inactive return inactive fields too
|
|
27
|
+
* @param params.include_standard also return `signature`, `initial`, `signatureDate`
|
|
28
|
+
*/
|
|
29
|
+
list(params?: {
|
|
30
|
+
include_inactive?: boolean;
|
|
31
|
+
include_standard?: boolean;
|
|
32
|
+
}, accountId?: string): Promise<IFieldDefinition[]>;
|
|
33
|
+
/** Get a single field definition by ID. */
|
|
34
|
+
get(fieldId: string, accountId?: string): Promise<IFieldDefinition>;
|
|
35
|
+
/** Update a field definition. */
|
|
36
|
+
update(fieldId: string, payload: IUpdateFieldPayload, accountId?: string): Promise<IFieldDefinition>;
|
|
37
|
+
/** Delete a field definition. Fails if the field has been used. */
|
|
38
|
+
delete(fieldId: string, accountId?: string): Promise<IEmptyResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Validate a single value against a field definition.
|
|
41
|
+
*
|
|
42
|
+
* Pass `signerAccessCode` for signer-side validation (the typical use case);
|
|
43
|
+
* omit it when the caller is authenticated via API key.
|
|
44
|
+
*/
|
|
45
|
+
validate(fieldId: string, value: unknown, options?: {
|
|
46
|
+
signerAccessCode?: string;
|
|
47
|
+
accountId?: string;
|
|
48
|
+
}): Promise<IFieldValidationResult>;
|
|
49
|
+
/** Validate multiple values at once. */
|
|
50
|
+
validateMultiple(entries: IFieldValidateMultipleEntry[], options?: {
|
|
51
|
+
signerAccessCode?: string;
|
|
52
|
+
accountId?: string;
|
|
53
|
+
}): Promise<IFieldValidationResult[]>;
|
|
54
|
+
/** List the platform's supported field types. */
|
|
55
|
+
listTypes(): Promise<IFieldType[]>;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../../../src/api/resources/fields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,2BAA2B,EAC3B,sBAAsB,EACtB,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAe,SAAQ,YAAY;IAC/C,iCAAiC;IAC3B,MAAM,CAAC,OAAO,EAAE,mBAAmB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAOxF;IAED;;;;;OAKG;IACG,IAAI,CACT,MAAM,GAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAO,EACvE,SAAS,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAO7B;IAED,2CAA2C;IACrC,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAMxE;IAED,iCAAiC;IAC3B,MAAM,CACX,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,mBAAmB,EAC5B,SAAS,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,gBAAgB,CAAC,CAM3B;IAED,mEAAmE;IAC7D,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAMvE;IAED;;;;;OAKG;IACG,QAAQ,CACb,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,EACd,OAAO,GAAE;QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GAC7D,OAAO,CAAC,sBAAsB,CAAC,CAUjC;IAED,wCAAwC;IAClC,gBAAgB,CACrB,OAAO,EAAE,2BAA2B,EAAE,EACtC,OAAO,GAAE;QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GAC7D,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAYnC;IAED,iDAAiD;IAC3C,SAAS,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAEvC;CACD"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { DocumentArtifactName, IDocumentDetailsResponse, IDocumentListResponse, ISigner, ISignerDocumentListParams, ISignerSelf, ISignFieldEntry, IStatusResponse } from '../types.js';
|
|
2
|
+
import { BaseResource } from './base.js';
|
|
3
|
+
/**
|
|
4
|
+
* Signer-side endpoints. Every call here is authenticated by `signer-access-code`
|
|
5
|
+
* (the one-time link emailed/whatsapped to the signer), not by the workspace
|
|
6
|
+
* API key. Use this resource when building a custom signer UI.
|
|
7
|
+
*/
|
|
8
|
+
export declare class SignerDocumentsResource extends BaseResource {
|
|
9
|
+
/** `GET /signers/{signer_id}/document?signer-access-code=…` */
|
|
10
|
+
getCurrent(signerId: string, signerAccessCode: string): Promise<IDocumentDetailsResponse>;
|
|
11
|
+
/** `GET /signers/{signer_id}/documents?signer-access-code=…` */
|
|
12
|
+
list(signerId: string, signerAccessCode: string, params?: ISignerDocumentListParams): Promise<IDocumentListResponse>;
|
|
13
|
+
/** `GET /signers/{signer_id}/documents/search?signer-access-code=…&search=…` */
|
|
14
|
+
search(signerId: string, search: string, signerAccessCode: string): Promise<IDocumentListResponse>;
|
|
15
|
+
/** `GET /signers/{signer_id}/documents/{document_id}/download/{artifact}?signer-access-code=…` */
|
|
16
|
+
download(signerId: string, documentId: string, artifactName: DocumentArtifactName, signerAccessCode: string): Promise<Buffer>;
|
|
17
|
+
/** `PUT /signers/documents/sign-multiple?signer-access-code=…` */
|
|
18
|
+
signMultiple(documentIds: string[], signerAccessCode: string): Promise<unknown[]>;
|
|
19
|
+
/** `PUT /signers/documents/decline-multiple?signer-access-code=…` */
|
|
20
|
+
declineMultiple(documentIds: string[], declineReason: string, signerAccessCode: string): Promise<unknown[]>;
|
|
21
|
+
/** `GET /signers/self?signer-access-code=…` — fetch the signer's own profile. */
|
|
22
|
+
self(signerAccessCode: string): Promise<ISignerSelf>;
|
|
23
|
+
/**
|
|
24
|
+
* `PUT /signers/accept-terms?signer-access-code=…` — accept the platform
|
|
25
|
+
* terms as the signer.
|
|
26
|
+
*
|
|
27
|
+
* The access code travels as the `signer-access-code` query parameter, like
|
|
28
|
+
* every other signer-side endpoint (the spec under-documents this one, but
|
|
29
|
+
* the query-param convention is uniform across the Signing API).
|
|
30
|
+
*/
|
|
31
|
+
acceptTerms(signerAccessCode: string): Promise<IStatusResponse>;
|
|
32
|
+
/** `POST /verify` — verify the email OTP for a signer. */
|
|
33
|
+
verifyEmail(payload: {
|
|
34
|
+
signerAccessCode: string;
|
|
35
|
+
verificationCode: string;
|
|
36
|
+
}): Promise<IStatusResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* `PUT /documents/{documentId}/signers/confirm-data?signer-access-code=…`
|
|
39
|
+
*
|
|
40
|
+
* The documented body fields are `full_name`, `email` and `government_id`;
|
|
41
|
+
* `whatsapp_phone_number` / `has_accepted_terms` are also accepted for the
|
|
42
|
+
* WhatsApp confirmation flow.
|
|
43
|
+
*/
|
|
44
|
+
confirmData(documentId: string, signerAccessCode: string, payload: {
|
|
45
|
+
full_name?: string;
|
|
46
|
+
email?: string;
|
|
47
|
+
government_id?: string;
|
|
48
|
+
whatsapp_phone_number?: string;
|
|
49
|
+
has_accepted_terms?: boolean;
|
|
50
|
+
}): Promise<ISigner>;
|
|
51
|
+
/**
|
|
52
|
+
* `POST /signature?signer-access-code=…&type=…` — upload the signer's
|
|
53
|
+
* signature or initial image. `imageType` defaults to `signature`.
|
|
54
|
+
*/
|
|
55
|
+
uploadSignature(signerAccessCode: string, image: Buffer, options?: {
|
|
56
|
+
imageType?: 'signature' | 'initial';
|
|
57
|
+
contentType?: string;
|
|
58
|
+
reuse?: boolean;
|
|
59
|
+
}): Promise<IStatusResponse>;
|
|
60
|
+
/** `GET /signature/{type}?signer-access-code=…` — download the signer's signature/initial. */
|
|
61
|
+
downloadSignature(signerAccessCode: string, imageType?: 'signature' | 'initial'): Promise<Buffer>;
|
|
62
|
+
/** `GET /sign?signer-access-code=…` — fetch the assignment as the signer sees it. */
|
|
63
|
+
getAssignment(signerAccessCode: string, hasAcceptedTerms?: boolean): Promise<IDocumentDetailsResponse>;
|
|
64
|
+
/** `POST /documents/{documentId}/assignments/{assignmentId}?signer-access-code=…` — sign. */
|
|
65
|
+
sign(documentId: string, assignmentId: string, signerAccessCode: string, entries: ISignFieldEntry[]): Promise<Record<string, unknown>>;
|
|
66
|
+
/**
|
|
67
|
+
* `PUT /documents/{documentId}/assignments/{assignmentId}/reject?signer-access-code=…`
|
|
68
|
+
* — signer-side decline using the access code from the signing link.
|
|
69
|
+
*/
|
|
70
|
+
decline(documentId: string, assignmentId: string, signerAccessCode: string, declineReason: string): Promise<unknown[]>;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=signer-documents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signer-documents.d.ts","sourceRoot":"","sources":["../../../../src/api/resources/signer-documents.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,oBAAoB,EACpB,wBAAwB,EAExB,qBAAqB,EACrB,OAAO,EACP,yBAAyB,EACzB,WAAW,EACX,eAAe,EACf,eAAe,EACf,MAAM,aAAa,CAAC;AAMrB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;GAIG;AACH,qBAAa,uBAAwB,SAA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yResult, ISigner, ISignerListParams, ISignerListResponse, IUpdateSignerPayload } from '../types.js';
|
|
2
|
+
import { BaseResource } from './base.js';
|
|
3
|
+
/** Validate the locally knowable fields before creating a signer. */
|
|
4
|
+
export declare function validateCreateSignerPayload(payload: ICreateSignerPayload): void;
|
|
5
|
+
export declare class SignerResource extends BaseResource {
|
|
6
|
+
/**
|
|
7
|
+
* Create a signer in the workspace.
|
|
8
|
+
*
|
|
9
|
+
* Only `full_name` is required. When an `email` is supplied the call is
|
|
10
|
+
* idempotent by email: an existing signer with that address is reused instead
|
|
11
|
+
* of duplicated.
|
|
12
|
+
*/
|
|
13
|
+
create(payload: ICreateSignerPayload, accountId?: string): Promise<ICreateSignerResponse>;
|
|
14
|
+
/** Get a signer by ID. */
|
|
15
|
+
get(signerId: string, accountId?: string): Promise<ISigner>;
|
|
16
|
+
/** List signers (`sort` accepts the live-verified `full_name` / `-full_name`). */
|
|
17
|
+
list(params?: ISignerListParams, accountId?: string): Promise<ISignerListResponse>;
|
|
18
|
+
/** Update a signer. Fails if the signer has active assignments. */
|
|
19
|
+
update(signerId: string, payload: IUpdateSignerPayload, accountId?: string): Promise<ICreateSignerResponse>;
|
|
20
|
+
/** Delete a signer. */
|
|
21
|
+
delete(signerId: string, accountId?: string): Promise<IEmptyResult>;
|
|
22
|
+
/** Find a signer by email via the API's `search` parameter. Returns `null` if none match. */
|
|
23
|
+
findByEmail(email: string, accountId?: string): Promise<ISigner | null>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=signers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signers.d.ts","sourceRoot":"","sources":["../../../../src/api/resources/signers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,OAAO,EACP,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAIzC,qEAAqE;AACrE,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAG/E;AAQD,qBAAa,cAAe,SAAQ,YAAY;IAC/C;;;;;;OAMG;IACG,MAAM,CAAC,OAAO,EAAE,oBAAoB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA6B9F;IAED,0BAA0B;IACpB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAMhE;IAED,kFAAkF;IAC5E,IAAI,CAAC,MAAM,GAAE,iBAAsB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAQ3F;IAED,mEAAmE;IAC7D,MAAM,CACX,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,oBAAoB,EAC7B,SAAS,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,qBAAqB,CAAC,CAMhC;IAED,uBAAuB;IACjB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAMxE;IAED,6FAA6F;IACvF,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAY5E;CACD"}
|