Skip to content

fix: rewrite assets resource against the real SuperOps schema#8

Merged
asachs01 merged 1 commit into
mainfrom
fix/assets-real-schema
May 20, 2026
Merged

fix: rewrite assets resource against the real SuperOps schema#8
asachs01 merged 1 commit into
mainfrom
fix/assets-real-schema

Conversation

@asachs01
Copy link
Copy Markdown
Member

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 takes input: AssetIdentifierInput!
  • Asset selected non-existent fields (operatingSystem, ipAddress, macAddress, clientId, siteId, createdAt, …)
  • list used cursor Connections — SuperOps pagination is page-based

CI never caught it: tests/mocks/handlers.ts was hand-built to match the SDK's own wrong assumptions.

Changes

  • Asset type + AssetsResource rewritten against the real schema (SCHEMA.md): getAsset(input:), page-based getAssetList, updateAsset. Dropped createAsset/deleteAsset and listByClient/listBySite — not in the real API.
  • Shared page-based pagination added (Page<T>, PageParams, createPagePaginatedIterator) alongside the legacy cursor types, which stay until the other resources migrate.
  • Mocks + integration tests rewritten to mirror real SuperOps response shapes.
  • SCHEMA.md documents the schema and per-resource migration status.

Confidence

  • get() / update()high. getAsset(input: { assetId }) and the Asset field set are corroborated directly by the issue Multiple "Validation error of type FiledUndefined" when running example #4 error log.
  • list()best-effort. ListInfoInput and ListInfo field names come from public docs, not live introspection (flagged in SCHEMA.md). May need adjustment once verified against the API.

Verification

npm ci + lint + typecheck + build + test + smoke test all green; 104 tests pass.

⚠️ Release strategy — maintainer decision

This is a breaking change (Asset type + assets.list() shape), so the commit carries a BREAKING CHANGE: footer → semantic-release would cut v2.0.0 on merge, with only assets migrated and the other 11 resources still broken.

Alternative: squash-merge with a non-breaking message and hold the 2.0.0 tag until #7 is complete. Your call at merge time — I did not auto-merge this one.

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.
@asachs01 asachs01 merged commit f61fe25 into main May 20, 2026
2 checks passed
@asachs01 asachs01 deleted the fix/assets-real-schema branch May 20, 2026 22:15
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple "Validation error of type FiledUndefined" when running example

1 participant