Repository navigation
Releases: B-Jones-RFD/sp-rest-connect
Releases · B-Jones-RFD/sp-rest-connect
Release list
v5.1.1
v5.1.0
Minor Changes
- 027d0b8: Add
queryListItems(CAML queries viaGetItems, for lists above the 5,000-item view threshold, withpagingInfosupport),batch(several REST calls in one/_api/$batchround trip on SharePoint 2016+, consecutive writes grouped into a changeset, oneBatchResponseper request), andRetry-Afterhandling:Failure.retryAfterMscarries the server's requested wait, and the retry logic honours it — or stops early when it exceedsmaxDelayMs.parseRetryAfteris exported. New types:QueryListItemsOptions,BatchOptions,BatchRequest,BatchResponse,BatchMethod,ItemsAction,ItemsActionFactory.
v5.0.0
Major Changes
- 24325b0: Remove the APIs deprecated during 4.x.Breaking changes-
accessTokenhas been removed from every write action. UserequestDigest, or omit it and let the connection manage the digest.-addListItem.payloadandupdateListItem.patchno longer accept a JSON string; pass a plain object. The entity type is resolved automatically.-addListItemresolves to the created item (T & { Id: number }, via a new type parameter) instead of a raw JSON string. ReplaceJSON.parse(res.data).Idwithres.data.Id. Both thenometadataandverboseresponse shapes are accepted; a response without anIdis aPARSEfailure.- The NTLM transport (get,post,auth,request, and the message builders) is no longer exported.SpRestErrorandparseSharePointErrorremain public.See "Migrating to 5.0" in the README. Everything added in 4.x — structuredFailurecodes,signal,agentOptions,retry, typed reads, paging, themanaged digest, and streams — is unchanged.
v4.3.0
Minor Changes
- f4d50fe: Managed request digest, object payloads, and streaming uploads/downloads.-
requestDigestis now optional on every write. When omitted, the connection fetches a digest, caches it until a minute before SharePoint says it expires, shares one fetch between concurrent writes, and on a 403 refreshes it and retries the write once. PassrequestDigestto bypass the cache. Standalone factories accept aConnectionContext(from the newcreateConnectionContext) as a second argument to share the cache.-addListItem.payloadandupdateListItem.patchaccept plain objects. The list's entity type is looked up once per list and cached; include__metadata.typeyourself to skip the lookup. The JSON-string form still works but is deprecated and will be removed in 5.0.- Streams.addDocumentToLibraryaccepts aReadableaspayload(plus optionalcontentLength; chunked otherwise). NewgetDocumentStreamFromLibraryreturns aReadableinstead of aBuffer. A stream upload is not retried on a stale managed digest.- New exports:createConnectionContext,getDocumentStreamFromLibrary, and typesConnectionContext,DigestCache,EntityTypeCache,ListItemPayload,GetDocumentStreamFromLibraryOptions.- Quick start and examples simplified accordingly.
v4.2.0
Minor Changes
- fc36ffd: Typed reads, paging helpers, and opt-in retry.- Type parameters on reads.
getListContents<T>,getFolderContents<T>andgetListItem<T>returnT[]/Tinstead ofunknown. The default is stillunknown, so existing code compiles unchanged.- Paging. A successfulgetListContents/getFolderContentsresult now carriesnextLinkwhen SharePoint has more items. New actions follow it:getNextPage({ nextLink })(same-origin links only),getAllListContents/getAllFolderContents(every page in one array; a failed page fails the whole call), anditerateListContents/iterateFolderContents(async iterators yielding onePageResultper page). All acceptmaxPages.- Retry.SiteConnectionOptions.retryenables exponential-backoff retry (full jitter) of read actions that fail withNETWORK,TIMEOUT, or HTTP 429/502/503/504. Writes are never retried.isTransientFailureis exported as the default predicate.- New exported types:Page,PageResult,PagedAction,TypedAction,PagedIterator,RetryOptions,GetNextPageOptions,PagingOptions,GetAllListContentsOptions,GetAllFolderContentsOptions.
v4.1.0
Minor Changes
- f0642b4: Structured failures, request cancellation, TLS options and startup validation.-
Failureis now structured. Every failure carriescode('HTTP' | 'AUTH' | 'TIMEOUT' | 'ABORTED' | 'NETWORK' | 'PARSE' | 'UNKNOWN'), plusstatusanddetails({ code, message }parsed from SharePoint's error body) for HTTP responses. Branch oncodeinstead of matchingerrortext.codeis a required property ofFailure; code that constructsFailureobjects by hand must add it.- Error messages no longer include a redundantError:prefix and now readError in <action>: HTTP <status>: <SharePoint message>for server responses.-signal?: AbortSignalis accepted by every action; aborting yields aFailurewith codeABORTED.timeoutis documented as a socket inactivity timeout.-agentOptions?: https.AgentOptionsonSiteConnectionOptionspassesca,rejectUnauthorized, client certificates,lookup, etc. to the HTTP agent, so internal CAs no longer needNODE_TLS_REJECT_UNAUTHORIZED=0.-createSiteConnectionvalidates its options and throws aTypeErrorfor a protocol or path insidesite, aserverRelativeUrlwithout a leading slash or with a trailing slash, or an unknownprotocol.-SpRestErrorandparseSharePointErrorare exported.- Supported Node.js range widened to>=20.- Published with npm provenance. - f0642b4: Structured failures, request cancellation, TLS options and startup validation.
v1.0.1
Patch Changes
- 4ddb1a3: Resolve type error
v1.0.0
Major Changes
- 0cd91e1: Move to stable
v0.6.0
Minor Changes
- 8643fc7: Added support to set timeout and binary in configuration
v0.5.2
Patch Changes
- a475240: Improved error messaging