Skip to content

Latest commit

Β 

History

History
601 lines (402 loc) Β· 14.1 KB

File metadata and controls

601 lines (402 loc) Β· 14.1 KB

SessionApi

All URIs are relative to https://geoengine.io/api

Method HTTP request Description
anonymousHandler POST /anonymous Creates session for anonymous user. The session's id serves as a Bearer token for requests.
loginHandler POST /login Creates a session by providing user credentials. The session's id serves as a Bearer token for requests.
logoutHandler POST /logout Ends a session.
oidcInit POST /oidcInit Initializes the Open Id Connect login procedure by requesting a parametrized url to the configured Id Provider.
oidcLogin POST /oidcLogin Creates a session for a user via a login with Open Id Connect. This call must be preceded by a call to oidcInit and match the parameters of that call.
registerUserHandler POST /user Registers a user.
sessionHandler GET /session Retrieves details about the current session.
sessionProjectHandler POST /session/project/{project} Sets the active project of the session.
sessionViewHandler POST /session/view

anonymousHandler

UserSession anonymousHandler()

Creates session for anonymous user. The session's id serves as a Bearer token for requests.

Example

import {
  Configuration,
  SessionApi,
} from '@geoengine/api-client';
import type { AnonymousHandlerRequest } from '@geoengine/api-client';

async function example() {
  console.log("πŸš€ Testing @geoengine/api-client SDK...");
  const api = new SessionApi();

  try {
    const data = await api.anonymousHandler();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

This endpoint does not need any parameter.

Return type

UserSession

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The created session -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

loginHandler

UserSession loginHandler(userCredentials)

Creates a session by providing user credentials. The session's id serves as a Bearer token for requests.

Example

import {
  Configuration,
  SessionApi,
} from '@geoengine/api-client';
import type { LoginHandlerRequest } from '@geoengine/api-client';

async function example() {
  console.log("πŸš€ Testing @geoengine/api-client SDK...");
  const api = new SessionApi();

  const body = {
    // UserCredentials
    userCredentials: ...,
  } satisfies LoginHandlerRequest;

  try {
    const data = await api.loginHandler(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
userCredentials UserCredentials

Return type

UserSession

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The created session -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

logoutHandler

logoutHandler()

Ends a session.

Example

import {
  Configuration,
  SessionApi,
} from '@geoengine/api-client';
import type { LogoutHandlerRequest } from '@geoengine/api-client';

async function example() {
  console.log("πŸš€ Testing @geoengine/api-client SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: session_token
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new SessionApi(config);

  try {
    const data = await api.logoutHandler();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

This endpoint does not need any parameter.

Return type

void (Empty response body)

Authorization

session_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 The Session was deleted. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

oidcInit

AuthCodeRequestURL oidcInit(redirectUri)

Initializes the Open Id Connect login procedure by requesting a parametrized url to the configured Id Provider.

Errors This call fails if Open ID Connect is disabled, misconfigured or the Id Provider is unreachable.

Example

import {
  Configuration,
  SessionApi,
} from '@geoengine/api-client';
import type { OidcInitRequest } from '@geoengine/api-client';

async function example() {
  console.log("πŸš€ Testing @geoengine/api-client SDK...");
  const api = new SessionApi();

  const body = {
    // string
    redirectUri: redirectUri_example,
  } satisfies OidcInitRequest;

  try {
    const data = await api.oidcInit(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
redirectUri string [Defaults to undefined]

Return type

AuthCodeRequestURL

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

oidcLogin

UserSession oidcLogin(redirectUri, authCodeResponse)

Creates a session for a user via a login with Open Id Connect. This call must be preceded by a call to oidcInit and match the parameters of that call.

Errors This call fails if the [`AuthCodeResponse`] is invalid, if a previous oidcLogin call with the same state was already successfully or unsuccessfully resolved, if the Open Id Connect configuration is invalid, or if the Id Provider is unreachable.

Example

import {
  Configuration,
  SessionApi,
} from '@geoengine/api-client';
import type { OidcLoginRequest } from '@geoengine/api-client';

async function example() {
  console.log("πŸš€ Testing @geoengine/api-client SDK...");
  const api = new SessionApi();

  const body = {
    // string
    redirectUri: redirectUri_example,
    // AuthCodeResponse
    authCodeResponse: ...,
  } satisfies OidcLoginRequest;

  try {
    const data = await api.oidcLogin(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
redirectUri string [Defaults to undefined]
authCodeResponse AuthCodeResponse

Return type

UserSession

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

registerUserHandler

string registerUserHandler(userRegistration)

Registers a user.

Example

import {
  Configuration,
  SessionApi,
} from '@geoengine/api-client';
import type { RegisterUserHandlerRequest } from '@geoengine/api-client';

async function example() {
  console.log("πŸš€ Testing @geoengine/api-client SDK...");
  const api = new SessionApi();

  const body = {
    // UserRegistration
    userRegistration: ...,
  } satisfies RegisterUserHandlerRequest;

  try {
    const data = await api.registerUserHandler(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
userRegistration UserRegistration

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The id of the created user -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

sessionHandler

UserSession sessionHandler()

Retrieves details about the current session.

Example

import {
  Configuration,
  SessionApi,
} from '@geoengine/api-client';
import type { SessionHandlerRequest } from '@geoengine/api-client';

async function example() {
  console.log("πŸš€ Testing @geoengine/api-client SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: session_token
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new SessionApi(config);

  try {
    const data = await api.sessionHandler();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

This endpoint does not need any parameter.

Return type

UserSession

Authorization

session_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The current session -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

sessionProjectHandler

sessionProjectHandler(project)

Sets the active project of the session.

Example

import {
  Configuration,
  SessionApi,
} from '@geoengine/api-client';
import type { SessionProjectHandlerRequest } from '@geoengine/api-client';

async function example() {
  console.log("πŸš€ Testing @geoengine/api-client SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: session_token
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new SessionApi(config);

  const body = {
    // string | Project id
    project: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
  } satisfies SessionProjectHandlerRequest;

  try {
    const data = await api.sessionProjectHandler(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
project string Project id [Defaults to undefined]

Return type

void (Empty response body)

Authorization

session_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 The project of the session was updated. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

sessionViewHandler

sessionViewHandler(sTRectangle)

Example

import {
  Configuration,
  SessionApi,
} from '@geoengine/api-client';
import type { SessionViewHandlerRequest } from '@geoengine/api-client';

async function example() {
  console.log("πŸš€ Testing @geoengine/api-client SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: session_token
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new SessionApi(config);

  const body = {
    // STRectangle
    sTRectangle: ...,
  } satisfies SessionViewHandlerRequest;

  try {
    const data = await api.sessionViewHandler(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
sTRectangle STRectangle

Return type

void (Empty response body)

Authorization

session_token

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 The view of the session was updated. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]