Skip to content

Requirements: Arda API Proxy

The HttpClient class accepts a ProxyConfig (host, apiKey) and a basePath string. It uses these to build fully qualified URLs for all requests.

Every HTTP request sent by HttpClient includes:

  • X-Author header set to the configured apiKey
  • Content-Type: application/json

REQ-CORE-003: URL Building with Time Coordinates

Section titled “REQ-CORE-003: URL Building with Time Coordinates”

HttpClient.buildUrl appends optional effectiveasof and recordedasof query parameters when TimeCoordinateParams are provided.

When a response has a non-OK HTTP status, HttpClient throws an ArdaApiError containing the status code, responseMessage, and details parsed from the response body.

The package has zero runtime (non-dev) dependencies. It relies only on the Node.js 18.18+ native fetch API.

The package must not import or depend on @modelcontextprotocol/sdk or any MCP-specific code.

The package exports the following shared types, faithful to the Arda API contracts:

  • TimeCoordinates — bitemporal effective/recorded pair
  • EntityRecord<TPayload, TMetadata> — standard response envelope
  • PageResult<TPayload, TMetadata> — paginated response wrapper
  • Query, Filter, Sort, SortEntry, SortDirection, Pagination
  • HistoryRequestBody
  • ErrorResponse
  • TimeCoordinateParams
  • ProxyConfig

Each proxy class is independently instantiable with a ProxyConfig object. The caller is responsible for sourcing host and apiKey values.

REQ-PROXY-002: Composition over Inheritance

Section titled “REQ-PROXY-002: Composition over Inheritance”

Proxies hold a reference to an HttpClient instance (composition). They do not extend a base class.

Every proxy wrapping a standard Arda entity endpoint exposes:

MethodHTTPPath
create(input, params?)POST /{entity}Create entity
get(entityId, params?)GET /{entity}/{entityId}Get by entity ID
getByRecordId(recordId)GET /{entity}/rid/{recordId}Get by record ID
update(entityId, input, params?)PUT /{entity}/{entityId}Update entity
delete(entityId, params?)DELETE /{entity}/{entityId}Delete entity
query(query)POST /{entity}/queryQuery with filter/sort/page
queryHistory(entityId, body)POST /{entity}/{entityId}/historyAudit history

Where params is optional TimeCoordinateParams.


Provides standard CRUD operations for /v1/tenant.

Provides standard CRUD operations for /v1/user-account.

Provides standard CRUD operations for /v1/agent-for.

Provides standard CRUD operations for /v1/invitation.


REQ-REF-001: BusinessAffiliateProxy — Standard Operations

Section titled “REQ-REF-001: BusinessAffiliateProxy — Standard Operations”

Provides standard CRUD operations for /v1/business-affiliate.

REQ-REF-002: BusinessAffiliateProxy — Detail and Role Operations

Section titled “REQ-REF-002: BusinessAffiliateProxy — Detail and Role Operations”

Beyond standard CRUD:

MethodHTTPPath
getWithDetails(entityId, params?)GET/business-affiliate/with-details/{entityId}
getRoles(entityId)GET/business-affiliate/{entityId}/roles
createRole(entityId, input)POST/business-affiliate/{entityId}/roles
updateRole(entityId, roleId, input)PUT/business-affiliate/{entityId}/roles/{roleId}

REQ-REF-003: ItemProxy — Standard Operations

Section titled “REQ-REF-003: ItemProxy — Standard Operations”

Provides standard CRUD operations for /v1/item.

REQ-REF-004: ItemProxy — Draft, Supply, and Utility Operations

Section titled “REQ-REF-004: ItemProxy — Draft, Supply, and Utility Operations”

Beyond standard CRUD:

MethodHTTPPath
getDraft(entityId)GET/item/{entityId}/draft
updateDraft(entityId, input)PUT/item/{entityId}/draft
getSupplies(entityId)GET/item/{entityId}/supply
createSupply(entityId, input)POST/item/{entityId}/supply
updateSupply(entityId, supplyId, input)PUT/item/{entityId}/supply/{supplyId}
deleteSupply(entityId, supplyId)DELETE/item/{entityId}/supply/{supplyId}
lookupSuppliers(query)GET/lookup-suppliers?q={query}
lookupUnits(query)GET/lookup-units?q={query}
printLabels(entityIds)POST/item/print-label
printBreadcrumbs(entityIds)POST/item/print-breadcrumb
createUploadUrl()POST/upload-job/upload-url
getUploadJobStatus(jobId)GET/upload-job/{jobId}

REQ-RES-001: KanbanProxy — Standard Operations

Section titled “REQ-RES-001: KanbanProxy — Standard Operations”

Provides standard CRUD operations for /v1/kanban.

REQ-RES-002: KanbanProxy — Detail, Summary, and Event Operations

Section titled “REQ-RES-002: KanbanProxy — Detail, Summary, and Event Operations”

Beyond standard CRUD:

MethodHTTPPath
getDetails(entityId, params?)GET/kanban-card/details/{entityId}
queryDetails(query)POST/kanban-card/details
queryDetailsByStatus(status, query)POST/kanban-card/details/{status}
getCardsForItem(itemEntityId)GET/kanban-card/for-item/{itemEntityId}
getSummary()GET/kanban-card/summary
getSummaryRequested()GET/kanban-card/summary/requested
getSummaryInProcess()GET/kanban-card/summary/in-process
updateNotes(entityId, input)PUT/kanban-card/{entityId}/notes
postEvent(entityId, event, body?)POST/kanban-card/{entityId}/event/{event}
printCards(entityIds)POST/kanban-card/print-card

REQ-RES-003: KanbanProxy — Event Type Safety

Section titled “REQ-RES-003: KanbanProxy — Event Type Safety”

The postEvent method accepts an event parameter constrained to the union type: "request" | "accept" | "start-processing" | "complete-processing" | "fulfill" | "receive" | "use" | "deplete" | "withdraw".


REQ-PROC-001: OrderProxy — Standard Operations

Section titled “REQ-PROC-001: OrderProxy — Standard Operations”

Provides standard CRUD operations for /v1/order.

REQ-PROC-002: OrderProxy — Full View and Creation Operations

Section titled “REQ-PROC-002: OrderProxy — Full View and Creation Operations”

Beyond standard CRUD:

MethodHTTPPath
getFull(entityId, params?)GET/order/full/{entityId}
createFromItems(input)POST/order/from-items
addItemsToOrder(entityId, input)POST/order/from-items/{entityId}
createFromKanbanCards(input)POST/order/from-kanban-cards
addKanbanCardsToOrder(entityId, input)POST/order/from-kanban-cards/{entityId}

REQ-PROC-003: OrderProxy — Line Item Operations

Section titled “REQ-PROC-003: OrderProxy — Line Item Operations”
MethodHTTPPath
addLine(entityId, input)POST/order/{entityId}/lines
updateLine(entityId, lineId, input)PUT/order/{entityId}/lines/{lineId}
deleteLine(entityId, lineId)DELETE/order/{entityId}/lines/{lineId}
moveLine(entityId, lineId, input)PUT/order/{entityId}/lines/move-line/{lineId}

REQ-PROC-004: OrderProxy — Lifecycle and Annotation Operations

Section titled “REQ-PROC-004: OrderProxy — Lifecycle and Annotation Operations”
MethodHTTPPath
submit(entityId)POST/order/{entityId}/submit
accept(entityId)POST/order/{entityId}/accepted
receive(entityId, input)POST/order/{entityId}/receive
archive(entityId)POST/order/{entityId}/archive
annotate(entityId, input)PUT/order/{entityId}/annotate
annotateLine(entityId, lineId, input)PUT/order/{entityId}/annotate-line/{lineId}

The package exposes both barrel and deep imports via package.json exports map:

Import PathContent
@arda-cards/api-proxyAll proxies and shared types
@arda-cards/api-proxy/sharedShared types and utilities only
@arda-cards/api-proxy/systemSystem domain proxies
@arda-cards/api-proxy/referenceReference Data domain proxies
@arda-cards/api-proxy/resourcesResources domain proxies
@arda-cards/api-proxy/procurementProcurement domain proxies

All request/response types match the Arda API OpenAPI specifications. Where OpenAPI types are ambiguous, Kotlin source in operations or accounts-component is authoritative.

The package compiles under strict: true with verbatimModuleSyntax enabled.

The package is published to GitHub Packages (npm.pkg.github.com) as @arda-cards/api-proxy on merge to main.

Pull requests and pushes to main run: format check, typecheck, lint, and tests with coverage enforcement (80% lines, 80% branches).