@lagunacreek/hogan-pms-client
v0.1.4
Published
Shared client for the Hogan PMS API: connection logic and typed data-access methods.
Readme
@lagunacreek/hogan-pms-client
Shared client for the Hogan PMS API. Holds the connection logic and typed data-access methods so they can be reused across apps instead of being re-implemented per service.
Status
@wip
Usage
import { version, VERSION } from "@lagunacreek/hogan-pms-client";
console.log(version()); // -> "0.1.0"
console.log(VERSION); // -> "0.1.0"Import Types
import type { WhoAmIType } from "@lagunacreek/hogan-pms-client";Call an OTA endpoint with the internal client (constructor args: apiKey, env,
version; env is one of LOCAL | DEV | TEST | PROD):
import { HoganInternalOTAClient } from "@lagunacreek/hogan-pms-client";
const ota = new HoganInternalOTAClient(process.env.HOGAN_API_KEY!, "LOCAL", "v1");
const me = await ota.whoami(); // GET /ota/v1/getWhoami
console.log(me.tenant); // -> "DEFAULT"Development
npm install
npm run build # bundle to dist/ (ESM + CJS + d.ts) via tsup
npm test # run vitest
npm run typecheck # tsc --noEmitLayout
src/
index.ts # barrel export
version.ts # version() — package version
internal-ota.ts # Maps to Hogan Internal OTA methods
client.ts # (planned) HoganClient: open travel alliance methods
errors.ts # (planned) HoganApiError, HoganValidationError, ...
types/ # (planned) types per resource
resources/ # (planned) one file per endpoint groupThe package version is injected at build time by tsup's define (and mirrored
in vitest.config.ts for tests), sourced from package.json, so there is no
JSON import assertion at runtime.
