@xyo-network/diviner-model 5.3.22 → 5.3.25

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/diviner-model",
3
- "version": "5.3.22",
3
+ "version": "5.3.25",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -30,32 +30,31 @@
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "files": [
32
32
  "dist",
33
- "src",
34
33
  "!**/*.bench.*",
35
34
  "!**/*.spec.*",
36
35
  "!**/*.test.*",
37
36
  "README.md"
38
37
  ],
39
38
  "dependencies": {
40
- "@xyo-network/account-model": "~5.3.22",
41
- "@xyo-network/module-model": "~5.3.22",
42
- "@xyo-network/payload-model": "~5.3.22"
39
+ "@xyo-network/module-model": "~5.3.25",
40
+ "@xyo-network/payload-model": "~5.3.25",
41
+ "@xyo-network/account-model": "~5.3.25"
43
42
  },
44
43
  "devDependencies": {
45
44
  "@opentelemetry/api": "^1.9.1",
46
45
  "@types/node": "^25.5.0",
47
- "@xylabs/sdk-js": "^5.0.91",
48
- "@xylabs/ts-scripts-common": "~7.6.8",
49
- "@xylabs/ts-scripts-yarn3": "~7.6.8",
50
- "@xylabs/tsconfig": "~7.6.8",
46
+ "@xylabs/sdk-js": "^5.0.93",
47
+ "@xylabs/ts-scripts-common": "~7.6.16",
48
+ "@xylabs/ts-scripts-pnpm": "~7.6.16",
49
+ "@xylabs/tsconfig": "~7.6.16",
51
50
  "acorn": "^8.16.0",
52
51
  "axios": "^1.14.0",
53
- "cosmiconfig": "^9.0.1",
54
- "esbuild": "^0.27.4",
55
- "eslint": "^10.1.0",
56
- "rollup": "^4.60.1",
52
+ "esbuild": "^0.28.0",
57
53
  "typescript": "~5.9.3",
58
- "zod": "^4.3.6"
54
+ "zod": "^4.3.6",
55
+ "@xyo-network/module-model": "~5.3.25",
56
+ "@xyo-network/account-model": "~5.3.25",
57
+ "@xyo-network/payload-model": "~5.3.25"
59
58
  },
60
59
  "peerDependencies": {
61
60
  "@xylabs/sdk-js": "^5",
@@ -64,4 +63,4 @@
64
63
  "publishConfig": {
65
64
  "access": "public"
66
65
  }
67
- }
66
+ }
package/src/Config.ts DELETED
@@ -1,24 +0,0 @@
1
- import type { EmptyObject, WithAdditional } from '@xylabs/sdk-js'
2
- import type { ModuleConfig, ModuleIdentifier } from '@xyo-network/module-model'
3
- import {
4
- asSchema, type Payload, type Schema,
5
- } from '@xyo-network/payload-model'
6
-
7
- export const DivinerConfigSchema = asSchema('network.xyo.diviner.config', true)
8
- export type DivinerConfigSchema = typeof DivinerConfigSchema
9
-
10
- export interface ModuleEventSubscription {
11
- sourceEvent: string
12
- sourceModule: ModuleIdentifier
13
- targetModuleFunction?: string
14
- }
15
-
16
- export type DivinerConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends Schema | void = void> = ModuleConfig<
17
- WithAdditional<
18
- {
19
- eventSubscriptions?: ModuleEventSubscription[]
20
- },
21
- Omit<TConfig, 'schema'>
22
- >,
23
- TSchema extends Schema ? TSchema : TConfig extends Payload ? TConfig['schema'] : DivinerConfigSchema
24
- >
@@ -1,11 +0,0 @@
1
- import type { RetryConfig } from '@xylabs/sdk-js'
2
- import type { AccountInstance } from '@xyo-network/account-model'
3
- import type { ModuleQueryResult } from '@xyo-network/module-model'
4
- import type { Payload, WithoutPrivateStorageMeta } from '@xyo-network/payload-model'
5
-
6
- export type DivinerDivineResult<T extends Payload> = WithoutPrivateStorageMeta<T>
7
-
8
- export interface DivinerQueryFunctions<TIn extends Payload = Payload, TOut extends Payload = Payload> {
9
- divine: (payloads?: TIn[], retry?: RetryConfig) => Promise<DivinerDivineResult<TOut>[]>
10
- divineQuery: (payloads?: TIn[], account?: AccountInstance, retry?: RetryConfig) => Promise<ModuleQueryResult<TOut>>
11
- }
package/src/EventData.ts DELETED
@@ -1,10 +0,0 @@
1
- import type { ModuleEventData, ModuleInstance } from '@xyo-network/module-model'
2
- import type { Payload } from '@xyo-network/payload-model'
3
-
4
- import type { DivineEndEventData, DivineStartEventData } from './EventsModels/index.ts'
5
-
6
- export type DivinerModuleEventData<
7
- TInstance extends ModuleInstance = ModuleInstance,
8
- TIn extends Payload = Payload,
9
- TOut extends Payload = Payload,
10
- > = DivineEndEventData<TInstance, TIn, TOut> & DivineStartEventData<TInstance, TIn> & ModuleEventData<TInstance>
@@ -1,17 +0,0 @@
1
- import type { EventData } from '@xylabs/sdk-js'
2
- import type { ModuleEventArgs, QueryableModule } from '@xyo-network/module-model'
3
- import type { Payload } from '@xyo-network/payload-model'
4
-
5
- export type DivineEndEventArgs<T extends QueryableModule = QueryableModule, TIn extends Payload = Payload, TOut extends Payload = Payload> = ModuleEventArgs<
6
- T,
7
- {
8
- errors: Error[]
9
- inPayloads: TIn[]
10
- outPayloads: TOut[]
11
- }
12
- >
13
-
14
- export interface DivineEndEventData<T extends QueryableModule = QueryableModule,
15
- TIn extends Payload = Payload, TOut extends Payload = Payload> extends EventData {
16
- divineEnd: DivineEndEventArgs<T, TIn, TOut>
17
- }
@@ -1,14 +0,0 @@
1
- import type { EventData } from '@xylabs/sdk-js'
2
- import type { ModuleEventArgs, QueryableModule } from '@xyo-network/module-model'
3
- import type { Payload } from '@xyo-network/payload-model'
4
-
5
- export type DivineStartEventArgs<T extends QueryableModule = QueryableModule, TIn extends Payload = Payload> = ModuleEventArgs<
6
- T,
7
- {
8
- inPayloads: TIn[]
9
- }
10
- >
11
-
12
- export interface DivineStartEventData<T extends QueryableModule = QueryableModule, TIn extends Payload = Payload> extends EventData {
13
- divineStart: DivineStartEventArgs<T, TIn>
14
- }
@@ -1,2 +0,0 @@
1
- export * from './DivineEnd.ts'
2
- export * from './DivineStart.ts'
package/src/Instance.ts DELETED
@@ -1,16 +0,0 @@
1
- import type { ModuleInstance } from '@xyo-network/module-model'
2
- import type { Payload } from '@xyo-network/payload-model'
3
-
4
- import type { DivinerQueryFunctions } from './DivinerQueryFunctions.ts'
5
- import type { DivinerModuleEventData } from './EventData.ts'
6
- import type { DivinerModule } from './Module.ts'
7
- import type { DivinerParams } from './Params.ts'
8
-
9
- export interface DivinerInstance<
10
- TParams extends DivinerParams = DivinerParams,
11
- TIn extends Payload = Payload,
12
- TOut extends Payload = Payload,
13
- TEvents extends DivinerModuleEventData = DivinerModuleEventData,
14
- > extends DivinerModule<TParams, TEvents>,
15
- DivinerQueryFunctions<TIn, TOut>,
16
- ModuleInstance<TParams, TEvents> {}
package/src/Module.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { QueryableModule } from '@xyo-network/module-model'
2
-
3
- import type { DivinerModuleEventData } from './EventData.ts'
4
- import type { DivinerParams } from './Params.ts'
5
-
6
- export interface DivinerModule<TParams extends DivinerParams = DivinerParams, TEvents extends DivinerModuleEventData = DivinerModuleEventData>
7
- extends QueryableModule<TParams, TEvents> {}
package/src/Params.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { AnyConfigSchema, QueryableModuleParams } from '@xyo-network/module-model'
2
-
3
- import type { DivinerConfig } from './Config.ts'
4
-
5
- export interface DivinerParams<
6
- TConfig extends AnyConfigSchema<DivinerConfig> = AnyConfigSchema<DivinerConfig>,
7
- > extends QueryableModuleParams<TConfig> {}
package/src/Payload.ts DELETED
@@ -1,11 +0,0 @@
1
- import type {
2
- EmptyObject, Hash, WithAdditional,
3
- } from '@xylabs/sdk-js'
4
- import type {
5
- Payload, Schema, WithSchema,
6
- } from '@xyo-network/payload-model'
7
-
8
- export type DivinedPayload<T extends void | EmptyObject | WithSchema = void, S extends Schema | void = void> = Payload<
9
- WithAdditional<{ sources: Hash[] }, T>,
10
- S
11
- >
@@ -1,8 +0,0 @@
1
- import { asSchema, type Query } from '@xyo-network/payload-model'
2
-
3
- export const DivinerDivineQuerySchema = asSchema('network.xyo.query.diviner.divine', true)
4
- export type DivinerDivineQuerySchema = typeof DivinerDivineQuerySchema
5
-
6
- export type DivinerDivineQuery = Query<{
7
- schema: DivinerDivineQuerySchema
8
- }>
@@ -1,8 +0,0 @@
1
- export * from './Divine.ts'
2
-
3
- import type { ModuleQueries } from '@xyo-network/module-model'
4
-
5
- import type { DivinerDivineQuery } from './Divine.ts'
6
-
7
- export type DivinerQueries = DivinerDivineQuery
8
- export type DivinerModuleQueries = ModuleQueries | DivinerQueries
@@ -1,19 +0,0 @@
1
- import type { ModuleIdentifier } from '@xyo-network/module-model'
2
-
3
- /**
4
- * Configuration for searchable storage of local state
5
- */
6
- export interface SearchableStorage {
7
- /**
8
- * Name/Address of the archivist where intermediate communications are stored
9
- */
10
- archivist: ModuleIdentifier
11
- /**
12
- * Name/Address of the diviner where intermediate communications are filtered
13
- */
14
- boundWitnessDiviner?: ModuleIdentifier
15
- /**
16
- * Name/Address of the diviner where intermediate communications are filtered
17
- */
18
- payloadDiviner?: ModuleIdentifier
19
- }
@@ -1,20 +0,0 @@
1
- import type { TypeCheck } from '@xylabs/sdk-js'
2
- import { IsObjectFactory } from '@xylabs/sdk-js'
3
- import type { AttachableModuleInstance } from '@xyo-network/module-model'
4
- import type { Payload } from '@xyo-network/payload-model'
5
-
6
- import type { DivinerModuleEventData } from '../EventData.ts'
7
- import type { DivinerInstance } from '../Instance.ts'
8
- import type { DivinerParams } from '../Params.ts'
9
-
10
- export interface AttachableDivinerInstance<
11
- TParams extends DivinerParams = DivinerParams,
12
- TIn extends Payload = Payload,
13
- TOut extends Payload = Payload,
14
- TEventData extends DivinerModuleEventData = DivinerModuleEventData,
15
- > extends DivinerInstance<TParams, TIn, TOut, TEventData>,
16
- AttachableModuleInstance<TParams, TEventData> {}
17
-
18
- export type AttachableDivinerInstanceTypeCheck<T extends AttachableDivinerInstance = AttachableDivinerInstance> = TypeCheck<T>
19
-
20
- export class IsAttachableDivinerInstanceFactory<T extends AttachableDivinerInstance = AttachableDivinerInstance> extends IsObjectFactory<T> {}
@@ -1,5 +0,0 @@
1
- import { AsObjectFactory } from '@xylabs/sdk-js'
2
-
3
- import { isAttachableDivinerInstance } from './isAttachableInstance.ts'
4
-
5
- export const asAttachableDivinerInstance = AsObjectFactory.create(isAttachableDivinerInstance)
@@ -1,3 +0,0 @@
1
- export * from './asAttachableInstance.ts'
2
- export * from './AttachableInstance.ts'
3
- export * from './isAttachableInstance.ts'
@@ -1,16 +0,0 @@
1
- import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk-js'
2
- import { IsObjectFactory } from '@xylabs/sdk-js'
3
- import { isAttachableModuleInstance } from '@xyo-network/module-model'
4
-
5
- import { isDivinerInstance } from '../typeChecks.ts'
6
- import type { AttachableDivinerInstance } from './AttachableInstance.ts'
7
-
8
- export const requiredAttachableDivinerInstanceFunctions: ObjectTypeShape = {}
9
-
10
- // we do not use IsInstanceFactory here to prevent a cycle
11
- const factory = new IsObjectFactory<AttachableDivinerInstance>()
12
-
13
- export const isAttachableDivinerInstance: TypeCheck<AttachableDivinerInstance> = factory.create(requiredAttachableDivinerInstanceFunctions, [
14
- isDivinerInstance,
15
- isAttachableModuleInstance,
16
- ])
package/src/index.ts DELETED
@@ -1,12 +0,0 @@
1
- export * from './attachable/index.ts'
2
- export * from './Config.ts'
3
- export * from './DivinerQueryFunctions.ts'
4
- export * from './EventData.ts'
5
- export * from './EventsModels/index.ts'
6
- export * from './Instance.ts'
7
- export * from './Module.ts'
8
- export * from './Params.ts'
9
- export * from './Payload.ts'
10
- export * from './Queries/index.ts'
11
- export * from './SearchableStorage.ts'
12
- export * from './typeChecks.ts'
package/src/typeChecks.ts DELETED
@@ -1,23 +0,0 @@
1
- import type { TypeCheck } from '@xylabs/sdk-js'
2
- import { AsObjectFactory } from '@xylabs/sdk-js'
3
- import {
4
- // eslint-disable-next-line sonarjs/deprecation
5
- IsInstanceFactory, isModuleInstance, IsQueryableModuleFactory, WithFactory,
6
- } from '@xyo-network/module-model'
7
-
8
- import type { DivinerInstance } from './Instance.ts'
9
- import type { DivinerModule } from './Module.ts'
10
- import { DivinerDivineQuerySchema } from './Queries/index.ts'
11
-
12
- export const isDivinerInstance: TypeCheck<DivinerInstance> = new IsInstanceFactory<DivinerInstance>().create({ divine: 'function' }, [isModuleInstance])
13
- export const isDivinerModule: TypeCheck<DivinerModule> = new IsQueryableModuleFactory<DivinerModule>().create([DivinerDivineQuerySchema])
14
-
15
- export const asDivinerModule = AsObjectFactory.create(isDivinerModule)
16
- export const asDivinerInstance = AsObjectFactory.create(isDivinerInstance)
17
-
18
- /** @deprecated use narrowing instead [ if(is) ] */
19
- // eslint-disable-next-line sonarjs/deprecation, @typescript-eslint/no-deprecated
20
- export const withDivinerModule = WithFactory.create(isDivinerModule)
21
- /** @deprecated use narrowing instead [ if(is) ] */
22
- // eslint-disable-next-line sonarjs/deprecation, @typescript-eslint/no-deprecated
23
- export const withDivinerInstance = WithFactory.create(isDivinerInstance)