import { Types } from "mongoose"; import { EncryptedDataType } from "./common"; export type ArcGISKeyType = { item: EncryptedDataType | null, expireAt: Date | null, }; export type ZonehavenTokenType = { token: string | null, expireAt: Date | null, referer: string | null, }; // Incremental pull cursor for the Watch Duty events cron. One Watch Duty account feeds every // department, so the cursor is global. The cron holds it back when a fetch is incomplete, which // is why it is stored and not derived from the events themselves. export type WatchDutySyncType = { lastModifiedAt: Date | null, }; // Encrypted with NODE_ESRI_ENCRYPTION_PASSWORD. server-admin writes it from Portal Global Settings, and cron-watchduty reads it. export type WatchDutyApiKeyType = { item: EncryptedDataType | null, }; export interface GlobalSettingsType { _id: Types.ObjectId, name: "global", arcgisApiKey: ArcGISKeyType, zonehavenToken: ZonehavenTokenType, watchDutySync: WatchDutySyncType, watchDutyApiKey?: WatchDutyApiKeyType, updatedAt: Date, }