UNPKG

@ztimson/momentum

Version:

Client library for momentum

67 lines 2 kB
/** Communication method */ export type AlertMethod = 'call' | 'email' | 'notification' | 'sms'; /** Alert */ export type Alert = { /** Triggering event */ event: string; /** Notify via methods */ method: AlertMethod[]; /** Notification name/title */ message: Omit<Message, 'to'> & { /** Include link */ link?: string; }; }; /** Excel formula column type */ export type Formula = string | any; /** Link column type */ export type Link = string; /** Metadata model */ export type Meta = { /** Document ID */ readonly _id?: string | any; /** Creator username */ readonly _createdBy?: string | null; /** Created timestamp */ readonly _createdDate?: Date | null; /** Modifier username */ readonly _updatedBy?: string | null; /** Modified timestamp */ readonly _updatedDate?: Date | null; }; /** SMS or Phone call message */ export type Message = { /** Message recipients */ to: string | string[]; /** Message subject/title */ subject?: string; /** Leave blank or specify a from address if there are options */ from?: string; /** Message body */ body: string; }; /** Saved message log */ export type MessageLog<T> = { /** Message UID */ readonly _id: string; /** Sent timestamp */ readonly _createdBy: string | null; /** Message initiator */ readonly _createdDate: Date; /** Message body */ message: T; }; export { type IPathEventEmitter, PE, PES, PathEvent, type PathListener, type PathUnsubscribe, PathEventEmitter } from '@ztimson/utils'; /** Recursive type for defining tree data */ export type TreeNode<T> = T & { /** Name of node */ name: string; /** Node children */ children: TreeNode<T>[]; }; export { type Unsubscribe } from '@ztimson/utils'; export declare function treeBuilder<T extends { path: string; }>(schemas: T[]): TreeNode<T>[]; export declare function validEvent(event: string): boolean; //# sourceMappingURL=core.d.ts.map