esigncomply 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +279 -2
- package/dist/cli/args.d.ts +16 -0
- package/dist/cli/browser.d.ts +17 -0
- package/dist/cli/check.d.ts +80 -0
- package/dist/cli/demo-page.d.ts +24 -0
- package/dist/cli/demo.d.ts +36 -0
- package/dist/cli/documents.d.ts +3 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/io.d.ts +40 -0
- package/dist/cli/verify.d.ts +4 -0
- package/dist/cli/webhooks.d.ts +20 -0
- package/dist/cli.js +2393 -0
- package/dist/client.d.ts +75 -0
- package/dist/errors.d.ts +49 -0
- package/dist/index.d.ts +95 -0
- package/dist/index.js +825 -0
- package/dist/resources/account.d.ts +40 -0
- package/dist/resources/base.d.ts +7 -0
- package/dist/resources/certificates.d.ts +19 -0
- package/dist/resources/documents.d.ts +20 -0
- package/dist/resources/guidance.d.ts +26 -0
- package/dist/resources/jurisdictions.d.ts +12 -0
- package/dist/resources/profiles.d.ts +16 -0
- package/dist/resources/records.d.ts +47 -0
- package/dist/resources/sessions.d.ts +15 -0
- package/dist/resources/signers.d.ts +15 -0
- package/dist/resources/supplements.d.ts +33 -0
- package/dist/resources/webhooks.d.ts +48 -0
- package/dist/types.d.ts +1687 -0
- package/dist/version.d.ts +2 -0
- package/package.json +61 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { RequestOptions } from "../client";
|
|
2
|
+
import type { Result } from "../errors";
|
|
3
|
+
import type { ApiKey, ApiKeyCreateParams, ConformanceRun, ConformanceRunParams, Domain, DomainCreateParams, GeneratedPrompt, List, ListParams, PromptGenerateParams, PromptSummary, Usage, WatchedJurisdictions } from "../types";
|
|
4
|
+
import { Resource } from "./base";
|
|
5
|
+
export declare class UsageResource extends Resource {
|
|
6
|
+
/** Events used in the subscription year, quota, period end; certificate allowance and spend; supplement storage. */
|
|
7
|
+
get(): Promise<Result<Usage>>;
|
|
8
|
+
}
|
|
9
|
+
export declare class Conformance extends Resource {
|
|
10
|
+
/** Run the conformance checker over recent test records (12.6). Findings are advisory statements about measurable design facts. */
|
|
11
|
+
run(body?: ConformanceRunParams, options?: RequestOptions): Promise<Result<ConformanceRun>>;
|
|
12
|
+
get(id: string): Promise<Result<ConformanceRun>>;
|
|
13
|
+
}
|
|
14
|
+
export declare class Prompts extends Resource {
|
|
15
|
+
/**
|
|
16
|
+
* Generate the integration prompt for an AI coding tool from wizard selections (section 12).
|
|
17
|
+
* Creates or reuses the ceremony profiles the prompt names and stores the prompt. Needs a `full_access` key.
|
|
18
|
+
*/
|
|
19
|
+
generate(body?: PromptGenerateParams, options?: RequestOptions): Promise<Result<GeneratedPrompt>>;
|
|
20
|
+
/** Prompts generated for this domain and environment, newest first. List items leave out the Markdown: read one prompt for its text. */
|
|
21
|
+
list(params?: ListParams): Promise<Result<List<PromptSummary>>>;
|
|
22
|
+
/** One stored prompt with its Markdown. Prompt IDs resolve permanently (BC-15). */
|
|
23
|
+
get(id: string): Promise<Result<GeneratedPrompt>>;
|
|
24
|
+
}
|
|
25
|
+
export declare class Domains extends Resource {
|
|
26
|
+
create(body: DomainCreateParams, options?: RequestOptions): Promise<Result<Domain>>;
|
|
27
|
+
get(id: string): Promise<Result<Domain>>;
|
|
28
|
+
/** Trigger verification of the domain. */
|
|
29
|
+
verify(id: string): Promise<Result<Domain>>;
|
|
30
|
+
/** Change domain settings, for example `certificate_spend_limit` (OC-16). */
|
|
31
|
+
update(id: string, body: Record<string, unknown>): Promise<Result<Domain>>;
|
|
32
|
+
/** Watch jurisdiction codes without enabling their packs, to receive their notices (GD-14). Replaces the whole list and resolves to it. */
|
|
33
|
+
watchJurisdictions(id: string, jurisdictions: string[]): Promise<Result<WatchedJurisdictions>>;
|
|
34
|
+
}
|
|
35
|
+
export declare class ApiKeys extends Resource {
|
|
36
|
+
/** Create a key. The full key is in the response once; only a prefix and a hash are stored. */
|
|
37
|
+
create(body: ApiKeyCreateParams, options?: RequestOptions): Promise<Result<ApiKey>>;
|
|
38
|
+
list(): Promise<Result<List<ApiKey>>>;
|
|
39
|
+
delete(id: string): Promise<Result<Record<string, unknown>>>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HttpClient } from "../client";
|
|
2
|
+
/** Shared plumbing: each resource is a thin, typed map of methods to endpoints (spec 13.2). */
|
|
3
|
+
export declare abstract class Resource {
|
|
4
|
+
protected readonly client: HttpClient;
|
|
5
|
+
}
|
|
6
|
+
/** Build a path from literal segments and IDs; IDs are percent-encoded. */
|
|
7
|
+
export declare function path(strings: TemplateStringsArray, ...ids: string[]): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BinaryResponse, RequestOptions } from "../client";
|
|
2
|
+
import type { Result } from "../errors";
|
|
3
|
+
import type { Certificate, CertificateCreateParams, CertificateListParams, CertificateQuote, CertificateShare, CertificateShareParams, List, RecordCertificateParams } from "../types";
|
|
4
|
+
import { Resource } from "./base";
|
|
5
|
+
export declare class Certificates extends Resource {
|
|
6
|
+
/** Issue one certificate over a set of records selected by filter. Asynchronous: answers `processing`, then `certificate.issued` fires. */
|
|
7
|
+
create(body: CertificateCreateParams, options?: RequestOptions): Promise<Result<Certificate>>;
|
|
8
|
+
/** What a certificate request would cost. Issues nothing and charges nothing (OC-13). */
|
|
9
|
+
quote(body: CertificateCreateParams | (RecordCertificateParams & {
|
|
10
|
+
record_id?: string;
|
|
11
|
+
})): Promise<Result<CertificateQuote>>;
|
|
12
|
+
list(filters?: CertificateListParams): Promise<Result<List<Certificate>>>;
|
|
13
|
+
get(id: string): Promise<Result<Certificate>>;
|
|
14
|
+
/** The certificate as a PDF. */
|
|
15
|
+
pdf(id: string): Promise<Result<BinaryResponse>>;
|
|
16
|
+
/** Create a time-limited share link that opens the certificate and runs verification without an account (OC-8). */
|
|
17
|
+
share(id: string, body: CertificateShareParams, options?: RequestOptions): Promise<Result<CertificateShare>>;
|
|
18
|
+
revokeShare(id: string): Promise<Result<Record<string, unknown>>>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RequestOptions } from "../client";
|
|
2
|
+
import type { Result } from "../errors";
|
|
3
|
+
import type { Document, DocumentCreateParams, DocumentListParams, DocumentVersion, DocumentVersionContentResult, DocumentVersionCreateParams, List } from "../types";
|
|
4
|
+
import { Resource } from "./base";
|
|
5
|
+
export declare class DocumentVersions extends Resource {
|
|
6
|
+
/** Publish an immutable version: text or file, language, version label, effective date. Returns the content hash. */
|
|
7
|
+
create(documentId: string, body: DocumentVersionCreateParams, options?: RequestOptions): Promise<Result<DocumentVersion>>;
|
|
8
|
+
list(documentId: string): Promise<Result<List<DocumentVersion>>>;
|
|
9
|
+
get(documentId: string, versionId: string | "current"): Promise<Result<DocumentVersion>>;
|
|
10
|
+
/** The canonical content to render. `"current"` picks the version in force, by `locale` when translations exist. */
|
|
11
|
+
getContent(documentId: string, versionId: string | "current", params?: {
|
|
12
|
+
locale?: string;
|
|
13
|
+
}): Promise<Result<DocumentVersionContentResult>>;
|
|
14
|
+
}
|
|
15
|
+
export declare class Documents extends Resource {
|
|
16
|
+
readonly versions: DocumentVersions;
|
|
17
|
+
create(body: DocumentCreateParams, options?: RequestOptions): Promise<Result<Document>>;
|
|
18
|
+
list(params?: DocumentListParams): Promise<Result<List<Document>>>;
|
|
19
|
+
get(id: string): Promise<Result<Document>>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { RequestOptions } from "../client";
|
|
2
|
+
import { type Result } from "../errors";
|
|
3
|
+
import type { GuidanceAcknowledgeParams, GuidanceNotice, GuidanceNoticeListParams, GuidanceRelease, GuidanceUpdate, List, ListParams } from "../types";
|
|
4
|
+
import { Resource } from "./base";
|
|
5
|
+
export declare class GuidanceNotices extends Resource {
|
|
6
|
+
/** Notices that reach this domain. Filters: jurisdiction, class, severity, kind, topic, since, affecting_profile. */
|
|
7
|
+
list(filters?: GuidanceNoticeListParams): Promise<Result<List<GuidanceNotice>>>;
|
|
8
|
+
get(id: string): Promise<Result<GuidanceNotice>>;
|
|
9
|
+
/** Mark a notice `read`, `applied` or `not_applicable`. Acknowledgment never gates recording (GD-10). */
|
|
10
|
+
acknowledge(id: string, body: GuidanceAcknowledgeParams, options?: RequestOptions): Promise<Result<GuidanceNotice>>;
|
|
11
|
+
}
|
|
12
|
+
export declare class GuidanceReleases extends Resource {
|
|
13
|
+
list(params?: ListParams): Promise<Result<List<GuidanceRelease>>>;
|
|
14
|
+
/** One release with its changelog: items added, changed, retired. */
|
|
15
|
+
get(id: string): Promise<Result<GuidanceRelease>>;
|
|
16
|
+
}
|
|
17
|
+
export declare class GuidanceUpdates extends Resource {
|
|
18
|
+
/** An update prompt: a short reviewed block that describes one change, to hand to a coding tool (GD-9). */
|
|
19
|
+
get(id: string): Promise<Result<GuidanceUpdate>>;
|
|
20
|
+
}
|
|
21
|
+
/** Notices, releases and update prompts (13.15). Guidance is data on its own release train; it never changes the API. */
|
|
22
|
+
export declare class Guidance extends Resource {
|
|
23
|
+
readonly notices: GuidanceNotices;
|
|
24
|
+
readonly releases: GuidanceReleases;
|
|
25
|
+
readonly updates: GuidanceUpdates;
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Result } from "../errors";
|
|
2
|
+
import type { JurisdictionPack, JurisdictionPackVersion, JurisdictionResolution, JurisdictionResolveParams, List, ListParams } from "../types";
|
|
3
|
+
import { Resource } from "./base";
|
|
4
|
+
export declare class Jurisdictions extends Resource {
|
|
5
|
+
/** The public catalogue of packs. Read it instead of hard-coding codes, so new packs need no SDK release (JR-1). */
|
|
6
|
+
list(params?: ListParams): Promise<Result<List<JurisdictionPack>>>;
|
|
7
|
+
get(code: string): Promise<Result<JurisdictionPack>>;
|
|
8
|
+
/** Version history and changelog of one pack. */
|
|
9
|
+
versions(code: string): Promise<Result<List<JurisdictionPackVersion>>>;
|
|
10
|
+
/** Dry run: the packs, rules, steps, strings and retention floor a session would get. Creates nothing and is not metered (JR-12). */
|
|
11
|
+
resolve(body: JurisdictionResolveParams): Promise<Result<JurisdictionResolution>>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RequestOptions } from "../client";
|
|
2
|
+
import type { Result } from "../errors";
|
|
3
|
+
import type { List, Profile, ProfileAdoptParams, ProfileCreateParams, ProfileGuidance } from "../types";
|
|
4
|
+
import { Resource } from "./base";
|
|
5
|
+
export declare class Profiles extends Resource {
|
|
6
|
+
/** Create a ceremony profile: which packs, which method, which assurance level (13.12). */
|
|
7
|
+
create(body: ProfileCreateParams, options?: RequestOptions): Promise<Result<Profile>>;
|
|
8
|
+
list(): Promise<Result<List<Profile>>>;
|
|
9
|
+
get(id: string): Promise<Result<Profile>>;
|
|
10
|
+
/** Everything that applies to a profile now: record conditions, obligations, recommendations and reports (13.15). */
|
|
11
|
+
guidance(id: string): Promise<Result<ProfileGuidance>>;
|
|
12
|
+
/** Move every pending record condition from advise to enforce (BC-6). Creates a new profile version. Body: `note`, optional. */
|
|
13
|
+
adopt(id: string, body?: ProfileAdoptParams, options?: RequestOptions): Promise<Result<Profile>>;
|
|
14
|
+
/** Return to the previous baseline, within 90 days of adoption (BC-6). */
|
|
15
|
+
rollback(id: string, options?: RequestOptions): Promise<Result<Profile>>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { BinaryResponse, RequestOptions } from "../client";
|
|
2
|
+
import { type Result } from "../errors";
|
|
3
|
+
import type { AnnotationCreateParams, Certificate, DeferredRecordParams, EscRecord, EvidenceOptions, EvidencePackageLink, List, RecordAnnotation, RecordCertificateParams, RecordCompletion, RecordListParams, RecordReceipt, RecordSummary, Supplement } from "../types";
|
|
4
|
+
import { Resource } from "./base";
|
|
5
|
+
export declare class Records extends Resource {
|
|
6
|
+
/** Search records. Filters: signer, e-mail, document, version, creation time, status. */
|
|
7
|
+
list(filters?: RecordListParams): Promise<Result<List<RecordSummary>>>;
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve a record. This is the server-side confirmation of CP-3: before
|
|
10
|
+
* granting access, check that `status` is `recorded`, `timestamped` or
|
|
11
|
+
* `anchored`, that `livemode` is what you expect, and that the signer and
|
|
12
|
+
* the document versions match what your server asked for.
|
|
13
|
+
*/
|
|
14
|
+
get(id: string): Promise<Result<EscRecord>>;
|
|
15
|
+
/** The evidence report as a PDF. */
|
|
16
|
+
report(id: string): Promise<Result<BinaryResponse>>;
|
|
17
|
+
/**
|
|
18
|
+
* The evidence package (ZIP). By default the API returns a signed download
|
|
19
|
+
* link valid for a few minutes. With `{ inline: true }` you get the archive
|
|
20
|
+
* bytes; when the archive is too large to travel inline, the SDK follows
|
|
21
|
+
* the link for you. Verify the package offline with `esigncomply-verify`.
|
|
22
|
+
*/
|
|
23
|
+
evidence(id: string, options: EvidenceOptions & {
|
|
24
|
+
inline: true;
|
|
25
|
+
}): Promise<Result<BinaryResponse>>;
|
|
26
|
+
evidence(id: string, options?: EvidenceOptions & {
|
|
27
|
+
inline?: false;
|
|
28
|
+
}): Promise<Result<EvidencePackageLink>>;
|
|
29
|
+
/** The signed receipt (JWS): the compact proof you can keep in your own database. */
|
|
30
|
+
receipt(id: string): Promise<Result<RecordReceipt>>;
|
|
31
|
+
/**
|
|
32
|
+
* Add a later fact: `superseded`, `legal_hold`, `legal_hold_released`,
|
|
33
|
+
* `note`, `paper_copy_requested`. Body: `type`, and optionally `data` and a
|
|
34
|
+
* free-text `note`. The earlier report types `notice.sent` and
|
|
35
|
+
* `cancellation.requested` are still accepted here and are stored as
|
|
36
|
+
* supplements (SM-12); new code sends those to `supplements.create`.
|
|
37
|
+
*/
|
|
38
|
+
annotate(id: string, body: AnnotationCreateParams | {
|
|
39
|
+
type: "notice.sent" | "cancellation.requested";
|
|
40
|
+
data?: Record<string, unknown>;
|
|
41
|
+
note?: string;
|
|
42
|
+
}, options?: RequestOptions): Promise<Result<RecordAnnotation | Supplement>>;
|
|
43
|
+
/** Issue an on-request certificate for one record (13.13). Needs `confirm_charge: true` when a charge would result. */
|
|
44
|
+
certify(id: string, body?: RecordCertificateParams, options?: RequestOptions): Promise<Result<Certificate>>;
|
|
45
|
+
/** Submit a deferred acceptance under `fail_open_deferred`. The record says it was reported, not observed. */
|
|
46
|
+
submitDeferred(body: DeferredRecordParams, options?: RequestOptions): Promise<Result<RecordCompletion>>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RequestOptions } from "../client";
|
|
2
|
+
import type { Result } from "../errors";
|
|
3
|
+
import type { Session, SessionCancelled, SessionCreateParams, SessionCreated } from "../types";
|
|
4
|
+
import { Resource } from "./base";
|
|
5
|
+
export declare class Sessions extends Resource {
|
|
6
|
+
/**
|
|
7
|
+
* Start a ceremony for one signer and a bundle of document versions (13.4).
|
|
8
|
+
* Hand `client_token` to the browser SDK and read the steps from
|
|
9
|
+
* `required_steps`. Pass an `idempotencyKey` so a retry cannot start two.
|
|
10
|
+
*/
|
|
11
|
+
create(body: SessionCreateParams, options?: RequestOptions): Promise<Result<SessionCreated>>;
|
|
12
|
+
/** State and remaining steps. `record_id` is set once the ceremony completed. */
|
|
13
|
+
get(id: string): Promise<Result<Session>>;
|
|
14
|
+
cancel(id: string, options?: RequestOptions): Promise<Result<SessionCancelled>>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RequestOptions } from "../client";
|
|
2
|
+
import type { Result } from "../errors";
|
|
3
|
+
import type { ConsentWithdrawal, ConsentWithdrawParams, ErasureRequest, ErasureRequestParams, List, ListParams, RecordSummary, SignerStatus } from "../types";
|
|
4
|
+
import { Resource } from "./base";
|
|
5
|
+
/** Signers are addressed by your own `external_id`. */
|
|
6
|
+
export declare class Signers extends Resource {
|
|
7
|
+
/** All records for one signer. */
|
|
8
|
+
records(externalId: string, params?: ListParams): Promise<Result<List<RecordSummary>>>;
|
|
9
|
+
/** For each document: the latest version accepted, and whether the current version is outstanding (DV-4). */
|
|
10
|
+
status(externalId: string): Promise<Result<SignerStatus>>;
|
|
11
|
+
/** Record that the signer withdrew consent to electronic records. Body: `record_id`, `scope`, `note`, all optional. */
|
|
12
|
+
withdrawConsent(externalId: string, body?: ConsentWithdrawParams, options?: RequestOptions): Promise<Result<ConsentWithdrawal>>;
|
|
13
|
+
/** Start a data-subject erasure or restriction workflow (17.3). Body: `scope` (`erasure` by default, or `restriction`) and `basis`. */
|
|
14
|
+
requestErasure(externalId: string, body?: ErasureRequestParams, options?: RequestOptions): Promise<Result<ErasureRequest>>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { RequestOptions } from "../client";
|
|
2
|
+
import { type Result } from "../errors";
|
|
3
|
+
import type { FileObject, FileUploadOptions, List, Supplement, SupplementContent, SupplementCreateParams, SupplementListParams, SupplementTypeInfo } from "../types";
|
|
4
|
+
import { Resource } from "./base";
|
|
5
|
+
/** Customer-supplied material (13.14): free text, JSON and files, sealed on receipt. */
|
|
6
|
+
export declare class Supplements extends Resource {
|
|
7
|
+
/**
|
|
8
|
+
* Send what you have, in the shape you have it. At least one of `text`,
|
|
9
|
+
* `data` or `files`; nothing else is required. The seal shows that you sent
|
|
10
|
+
* it no later than `received_at`. Esign Comply does not verify its content.
|
|
11
|
+
*/
|
|
12
|
+
create(body: SupplementCreateParams, options?: RequestOptions): Promise<Result<Supplement>>;
|
|
13
|
+
list(filters?: SupplementListParams): Promise<Result<List<Supplement>>>;
|
|
14
|
+
get(id: string): Promise<Result<Supplement>>;
|
|
15
|
+
/** Text, data and files as stored. */
|
|
16
|
+
content(id: string): Promise<Result<SupplementContent>>;
|
|
17
|
+
/** Withdraw a supplement (CS-14). It stays listed, marked withdrawn. */
|
|
18
|
+
withdraw(id: string): Promise<Result<Supplement>>;
|
|
19
|
+
/** The public catalogue of recognised types with suggested fields. Any other type is accepted too (SM-3). */
|
|
20
|
+
types(): Promise<Result<List<SupplementTypeInfo>>>;
|
|
21
|
+
}
|
|
22
|
+
export declare class Files extends Resource {
|
|
23
|
+
/**
|
|
24
|
+
* Upload a file to attach to a supplement. Performs the three steps of the
|
|
25
|
+
* upload flow (13.14): registers the file with its name, size, type and
|
|
26
|
+
* SHA-256; sends the bytes straight to storage; then reads the file back so
|
|
27
|
+
* `status` reflects what the API saw. A file not referenced by a supplement
|
|
28
|
+
* within 7 days is deleted.
|
|
29
|
+
*/
|
|
30
|
+
upload(pathOrBytes: string | Uint8Array, options?: FileUploadOptions): Promise<Result<FileObject>>;
|
|
31
|
+
/** Upload status: `stored` once Esign Comply has recomputed the hash, `rejected` on a mismatch. */
|
|
32
|
+
get(id: string): Promise<Result<FileObject>>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { RequestOptions } from "../client";
|
|
2
|
+
import { type Result } from "../errors";
|
|
3
|
+
import type { List, WebhookDelivery, WebhookEndpoint, WebhookEndpointCreateParams, WebhookEndpointUpdateParams, WebhookEvent } from "../types";
|
|
4
|
+
import { Resource } from "./base";
|
|
5
|
+
/** Headers as a fetch `Headers` object or as a plain record (Node's `req.headers`, Express, Next.js). */
|
|
6
|
+
export type HeadersLike = {
|
|
7
|
+
get(name: string): string | null;
|
|
8
|
+
} | Record<string, string | string[] | undefined>;
|
|
9
|
+
export interface WebhookVerifyOptions {
|
|
10
|
+
/** How far the delivery's timestamp may be from now. Default 300 seconds (WH-2). */
|
|
11
|
+
toleranceSeconds?: number;
|
|
12
|
+
/** The clock to compare with. Default: now. */
|
|
13
|
+
now?: Date;
|
|
14
|
+
}
|
|
15
|
+
/** The `webhook-signature` value for one delivery: `v1,` and the base64 HMAC-SHA256 of `id.timestamp.body`. */
|
|
16
|
+
export declare function signWebhookPayload(secret: string, id: string, timestamp: number, body: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Verify a delivery signed under the Standard Webhooks convention (WH-1):
|
|
19
|
+
* HMAC-SHA256 over `id.timestamp.body` with the endpoint secret. Synchronous
|
|
20
|
+
* core of `esc.webhooks.verify`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function verifyWebhookSignature<T = Record<string, unknown>>(rawBody: string | Uint8Array, headers: HeadersLike, secret: string, options?: WebhookVerifyOptions): Result<WebhookEvent<T>>;
|
|
23
|
+
export declare class Webhooks extends Resource {
|
|
24
|
+
/**
|
|
25
|
+
* Verify a delivery and return its event. Pass the raw body exactly as
|
|
26
|
+
* received. Deliveries older than 5 minutes are refused (WH-2). Deliveries
|
|
27
|
+
* are at-least-once: make your handler idempotent on `event.id` (WH-4), and
|
|
28
|
+
* ignore event types you do not know (WH-6).
|
|
29
|
+
*/
|
|
30
|
+
verify<T = Record<string, unknown>>(rawBody: string | Uint8Array, headers: HeadersLike, secret: string, options?: WebhookVerifyOptions): Promise<Result<WebhookEvent<T>>>;
|
|
31
|
+
/** Register an endpoint. The response carries the signing `secret` once. */
|
|
32
|
+
create(body: WebhookEndpointCreateParams, options?: RequestOptions): Promise<Result<WebhookEndpoint>>;
|
|
33
|
+
list(): Promise<Result<List<WebhookEndpoint>>>;
|
|
34
|
+
update(id: string, body: WebhookEndpointUpdateParams): Promise<Result<WebhookEndpoint>>;
|
|
35
|
+
delete(id: string): Promise<Result<Record<string, unknown>>>;
|
|
36
|
+
/**
|
|
37
|
+
* Delivery history with response codes. `since` returns deliveries created
|
|
38
|
+
* after that time, oldest first; `include: "payload"` adds each event.
|
|
39
|
+
* Used by `esigncomply webhooks listen`.
|
|
40
|
+
*/
|
|
41
|
+
listDeliveries(params?: {
|
|
42
|
+
since?: string;
|
|
43
|
+
limit?: number;
|
|
44
|
+
include?: "payload";
|
|
45
|
+
endpoint?: string;
|
|
46
|
+
status?: string;
|
|
47
|
+
}): Promise<Result<List<WebhookDelivery>>>;
|
|
48
|
+
}
|