Repository navigation
build(deps): move to ts-client 7, with typed API calls and checked request bodies - #346
Conversation
Replace the 6.x session globals and raw HTTP helpers with the v7 typed client, session and realtime API. Calls keep the 6.x reject-on-error behaviour through the compat helpers. - common/placeos.ts holds the auth session, client and realtime - request bodies keep only schema fields (newItem, toBody) - serve oauth-resp.html from the package root for the frame login - build jobs use /api/engine/v2/build - driver recompile and reload read text responses - server error text no longer reaches the console or Sentry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[High impact] The changes since the previous review appear safe to merge. SummaryMoves Backoffice to
Reviews (9) · Last reviewed commit: "fix(triggers): a new trigger gets POST a..." · Reviewed by Greptile |
ts-client now reads the driver recompile and reload replies as text, keeps a plain-text error body in the http error, and navigates only to http and https URLs. Remove the local operations, the error text reader and the navigate hook that did this in backoffice. readError shows a plain-text error body, and the debug log leaves out the new error text. Refs PlaceOS/ts-client#37 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e out of Sentry - extensions and the history comparison get parsed metadata details, as 6.x gave them - history version dates use milliseconds, so they no longer show 1970 - Sentry does not record console output, where error toasts put the message of the server Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- one collectPages in common/types, used by cascade delete and the zone export. A next() that gives null now fails the cascade plan instead of giving a short list - httpError, settingsLevels and toUser replace repeated code - remove cleanObject calls around toBody, which drops null already - remove apiClient, the binding directive ngOnInit and unused types - derive the signage AI provider type from the API type - the debug log copies nothing while window.debug is off Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… on load - forms save through ACTIONS.<type>.save, and a crudActions factory builds the plain item actions - zone trigger links send only `triggers`, so other edits stay - activeOf types the active item with its settings, so state services need no casts - withEmptyLists gives `[]` for null value lists of the active item and settings keys, so reads need no guards - the item counts and the metadata tab share one metadata load - errors.ts reads the parsed CallError, with no raw Response branches - form models and the chip-list use readonly arrays - cluster task names load nodes without their status Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- object-list-field: a value in a new row went to the row with the field's index, so tenant booking limits and SAML attribute mappings were lost - SAML: a new source leaves out empty values, so the API gives its defaults and does not refuse an empty name identifier format. The attribute and runtime parameter maps update without a delay, so a quick save keeps them - users: the email of a saved user is read-only, as the API keeps it - API keys: the edit form shows the assigned user - modules: the header status follows start and stop - edges: "Last seen" reads the time in seconds, and shows "Never" for a new edge - extensions: an extension with no conditions no longer breaks the list - brokers: the edit button says "Edit MQTT Broker" and has an accessible name Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Specs for zones, systems, users, groups, domains, triggers, admin, repositories, drivers and modules against the local PlaceOS stack. Each test makes its own data through the API, checks the result through the API, and removes the data with the new `cleanup` fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A module start or stop reply changes the active item only when the same module is still active, and it copies the current item. Before, a reply after a move to another section made the old module the active item there - `loadMetadataBlocks` shares only a load that is still running. A finished load is not used again, so a metadata write from an extension or the user settings is seen at once. `forgetMetadataBlocks` is removed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MrYuion
left a comment
There was a problem hiding this comment.
Note
🤖 Claude Opus 5.5 responding on behalf of Alex
Review of 5dc98e68 against develop: 3 regressions from 6.x and 2 nits, inline below.
I checked the 5 "Fixed in" replies against the code. All are true: parseMetadataDetails is used for the extension reply and the history diff, both history selectors multiply updated_at by 1000, Sentry drops the Console integration, toggleModuleState reads active_item again before replaceItem, and loadMetadataBlocks shares only a running load. The secret_expiry answer matches the 6.x behaviour.
Checks on this head: bun run test:ci passes (129 files, 1079 tests). bun run lint passes. tsc -p tsconfig.app.json passes. tsc -p tsconfig.spec.json gives 10 errors (Promise.withResolvers lib target, mock types). CI does not run that check, and the lines with the errors are not changed by this PR.
I compared with the @placeos/ts-client@6.11.0 source and dropped findings where 6.x did the same thing. For example, the bulk import spread a PlaceModule into a plain object, so toJSON never removed control_system_id.
…ty webhook methods
- An extension `load` of a block that does not exist gives `{}` again.
- The route guard waits for the connection with no time limit, as 6.x did.
Only the user load has the 60 s limit.
- A saved trigger with no webhook methods keeps the empty list. Only a new
trigger gets `POST`. The server always sends the list.
- A new metadata block shows no update time until it is saved.
- The `mapPage` doc comment is above `mapPage`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The create flow gives the form `newItem(Trigger)`, so the form always has a trigger and the `POST` default did not apply. Now a saved trigger keeps its list, also when it is empty. A copy keeps its list. An unsaved trigger with an empty list gets `POST`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Backoffice used
@placeos/ts-client6.x. Version 7 replaces the global session and the raw HTTP helpers with a generated, typed client. It also rejects request bodies that have fields the schema does not know.This PR moves backoffice to
^7.0.0-next.2.How
common/placeos.tscreates the auth session, the API client and the realtime client. It also givesnewItemandtoBody, so request bodies contain only the fields in the schema.orThrowandorThrowPage. A failed call still rejects, as in 6.x.ACTIONS.<type>.save.activeOftypes the active item.withEmptyListsgives[]where v7 givesnullfor a list the server leaves out, as the 6.x classes did.oauth-resp.htmlnow comes from the package root. Before this change, a clean build did not have it, and the silent frame login failed./api/engine/v2/build/*.next.1 had three client problems that needed workarounds here (PlaceOS/ts-client#37). next.2 fixes them, so the second commit removes the workarounds.
Local stack e2e tests
e2e/src/local/now has specs for the main user stories: zones, systems, users, groups, domains, triggers, admin, repositories, drivers and modules. Each test makes its own data through the API, checks the result through the API, and removes the data with the newcleanupfixture.e2e/README.mdlists the coverage and the stories that the local stack cannot run (no core, build service or upload store).Bugs the new tests found
These were also on
develop.object-list-fieldsent a value in a new row to the row with the field's index. Tenant booking limits and SAML attribute mappings were lost.name_identifier_format: '', and the API refused it with a 422. A new source now leaves out empty values, so the API gives its defaults. The attribute and runtime parameter maps also updated 200 ms after a change, so a quick save lost them. They now update at once.conditionsbroke the extensions list.Behaviour changes
triggers, so other edits to the zone stay.Testing
tscandngc: 0 errors. The spec type check has the same 10 errors asdevelop.AC-ADM-011-4sometimes fails and then passes on retry (3 in 10 ondeveloptoo): its helper presses ArrowDown before the debounced user search starts.e2e/stack): 175 pass, setup included. The specs I changed for these fixes also passed twice in a row.Five rounds of multi-model review checked the first commit. All blockers are fixed. The later commits (the workaround removal, the review fixes, two cleanup passes, the e2e specs and the bug fixes) had no council review.
Created with Claude Opus 5.5 in Claude Code, with review by gpt-6.2-sol.
🤖 Generated with Claude Code