fix: rewrite assets resource against the real SuperOps schema#8
Merged
Conversation
Closes #4. The assets resource queried a schema that does not exist: getAsset took `id` (real API: `input: AssetIdentifierInput!`), the Asset type selected fields the real type lacks (`operatingSystem`, `ipAddress`, `clientId`, …), and list used cursor connections where SuperOps is page-based. The server rejected every field. - Rewrite the Asset type and AssetsResource against SuperOps' real GraphQL schema (see SCHEMA.md): `getAsset(input:)`, page-based `getAssetList`, `updateAsset`. Drop createAsset/deleteAsset and listByClient/listBySite — not present in the real API. - Add a shared page-based pagination layer (Page<T>, PageParams, createPagePaginatedIterator) alongside the legacy cursor types, which remain for not-yet-migrated resources. - Rewrite the assets mocks to mirror real SuperOps response shapes, and the assets integration tests to the new surface. - Add SCHEMA.md documenting the real schema and migration status. This is a breaking change to the assets API. The other 11 resources are still on the assumed schema; full migration is tracked in #7. BREAKING CHANGE: assets resource API and the Asset type changed to match SuperOps' real GraphQL schema; assets.list() now returns a page-based Page<Asset> instead of a cursor Connection.
github-actions Bot
pushed a commit
that referenced
this pull request
May 20, 2026
# [2.0.0](v1.0.5...v2.0.0) (2026-05-20) ### Bug Fixes * rewrite assets resource against the real SuperOps schema ([#8](#8)) ([f61fe25](f61fe25)), closes [#4](#4) ### BREAKING CHANGES * assets resource API and the Asset type changed to match SuperOps' real GraphQL schema; assets.list() now returns a page-based Page<Asset> instead of a cursor Connection.
asachs01
added a commit
that referenced
this pull request
May 21, 2026
Completes the v2 migration started for assets in #8. Every remaining resource queried an assumed schema the real SuperOps API rejects. Migrate tickets, clients, sites, alerts, contracts, technicians and knowledge-base to SuperOps' real schema. Remove runbooks, patches, remote-sessions and reports (no SuperOps API equivalent). Split test mocks per resource; update SCHEMA.md and README. Fidelity caveat: corrected from public docs, not live introspection; unverified input-type fields are flagged in source. Closes #7 BREAKING CHANGE: all resource APIs changed to match SuperOps' real GraphQL schema; list methods return page-based Page<T>; the runbooks, patches, remoteSessions and reports resources were removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4. First increment of the v2.0.0 migration (#7).
Problem
The SDK was built against an assumed GraphQL schema that doesn't match SuperOps' real API. For
assets, the server rejected nearly every field:getAsset(id:)— real API takesinput: AssetIdentifierInput!Assetselected non-existent fields (operatingSystem,ipAddress,macAddress,clientId,siteId,createdAt, …)Connections — SuperOps pagination is page-basedCI never caught it:
tests/mocks/handlers.tswas hand-built to match the SDK's own wrong assumptions.Changes
Assettype +AssetsResourcerewritten against the real schema (SCHEMA.md):getAsset(input:), page-basedgetAssetList,updateAsset. DroppedcreateAsset/deleteAssetandlistByClient/listBySite— not in the real API.Page<T>,PageParams,createPagePaginatedIterator) alongside the legacy cursor types, which stay until the other resources migrate.SCHEMA.mddocuments the schema and per-resource migration status.Confidence
get()/update()— high.getAsset(input: { assetId })and theAssetfield set are corroborated directly by the issue Multiple "Validation error of type FiledUndefined" when running example #4 error log.list()— best-effort.ListInfoInputandListInfofield names come from public docs, not live introspection (flagged inSCHEMA.md). May need adjustment once verified against the API.Verification
npm ci+ lint + typecheck + build + test + smoke test all green; 104 tests pass.This is a breaking change (
Assettype +assets.list()shape), so the commit carries aBREAKING CHANGE:footer → semantic-release would cut v2.0.0 on merge, with onlyassetsmigrated and the other 11 resources still broken.Alternative: squash-merge with a non-breaking message and hold the
2.0.0tag until #7 is complete. Your call at merge time — I did not auto-merge this one.