@assinafy/sdk 2.9.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -1
- package/README.en.md +18 -4
- package/README.md +18 -4
- package/dist/index.d.mts +59 -10
- package/dist/index.d.ts +59 -10
- package/dist/index.js +67 -13
- package/dist/index.mjs +67 -13
- package/docs/API_COVERAGE.md +1 -1
- package/docs/COMPATIBILITY.md +67 -3
- package/docs/RELEASING.md +12 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.10.0] - 2026-10-29
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `documents.listActivities(documentId, params?)` returns activity entries
|
|
15
|
+
with pagination metadata from the response headers. Use it to read the full
|
|
16
|
+
production history; sandbox responses omit metadata while still unpaged.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- `documents.activities(documentId, params?)` accepts `page`, `per-page`
|
|
21
|
+
(or `per_page`), and `sort`, allowing callers to fetch beyond production's
|
|
22
|
+
default 20 activity entries. Existing calls still return an array; sandbox
|
|
23
|
+
responses remain compatible with its unpaged activity log.
|
|
24
|
+
|
|
25
|
+
## [2.9.1] - 2026-10-28
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Live smoke tests accept all 13 notification preference fields, including the
|
|
30
|
+
four contract lifecycle notification settings.
|
|
31
|
+
|
|
10
32
|
## [2.9.0] - 2026-10-28
|
|
11
33
|
|
|
12
34
|
### Added
|
|
@@ -873,7 +895,10 @@ signer fields with `cpf` and `whatsapp_phone_number`.
|
|
|
873
895
|
- High-level `uploadAndRequestSignatures` helper on `AssinafyClient`.
|
|
874
896
|
- `PaginatedResult<T>` with parsed `X-Pagination-*` header meta.
|
|
875
897
|
|
|
876
|
-
[Unreleased]: https://github.com/assinafy/typescript-sdk/compare/v2.
|
|
898
|
+
[Unreleased]: https://github.com/assinafy/typescript-sdk/compare/v2.10.0...HEAD
|
|
899
|
+
[2.10.0]: https://github.com/assinafy/typescript-sdk/compare/v2.9.1...v2.10.0
|
|
900
|
+
[2.9.1]: https://github.com/assinafy/typescript-sdk/compare/v2.9.0...v2.9.1
|
|
901
|
+
[2.9.0]: https://github.com/assinafy/typescript-sdk/compare/v2.8.1...v2.9.0
|
|
877
902
|
[2.8.1]: https://github.com/assinafy/typescript-sdk/compare/v2.8.0...v2.8.1
|
|
878
903
|
[2.8.0]: https://github.com/assinafy/typescript-sdk/releases/tag/v2.8.0
|
|
879
904
|
[2.7.1]: https://github.com/assinafy/typescript-sdk/compare/v2.7.0...v2.7.1
|
package/README.en.md
CHANGED
|
@@ -347,7 +347,7 @@ ledger is in [docs/API_COVERAGE.md](docs/API_COVERAGE.md).
|
|
|
347
347
|
|
|
348
348
|
| Resource | Endpoints |
|
|
349
349
|
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
350
|
-
| `client.documents` | list, **search**, upload, details, get, **rename**, activities, waitUntilReady, download, thumbnail, downloadPage, statuses, delete, verify, createFromTemplate, estimateCostFromTemplate, getPublic, sendToken, listTags, replaceTags, addTags, detachTag, isFullySigned, getSigningProgress |
|
|
350
|
+
| `client.documents` | list, **search**, upload, details, get, **rename**, activities, listActivities, waitUntilReady, download, thumbnail, downloadPage, statuses, delete, verify, createFromTemplate, estimateCostFromTemplate, getPublic, sendToken, listTags, replaceTags, addTags, detachTag, isFullySigned, getSigningProgress |
|
|
351
351
|
| `client.signers` | create, get, list, update, delete, findByEmail |
|
|
352
352
|
| `client.assignments` | list, create, estimateCost, resetExpiration, resendNotification, estimateResendCost, listWhatsAppNotifications, getIdentityVerification, downloadIdentityVerificationImage, reviewIdentityVerification |
|
|
353
353
|
| `client.contracts` | list, get, set, listRelated, renew, terminate |
|
|
@@ -718,7 +718,10 @@ const { data, meta } = await client.documents.list({ page: 1, 'per-page': 20, so
|
|
|
718
718
|
const hits = await client.documents.search({ search: 'agreement', status: 'pending_signature', 'per-page': 20 });
|
|
719
719
|
|
|
720
720
|
await client.documents.details(doc.id);
|
|
721
|
-
|
|
721
|
+
// Production: page 2 of activities, oldest first; returns an array.
|
|
722
|
+
await client.documents.activities(doc.id, { page: 2, 'per-page': 100, sort: 'id' });
|
|
723
|
+
// Use listActivities for { data, meta }, including total and last_page.
|
|
724
|
+
await client.documents.listActivities(doc.id, { page: 2, 'per-page': 100, sort: 'id' });
|
|
722
725
|
await client.documents.waitUntilReady(doc.id, { maxWaitMs: 30_000 });
|
|
723
726
|
|
|
724
727
|
// Rename. The API rejects this with 400 while the document is still in
|
|
@@ -774,11 +777,22 @@ both are silent rather than errors:
|
|
|
774
777
|
- Only the hyphenated `per-page` is read. `per_page` is accepted and ignored,
|
|
775
778
|
falling back to 20 rows — so the SDK rewrites `per_page` to `per-page` on
|
|
776
779
|
every list method, and an explicit `per-page` wins when both are given.
|
|
777
|
-
- `per-page`
|
|
778
|
-
|
|
780
|
+
- Document and signer lists have been observed to clamp `per-page` to **50**.
|
|
781
|
+
Asking for 100 returns 50 rows with a `200` on those deployments.
|
|
782
|
+
The exported `MAX_LIST_PAGE_SIZE` constant is that observed ceiling; page through with
|
|
779
783
|
`page` rather than requesting a larger page, and trust `meta.per_page` over
|
|
780
784
|
the value you asked for.
|
|
781
785
|
|
|
786
|
+
`documents.activities(documentId, params?)` keeps its array return type and does
|
|
787
|
+
not expose pagination metadata; use `documents.listActivities()` for `{ data, meta }`.
|
|
788
|
+
In production, these methods return **20 entries per page**
|
|
789
|
+
by default and documents a maximum `per-page` of **100**. Use `page` to fetch later
|
|
790
|
+
entries; an empty array marks the end. `sort: 'id'` returns oldest first, and
|
|
791
|
+
`sort: '-id'` (the default) returns newest first. Sandbox still returns the full,
|
|
792
|
+
unpaged log and may ignore these parameters, so do not loop through pages there.
|
|
793
|
+
Existing integrations that read the entire history in one request must now
|
|
794
|
+
request subsequent pages. See the [migration example](docs/COMPATIBILITY.md#document-activities).
|
|
795
|
+
|
|
782
796
|
### Contract lifecycle management (CLM)
|
|
783
797
|
|
|
784
798
|
Contract lifecycle management tracks the business terms attached to an existing
|
package/README.md
CHANGED
|
@@ -332,7 +332,7 @@ As 118 operações documentadas em https://api.assinafy.com.br/v1/docs estão co
|
|
|
332
332
|
|
|
333
333
|
| Recurso | Endpoints |
|
|
334
334
|
| --- | --- |
|
|
335
|
-
| `client.documents` | list, search, upload, details, get, rename, activities, waitUntilReady, download, thumbnail, downloadPage, statuses, delete, verify, createFromTemplate, estimateCostFromTemplate, getPublic, sendToken, listTags, replaceTags, addTags, detachTag, isFullySigned, getSigningProgress |
|
|
335
|
+
| `client.documents` | list, search, upload, details, get, rename, activities, listActivities, waitUntilReady, download, thumbnail, downloadPage, statuses, delete, verify, createFromTemplate, estimateCostFromTemplate, getPublic, sendToken, listTags, replaceTags, addTags, detachTag, isFullySigned, getSigningProgress |
|
|
336
336
|
| `client.signers` | create, get, list, update, delete, findByEmail |
|
|
337
337
|
| `client.assignments` | list, create, estimateCost, resetExpiration, resendNotification, estimateResendCost, listWhatsAppNotifications, getIdentityVerification, downloadIdentityVerificationImage, reviewIdentityVerification |
|
|
338
338
|
| `client.contracts` | list, get, set, listRelated, renew, terminate |
|
|
@@ -687,7 +687,10 @@ const { data, meta } = await client.documents.list({ page: 1, 'per-page': 20, so
|
|
|
687
687
|
const achados = await client.documents.search({ search: 'contrato', status: 'pending_signature', 'per-page': 20 });
|
|
688
688
|
|
|
689
689
|
await client.documents.details(doc.id);
|
|
690
|
-
|
|
690
|
+
// Produção: página 2 de atividades, mais antigas primeiro; retorna um array.
|
|
691
|
+
await client.documents.activities(doc.id, { page: 2, 'per-page': 100, sort: 'id' });
|
|
692
|
+
// Use listActivities para { data, meta }, incluindo total e last_page.
|
|
693
|
+
await client.documents.listActivities(doc.id, { page: 2, 'per-page': 100, sort: 'id' });
|
|
691
694
|
await client.documents.waitUntilReady(doc.id, { maxWaitMs: 30_000 });
|
|
692
695
|
|
|
693
696
|
// Renomear. A API responde 400 enquanto o documento está em
|
|
@@ -740,10 +743,21 @@ As listagens devolvem `{ data, meta }`, com `meta` preenchido a partir dos heade
|
|
|
740
743
|
- Só o `per-page` com hífen é lido. `per_page` é aceito e ignorado, caindo para 20 linhas — por isso
|
|
741
744
|
o SDK reescreve `per_page` como `per-page` em toda listagem, e um `per-page` explícito vence
|
|
742
745
|
quando os dois são enviados.
|
|
743
|
-
-
|
|
744
|
-
|
|
746
|
+
- Nas listagens de documentos e signatários, observou-se um limite de **50** para `per-page`.
|
|
747
|
+
Nesses ambientes, pedir 100 devolve 50 linhas com `200`. A constante exportada
|
|
748
|
+
`MAX_LIST_PAGE_SIZE` é esse teto observado; pagine com `page` em vez de pedir páginas maiores, e confie no
|
|
745
749
|
`meta.per_page` mais do que no valor pedido.
|
|
746
750
|
|
|
751
|
+
`documents.activities(documentId, params?)` mantém o retorno como array; use
|
|
752
|
+
`documents.listActivities()` para obter `{ data, meta }` com os metadados de paginação.
|
|
753
|
+
Em produção, esses métodos retornam **20 entradas por página** por padrão, com
|
|
754
|
+
máximo documentado de **100** para `per-page`. Use `page` para buscar as próximas entradas;
|
|
755
|
+
um array vazio indica o fim. `sort: 'id'` retorna as mais antigas primeiro, e `sort: '-id'`
|
|
756
|
+
(padrão), as mais recentes. O sandbox ainda retorna o histórico completo, sem paginação,
|
|
757
|
+
e pode ignorar esses parâmetros; por isso, não percorra páginas em loop nesse ambiente.
|
|
758
|
+
Integrações que liam o histórico completo em uma requisição precisam agora buscar
|
|
759
|
+
as páginas seguintes. Veja o [exemplo de migração](docs/COMPATIBILITY.md#document-activities).
|
|
760
|
+
|
|
747
761
|
### Gestão do ciclo de vida de contratos (CLM)
|
|
748
762
|
|
|
749
763
|
A gestão do ciclo de vida de contratos (CLM) acompanha os termos comerciais ligados a um documento
|
package/dist/index.d.mts
CHANGED
|
@@ -1703,7 +1703,7 @@ declare abstract class BaseResource {
|
|
|
1703
1703
|
missingId: string;
|
|
1704
1704
|
}): Promise<T>;
|
|
1705
1705
|
/** Execute a paginated list call and attach meta from `X-Pagination-*` headers. */
|
|
1706
|
-
protected callList<T>(label: string, request: RequestFn): Promise<PaginatedResult<T>>;
|
|
1706
|
+
protected callList<T>(label: string, request: RequestFn, allowEmptyBody?: boolean): Promise<PaginatedResult<T>>;
|
|
1707
1707
|
}
|
|
1708
1708
|
type RequestFn = () => Promise<AxiosResponse>;
|
|
1709
1709
|
|
|
@@ -2102,14 +2102,22 @@ declare class DocumentResource extends BaseResource {
|
|
|
2102
2102
|
*/
|
|
2103
2103
|
downloadPage(documentId: string, pageId: string): Promise<Buffer>;
|
|
2104
2104
|
/**
|
|
2105
|
-
* Fetch the document activity log
|
|
2105
|
+
* Fetch a page of the document activity log
|
|
2106
2106
|
* (`GET /documents/{documentId}/activities`).
|
|
2107
2107
|
*
|
|
2108
|
-
*
|
|
2109
|
-
*
|
|
2108
|
+
* Production returns 20 entries per page by default, newest first. Request
|
|
2109
|
+
* later pages explicitly; a page past the end returns `[]`. Sandbox still
|
|
2110
|
+
* returns the full, unpaged log and may ignore these parameters. This method
|
|
2111
|
+
* preserves its array return type; use {@link DocumentResource.listActivities}
|
|
2112
|
+
* for pagination metadata. Normalises an absent body to `[]`.
|
|
2110
2113
|
*
|
|
2111
2114
|
* @param documentId - The document whose activity log to fetch.
|
|
2112
|
-
* @
|
|
2115
|
+
* @param params - Optional pagination and sorting parameters.
|
|
2116
|
+
* @param params.page - Page number, starting at 1.
|
|
2117
|
+
* @param params.per-page - Entries per page (production default 20, documented max 100).
|
|
2118
|
+
* @param params.per_page - Alias for `per-page`; explicit `per-page` wins.
|
|
2119
|
+
* @param params.sort - `-id` (default, newest first) or `id` (oldest first).
|
|
2120
|
+
* @returns The requested page of activity entries, or `[]`:
|
|
2113
2121
|
* ```jsonc
|
|
2114
2122
|
* [
|
|
2115
2123
|
* {
|
|
@@ -2130,16 +2138,56 @@ declare class DocumentResource extends BaseResource {
|
|
|
2130
2138
|
* }
|
|
2131
2139
|
* ]
|
|
2132
2140
|
* ```
|
|
2133
|
-
* @throws {ValidationError} If `documentId` is missing.
|
|
2134
|
-
* @throws {ApiError} If the API rejects the request.
|
|
2141
|
+
* @throws {ValidationError} If `documentId` is missing or invalid, or `params` is not an object.
|
|
2142
|
+
* @throws {ApiError} If the API rejects the request (`401` for invalid credentials, `500` for a server error).
|
|
2135
2143
|
*
|
|
2136
2144
|
* @example
|
|
2137
2145
|
* ```ts
|
|
2138
|
-
* const events = await client.documents.activities('doc-1'
|
|
2146
|
+
* const events = await client.documents.activities('doc-1', {
|
|
2147
|
+
* page: 2, 'per-page': 100, sort: 'id',
|
|
2148
|
+
* });
|
|
2139
2149
|
* console.log(events.map((e) => e.event));
|
|
2140
2150
|
* ```
|
|
2141
2151
|
*/
|
|
2142
|
-
activities(documentId: string): Promise<IDocumentActivity[]>;
|
|
2152
|
+
activities(documentId: string, params?: IListParams): Promise<IDocumentActivity[]>;
|
|
2153
|
+
/**
|
|
2154
|
+
* Fetch document activities with pagination metadata
|
|
2155
|
+
* (`GET /documents/{documentId}/activities`).
|
|
2156
|
+
*
|
|
2157
|
+
* Production defaults to 20 entries, newest first. `meta` comes from the
|
|
2158
|
+
* `X-Pagination-*` headers; use `last_page` to request the remaining pages.
|
|
2159
|
+
* Sandbox returns the full unpaged log without `meta`: process it once.
|
|
2160
|
+
* Normalises an absent body to an empty list. Makes exactly one request.
|
|
2161
|
+
*
|
|
2162
|
+
* @param documentId - The document whose activity log to fetch.
|
|
2163
|
+
* @param params - Optional pagination and sorting parameters.
|
|
2164
|
+
* @param params.page - Page number, starting at 1.
|
|
2165
|
+
* @param params.per-page - Entries per page (production default 20, documented max 100).
|
|
2166
|
+
* @param params.per_page - Alias for `per-page`; explicit `per-page` wins.
|
|
2167
|
+
* @param params.sort - `-id` (default, newest first) or `id` (oldest first).
|
|
2168
|
+
* @returns Activity entries and pagination metadata when the server supplies it:
|
|
2169
|
+
* ```jsonc
|
|
2170
|
+
* {
|
|
2171
|
+
* "data": [{
|
|
2172
|
+
* "id": 15271,
|
|
2173
|
+
* "event": "document_uploaded",
|
|
2174
|
+
* "message": "Documento criado.",
|
|
2175
|
+
* "payload": [],
|
|
2176
|
+
* "origin": null,
|
|
2177
|
+
* "created_at": "2026-07-19T14:56:55Z"
|
|
2178
|
+
* }],
|
|
2179
|
+
* "meta": { "current_page": 2, "per_page": 20, "total": 21, "last_page": 2 }
|
|
2180
|
+
* }
|
|
2181
|
+
* ```
|
|
2182
|
+
* @throws {ValidationError} If `documentId` is missing or invalid, or `params` is not an object.
|
|
2183
|
+
* @throws {ApiError} If the API rejects the request (`401` for invalid credentials, `500` for a server error).
|
|
2184
|
+
* @example
|
|
2185
|
+
* ```ts
|
|
2186
|
+
* const { data, meta } = await client.documents.listActivities('doc-1', { page: 2 });
|
|
2187
|
+
* console.log(data, meta?.total);
|
|
2188
|
+
* ```
|
|
2189
|
+
*/
|
|
2190
|
+
listActivities(documentId: string, params?: IListParams): Promise<PaginatedResult<IDocumentActivity>>;
|
|
2143
2191
|
/**
|
|
2144
2192
|
* Delete a document (`DELETE /documents/{documentId}`).
|
|
2145
2193
|
*
|
|
@@ -8208,11 +8256,12 @@ declare class NetworkError extends AssinafyError {
|
|
|
8208
8256
|
}
|
|
8209
8257
|
|
|
8210
8258
|
/**
|
|
8211
|
-
*
|
|
8259
|
+
* Observed page-size cap for document and signer lists on older deployments.
|
|
8212
8260
|
*
|
|
8213
8261
|
* The API silently clamps `per-page` to this value rather than rejecting a
|
|
8214
8262
|
* larger one, so a caller asking for 100 receives 50 and no error. Methods that
|
|
8215
8263
|
* need "as many rows as one request can give" pin this instead of guessing.
|
|
8264
|
+
* Production document activities have a documented maximum of 100 instead.
|
|
8216
8265
|
*/
|
|
8217
8266
|
declare const MAX_LIST_PAGE_SIZE = 50;
|
|
8218
8267
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1703,7 +1703,7 @@ declare abstract class BaseResource {
|
|
|
1703
1703
|
missingId: string;
|
|
1704
1704
|
}): Promise<T>;
|
|
1705
1705
|
/** Execute a paginated list call and attach meta from `X-Pagination-*` headers. */
|
|
1706
|
-
protected callList<T>(label: string, request: RequestFn): Promise<PaginatedResult<T>>;
|
|
1706
|
+
protected callList<T>(label: string, request: RequestFn, allowEmptyBody?: boolean): Promise<PaginatedResult<T>>;
|
|
1707
1707
|
}
|
|
1708
1708
|
type RequestFn = () => Promise<AxiosResponse>;
|
|
1709
1709
|
|
|
@@ -2102,14 +2102,22 @@ declare class DocumentResource extends BaseResource {
|
|
|
2102
2102
|
*/
|
|
2103
2103
|
downloadPage(documentId: string, pageId: string): Promise<Buffer>;
|
|
2104
2104
|
/**
|
|
2105
|
-
* Fetch the document activity log
|
|
2105
|
+
* Fetch a page of the document activity log
|
|
2106
2106
|
* (`GET /documents/{documentId}/activities`).
|
|
2107
2107
|
*
|
|
2108
|
-
*
|
|
2109
|
-
*
|
|
2108
|
+
* Production returns 20 entries per page by default, newest first. Request
|
|
2109
|
+
* later pages explicitly; a page past the end returns `[]`. Sandbox still
|
|
2110
|
+
* returns the full, unpaged log and may ignore these parameters. This method
|
|
2111
|
+
* preserves its array return type; use {@link DocumentResource.listActivities}
|
|
2112
|
+
* for pagination metadata. Normalises an absent body to `[]`.
|
|
2110
2113
|
*
|
|
2111
2114
|
* @param documentId - The document whose activity log to fetch.
|
|
2112
|
-
* @
|
|
2115
|
+
* @param params - Optional pagination and sorting parameters.
|
|
2116
|
+
* @param params.page - Page number, starting at 1.
|
|
2117
|
+
* @param params.per-page - Entries per page (production default 20, documented max 100).
|
|
2118
|
+
* @param params.per_page - Alias for `per-page`; explicit `per-page` wins.
|
|
2119
|
+
* @param params.sort - `-id` (default, newest first) or `id` (oldest first).
|
|
2120
|
+
* @returns The requested page of activity entries, or `[]`:
|
|
2113
2121
|
* ```jsonc
|
|
2114
2122
|
* [
|
|
2115
2123
|
* {
|
|
@@ -2130,16 +2138,56 @@ declare class DocumentResource extends BaseResource {
|
|
|
2130
2138
|
* }
|
|
2131
2139
|
* ]
|
|
2132
2140
|
* ```
|
|
2133
|
-
* @throws {ValidationError} If `documentId` is missing.
|
|
2134
|
-
* @throws {ApiError} If the API rejects the request.
|
|
2141
|
+
* @throws {ValidationError} If `documentId` is missing or invalid, or `params` is not an object.
|
|
2142
|
+
* @throws {ApiError} If the API rejects the request (`401` for invalid credentials, `500` for a server error).
|
|
2135
2143
|
*
|
|
2136
2144
|
* @example
|
|
2137
2145
|
* ```ts
|
|
2138
|
-
* const events = await client.documents.activities('doc-1'
|
|
2146
|
+
* const events = await client.documents.activities('doc-1', {
|
|
2147
|
+
* page: 2, 'per-page': 100, sort: 'id',
|
|
2148
|
+
* });
|
|
2139
2149
|
* console.log(events.map((e) => e.event));
|
|
2140
2150
|
* ```
|
|
2141
2151
|
*/
|
|
2142
|
-
activities(documentId: string): Promise<IDocumentActivity[]>;
|
|
2152
|
+
activities(documentId: string, params?: IListParams): Promise<IDocumentActivity[]>;
|
|
2153
|
+
/**
|
|
2154
|
+
* Fetch document activities with pagination metadata
|
|
2155
|
+
* (`GET /documents/{documentId}/activities`).
|
|
2156
|
+
*
|
|
2157
|
+
* Production defaults to 20 entries, newest first. `meta` comes from the
|
|
2158
|
+
* `X-Pagination-*` headers; use `last_page` to request the remaining pages.
|
|
2159
|
+
* Sandbox returns the full unpaged log without `meta`: process it once.
|
|
2160
|
+
* Normalises an absent body to an empty list. Makes exactly one request.
|
|
2161
|
+
*
|
|
2162
|
+
* @param documentId - The document whose activity log to fetch.
|
|
2163
|
+
* @param params - Optional pagination and sorting parameters.
|
|
2164
|
+
* @param params.page - Page number, starting at 1.
|
|
2165
|
+
* @param params.per-page - Entries per page (production default 20, documented max 100).
|
|
2166
|
+
* @param params.per_page - Alias for `per-page`; explicit `per-page` wins.
|
|
2167
|
+
* @param params.sort - `-id` (default, newest first) or `id` (oldest first).
|
|
2168
|
+
* @returns Activity entries and pagination metadata when the server supplies it:
|
|
2169
|
+
* ```jsonc
|
|
2170
|
+
* {
|
|
2171
|
+
* "data": [{
|
|
2172
|
+
* "id": 15271,
|
|
2173
|
+
* "event": "document_uploaded",
|
|
2174
|
+
* "message": "Documento criado.",
|
|
2175
|
+
* "payload": [],
|
|
2176
|
+
* "origin": null,
|
|
2177
|
+
* "created_at": "2026-07-19T14:56:55Z"
|
|
2178
|
+
* }],
|
|
2179
|
+
* "meta": { "current_page": 2, "per_page": 20, "total": 21, "last_page": 2 }
|
|
2180
|
+
* }
|
|
2181
|
+
* ```
|
|
2182
|
+
* @throws {ValidationError} If `documentId` is missing or invalid, or `params` is not an object.
|
|
2183
|
+
* @throws {ApiError} If the API rejects the request (`401` for invalid credentials, `500` for a server error).
|
|
2184
|
+
* @example
|
|
2185
|
+
* ```ts
|
|
2186
|
+
* const { data, meta } = await client.documents.listActivities('doc-1', { page: 2 });
|
|
2187
|
+
* console.log(data, meta?.total);
|
|
2188
|
+
* ```
|
|
2189
|
+
*/
|
|
2190
|
+
listActivities(documentId: string, params?: IListParams): Promise<PaginatedResult<IDocumentActivity>>;
|
|
2143
2191
|
/**
|
|
2144
2192
|
* Delete a document (`DELETE /documents/{documentId}`).
|
|
2145
2193
|
*
|
|
@@ -8208,11 +8256,12 @@ declare class NetworkError extends AssinafyError {
|
|
|
8208
8256
|
}
|
|
8209
8257
|
|
|
8210
8258
|
/**
|
|
8211
|
-
*
|
|
8259
|
+
* Observed page-size cap for document and signer lists on older deployments.
|
|
8212
8260
|
*
|
|
8213
8261
|
* The API silently clamps `per-page` to this value rather than rejecting a
|
|
8214
8262
|
* larger one, so a caller asking for 100 receives 50 and no error. Methods that
|
|
8215
8263
|
* need "as many rows as one request can give" pin this instead of guessing.
|
|
8264
|
+
* Production document activities have a documented maximum of 100 instead.
|
|
8216
8265
|
*/
|
|
8217
8266
|
declare const MAX_LIST_PAGE_SIZE = 50;
|
|
8218
8267
|
|
package/dist/index.js
CHANGED
|
@@ -690,7 +690,7 @@ var import_axios2 = __toESM(require("axios"));
|
|
|
690
690
|
// package.json
|
|
691
691
|
var package_default = {
|
|
692
692
|
name: "@assinafy/sdk",
|
|
693
|
-
version: "2.
|
|
693
|
+
version: "2.10.0",
|
|
694
694
|
packageManager: "bun@1.4.4",
|
|
695
695
|
description: "TypeScript SDK for Assinafy API - Digital signature platform",
|
|
696
696
|
type: "commonjs",
|
|
@@ -982,7 +982,7 @@ var BaseResource = class {
|
|
|
982
982
|
return result;
|
|
983
983
|
}
|
|
984
984
|
/** Execute a paginated list call and attach meta from `X-Pagination-*` headers. */
|
|
985
|
-
async callList(label, request) {
|
|
985
|
+
async callList(label, request, allowEmptyBody = false) {
|
|
986
986
|
try {
|
|
987
987
|
const response = assertSuccessful(await request());
|
|
988
988
|
const unwrapped = handleAssinafyResponse(response.data);
|
|
@@ -991,6 +991,8 @@ var BaseResource = class {
|
|
|
991
991
|
data = unwrapped;
|
|
992
992
|
} else if (Array.isArray(unwrapped?.data)) {
|
|
993
993
|
data = unwrapped.data;
|
|
994
|
+
} else if (allowEmptyBody && unwrapped == null) {
|
|
995
|
+
data = [];
|
|
994
996
|
} else {
|
|
995
997
|
throw new AssinafyError(`${label}: API returned a malformed list payload`, {
|
|
996
998
|
responseData: unwrapped
|
|
@@ -2492,14 +2494,22 @@ var DocumentResource = class extends BaseResource {
|
|
|
2492
2494
|
);
|
|
2493
2495
|
}
|
|
2494
2496
|
/**
|
|
2495
|
-
* Fetch the document activity log
|
|
2497
|
+
* Fetch a page of the document activity log
|
|
2496
2498
|
* (`GET /documents/{documentId}/activities`).
|
|
2497
2499
|
*
|
|
2498
|
-
*
|
|
2499
|
-
*
|
|
2500
|
+
* Production returns 20 entries per page by default, newest first. Request
|
|
2501
|
+
* later pages explicitly; a page past the end returns `[]`. Sandbox still
|
|
2502
|
+
* returns the full, unpaged log and may ignore these parameters. This method
|
|
2503
|
+
* preserves its array return type; use {@link DocumentResource.listActivities}
|
|
2504
|
+
* for pagination metadata. Normalises an absent body to `[]`.
|
|
2500
2505
|
*
|
|
2501
2506
|
* @param documentId - The document whose activity log to fetch.
|
|
2502
|
-
* @
|
|
2507
|
+
* @param params - Optional pagination and sorting parameters.
|
|
2508
|
+
* @param params.page - Page number, starting at 1.
|
|
2509
|
+
* @param params.per-page - Entries per page (production default 20, documented max 100).
|
|
2510
|
+
* @param params.per_page - Alias for `per-page`; explicit `per-page` wins.
|
|
2511
|
+
* @param params.sort - `-id` (default, newest first) or `id` (oldest first).
|
|
2512
|
+
* @returns The requested page of activity entries, or `[]`:
|
|
2503
2513
|
* ```jsonc
|
|
2504
2514
|
* [
|
|
2505
2515
|
* {
|
|
@@ -2520,22 +2530,66 @@ var DocumentResource = class extends BaseResource {
|
|
|
2520
2530
|
* }
|
|
2521
2531
|
* ]
|
|
2522
2532
|
* ```
|
|
2523
|
-
* @throws {ValidationError} If `documentId` is missing.
|
|
2524
|
-
* @throws {ApiError} If the API rejects the request.
|
|
2533
|
+
* @throws {ValidationError} If `documentId` is missing or invalid, or `params` is not an object.
|
|
2534
|
+
* @throws {ApiError} If the API rejects the request (`401` for invalid credentials, `500` for a server error).
|
|
2525
2535
|
*
|
|
2526
2536
|
* @example
|
|
2527
2537
|
* ```ts
|
|
2528
|
-
* const events = await client.documents.activities('doc-1'
|
|
2538
|
+
* const events = await client.documents.activities('doc-1', {
|
|
2539
|
+
* page: 2, 'per-page': 100, sort: 'id',
|
|
2540
|
+
* });
|
|
2529
2541
|
* console.log(events.map((e) => e.event));
|
|
2530
2542
|
* ```
|
|
2531
2543
|
*/
|
|
2532
|
-
async activities(documentId) {
|
|
2544
|
+
async activities(documentId, params = {}) {
|
|
2545
|
+
return (await this.listActivities(documentId, params)).data;
|
|
2546
|
+
}
|
|
2547
|
+
/**
|
|
2548
|
+
* Fetch document activities with pagination metadata
|
|
2549
|
+
* (`GET /documents/{documentId}/activities`).
|
|
2550
|
+
*
|
|
2551
|
+
* Production defaults to 20 entries, newest first. `meta` comes from the
|
|
2552
|
+
* `X-Pagination-*` headers; use `last_page` to request the remaining pages.
|
|
2553
|
+
* Sandbox returns the full unpaged log without `meta`: process it once.
|
|
2554
|
+
* Normalises an absent body to an empty list. Makes exactly one request.
|
|
2555
|
+
*
|
|
2556
|
+
* @param documentId - The document whose activity log to fetch.
|
|
2557
|
+
* @param params - Optional pagination and sorting parameters.
|
|
2558
|
+
* @param params.page - Page number, starting at 1.
|
|
2559
|
+
* @param params.per-page - Entries per page (production default 20, documented max 100).
|
|
2560
|
+
* @param params.per_page - Alias for `per-page`; explicit `per-page` wins.
|
|
2561
|
+
* @param params.sort - `-id` (default, newest first) or `id` (oldest first).
|
|
2562
|
+
* @returns Activity entries and pagination metadata when the server supplies it:
|
|
2563
|
+
* ```jsonc
|
|
2564
|
+
* {
|
|
2565
|
+
* "data": [{
|
|
2566
|
+
* "id": 15271,
|
|
2567
|
+
* "event": "document_uploaded",
|
|
2568
|
+
* "message": "Documento criado.",
|
|
2569
|
+
* "payload": [],
|
|
2570
|
+
* "origin": null,
|
|
2571
|
+
* "created_at": "2026-07-19T14:56:55Z"
|
|
2572
|
+
* }],
|
|
2573
|
+
* "meta": { "current_page": 2, "per_page": 20, "total": 21, "last_page": 2 }
|
|
2574
|
+
* }
|
|
2575
|
+
* ```
|
|
2576
|
+
* @throws {ValidationError} If `documentId` is missing or invalid, or `params` is not an object.
|
|
2577
|
+
* @throws {ApiError} If the API rejects the request (`401` for invalid credentials, `500` for a server error).
|
|
2578
|
+
* @example
|
|
2579
|
+
* ```ts
|
|
2580
|
+
* const { data, meta } = await client.documents.listActivities('doc-1', { page: 2 });
|
|
2581
|
+
* console.log(data, meta?.total);
|
|
2582
|
+
* ```
|
|
2583
|
+
*/
|
|
2584
|
+
async listActivities(documentId, params = {}) {
|
|
2533
2585
|
const id = this.requireId(documentId, "Document ID");
|
|
2534
|
-
|
|
2586
|
+
return this.callList(
|
|
2535
2587
|
"Failed to fetch document activities",
|
|
2536
|
-
() => this.http.get(`/documents/${this.pathSegment(id, "Document ID")}/activities
|
|
2588
|
+
() => this.http.get(`/documents/${this.pathSegment(id, "Document ID")}/activities`, {
|
|
2589
|
+
params: cleanListParams(params)
|
|
2590
|
+
}),
|
|
2591
|
+
true
|
|
2537
2592
|
);
|
|
2538
|
-
return result ?? [];
|
|
2539
2593
|
}
|
|
2540
2594
|
/**
|
|
2541
2595
|
* Delete a document (`DELETE /documents/{documentId}`).
|
package/dist/index.mjs
CHANGED
|
@@ -628,7 +628,7 @@ import axios2 from "axios";
|
|
|
628
628
|
// package.json
|
|
629
629
|
var package_default = {
|
|
630
630
|
name: "@assinafy/sdk",
|
|
631
|
-
version: "2.
|
|
631
|
+
version: "2.10.0",
|
|
632
632
|
packageManager: "bun@1.4.4",
|
|
633
633
|
description: "TypeScript SDK for Assinafy API - Digital signature platform",
|
|
634
634
|
type: "commonjs",
|
|
@@ -920,7 +920,7 @@ var BaseResource = class {
|
|
|
920
920
|
return result;
|
|
921
921
|
}
|
|
922
922
|
/** Execute a paginated list call and attach meta from `X-Pagination-*` headers. */
|
|
923
|
-
async callList(label, request) {
|
|
923
|
+
async callList(label, request, allowEmptyBody = false) {
|
|
924
924
|
try {
|
|
925
925
|
const response = assertSuccessful(await request());
|
|
926
926
|
const unwrapped = handleAssinafyResponse(response.data);
|
|
@@ -929,6 +929,8 @@ var BaseResource = class {
|
|
|
929
929
|
data = unwrapped;
|
|
930
930
|
} else if (Array.isArray(unwrapped?.data)) {
|
|
931
931
|
data = unwrapped.data;
|
|
932
|
+
} else if (allowEmptyBody && unwrapped == null) {
|
|
933
|
+
data = [];
|
|
932
934
|
} else {
|
|
933
935
|
throw new AssinafyError(`${label}: API returned a malformed list payload`, {
|
|
934
936
|
responseData: unwrapped
|
|
@@ -2430,14 +2432,22 @@ var DocumentResource = class extends BaseResource {
|
|
|
2430
2432
|
);
|
|
2431
2433
|
}
|
|
2432
2434
|
/**
|
|
2433
|
-
* Fetch the document activity log
|
|
2435
|
+
* Fetch a page of the document activity log
|
|
2434
2436
|
* (`GET /documents/{documentId}/activities`).
|
|
2435
2437
|
*
|
|
2436
|
-
*
|
|
2437
|
-
*
|
|
2438
|
+
* Production returns 20 entries per page by default, newest first. Request
|
|
2439
|
+
* later pages explicitly; a page past the end returns `[]`. Sandbox still
|
|
2440
|
+
* returns the full, unpaged log and may ignore these parameters. This method
|
|
2441
|
+
* preserves its array return type; use {@link DocumentResource.listActivities}
|
|
2442
|
+
* for pagination metadata. Normalises an absent body to `[]`.
|
|
2438
2443
|
*
|
|
2439
2444
|
* @param documentId - The document whose activity log to fetch.
|
|
2440
|
-
* @
|
|
2445
|
+
* @param params - Optional pagination and sorting parameters.
|
|
2446
|
+
* @param params.page - Page number, starting at 1.
|
|
2447
|
+
* @param params.per-page - Entries per page (production default 20, documented max 100).
|
|
2448
|
+
* @param params.per_page - Alias for `per-page`; explicit `per-page` wins.
|
|
2449
|
+
* @param params.sort - `-id` (default, newest first) or `id` (oldest first).
|
|
2450
|
+
* @returns The requested page of activity entries, or `[]`:
|
|
2441
2451
|
* ```jsonc
|
|
2442
2452
|
* [
|
|
2443
2453
|
* {
|
|
@@ -2458,22 +2468,66 @@ var DocumentResource = class extends BaseResource {
|
|
|
2458
2468
|
* }
|
|
2459
2469
|
* ]
|
|
2460
2470
|
* ```
|
|
2461
|
-
* @throws {ValidationError} If `documentId` is missing.
|
|
2462
|
-
* @throws {ApiError} If the API rejects the request.
|
|
2471
|
+
* @throws {ValidationError} If `documentId` is missing or invalid, or `params` is not an object.
|
|
2472
|
+
* @throws {ApiError} If the API rejects the request (`401` for invalid credentials, `500` for a server error).
|
|
2463
2473
|
*
|
|
2464
2474
|
* @example
|
|
2465
2475
|
* ```ts
|
|
2466
|
-
* const events = await client.documents.activities('doc-1'
|
|
2476
|
+
* const events = await client.documents.activities('doc-1', {
|
|
2477
|
+
* page: 2, 'per-page': 100, sort: 'id',
|
|
2478
|
+
* });
|
|
2467
2479
|
* console.log(events.map((e) => e.event));
|
|
2468
2480
|
* ```
|
|
2469
2481
|
*/
|
|
2470
|
-
async activities(documentId) {
|
|
2482
|
+
async activities(documentId, params = {}) {
|
|
2483
|
+
return (await this.listActivities(documentId, params)).data;
|
|
2484
|
+
}
|
|
2485
|
+
/**
|
|
2486
|
+
* Fetch document activities with pagination metadata
|
|
2487
|
+
* (`GET /documents/{documentId}/activities`).
|
|
2488
|
+
*
|
|
2489
|
+
* Production defaults to 20 entries, newest first. `meta` comes from the
|
|
2490
|
+
* `X-Pagination-*` headers; use `last_page` to request the remaining pages.
|
|
2491
|
+
* Sandbox returns the full unpaged log without `meta`: process it once.
|
|
2492
|
+
* Normalises an absent body to an empty list. Makes exactly one request.
|
|
2493
|
+
*
|
|
2494
|
+
* @param documentId - The document whose activity log to fetch.
|
|
2495
|
+
* @param params - Optional pagination and sorting parameters.
|
|
2496
|
+
* @param params.page - Page number, starting at 1.
|
|
2497
|
+
* @param params.per-page - Entries per page (production default 20, documented max 100).
|
|
2498
|
+
* @param params.per_page - Alias for `per-page`; explicit `per-page` wins.
|
|
2499
|
+
* @param params.sort - `-id` (default, newest first) or `id` (oldest first).
|
|
2500
|
+
* @returns Activity entries and pagination metadata when the server supplies it:
|
|
2501
|
+
* ```jsonc
|
|
2502
|
+
* {
|
|
2503
|
+
* "data": [{
|
|
2504
|
+
* "id": 15271,
|
|
2505
|
+
* "event": "document_uploaded",
|
|
2506
|
+
* "message": "Documento criado.",
|
|
2507
|
+
* "payload": [],
|
|
2508
|
+
* "origin": null,
|
|
2509
|
+
* "created_at": "2026-07-19T14:56:55Z"
|
|
2510
|
+
* }],
|
|
2511
|
+
* "meta": { "current_page": 2, "per_page": 20, "total": 21, "last_page": 2 }
|
|
2512
|
+
* }
|
|
2513
|
+
* ```
|
|
2514
|
+
* @throws {ValidationError} If `documentId` is missing or invalid, or `params` is not an object.
|
|
2515
|
+
* @throws {ApiError} If the API rejects the request (`401` for invalid credentials, `500` for a server error).
|
|
2516
|
+
* @example
|
|
2517
|
+
* ```ts
|
|
2518
|
+
* const { data, meta } = await client.documents.listActivities('doc-1', { page: 2 });
|
|
2519
|
+
* console.log(data, meta?.total);
|
|
2520
|
+
* ```
|
|
2521
|
+
*/
|
|
2522
|
+
async listActivities(documentId, params = {}) {
|
|
2471
2523
|
const id = this.requireId(documentId, "Document ID");
|
|
2472
|
-
|
|
2524
|
+
return this.callList(
|
|
2473
2525
|
"Failed to fetch document activities",
|
|
2474
|
-
() => this.http.get(`/documents/${this.pathSegment(id, "Document ID")}/activities
|
|
2526
|
+
() => this.http.get(`/documents/${this.pathSegment(id, "Document ID")}/activities`, {
|
|
2527
|
+
params: cleanListParams(params)
|
|
2528
|
+
}),
|
|
2529
|
+
true
|
|
2475
2530
|
);
|
|
2476
|
-
return result ?? [];
|
|
2477
2531
|
}
|
|
2478
2532
|
/**
|
|
2479
2533
|
* Delete a document (`DELETE /documents/{documentId}`).
|
package/docs/API_COVERAGE.md
CHANGED
|
@@ -84,7 +84,7 @@ Status meanings:
|
|
|
84
84
|
| `GET` | `/v1/documents/{documentId}` | `client.documents.details(documentId)` / `get(documentId)` | Covered |
|
|
85
85
|
| `DELETE` | `/v1/documents/{documentId}` | `client.documents.delete(documentId)` | Covered |
|
|
86
86
|
| `PATCH` | `/v1/documents/{documentId}` | `client.documents.rename(documentId, name)` | Covered |
|
|
87
|
-
| `GET` | `/v1/documents/{documentId}/activities` | `client.documents.activities(documentId)` | Covered |
|
|
87
|
+
| `GET` | `/v1/documents/{documentId}/activities` | `client.documents.activities(documentId, params?)` / `client.documents.listActivities(documentId, params?)` | Covered |
|
|
88
88
|
| `GET` | `/v1/documents/{documentId}/download/{artifactName}` | `client.documents.download(documentId, artifactName)` | Covered |
|
|
89
89
|
| `GET` | `/v1/documents/{documentSignatureHash}/verify` | `client.documents.verify(documentSignatureHash)` | Covered |
|
|
90
90
|
| `GET` | `/v1/documents/{documentId}/thumbnail` | `client.documents.thumbnail(documentId)` | Covered |
|
package/docs/COMPATIBILITY.md
CHANGED
|
@@ -65,12 +65,34 @@ the hourly renewal and expiration lifecycle, and expose portfolio filters.
|
|
|
65
65
|
OAuth reads require `documents:read`; writes require `documents:write` plus a
|
|
66
66
|
workspace plan with contract tracking.
|
|
67
67
|
|
|
68
|
+
Owner assignment is optional. Integrations that do not manage ownership can
|
|
69
|
+
omit `owner_id` without discovering or supplying workspace member IDs.
|
|
70
|
+
Workspace membership is never available to OAuth tokens, including those with
|
|
71
|
+
`account:read`: the member directory includes other members' and pending
|
|
72
|
+
invitees' emails, roles, and session-only data. Adding it to that scope would
|
|
73
|
+
expand existing grants without renewed consent.
|
|
74
|
+
|
|
75
|
+
For an explicit "assign to me" action, `client.oauth.getUserInfo()` calls
|
|
76
|
+
`GET /v1/oauth/userinfo` with the `openid` scope. Its `sub` is the signed-in
|
|
77
|
+
user's ID in the format accepted by `owner_id`; this does not enumerate other
|
|
78
|
+
members. Assignment to someone else by email is not a supported contract field.
|
|
79
|
+
|
|
80
|
+
An amendment's `apply_error` is human-readable text, not a stable code. Do not
|
|
81
|
+
parse it to select localized guidance. The published causes are a missing
|
|
82
|
+
contract-tracking plan, a parent that cannot accept the delta, an earlier signed
|
|
83
|
+
instrument still pending, a later signed instrument already applied, and an
|
|
84
|
+
unexpected failure. A machine-readable error code requires an API contract
|
|
85
|
+
addition before the SDK can expose it.
|
|
86
|
+
|
|
68
87
|
A sandbox may return the generic `404` while these routes are not deployed, or
|
|
69
88
|
`403` while its workspace plan does not include contract tracking. The SDK does
|
|
70
89
|
not reinterpret either response or route a sandbox request to production.
|
|
71
90
|
Read operations remain available after a production plan lapses; writes are
|
|
72
91
|
plan-gated. Signed amendments wait and the lifecycle catches up after the plan
|
|
73
92
|
returns, as defined by the production integration guide.
|
|
93
|
+
The current sandbox specification publishes neither the six CLM operations nor
|
|
94
|
+
activity paging. The SDK's `audit:api` checks the production contract; passing
|
|
95
|
+
sandbox smoke tests does not verify either capability.
|
|
74
96
|
|
|
75
97
|
`documents.details()` can expose `has_contract` only in a workspace context and
|
|
76
98
|
only when contract tracking is available. A missing key means unknown, not
|
|
@@ -146,8 +168,8 @@ identifier.
|
|
|
146
168
|
|
|
147
169
|
## List pagination
|
|
148
170
|
|
|
149
|
-
Two behaviours
|
|
150
|
-
surfaces as an error a caller could react to:
|
|
171
|
+
Two behaviours observed on document and signer lists are silent rather than
|
|
172
|
+
loud, so neither surfaces as an error a caller could react to:
|
|
151
173
|
|
|
152
174
|
- Only the hyphenated `per-page` is read. `per_page` is accepted and discarded,
|
|
153
175
|
and the response falls back to the default of 20 rows. The SDK normalizes
|
|
@@ -165,7 +187,49 @@ const { data, meta } = await client.documents.list({ 'per-page': MAX_LIST_PAGE_S
|
|
|
165
187
|
// page size the server actually applied — prefer it over the requested value.
|
|
166
188
|
```
|
|
167
189
|
|
|
168
|
-
`signers.findByEmail()` pins this maximum
|
|
190
|
+
`signers.findByEmail()` pins this maximum when scanning matching signer pages.
|
|
191
|
+
|
|
192
|
+
### Document activities
|
|
193
|
+
|
|
194
|
+
Production `GET /v1/documents/{documentId}/activities` is paginated: 20 entries
|
|
195
|
+
per page by default, with `page`, `per-page` (documented maximum 100), and `sort`
|
|
196
|
+
(`-id` for newest first, the default; `id` for oldest first). A page beyond the
|
|
197
|
+
end returns an empty `data` array. Its documented limit differs from the observed
|
|
198
|
+
50-row cap above; the SDK forwards the requested size without clamping it.
|
|
199
|
+
|
|
200
|
+
`documents.activities(documentId, params?)` continues to return
|
|
201
|
+
`IDocumentActivity[]`, normalizing an absent body to `[]`. It accepts `per_page`
|
|
202
|
+
as an alias for `per-page`, with the hyphenated form taking precedence. It makes
|
|
203
|
+
one request. Use `documents.listActivities()` to receive `{ data, meta }`, with
|
|
204
|
+
`current_page`, `per_page`, `total` and `last_page` parsed from the production
|
|
205
|
+
`X-Pagination-*` headers. `meta` is absent when the server sends no pagination
|
|
206
|
+
headers.
|
|
207
|
+
|
|
208
|
+
```ts
|
|
209
|
+
import type { IDocumentActivity } from '@assinafy/sdk';
|
|
210
|
+
|
|
211
|
+
const events: IDocumentActivity[] = [];
|
|
212
|
+
for (let page = 1; ; page++) {
|
|
213
|
+
const { data, meta } = await client.documents.listActivities('document-id', {
|
|
214
|
+
page, 'per-page': 100, sort: 'id',
|
|
215
|
+
});
|
|
216
|
+
events.push(...data);
|
|
217
|
+
// Unpaged sandbox responses have no meta and must be consumed only once.
|
|
218
|
+
if (!meta?.last_page || page >= meta.last_page || data.length === 0) break;
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Production's change from an unpaged history to a default page of 20 affects
|
|
223
|
+
existing clients even without an SDK upgrade: a successful request no longer
|
|
224
|
+
implies a complete activity log. SDK 2.9.1 and earlier cannot request later
|
|
225
|
+
pages through `activities()`. Integrations that need the full history must
|
|
226
|
+
upgrade to SDK 2.10.0 or later and explicitly traverse
|
|
227
|
+
pages. This SDK change does not automatically fetch the entire history.
|
|
228
|
+
|
|
229
|
+
Sandbox still serves an unpaged activity log and may ignore these parameters.
|
|
230
|
+
Do not use a loop that waits for an empty page on that deployment: it can keep
|
|
231
|
+
returning the same full log. A successful sandbox call does not verify production
|
|
232
|
+
pagination.
|
|
169
233
|
|
|
170
234
|
## Assignment list account context
|
|
171
235
|
|
package/docs/RELEASING.md
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
GitLab is the canonical repository and push-mirrors branches and tags to
|
|
4
4
|
GitHub. Publishing is performed by `.github/workflows/release.yml` when GitHub
|
|
5
5
|
receives a tag matching `v*`; a mirrored tag does not create a GitHub `release`
|
|
6
|
-
event,
|
|
6
|
+
event, so the workflow creates the GitHub Release page after both registries
|
|
7
|
+
accept the package.
|
|
7
8
|
|
|
8
9
|
## Release support matrix
|
|
9
10
|
|
|
@@ -116,9 +117,11 @@ The workflow serializes releases repository-wide and performs these steps:
|
|
|
116
117
|
and build once;
|
|
117
118
|
3. create one `.tgz` with lifecycle scripts disabled and record its SHA-256;
|
|
118
119
|
4. upload that archive and checksum as a seven-day workflow artifact;
|
|
119
|
-
5. verify and publish the archive to npm through trusted-publisher OIDC;
|
|
120
|
+
5. verify and publish the archive to npm through trusted-publisher OIDC;
|
|
120
121
|
6. verify and publish the **same bytes** to GitHub Packages using
|
|
121
|
-
`GITHUB_TOKEN
|
|
122
|
+
`GITHUB_TOKEN`; and
|
|
123
|
+
7. create the GitHub Release page with generated notes, the same `.tgz`, and
|
|
124
|
+
`SHA256SUMS` after both registries succeed.
|
|
122
125
|
|
|
123
126
|
The GitHub Packages job depends on npm publishing, preventing a GitHub-only
|
|
124
127
|
release when npm fails. Both registry jobs validate `SHA256SUMS`; neither
|
|
@@ -128,8 +131,9 @@ contract and must be preserved when editing the workflow.
|
|
|
128
131
|
## Verification and recovery
|
|
129
132
|
|
|
130
133
|
After publishing, confirm that the expected version appears on npm and GitHub
|
|
131
|
-
Packages,
|
|
132
|
-
|
|
134
|
+
Packages, the GitHub Release is marked latest with both verified assets, a
|
|
135
|
+
clean Node.js consumer can import both the ESM and CommonJS entrypoints, and
|
|
136
|
+
registry downloads have the expected checksum.
|
|
133
137
|
|
|
134
138
|
If packaging or npm publishing fails, fix the source, increment or retain the
|
|
135
139
|
version as registry state allows, and create a new tag only after review. Never
|
|
@@ -145,6 +149,9 @@ archive already published to npm. Do not repack an approximation or unpublish a
|
|
|
145
149
|
released npm version. If the artifact has expired, stop and review recovery with
|
|
146
150
|
the maintainers before changing workflow dependencies or registry state.
|
|
147
151
|
|
|
152
|
+
If both registries succeed and GitHub Release creation fails, rerun only the
|
|
153
|
+
failed release job while the workflow artifact is retained.
|
|
154
|
+
|
|
148
155
|
For a defective published release, prefer deprecating the affected version and
|
|
149
156
|
shipping a reviewed patch. Record the incident and remediation in the
|
|
150
157
|
changelog and any applicable security advisory.
|