@assinafy/sdk 3.0.1 → 3.0.2
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/CHANGELOG.md +15 -1
- package/dist/index.d.mts +22 -12
- package/dist/index.d.ts +22 -12
- package/dist/index.js +21 -14
- package/dist/index.mjs +21 -14
- package/docs/COMPATIBILITY.md +7 -0
- package/docs/README.en.md +4 -3
- package/docs/README.md +4 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [3.0.2] - 2026-11-12
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- `contracts.set()` accepts `auto_renew: null`, as the API does: a contract
|
|
15
|
+
resets auto-renewal to `false`, and a pending amendment drops it from its
|
|
16
|
+
terms. `IDocumentContractInput.auto_renew` is `boolean | null`.
|
|
17
|
+
- `assignments.estimateCost()` and `documents.estimateCostFromTemplate()` send
|
|
18
|
+
each signer's `step`, which the API reads to keep every `DigitalCertificate`
|
|
19
|
+
signer alone in its step, so estimates with several certificate signers in
|
|
20
|
+
their own steps succeed. Assignment estimates check the signing order as
|
|
21
|
+
creation does. `IAssignmentCostSigner` and `ITemplateCostSigner` accept `step`.
|
|
22
|
+
|
|
10
23
|
## [3.0.1] - 2026-11-11
|
|
11
24
|
|
|
12
25
|
### Fixed
|
|
@@ -1026,7 +1039,8 @@ signer fields with `cpf` and `whatsapp_phone_number`.
|
|
|
1026
1039
|
- High-level `uploadAndRequestSignatures` helper on `AssinafyClient`.
|
|
1027
1040
|
- `PaginatedResult<T>` with parsed `X-Pagination-*` header meta.
|
|
1028
1041
|
|
|
1029
|
-
[Unreleased]: https://github.com/assinafy/typescript-sdk/compare/v3.0.
|
|
1042
|
+
[Unreleased]: https://github.com/assinafy/typescript-sdk/compare/v3.0.2...HEAD
|
|
1043
|
+
[3.0.2]: https://github.com/assinafy/typescript-sdk/compare/v3.0.1...v3.0.2
|
|
1030
1044
|
[3.0.1]: https://github.com/assinafy/typescript-sdk/compare/v3.0.0...v3.0.1
|
|
1031
1045
|
[3.0.0]: https://github.com/assinafy/typescript-sdk/compare/v2.11.0...v3.0.0
|
|
1032
1046
|
[2.11.0]: https://github.com/assinafy/typescript-sdk/compare/v2.10.0...v2.11.0
|
package/dist/index.d.mts
CHANGED
|
@@ -400,6 +400,8 @@ interface IAssignmentEntry {
|
|
|
400
400
|
interface IAssignmentCostSigner {
|
|
401
401
|
verification_method?: AssignmentVerificationMethod;
|
|
402
402
|
notification_methods?: AssignmentNotificationMethod[];
|
|
403
|
+
/** The signer's signing step at creation; each `DigitalCertificate` signer needs its own. */
|
|
404
|
+
step?: number;
|
|
403
405
|
}
|
|
404
406
|
/**
|
|
405
407
|
* Official request body for
|
|
@@ -679,7 +681,8 @@ interface IDocumentContractInput {
|
|
|
679
681
|
currency?: string | null;
|
|
680
682
|
start_date?: string | null;
|
|
681
683
|
end_date?: string | null;
|
|
682
|
-
|
|
684
|
+
/** Null resets auto-renewal to false, or drops it from a pending amendment's terms. */
|
|
685
|
+
auto_renew?: boolean | null;
|
|
683
686
|
renewal_term_months?: number | null;
|
|
684
687
|
notice_period_days?: number | null;
|
|
685
688
|
owner_id?: string | null;
|
|
@@ -1262,13 +1265,15 @@ interface ITemplateSigner {
|
|
|
1262
1265
|
step?: number;
|
|
1263
1266
|
}
|
|
1264
1267
|
/**
|
|
1265
|
-
* Role/channel descriptor used only for template cost estimation.
|
|
1266
|
-
*
|
|
1268
|
+
* Role/channel descriptor used only for template cost estimation. It carries no
|
|
1269
|
+
* signer identity; `step` is the role's signing step at creation, which the API
|
|
1270
|
+
* reads to keep each `DigitalCertificate` signer alone in its step.
|
|
1267
1271
|
*/
|
|
1268
1272
|
interface ITemplateCostSigner {
|
|
1269
1273
|
role_id: string;
|
|
1270
1274
|
verification_method?: AssignmentVerificationMethod;
|
|
1271
1275
|
notification_methods?: AssignmentNotificationMethod[];
|
|
1276
|
+
step?: number;
|
|
1272
1277
|
}
|
|
1273
1278
|
/** Options for creating a document from a template. */
|
|
1274
1279
|
interface ICreateDocumentFromTemplateOptions {
|
|
@@ -2843,9 +2848,10 @@ declare class DocumentResource extends BaseResource {
|
|
|
2843
2848
|
*
|
|
2844
2849
|
* @param templateId - The template that would be instantiated.
|
|
2845
2850
|
* @param signers - One channel descriptor per template role. Cost requests
|
|
2846
|
-
* use
|
|
2847
|
-
*
|
|
2848
|
-
*
|
|
2851
|
+
* use `role_id`, `verification_method`, `notification_methods`, and the
|
|
2852
|
+
* role's creation `step`, which the API reads to keep each
|
|
2853
|
+
* `DigitalCertificate` signer alone in its step; they send no signer ID,
|
|
2854
|
+
* and editor roles are ignored by the cost calculation.
|
|
2849
2855
|
* @param accountId - Override the client's default account ID.
|
|
2850
2856
|
* @returns An {@link ICostEstimate}: `total_credits`, balances, and a
|
|
2851
2857
|
* per-line `breakdown` of what the operation would consume:
|
|
@@ -4043,9 +4049,10 @@ declare class AssignmentResource extends BaseResource {
|
|
|
4043
4049
|
* ```
|
|
4044
4050
|
*
|
|
4045
4051
|
* @param documentId - The document the assignment would be created on.
|
|
4046
|
-
* @param payload - `method` plus channel
|
|
4047
|
-
* `collect`-mode `entries`.
|
|
4048
|
-
*
|
|
4052
|
+
* @param payload - `method` plus signer channel descriptors and/or
|
|
4053
|
+
* `collect`-mode `entries`. Signer IDs are not part of this request. Send
|
|
4054
|
+
* each signer's creation `step` too: the API keeps every
|
|
4055
|
+
* `DigitalCertificate` signer alone in its step when it estimates.
|
|
4049
4056
|
* @returns an {@link ICostEstimate} with `total_credits`, balances, a
|
|
4050
4057
|
* line-item `breakdown`, and a `has_sufficient_resources` gate.
|
|
4051
4058
|
* `blocking_reason` may be `PendingPayment`, `InsufficientDocuments`, or
|
|
@@ -4067,7 +4074,8 @@ declare class AssignmentResource extends BaseResource {
|
|
|
4067
4074
|
* ```
|
|
4068
4075
|
* @throws {ValidationError} If `documentId` is missing, a `virtual` request
|
|
4069
4076
|
* has no signer entry, or a `collect` request has no signer entry or no
|
|
4070
|
-
* field-placement entry,
|
|
4077
|
+
* field-placement entry, the signing order is invalid, or the request
|
|
4078
|
+
* combines `DigitalCertificate` with `collect`.
|
|
4071
4079
|
* The last case has `errors.code ===
|
|
4072
4080
|
* 'digital_certificate_requires_virtual_method'`.
|
|
4073
4081
|
* @throws {ApiError} If the API rejects the request.
|
|
@@ -8168,7 +8176,8 @@ declare class ContractResource extends BaseResource {
|
|
|
8168
8176
|
* @param payload.currency - Three-letter currency; null resets as documented.
|
|
8169
8177
|
* @param payload.start_date - Start date (`YYYY-MM-DD`), or null.
|
|
8170
8178
|
* @param payload.end_date - End date (`YYYY-MM-DD`), or null.
|
|
8171
|
-
* @param payload.auto_renew - Whether the hourly lifecycle starts a new term
|
|
8179
|
+
* @param payload.auto_renew - Whether the hourly lifecycle starts a new term;
|
|
8180
|
+
* null resets it to false, or drops it from a pending amendment's terms.
|
|
8172
8181
|
* @param payload.renewal_term_months - 1–600 months, or null for the default.
|
|
8173
8182
|
* @param payload.notice_period_days - 0–3650 days, or null to disable notice.
|
|
8174
8183
|
* @param payload.owner_id - Active workspace member ID, or null.
|
|
@@ -9573,4 +9582,5 @@ declare const MAX_LIST_PAGE_SIZE = 50;
|
|
|
9573
9582
|
|
|
9574
9583
|
declare const SDK_USER_AGENT: string;
|
|
9575
9584
|
|
|
9576
|
-
export {
|
|
9585
|
+
export { ApiError, AssignmentResource, AssinafyClient, AssinafyError, AuthenticationResource, ContractResource, DEFAULT_WEBHOOK_EVENTS, DIGITAL_CERTIFICATE_REQUIRES_VIRTUAL_METHOD, DocumentResource, EmbedResource, EnvelopeResource, FieldsResource, MAX_LIST_PAGE_SIZE, MAX_UPLOAD_BYTES, NetworkError, OAuthError, OAuthResource, SDK_USER_AGENT, SignerDocumentsResource, SignerResource, TagResource, TemplateResource, UserResource, ValidationError, WebhookResource, WebhookVerifier, WorkspaceResource, buildAssignmentPayload, parseWwwAuthenticate };
|
|
9586
|
+
export type { AccountLogoUploadSource, AnyString, AssignmentDisplaySettings, AssignmentMethod, AssignmentNotificationMethod, AssignmentVerificationMethod, AssinafyClientOptions, ClientConfigInput, DocumentArtifactName, DocumentContractRelationType, DocumentContractStatus, DocumentStatsGranularity, DocumentStatus, DocumentUploadSource, IAcceptTermsResult, IAccountLimits, IAccountSigningFeatures, IAccountTheme, IAccountUsage, IAccountUsageBalance, IAddEnvelopeDocumentPayload, IApiFieldError, IApiKeyResponse, IAssignment, IAssignmentCostSigner, IAssignmentEntry, IAssignmentItem, IAssignmentListParams, IAssignmentListResponse, IAssignmentSigner, IAuthenticateChallenge, IAuthenticatedUser, ICertifiedCopyResendResult, IConfirmSignerDataPayload, IConfirmTotpPayload, ICostEstimate, ICreateAssignmentPayload, ICreateAssignmentResponse, ICreateDocumentFromTemplateOptions, ICreateEnvelopePayload, ICreateFieldPayload, ICreateSignerPayload, ICreateSignerResponse, ICreateTagPayload, ICreateWorkspacePayload, IDeleteTagResponse, IDetachDocumentTagResponse, IDisplaySettings, IDocumentActivity, IDocumentContract, IDocumentContractAmendment, IDocumentContractExternalReference, IDocumentContractInput, IDocumentContractListParams, IDocumentContractListResponse, IDocumentDetailsOptions, IDocumentDetailsResponse, IDocumentEnvelopeRef, IDocumentListItem, IDocumentListParams, IDocumentListResponse, IDocumentRenderOptions, IDocumentSearchParams, IDocumentStatsParams, IDocumentStatsRow, IDocumentStatusInfo, IDocumentUploadOptions, IDocumentUploadResponse, IDocumentVerification, IEmbedOrigin, IEmbedSession, IEnvelope, IEnvelopeActivity, IEnvelopeCancelResult, IEnvelopeDocument, IEnvelopeDocumentInput, IEnvelopeDocumentSigner, IEnvelopeListParams, IEnvelopeListResponse, IEnvelopeResendResponse, IEnvelopeSignerInput, IEstimateAssignmentCostPayload, IFieldDefinition, IFieldType, IFieldValidateMultipleEntry, IFieldValidationMultipleResult, IFieldValidationResponse, IFieldValidationResult, IInlineTag, ILegacyConfirmSignerDataPayload, ILegacyResendCostEstimate, ILegacyUploadSignatureOptions, IListParams, ILoginResponse, IMaskedApiKeyResponse, IMfaMethod, IMfaReauth, IMfaRecoveryCodes, IMfaStatus, INotificationHistoryEntry, INotificationPolicy, INotificationPreferences, IOAuthAuthorizationCallback, IOAuthAuthorizationRequest, IOAuthAuthorizationServerMetadata, IOAuthProtectedResourceMetadata, IOAuthTokenResponse, IOAuthUserInfo, IPage, IPaginatedResponse, IPublicDocumentInfo, IPushPreferences, IRateLimitInfo, IRenameDocumentResponse, IRenewDocumentContractPayload, IResendCostEstimate, IResendEmailResponse, IReviewIdentityVerificationPayload, ISendTokenResult, ISignFieldEntry, ISigner, ISignerCertifiedCopyStatus, ISignerDocumentListParams, ISignerIdentityReview, ISignerIdentityVerification, ISignerIdentityVerificationSession, ISignerListParams, ISignerListResponse, ISignerSelf, ISigningCurrentSigner, ISigningDocument, ISigningProgress, ISigningReadOptions, ISigningUrl, IStartIdentityVerificationPayload, ITag, ITemplateCostSigner, ITemplateDetailsResponse, ITemplateFieldPlacement, ITemplateListItem, ITemplateListParams, ITemplateListResponse, ITemplateRole, ITemplateSigner, ITerminateDocumentContractPayload, ITotpEnrollment, IUpdateEnvelopePayload, IUpdateFieldPayload, IUpdateNotificationPolicyPayload, IUpdateNotificationPreferences, IUpdatePushPreferences, IUpdateSignerPayload, IUpdateTagPayload, IUpdateTemplatePayload, IUpdateWorkspacePayload, IUploadAndRequestSignaturesResult, IUploadAndRequestSignaturesSigner, IUploadSignatureOptions, IWebhookDispatch, IWebhookDispatchListParams, IWebhookEndpoint, IWebhookEndpointCreatePayload, IWebhookEndpointCreateResponse, IWebhookEndpointSecret, IWebhookEndpointSecretRotation, IWebhookEndpointUpdatePayload, IWebhookEventTypeInfo, IWebhookPayload, IWebhookRegisterPayload, IWebhookSubscription, IWhatsAppNotification, IWorkspaceListItem, IWorkspaceListResponse, IWorkspaceResponse, IdentityVerificationImageName, IdentityVerificationStatus, Logger, NotificationPolicyEvent, NotificationSenderType, OAuthScope, PaginatedResult, PaginationMeta, PushPreferenceEvent, SendTokenChannel, SignatureImageType, SignerReference, WebhookDeliveryEventType, WebhookEventType, WebhookHeaders };
|
package/dist/index.d.ts
CHANGED
|
@@ -400,6 +400,8 @@ interface IAssignmentEntry {
|
|
|
400
400
|
interface IAssignmentCostSigner {
|
|
401
401
|
verification_method?: AssignmentVerificationMethod;
|
|
402
402
|
notification_methods?: AssignmentNotificationMethod[];
|
|
403
|
+
/** The signer's signing step at creation; each `DigitalCertificate` signer needs its own. */
|
|
404
|
+
step?: number;
|
|
403
405
|
}
|
|
404
406
|
/**
|
|
405
407
|
* Official request body for
|
|
@@ -679,7 +681,8 @@ interface IDocumentContractInput {
|
|
|
679
681
|
currency?: string | null;
|
|
680
682
|
start_date?: string | null;
|
|
681
683
|
end_date?: string | null;
|
|
682
|
-
|
|
684
|
+
/** Null resets auto-renewal to false, or drops it from a pending amendment's terms. */
|
|
685
|
+
auto_renew?: boolean | null;
|
|
683
686
|
renewal_term_months?: number | null;
|
|
684
687
|
notice_period_days?: number | null;
|
|
685
688
|
owner_id?: string | null;
|
|
@@ -1262,13 +1265,15 @@ interface ITemplateSigner {
|
|
|
1262
1265
|
step?: number;
|
|
1263
1266
|
}
|
|
1264
1267
|
/**
|
|
1265
|
-
* Role/channel descriptor used only for template cost estimation.
|
|
1266
|
-
*
|
|
1268
|
+
* Role/channel descriptor used only for template cost estimation. It carries no
|
|
1269
|
+
* signer identity; `step` is the role's signing step at creation, which the API
|
|
1270
|
+
* reads to keep each `DigitalCertificate` signer alone in its step.
|
|
1267
1271
|
*/
|
|
1268
1272
|
interface ITemplateCostSigner {
|
|
1269
1273
|
role_id: string;
|
|
1270
1274
|
verification_method?: AssignmentVerificationMethod;
|
|
1271
1275
|
notification_methods?: AssignmentNotificationMethod[];
|
|
1276
|
+
step?: number;
|
|
1272
1277
|
}
|
|
1273
1278
|
/** Options for creating a document from a template. */
|
|
1274
1279
|
interface ICreateDocumentFromTemplateOptions {
|
|
@@ -2843,9 +2848,10 @@ declare class DocumentResource extends BaseResource {
|
|
|
2843
2848
|
*
|
|
2844
2849
|
* @param templateId - The template that would be instantiated.
|
|
2845
2850
|
* @param signers - One channel descriptor per template role. Cost requests
|
|
2846
|
-
* use
|
|
2847
|
-
*
|
|
2848
|
-
*
|
|
2851
|
+
* use `role_id`, `verification_method`, `notification_methods`, and the
|
|
2852
|
+
* role's creation `step`, which the API reads to keep each
|
|
2853
|
+
* `DigitalCertificate` signer alone in its step; they send no signer ID,
|
|
2854
|
+
* and editor roles are ignored by the cost calculation.
|
|
2849
2855
|
* @param accountId - Override the client's default account ID.
|
|
2850
2856
|
* @returns An {@link ICostEstimate}: `total_credits`, balances, and a
|
|
2851
2857
|
* per-line `breakdown` of what the operation would consume:
|
|
@@ -4043,9 +4049,10 @@ declare class AssignmentResource extends BaseResource {
|
|
|
4043
4049
|
* ```
|
|
4044
4050
|
*
|
|
4045
4051
|
* @param documentId - The document the assignment would be created on.
|
|
4046
|
-
* @param payload - `method` plus channel
|
|
4047
|
-
* `collect`-mode `entries`.
|
|
4048
|
-
*
|
|
4052
|
+
* @param payload - `method` plus signer channel descriptors and/or
|
|
4053
|
+
* `collect`-mode `entries`. Signer IDs are not part of this request. Send
|
|
4054
|
+
* each signer's creation `step` too: the API keeps every
|
|
4055
|
+
* `DigitalCertificate` signer alone in its step when it estimates.
|
|
4049
4056
|
* @returns an {@link ICostEstimate} with `total_credits`, balances, a
|
|
4050
4057
|
* line-item `breakdown`, and a `has_sufficient_resources` gate.
|
|
4051
4058
|
* `blocking_reason` may be `PendingPayment`, `InsufficientDocuments`, or
|
|
@@ -4067,7 +4074,8 @@ declare class AssignmentResource extends BaseResource {
|
|
|
4067
4074
|
* ```
|
|
4068
4075
|
* @throws {ValidationError} If `documentId` is missing, a `virtual` request
|
|
4069
4076
|
* has no signer entry, or a `collect` request has no signer entry or no
|
|
4070
|
-
* field-placement entry,
|
|
4077
|
+
* field-placement entry, the signing order is invalid, or the request
|
|
4078
|
+
* combines `DigitalCertificate` with `collect`.
|
|
4071
4079
|
* The last case has `errors.code ===
|
|
4072
4080
|
* 'digital_certificate_requires_virtual_method'`.
|
|
4073
4081
|
* @throws {ApiError} If the API rejects the request.
|
|
@@ -8168,7 +8176,8 @@ declare class ContractResource extends BaseResource {
|
|
|
8168
8176
|
* @param payload.currency - Three-letter currency; null resets as documented.
|
|
8169
8177
|
* @param payload.start_date - Start date (`YYYY-MM-DD`), or null.
|
|
8170
8178
|
* @param payload.end_date - End date (`YYYY-MM-DD`), or null.
|
|
8171
|
-
* @param payload.auto_renew - Whether the hourly lifecycle starts a new term
|
|
8179
|
+
* @param payload.auto_renew - Whether the hourly lifecycle starts a new term;
|
|
8180
|
+
* null resets it to false, or drops it from a pending amendment's terms.
|
|
8172
8181
|
* @param payload.renewal_term_months - 1–600 months, or null for the default.
|
|
8173
8182
|
* @param payload.notice_period_days - 0–3650 days, or null to disable notice.
|
|
8174
8183
|
* @param payload.owner_id - Active workspace member ID, or null.
|
|
@@ -9573,4 +9582,5 @@ declare const MAX_LIST_PAGE_SIZE = 50;
|
|
|
9573
9582
|
|
|
9574
9583
|
declare const SDK_USER_AGENT: string;
|
|
9575
9584
|
|
|
9576
|
-
export {
|
|
9585
|
+
export { ApiError, AssignmentResource, AssinafyClient, AssinafyError, AuthenticationResource, ContractResource, DEFAULT_WEBHOOK_EVENTS, DIGITAL_CERTIFICATE_REQUIRES_VIRTUAL_METHOD, DocumentResource, EmbedResource, EnvelopeResource, FieldsResource, MAX_LIST_PAGE_SIZE, MAX_UPLOAD_BYTES, NetworkError, OAuthError, OAuthResource, SDK_USER_AGENT, SignerDocumentsResource, SignerResource, TagResource, TemplateResource, UserResource, ValidationError, WebhookResource, WebhookVerifier, WorkspaceResource, buildAssignmentPayload, parseWwwAuthenticate };
|
|
9586
|
+
export type { AccountLogoUploadSource, AnyString, AssignmentDisplaySettings, AssignmentMethod, AssignmentNotificationMethod, AssignmentVerificationMethod, AssinafyClientOptions, ClientConfigInput, DocumentArtifactName, DocumentContractRelationType, DocumentContractStatus, DocumentStatsGranularity, DocumentStatus, DocumentUploadSource, IAcceptTermsResult, IAccountLimits, IAccountSigningFeatures, IAccountTheme, IAccountUsage, IAccountUsageBalance, IAddEnvelopeDocumentPayload, IApiFieldError, IApiKeyResponse, IAssignment, IAssignmentCostSigner, IAssignmentEntry, IAssignmentItem, IAssignmentListParams, IAssignmentListResponse, IAssignmentSigner, IAuthenticateChallenge, IAuthenticatedUser, ICertifiedCopyResendResult, IConfirmSignerDataPayload, IConfirmTotpPayload, ICostEstimate, ICreateAssignmentPayload, ICreateAssignmentResponse, ICreateDocumentFromTemplateOptions, ICreateEnvelopePayload, ICreateFieldPayload, ICreateSignerPayload, ICreateSignerResponse, ICreateTagPayload, ICreateWorkspacePayload, IDeleteTagResponse, IDetachDocumentTagResponse, IDisplaySettings, IDocumentActivity, IDocumentContract, IDocumentContractAmendment, IDocumentContractExternalReference, IDocumentContractInput, IDocumentContractListParams, IDocumentContractListResponse, IDocumentDetailsOptions, IDocumentDetailsResponse, IDocumentEnvelopeRef, IDocumentListItem, IDocumentListParams, IDocumentListResponse, IDocumentRenderOptions, IDocumentSearchParams, IDocumentStatsParams, IDocumentStatsRow, IDocumentStatusInfo, IDocumentUploadOptions, IDocumentUploadResponse, IDocumentVerification, IEmbedOrigin, IEmbedSession, IEnvelope, IEnvelopeActivity, IEnvelopeCancelResult, IEnvelopeDocument, IEnvelopeDocumentInput, IEnvelopeDocumentSigner, IEnvelopeListParams, IEnvelopeListResponse, IEnvelopeResendResponse, IEnvelopeSignerInput, IEstimateAssignmentCostPayload, IFieldDefinition, IFieldType, IFieldValidateMultipleEntry, IFieldValidationMultipleResult, IFieldValidationResponse, IFieldValidationResult, IInlineTag, ILegacyConfirmSignerDataPayload, ILegacyResendCostEstimate, ILegacyUploadSignatureOptions, IListParams, ILoginResponse, IMaskedApiKeyResponse, IMfaMethod, IMfaReauth, IMfaRecoveryCodes, IMfaStatus, INotificationHistoryEntry, INotificationPolicy, INotificationPreferences, IOAuthAuthorizationCallback, IOAuthAuthorizationRequest, IOAuthAuthorizationServerMetadata, IOAuthProtectedResourceMetadata, IOAuthTokenResponse, IOAuthUserInfo, IPage, IPaginatedResponse, IPublicDocumentInfo, IPushPreferences, IRateLimitInfo, IRenameDocumentResponse, IRenewDocumentContractPayload, IResendCostEstimate, IResendEmailResponse, IReviewIdentityVerificationPayload, ISendTokenResult, ISignFieldEntry, ISigner, ISignerCertifiedCopyStatus, ISignerDocumentListParams, ISignerIdentityReview, ISignerIdentityVerification, ISignerIdentityVerificationSession, ISignerListParams, ISignerListResponse, ISignerSelf, ISigningCurrentSigner, ISigningDocument, ISigningProgress, ISigningReadOptions, ISigningUrl, IStartIdentityVerificationPayload, ITag, ITemplateCostSigner, ITemplateDetailsResponse, ITemplateFieldPlacement, ITemplateListItem, ITemplateListParams, ITemplateListResponse, ITemplateRole, ITemplateSigner, ITerminateDocumentContractPayload, ITotpEnrollment, IUpdateEnvelopePayload, IUpdateFieldPayload, IUpdateNotificationPolicyPayload, IUpdateNotificationPreferences, IUpdatePushPreferences, IUpdateSignerPayload, IUpdateTagPayload, IUpdateTemplatePayload, IUpdateWorkspacePayload, IUploadAndRequestSignaturesResult, IUploadAndRequestSignaturesSigner, IUploadSignatureOptions, IWebhookDispatch, IWebhookDispatchListParams, IWebhookEndpoint, IWebhookEndpointCreatePayload, IWebhookEndpointCreateResponse, IWebhookEndpointSecret, IWebhookEndpointSecretRotation, IWebhookEndpointUpdatePayload, IWebhookEventTypeInfo, IWebhookPayload, IWebhookRegisterPayload, IWebhookSubscription, IWhatsAppNotification, IWorkspaceListItem, IWorkspaceListResponse, IWorkspaceResponse, IdentityVerificationImageName, IdentityVerificationStatus, Logger, NotificationPolicyEvent, NotificationSenderType, OAuthScope, PaginatedResult, PaginationMeta, PushPreferenceEvent, SendTokenChannel, SignatureImageType, SignerReference, WebhookDeliveryEventType, WebhookEventType, WebhookHeaders };
|
package/dist/index.js
CHANGED
|
@@ -763,7 +763,7 @@ var import_axios2 = __toESM(require("axios"));
|
|
|
763
763
|
// package.json
|
|
764
764
|
var package_default = {
|
|
765
765
|
name: "@assinafy/sdk",
|
|
766
|
-
version: "3.0.
|
|
766
|
+
version: "3.0.2",
|
|
767
767
|
packageManager: "bun@1.4.4",
|
|
768
768
|
description: "TypeScript SDK for Assinafy API - Digital signature platform",
|
|
769
769
|
type: "commonjs",
|
|
@@ -835,9 +835,9 @@ var package_default = {
|
|
|
835
835
|
"@types/bun": "^1.4.4",
|
|
836
836
|
"@types/node": "^22.20.5",
|
|
837
837
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
838
|
-
eslint: "^10.
|
|
838
|
+
eslint: "^10.14.0",
|
|
839
839
|
publint: "^0.3.25",
|
|
840
|
-
tsup: "^
|
|
840
|
+
tsup: "^9.0.0",
|
|
841
841
|
typescript: "^6.0.3",
|
|
842
842
|
"typescript-eslint": "^8.72.1"
|
|
843
843
|
},
|
|
@@ -1254,6 +1254,7 @@ function buildAssignmentEstimatePayload(payload) {
|
|
|
1254
1254
|
}
|
|
1255
1255
|
const normalisedSigners = signers.map((signer) => normaliseEstimateSigner(signer));
|
|
1256
1256
|
validateDigitalCertificateMethod(method, normalisedSigners);
|
|
1257
|
+
validateSigningOrder(normalisedSigners, "assignment cost signers");
|
|
1257
1258
|
return cleanParams({
|
|
1258
1259
|
method,
|
|
1259
1260
|
signers: normalisedSigners,
|
|
@@ -1298,7 +1299,8 @@ function normaliseEstimateSigner(signer) {
|
|
|
1298
1299
|
validateAssignmentSignerOptions(descriptor);
|
|
1299
1300
|
return cleanParams({
|
|
1300
1301
|
verification_method: descriptor.verification_method,
|
|
1301
|
-
notification_methods: descriptor.notification_methods
|
|
1302
|
+
notification_methods: descriptor.notification_methods,
|
|
1303
|
+
step: descriptor.step
|
|
1302
1304
|
});
|
|
1303
1305
|
}
|
|
1304
1306
|
function normaliseAssignmentEntries(entries) {
|
|
@@ -1675,9 +1677,10 @@ var AssignmentResource = class extends BaseResource {
|
|
|
1675
1677
|
* ```
|
|
1676
1678
|
*
|
|
1677
1679
|
* @param documentId - The document the assignment would be created on.
|
|
1678
|
-
* @param payload - `method` plus channel
|
|
1679
|
-
* `collect`-mode `entries`.
|
|
1680
|
-
*
|
|
1680
|
+
* @param payload - `method` plus signer channel descriptors and/or
|
|
1681
|
+
* `collect`-mode `entries`. Signer IDs are not part of this request. Send
|
|
1682
|
+
* each signer's creation `step` too: the API keeps every
|
|
1683
|
+
* `DigitalCertificate` signer alone in its step when it estimates.
|
|
1681
1684
|
* @returns an {@link ICostEstimate} with `total_credits`, balances, a
|
|
1682
1685
|
* line-item `breakdown`, and a `has_sufficient_resources` gate.
|
|
1683
1686
|
* `blocking_reason` may be `PendingPayment`, `InsufficientDocuments`, or
|
|
@@ -1699,7 +1702,8 @@ var AssignmentResource = class extends BaseResource {
|
|
|
1699
1702
|
* ```
|
|
1700
1703
|
* @throws {ValidationError} If `documentId` is missing, a `virtual` request
|
|
1701
1704
|
* has no signer entry, or a `collect` request has no signer entry or no
|
|
1702
|
-
* field-placement entry,
|
|
1705
|
+
* field-placement entry, the signing order is invalid, or the request
|
|
1706
|
+
* combines `DigitalCertificate` with `collect`.
|
|
1703
1707
|
* The last case has `errors.code ===
|
|
1704
1708
|
* 'digital_certificate_requires_virtual_method'`.
|
|
1705
1709
|
* @throws {ApiError} If the API rejects the request.
|
|
@@ -3087,9 +3091,10 @@ var DocumentResource = class extends BaseResource {
|
|
|
3087
3091
|
*
|
|
3088
3092
|
* @param templateId - The template that would be instantiated.
|
|
3089
3093
|
* @param signers - One channel descriptor per template role. Cost requests
|
|
3090
|
-
* use
|
|
3091
|
-
*
|
|
3092
|
-
*
|
|
3094
|
+
* use `role_id`, `verification_method`, `notification_methods`, and the
|
|
3095
|
+
* role's creation `step`, which the API reads to keep each
|
|
3096
|
+
* `DigitalCertificate` signer alone in its step; they send no signer ID,
|
|
3097
|
+
* and editor roles are ignored by the cost calculation.
|
|
3093
3098
|
* @param accountId - Override the client's default account ID.
|
|
3094
3099
|
* @returns An {@link ICostEstimate}: `total_credits`, balances, and a
|
|
3095
3100
|
* per-line `breakdown` of what the operation would consume:
|
|
@@ -3478,6 +3483,7 @@ function normaliseTemplateCostSigners(signers) {
|
|
|
3478
3483
|
if (signer.notification_methods !== void 0) {
|
|
3479
3484
|
descriptor.notification_methods = signer.notification_methods;
|
|
3480
3485
|
}
|
|
3486
|
+
if (signer.step !== void 0) descriptor.step = signer.step;
|
|
3481
3487
|
return descriptor;
|
|
3482
3488
|
});
|
|
3483
3489
|
return normalised;
|
|
@@ -9313,7 +9319,8 @@ var ContractResource = class extends BaseResource {
|
|
|
9313
9319
|
* @param payload.currency - Three-letter currency; null resets as documented.
|
|
9314
9320
|
* @param payload.start_date - Start date (`YYYY-MM-DD`), or null.
|
|
9315
9321
|
* @param payload.end_date - End date (`YYYY-MM-DD`), or null.
|
|
9316
|
-
* @param payload.auto_renew - Whether the hourly lifecycle starts a new term
|
|
9322
|
+
* @param payload.auto_renew - Whether the hourly lifecycle starts a new term;
|
|
9323
|
+
* null resets it to false, or drops it from a pending amendment's terms.
|
|
9317
9324
|
* @param payload.renewal_term_months - 1–600 months, or null for the default.
|
|
9318
9325
|
* @param payload.notice_period_days - 0–3650 days, or null to disable notice.
|
|
9319
9326
|
* @param payload.owner_id - Active workspace member ID, or null.
|
|
@@ -9618,8 +9625,8 @@ function buildContractInput(payload) {
|
|
|
9618
9625
|
if (typeof payload.start_date === "string" && typeof payload.end_date === "string" && payload.end_date < payload.start_date) {
|
|
9619
9626
|
throw new ValidationError("end_date must be on or after start_date");
|
|
9620
9627
|
}
|
|
9621
|
-
if (payload.auto_renew !== void 0 && typeof payload.auto_renew !== "boolean") {
|
|
9622
|
-
throw new ValidationError("auto_renew must be a boolean");
|
|
9628
|
+
if (payload.auto_renew !== void 0 && payload.auto_renew !== null && typeof payload.auto_renew !== "boolean") {
|
|
9629
|
+
throw new ValidationError("auto_renew must be a boolean or null");
|
|
9623
9630
|
}
|
|
9624
9631
|
validateNullableInteger(payload.renewal_term_months, "renewal_term_months", 1, 600);
|
|
9625
9632
|
validateNullableInteger(payload.notice_period_days, "notice_period_days", 0, 3650);
|
package/dist/index.mjs
CHANGED
|
@@ -699,7 +699,7 @@ import axios2 from "axios";
|
|
|
699
699
|
// package.json
|
|
700
700
|
var package_default = {
|
|
701
701
|
name: "@assinafy/sdk",
|
|
702
|
-
version: "3.0.
|
|
702
|
+
version: "3.0.2",
|
|
703
703
|
packageManager: "bun@1.4.4",
|
|
704
704
|
description: "TypeScript SDK for Assinafy API - Digital signature platform",
|
|
705
705
|
type: "commonjs",
|
|
@@ -771,9 +771,9 @@ var package_default = {
|
|
|
771
771
|
"@types/bun": "^1.4.4",
|
|
772
772
|
"@types/node": "^22.20.5",
|
|
773
773
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
774
|
-
eslint: "^10.
|
|
774
|
+
eslint: "^10.14.0",
|
|
775
775
|
publint: "^0.3.25",
|
|
776
|
-
tsup: "^
|
|
776
|
+
tsup: "^9.0.0",
|
|
777
777
|
typescript: "^6.0.3",
|
|
778
778
|
"typescript-eslint": "^8.72.1"
|
|
779
779
|
},
|
|
@@ -1190,6 +1190,7 @@ function buildAssignmentEstimatePayload(payload) {
|
|
|
1190
1190
|
}
|
|
1191
1191
|
const normalisedSigners = signers.map((signer) => normaliseEstimateSigner(signer));
|
|
1192
1192
|
validateDigitalCertificateMethod(method, normalisedSigners);
|
|
1193
|
+
validateSigningOrder(normalisedSigners, "assignment cost signers");
|
|
1193
1194
|
return cleanParams({
|
|
1194
1195
|
method,
|
|
1195
1196
|
signers: normalisedSigners,
|
|
@@ -1234,7 +1235,8 @@ function normaliseEstimateSigner(signer) {
|
|
|
1234
1235
|
validateAssignmentSignerOptions(descriptor);
|
|
1235
1236
|
return cleanParams({
|
|
1236
1237
|
verification_method: descriptor.verification_method,
|
|
1237
|
-
notification_methods: descriptor.notification_methods
|
|
1238
|
+
notification_methods: descriptor.notification_methods,
|
|
1239
|
+
step: descriptor.step
|
|
1238
1240
|
});
|
|
1239
1241
|
}
|
|
1240
1242
|
function normaliseAssignmentEntries(entries) {
|
|
@@ -1611,9 +1613,10 @@ var AssignmentResource = class extends BaseResource {
|
|
|
1611
1613
|
* ```
|
|
1612
1614
|
*
|
|
1613
1615
|
* @param documentId - The document the assignment would be created on.
|
|
1614
|
-
* @param payload - `method` plus channel
|
|
1615
|
-
* `collect`-mode `entries`.
|
|
1616
|
-
*
|
|
1616
|
+
* @param payload - `method` plus signer channel descriptors and/or
|
|
1617
|
+
* `collect`-mode `entries`. Signer IDs are not part of this request. Send
|
|
1618
|
+
* each signer's creation `step` too: the API keeps every
|
|
1619
|
+
* `DigitalCertificate` signer alone in its step when it estimates.
|
|
1617
1620
|
* @returns an {@link ICostEstimate} with `total_credits`, balances, a
|
|
1618
1621
|
* line-item `breakdown`, and a `has_sufficient_resources` gate.
|
|
1619
1622
|
* `blocking_reason` may be `PendingPayment`, `InsufficientDocuments`, or
|
|
@@ -1635,7 +1638,8 @@ var AssignmentResource = class extends BaseResource {
|
|
|
1635
1638
|
* ```
|
|
1636
1639
|
* @throws {ValidationError} If `documentId` is missing, a `virtual` request
|
|
1637
1640
|
* has no signer entry, or a `collect` request has no signer entry or no
|
|
1638
|
-
* field-placement entry,
|
|
1641
|
+
* field-placement entry, the signing order is invalid, or the request
|
|
1642
|
+
* combines `DigitalCertificate` with `collect`.
|
|
1639
1643
|
* The last case has `errors.code ===
|
|
1640
1644
|
* 'digital_certificate_requires_virtual_method'`.
|
|
1641
1645
|
* @throws {ApiError} If the API rejects the request.
|
|
@@ -3023,9 +3027,10 @@ var DocumentResource = class extends BaseResource {
|
|
|
3023
3027
|
*
|
|
3024
3028
|
* @param templateId - The template that would be instantiated.
|
|
3025
3029
|
* @param signers - One channel descriptor per template role. Cost requests
|
|
3026
|
-
* use
|
|
3027
|
-
*
|
|
3028
|
-
*
|
|
3030
|
+
* use `role_id`, `verification_method`, `notification_methods`, and the
|
|
3031
|
+
* role's creation `step`, which the API reads to keep each
|
|
3032
|
+
* `DigitalCertificate` signer alone in its step; they send no signer ID,
|
|
3033
|
+
* and editor roles are ignored by the cost calculation.
|
|
3029
3034
|
* @param accountId - Override the client's default account ID.
|
|
3030
3035
|
* @returns An {@link ICostEstimate}: `total_credits`, balances, and a
|
|
3031
3036
|
* per-line `breakdown` of what the operation would consume:
|
|
@@ -3414,6 +3419,7 @@ function normaliseTemplateCostSigners(signers) {
|
|
|
3414
3419
|
if (signer.notification_methods !== void 0) {
|
|
3415
3420
|
descriptor.notification_methods = signer.notification_methods;
|
|
3416
3421
|
}
|
|
3422
|
+
if (signer.step !== void 0) descriptor.step = signer.step;
|
|
3417
3423
|
return descriptor;
|
|
3418
3424
|
});
|
|
3419
3425
|
return normalised;
|
|
@@ -9249,7 +9255,8 @@ var ContractResource = class extends BaseResource {
|
|
|
9249
9255
|
* @param payload.currency - Three-letter currency; null resets as documented.
|
|
9250
9256
|
* @param payload.start_date - Start date (`YYYY-MM-DD`), or null.
|
|
9251
9257
|
* @param payload.end_date - End date (`YYYY-MM-DD`), or null.
|
|
9252
|
-
* @param payload.auto_renew - Whether the hourly lifecycle starts a new term
|
|
9258
|
+
* @param payload.auto_renew - Whether the hourly lifecycle starts a new term;
|
|
9259
|
+
* null resets it to false, or drops it from a pending amendment's terms.
|
|
9253
9260
|
* @param payload.renewal_term_months - 1–600 months, or null for the default.
|
|
9254
9261
|
* @param payload.notice_period_days - 0–3650 days, or null to disable notice.
|
|
9255
9262
|
* @param payload.owner_id - Active workspace member ID, or null.
|
|
@@ -9554,8 +9561,8 @@ function buildContractInput(payload) {
|
|
|
9554
9561
|
if (typeof payload.start_date === "string" && typeof payload.end_date === "string" && payload.end_date < payload.start_date) {
|
|
9555
9562
|
throw new ValidationError("end_date must be on or after start_date");
|
|
9556
9563
|
}
|
|
9557
|
-
if (payload.auto_renew !== void 0 && typeof payload.auto_renew !== "boolean") {
|
|
9558
|
-
throw new ValidationError("auto_renew must be a boolean");
|
|
9564
|
+
if (payload.auto_renew !== void 0 && payload.auto_renew !== null && typeof payload.auto_renew !== "boolean") {
|
|
9565
|
+
throw new ValidationError("auto_renew must be a boolean or null");
|
|
9559
9566
|
}
|
|
9560
9567
|
validateNullableInteger(payload.renewal_term_months, "renewal_term_months", 1, 600);
|
|
9561
9568
|
validateNullableInteger(payload.notice_period_days, "notice_period_days", 0, 3650);
|
package/docs/COMPATIBILITY.md
CHANGED
|
@@ -391,6 +391,13 @@ certificate/`collect` combination before assignment creation or cost
|
|
|
391
391
|
estimation with `ValidationError.errors.code` set to
|
|
392
392
|
`digital_certificate_requires_virtual_method`.
|
|
393
393
|
|
|
394
|
+
Both cost estimates apply the one-certificate-signer-per-step rule too, and
|
|
395
|
+
the API reads each signer's `step` there although the published estimate
|
|
396
|
+
schemas omit it; signers without a `step` share one step. The SDK forwards
|
|
397
|
+
`step` on assignment and template estimates, so send the creation steps when
|
|
398
|
+
estimating. Assignment estimates check the signing order locally, as creation
|
|
399
|
+
does.
|
|
400
|
+
|
|
394
401
|
Template role IDs do not reveal which entries are signers, editors or copy
|
|
395
402
|
receivers. The SDK validates each entry's channel and positive `step`, then
|
|
396
403
|
lets the API enforce role-aware signing order. The server derives the method:
|
package/docs/README.en.md
CHANGED
|
@@ -1097,8 +1097,9 @@ forward them outside the signing flow.
|
|
|
1097
1097
|
|
|
1098
1098
|
`DigitalCertificate` requires `method: 'virtual'`, the account feature, a CPF
|
|
1099
1099
|
or CNPJ in the signer's `government_id`, and exactly one certificate signer in
|
|
1100
|
-
that signing step.
|
|
1101
|
-
|
|
1100
|
+
that signing step. Estimates take the same `step` as creation: with two or
|
|
1101
|
+
more certificate signers, give each its own step in both calls. It costs 0.5
|
|
1102
|
+
credits per certificate signer in addition to the selected notification cost. A certificate flow completes the signer's
|
|
1102
1103
|
virtual item; it cannot submit placed fields through the ordinary `collect`
|
|
1103
1104
|
signing endpoint.
|
|
1104
1105
|
|
|
@@ -1124,7 +1125,7 @@ const certificateSigner = await client.signers.update(signerId, {
|
|
|
1124
1125
|
|
|
1125
1126
|
const certificateCost = await client.assignments.estimateCost(documentId, {
|
|
1126
1127
|
method: 'virtual',
|
|
1127
|
-
signers: [{ verification_method: 'DigitalCertificate', notification_methods: ['Email'] }],
|
|
1128
|
+
signers: [{ step: 1, verification_method: 'DigitalCertificate', notification_methods: ['Email'] }],
|
|
1128
1129
|
});
|
|
1129
1130
|
|
|
1130
1131
|
await client.assignments.create(documentId, {
|
package/docs/README.md
CHANGED
|
@@ -1050,8 +1050,9 @@ nem encaminhe fora do fluxo de assinatura.
|
|
|
1050
1050
|
|
|
1051
1051
|
`DigitalCertificate` exige `method: 'virtual'`, o recurso **Certificado Digital** na conta (planos
|
|
1052
1052
|
Standard e Pro), CPF ou CNPJ em `government_id` do signatário, e exatamente **um signatário por
|
|
1053
|
-
certificado naquele passo de assinatura**.
|
|
1054
|
-
|
|
1053
|
+
certificado naquele passo de assinatura**. A estimativa recebe o mesmo `step` da criação: com dois
|
|
1054
|
+
ou mais signatários com certificado, dê a cada um o seu passo nas duas chamadas. Custa 0,5 crédito
|
|
1055
|
+
por signatário, além do custo da notificação escolhida. O fluxo por certificado conclui o item virtual do signatário; ele não consegue
|
|
1055
1056
|
enviar campos posicionados pelo endpoint comum de assinatura `collect`.
|
|
1056
1057
|
|
|
1057
1058
|
O SDK rejeita signatários por certificado em assignments `collect`, tanto em `create()` quanto em
|
|
@@ -1074,7 +1075,7 @@ const signatarioCertificado = await client.signers.update(signerId, {
|
|
|
1074
1075
|
|
|
1075
1076
|
const custoCertificado = await client.assignments.estimateCost(documentId, {
|
|
1076
1077
|
method: 'virtual',
|
|
1077
|
-
signers: [{ verification_method: 'DigitalCertificate', notification_methods: ['Email'] }],
|
|
1078
|
+
signers: [{ step: 1, verification_method: 'DigitalCertificate', notification_methods: ['Email'] }],
|
|
1078
1079
|
});
|
|
1079
1080
|
|
|
1080
1081
|
await client.assignments.create(documentId, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assinafy/sdk",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"packageManager": "bun@1.4.4",
|
|
5
5
|
"description": "TypeScript SDK for Assinafy API - Digital signature platform",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
"@types/bun": "^1.4.4",
|
|
73
73
|
"@types/node": "^22.20.5",
|
|
74
74
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
75
|
-
"eslint": "^10.
|
|
75
|
+
"eslint": "^10.14.0",
|
|
76
76
|
"publint": "^0.3.25",
|
|
77
|
-
"tsup": "^
|
|
77
|
+
"tsup": "^9.0.0",
|
|
78
78
|
"typescript": "^6.0.3",
|
|
79
79
|
"typescript-eslint": "^8.72.1"
|
|
80
80
|
},
|