@assinafy/cli 2.4.2 → 2.5.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/.env.example +4 -2
- package/README.en.md +46 -21
- package/README.md +34 -15
- package/dist/api.cjs +295 -55
- package/dist/api.cjs.map +1 -1
- package/dist/api.js +295 -55
- package/dist/api.js.map +1 -1
- package/dist/cli.cjs +635 -100
- package/dist/types/api/errors.d.ts +9 -0
- package/dist/types/api/errors.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +1 -1
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/resources/authentication.d.ts +33 -3
- package/dist/types/api/resources/authentication.d.ts.map +1 -1
- package/dist/types/api/resources/documents.d.ts +4 -3
- package/dist/types/api/resources/documents.d.ts.map +1 -1
- package/dist/types/api/resources/oauth.d.ts +1 -1
- package/dist/types/api/resources/oauth.d.ts.map +1 -1
- package/dist/types/api/resources/signer-documents.d.ts +9 -4
- package/dist/types/api/resources/signer-documents.d.ts.map +1 -1
- package/dist/types/api/resources/webhooks.d.ts +39 -6
- package/dist/types/api/resources/webhooks.d.ts.map +1 -1
- package/dist/types/api/support/webhook-verifier.d.ts +31 -14
- package/dist/types/api/support/webhook-verifier.d.ts.map +1 -1
- package/dist/types/api/types.d.ts +110 -21
- package/dist/types/api/types.d.ts.map +1 -1
- package/dist/types/api/utils.d.ts.map +1 -1
- package/docs/README.md +1 -1
- package/docs/api-operations.json +105 -1
- package/docs/api-reference.md +2380 -2057
- package/docs/auth.md +125 -4
- package/docs/documents.md +5 -6
- package/docs/migration-v2.md +1 -1
- package/docs/sdk-reference.md +84 -23
- package/docs/signer.md +4 -2
- package/docs/webhooks.md +185 -20
- package/package.json +2 -2
|
@@ -5,6 +5,12 @@ export declare class AssinafyError extends Error {
|
|
|
5
5
|
cause?: unknown;
|
|
6
6
|
});
|
|
7
7
|
}
|
|
8
|
+
/** `X-Rate-Limit-*` values reported with a response (window size, requests left, seconds to reset). */
|
|
9
|
+
export interface RateLimitInfo {
|
|
10
|
+
limit?: number;
|
|
11
|
+
remaining?: number;
|
|
12
|
+
reset?: number;
|
|
13
|
+
}
|
|
8
14
|
/** Thrown when the API returns a non-success HTTP status. */
|
|
9
15
|
export declare class ApiError extends AssinafyError {
|
|
10
16
|
readonly statusCode: number;
|
|
@@ -13,10 +19,13 @@ export declare class ApiError extends AssinafyError {
|
|
|
13
19
|
readonly wwwAuthenticate: string | undefined;
|
|
14
20
|
/** Server retry delay (seconds or HTTP date), when provided. */
|
|
15
21
|
readonly retryAfter: string | undefined;
|
|
22
|
+
/** Rate-limit window reported by the API, when the headers are present. */
|
|
23
|
+
readonly rateLimit: RateLimitInfo | undefined;
|
|
16
24
|
constructor(message: string, statusCode: number, responseData?: unknown, options?: {
|
|
17
25
|
cause?: unknown;
|
|
18
26
|
wwwAuthenticate?: string;
|
|
19
27
|
retryAfter?: string;
|
|
28
|
+
rateLimit?: RateLimitInfo;
|
|
20
29
|
});
|
|
21
30
|
static fromResponse(statusCode: number, responseData: unknown, headers?: Record<string, unknown>): ApiError;
|
|
22
31
|
}
|
|
@@ -1 +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;IACtC,0FAA0F;IAC1F,SAAgB,eAAe,EAAE,M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,OAAO,EACrB,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACnC,QAAQ,CA6BV;CACD;AAWD,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;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;IACtD,iEAAiE;IACjE,SAAgB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/C,kEAAkE;IAClE,SAAgB,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpC,YACC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EACtD,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAO7B;CACD"}
|
|
@@ -15,7 +15,7 @@ export { TemplateResource } from './resources/templates.js';
|
|
|
15
15
|
export { UsersResource } from './resources/users.js';
|
|
16
16
|
export { WebhookResource } from './resources/webhooks.js';
|
|
17
17
|
export { WorkspaceResource } from './resources/workspaces.js';
|
|
18
|
-
export type { WebhookVerifierOptions } from './support/webhook-verifier.js';
|
|
18
|
+
export type { WebhookDeliveryOptions, WebhookHeaders, WebhookVerifierOptions, } from './support/webhook-verifier.js';
|
|
19
19
|
export { WebhookVerifier } from './support/webhook-verifier.js';
|
|
20
20
|
export * from './types.js';
|
|
21
21
|
export { normalizeBaseUrl, requireDocumentArtifactName, requireSignerImageType } from './utils.js';
|
|
@@ -1 +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,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,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,
|
|
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,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,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,EACX,sBAAsB,EACtB,cAAc,EACd,sBAAsB,GACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { IApiKeyResponse, IEmptyResult, ILoginResponse, IMaskedApiKeyResponse, IStatusResponse, SocialLoginProvider } from '../types.js';
|
|
1
|
+
import type { IApiKeyResponse, IEmptyResult, ILoginResponse, IMaskedApiKeyResponse, IMfaReauthPayload, IMfaRecoveryCodes, IMfaStatus, IMfaVerifyPayload, IStatusResponse, ITotpConfirmPayload, ITotpEnrollment, SocialLoginProvider } from '../types.js';
|
|
2
2
|
import { BaseResource } from './base.js';
|
|
3
3
|
/**
|
|
4
|
-
* Authentication endpoints (login, social login, password
|
|
5
|
-
* personal API key management (`/users/api-keys`)
|
|
4
|
+
* Authentication endpoints (login, two-factor, social login, password
|
|
5
|
+
* management), personal API key management (`/users/api-keys`), and
|
|
6
|
+
* two-factor enrollment (`/users/self/mfa`).
|
|
6
7
|
*
|
|
7
8
|
* Most of these endpoints are intended to bootstrap an authenticated session
|
|
8
9
|
* for a human user. Production server-to-server integrations should use
|
|
@@ -11,6 +12,35 @@ import { BaseResource } from './base.js';
|
|
|
11
12
|
export declare class AuthenticationResource extends BaseResource {
|
|
12
13
|
/** `POST /login` — exchange email + password for a JWT access token. */
|
|
13
14
|
login(email: string, password: string): Promise<ILoginResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* `POST /authentication/mfa/verify` — exchange the login `mfa_token` and an
|
|
17
|
+
* authenticator or recovery code for an access token. The challenge is
|
|
18
|
+
* single-use and expires 5 minutes after login.
|
|
19
|
+
*/
|
|
20
|
+
verifyMfa(payload: IMfaVerifyPayload): Promise<ILoginResponse>;
|
|
21
|
+
/** `GET /users/self/mfa` — enrolled two-factor methods and remaining recovery codes. */
|
|
22
|
+
listMfaMethods(): Promise<IMfaStatus>;
|
|
23
|
+
/**
|
|
24
|
+
* `POST /users/self/mfa/totp` — start authenticator enrollment. The secret
|
|
25
|
+
* and provisioning URI are returned only once; two-factor stays inactive
|
|
26
|
+
* until {@link confirmTotpEnrollment}.
|
|
27
|
+
*/
|
|
28
|
+
startTotpEnrollment(label?: string): Promise<ITotpEnrollment>;
|
|
29
|
+
/**
|
|
30
|
+
* `PUT /users/self/mfa/totp/confirm` — activate the method with a live code
|
|
31
|
+
* and receive one-time recovery codes. Replacing a confirmed method also
|
|
32
|
+
* requires `password` or `reauth_code`.
|
|
33
|
+
*/
|
|
34
|
+
confirmTotpEnrollment(payload: ITotpConfirmPayload): Promise<IMfaRecoveryCodes>;
|
|
35
|
+
/** `POST /users/self/mfa/recovery-codes` — issue ten new recovery codes, invalidating the old set. */
|
|
36
|
+
regenerateRecoveryCodes(payload: IMfaReauthPayload): Promise<IMfaRecoveryCodes>;
|
|
37
|
+
/**
|
|
38
|
+
* `DELETE /users/self/mfa/{methodId}` — remove a method. Removing the last
|
|
39
|
+
* one also discards the recovery codes.
|
|
40
|
+
*/
|
|
41
|
+
removeMfaMethod(methodId: string, payload: IMfaReauthPayload): Promise<{
|
|
42
|
+
is_mfa_enabled: boolean;
|
|
43
|
+
}>;
|
|
14
44
|
/** `POST /authentication/social-login` — exchange a provider token for an Assinafy JWT. */
|
|
15
45
|
socialLogin(payload: {
|
|
16
46
|
provider: SocialLoginProvider;
|
|
@@ -1 +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;
|
|
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,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAUzC;;;;;;;;GAQG;AACH,qBAAa,sBAAuB,SAAQ,YAAY;IACvD,wEAAwE;IAClE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAMpE;IAED;;;;OAIG;IACG,SAAS,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAA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K,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"}
|
|
@@ -109,9 +109,10 @@ export declare class DocumentResource extends BaseResource {
|
|
|
109
109
|
*/
|
|
110
110
|
getPublic(documentId: string): Promise<IPublicDocumentInfo>;
|
|
111
111
|
/**
|
|
112
|
-
* `PUT /public/documents/{document_id}/send-token` —
|
|
113
|
-
*
|
|
114
|
-
*
|
|
112
|
+
* `PUT /public/documents/{document_id}/send-token` — email a one-time access
|
|
113
|
+
* token to a signer who has not signed a pending document yet. The API sends
|
|
114
|
+
* `{ channel: 'email', recipient }`; only the `email` channel is accepted.
|
|
115
|
+
* The `{ email }` form is kept for existing callers and sends the same body.
|
|
115
116
|
*/
|
|
116
117
|
sendToken(documentId: string, recipient: string | {
|
|
117
118
|
email: string;
|
|
@@ -1 +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,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;;;;;;;OASG;IACG,kBAAkB,CACvB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,eAAe,EAAE,EAC1B,OAAO,GAAE,kCAAuC,EAChD,SAAS,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,wBAAwB,CAAC,CAuBnC;IAED,uEAAuE;IACjE,wBAAwB,CAC7B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,mBAAmB,EAAE,EAC9B,SAAS,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,qBAAqB,CAAC,CAOhC;IAED;;;OAGG;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
|
|
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;AAYrB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAmBzC,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,C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mB,EAAE,EAC9B,SAAS,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,qBAAqB,CAAC,CAOhC;IAED;;;OAGG;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;;;;;OAKG;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,CAY7B;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"}
|
|
@@ -11,7 +11,7 @@ export declare class OAuthResource extends BaseResource {
|
|
|
11
11
|
/** Validate callback URI, state, and issuer before exchanging its one-time code. */
|
|
12
12
|
exchangeCode(callbackUrl: string, request: IOAuthAuthorizationRequest, clientSecret?: string): Promise<IOAuthTokenResponse>;
|
|
13
13
|
/**
|
|
14
|
-
* `POST /oauth/token` — code exchange or
|
|
14
|
+
* `POST /oauth/token` — code exchange, refresh, or RFC 8693 token exchange; returns the flat OAuth JSON body.
|
|
15
15
|
* A refresh must return a new `refresh_token`; otherwise this throws `ValidationError`.
|
|
16
16
|
*/
|
|
17
17
|
token(payload: IOAuthTokenPayload): Promise<IOAuthTokenResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../../src/api/resources/oauth.ts"],"names":[],"mappings":"AAG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AED,yFAAyF;IACnF,SAAS,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CA6CxF;IAED,oFAAoF;IAC9E,YAAY,CACjB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,0BAA0B,EACnC,YAAY,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,mBAAmB,CAAC,CAiD9B;IAED;;;OAGG;IACG,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAmDrE;IAED,2FAA2F;IACrF,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAaxD;IAED,uFAAuF;IACjF,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC,CAExC;CACD"}
|
|
@@ -8,10 +8,15 @@ import { BaseResource } from './base.js';
|
|
|
8
8
|
export declare class SignerDocumentsResource extends BaseResource {
|
|
9
9
|
/** `GET /signers/{signer_id}/document?signer-access-code=…` */
|
|
10
10
|
getCurrent(signerId: string, signerAccessCode: string): Promise<IDocumentDetailsResponse>;
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
/**
|
|
12
|
+
* `GET /signers/{signer_id}/documents` — with a signer access code, or with
|
|
13
|
+
* the client's owner credentials when the code is omitted (the signer must
|
|
14
|
+
* belong to that workspace).
|
|
15
|
+
*/
|
|
16
|
+
list(signerId: string, signerAccessCode?: string, params?: ISignerDocumentListParams): Promise<IDocumentListResponse>;
|
|
17
|
+
/** `GET /signers/{signer_id}/documents/search?search=…` — access code or owner credentials. */
|
|
18
|
+
search(signerId: string, search: string, signerAccessCode?: string): Promise<IDocumentListResponse>;
|
|
19
|
+
private signerOrOwnerConfig;
|
|
15
20
|
/**
|
|
16
21
|
* Public `GET /signers/{signer_id}/documents/{document_id}/download/{artifact}`.
|
|
17
22
|
* When an access code is supplied, the SDK first verifies that it belongs to
|
|
@@ -1 +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,4BAA4B,EAC5B,yBAAyB,EACzB,wBAAwB,EAExB,qBAAqB,EACrB,YAAY,EACZ,OAAO,EACP,yBAAyB,EACzB,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"signer-documents.d.ts","sourceRoot":"","sources":["../../../../src/api/resources/signer-documents.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,oBAAoB,EACpB,4BAA4B,EAC5B,yBAAyB,EACzB,wBAAwB,EAExB,qBAAqB,EACrB,YAAY,EACZ,OAAO,EACP,yBAAyB,EACzB,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,MAAM,aAAa,CAAC;AAQrB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,YAAY;IACxD,+DAA+D;IACzD,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAM9F;IAED;;;;OAIG;IACG,IAAI,CACT,QAAQ,EAAE,MAAM,EAChB,gBAAgB,CAAC,EAAE,MAAM,EACzB,MAAM,GAAE,yBAA8B,GACpC,OAAO,CAAC,qBAAqB,CAAC,CAMhC;IAED,+FAA+F;IACzF,MAAM,CACX,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,gBAAgB,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,qBAAqB,CAAC,CAMhC;IAED,OAAO,CAAC,mBAAmB;IAQ3B;;;;OAIG;IACG,QAAQ,CACb,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE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AAE,OAAO,CAAC;KAC7B,GACC,OAAO,CAAC,OAAO,GAAG,YAAY,CAAC,CAcjC;IAED;;;OAGG;IACG,eAAe,CACpB,gBAAgB,EAAE,MAAM,EACxB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;QAAE,SAAS,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAO,GAC1F,OAAO,CAAC,YAAY,GAAG,eAAe,CAAC,CAqBzC;IAED,8FAA8F;IACxF,iBAAiB,CACtB,gBAAgB,EAAE,MAAM,EACxB,SAAS,GAAE,WAAW,GAAG,SAAuB,GAC9C,OAAO,CAAC,MAAM,CAAC,CASjB;IAED,qFAAqF;IAC/E,aAAa,CAClB,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,CAAC,EAAE,OAAO,GACxB,OAAO,CAAC,wBAAwB,CAAC,CAKnC;IAED;;;OAGG;IACG,IAAI,CACT,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,eAAe,EAAE,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAclC;IAED;;;OAGG;IACG,OAAO,CACZ,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,MAAM,EACxB,aAAa,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,EAAE,CAAC,CAapB;YAEa,qBAAqB;CAcnC"}
|
|
@@ -1,17 +1,50 @@
|
|
|
1
|
-
import type { IWebhookDispatch, IWebhookDispatchListParams, IWebhookEventTypeInfo, IWebhookRegisterPayload, IWebhookSubscription, PaginatedResult } from '../types.js';
|
|
1
|
+
import type { IEmptyResult, IWebhookDispatch, IWebhookDispatchListParams, IWebhookEndpoint, IWebhookEndpointCreatePayload, IWebhookEndpointSecret, IWebhookEndpointUpdatePayload, IWebhookEventTypeInfo, IWebhookRegisterPayload, IWebhookSubscription, PaginatedResult } from '../types.js';
|
|
2
2
|
import { BaseResource } from './base.js';
|
|
3
3
|
export declare class WebhookResource extends BaseResource {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* `PUT /accounts/{accountId}/webhooks/subscriptions` — create or replace the
|
|
6
|
+
* account's oldest webhook endpoint. Use the endpoint methods for accounts
|
|
7
|
+
* with several endpoints or for signed deliveries.
|
|
8
|
+
*/
|
|
5
9
|
register(payload: IWebhookRegisterPayload, accountId?: string): Promise<IWebhookSubscription>;
|
|
6
|
-
/** Fetch the
|
|
10
|
+
/** Fetch the account's oldest webhook endpoint. Returns `null` if none exists. */
|
|
7
11
|
get(accountId?: string): Promise<IWebhookSubscription | null>;
|
|
8
|
-
/** Inactivate the
|
|
12
|
+
/** Inactivate the account's oldest webhook endpoint without deleting it. */
|
|
9
13
|
inactivate(accountId?: string): Promise<IWebhookSubscription>;
|
|
14
|
+
/** `GET /accounts/{accountId}/webhooks/endpoints` — list webhook endpoints, oldest first. */
|
|
15
|
+
listEndpoints(accountId?: string): Promise<IWebhookEndpoint[]>;
|
|
16
|
+
/**
|
|
17
|
+
* `POST /accounts/{accountId}/webhooks/endpoints` — register another
|
|
18
|
+
* endpoint. Accounts allow 1 endpoint, or up to 3 on paid plans (`403` past
|
|
19
|
+
* the limit); URLs must be unique per workspace. Omitted `events` uses the
|
|
20
|
+
* same default set as {@link register}.
|
|
21
|
+
*/
|
|
22
|
+
createEndpoint(payload: IWebhookEndpointCreatePayload, accountId?: string): Promise<IWebhookEndpoint>;
|
|
23
|
+
/** `GET /accounts/{accountId}/webhooks/endpoints/{endpointId}` — fetch one endpoint. */
|
|
24
|
+
getEndpoint(endpointId: string, accountId?: string): Promise<IWebhookEndpoint>;
|
|
25
|
+
/**
|
|
26
|
+
* `PUT /accounts/{accountId}/webhooks/endpoints/{endpointId}` — update only
|
|
27
|
+
* the fields sent. Enabling signing creates a secret when none exists;
|
|
28
|
+
* disabling it discards the secret.
|
|
29
|
+
*/
|
|
30
|
+
updateEndpoint(endpointId: string, payload: IWebhookEndpointUpdatePayload, accountId?: string): Promise<IWebhookEndpoint>;
|
|
31
|
+
/** `DELETE /accounts/{accountId}/webhooks/endpoints/{endpointId}` — delete an endpoint and free its slot. */
|
|
32
|
+
deleteEndpoint(endpointId: string, accountId?: string): Promise<IEmptyResult>;
|
|
33
|
+
/**
|
|
34
|
+
* `GET …/endpoints/{endpointId}/secret` — the `whsec_` signing secret.
|
|
35
|
+
* Returns `400` when signing is disabled. Not available to OAuth applications.
|
|
36
|
+
*/
|
|
37
|
+
getEndpointSecret(endpointId: string, accountId?: string): Promise<IWebhookEndpointSecret>;
|
|
38
|
+
/**
|
|
39
|
+
* `POST …/endpoints/{endpointId}/secret/rotate` — replace the signing secret.
|
|
40
|
+
* The old secret stops working immediately. Not available to OAuth applications.
|
|
41
|
+
*/
|
|
42
|
+
rotateEndpointSecret(endpointId: string, accountId?: string): Promise<IWebhookEndpointSecret>;
|
|
10
43
|
/** List currently supported webhook event types. */
|
|
11
44
|
listEventTypes(): Promise<IWebhookEventTypeInfo[]>;
|
|
12
|
-
/** List webhook delivery history for the workspace. */
|
|
45
|
+
/** List webhook delivery history for the workspace, optionally for one endpoint. */
|
|
13
46
|
listDispatches(params?: IWebhookDispatchListParams, accountId?: string): Promise<PaginatedResult<IWebhookDispatch>>;
|
|
14
|
-
/** Retry delivery of a specific webhook dispatch. */
|
|
47
|
+
/** Retry delivery of a specific webhook dispatch to that entry's endpoint. */
|
|
15
48
|
retryDispatch(dispatchId: string, accountId?: string): Promise<IWebhookDispatch>;
|
|
16
49
|
}
|
|
17
50
|
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../../src/api/resources/webhooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,gBAAgB,EAChB,0BAA0B,EA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AE,6BAA6B,EACtC,SAAS,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,gBAAgB,CAAC,CAU3B;IAED,6GAA6G;IACvG,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAMlF;IAED;;;OAGG;IACG,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAM/F;IAED;;;OAGG;IACG,oBAAoB,CACzB,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,sBAAsB,CAAC,CAOjC;IAED,oDAAoD;IAC9C,cAAc,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAIvD;IAED,oFAAoF;IAC9E,cAAc,CACnB,MAAM,GAAE,0BAA+B,EACvC,SAAS,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAS5C;IAED,8EAA8E;IACxE,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAMrF;CACD"}
|
|
@@ -1,32 +1,49 @@
|
|
|
1
1
|
import type { IWebhookPayload } from '../types.js';
|
|
2
|
-
/**
|
|
2
|
+
/** Options for the legacy {@link WebhookVerifier.verify} body-only HMAC. */
|
|
3
3
|
export interface WebhookVerifierOptions {
|
|
4
4
|
/** HMAC hash algorithm. Defaults to `sha256`. */
|
|
5
5
|
algorithm?: string;
|
|
6
6
|
/** Digest encoding of the signature value. Defaults to `hex`. */
|
|
7
7
|
encoding?: 'hex' | 'base64';
|
|
8
8
|
}
|
|
9
|
+
/** Request headers as Node (`IncomingHttpHeaders`), a plain record, or a Fetch `Headers`. */
|
|
10
|
+
export type WebhookHeaders = Headers | Record<string, string | string[] | undefined>;
|
|
11
|
+
/** Options for {@link WebhookVerifier.verifyDelivery}. */
|
|
12
|
+
export interface WebhookDeliveryOptions {
|
|
13
|
+
/** Maximum clock difference accepted for `webhook-timestamp`. Defaults to 300 seconds. */
|
|
14
|
+
toleranceSeconds?: number;
|
|
15
|
+
/** Current time in milliseconds. Defaults to `Date.now()`. */
|
|
16
|
+
now?: number;
|
|
17
|
+
}
|
|
9
18
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* NOTE: the public API reference does not document a webhook signing scheme.
|
|
13
|
-
* This helper implements the common convention — an HMAC of the raw body using
|
|
14
|
-
* the workspace webhook secret, compared against a hex digest sent in a
|
|
15
|
-
* signature header — and lets you override the algorithm/encoding to match
|
|
16
|
-
* whatever the platform actually sends. Confirm the exact header name and
|
|
17
|
-
* encoding against a real delivered webhook before relying on it, and treat a
|
|
18
|
-
* failed {@link WebhookVerifier.verify} as "unverified", not proof of forgery.
|
|
19
|
+
* Verifies Assinafy webhook deliveries and parses their JSON envelope.
|
|
19
20
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* Endpoints with `signing_enabled: true` sign each delivery following the
|
|
22
|
+
* Standard Webhooks specification: `webhook-signature` carries one or more
|
|
23
|
+
* space-separated `v1,<base64>` HMAC-SHA256 values over
|
|
24
|
+
* `{webhook-id}.{webhook-timestamp}.{raw body}`, keyed with the base64 part of
|
|
25
|
+
* the endpoint's `whsec_` secret. Use {@link verifyDelivery} with the raw
|
|
26
|
+
* request body and headers; deduplicate accepted deliveries by `webhook-id`.
|
|
23
27
|
*/
|
|
24
28
|
export declare class WebhookVerifier {
|
|
25
29
|
private readonly webhookSecret?;
|
|
26
30
|
private readonly algorithm;
|
|
27
31
|
private readonly encoding;
|
|
28
32
|
constructor(webhookSecret?: string | undefined, options?: WebhookVerifierOptions);
|
|
29
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Returns `true` when `headers` carry a Standard Webhooks signature that
|
|
35
|
+
* matches the raw `payload` under this verifier's `whsec_` secret and the
|
|
36
|
+
* `webhook-timestamp` is within the tolerance window. Pass the body exactly
|
|
37
|
+
* as received; re-serialized JSON does not verify.
|
|
38
|
+
*/
|
|
39
|
+
verifyDelivery(payload: string | Buffer, headers: WebhookHeaders, options?: WebhookDeliveryOptions): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Returns `true` if `signature` is an HMAC of `payload` keyed with the raw
|
|
42
|
+
* secret string under the configured algorithm/encoding.
|
|
43
|
+
*
|
|
44
|
+
* @deprecated Assinafy signs deliveries with Standard Webhooks headers; use
|
|
45
|
+
* {@link verifyDelivery}. Retained for existing callers.
|
|
46
|
+
*/
|
|
30
47
|
verify(payload: string | Buffer, signature: string): boolean;
|
|
31
48
|
/** Parse the raw webhook body into a JSON event envelope. */
|
|
32
49
|
extractEvent(payload: string | Buffer): IWebhookPayload | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-verifier.d.ts","sourceRoot":"","sources":["../../../../src/api/support/webhook-verifier.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,
|
|
1
|
+
{"version":3,"file":"webhook-verifier.d.ts","sourceRoot":"","sources":["../../../../src/api/support/webhook-verifier.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,4EAA4E;AAC5E,MAAM,WAAW,sBAAsB;IACtC,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;CAC5B;AAED,6FAA6F;AAC7F,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;AAErF,0DAA0D;AAC1D,MAAM,WAAW,sBAAsB;IACtC,0FAA0F;IAC1F,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8DAA8D;IAC9D,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAeD;;;;;;;;;GASG;AACH,qBAAa,eAAe;IAK1B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC;IAJhC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAE5C,YACkB,aAAa,CAAC,EAAE,MAAM,YAAA,EACvC,OAAO,GAAE,sBAA2B,EAIpC;IAED;;;;;OAKG;IACH,cAAc,CACb,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,OAAO,EAAE,cAAc,EACvB,OAAO,GAAE,sBAA2B,GAClC,OAAO,CA6BT;IAED;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAc3D;IAED,6DAA6D;IAC7D,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,eAAe,GAAG,IAAI,CAS7D;IAED,yEAAyE;IACzE,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAKrE;IAED;;;;;OAKG;IACH,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAS/E;CACD"}
|
|
@@ -41,8 +41,9 @@ export interface AssinafyClientOptions {
|
|
|
41
41
|
*/
|
|
42
42
|
allowInsecureHttp?: boolean;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
44
|
+
* Default `whsec_` endpoint signing secret for {@link WebhookVerifier}
|
|
45
|
+
* (`client.webhookVerifier`). Each endpoint has its own secret; construct a
|
|
46
|
+
* separate verifier per endpoint when several are signed.
|
|
46
47
|
*/
|
|
47
48
|
webhookSecret?: string;
|
|
48
49
|
/** Request timeout in milliseconds. Defaults to 30_000. */
|
|
@@ -596,6 +597,37 @@ export interface IWebhookSubscription {
|
|
|
596
597
|
created_at?: string | null;
|
|
597
598
|
updated_at?: string | null;
|
|
598
599
|
}
|
|
600
|
+
/** A webhook endpoint (`/accounts/{accountId}/webhooks/endpoints`). */
|
|
601
|
+
export interface IWebhookEndpoint {
|
|
602
|
+
id: string;
|
|
603
|
+
name: string | null;
|
|
604
|
+
url: string;
|
|
605
|
+
email: string;
|
|
606
|
+
events: string[];
|
|
607
|
+
is_active: boolean;
|
|
608
|
+
/** `true` when deliveries carry a Standard Webhooks `webhook-signature` header. */
|
|
609
|
+
signing_enabled: boolean;
|
|
610
|
+
created_at: string;
|
|
611
|
+
updated_at: string;
|
|
612
|
+
}
|
|
613
|
+
/** `POST /accounts/{accountId}/webhooks/endpoints` body. */
|
|
614
|
+
export interface IWebhookEndpointCreatePayload {
|
|
615
|
+
url: string;
|
|
616
|
+
email: string;
|
|
617
|
+
/** Defaults to the SDK's standard event set when omitted. */
|
|
618
|
+
events?: WebhookEventType[] | string[];
|
|
619
|
+
name?: string;
|
|
620
|
+
/** Server default: `true`. */
|
|
621
|
+
is_active?: boolean;
|
|
622
|
+
/** Server default: `false`. */
|
|
623
|
+
signing_enabled?: boolean;
|
|
624
|
+
}
|
|
625
|
+
/** `PUT /accounts/{accountId}/webhooks/endpoints/{endpointId}` body; only sent fields change. */
|
|
626
|
+
export type IWebhookEndpointUpdatePayload = Partial<IWebhookEndpointCreatePayload>;
|
|
627
|
+
/** Endpoint signing secret, prefixed `whsec_`. */
|
|
628
|
+
export interface IWebhookEndpointSecret {
|
|
629
|
+
secret: string;
|
|
630
|
+
}
|
|
599
631
|
export interface IWebhookEventTypeInfo {
|
|
600
632
|
id: WebhookEventType | string;
|
|
601
633
|
description: string;
|
|
@@ -605,6 +637,8 @@ export interface IWebhookDispatch {
|
|
|
605
637
|
id: string;
|
|
606
638
|
event: WebhookEventType | string;
|
|
607
639
|
activity_id: number;
|
|
640
|
+
/** Endpoint that received this delivery. */
|
|
641
|
+
endpoint_id?: string | null;
|
|
608
642
|
endpoint: string | null;
|
|
609
643
|
payload: IWebhookPayload | Record<string, unknown> | null;
|
|
610
644
|
delivered: boolean;
|
|
@@ -617,6 +651,8 @@ export interface IWebhookDispatch {
|
|
|
617
651
|
updated_at?: string;
|
|
618
652
|
}
|
|
619
653
|
export interface IWebhookDispatchListParams extends IPaginationParams {
|
|
654
|
+
/** Only deliveries to this webhook endpoint. */
|
|
655
|
+
endpoint_id?: string;
|
|
620
656
|
event?: WebhookEventType | string;
|
|
621
657
|
delivered?: boolean | 'true' | 'false';
|
|
622
658
|
from?: number;
|
|
@@ -788,26 +824,21 @@ export interface IPublicDocumentInfo {
|
|
|
788
824
|
page_count?: string | number;
|
|
789
825
|
created_by?: string;
|
|
790
826
|
}
|
|
791
|
-
/** Channel accepted by the `send-token` endpoint. */
|
|
792
|
-
export type SendTokenChannel = 'email'
|
|
793
|
-
/**
|
|
794
|
-
* Response from `PUT /public/documents/{id}/send-token`.
|
|
795
|
-
*
|
|
796
|
-
* The published body is `{ email }`; the live legacy form may echo the
|
|
797
|
-
* alternate `recipient` + `channel` fields that the SDK also supports.
|
|
798
|
-
*/
|
|
827
|
+
/** Channel accepted by the `send-token` endpoint. Only `email` is supported. */
|
|
828
|
+
export type SendTokenChannel = 'email';
|
|
829
|
+
/** `data` of `PUT /public/documents/{id}/send-token`. */
|
|
799
830
|
export interface ISendTokenResponse {
|
|
800
|
-
/**
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
831
|
+
/** Compact document; sandbox returns `page_count` as a numeric string. */
|
|
832
|
+
document: {
|
|
833
|
+
resource: 'document';
|
|
834
|
+
id: string;
|
|
835
|
+
name: string;
|
|
836
|
+
page_count: number | string;
|
|
837
|
+
created_by: string;
|
|
838
|
+
};
|
|
839
|
+
channel: SendTokenChannel;
|
|
840
|
+
/** The signer email the token was sent to. */
|
|
841
|
+
recipient: string;
|
|
811
842
|
}
|
|
812
843
|
/** Authentication: login response (also returned by social login). */
|
|
813
844
|
export interface IAuthUser {
|
|
@@ -832,6 +863,55 @@ export interface ILoginResponse {
|
|
|
832
863
|
access_token: string;
|
|
833
864
|
user: IAuthUser;
|
|
834
865
|
accounts: IAuthAccount[];
|
|
866
|
+
/**
|
|
867
|
+
* Two-factor challenge returned by `POST /login` when the user has a
|
|
868
|
+
* confirmed method. Complete it with `auth.verifyMfa` within 5 minutes.
|
|
869
|
+
*/
|
|
870
|
+
mfa_token?: string;
|
|
871
|
+
}
|
|
872
|
+
/** `POST /authentication/mfa/verify` body. */
|
|
873
|
+
export interface IMfaVerifyPayload {
|
|
874
|
+
mfa_token: string;
|
|
875
|
+
/** 6-digit authenticator code or a recovery code such as `ABCD-EFGH-JKMN`. */
|
|
876
|
+
code: string;
|
|
877
|
+
}
|
|
878
|
+
/** An enrolled two-factor method. */
|
|
879
|
+
export interface IMfaMethod {
|
|
880
|
+
id: string;
|
|
881
|
+
type: 'Totp' | (string & {});
|
|
882
|
+
label: string | null;
|
|
883
|
+
confirmed_at: string | null;
|
|
884
|
+
last_used_at: string | null;
|
|
885
|
+
}
|
|
886
|
+
/** `GET /users/self/mfa` response. */
|
|
887
|
+
export interface IMfaStatus {
|
|
888
|
+
methods: IMfaMethod[];
|
|
889
|
+
recovery_codes_remaining: number;
|
|
890
|
+
}
|
|
891
|
+
/** `POST /users/self/mfa/totp` response; `secret` is returned only once. */
|
|
892
|
+
export interface ITotpEnrollment {
|
|
893
|
+
id: string;
|
|
894
|
+
secret: string;
|
|
895
|
+
provisioning_uri: string;
|
|
896
|
+
}
|
|
897
|
+
/** `PUT /users/self/mfa/totp/confirm` body. */
|
|
898
|
+
export interface ITotpConfirmPayload {
|
|
899
|
+
id: string;
|
|
900
|
+
/** Live code from the device being enrolled. */
|
|
901
|
+
code: string;
|
|
902
|
+
/** Re-authentication, required only when replacing a confirmed method. */
|
|
903
|
+
password?: string;
|
|
904
|
+
/** Alternative re-authentication: a code from the current device or a recovery code. */
|
|
905
|
+
reauth_code?: string;
|
|
906
|
+
}
|
|
907
|
+
/** Re-authentication proof: the current password, or a live/recovery `code`. */
|
|
908
|
+
export interface IMfaReauthPayload {
|
|
909
|
+
password?: string;
|
|
910
|
+
code?: string;
|
|
911
|
+
}
|
|
912
|
+
/** One-time recovery codes. */
|
|
913
|
+
export interface IMfaRecoveryCodes {
|
|
914
|
+
recovery_codes: string[];
|
|
835
915
|
}
|
|
836
916
|
/**
|
|
837
917
|
* `GET /users/self` is documented as a direct user, while the sandbox has also
|
|
@@ -1014,6 +1094,15 @@ export type IOAuthTokenPayload = {
|
|
|
1014
1094
|
} | {
|
|
1015
1095
|
grant_type: 'refresh_token';
|
|
1016
1096
|
refresh_token: string;
|
|
1097
|
+
} | {
|
|
1098
|
+
/** RFC 8693; Assinafy internal-service confidential clients only (others get `invalid_client`). */
|
|
1099
|
+
grant_type: 'urn:ietf:params:oauth:grant-type:token-exchange';
|
|
1100
|
+
client_secret: string;
|
|
1101
|
+
/** Required for this grant: this API's own resource identifier. */
|
|
1102
|
+
resource: string;
|
|
1103
|
+
subject_token: string;
|
|
1104
|
+
subject_token_type: 'urn:ietf:params:oauth:token-type:access_token';
|
|
1105
|
+
requested_token_type?: 'urn:ietf:params:oauth:token-type:access_token';
|
|
1017
1106
|
});
|
|
1018
1107
|
/** Flat OAuth response. Persist rotated tokens atomically before making further requests. */
|
|
1019
1108
|
export interface IOAuthTokenResponse {
|