UNPKG

@careevolution/orchestrate

Version:

A TypeScript client for the Orchestrate API

35 lines (32 loc) 1.67 kB
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; import { createLocalHashingHttpHandler } from "../httpHandlerFactory.js"; export class LocalHashingApi { constructor(configuration = {}) { this.httpHandler = createLocalHashingHttpHandler(configuration.url); } toString() { return `LocalHashingApi(${this.httpHandler.toString()})`; } /** * Hashes a demographic using the local hashing service. * @param demographic The demographic to hash. * @returns The hashed demographic. - `data`: The B64 encoded hash provided by the local hashing service. - `version`: The version number provided by the local hashing service. - `advisories`: Contains advisory messages about the operation. * @link https://rosetta-api.docs.careevolution.com/terminology/classify/condition.html */ hash(demographic) { return __awaiter(this, void 0, void 0, function* () { return this.httpHandler.post("/hash", demographic); }); } }