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 static | A path starting at an entity set, singleton or operation import, such as Cubes. |
metadata static | The service's metadata document, $metadata. |
batch static | The service's batch endpoint, $batch. |
link static | A path TM1 sent (an @odata.id, a Location), re-encoded segment by segment. |
functionImport static | A function import called from the service root, such as ModelCubes() or TailMessageLog(Top=10). |
key | Cubes → Cubes('Sales'); a compound key from a map. |
nav | Adds a navigation property or structural property segment, such as Views. |
cast | Adds a type-cast segment, such as tm1.NativeView. |
action | Adds a bound action segment, such as tm1.Reserve. |
function | Adds a bound function call with literal parameters, such as tm1.GetPartition(Begin=0,End=99). |
value | Adds $value. |
count | Adds $count. |
ref | Adds $ref. |
equals | Whether other is the same path. |
toString | The encoded path, without a leading slash, such as Cubes('Sales')/Views. |
toJSON | The encoded path, where a path is written into JSON. |
of
staticstatic of(name: string): ODataPathA path starting at an entity set, singleton or operation import, such as Cubes. @throws RangeError if name isn't an OData identifier
metadata
staticstatic metadata(): ODataPathThe service's metadata document, $metadata: its CSDL XML. A path of its own, since $metadata isn't an identifier of accepts.
batch
staticstatic batch(): ODataPathThe service's batch endpoint, $batch: a path of its own, as for metadata.
link
staticstatic link(link: string): ODataPathA path TM1 sent (an @odata.id, a Location), re-encoded segment by segment.
functionImport
staticstatic functionImport(name: string, parameters?: Tm1Map<unknown>): ODataPathA 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): ODataPathCubes → Cubes('Sales'); a compound key from a map: Edges(ParentName='a',ComponentName='b').
cast
cast(qualifiedType: string): ODataPathAdds a type-cast segment, such as tm1.NativeView: the namespace-qualified type name.
action
action(qualifiedName: string): ODataPathAdds 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>): ODataPathAdds 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(): ODataPathAdds $value: a property's or media entity's raw value.
count
count(): ODataPathAdds $count: the number of items in a collection, as plain text.
ref
ref(): ODataPathAdds $ref: references to entities rather than the entities themselves.
equals
equals(other: unknown): booleanWhether other is the same path.
toString
toString(): stringThe encoded path, without a leading slash, such as Cubes('Sales')/Views.
toJSON
toJSON(): stringThe encoded path, where a path is written into JSON: an @odata.bind reference.