New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@or-sdk/hitl

Package Overview
Dependencies
Maintainers
0
Versions
603
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@or-sdk/hitl

  • 0.34.59
  • npm
  • Socket score

Version published
Weekly downloads
1.1K
increased by40.77%
Maintainers
0
Weekly downloads
 
Created
Source

Installation:

$ npm i @or-sdk/hitl

Usage

To start using HitL API methods through this SDK it has be Initialized first. To do that a OneReach JWT authorization token and a HitL or Discovery service URL have to be passed to the constructor. After initializing the HitL SDK, its methods can be used to make requests to HitL APIs.

Available HitL APIs are:

  • agents (see AgentsApi class for the documentation)
  • cannedMessages (see CannedMessagesApi class for the documentation)
  • commands (see CommandsApi class for the documentation)
  • conferences (see ConferencesApi class for the documentation)
  • contactRuleGroups (see ContactRuleGroupsApi class for the documentation)
  • contacts (see ContactsApi class for the documentation)
  • contactsMeta (see ContactsMetaApi class for the documentation)
  • eventTemplates (see EventTemplatesApi class for the documentation)
  • filters (see FiltersApi class for the documentation)
  • helpers (see HelpersApi class for the documentation)
  • listeners (see ListenersApi class for the documentation)
  • migrations (see MigrationsApi class for the documentation)
  • ruleGroups (see RuleGroupsApi class for the documentation)
  • sessionEvents (see SessionEventsApi class for the documentation)
  • sessionRelations (see SessionRelationsApi class for the documentation)
  • sessions (see SessionsApi class for the documentation)
  • settings (see SettingsApi class for the documentation)
  • tasks (see TasksApi class for the documentation)
  • versions (see VersionsApi class for the documentation)

Examples

In a flow

const HitlApi = require('@or-sdk/hitl').HITL;

// with direct api url
const hitlApi = new HitlApi({
  token: this.config.flowToken,
  hitlUrl: this.config.env.HITL_API_URL
});

// with service discovery(slower)
const hitlApi = new HitlApi({
  token: this.config.flowToken,
  discoveryUrl: this.config.env.SERVICE_DISCOVERY_API_URL,
});

const ruleGroupsList = await hitlApi.ruleGroups.searchRuleGroups();

Outside a flow

const HitlApi = require('@or-sdk/hitl').HITL;

const CLIENT_DOMAIN_PREFIX = ''; // A PDE client-environment domain prefix, e.g. "staging"

// Either "discoveryUrl" or "hitlUrl" should be specified, "hitlUrl" takes precedence if both are present
const { agents, cannedMessages, ruleGroups } = new HitlApi({
  token: 'AUTH TOKEN HERE', // FLOW, SERVICE or USER JWT OneReach authorization token
  discoveryUrl: `https://discovery.${CLIENT_DOMAIN_PREFIX}.api.onereach.ai`, // A service discovery URL, e.g. "https://discovery.staging.api.onereach.ai"
  hitlUrl: `https://hitl.${CLIENT_DOMAIN_PREFIX}.api.onereach.ai`, // A HitL API URL, e.g. "https://hitl.staging.api.onereach.ai"
});

const agentsList = await agents.getAgents();
const cannedMessages = await cannedMessages.getCannedMessages({ id: 'MESSAGE ID HERE' });
const ruleGroupsList = await hitlApi.ruleGroups.searchRuleGroups();

FAQs

Package last updated on 07 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc