GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — sdk-js/packages/epilot-sdk-v2/docs/purpose.md at main · epilot-dev/sdk-js

Expand file tree

/

purpose.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
284 lines (211 loc) · 4.42 KB
/

purpose.md

Copy path

File metadata and controls

284 lines (211 loc) · 4.42 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Purpose API

  • Base URL: https://purpose.sls.epilot.io
  • Full API Docs: https://docs.epilot.io/api/purpose

Usage

import { epilot } from '@epilot/sdk'

epilot.authorize(() => '<token>')
const { data } = await epilot.purpose.createPurpose(...)

Tree-shakeable import

import { getClient, authorize } from '@epilot/sdk/purpose'

const purposeClient = getClient()
authorize(purposeClient, () => '<token>')
const { data } = await purposeClient.createPurpose(...)

Operations

Purpose

  • createPurpose
  • searchPurposes
  • batchGetPurposes
  • getPurpose
  • updatePurpose
  • deletePurpose

Schemas

  • Purpose
  • CreatePurposeInput
  • UpdatePurposeInput
  • BatchGetPurposesInput
  • Error

createPurpose

Create a new purpose.

POST /v1/purpose

const { data } = await client.createPurpose(
  null,
  {
    name: 'Electricity Contract'
  },
)
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Electricity Contract",
  "created_at": "2024-01-15T10:30:00.000Z",
  "updated_at": "2024-06-01T08:00:00.000Z"
}

searchPurposes

Search purposes using fuzzy matching against the purpose name.

GET /v1/purpose:search

const { data } = await client.searchPurposes({
  query: 'example',
  size: 1,
})
Response
{
  "results": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "Electricity Contract",
      "created_at": "2024-01-15T10:30:00.000Z",
      "updated_at": "2024-06-01T08:00:00.000Z"
    }
  ]
}

batchGetPurposes

Fetch multiple purposes by their known IDs in a single request.

POST /v1/purpose:batchGet

const { data } = await client.batchGetPurposes(
  null,
  {
    purposeIds: ['123e4567-e89b-12d3-a456-426614174000', '987fcdeb-51a2-43f7-9012-345678901234']
  },
)
Response
{
  "results": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "Electricity Contract",
      "created_at": "2024-01-15T10:30:00.000Z",
      "updated_at": "2024-06-01T08:00:00.000Z"
    }
  ],
  "hits": 2
}

getPurpose

Get a single purpose by its UUID.

GET /v1/purpose/{purposeId}

const { data } = await client.getPurpose({
  purposeId: 'example',
})
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Electricity Contract",
  "created_at": "2024-01-15T10:30:00.000Z",
  "updated_at": "2024-06-01T08:00:00.000Z"
}

updatePurpose

Update an existing purpose.

PUT /v1/purpose/{purposeId}

const { data } = await client.updatePurpose(
  {
    purposeId: 'example',
  },
  {
    name: 'Electricity & Gas Contract'
  },
)
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Electricity Contract",
  "created_at": "2024-01-15T10:30:00.000Z",
  "updated_at": "2024-06-01T08:00:00.000Z"
}

deletePurpose

Permanently delete a purpose by its UUID.

DELETE /v1/purpose/{purposeId}

const { data } = await client.deletePurpose({
  purposeId: 'example',
})
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Electricity Contract",
  "created_at": "2024-01-15T10:30:00.000Z",
  "updated_at": "2024-06-01T08:00:00.000Z"
}

Schemas

Purpose

An epilot Purpose – a named taxonomy label used to tag and organize resources across the platform

type Purpose = {
  id: string // uuid
  name: string
  created_at?: string // date-time
  updated_at?: string // date-time
}

CreatePurposeInput

Input for creating a new purpose

type CreatePurposeInput = {
  name: string
}

UpdatePurposeInput

Input for updating an existing purpose

type UpdatePurposeInput = {
  name?: string
}

BatchGetPurposesInput

Input for batch-fetching purposes by their IDs

type BatchGetPurposesInput = {
  purposeIds: string // uuid[]
}

Error

type Error = {
  status?: number
  error?: string
  message?: string
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.