skipcheck

TM1 client · Docs · Versions and capabilities

Tm1Capabilities

import { Tm1Capabilities } from "@skipcheck/tm1-client";

What a connected TM1 server supports, read from its own $metadata: the way OData intends clients to detect features, with no version tables. It works for any TM1, including versions the client has never seen.

// Does the server's $metadata define the cube's tm1.Reserve action?
const reserve = Tm1Capability.boundOperation("tm1.Cube", "tm1.Reserve").since("11.8.34");
return (await session.capabilities()).supports(reserve);

Members

schemaVersion propertyThe REST API schema version the server reports in Core.SchemaVersion, such as 11.8.35.
productVersion propertyThe server's product version, such as 11.8.03500.6.
endpoints propertyThe endpoints, as coverage-gate IDs.
parse staticReads a $metadata document.
withProductVersionA copy that knows the server's product version, for the message of a refusal.
supportsWhether the server's $metadata defines capability.
checkUndefined if the server has it; otherwise the error saying what's missing, as Java's.
toStringHow much the server defines, for logs.

schemaVersion

property
readonly schemaVersion: string | undefined

The REST API schema version the server reports in Core.SchemaVersion, such as 11.8.35. Not the product version: a different number.

productVersion

property
readonly productVersion: Tm1Version | undefined

The server's product version, such as 11.8.03500.6.

endpoints

property
readonly endpoints: ReadonlySet<string>

The endpoints, as coverage-gate IDs.

parse

static
static parse(metadata: string, productVersion?: Tm1Version): Tm1Capabilities

Reads a $metadata document.

Throws

Tm1ProtocolException if it isn't XML, has a DOCTYPE, isn't CSDL, or defines something this client can't model, such as a bound operation with no binding parameter: never any other error

withProductVersion

withProductVersion(productVersion: Tm1Version | undefined): Tm1Capabilities

A copy that knows the server's product version, for the message of a refusal.

supports

supports(capability: Tm1Capability): boolean

Whether the server's $metadata defines capability.

check

check(capability: Tm1Capability, server: string): Tm1UnsupportedOperationException | undefined

Undefined if the server has it; otherwise the error saying what's missing, as Java's.

toString

toString(): string

How much the server defines, for logs.