@careevolution/orchestrate
Version:
A TypeScript client for the Orchestrate API
39 lines (36 loc) • 1.84 kB
JavaScript
;
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());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LocalHashingApi = void 0;
const httpHandlerFactory_js_1 = require("../httpHandlerFactory.js");
class LocalHashingApi {
constructor(configuration = {}) {
this.httpHandler = (0, httpHandlerFactory_js_1.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);
});
}
}
exports.LocalHashingApi = LocalHashingApi;