@xyo-network/diviner-model 3.15.5 → 3.15.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/Divine.ts","../../src/attachable/AttachableInstance.ts","../../src/Config.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isAttachableDivinerInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableDivinerInstance = AsObjectFactory.create(isAttachableDivinerInstance)\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { ObjectTypeShape } from '@xylabs/typeof'\nimport { isAttachableModuleInstance } from '@xyo-network/module-model'\n\nimport { isDivinerInstance } from '../typeChecks.ts'\nimport type { AttachableDivinerInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableDivinerInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableDivinerInstance>()\n\nexport const isAttachableDivinerInstance: TypeCheck<AttachableDivinerInstance> = factory.create(requiredAttachableDivinerInstanceFunctions, [\n isDivinerInstance,\n isAttachableModuleInstance,\n])\n","import { AsObjectFactory } from '@xylabs/object'\nimport {\n IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { DivinerInstance } from './Instance.ts'\nimport type { DivinerModule } from './Module.ts'\nimport { DivinerDivineQuerySchema } from './Queries/index.ts'\n\nexport const isDivinerInstance = new IsInstanceFactory<DivinerInstance>().create({ divine: 'function' }, [isModuleInstance])\nexport const isDivinerModule = new IsModuleFactory<DivinerModule>().create([DivinerDivineQuerySchema])\n\nexport const asDivinerModule = AsObjectFactory.create(isDivinerModule)\nexport const asDivinerInstance = AsObjectFactory.create(isDivinerInstance)\nexport const withDivinerModule = WithFactory.create(isDivinerModule)\nexport const withDivinerInstance = WithFactory.create(isDivinerInstance)\n","import type { Query } from '@xyo-network/payload-model'\n\nexport type DivinerDivineQuerySchema = 'network.xyo.query.diviner.divine'\nexport const DivinerDivineQuerySchema: DivinerDivineQuerySchema = 'network.xyo.query.diviner.divine'\n\nexport type DivinerDivineQuery = Query<{\n schema: DivinerDivineQuerySchema\n}>\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { DivinerModuleEventData } from '../EventData.ts'\nimport type { DivinerInstance } from '../Instance.ts'\nimport type { DivinerParams } from '../Params.ts'\n\nexport interface AttachableDivinerInstance<\n TParams extends DivinerParams = DivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData = DivinerModuleEventData,\n> extends DivinerInstance<TParams, TIn, TOut, TEventData>,\n AttachableModuleInstance<TParams, TEventData> {}\n\nexport type AttachableDivinerInstanceTypeCheck<T extends AttachableDivinerInstance = AttachableDivinerInstance> = TypeCheck<T>\n\nexport class IsAttachableDivinerInstanceFactory<T extends AttachableDivinerInstance = AttachableDivinerInstance> extends IsObjectFactory<T> {}\n","import type { EmptyObject, WithAdditional } from '@xylabs/object'\nimport type { ModuleConfig } from '@xyo-network/module-model'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\n\nexport const DivinerConfigSchema = 'network.xyo.diviner.config' as const\nexport type DivinerConfigSchema = typeof DivinerConfigSchema\n\nexport type DivinerConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends Schema | void = void> = ModuleConfig<\n WithAdditional<\n {\n schema: TConfig extends Payload ? TConfig['schema'] : DivinerConfigSchema\n },\n TConfig\n >,\n TSchema\n>\n"],"mappings":";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;ACH3C,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAiB;AAAA,EAAkB;AAAA,OACjD;;;ACAA,IAAM,2BAAqD;;;ADM3D,IAAM,oBAAoB,IAAI,kBAAmC,EAAE,OAAO,EAAE,QAAQ,WAAW,GAAG,CAAC,gBAAgB,CAAC;AACpH,IAAM,kBAAkB,IAAI,gBAA+B,EAAE,OAAO,CAAC,wBAAwB,CAAC;AAE9F,IAAM,kBAAkB,gBAAgB,OAAO,eAAe;AAC9D,IAAM,oBAAoB,gBAAgB,OAAO,iBAAiB;AAClE,IAAM,oBAAoB,YAAY,OAAO,eAAe;AAC5D,IAAM,sBAAsB,YAAY,OAAO,iBAAiB;;;ADPhE,IAAM,6CAA8D,CAAC;AAG5E,IAAM,UAAU,IAAI,gBAA2C;AAExD,IAAM,8BAAoE,QAAQ,OAAO,4CAA4C;AAAA,EAC1I;AAAA,EACA;AACF,CAAC;;;ADZM,IAAM,8BAA8BC,iBAAgB,OAAO,2BAA2B;;;AIH7F,SAAS,mBAAAC,wBAAuB;AAkBzB,IAAM,qCAAN,cAAkHA,iBAAmB;AAAC;;;ACftI,IAAM,sBAAsB;","names":["AsObjectFactory","AsObjectFactory","IsObjectFactory"]}
1
+ {"version":3,"sources":["../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/Divine.ts","../../src/attachable/AttachableInstance.ts","../../src/Config.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isAttachableDivinerInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableDivinerInstance = AsObjectFactory.create(isAttachableDivinerInstance)\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { ObjectTypeShape } from '@xylabs/typeof'\nimport { isAttachableModuleInstance } from '@xyo-network/module-model'\n\nimport { isDivinerInstance } from '../typeChecks.ts'\nimport type { AttachableDivinerInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableDivinerInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableDivinerInstance>()\n\nexport const isAttachableDivinerInstance: TypeCheck<AttachableDivinerInstance> = factory.create(requiredAttachableDivinerInstanceFunctions, [\n isDivinerInstance,\n isAttachableModuleInstance,\n])\n","import { AsObjectFactory } from '@xylabs/object'\nimport {\n IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { DivinerInstance } from './Instance.ts'\nimport type { DivinerModule } from './Module.ts'\nimport { DivinerDivineQuerySchema } from './Queries/index.ts'\n\nexport const isDivinerInstance = new IsInstanceFactory<DivinerInstance>().create({ divine: 'function' }, [isModuleInstance])\nexport const isDivinerModule = new IsModuleFactory<DivinerModule>().create([DivinerDivineQuerySchema])\n\nexport const asDivinerModule = AsObjectFactory.create(isDivinerModule)\nexport const asDivinerInstance = AsObjectFactory.create(isDivinerInstance)\nexport const withDivinerModule = WithFactory.create(isDivinerModule)\nexport const withDivinerInstance = WithFactory.create(isDivinerInstance)\n","import type { Query } from '@xyo-network/payload-model'\n\nexport type DivinerDivineQuerySchema = 'network.xyo.query.diviner.divine'\nexport const DivinerDivineQuerySchema: DivinerDivineQuerySchema = 'network.xyo.query.diviner.divine'\n\nexport type DivinerDivineQuery = Query<{\n schema: DivinerDivineQuerySchema\n}>\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { DivinerModuleEventData } from '../EventData.ts'\nimport type { DivinerInstance } from '../Instance.ts'\nimport type { DivinerParams } from '../Params.ts'\n\nexport interface AttachableDivinerInstance<\n TParams extends DivinerParams = DivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData = DivinerModuleEventData,\n> extends DivinerInstance<TParams, TIn, TOut, TEventData>,\n AttachableModuleInstance<TParams, TEventData> {}\n\nexport type AttachableDivinerInstanceTypeCheck<T extends AttachableDivinerInstance = AttachableDivinerInstance> = TypeCheck<T>\n\nexport class IsAttachableDivinerInstanceFactory<T extends AttachableDivinerInstance = AttachableDivinerInstance> extends IsObjectFactory<T> {}\n","import type { EmptyObject, WithAdditional } from '@xylabs/object'\nimport type { ModuleConfig, ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\n\nexport const DivinerConfigSchema = 'network.xyo.diviner.config' as const\nexport type DivinerConfigSchema = typeof DivinerConfigSchema\n\nexport interface ModuleEventSubscription {\n sourceEvent: string\n sourceModule: ModuleIdentifier\n targetModuleFunction?: string\n}\n\nexport type DivinerConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends Schema | void = void> = ModuleConfig<\n WithAdditional<\n {\n eventSubscriptions?: ModuleEventSubscription[]\n schema: TConfig extends Payload ? TConfig['schema'] : DivinerConfigSchema\n },\n TConfig\n >,\n TSchema\n>\n"],"mappings":";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;ACH3C,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAiB;AAAA,EAAkB;AAAA,OACjD;;;ACAA,IAAM,2BAAqD;;;ADM3D,IAAM,oBAAoB,IAAI,kBAAmC,EAAE,OAAO,EAAE,QAAQ,WAAW,GAAG,CAAC,gBAAgB,CAAC;AACpH,IAAM,kBAAkB,IAAI,gBAA+B,EAAE,OAAO,CAAC,wBAAwB,CAAC;AAE9F,IAAM,kBAAkB,gBAAgB,OAAO,eAAe;AAC9D,IAAM,oBAAoB,gBAAgB,OAAO,iBAAiB;AAClE,IAAM,oBAAoB,YAAY,OAAO,eAAe;AAC5D,IAAM,sBAAsB,YAAY,OAAO,iBAAiB;;;ADPhE,IAAM,6CAA8D,CAAC;AAG5E,IAAM,UAAU,IAAI,gBAA2C;AAExD,IAAM,8BAAoE,QAAQ,OAAO,4CAA4C;AAAA,EAC1I;AAAA,EACA;AACF,CAAC;;;ADZM,IAAM,8BAA8BC,iBAAgB,OAAO,2BAA2B;;;AIH7F,SAAS,mBAAAC,wBAAuB;AAkBzB,IAAM,qCAAN,cAAkHA,iBAAmB;AAAC;;;ACftI,IAAM,sBAAsB;","names":["AsObjectFactory","AsObjectFactory","IsObjectFactory"]}
@@ -1,9 +1,15 @@
1
1
  import type { EmptyObject, WithAdditional } from '@xylabs/object';
2
- import type { ModuleConfig } from '@xyo-network/module-model';
2
+ import type { ModuleConfig, ModuleIdentifier } from '@xyo-network/module-model';
3
3
  import type { Payload, Schema } from '@xyo-network/payload-model';
4
4
  export declare const DivinerConfigSchema: "network.xyo.diviner.config";
5
5
  export type DivinerConfigSchema = typeof DivinerConfigSchema;
6
+ export interface ModuleEventSubscription {
7
+ sourceEvent: string;
8
+ sourceModule: ModuleIdentifier;
9
+ targetModuleFunction?: string;
10
+ }
6
11
  export type DivinerConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends Schema | void = void> = ModuleConfig<WithAdditional<{
12
+ eventSubscriptions?: ModuleEventSubscription[];
7
13
  schema: TConfig extends Payload ? TConfig['schema'] : DivinerConfigSchema;
8
14
  }, TConfig>, TSchema>;
9
15
  //# sourceMappingURL=Config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEjE,eAAO,MAAM,mBAAmB,EAAG,4BAAqC,CAAA;AACxE,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA;AAE5D,MAAM,MAAM,aAAa,CAAC,OAAO,SAAS,OAAO,GAAG,WAAW,GAAG,IAAI,GAAG,IAAI,EAAE,OAAO,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CACjI,cAAc,CACZ;IACE,MAAM,EAAE,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,mBAAmB,CAAA;CAC1E,EACD,OAAO,CACR,EACD,OAAO,CACR,CAAA"}
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEjE,eAAO,MAAM,mBAAmB,EAAG,4BAAqC,CAAA;AACxE,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA;AAE5D,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,gBAAgB,CAAA;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,MAAM,aAAa,CAAC,OAAO,SAAS,OAAO,GAAG,WAAW,GAAG,IAAI,GAAG,IAAI,EAAE,OAAO,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CACjI,cAAc,CACZ;IACE,kBAAkB,CAAC,EAAE,uBAAuB,EAAE,CAAA;IAC9C,MAAM,EAAE,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,mBAAmB,CAAA;CAC1E,EACD,OAAO,CACR,EACD,OAAO,CACR,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/diviner-model",
3
- "version": "3.15.5",
3
+ "version": "3.15.6",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -33,10 +33,10 @@
33
33
  "@xylabs/object": "^4.9.8",
34
34
  "@xylabs/retry": "^4.9.8",
35
35
  "@xylabs/typeof": "^4.9.8",
36
- "@xyo-network/account-model": "^3.15.5",
37
- "@xyo-network/module-events": "^3.15.5",
38
- "@xyo-network/module-model": "^3.15.5",
39
- "@xyo-network/payload-model": "^3.15.5"
36
+ "@xyo-network/account-model": "^3.15.6",
37
+ "@xyo-network/module-events": "^3.15.6",
38
+ "@xyo-network/module-model": "^3.15.6",
39
+ "@xyo-network/payload-model": "^3.15.6"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@xylabs/ts-scripts-yarn3": "^6.5.5",
package/src/Config.ts CHANGED
@@ -1,13 +1,20 @@
1
1
  import type { EmptyObject, WithAdditional } from '@xylabs/object'
2
- import type { ModuleConfig } from '@xyo-network/module-model'
2
+ import type { ModuleConfig, ModuleIdentifier } from '@xyo-network/module-model'
3
3
  import type { Payload, Schema } from '@xyo-network/payload-model'
4
4
 
5
5
  export const DivinerConfigSchema = 'network.xyo.diviner.config' as const
6
6
  export type DivinerConfigSchema = typeof DivinerConfigSchema
7
7
 
8
+ export interface ModuleEventSubscription {
9
+ sourceEvent: string
10
+ sourceModule: ModuleIdentifier
11
+ targetModuleFunction?: string
12
+ }
13
+
8
14
  export type DivinerConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends Schema | void = void> = ModuleConfig<
9
15
  WithAdditional<
10
16
  {
17
+ eventSubscriptions?: ModuleEventSubscription[]
11
18
  schema: TConfig extends Payload ? TConfig['schema'] : DivinerConfigSchema
12
19
  },
13
20
  TConfig