@assinafy/cli 2.5.1 → 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.js CHANGED
@@ -1449,32 +1449,46 @@ var SignerDocumentsResource = class extends BaseResource {
1449
1449
  () => this.http.get(`/signers/${sid}/document`, signerAccessConfig(code))
1450
1450
  );
1451
1451
  }
1452
+ /** `GET /signers/{signer_id}/documents?signer-access-code=…` */
1453
+ async list(signerId, signerAccessCode, params = {}) {
1454
+ const code = this.requireId(signerAccessCode, "signer-access-code");
1455
+ return this.listDocuments(signerId, signerAccessConfig(code, { ...params }));
1456
+ }
1452
1457
  /**
1453
- * `GET /signers/{signer_id}/documents` — with a signer access code, or with
1454
- * the client's owner credentials when the code is omitted (the signer must
1455
- * belong to that workspace).
1458
+ * `GET /signers/{signer_id}/documents` with the client's owner credentials
1459
+ * (API key or token) instead of a signer access code. The signer must belong
1460
+ * to that workspace.
1456
1461
  */
1457
- async list(signerId, signerAccessCode, params = {}) {
1462
+ async listAsOwner(signerId, params = {}) {
1463
+ return this.listDocuments(signerId, { params: cleanParams({ ...params }) });
1464
+ }
1465
+ /** `GET /signers/{signer_id}/documents/search?search=…&signer-access-code=…` */
1466
+ async search(signerId, search, signerAccessCode) {
1467
+ const code = this.requireId(signerAccessCode, "signer-access-code");
1468
+ return this.searchDocuments(signerId, signerAccessConfig(code, { search }));
1469
+ }
1470
+ /**
1471
+ * `GET /signers/{signer_id}/documents/search?search=…` with the client's owner
1472
+ * credentials instead of a signer access code. The signer must belong to that
1473
+ * workspace.
1474
+ */
1475
+ async searchAsOwner(signerId, search) {
1476
+ return this.searchDocuments(signerId, { params: cleanParams({ search }) });
1477
+ }
1478
+ listDocuments(signerId, config) {
1458
1479
  const sid = this.requireId(signerId, "Signer ID");
1459
- const config = this.signerOrOwnerConfig(signerAccessCode, { ...params });
1460
1480
  return this.callList(
1461
1481
  "Failed to list signer documents",
1462
1482
  () => this.http.get(`/signers/${sid}/documents`, config)
1463
1483
  );
1464
1484
  }
1465
- /** `GET /signers/{signer_id}/documents/search?search=…` — access code or owner credentials. */
1466
- async search(signerId, search, signerAccessCode) {
1485
+ searchDocuments(signerId, config) {
1467
1486
  const sid = this.requireId(signerId, "Signer ID");
1468
- const config = this.signerOrOwnerConfig(signerAccessCode, { search });
1469
1487
  return this.callList(
1470
1488
  "Failed to search signer documents",
1471
1489
  () => this.http.get(`/signers/${sid}/documents/search`, config)
1472
1490
  );
1473
1491
  }
1474
- signerOrOwnerConfig(signerAccessCode, params) {
1475
- if (signerAccessCode === void 0) return { params: cleanParams(params) };
1476
- return signerAccessConfig(this.requireId(signerAccessCode, "signer-access-code"), params);
1477
- }
1478
1492
  /**
1479
1493
  * Public `GET /signers/{signer_id}/documents/{document_id}/download/{artifact}`.
1480
1494
  * When an access code is supplied, the SDK first verifies that it belongs to