@xyo-network/module-model 2.45.1 → 2.46.1
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/dist/cjs/Config.js +2 -2
- package/dist/cjs/Config.js.map +1 -1
- package/dist/cjs/Queries/Discover.js +2 -2
- package/dist/cjs/Queries/Discover.js.map +1 -1
- package/dist/cjs/Queries/Subscribe.js +2 -2
- package/dist/cjs/Queries/Subscribe.js.map +1 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{ModuleDescription.js → model/ModuleDescription.js} +0 -0
- package/dist/cjs/model/ModuleDescription.js.map +1 -0
- package/dist/cjs/model/index.js +1 -1
- package/dist/cjs/model/index.js.map +1 -1
- package/dist/docs.json +1394 -864
- package/dist/esm/Config.js +1 -1
- package/dist/esm/Config.js.map +1 -1
- package/dist/esm/Queries/Discover.js +1 -1
- package/dist/esm/Queries/Discover.js.map +1 -1
- package/dist/esm/Queries/Subscribe.js +1 -1
- package/dist/esm/Queries/Subscribe.js.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{ModuleDescription.js → model/ModuleDescription.js} +0 -0
- package/dist/esm/model/ModuleDescription.js.map +1 -0
- package/dist/esm/model/index.js +1 -1
- package/dist/esm/model/index.js.map +1 -1
- package/dist/types/Config.d.ts +4 -4
- package/dist/types/Config.d.ts.map +1 -1
- package/dist/types/PartialConfig.d.ts +2 -2
- package/dist/types/PartialConfig.d.ts.map +1 -1
- package/dist/types/Queries/Discover.d.ts +4 -4
- package/dist/types/Queries/Discover.d.ts.map +1 -1
- package/dist/types/Queries/Subscribe.d.ts +6 -6
- package/dist/types/Queries/Subscribe.d.ts.map +1 -1
- package/dist/types/Queries/index.d.ts +4 -4
- package/dist/types/Queries/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/model/Module.d.ts +12 -7
- package/dist/types/model/Module.d.ts.map +1 -1
- package/dist/types/{ModuleDescription.d.ts → model/ModuleDescription.d.ts} +1 -0
- package/dist/types/model/ModuleDescription.d.ts.map +1 -0
- package/dist/types/model/ModuleRepository.d.ts +1 -2
- package/dist/types/model/ModuleRepository.d.ts.map +1 -1
- package/dist/types/model/index.d.ts +1 -1
- package/dist/types/model/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/Config.ts +4 -4
- package/src/PartialConfig.ts +2 -2
- package/src/Queries/Discover.ts +4 -4
- package/src/Queries/Subscribe.ts +6 -6
- package/src/Queries/index.ts +4 -4
- package/src/index.ts +0 -1
- package/src/model/Module.ts +14 -8
- package/src/{ModuleDescription.ts → model/ModuleDescription.ts} +1 -0
- package/src/model/ModuleRepository.ts +1 -2
- package/src/model/index.ts +1 -1
- package/dist/cjs/ModuleDescription.js.map +0 -1
- package/dist/cjs/model/ModuleResolver.js +0 -3
- package/dist/cjs/model/ModuleResolver.js.map +0 -1
- package/dist/esm/ModuleDescription.js.map +0 -1
- package/dist/esm/model/ModuleResolver.js +0 -2
- package/dist/esm/model/ModuleResolver.js.map +0 -1
- package/dist/types/ModuleDescription.d.ts.map +0 -1
- package/dist/types/model/ModuleResolver.d.ts +0 -8
- package/dist/types/model/ModuleResolver.d.ts.map +0 -1
- package/src/model/ModuleResolver.ts +0 -9
package/dist/esm/Config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const ModuleConfigSchema = 'network.xyo.module.config';
|
|
2
2
|
//# sourceMappingURL=Config.js.map
|
package/dist/esm/Config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,kBAAkB,GAAuB,2BAA2B,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const ModuleDiscoverQuerySchema = 'network.xyo.query.module.discover';
|
|
2
2
|
//# sourceMappingURL=Discover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Discover.js","sourceRoot":"","sources":["../../../src/Queries/Discover.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"Discover.js","sourceRoot":"","sources":["../../../src/Queries/Discover.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,yBAAyB,GAA8B,mCAAmC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const ModuleSubscribeQuerySchema = 'network.xyo.query.module.subscribe';
|
|
2
2
|
//# sourceMappingURL=Subscribe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Subscribe.js","sourceRoot":"","sources":["../../../src/Queries/Subscribe.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"Subscribe.js","sourceRoot":"","sources":["../../../src/Queries/Subscribe.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,0BAA0B,GAA+B,oCAAoC,CAAA"}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModuleDescription.js","sourceRoot":"","sources":["../../../src/model/ModuleDescription.ts"],"names":[],"mappings":""}
|
package/dist/esm/model/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA"}
|
package/dist/types/Config.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { EmptyObject } from '@xyo-network/core';
|
|
2
2
|
import { XyoPayload } from '@xyo-network/payload-model';
|
|
3
|
-
export type
|
|
4
|
-
export declare const
|
|
3
|
+
export type ModuleConfigSchema = 'network.xyo.module.config';
|
|
4
|
+
export declare const ModuleConfigSchema: ModuleConfigSchema;
|
|
5
5
|
export type AddressString = string;
|
|
6
6
|
export type CosigningAddressSet = string[];
|
|
7
7
|
export type SchemaString = string;
|
|
8
|
-
export type
|
|
8
|
+
export type ModuleConfigBase<T extends EmptyObject = EmptyObject> = XyoPayload<{
|
|
9
9
|
name?: string;
|
|
10
10
|
security?: {
|
|
11
11
|
allowed?: Record<SchemaString, (AddressString | CosigningAddressSet)[]>;
|
|
12
12
|
disallowed?: Record<SchemaString, AddressString[]>;
|
|
13
13
|
};
|
|
14
14
|
} & T>;
|
|
15
|
-
export type
|
|
15
|
+
export type ModuleConfig<TConfig extends XyoPayload = XyoPayload> = ModuleConfigBase<TConfig>;
|
|
16
16
|
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAEvD,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAEvD,MAAM,MAAM,kBAAkB,GAAG,2BAA2B,CAAA;AAC5D,eAAO,MAAM,kBAAkB,EAAE,kBAAgD,CAAA;AAEjF,MAAM,MAAM,aAAa,GAAG,MAAM,CAAA;AAClC,MAAM,MAAM,mBAAmB,GAAG,MAAM,EAAE,CAAA;AAC1C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAA;AAEjC,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,UAAU,CAC5E;IACE,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,QAAQ,CAAC,EAAE;QAET,OAAO,CAAC,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,aAAa,GAAG,mBAAmB,CAAC,EAAE,CAAC,CAAA;QAEvE,UAAU,CAAC,EAAE,MAAM,CAAC,YAAY,EAAE,aAAa,EAAE,CAAC,CAAA;KACnD,CAAA;CACF,GAAG,CAAC,CACN,CAAA;AAED,MAAM,MAAM,YAAY,CAAC,OAAO,SAAS,UAAU,GAAG,UAAU,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type PartialModuleConfig<T extends
|
|
1
|
+
import { ModuleConfig } from './Config';
|
|
2
|
+
export type PartialModuleConfig<T extends ModuleConfig> = Omit<T, 'schema'> & {
|
|
3
3
|
schema?: T['schema'];
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=PartialConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PartialConfig.d.ts","sourceRoot":"","sources":["../../src/PartialConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PartialConfig.d.ts","sourceRoot":"","sources":["../../src/PartialConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,YAAY,IAAI,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG;IAC5E,MAAM,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAA;CACrB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { XyoQuery } from '../Query';
|
|
2
|
-
export type
|
|
3
|
-
export declare const
|
|
4
|
-
export type
|
|
5
|
-
schema:
|
|
2
|
+
export type ModuleDiscoverQuerySchema = 'network.xyo.query.module.discover';
|
|
3
|
+
export declare const ModuleDiscoverQuerySchema: ModuleDiscoverQuerySchema;
|
|
4
|
+
export type ModuleDiscoverQuery = XyoQuery<{
|
|
5
|
+
schema: ModuleDiscoverQuerySchema;
|
|
6
6
|
}>;
|
|
7
7
|
//# sourceMappingURL=Discover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Discover.d.ts","sourceRoot":"","sources":["../../../src/Queries/Discover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Discover.d.ts","sourceRoot":"","sources":["../../../src/Queries/Discover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,MAAM,MAAM,yBAAyB,GAAG,mCAAmC,CAAA;AAC3E,eAAO,MAAM,yBAAyB,EAAE,yBAA+D,CAAA;AAEvG,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,MAAM,EAAE,yBAAyB,CAAA;CAClC,CAAC,CAAA"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { XyoQuery } from '../Query';
|
|
2
|
-
export type
|
|
3
|
-
export declare const
|
|
4
|
-
export interface
|
|
2
|
+
export type ModuleSubscribeQuerySchema = 'network.xyo.query.module.subscribe';
|
|
3
|
+
export declare const ModuleSubscribeQuerySchema: ModuleSubscribeQuerySchema;
|
|
4
|
+
export interface ModuleSubscribeFilter {
|
|
5
5
|
/** @field if specified, at least one of the schemas must be present in the boundwtness to generate a notification */
|
|
6
6
|
schema?: string[];
|
|
7
7
|
}
|
|
8
|
-
export type
|
|
8
|
+
export type ModuleSubscribeQuery = XyoQuery<{
|
|
9
9
|
/** @field The address that will receive notifications */
|
|
10
10
|
address: string;
|
|
11
11
|
/** @field A subscribe with a null for filter is an unsubscribe */
|
|
12
|
-
filter?:
|
|
12
|
+
filter?: ModuleSubscribeFilter | null;
|
|
13
13
|
/** @field The maximum events queued per send [may increase frequency] */
|
|
14
14
|
maxQueue?: number;
|
|
15
|
-
schema:
|
|
15
|
+
schema: ModuleSubscribeQuerySchema;
|
|
16
16
|
}>;
|
|
17
17
|
//# sourceMappingURL=Subscribe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Subscribe.d.ts","sourceRoot":"","sources":["../../../src/Queries/Subscribe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Subscribe.d.ts","sourceRoot":"","sources":["../../../src/Queries/Subscribe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,MAAM,MAAM,0BAA0B,GAAG,oCAAoC,CAAA;AAC7E,eAAO,MAAM,0BAA0B,EAAE,0BAAiE,CAAA;AAE1G,MAAM,WAAW,qBAAqB;IACpC,qHAAqH;IACrH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB;AAGD,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAA;IACf,kEAAkE;IAClE,MAAM,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAA;IACrC,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,0BAA0B,CAAA;CACnC,CAAC,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { XyoQuery } from '../Query';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { ModuleDiscoverQuery } from './Discover';
|
|
3
|
+
import { ModuleSubscribeQuery } from './Subscribe';
|
|
4
4
|
export * from './Discover';
|
|
5
5
|
export * from './Subscribe';
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
6
|
+
export type ModuleQueryBase = ModuleSubscribeQuery | ModuleDiscoverQuery;
|
|
7
|
+
export type ModuleQuery<T extends XyoQuery | void = void> = T extends XyoQuery ? ModuleQueryBase | T : ModuleQueryBase;
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Queries/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Queries/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAE3B,MAAM,MAAM,eAAe,GAAG,oBAAoB,GAAG,mBAAmB,CAAA;AAExE,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,QAAQ,GAAG,IAAI,GAAG,IAAI,IAAI,CAAC,SAAS,QAAQ,GAAG,eAAe,GAAG,CAAC,GAAG,eAAe,CAAA"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { XyoPayload } from '@xyo-network/payload-model';
|
|
2
2
|
import { Promisable } from '@xyo-network/promise';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ModuleConfig } from '../Config';
|
|
4
|
+
import { ModuleFilter } from '../ModuleFilter';
|
|
5
5
|
import { ModuleQueryResult } from '../ModuleQueryResult';
|
|
6
6
|
import { XyoQueryBoundWitness } from '../Query';
|
|
7
|
-
export interface
|
|
7
|
+
export interface ModuleResolver<TModule extends Module = Module> {
|
|
8
|
+
isModuleResolver: boolean;
|
|
9
|
+
resolve(filter?: ModuleFilter): Promisable<TModule[]>;
|
|
10
|
+
}
|
|
11
|
+
export interface Module<TConfig extends ModuleConfig = ModuleConfig> {
|
|
8
12
|
address: string;
|
|
9
13
|
config: TConfig;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
queries: string[];
|
|
15
|
+
query: <T extends XyoQueryBoundWitness = XyoQueryBoundWitness, TConf extends ModuleConfig = ModuleConfig>(query: T, payloads?: XyoPayload[], queryConfig?: TConf) => Promisable<ModuleQueryResult>;
|
|
16
|
+
queryable: <T extends XyoQueryBoundWitness = XyoQueryBoundWitness, TConf extends ModuleConfig = ModuleConfig>(query: T, payloads?: XyoPayload[], queryConfig?: TConf) => Promisable<boolean>;
|
|
17
|
+
resolve: (filter?: ModuleFilter) => Promisable<Module[]>;
|
|
18
|
+
resolver?: ModuleResolver;
|
|
14
19
|
}
|
|
15
20
|
//# sourceMappingURL=Module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Module.d.ts","sourceRoot":"","sources":["../../../src/model/Module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Module.d.ts","sourceRoot":"","sources":["../../../src/model/Module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IAC7D,gBAAgB,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC,CAAA;CACtD;AAED,MAAM,WAAW,MAAM,CAAC,OAAO,SAAS,YAAY,GAAG,YAAY;IACjE,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,KAAK,EAAE,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,EAAE,KAAK,SAAS,YAAY,GAAG,YAAY,EACtG,KAAK,EAAE,CAAC,EACR,QAAQ,CAAC,EAAE,UAAU,EAAE,EACvB,WAAW,CAAC,EAAE,KAAK,KAChB,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAClC,SAAS,EAAE,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,EAAE,KAAK,SAAS,YAAY,GAAG,YAAY,EAC1G,KAAK,EAAE,CAAC,EACR,QAAQ,CAAC,EAAE,UAAU,EAAE,EACvB,WAAW,CAAC,EAAE,KAAK,KAChB,UAAU,CAAC,OAAO,CAAC,CAAA;IACxB,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,YAAY,KAAK,UAAU,CAAC,MAAM,EAAE,CAAC,CAAA;IACxD,QAAQ,CAAC,EAAE,cAAc,CAAA;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModuleDescription.d.ts","sourceRoot":"","sources":["../../../src/model/ModuleDescription.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Module } from './Module';
|
|
2
|
-
import { ModuleResolver } from './ModuleResolver';
|
|
1
|
+
import { Module, ModuleResolver } from './Module';
|
|
3
2
|
export interface ModuleRepository<TModule extends Module = Module> extends ModuleResolver<TModule> {
|
|
4
3
|
add(module: Module, name?: string): this;
|
|
5
4
|
add(module: Module[], name?: string[]): this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleRepository.d.ts","sourceRoot":"","sources":["../../../src/model/ModuleRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"ModuleRepository.d.ts","sourceRoot":"","sources":["../../../src/model/ModuleRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAEjD,MAAM,WAAW,gBAAgB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,cAAc,CAAC,OAAO,CAAC;IAChG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAC5C,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;IAE9D,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;IACrC,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;CACzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA"}
|
package/package.json
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xyo-network/boundwitness-model": "^2.
|
|
14
|
-
"@xyo-network/core": "^2.
|
|
15
|
-
"@xyo-network/payload-model": "^2.
|
|
16
|
-
"@xyo-network/promise": "^2.
|
|
13
|
+
"@xyo-network/boundwitness-model": "^2.46.1",
|
|
14
|
+
"@xyo-network/core": "^2.46.1",
|
|
15
|
+
"@xyo-network/payload-model": "^2.46.1",
|
|
16
|
+
"@xyo-network/promise": "^2.46.1"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@xylabs/ts-scripts-yarn3": "^2.14.15",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
},
|
|
54
54
|
"sideEffects": false,
|
|
55
55
|
"types": "dist/types/index.d.ts",
|
|
56
|
-
"version": "2.
|
|
56
|
+
"version": "2.46.1"
|
|
57
57
|
}
|
package/src/Config.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { EmptyObject } from '@xyo-network/core'
|
|
2
2
|
import { XyoPayload } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
|
-
export type
|
|
5
|
-
export const
|
|
4
|
+
export type ModuleConfigSchema = 'network.xyo.module.config'
|
|
5
|
+
export const ModuleConfigSchema: ModuleConfigSchema = 'network.xyo.module.config'
|
|
6
6
|
|
|
7
7
|
export type AddressString = string
|
|
8
8
|
export type CosigningAddressSet = string[]
|
|
9
9
|
export type SchemaString = string
|
|
10
10
|
|
|
11
|
-
export type
|
|
11
|
+
export type ModuleConfigBase<T extends EmptyObject = EmptyObject> = XyoPayload<
|
|
12
12
|
{
|
|
13
13
|
name?: string
|
|
14
14
|
//if both allowed and disallowed is specified, then disallowed takes priority
|
|
@@ -21,4 +21,4 @@ export type AbstractModuleConfigBase<T extends EmptyObject = EmptyObject> = XyoP
|
|
|
21
21
|
} & T
|
|
22
22
|
>
|
|
23
23
|
|
|
24
|
-
export type
|
|
24
|
+
export type ModuleConfig<TConfig extends XyoPayload = XyoPayload> = ModuleConfigBase<TConfig>
|
package/src/PartialConfig.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModuleConfig } from './Config'
|
|
2
2
|
|
|
3
|
-
export type PartialModuleConfig<T extends
|
|
3
|
+
export type PartialModuleConfig<T extends ModuleConfig> = Omit<T, 'schema'> & {
|
|
4
4
|
schema?: T['schema']
|
|
5
5
|
}
|
package/src/Queries/Discover.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { XyoQuery } from '../Query'
|
|
2
2
|
|
|
3
|
-
export type
|
|
4
|
-
export const
|
|
3
|
+
export type ModuleDiscoverQuerySchema = 'network.xyo.query.module.discover'
|
|
4
|
+
export const ModuleDiscoverQuerySchema: ModuleDiscoverQuerySchema = 'network.xyo.query.module.discover'
|
|
5
5
|
|
|
6
|
-
export type
|
|
7
|
-
schema:
|
|
6
|
+
export type ModuleDiscoverQuery = XyoQuery<{
|
|
7
|
+
schema: ModuleDiscoverQuerySchema
|
|
8
8
|
}>
|
package/src/Queries/Subscribe.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { XyoQuery } from '../Query'
|
|
2
2
|
|
|
3
|
-
export type
|
|
4
|
-
export const
|
|
3
|
+
export type ModuleSubscribeQuerySchema = 'network.xyo.query.module.subscribe'
|
|
4
|
+
export const ModuleSubscribeQuerySchema: ModuleSubscribeQuerySchema = 'network.xyo.query.module.subscribe'
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface ModuleSubscribeFilter {
|
|
7
7
|
/** @field if specified, at least one of the schemas must be present in the boundwtness to generate a notification */
|
|
8
8
|
schema?: string[]
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
//requests notification when a boundwitness is added to the modules chain that meets the filter criteria
|
|
12
|
-
export type
|
|
12
|
+
export type ModuleSubscribeQuery = XyoQuery<{
|
|
13
13
|
/** @field The address that will receive notifications */
|
|
14
14
|
address: string
|
|
15
15
|
/** @field A subscribe with a null for filter is an unsubscribe */
|
|
16
|
-
filter?:
|
|
16
|
+
filter?: ModuleSubscribeFilter | null
|
|
17
17
|
/** @field The maximum events queued per send [may increase frequency] */
|
|
18
18
|
maxQueue?: number
|
|
19
|
-
schema:
|
|
19
|
+
schema: ModuleSubscribeQuerySchema
|
|
20
20
|
}>
|
package/src/Queries/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { XyoQuery } from '../Query'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { ModuleDiscoverQuery } from './Discover'
|
|
3
|
+
import { ModuleSubscribeQuery } from './Subscribe'
|
|
4
4
|
|
|
5
5
|
export * from './Discover'
|
|
6
6
|
export * from './Subscribe'
|
|
7
7
|
|
|
8
|
-
export type
|
|
8
|
+
export type ModuleQueryBase = ModuleSubscribeQuery | ModuleDiscoverQuery
|
|
9
9
|
|
|
10
|
-
export type
|
|
10
|
+
export type ModuleQuery<T extends XyoQuery | void = void> = T extends XyoQuery ? ModuleQueryBase | T : ModuleQueryBase
|
package/src/index.ts
CHANGED
package/src/model/Module.ts
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
import { XyoPayload } from '@xyo-network/payload-model'
|
|
2
2
|
import { Promisable } from '@xyo-network/promise'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { ModuleConfig } from '../Config'
|
|
5
|
+
import { ModuleFilter } from '../ModuleFilter'
|
|
6
6
|
import { ModuleQueryResult } from '../ModuleQueryResult'
|
|
7
7
|
import { XyoQueryBoundWitness } from '../Query'
|
|
8
8
|
|
|
9
|
-
export interface
|
|
9
|
+
export interface ModuleResolver<TModule extends Module = Module> {
|
|
10
|
+
isModuleResolver: boolean
|
|
11
|
+
resolve(filter?: ModuleFilter): Promisable<TModule[]>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface Module<TConfig extends ModuleConfig = ModuleConfig> {
|
|
10
15
|
address: string
|
|
11
16
|
config: TConfig
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
query: <T extends XyoQueryBoundWitness = XyoQueryBoundWitness, TConf extends AbstractModuleConfig = AbstractModuleConfig>(
|
|
17
|
+
queries: string[]
|
|
18
|
+
query: <T extends XyoQueryBoundWitness = XyoQueryBoundWitness, TConf extends ModuleConfig = ModuleConfig>(
|
|
15
19
|
query: T,
|
|
16
20
|
payloads?: XyoPayload[],
|
|
17
21
|
queryConfig?: TConf,
|
|
18
22
|
) => Promisable<ModuleQueryResult>
|
|
19
|
-
queryable: <T extends XyoQueryBoundWitness = XyoQueryBoundWitness, TConf extends
|
|
23
|
+
queryable: <T extends XyoQueryBoundWitness = XyoQueryBoundWitness, TConf extends ModuleConfig = ModuleConfig>(
|
|
20
24
|
query: T,
|
|
21
25
|
payloads?: XyoPayload[],
|
|
22
26
|
queryConfig?: TConf,
|
|
23
|
-
) => boolean
|
|
27
|
+
) => Promisable<boolean>
|
|
28
|
+
resolve: (filter?: ModuleFilter) => Promisable<Module[]>
|
|
29
|
+
resolver?: ModuleResolver
|
|
24
30
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Module } from './Module'
|
|
2
|
-
import { ModuleResolver } from './ModuleResolver'
|
|
1
|
+
import { Module, ModuleResolver } from './Module'
|
|
3
2
|
|
|
4
3
|
export interface ModuleRepository<TModule extends Module = Module> extends ModuleResolver<TModule> {
|
|
5
4
|
add(module: Module, name?: string): this
|
package/src/model/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleDescription.js","sourceRoot":"","sources":["../../src/ModuleDescription.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleResolver.js","sourceRoot":"","sources":["../../../src/model/ModuleResolver.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleDescription.js","sourceRoot":"","sources":["../../src/ModuleDescription.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleResolver.js","sourceRoot":"","sources":["../../../src/model/ModuleResolver.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleDescription.d.ts","sourceRoot":"","sources":["../../src/ModuleDescription.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Promisable } from '@xyo-network/promise';
|
|
2
|
-
import { ModuleFilter } from '../ModuleFilter';
|
|
3
|
-
import { Module } from './Module';
|
|
4
|
-
export interface ModuleResolver<TModule extends Module = Module> {
|
|
5
|
-
isModuleResolver: boolean;
|
|
6
|
-
resolve(filter?: ModuleFilter): Promisable<TModule[]>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=ModuleResolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleResolver.d.ts","sourceRoot":"","sources":["../../../src/model/ModuleResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IAC7D,gBAAgB,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC,CAAA;CACtD"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Promisable } from '@xyo-network/promise'
|
|
2
|
-
|
|
3
|
-
import { ModuleFilter } from '../ModuleFilter'
|
|
4
|
-
import { Module } from './Module'
|
|
5
|
-
|
|
6
|
-
export interface ModuleResolver<TModule extends Module = Module> {
|
|
7
|
-
isModuleResolver: boolean
|
|
8
|
-
resolve(filter?: ModuleFilter): Promisable<TModule[]>
|
|
9
|
-
}
|