Tm1Seed
import { Tm1Seed } from "@skipcheck/tm1-testcontainers";Used in the walkthrough Test your code against a real TM1.
Objects the image puts into an empty database on first start (its TM1_SEED
setting). The samples come from the TM1 install itself, so they're only available where
the install includes them.
A server seeded with IBM's SData sample:
const source = Tm1Source.discover();
if (!source) throw new Error("Set TM1_HOME_DIR or TM1_BUNDLE_DIR");
// SData's login is admin / apple, and the server must be this version
await using server = new Tm1ServerContainer(source).withSeed(Tm1Seed.SDATA).withExpectedVersion(Tm1Version.parse("11.8.03500.6"));
await server.start();
// Declared after the server, so it's closed before the container stops
await using tm1 = Tm1Client.builder().baseUrl(server.getRestUrl()).basicAuth(server.getUsername(), server.getPassword()).build();
// SData's cubes, such as SalesCube
const cubes = await tm1.cubes.modelCubes(ODataQuery.none().select(Cube.Fields.Name)).toArray();
return cubes.map((cube) => cube.Name!);
Members
EMPTY property | No objects. |
SDATA property | IBM's SData sample, with the login admin / apple. |
name property | The constant's name, as Java's name(). |
value property | What the image calls it (package-private in Java). |
username property | @internal |
password property | @internal |
values static | Every seed, as Java's values(). |
toString | The seed's name, as Java's enum constant. |
EMPTY
propertystatic EMPTYNo objects: an empty database with the login admin and no password.
SDATA
propertystatic SDATAIBM's SData sample, with the login admin / apple.
name
propertyreadonly name: stringThe constant's name, as Java's name().
value
propertyreadonly value: stringWhat the image calls it (package-private in Java).
username
propertyreadonly username: string@internal
password
propertyreadonly password: string@internal
values
staticstatic values(): Tm1Seed[]Every seed, as Java's values().
toString
toString(): stringThe seed's name, as Java's enum constant.