@assinafy/cli 2.5.2 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.cjs +26 -12
- package/dist/api.cjs.map +1 -1
- package/dist/api.js +26 -12
- package/dist/api.js.map +1 -1
- package/dist/cli.cjs +29 -15
- package/dist/types/api/resources/signer-documents.d.ts +16 -7
- package/dist/types/api/resources/signer-documents.d.ts.map +1 -1
- package/docs/sdk-reference.md +5 -3
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -22524,32 +22524,46 @@ var SignerDocumentsResource = class extends BaseResource {
|
|
|
22524
22524
|
() => this.http.get(`/signers/${sid}/document`, signerAccessConfig(code))
|
|
22525
22525
|
);
|
|
22526
22526
|
}
|
|
22527
|
+
/** `GET /signers/{signer_id}/documents?signer-access-code=…` */
|
|
22528
|
+
async list(signerId, signerAccessCode, params = {}) {
|
|
22529
|
+
const code = this.requireId(signerAccessCode, "signer-access-code");
|
|
22530
|
+
return this.listDocuments(signerId, signerAccessConfig(code, { ...params }));
|
|
22531
|
+
}
|
|
22527
22532
|
/**
|
|
22528
|
-
* `GET /signers/{signer_id}/documents`
|
|
22529
|
-
*
|
|
22530
|
-
*
|
|
22533
|
+
* `GET /signers/{signer_id}/documents` with the client's owner credentials
|
|
22534
|
+
* (API key or token) instead of a signer access code. The signer must belong
|
|
22535
|
+
* to that workspace.
|
|
22531
22536
|
*/
|
|
22532
|
-
async
|
|
22537
|
+
async listAsOwner(signerId, params = {}) {
|
|
22538
|
+
return this.listDocuments(signerId, { params: cleanParams({ ...params }) });
|
|
22539
|
+
}
|
|
22540
|
+
/** `GET /signers/{signer_id}/documents/search?search=…&signer-access-code=…` */
|
|
22541
|
+
async search(signerId, search, signerAccessCode) {
|
|
22542
|
+
const code = this.requireId(signerAccessCode, "signer-access-code");
|
|
22543
|
+
return this.searchDocuments(signerId, signerAccessConfig(code, { search }));
|
|
22544
|
+
}
|
|
22545
|
+
/**
|
|
22546
|
+
* `GET /signers/{signer_id}/documents/search?search=…` with the client's owner
|
|
22547
|
+
* credentials instead of a signer access code. The signer must belong to that
|
|
22548
|
+
* workspace.
|
|
22549
|
+
*/
|
|
22550
|
+
async searchAsOwner(signerId, search) {
|
|
22551
|
+
return this.searchDocuments(signerId, { params: cleanParams({ search }) });
|
|
22552
|
+
}
|
|
22553
|
+
listDocuments(signerId, config) {
|
|
22533
22554
|
const sid = this.requireId(signerId, "Signer ID");
|
|
22534
|
-
const config = this.signerOrOwnerConfig(signerAccessCode, { ...params });
|
|
22535
22555
|
return this.callList(
|
|
22536
22556
|
"Failed to list signer documents",
|
|
22537
22557
|
() => this.http.get(`/signers/${sid}/documents`, config)
|
|
22538
22558
|
);
|
|
22539
22559
|
}
|
|
22540
|
-
|
|
22541
|
-
async search(signerId, search, signerAccessCode) {
|
|
22560
|
+
searchDocuments(signerId, config) {
|
|
22542
22561
|
const sid = this.requireId(signerId, "Signer ID");
|
|
22543
|
-
const config = this.signerOrOwnerConfig(signerAccessCode, { search });
|
|
22544
22562
|
return this.callList(
|
|
22545
22563
|
"Failed to search signer documents",
|
|
22546
22564
|
() => this.http.get(`/signers/${sid}/documents/search`, config)
|
|
22547
22565
|
);
|
|
22548
22566
|
}
|
|
22549
|
-
signerOrOwnerConfig(signerAccessCode, params) {
|
|
22550
|
-
if (signerAccessCode === void 0) return { params: cleanParams(params) };
|
|
22551
|
-
return signerAccessConfig(this.requireId(signerAccessCode, "signer-access-code"), params);
|
|
22552
|
-
}
|
|
22553
22567
|
/**
|
|
22554
22568
|
* Public `GET /signers/{signer_id}/documents/{document_id}/download/{artifact}`.
|
|
22555
22569
|
* When an access code is supplied, the SDK first verifies that it belongs to
|
|
@@ -26790,7 +26804,7 @@ var documentsCommand2 = addListOptions(
|
|
|
26790
26804
|
const result = await withSpinner(
|
|
26791
26805
|
"Fetching documents",
|
|
26792
26806
|
config,
|
|
26793
|
-
() => client.signerDocuments.list(signerId, opts.accessCode, listParams(opts))
|
|
26807
|
+
() => opts.accessCode === void 0 ? client.signerDocuments.listAsOwner(signerId, listParams(opts)) : client.signerDocuments.list(signerId, opts.accessCode, listParams(opts))
|
|
26794
26808
|
);
|
|
26795
26809
|
printPaginatedData(
|
|
26796
26810
|
result,
|
|
@@ -26808,7 +26822,7 @@ var searchCommand2 = new Command("search").description("Search the signer's docu
|
|
|
26808
26822
|
const result = await withSpinner(
|
|
26809
26823
|
"Searching documents",
|
|
26810
26824
|
config,
|
|
26811
|
-
() => client.signerDocuments.search(signerId, query, opts.accessCode)
|
|
26825
|
+
() => opts.accessCode === void 0 ? client.signerDocuments.searchAsOwner(signerId, query) : client.signerDocuments.search(signerId, query, opts.accessCode)
|
|
26812
26826
|
);
|
|
26813
26827
|
printPaginatedData(
|
|
26814
26828
|
result,
|
|
@@ -27810,7 +27824,7 @@ function handleStreamError(err, fallback, exit = process.exit) {
|
|
|
27810
27824
|
// package.json
|
|
27811
27825
|
var package_default = {
|
|
27812
27826
|
name: "@assinafy/cli",
|
|
27813
|
-
version: "2.5.
|
|
27827
|
+
version: "2.5.3",
|
|
27814
27828
|
description: "The official command-line interface for the Assinafy digital-signature API",
|
|
27815
27829
|
license: "MIT",
|
|
27816
27830
|
type: "module",
|
|
@@ -8,15 +8,24 @@ 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
|
+
/** `GET /signers/{signer_id}/documents?signer-access-code=…` */
|
|
12
|
+
list(signerId: string, signerAccessCode: string, params?: ISignerDocumentListParams): Promise<IDocumentListResponse>;
|
|
11
13
|
/**
|
|
12
|
-
* `GET /signers/{signer_id}/documents`
|
|
13
|
-
*
|
|
14
|
-
*
|
|
14
|
+
* `GET /signers/{signer_id}/documents` with the client's owner credentials
|
|
15
|
+
* (API key or token) instead of a signer access code. The signer must belong
|
|
16
|
+
* to that workspace.
|
|
15
17
|
*/
|
|
16
|
-
|
|
17
|
-
/** `GET /signers/{signer_id}/documents/search?search
|
|
18
|
-
search(signerId: string, search: string, signerAccessCode
|
|
19
|
-
|
|
18
|
+
listAsOwner(signerId: string, params?: ISignerDocumentListParams): Promise<IDocumentListResponse>;
|
|
19
|
+
/** `GET /signers/{signer_id}/documents/search?search=…&signer-access-code=…` */
|
|
20
|
+
search(signerId: string, search: string, signerAccessCode: string): Promise<IDocumentListResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* `GET /signers/{signer_id}/documents/search?search=…` with the client's owner
|
|
23
|
+
* credentials instead of a signer access code. The signer must belong to that
|
|
24
|
+
* workspace.
|
|
25
|
+
*/
|
|
26
|
+
searchAsOwner(signerId: string, search: string): Promise<IDocumentListResponse>;
|
|
27
|
+
private listDocuments;
|
|
28
|
+
private searchDocuments;
|
|
20
29
|
/**
|
|
21
30
|
* Public `GET /signers/{signer_id}/documents/{document_id}/download/{artifact}`.
|
|
22
31
|
* 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;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
|
|
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,gEAAgE;IAC1D,IAAI,CACT,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,MAAM,GAAE,yBAA8B,GACpC,OAAO,CAAC,qBAAqB,CAAC,CAGhC;IAED;;;;OAIG;IACG,WAAW,CAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,yBAA8B,GACpC,OAAO,CAAC,qBAAqB,CAAC,CAEhC;IAED,gFAAgF;IAC1E,MAAM,CACX,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,MAAM,GACtB,OAAO,CAAC,qBAAqB,CAAC,CAGhC;IAED;;;;OAIG;IACG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAEpF;IAED,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,eAAe;IAOvB;;;;OAIG;IACG,QAAQ,CACb,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,oBAAoB,EAClC,gBAAgB,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,M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AC,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"}
|
package/docs/sdk-reference.md
CHANGED
|
@@ -224,13 +224,15 @@ Create payload: `{ full_name: string; email?; whatsapp_phone_number?; phone?; cp
|
|
|
224
224
|
|
|
225
225
|
## Signer-side flows (`client.signerDocuments`)
|
|
226
226
|
|
|
227
|
-
These methods use the private `signer-access-code`, not the workspace API key, except for the artifact download that the API publishes as a public route. `
|
|
227
|
+
These methods use the private `signer-access-code`, not the workspace API key, except for the artifact download that the API publishes as a public route. `listAsOwner` and `searchAsOwner` call the same routes with the client's API key or bearer token instead; the signer must belong to that workspace. For email or WhatsApp verification, obtain the access code from the verification link and the OTP from the same message. An invitation containing only a document ID and recipient is not an access code. Call `self` and `getAssignment` to confirm the signer and document before submitting a decision; keep each document's verification credentials together.
|
|
228
228
|
|
|
229
229
|
| SDK method | HTTP operation | Resolves to |
|
|
230
230
|
| --- | --- | --- |
|
|
231
231
|
| `getCurrent(signerId, accessCode)` | [`GET /signers/{signerId}/document`](./api-reference.md#get-signers-document) | `IDocumentDetailsResponse` |
|
|
232
|
-
| `list(signerId, accessCode
|
|
233
|
-
| `
|
|
232
|
+
| `list(signerId, accessCode, params?)` | [`GET /signers/{signerId}/documents`](./api-reference.md#list-signers-documents) | `IDocumentListResponse` |
|
|
233
|
+
| `listAsOwner(signerId, params?)` | [`GET /signers/{signerId}/documents`](./api-reference.md#list-signers-documents) with owner credentials | `IDocumentListResponse` |
|
|
234
|
+
| `search(signerId, search, accessCode)` | [`GET /signers/{signerId}/documents/search`](./api-reference.md#search-signers-documents) | `IDocumentListResponse` |
|
|
235
|
+
| `searchAsOwner(signerId, search)` | [`GET /signers/{signerId}/documents/search`](./api-reference.md#search-signers-documents) with owner credentials | `IDocumentListResponse` |
|
|
234
236
|
| `download(signerId, documentId, artifact, accessCode?)` | [`GET /signers/{signerId}/documents/{documentId}/download/{artifact}`](./api-reference.md#download-signers-document-artifact) | `Buffer` |
|
|
235
237
|
| `signMultiple(documentIds, accessCode)` | [`PUT /signers/documents/sign-multiple`](./api-reference.md#sign-multiple-documents) | `unknown[]` |
|
|
236
238
|
| `declineMultiple(documentIds, reason, accessCode)` | [`PUT /signers/documents/decline-multiple`](./api-reference.md#decline-multiple-documents) | `unknown[]` |
|