Complete reference of every operation, grouped by resource. See the README for usage and configuration.
import Galaxy from '@scalar/galaxy-node';
const client = new Galaxy({
bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var
environment: 'production',
});Everything about planets
It's easy to say you know them all, but do you really? Retrieve all the planets and check whether you missed one.
| Direction | Type |
|---|---|
| Request | PlanetListAllDataParams |
| Response | PlanetListAllDataResponse |
const listAllData = await client.planets.listAllData({
limit: 10,
offset: 0,
});Time to play god and create a new planet. What do you think? Ah, don't think too much. What could go wrong anyway?
| Direction | Type |
|---|---|
| Request | PlanetCreateParams |
| Response | Planet |
const planet = await client.planets.create({
name: 'Mars',
});You'll better learn a little bit more about the planets. It might come in handy once space travel is available for everyone.
| Direction | Type |
|---|---|
| Response | Planet |
const planet = await client.planets.retrieve(1);Sometimes you make mistakes, that's fine. No worries, you can update all planets.
| Direction | Type |
|---|---|
| Request | PlanetUpdateParams |
| Response | Planet |
const planet = await client.planets.update(1, {
name: 'Mars',
});This endpoint was used to delete planets. Unfortunately, that caused a lot of trouble for planets with life. So, this endpoint is now deprecated and should not be used anymore.
await client.planets.delete(1);Got a crazy good photo of a planet? Share it with the world!
| Direction | Type |
|---|---|
| Request | PlanetUploadImageParams |
| Response | PlanetUploadImageResponse |
const uploadImage = await client.planets.uploadImage(1);Celestial bodies are the planets and satellites in the Scalar Galaxy.
Stars, moons, comets, the occasional rogue asteroid — if it glows or drifts through the void, you can add it here.
| Direction | Type |
|---|---|
| Request | CelestialBodyCreateParams |
| Response | CelestialBody |
const celestialBody = await client.celestialBodies.create({
name: 'Mars',
});Some endpoints are public, but some require authentication. We provide all the required endpoints to create an account and authorize yourself.
Time to create a user account, eh?
| Direction | Type |
|---|---|
| Request | AuthenticationCreateUserParams |
| Response | User |
const user = await client.authentication.createUser({
name: 'Marc',
email: 'marc@scalar.com',
password: 'i-love-scalar',
});Yeah, this is the boring security stuff. Just get your super secret token and move on.
| Direction | Type |
|---|---|
| Request | AuthenticationCreateTokenParams |
| Response | AuthenticationCreateTokenResponse |
const createToken = await client.authentication.createToken({
email: 'marc@scalar.com',
password: 'i-love-scalar',
});Find yourself they say. That's what you can do here.
| Direction | Type |
|---|---|
| Response | User |
const user = await client.authentication.listMe();