{
  "version": 3,
  "sources": ["../../src/modules/sentinel-model/attachable/asAttachableInstance.ts", "../../src/modules/sentinel-model/attachable/isAttachableInstance.ts", "../../src/modules/sentinel-model/typeChecks.ts", "../../src/modules/sentinel-model/Queries/Report.ts", "../../src/modules/sentinel-model/attachable/AttachableInstance.ts", "../../src/modules/sentinel-model/Automation.ts", "../../src/modules/sentinel-model/Config.ts"],
  "sourcesContent": ["import { AsObjectFactory } from '@ariestools/sdk'\n\nimport { isAttachableSentinelInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableSentinelInstance = AsObjectFactory.create(isAttachableSentinelInstance)\n", "import type { ObjectTypeShape, TypeCheck } from '@ariestools/sdk'\nimport { IsObjectFactory } from '@ariestools/sdk'\n\nimport { isAttachableModuleInstance } from '#module-model'\n\nimport { isSentinelInstance } from '../typeChecks.ts'\nimport type { AttachableSentinelInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableSentinelInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableSentinelInstance>()\n\nexport const isAttachableSentinelInstance: TypeCheck<AttachableSentinelInstance> = factory.create(requiredAttachableSentinelInstanceFunctions, [\n  isSentinelInstance,\n  isAttachableModuleInstance,\n])\n", "import { AsObjectFactory } from '@ariestools/sdk'\n\nimport {\n  IsInstanceFactory, isModuleInstance, IsQueryableModuleFactory, WithFactory,\n} from '#module-model'\n\nimport type { SentinelInstance } from './Instance.ts'\nimport type { SentinelModule } from './Module.ts'\nimport { SentinelReportQuerySchema } from './Queries/index.ts'\n\nexport const isSentinelInstance = new IsInstanceFactory<SentinelInstance>().create({ report: 'function' }, [isModuleInstance])\nexport const isSentinelModule = new IsQueryableModuleFactory<SentinelModule>().create([SentinelReportQuerySchema])\n\nexport const asSentinelModule = AsObjectFactory.create(isSentinelModule)\nexport const asSentinelInstance = AsObjectFactory.create(isSentinelInstance)\n\n/** @deprecated use narrowing instead [ if(is) ] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const withSentinelModule = WithFactory.create(isSentinelModule)\n/** @deprecated use narrowing instead [ if(is) ] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const withSentinelInstance = WithFactory.create(isSentinelInstance)\n", "import {\n  zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport {\n  asSchema, PayloadZodOfSchema, QueryFieldsZod,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nexport const SentinelReportQuerySchema: 'network.xyo.query.sentinel.report' & {\n  readonly __schema: true\n} = asSchema('network.xyo.query.sentinel.report', true)\nexport type SentinelReportQuerySchema = typeof SentinelReportQuerySchema\n\nexport const SentinelReportQueryZod: z.ZodMiniObject<\n  & { schema: z.ZodMiniLiteral<SentinelReportQuerySchema> }\n  & (typeof QueryFieldsZod)['shape'],\n  z.core.$strip\n> = z.extend(PayloadZodOfSchema(SentinelReportQuerySchema), { ...QueryFieldsZod.shape })\n\nexport type SentinelReportQuery = z.infer<typeof SentinelReportQueryZod>\n\nexport const isSentinelReportQuery: ReturnType<typeof zodIsFactory<SentinelReportQuery>> = zodIsFactory(SentinelReportQueryZod)\nexport const asSentinelReportQuery: ReturnType<typeof zodAsFactory<SentinelReportQuery>> = zodAsFactory(SentinelReportQueryZod, 'asSentinelReportQuery')\nexport const toSentinelReportQuery: ReturnType<typeof zodToFactory<SentinelReportQuery>> = zodToFactory(SentinelReportQueryZod, 'toSentinelReportQuery')\n", "import type { TypeCheck } from '@ariestools/sdk'\nimport { IsObjectFactory } from '@ariestools/sdk'\n\nimport type { AttachableModuleInstance } from '#module-model'\n\nimport type { SentinelModuleEventData } from '../EventData.ts'\nimport type { SentinelInstance } from '../Instance.ts'\nimport type { SentinelModule } from '../Module.ts'\nimport type { SentinelParams } from '../Params.ts'\n\nexport interface AttachableSentinelInstance<\n  TParams extends SentinelParams = SentinelParams,\n  TEventData extends SentinelModuleEventData = SentinelModuleEventData,\n> extends SentinelModule<TParams, TEventData>,\n  AttachableModuleInstance<TParams, TEventData>,\n  SentinelInstance<TParams, TEventData> {}\n\nexport type AttachableSentinelInstanceTypeCheck<T extends AttachableSentinelInstance = AttachableSentinelInstance> = TypeCheck<T>\n\nexport class IsAttachableSentinelInstanceFactory<T extends AttachableSentinelInstance = AttachableSentinelInstance> extends IsObjectFactory<T> {}\n", "import type { EventName } from '@ariestools/sdk'\nimport {\n  zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport type { Payload } from '@xyo-network/sdk-protocol'\nimport { asSchema, PayloadZodOfSchema } from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nimport type { ModuleIdentifier } from '#module-model'\n\nexport const SentinelAutomationSchema: 'network.xyo.automation' & {\n  readonly __schema: true\n} = asSchema('network.xyo.automation', true)\nexport type SentinelAutomationSchema = typeof SentinelAutomationSchema\n\nexport const SentinelIntervalAutomationSchema: 'network.xyo.automation.interval' & {\n  readonly __schema: true\n} = asSchema('network.xyo.automation.interval', true)\nexport type SentinelIntervalAutomationSchema = typeof SentinelIntervalAutomationSchema\n\nexport const SentinelModuleEventAutomationSchema: 'network.xyo.automation.event.module' & {\n  readonly __schema: true\n} = asSchema('network.xyo.automation.event.module', true)\nexport type SentinelModuleEventAutomationSchema = typeof SentinelModuleEventAutomationSchema\n\nexport type SentinelBaseAutomationPayload<T extends Payload> = Payload<\n  {\n    type?: 'interval' | 'event'\n  } & T\n>\n\n/** Settings for an Interval Automation */\nexport const SentinelIntervalAutomationZod: z.ZodMiniObject<{\n  end: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n  frequency: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n  frequencyUnits: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<'second'>, z.ZodMiniLiteral<'minute'>, z.ZodMiniLiteral<'hour'>, z.ZodMiniLiteral<'day'>, z.ZodMiniLiteral<'millis'>]>>\n  remaining: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n  schema: z.ZodMiniLiteral<SentinelIntervalAutomationSchema>\n  start: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n  type: z.ZodMiniLiteral<'interval'>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(SentinelIntervalAutomationSchema), {\n  /** Epoch after which any reoccurrence stops */\n  end: z.optional(z.number()),\n  /** Time between triggers [non-repeating if undefined] */\n  frequency: z.optional(z.number()),\n  /** Units for frequency field [hour if undefined] */\n  frequencyUnits: z.optional(z.union([z.literal('second'), z.literal('minute'), z.literal('hour'), z.literal('day'), z.literal('millis')])),\n  /** Remaining triggers [infinite if undefined] */\n  remaining: z.optional(z.number()),\n  /** Epoch of the next trigger */\n  start: z.optional(z.number()),\n  /** The type of automation */\n  type: z.literal('interval'),\n})\n\nexport type SentinelIntervalAutomationPayload = z.infer<typeof SentinelIntervalAutomationZod>\n\nexport const isSentinelIntervalAutomation: ReturnType<typeof zodIsFactory<SentinelIntervalAutomationPayload>> = zodIsFactory(SentinelIntervalAutomationZod)\nexport const asSentinelIntervalAutomation: ReturnType<typeof zodAsFactory<SentinelIntervalAutomationPayload>> = zodAsFactory(SentinelIntervalAutomationZod, 'asSentinelIntervalAutomation')\nexport const toSentinelIntervalAutomation: ReturnType<typeof zodToFactory<SentinelIntervalAutomationPayload>> = zodToFactory(SentinelIntervalAutomationZod, 'toSentinelIntervalAutomation')\n\n/** Settings for an Module Event Automation */\nexport const SentinelModuleEventAutomationZod: z.ZodMiniObject<{\n  eventName: z.ZodMiniCustom<EventName, EventName>\n  schema: z.ZodMiniLiteral<SentinelModuleEventAutomationSchema>\n  source: z.ZodMiniCustom<ModuleIdentifier, ModuleIdentifier>\n  type: z.ZodMiniLiteral<'event'>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(SentinelModuleEventAutomationSchema), {\n  eventName: z.custom<EventName>(),\n  source: z.custom<ModuleIdentifier>(),\n  type: z.literal('event'),\n})\n\nexport type SentinelModuleEventAutomationPayload = z.infer<typeof SentinelModuleEventAutomationZod>\n\nexport const isSentinelModuleEventAutomation: ReturnType<typeof zodIsFactory<SentinelModuleEventAutomationPayload>> = zodIsFactory(SentinelModuleEventAutomationZod)\nexport const asSentinelModuleEventAutomation: ReturnType<typeof zodAsFactory<SentinelModuleEventAutomationPayload>> = zodAsFactory(SentinelModuleEventAutomationZod, 'asSentinelModuleEventAutomation')\nexport const toSentinelModuleEventAutomation: ReturnType<typeof zodToFactory<SentinelModuleEventAutomationPayload>> = zodToFactory(SentinelModuleEventAutomationZod, 'toSentinelModuleEventAutomation')\n\n/** Settings for an Automation */\nexport type SentinelAutomationPayload = Payload<\n  SentinelIntervalAutomationPayload | SentinelModuleEventAutomationPayload,\n  SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelModuleEventAutomationSchema\n>\n", "import type { WithAdditional } from '@ariestools/sdk'\nimport {\n  zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport {\n  asSchema, type Payload, type Schema,\n} from '@xyo-network/sdk-protocol'\nimport * as z from 'zod/mini'\n\nimport type { ModuleConfig } from '#module-model'\nimport { ModuleConfigZod } from '#module-model'\n\nimport type { SentinelAutomationPayload } from './Automation.ts'\nimport type { Task } from './Task.ts'\n\nexport const SentinelConfigSchema: 'network.xyo.sentinel.config' & {\n  readonly __schema: true\n} = asSchema('network.xyo.sentinel.config', true)\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport const SentinelConfigZod: z.ZodMiniObject<\n  & Omit<(typeof ModuleConfigZod)['shape'], 'schema'>\n  & { schema: z.ZodMiniLiteral<SentinelConfigSchema> }\n  & {\n    automations: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniCustom<SentinelAutomationPayload, SentinelAutomationPayload>>>\n    synchronous: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n    tasks: z.ZodMiniArray<z.ZodMiniCustom<Task, Task>>\n    throwErrors: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n  },\n  z.core.$strip\n> = z.extend(ModuleConfigZod, {\n  schema: z.literal(SentinelConfigSchema),\n  automations: z.optional(z.array(z.custom<SentinelAutomationPayload>())),\n  synchronous: z.optional(z.boolean()),\n  tasks: z.array(z.custom<Task>()),\n  throwErrors: z.optional(z.boolean()),\n})\n\nexport type SentinelConfigBase = z.infer<typeof SentinelConfigZod>\n\nexport const isSentinelConfig: ReturnType<typeof zodIsFactory<SentinelConfigBase>> = zodIsFactory(SentinelConfigZod)\nexport const asSentinelConfig: ReturnType<typeof zodAsFactory<SentinelConfigBase>> = zodAsFactory(SentinelConfigZod, 'asSentinelConfig')\nexport const toSentinelConfig: ReturnType<typeof zodToFactory<SentinelConfigBase>> = zodToFactory(SentinelConfigZod, 'toSentinelConfig')\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends Schema | void = void> = ModuleConfig<\n  WithAdditional<\n    {\n      automations?: SentinelAutomationPayload[]\n      schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n      synchronous?: boolean\n      tasks: Task[]\n      throwErrors?: boolean\n    },\n    TConfig\n  >,\n  TSchema\n>\n"],
  "mappings": ";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;ACH3C,SAAS,uBAAuB;AAEhC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAkB;AAAA,EAA0B;AAAA,OAC1D;;;ACJP;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP;AAAA,EACE;AAAA,EAAU;AAAA,EAAoB;AAAA,OACzB;AACP,YAAY,OAAO;AAEZ,IAAM,4BAET,SAAS,qCAAqC,IAAI;AAG/C,IAAM,yBAIP,SAAO,mBAAmB,yBAAyB,GAAG,EAAE,GAAG,eAAe,MAAM,CAAC;AAIhF,IAAM,wBAA8E,aAAa,sBAAsB;AACvH,IAAM,wBAA8E,aAAa,wBAAwB,uBAAuB;AAChJ,IAAM,wBAA8E,aAAa,wBAAwB,uBAAu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S,YAAW,UAAO,CAAC;AAAA;AAAA,EAE5B,MAAQ,WAAQ,UAAU;AAC5B,CAAC;AAIM,IAAM,+BAAmGH,cAAa,6BAA6B;AACnJ,IAAM,+BAAmGD,cAAa,+BAA+B,8BAA8B;AACnL,IAAM,+BAAmGE,cAAa,+BAA+B,8BAA8B;AAGnL,IAAM,mCAKS,UAAOE,oBAAmB,mCAAmC,GAAG;AAAA,EACpF,WAAa,UAAkB;AAAA,EAC/B,QAAU,UAAyB;AAAA,EACnC,MAAQ,WAAQ,OAAO;AACzB,CAAC;AAIM,IAAM,kCAAyGH,cAAa,gCAAgC;AAC5J,IAAM,kCAAyGD,cAAa,kCAAkC,iCAAiC;AAC/L,IAAM,kCAAyGE,cAAa,kCAAkC,iCAAiC;;;AC5EtM;AAAA,EACE,gBAAAI;AAAA,EAAc,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,OACvB;AACP;AAAA,EACE,YAAAC;AAAA,OACK;AACP,YAAYC,QAAO;AAGnB,SAAS,uBAAuB;AAKzB,IAAM,uBAETD,UAAS,+BAA+B,IAAI;AAGzC,IAAM,oBAUP,UAAO,iBAAiB;AAAA,EAC5B,QAAU,WAAQ,oBAAoB;AAAA,EACtC,aAAe,YAAW,SAAQ,UAAkC,CAAC,CAAC;AAAA,EACtE,aAAe,YAAW,WAAQ,CAAC;AAAA,EACnC,OAAS,SAAQ,UAAa,CAAC;AAAA,EAC/B,aAAe,YAAW,WAAQ,CAAC;AACrC,CAAC;AAIM,IAAM,mBAAwEF,cAAa,iBAAiB;AAC5G,IAAM,mBAAwED,cAAa,mBAAmB,kBAAkB;AAChI,IAAM,mBAAwEE,cAAa,mBAAmB,kBAAkB;",
  "names": ["AsObjectFactory", "AsObjectFactory", "IsObjectFactory", "zodAsFactory", "zodIsFactory", "zodToFactory", "asSchema", "PayloadZodOfSchema", "z", "zodAsFactory", "zodIsFactory", "zodToFactory", "asSchema", "z"]
}
