/*** * * SaaSquatch Type Definitions * * This file was automatically generated. DO NOT edit it by hand, instead edit the related JSON Schema file. * * Generated on 2026-03-20T21:11:42.771Z * ***/ /*** * UserMetric.schema.json * Generated on 2026-03-20T21:11:43.594Z * This file was automatically generated. DO NOT edit it by hand, instead edit the related JSON Schema file. ***/ /** * User metrics establish how aggregate functions can be used to update a custom user field with respect to an event. */ export type UserMetric = (({ aggregateId?: "SUM" aggregateRules?: SingleFieldWithWindowingAggregate [k: string]: unknown } | { aggregateId?: "COUNT" aggregateRules?: WindowingAggregate [k: string]: unknown } | { aggregateId?: "FIRST_SEEN" [k: string]: unknown } | { aggregateId?: "LAST_SEEN" [k: string]: unknown } | { aggregateId?: "FIRST_VALUE" aggregateRules?: SingleFieldAggregate [k: string]: unknown } | { aggregateId?: "LAST_VALUE" aggregateRules?: SingleFieldAggregate [k: string]: unknown } | { aggregateId?: "THROTTLED_LAST_NUMERIC_VALUE" aggregateRules?: { fieldName: FieldName diff?: ThrottleInterval } [k: string]: unknown }) & { customFieldKey: CustomField aggregateId: AggregateIdentifier dateTriggeredWindow?: DateTriggeredWindow userEventKey: UserEventKey filter?: Filter [k: string]: unknown }) /** * The field on which this aggregate will be performed. * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "fieldName". */ export type FieldName = string /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "windowing". */ export type Windowing = (Windowing1 & { type: ("FIXED" | "SLIDING") [k: string]: unknown }) export type Windowing1 = ({ type: "FIXED" unit: ("DAY" | "WEEK" | "MONTH" | "YEAR") [k: string]: unknown } | { type: "SLIDING" duration: number unit: ("DAY" | "WEEK" | "MONTH" | "YEAR") maxBucketValue?: number [k: string]: unknown }) /** * The minimum interval time that can elapse between recording the value of field name. Default is milliseconds per hour. */ export type ThrottleInterval = string /** * The name of the custom field associated with this metric. */ export type CustomField = string /** * An unique identifier for the aggregate operation to perform. */ export type AggregateIdentifier = ("SUM" | "COUNT" | "FIRST_SEEN" | "LAST_SEEN" | "FIRST_VALUE" | "LAST_VALUE" | "THROTTLED_LAST_NUMERIC_VALUE") /** * An ISO 8601 interval. The aggregate operation will only be performed between this window. */ export type DateTriggeredWindow = string /** * The event that will be aggregated by this metric. */ export type UserEventKey = string /** * A JSONata expression which will filter out non-matching events */ export type Filter = string /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "singleFieldWithWindowingAggregate". */ export interface SingleFieldWithWindowingAggregate { fieldName: FieldName windowing?: Windowing } /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "windowingAggregate". */ export interface WindowingAggregate { windowing?: Windowing } /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "singleFieldAggregate". */ export interface SingleFieldAggregate { fieldName: FieldName }