Skip to content

Latest commit

 

History

History
243 lines (165 loc) · 22.6 KB

File metadata and controls

243 lines (165 loc) · 22.6 KB

AuthSessions

(project.authSessions)

Overview

Manage the authentication sessions of your projects

Available Operations

  • all - Get Auth Sessions
  • one - Get Auth Session
  • delete - Delete Auth Session

all

Gets all authentication sessions of project

Example Usage

import { IntunedClient } from "@intuned/client";

const intunedClient = new IntunedClient({
  apiKey: "<YOUR_API_KEY_HERE>",
  workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});

async function run() {
  const result = await intunedClient.project.authSessions.all("my-project");

  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { IntunedClientCore } from "@intuned/client/core.js";
import { projectAuthSessionsAll } from "@intuned/client/funcs/projectAuthSessionsAll.js";

// Use `IntunedClientCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const intunedClient = new IntunedClientCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});

async function run() {
  const res = await projectAuthSessionsAll(intunedClient, "my-project");

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description Example
projectName string ✔️ Your project name. It is the name you provide when creating a project. [object Object]
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.AuthSessionInfo[]>

Errors

Error Object Status Code Content Type
errors.ApiErrorInvalidInput 400 application/json
errors.ApiErrorUnauthorized 401 application/json
errors.SDKError 4xx-5xx /

one

Gets authentication session of project by ID

Example Usage

import { IntunedClient } from "@intuned/client";

const intunedClient = new IntunedClient({
  apiKey: "<YOUR_API_KEY_HERE>",
  workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});

async function run() {
  const result = await intunedClient.project.authSessions.one("my-project", "<value>");

  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { IntunedClientCore } from "@intuned/client/core.js";
import { projectAuthSessionsOne } from "@intuned/client/funcs/projectAuthSessionsOne.js";

// Use `IntunedClientCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const intunedClient = new IntunedClientCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});

async function run() {
  const res = await projectAuthSessionsOne(intunedClient, "my-project", "<value>");

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description Example
projectName string ✔️ Your project name. It is the name you provide when creating a project. [object Object]
authSessionId string ✔️ Authentication session ID. You can obtain it from the Auth Sessions tab in your project details.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.AuthSessionInfo>

Errors

Error Object Status Code Content Type
errors.ApiErrorInvalidInput 400 application/json
errors.ApiErrorUnauthorized 401 application/json
errors.SDKError 4xx-5xx /

delete

Deletes an authentication session by ID.

Example Usage

import { IntunedClient } from "@intuned/client";

const intunedClient = new IntunedClient({
  apiKey: "<YOUR_API_KEY_HERE>",
  workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});

async function run() {
  await intunedClient.project.authSessions.delete("my-project", "<value>");

  
}

run();

Standalone function

The standalone function version of this method:

import { IntunedClientCore } from "@intuned/client/core.js";
import { projectAuthSessionsDelete } from "@intuned/client/funcs/projectAuthSessionsDelete.js";

// Use `IntunedClientCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const intunedClient = new IntunedClientCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});

async function run() {
  const res = await projectAuthSessionsDelete(intunedClient, "my-project", "<value>");

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description Example
projectName string ✔️ Your project name. It is the name you provide when creating a project. [object Object]
authSessionId string ✔️ Authentication session ID. You can obtain it from the Auth Sessions tab in your project details.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Object Status Code Content Type
errors.ApiErrorInvalidInput 400 application/json
errors.ApiErrorUnauthorized 401 application/json
errors.SDKError 4xx-5xx /