skipcheck

TM1 client · Docs · Queries

ODataPath

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

A resource path relative to the service root, built from segments and encoded as it's built:

const element = ODataPath.of("Dimensions").key("Region").nav("Hierarchies").key("Region").nav("Elements").key("O'Neil");
// Dimensions('Region')/Hierarchies('Region')/Elements('O''Neil')
const reserve = ODataPath.of("Cubes").key("Sales").action("tm1.Reserve");
// Cubes('Sales')/tm1.Reserve

Names (entity sets, navigation properties, operations, type casts) must be OData identifiers, optionally qualified; they're checked, never encoded. Key values can be any text: they're written as string literals and percent-encoded. Paths are immutable.

Members

of staticA path starting at an entity set, singleton or operation import, such as Cubes.
metadata staticThe service's metadata document, $metadata.
batch staticThe service's batch endpoint, $batch.
link staticA path TM1 sent (an @odata.id, a Location), re-encoded segment by segment.
functionImport staticA function import called from the service root, such as ModelCubes() or TailMessageLog(Top=10).
keyCubes → Cubes('Sales'); a compound key from a map.
navAdds a navigation property or structural property segment, such as Views.
castAdds a type-cast segment, such as tm1.NativeView.
actionAdds a bound action segment, such as tm1.Reserve.
functionAdds a bound function call with literal parameters, such as tm1.GetPartition(Begin=0,End=99).
valueAdds $value.
countAdds $count.
refAdds $ref.
equalsWhether other is the same path.
toStringThe encoded path, without a leading slash, such as Cubes('Sales')/Views.
toJSONThe encoded path, where a path is written into JSON.

of

static
static of(name: string): ODataPath

A path starting at an entity set, singleton or operation import, such as Cubes. @throws RangeError if name isn't an OData identifier

metadata

static
static metadata(): ODataPath

The service's metadata document, $metadata: its CSDL XML. A path of its own, since $metadata isn't an identifier of accepts.

batch

static
static batch(): ODataPath

The service's batch endpoint, $batch: a path of its own, as for metadata.

functionImport

static
static functionImport(name: string, parameters?: Tm1Map<unknown>): ODataPath

A function import called from the service root, such as ModelCubes() or TailMessageLog(Top=10). @param name the import's name, unqualified @param parameters the parameter names and values, in order, as for function

key

key(value: unknown): ODataPath

Cubes → Cubes('Sales'); a compound key from a map: Edges(ParentName='a',ComponentName='b').

cast

cast(qualifiedType: string): ODataPath

Adds a type-cast segment, such as tm1.NativeView: the namespace-qualified type name.

action

action(qualifiedName: string): ODataPath

Adds a bound action segment, such as tm1.Reserve: the namespace-qualified action name. Actions are invoked with POST.

function

function(qualifiedName: string, parameters?: Tm1Map<unknown>): ODataPath

Adds a bound function call with literal parameters, such as tm1.GetPartition(Begin=0,End=99). Use parameter aliases (in ODataQuery) for complex or collection parameters. @param qualifiedName the namespace-qualified function name @param parameters the parameter names and values, in order; each value is written as an OData literal, or as the alias's name if it's an ODataPath.Alias

value

value(): ODataPath

Adds $value: a property's or media entity's raw value.

count

count(): ODataPath

Adds $count: the number of items in a collection, as plain text.

ref

ref(): ODataPath

Adds $ref: references to entities rather than the entities themselves.

equals

equals(other: unknown): boolean

Whether other is the same path.

toString

toString(): string

The encoded path, without a leading slash, such as Cubes('Sales')/Views.

toJSON

toJSON(): string

The encoded path, where a path is written into JSON: an @odata.bind reference.