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 property | The REST API schema version the server reports in Core.SchemaVersion, such as 11.8.35. |
productVersion property | The server's product version, such as 11.8.03500.6. |
endpoints property | The endpoints, as coverage-gate IDs. |
parse static | Reads a $metadata document. |
withProductVersion | A copy that knows the server's product version, for the message of a refusal. |
supports | Whether the server's $metadata defines capability. |
check | Undefined if the server has it; otherwise the error saying what's missing, as Java's. |
toString | How much the server defines, for logs. |
schemaVersion
propertyreadonly 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
propertyreadonly productVersion: Tm1Version | undefined The server's product version, such as 11.8.03500.6.
endpoints
propertyreadonly endpoints: ReadonlySet<string>The endpoints, as coverage-gate IDs.
parse
staticstatic parse(metadata: string, productVersion?: Tm1Version): Tm1CapabilitiesReads 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): Tm1CapabilitiesA copy that knows the server's product version, for the message of a refusal.
supports
supports(capability: Tm1Capability): booleanWhether the server's $metadata defines capability.
check
check(capability: Tm1Capability, server: string): Tm1UnsupportedOperationException | undefinedUndefined if the server has it; otherwise the error saying what's missing, as Java's.
toString
toString(): stringHow much the server defines, for logs.