import Sequelize from "sequelize"; import { GroupConfigurationObject } from "../classes/codeConfig"; import { GroupRuleOpType, RelativeMatchDirectionType, RelativeMatchUnitType } from "../modules/ruleOpsDictionary"; import { Destination } from "./Destination"; import { GroupMember } from "./GroupMember"; import { GrouparooRecord } from "./GrouparooRecord"; import { GroupRule } from "./GroupRule"; import { Property } from "./Property"; import { Run } from "./Run"; import { GrouparooModel } from "./GrouparooModel"; import { CommonModel } from "../classes/commonModel"; export declare const GROUP_RULE_LIMIT = 10; export interface GroupRuleOperation { op: GroupRuleOpType; description?: string; } export interface GroupRuleWithKey { key?: string; type?: Property["type"]; topLevel?: boolean; operation: GroupRuleOperation; match?: string | number | boolean; relativeMatchNumber?: number; relativeMatchUnit?: RelativeMatchUnitType; relativeMatchDirection?: RelativeMatchDirectionType; } declare const matchTypes: readonly ["any", "all"]; declare const STATES: readonly ["draft", "ready", "initializing", "updating", "deleted"]; export declare class Group extends CommonModel { idPrefix(): string; name: string; matchType: typeof matchTypes[number]; state: typeof STATES[number]; locked: string; calculatedAt: Date; modelId: string; groupMembers: GroupMember[]; groupRules: GroupRule[]; destinations: Destination[]; records: GrouparooRecord[]; model: GrouparooModel; recordsCount(options?: {}): Promise; getRules(): Promise; setRules(rules: GroupRuleWithKey[]): Promise; apiData(): Promise<{ id: string; name: string; modelId: string; modelName: string; rules: GroupRuleWithKey[]; matchType: "all" | "any"; state: "ready" | "draft" | "deleted" | "initializing" | "updating"; locked: string; recordsCount: number; createdAt: number; updatedAt: number; nextCalculatedAt: number; calculatedAt: number; }>; fromConvenientRules(rules: GroupRuleWithKey[]): GroupRuleWithKey[]; toConvenientRules(rules: GroupRuleWithKey[]): GroupRuleWithKey[]; nextCalculatedAt(): Promise; run(destinationId?: string): Promise; stopPreviousRuns(): Promise; runAddGroupMembers(run: Run, limit?: number, offset?: number, highWaterMark?: number, destinationId?: string): Promise<{ groupMembersCount: number; nextHighWaterMark: number; nextOffset: number; }>; runRemoveGroupMembers(run: Run, limit?: number, destinationId?: string): Promise; removePreviousRunGroupMembers(run: Run, limit?: number): Promise; updateRecordsMembership(records: GrouparooRecord[]): Promise<{ [recordId: string]: boolean; }>; countPotentialMembers(rules?: GroupRuleWithKey[], matchType?: typeof matchTypes[number]): Promise; /** * Take the rules for the group and check how many group members there would have been both individually for each single rule, and then by building up the query step-by-step */ countComponentMembersFromRules(rules?: GroupRuleWithKey[]): Promise<{ componentCounts: number[]; funnelCounts: number[]; }>; /** * Build the where-clause for the query to determine Group membership */ _buildGroupMemberQueryParts(rules?: GroupRuleWithKey[], matchType?: typeof matchTypes[number], recordState?: string): Promise<{ where: Sequelize.WhereAttributeHash; include: Sequelize.Includeable[]; }>; getConfigId(): string; getConfigObject(): Promise; static ensureModel(instance: Group): Promise; static updateState(instance: Group): Promise; static noUpdateIfLocked(instance: Group): Promise; static checkGroupMembers(instance: Group): Promise; static ensureNotInUse(instance: Group): Promise; static noDestroyIfLocked(instance: Group): Promise; static destroyDestinationGroupTracking(instance: Group): Promise; static destroyDestinationGroupMembership(instance: Group): Promise; static destroyGroupRules(instance: Group): Promise; static stopRuns(instance: Group): Promise; } export {};