Release 4.0.0 #1
Loading…
Reference in a new issue
No description provided.
Delete branch "4.0.0-develop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Release 4.0.0. The full list of changes, breaking changes and migration notes is in CHANGELOG.md; the wiki's Migrating from 3.x and Handoff pages cover the rest.
Highlights:
restapimodule and the OpenText optional modules of a live 26.1 server register (SAP and Engineering follow in 4.2.0).V1,V3); version gating and detection; normalisedresponse.resultfor every entity kind with a readable shape.@ulyxie/cs-rest/<module>), ES modules only, Node 20.19+ / Bun / browsers.Checks: build, 1200 tests, the declaration check (bundler / nodenext / node10), the generated-files check, coverage 0 remaining.
master and 4.0.0-develop shared no history;
d0e0ee3joins master's 3.x commit as an ancestor without taking anything from it (4.0.0 already carries its two fixes), so this merges as a fast-forward.Merging and pushing a
v4.0.0tag runs publish.yml, which stages the release on npm; it goes live only when approved with 2FA.🤖 Generated with Claude Code
The first batch of operations a live 26.1 server serves that OpenText's spec leaves out, from the core restapi module: - nodes: createZip, zipStatus, zipContent, downloadZip (zip-and-download), state, descendantSubtypesExist, appContainer, appContainerPage, propertiesActionsV1 - versions.listActionsV1 - members: preferences, updatePreferences, myPhotoV1, userPickListV1, groupPickListV1 - permissions.check - server: settings, setting, updateSetting - forms.memberPreferencesFormV1 They return TUndocumented, a new exported type: the server declares no schema for them. Their JSDoc says they are undocumented, and names what is unverified - the zip job type, the preference values and how a setting value is sent. Four routes are recorded as coverage skips: PUT /v2/csui/favorites and GET /v1/forms/info, which the server's own source marks deprecated; GET /v1/forms/nodes/info, the same deprecated action; and POST /v1/members/{id}, the same update as PUT. coverage.mjs takes --spec and --by module to measure against the live list, and no longer reports live-only templates as strays when measuring against the published spec. Against the live list: 345 of 1366 covered, 17 skipped. QUESTIONS.md Q14 asks which optional modules to cover next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Every operation the core restapi module of a live 26.1 server registers now has a method: 371 of 377, the other 6 recorded as coverage skips. This batch covers the remaining 122 routes. New handlers: - recman: RM classifications, holds, RSIs, security clearances, cross-references, disposition review - physicalObjects: borrowing, requests, returns, locators, transfers, labels, circulation - classifications, video, wopi - admin: lladmin, clustermgmt and admin (install, licences, modules, OTDS, cluster, database upgrade) Added to existing handlers: module and widget assignments on members, nodes.objectShareV1 / releaseObjectShareV1 / addFromTemplateV1, forms.rmClassificationsFormV1, webreports.parametersByIdV1 and destinationByNicknameV1. The four v3 routes take a V3 suffix (Q1's first option): nodes.appContainerV3, appContainerPageV3, server.statusV3, auth.tokenExpiryV3. The POST form of ModuleAssignmentCounts is a coverage skip, being the same action as the GET. Most of these routes dispatch to server actions that declare no fields, so their writes take a fields object sent as the body parameter, and their JSDoc says the fields are unverified. Gating fix: GET /v1/nodes/{id}/parameters and GET /v1/webreports/{nickname}/destination left the published spec after 20.4 but 26.1 still serves both, so gating refused them on every later release. generate-capabilities now treats the live route lists as evidence against a removal. test/requests.test.mjs checks the method, URL, query and fields each new method sends, against a fake adapter (134 tests). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>The core - Session, auth, version detection and gating, the normaliser, and the nodes, versions, members, categories, permissions, volumes, uploads, search, forms and server handlers - stays at the package root. Everything else moves to its own subpath, which adds its getter to every Session when imported once: import "@ulyxie/cs-rest/workflow"; // session.workflow Modules: admin, ai, classifications, perspectives, physical-objects (session.physicalObjects), recman, reminders, rpc (session.rhcore and session.rpcClient(), plus RPCClient / RPCError / isRPCError), signatures, video, viewx, webreports, wopi, workflow. - Before its import a module's getter throws, naming the import it needs. - session.use(Handler) returns the Session's instance of any handler; the getters go through it. - registerModule(name, Handler) and the SessionModules interface let a third-party handler attach itself the same way. ServiceAbstract is exported to build one on. The build is now tsc alone, one ES module per source file, so the core and every module share a single Session class and an app's bundler drops what it does not import. Measured with esbuild from the packed tarball, minified: core 64 KB (12.7 KB gzip), everything 91 KB (17.0 KB). microbundle and the CJS build are gone; engines is now >= 20.19, where require() of ES modules works unflagged. File paths for uploads and downloads go through a "#platform" import, which resolves to fs on Node and Bun and to a stub that explains itself in browsers. The dynamic import("fs") it replaces made esbuild and webpack fail to bundle the package for the browser at all. check:dts now compiles test/types/ against the shipped declarations under bundler and nodenext resolution, strict and with skipLibCheck off. The tests import through the package's own exports map; test/modules.test.mjs covers the module mechanics. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>The Session no longer wraps an axios instance. An HttpClient builds each request - URL, query string, multipart body, ticket - and hands it to a transport, by default the platform's own fetch, so the package has no runtime dependencies. Measured with esbuild from the packed tarball, minified and gzipped, the core goes from 31.8 KB with axios to 13.4 KB. - Methods resolve with TResponse ({ data, status, statusText, headers }); data is unchanged. - Any status outside 2xx rejects with an HTTPError whose response carries status and data, as an axios error did, whichever transport was used; isHTTPError() tells them apart. The message includes Content Server's own error text. - New Session options: fetch (a fetch to use, e.g. with an undici dispatcher for a proxy or a private CA), transport, headers. - @ulyxie/cs-rest/axios exports axiosTransport(instance), for axios's proxy handling, agents and interceptors. It takes the caller's instance and never imports axios, which is now an optional peer dependency. - Username/password Sessions sign in once, shared by concurrent first requests; a failed sign-in is retried by the next request. - "arraybuffer" answers are ArrayBuffers in Node too, and "stream" a web ReadableStream; downloadTo() writes either to disk. - session.axios is gone. test/http.test.mjs covers URL and query building, body encoding, sign-in, ticket refresh, decoding, errors, path uploads and downloads, and the axios transport behaving identically (155 tests). Smoke-tested on Bun 1.1.38. README, CHANGELOG and QUESTIONS.md (Q15: defaults to review) updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Live testing on the 26.1 dev server showed every upload held in memory, each runtime for its own reason: - Node's fetch buffers any request body, FormData or stream, built-in or the undici package, with or without a dispatcher; - Bun's fetch, and Node's FormData encoding, read file parts fully; - axios in Node copies the body for follow-redirects. So: - In Node the default transport is now Node's own http / https (http/node-transport.ts, reached only through #platform, so browser bundles never see it). A new `agent` option takes an https.Agent for a private CA, a proxy or a custom lookup. Bun and browsers keep fetch. - On Node and Bun, multipart bodies are encoded by the library as a stream with an exact Content-Length (http/multipart.ts). Browsers keep their native FormData, which they stream from disk. - The axios transport sends uploads with maxRedirects 0. A 512 MB upload now costs +0 MB in Node and Bun and +9 MB through axios, against +529, +515 and +452 MB before. The core browser bundle is unchanged at 13.5 KB gzipped. Live tests, not part of npm test, configured by .env (ignored by git): - test:live (test/live/smoke.mjs): 17/17 on the dev server through the default transport, a custom fetch and axios; - test:live:large (test/live/large.mjs): 512 MB uploads stream and download back with matching checksums. Large File Upload's parts and completion succeed, but creating the node then fails on that server ("Could not close stream cursor"), identically on both transports - a server-side fault, noted in the wiki Handoff. undici is a dev dependency for the live tests' dispatcher. Unit tests: 162, including the Node transport against a real local server and every form body decoded by a standard multipart parser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Every route of the recman, recmansecurity and physicalobjects modules in the live 26.1 route list now has a method, on the existing handlers: - session.recman (+105): RM settings, field and function access, the code tables and their imports; record counts, record create info and actions on several nodes at once; holds as objects (v1 and v2), hold items and maintenance, user holds; RSIs and their retention schedules (create, update, delete, stages, approval, history, items); cross-reference types; disposition searches, their runs, results and reviewer views; the RM processing queue; the RM forms; and security clearances (recmansecurity): clearance codes and settings, node clearance levels and supplemental markings, and each user's clearance. - session.physicalObjects (+50): circulation of several items at once (borrow, return, request, acknowledge, pickup, labels, locators, transfers, boxes, metadata), the v2 circulation lists and the user's borrowed and requested items, boxes, locators and transfers, code tables, media types, imports, and the PO forms. Routes that declare their fields are typed (RSIs and schedules, user holds, user clearance); the rest take `fields`, as before. Imports go as flat form fields so a File can be sent. Coverage skips: GET /v2/hold (the same Hold object as GET /v2/holds/{id}, hold()) and PUT /v2/rsischedule (the same RetentionPolicyUpdate object as PUT /v2/rsischedules/{id}, updateRsi(), with the id in the body). Every GET was called, read-only, on the 26.1 dev server; the shapes and required parameters it showed are in the JSDoc. That server has no holds or RSIs, so single-hold and single-RSI reads were seen only with no id. No writes were sent. Against the live list: 622 / 1361, 719 remaining. Tests: 317. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Every live-list route outside Extended ECM, SAP and Engineering now has a method, except othcm (Extended ECM for SAP SuccessFactors) and ual (ArchiveLink for SAP), left for the SAP batch. Joining existing handlers: - workflow: webwork (13) and wfinitiatefromitem (itemWorkflows) - viewx: viewx (publicationV1, nodeDbStringsV1, settingsV1, tokenV1, transformsV1) and the classic docviewer (viewV1) - signatures: signatureproviders (6) - signing as a workflow step - perspectives: the v1 perspective object (5) - classifications: the classification module (5) - webreports.processorV1, ai.authCheck, office.reprocessProtection (cpmaip), physicalObjects.barcode (barcode) - core, kept small: search (websbroker search-broker reads, 5), forms.documentTypeAttributesFormV1, nodes.intelligentFilingOverview and setIntelligentFilingOAuth (metadata), auth.logoutTokenV1, server.smartUiSettingsV1 and batchV1 (csui) New modules: sharing (contentsharing, 26), pulse (socialobject + socialfeed, 19), notifications (messagecenter + webnotify, 15), regulated (controlledviewing + wlrd + esign/fdausers, 12), wiki (9), email (otemail, 4), forums, syndication (qds), webedit, salesforce (salesforceinterface) (3 each), sharepoint-archive (enterprisearchivesp, 2). Coverage skips: GET /v1/search (POST form used), PUT /v2/pulse/members/{id} (same object as the POST), and the four POST /v2/csapplications/<action> routes, which server.csApplication(action) reaches through the published template. GETs were read on the 26.1 dev server (74 calls, no writes) and the answers folded into JSDoc. 503 tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>The Extended ECM modules of the live 26.1 route list - xecmpf, xecmgov, xecmoffice, xgovexpimp and xecmgw, 237 routes - now have methods (221 for 230 routes; 7 coverage skips). Four new modules: - @ulyxie/cs-rest/workspaces (session.workspaces, 98): the xecmpf platform - workspace documents and dossiers, file upload by document type, workspace references, business attachments on workspaces, nodes and business objects, external systems, business object types and their policies, completeness checks, Extended ECM permissions and members, unique names, ECMLink licensing, the web viewer, CMIS, document generation, transports, deletion through review workflows, the application-integration workflows (xecmpfappintgn), xecmxo records, and the xecmgw gateway. - @ulyxie/cs-rest/event-action-center (session.eventActionCenter, 14). - @ulyxie/cs-rest/smart-document-types (session.smartDocumentTypes, 24): smart document types, their rules and bots, scheduled bots and jobs, and the expression builder. - @ulyxie/cs-rest/government (session.government, 56): Extended ECM for Government (xGov) with its xdomea export and import. Extended ECM for Microsoft 365 (xecmoffice, 29) joins session.office: group and Teams associations, content and member sync, Teams archiving, picker configuration. Coverage skips: the second registrations of SaveDocument, the workspace reference update and the three document-deletion objects (under /v2/othcm/...), and GET / PUT /v2/nodes/{id}/xgovpermissions, which 26.1 registers without a handler. Every GET that changes nothing was read on the 26.1 dev server (78 calls, 50 answered 200; no writes sent) and the findings are in the JSDoc: dossier requires group_by, archiveRecord wants ext_record_id or archive_id with document_id, most workspace reads need a business workspace or business object configuration, the application-integration reads need Process Automation configured. Request tests: 733. The workspaces themselves (GET/POST/PUT /v2/businessworkspaces and their members, related items and icons) are otsapxecm routes, still to come. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>The dev server's Physical Objects module has no media types, so no physical item can exist there; every write was reached with a scratch document (logged, deleted and purged) or with ids that do not exist, and its fields taken from the Physical Objects Smart View bundle and the forms. - cancelRequested sent `id`; the server wants request ids as repeated `ids` query keys ("The list of ID is empty"). It now takes an array. - borrowManyV1, returnManyV1, boxManyV1 and borrowRequested send flat form fields, as Smart View does, so an AddDesktopDoc file can go in. - The circulation writes take their ids directly and send them as each route expects: an array (request, acknowledge, flag for pickup) or space-separated (labels, locators, transfers, boxes, metadata, properties, media types, history purge, request cancel). - The borrowed-item member routes type `node_id`, which the server requires ("Missing required parameter 'Node ID'"); assignLocatorV1 types facility / area / box_locator; generateLabelsForManyV1 requires label_type ("Label type is not defined"); synchronizeFromToDatesV1 sends no body. - JSDoc records each route's answer on 26.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Checked the wiki, forums, Pulse, notifications, sharing, email and syndication writes against the dev server, every object created logged and removed (/work/cs-rest-live-writes.md, outside the repo). - wiki.autosave sent its fields in `body`: answered 200, nothing saved. Now flat form fields; autosaved() documented as taking the page id. - Pulse writes never reached the server ("status" required inside body). updateStatusV1(status, { CSID }), commentV1(id, status), statusActionV1(id, action) and destroyStatusV1(id) send flat fields; the id is the status's feed event id, not the node a status is stored as. - email.upgradeMetadataV1 sends `items` as a JSON string in a flat field. - notifications.setWatch and setState(provider) go URL-encoded, and syndication.syndicate / consolidate as flat fields with OScript lists, as Smart View sends them (unverified: notifications and syndication are not set up on that server). - forums.subscribe, wiki.deleteAutosave, sharing.shareOptionsV1 verified; the error answers of the rest are in their JSDoc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>The last write-verification run, logged in full on the dev server: - reminders.add / update send `data` as one JSON form field, as Smart View does; inside `body` 26.1 refused it ("value must be a String"). Their JSDoc lists the fields the UI sends. - regulated.reassignControlledCopy sends plain fields with the copy list JSON-encoded; inside `body` 26.1 refused controlledCopyDetails. - wopi.lockV1 / refreshLockV1 send lock_id as a form field; the WOPI module does not read `body`. The lock routes still answer 403 to a plain ticket, and the csnodes WOPI routes report failure inside a 200 - both documented. - classifications.addV1 types its fields; update and bulk removal take a single integer class_id. - Verified as they were: nodes.createZip with type "zipanddownload" (the job ran, the archive held both documents; status shape and the job's lifecycle documented), workflow.createDraft / updateDraft (the draft is a node, removed with nodes.delete), office.create and categoryInheritanceV1, classifying and unclassifying a document. QUESTIONS.md Q14 records the zip job type as verified. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>test/gating.test.mjs (28): supports()/assertSupported() for operations added in a release and removed after one, the two "still served" entries never refused, unknown operations allowed, "latest" gating nothing, UnsupportedOperationError's fields and message, gated() URL building (value count, missing values, path-segment encoding), and detectVersion against a fake serverinfo: an exact release, one with no spec, newer than the newest, older than the oldest, no version, a configured release overridden, an unreachable server, and detection made once for concurrent first calls. test/compat.test.mjs (29): every shim in CHANGELOG.md's breaking-changes tables reaches the generation 3.x used, warns once per method, and resolves with the shape 3.x code expects. Fixes the tests exposed: - workflow.draftprocesses(), draftprocessesUpdate() and draftprocessesPut() never warned, though the changelog lists them as deprecated with a warning. They now do; workflow.start() and WorkflowInitiator, which used them internally, call createDraft / updateDraft / forms.draftProcessUpdateV1 instead, so they stay silent and still resolve with the body. - volumes.volumes("v1"), volumeInfo(type, "v2") and browse(type, "v1") sent the leftover API version as a query string (?0=v&1=1) on the v2 route. They now throw a TypeError naming the method to call, as the changelog says such calls do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>The runner image ships no yarn. setup-node's `cache: 'yarn'` looked yarn up before any step could install it, so the first CI run on the 4.0.0 pull request failed in 8 seconds ("Unable to locate executable file: yarn"), and publish.yml would have failed the same way on a release tag. Both now install yarn 1.22.22 from npm after setting up Node, without the cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>