Skip to main content

hiloop TypeScript SDK

Type Aliases

  • AttributeValue
  • Calculation
  • ClientOptions
  • Filter
  • Identity
  • IdentityServiceWhoAmIData
  • IdentityServiceWhoAmIResponse
  • IdentityServiceWhoAmIResponses
  • Options
  • Order
  • QueryRequest
  • QueryResponse
  • QuerySpec
  • Row
  • TelemetryQueryServiceQueryData
  • TelemetryQueryServiceQueryResponse
  • TelemetryQueryServiceQueryResponses
  • TimeRange
  • WhoAmIResponse

Functions

  • identityServiceWhoAmI
  • telemetryQueryServiceQuery

Type Alias: AttributeValue

AttributeValue = object
A typed scalar attribute value (mirrors the Event v1 narrow value model).

Properties

boolValue?

optional boolValue?: boolean

doubleValue?

optional doubleValue?: number

intValue?

optional intValue?: string

stringValue?

optional stringValue?: string

Type Alias: Calculation

Calculation = object

Properties

column?

optional column?: string
The column to aggregate. Required for every op except COUNT.

op?

optional op?: "CALCULATION_OP_UNSPECIFIED" | "CALCULATION_OP_COUNT" | "CALCULATION_OP_SUM" | "CALCULATION_OP_AVG" | "CALCULATION_OP_MIN" | "CALCULATION_OP_MAX" | "CALCULATION_OP_P50" | "CALCULATION_OP_P95" | "CALCULATION_OP_P99"

Type Alias: ClientOptions

ClientOptions = object

Properties

baseUrl

baseUrl: `${string}://gen` | string & object

Type Alias: Filter

Filter = object

Properties

column?

optional column?: string

op?

optional op?: "FILTER_OP_UNSPECIFIED" | "FILTER_OP_EQ" | "FILTER_OP_NE" | "FILTER_OP_GT" | "FILTER_OP_GTE" | "FILTER_OP_LT" | "FILTER_OP_LTE" | "FILTER_OP_CONTAINS" | "FILTER_OP_EXISTS"

value?

optional value?: AttributeValue
The comparison value; omitted for EXISTS.

Type Alias: Identity

Identity = object
The caller identity, as resolved by the authz enforcement point and stamped onto the request as x-hiloop-* headers. The hiloop API edge trusts these headers; it does not re-authenticate.

Properties

authMethod?

optional authMethod?: string
x-hiloop-auth-method — how the caller authenticated (e.g. “api_key”, “session”).

orgId?

optional orgId?: string
x-hiloop-org-id — the organization the caller acts in.

scope?

optional scope?: string
x-hiloop-scope — the granted scope, when present.

tenantId?

optional tenantId?: string
x-hiloop-tenant-id — the tenant the caller acts in (drives app.tenant_id / RLS downstream).

userId?

optional userId?: string
x-hiloop-user-id — the user, when the credential is user-scoped; empty for service keys.

Type Alias: IdentityServiceWhoAmIData

IdentityServiceWhoAmIData = object

Properties

body?

optional body?: never

path?

optional path?: never

query?

optional query?: never

url

url: "/v1/whoami"

Type Alias: IdentityServiceWhoAmIResponse

IdentityServiceWhoAmIResponse = IdentityServiceWhoAmIResponses\keyof [IdentityServiceWhoAmIResponses]

Type Alias: IdentityServiceWhoAmIResponses

IdentityServiceWhoAmIResponses = object

Properties

200

200: WhoAmIResponse
OK

Type Alias: Options<TData, ThrowOnError, TResponse>

Options<TData, ThrowOnError, TResponse> = Options2<TData, ThrowOnError, TResponse> & object

Type Declaration

client?

optional client?: Client
You can provide a client instance returned by createClient() instead of individual options. This might be also useful if you want to implement a custom client.

meta?

optional meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta
You can pass arbitrary values through the meta object. This can be used to access values that aren’t defined as part of the SDK function.

Type Parameters

TData

TData extends TDataShape = TDataShape

ThrowOnError

ThrowOnError extends boolean = boolean

TResponse

TResponse = unknown

Type Alias: Order

Order = object

Properties

column?

optional column?: string

descending?

optional descending?: boolean

Type Alias: QueryRequest

QueryRequest = object

Properties

spec?

optional spec?: QuerySpec

Type Alias: QueryResponse

QueryResponse = object

Properties

rows?

optional rows?: Row[]

Type Alias: QuerySpec

QuerySpec = object
A structured, server-validated query. The set of addressable columns is fixed by the canonical event schema; unknown columns are rejected.

Properties

breakdowns?

optional breakdowns?: string[]
Group-by columns for the calculations.

calculations?

optional calculations?: Calculation[]
Aggregations to compute. Empty means return matching rows (subject to limit).

filters?

optional filters?: Filter[]
Conjunctive (AND-ed) typed predicates.

forkPath?

optional forkPath?: string
Subtree anchor: the fork-node path to scope to. Empty means the whole run.

limit?

optional limit?: number
Row cap; clamped server-side to a maximum.

orders?

optional orders?: Order[]

runId?

optional runId?: string
The run (session) to query. Required.

timeRange?

optional timeRange?: TimeRange

Type Alias: Row

Row = object
One result row: column name -> typed value. For aggregations the columns are the breakdown columns plus one per calculation (e.g. “p95_duration_ns”).

Properties

columns?

optional columns?: object

Index Signature

[key: string]: AttributeValue

Type Alias: TelemetryQueryServiceQueryData

TelemetryQueryServiceQueryData = object

Properties

body

body: QueryRequest

path?

optional path?: never

query?

optional query?: never

url

url: "/v1/telemetry/query"

Type Alias: TelemetryQueryServiceQueryResponse

TelemetryQueryServiceQueryResponse = TelemetryQueryServiceQueryResponses\keyof [TelemetryQueryServiceQueryResponses]

Type Alias: TelemetryQueryServiceQueryResponses

TelemetryQueryServiceQueryResponses = object

Properties

200

200: QueryResponse
OK

Type Alias: TimeRange

TimeRange = object
Inclusive wall-clock window in nanoseconds (matches CanonicalEvent.ts_wall_ns).

Properties

endNs?

optional endNs?: string

startNs?

optional startNs?: string

Type Alias: WhoAmIResponse

WhoAmIResponse = object

Properties

identity?

optional identity?: Identity
The caller identity reflected from the request’s x-hiloop-* headers.

Function: identityServiceWhoAmI()

identityServiceWhoAmI<ThrowOnError>(options?): RequestResult<IdentityServiceWhoAmIResponses, unknown, ThrowOnError>
Echo the caller identity stamped by authz. Acts as both a health probe and an identity sanity-check. The HTTP binding is what the Envoy gRPC-JSON transcoder exposes and what the generated OpenAPI/SDKs/CLI consume.

Type Parameters

ThrowOnError

ThrowOnError extends boolean = false

Parameters

options?

Options<IdentityServiceWhoAmIData, ThrowOnError, unknown>

Returns

RequestResult<IdentityServiceWhoAmIResponses, unknown, ThrowOnError>

Function: telemetryQueryServiceQuery()

telemetryQueryServiceQuery<ThrowOnError>(options): RequestResult<TelemetryQueryServiceQueryResponses, unknown, ThrowOnError>
Run a structured query over the caller’s telemetry.

Type Parameters

ThrowOnError

ThrowOnError extends boolean = false

Parameters

options

Options<TelemetryQueryServiceQueryData, ThrowOnError>

Returns

RequestResult<TelemetryQueryServiceQueryResponses, unknown, ThrowOnError>