@xyo-network/module-model 5.3.4 → 5.3.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.
- package/dist/neutral/CreatableModule/CreatableModule.d.ts +2 -14
- package/dist/neutral/CreatableModule/CreatableModule.d.ts.map +1 -1
- package/dist/neutral/CreatableModule/LabeledCreatableModule.d.ts +14 -0
- package/dist/neutral/CreatableModule/LabeledCreatableModule.d.ts.map +1 -0
- package/dist/neutral/CreatableModule/index.d.ts +1 -0
- package/dist/neutral/CreatableModule/index.d.ts.map +1 -1
- package/dist/neutral/QueryableModule/IsQueryableModuleFactory.d.ts +12 -0
- package/dist/neutral/QueryableModule/IsQueryableModuleFactory.d.ts.map +1 -0
- package/dist/neutral/QueryableModule/QueryableModule.d.ts +10 -0
- package/dist/neutral/QueryableModule/QueryableModule.d.ts.map +1 -0
- package/dist/neutral/{module/ModuleFields.d.ts → QueryableModule/QueryableModuleFields.d.ts} +6 -3
- package/dist/neutral/QueryableModule/QueryableModuleFields.d.ts.map +1 -0
- package/dist/neutral/{module/ModuleQueryFunctions.d.ts → QueryableModule/QueryableModuleFunctions.d.ts} +5 -2
- package/dist/neutral/QueryableModule/QueryableModuleFunctions.d.ts.map +1 -0
- package/dist/neutral/QueryableModule/QueryableModuleParams.d.ts +19 -0
- package/dist/neutral/QueryableModule/QueryableModuleParams.d.ts.map +1 -0
- package/dist/neutral/QueryableModule/asQueryableModule.d.ts +4 -0
- package/dist/neutral/QueryableModule/asQueryableModule.d.ts.map +1 -0
- package/dist/neutral/QueryableModule/asQueryableModuleObject.d.ts +4 -0
- package/dist/neutral/QueryableModule/asQueryableModuleObject.d.ts.map +1 -0
- package/dist/neutral/QueryableModule/index.d.ts +10 -0
- package/dist/neutral/QueryableModule/index.d.ts.map +1 -0
- package/dist/neutral/QueryableModule/isQueryableModule.d.ts +10 -0
- package/dist/neutral/QueryableModule/isQueryableModule.d.ts.map +1 -0
- package/dist/neutral/QueryableModule/isQueryableModuleObject.d.ts +9 -0
- package/dist/neutral/QueryableModule/isQueryableModuleObject.d.ts.map +1 -0
- package/dist/neutral/index.d.ts +1 -2
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +41 -28
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/instance/Instance.d.ts +2 -3
- package/dist/neutral/instance/Instance.d.ts.map +1 -1
- package/dist/neutral/instance/ModuleFilter.d.ts +3 -3
- package/dist/neutral/instance/ModuleFilter.d.ts.map +1 -1
- package/dist/neutral/instance/ModuleInstanceParams.d.ts +10 -0
- package/dist/neutral/instance/ModuleInstanceParams.d.ts.map +1 -0
- package/dist/neutral/instance/ModuleResolver.d.ts +1 -1
- package/dist/neutral/instance/ModuleResolver.d.ts.map +1 -1
- package/dist/neutral/instance/ObjectResolver.d.ts +0 -2
- package/dist/neutral/instance/ObjectResolver.d.ts.map +1 -1
- package/dist/neutral/instance/asModuleInstance.d.ts +1 -1
- package/dist/neutral/instance/asModuleInstance.d.ts.map +1 -1
- package/dist/neutral/instance/attachable/AttachableInstance.d.ts +2 -2
- package/dist/neutral/instance/attachable/AttachableInstance.d.ts.map +1 -1
- package/dist/neutral/instance/attachable/asAttachableInstance.d.ts +1 -1
- package/dist/neutral/instance/attachable/asAttachableInstance.d.ts.map +1 -1
- package/dist/neutral/instance/index.d.ts +1 -0
- package/dist/neutral/instance/index.d.ts.map +1 -1
- package/dist/neutral/instance/isModuleInstance.d.ts.map +1 -1
- package/dist/neutral/lib/duplicateModules.d.ts +2 -2
- package/dist/neutral/lib/duplicateModules.d.ts.map +1 -1
- package/dist/neutral/withModule.d.ts +1 -2
- package/dist/neutral/withModule.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/CreatableModule/CreatableModule.ts +2 -21
- package/src/CreatableModule/LabeledCreatableModule.ts +20 -0
- package/src/CreatableModule/index.ts +1 -0
- package/src/QueryableModule/IsQueryableModuleFactory.ts +34 -0
- package/src/QueryableModule/QueryableModule.ts +14 -0
- package/src/{module/ModuleFields.ts → QueryableModule/QueryableModuleFields.ts} +5 -2
- package/src/{module/ModuleQueryFunctions.ts → QueryableModule/QueryableModuleFunctions.ts} +4 -1
- package/src/QueryableModule/QueryableModuleParams.ts +20 -0
- package/src/QueryableModule/asQueryableModule.ts +8 -0
- package/src/QueryableModule/asQueryableModuleObject.ts +8 -0
- package/src/QueryableModule/index.ts +9 -0
- package/src/QueryableModule/isQueryableModule.ts +20 -0
- package/src/QueryableModule/isQueryableModuleObject.ts +20 -0
- package/src/index.ts +1 -2
- package/src/instance/Instance.ts +7 -5
- package/src/instance/ModuleInstanceParams.ts +11 -0
- package/src/instance/ObjectResolver.ts +0 -2
- package/src/instance/attachable/AttachableInstance.ts +2 -2
- package/src/instance/index.ts +1 -0
- package/src/instance/isModuleInstance.ts +2 -2
- package/src/lib/duplicateModules.ts +2 -2
- package/src/withModule.ts +1 -6
- package/dist/neutral/ModuleParams.d.ts +0 -21
- package/dist/neutral/ModuleParams.d.ts.map +0 -1
- package/dist/neutral/module/IsModuleFactory.d.ts +0 -7
- package/dist/neutral/module/IsModuleFactory.d.ts.map +0 -1
- package/dist/neutral/module/Module.d.ts +0 -7
- package/dist/neutral/module/Module.d.ts.map +0 -1
- package/dist/neutral/module/ModuleFields.d.ts.map +0 -1
- package/dist/neutral/module/ModuleQueryFunctions.d.ts.map +0 -1
- package/dist/neutral/module/asModule.d.ts +0 -2
- package/dist/neutral/module/asModule.d.ts.map +0 -1
- package/dist/neutral/module/asModuleObject.d.ts +0 -2
- package/dist/neutral/module/asModuleObject.d.ts.map +0 -1
- package/dist/neutral/module/index.d.ts +0 -9
- package/dist/neutral/module/index.d.ts.map +0 -1
- package/dist/neutral/module/isModule.d.ts +0 -6
- package/dist/neutral/module/isModule.d.ts.map +0 -1
- package/dist/neutral/module/isModuleObject.d.ts +0 -5
- package/dist/neutral/module/isModuleObject.d.ts.map +0 -1
- package/src/ModuleParams.ts +0 -23
- package/src/module/IsModuleFactory.ts +0 -28
- package/src/module/Module.ts +0 -9
- package/src/module/asModule.ts +0 -5
- package/src/module/asModuleObject.ts +0 -5
- package/src/module/index.ts +0 -8
- package/src/module/isModule.ts +0 -14
- package/src/module/isModuleObject.ts +0 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { QueryableModule } from '../QueryableModule/index.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Used to filter duplicates from an array of modules
|
|
4
4
|
* @example: modulesArray.filter(duplicateModules)
|
|
@@ -8,5 +8,5 @@ import type { Module } from '../module/index.ts';
|
|
|
8
8
|
* @returns True if the Module's address is the first occurrence of
|
|
9
9
|
* that address in the array, false otherwise
|
|
10
10
|
*/
|
|
11
|
-
export declare const duplicateModules: (value:
|
|
11
|
+
export declare const duplicateModules: (value: QueryableModule, index: number, array: QueryableModule[]) => value is QueryableModule;
|
|
12
12
|
//# sourceMappingURL=duplicateModules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"duplicateModules.d.ts","sourceRoot":"","sources":["../../../src/lib/duplicateModules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"duplicateModules.d.ts","sourceRoot":"","sources":["../../../src/lib/duplicateModules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAElE;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,eAAe,EAAE,OAAO,MAAM,EAAE,OAAO,eAAe,EAAE,KAAG,KAAK,IAAI,eAE3G,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { TypeCheck } from '@xylabs/sdk-js';
|
|
2
|
+
/** @deprecated use narrowing instead [ if(is) ] */
|
|
2
3
|
export declare const WithFactory: {
|
|
3
4
|
create: <T extends object>(typeCheck: TypeCheck<T>) => <R>(mod: any, closure: (mod: T) => R) => R | undefined;
|
|
4
5
|
};
|
|
5
|
-
export declare const withModule: <R>(mod: any, closure: (mod: import("./module/Module.ts").Module<import("./ModuleParams.ts").ModuleParams<import("./index.ts").AnyConfigSchema<import("./index.ts").ModuleConfig>>, import("./index.ts").ModuleEventData<object>>) => R) => R | undefined;
|
|
6
|
-
export declare const withModuleInstance: <R>(mod: any, closure: (mod: import("./instance/Instance.ts").ModuleInstance<import("./ModuleParams.ts").ModuleParams<import("./index.ts").AnyConfigSchema<import("./index.ts").ModuleConfig>>, import("./index.ts").ModuleEventData<object>>) => R) => R | undefined;
|
|
7
6
|
//# sourceMappingURL=withModule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withModule.d.ts","sourceRoot":"","sources":["../../src/withModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"withModule.d.ts","sourceRoot":"","sources":["../../src/withModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,mDAAmD;AACnD,eAAO,MAAM,WAAW;aACb,CAAC,SAAS,MAAM,aAAa,SAAS,CAAC,CAAC,CAAC,MACxC,CAAC,EAEP,KAAK,GAAG,EAER,SAAS,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,KACrB,CAAC,GAAG,SAAS;CAInB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/module-model",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.6",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"!**/*.test.*"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@xyo-network/account-model": "~5.3.
|
|
40
|
-
"@xyo-network/boundwitness-model": "~5.3.
|
|
41
|
-
"@xyo-network/manifest-model": "~5.3.
|
|
42
|
-
"@xyo-network/payload-model": "~5.3.
|
|
39
|
+
"@xyo-network/account-model": "~5.3.6",
|
|
40
|
+
"@xyo-network/boundwitness-model": "~5.3.6",
|
|
41
|
+
"@xyo-network/manifest-model": "~5.3.6",
|
|
42
|
+
"@xyo-network/payload-model": "~5.3.6"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@xylabs/sdk-js": "^5.0.79",
|
|
@@ -5,11 +5,9 @@ import type { Schema } from '@xyo-network/payload-model'
|
|
|
5
5
|
|
|
6
6
|
import type { ModuleEventData } from '../EventsModels/index.ts'
|
|
7
7
|
import type { AttachableModuleInstance } from '../instance/index.ts'
|
|
8
|
-
import type {
|
|
9
|
-
import type { ModuleParams } from '../ModuleParams.ts'
|
|
10
|
-
import type { LabeledCreatableModuleFactory } from './LabeledCreatableModuleFactory.ts'
|
|
8
|
+
import type { QueryableModuleParams } from '../QueryableModule/index.ts'
|
|
11
9
|
|
|
12
|
-
export interface CreatableModuleInstance<TParams extends
|
|
10
|
+
export interface CreatableModuleInstance<TParams extends QueryableModuleParams = QueryableModuleParams, TEventData extends ModuleEventData = ModuleEventData>
|
|
13
11
|
extends CreatableInstance<TParams, TEventData>, AttachableModuleInstance<TParams, TEventData> {}
|
|
14
12
|
|
|
15
13
|
export interface CreatableModuleFactory<T extends CreatableModuleInstance = CreatableModuleInstance>
|
|
@@ -22,10 +20,6 @@ export interface CreatableModuleFactory<T extends CreatableModuleInstance = Crea
|
|
|
22
20
|
params?: Partial<T['params']>): Promise<T>
|
|
23
21
|
}
|
|
24
22
|
|
|
25
|
-
export interface LabeledCreatableModule<T extends CreatableModuleInstance = CreatableModuleInstance> extends CreatableModule<T>, WithOptionalLabels {
|
|
26
|
-
factory(params?: Partial<T['params']>): LabeledCreatableModuleFactory<T>
|
|
27
|
-
}
|
|
28
|
-
|
|
29
23
|
export interface CreatableModule<T extends CreatableModuleInstance = CreatableModuleInstance> extends Creatable<T> {
|
|
30
24
|
configSchemas: Schema[]
|
|
31
25
|
defaultConfigSchema: Schema
|
|
@@ -46,16 +40,3 @@ export function creatableModule<TModule extends CreatableModuleInstance = Creata
|
|
|
46
40
|
constructor
|
|
47
41
|
}
|
|
48
42
|
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Class annotation to be used to decorate Modules which support
|
|
52
|
-
* an asynchronous creation pattern
|
|
53
|
-
* @returns The decorated Module requiring it implement the members
|
|
54
|
-
* of the CreatableModule as statics properties/methods
|
|
55
|
-
*/
|
|
56
|
-
export function labeledCreatableModule<TModule extends CreatableModuleInstance = CreatableModuleInstance>() {
|
|
57
|
-
return <U extends LabeledCreatableModule<TModule>>(constructor: U) => {
|
|
58
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
59
|
-
constructor
|
|
60
|
-
}
|
|
61
|
-
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { WithOptionalLabels } from '../Labels/index.ts'
|
|
2
|
+
import type { CreatableModule, CreatableModuleInstance } from './CreatableModule.ts'
|
|
3
|
+
import type { LabeledCreatableModuleFactory } from './LabeledCreatableModuleFactory.ts'
|
|
4
|
+
|
|
5
|
+
export interface LabeledCreatableModule<T extends CreatableModuleInstance = CreatableModuleInstance> extends CreatableModule<T>, WithOptionalLabels {
|
|
6
|
+
factory(params?: Partial<T['params']>): LabeledCreatableModuleFactory<T>
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Class annotation to be used to decorate Modules which support
|
|
11
|
+
* an asynchronous creation pattern
|
|
12
|
+
* @returns The decorated Module requiring it implement the members
|
|
13
|
+
* of the CreatableModule as statics properties/methods
|
|
14
|
+
*/
|
|
15
|
+
export function labeledCreatableModule<TModule extends CreatableModuleInstance = CreatableModuleInstance>() {
|
|
16
|
+
return <U extends LabeledCreatableModule<TModule>>(constructor: U) => {
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
18
|
+
constructor
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AnyNonPromise,
|
|
3
|
+
AnyObject, EmptyObject, TypeCheck,
|
|
4
|
+
TypeCheckConfig,
|
|
5
|
+
} from '@xylabs/sdk-js'
|
|
6
|
+
|
|
7
|
+
import { asQueryableModuleObject } from './asQueryableModuleObject.ts'
|
|
8
|
+
import { isQueryableModuleObject } from './isQueryableModuleObject.ts'
|
|
9
|
+
import type { QueryableModule } from './QueryableModule.ts'
|
|
10
|
+
|
|
11
|
+
export type QueryableModuleTypeCheck<T extends QueryableModule = QueryableModule> = TypeCheck<T>
|
|
12
|
+
|
|
13
|
+
/** @deprecated use QueryableModuleTypeCheck instead */
|
|
14
|
+
export type ModuleTypeCheck<T extends QueryableModule = QueryableModule> = TypeCheck<T>
|
|
15
|
+
|
|
16
|
+
export class IsQueryableModuleFactory<T extends QueryableModule = QueryableModule> {
|
|
17
|
+
create(expectedQueries?: string[], additionalChecks?: TypeCheck<AnyObject | EmptyObject>[]): QueryableModuleTypeCheck<T> {
|
|
18
|
+
const result = (obj: AnyNonPromise, config?: TypeCheckConfig | number): obj is T => {
|
|
19
|
+
const mod = asQueryableModuleObject(obj)
|
|
20
|
+
return (
|
|
21
|
+
isQueryableModuleObject(mod, config)
|
|
22
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
23
|
+
&& (expectedQueries?.reduce((prev, query) => prev && mod.queries.includes(query), true) ?? true)
|
|
24
|
+
// perform additional checks
|
|
25
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
26
|
+
&& (additionalChecks?.reduce((prev, check) => prev && check(obj, config), true) ?? true)
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
return result
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** @deprecated use IsQueryableModuleFactory instead */
|
|
34
|
+
export class IsModuleFactory<T extends QueryableModule = QueryableModule> extends IsQueryableModuleFactory<T> {}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CreatableInstance } from '@xylabs/sdk-js'
|
|
2
|
+
|
|
3
|
+
import type { ModuleEventData } from '../EventsModels/index.ts'
|
|
4
|
+
import type { QueryableModuleFields } from './QueryableModuleFields.ts'
|
|
5
|
+
import type { QueryableModuleParams } from './QueryableModuleParams.ts'
|
|
6
|
+
|
|
7
|
+
export interface QueryableModule<TParams extends QueryableModuleParams = QueryableModuleParams,
|
|
8
|
+
TEventData extends ModuleEventData<object> = ModuleEventData<object>>
|
|
9
|
+
extends QueryableModuleFields<TParams>, CreatableInstance<TParams, TEventData> {
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** @deprecated use QueryableModule instead */
|
|
13
|
+
export interface Module<TParams extends QueryableModuleParams = QueryableModuleParams, TEventData extends ModuleEventData<object> = ModuleEventData<object>>
|
|
14
|
+
extends QueryableModule<TParams, TEventData> {}
|
|
@@ -4,10 +4,10 @@ import type { Payload } from '@xyo-network/payload-model'
|
|
|
4
4
|
|
|
5
5
|
import type { ModuleConfig } from '../Config/index.ts'
|
|
6
6
|
import type { ModuleName } from '../ModuleIdentifier.ts'
|
|
7
|
-
import type { ModuleParams } from '../ModuleParams.ts'
|
|
8
7
|
import type { ModuleQueryResult } from '../ModuleQueryResult.ts'
|
|
8
|
+
import type { QueryableModuleParams } from './QueryableModuleParams.ts'
|
|
9
9
|
|
|
10
|
-
export interface
|
|
10
|
+
export interface QueryableModuleFields<TParams extends QueryableModuleParams = QueryableModuleParams> {
|
|
11
11
|
address: Address
|
|
12
12
|
config: TParams['config']
|
|
13
13
|
|
|
@@ -32,3 +32,6 @@ export interface ModuleFields<TParams extends ModuleParams = ModuleParams> {
|
|
|
32
32
|
queryConfig?: TConf,
|
|
33
33
|
) => Promisable<boolean>
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
/** @deprecated use QueryableModuleFields instead */
|
|
37
|
+
export interface ModuleFields<TParams extends QueryableModuleParams = QueryableModuleParams> extends QueryableModuleFields<TParams> {}
|
|
@@ -6,10 +6,13 @@ import type { Payload } from '@xyo-network/payload-model'
|
|
|
6
6
|
import type { ModuleQueryResult } from '../ModuleQueryResult.ts'
|
|
7
7
|
import type { AddressPayload, AddressPreviousHashPayload } from '../Payload/index.ts'
|
|
8
8
|
|
|
9
|
-
export interface
|
|
9
|
+
export interface QueryableModuleFunctions {
|
|
10
10
|
manifest: (maxDepth?: number, ignoreAddresses?: Address[]) => Promisable<ModuleManifestPayload>
|
|
11
11
|
manifestQuery: (account: AccountInstance, maxDepth?: number, ignoreAddresses?: Address[]) => Promisable<ModuleQueryResult<ModuleManifestPayload>>
|
|
12
12
|
moduleAddress: () => Promisable<(AddressPreviousHashPayload | AddressPayload)[]>
|
|
13
13
|
state: () => Promisable<Payload[]>
|
|
14
14
|
stateQuery: (account: AccountInstance) => Promisable<ModuleQueryResult>
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
/** @deprecated use QueryableModuleFunctions instead */
|
|
18
|
+
export interface ModuleQueryFunctions extends QueryableModuleFunctions {}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CreatableParams } from '@xylabs/sdk-js'
|
|
2
|
+
import type { AccountInstance } from '@xyo-network/account-model'
|
|
3
|
+
|
|
4
|
+
import type { AnyConfigSchema, ModuleConfig } from '../Config/index.ts'
|
|
5
|
+
import type { ModuleIdentifierTransformer } from '../ModuleIdentifierTransformer.ts'
|
|
6
|
+
import type { ModuleStatusReporter } from '../ModuleStatusReporter.ts'
|
|
7
|
+
|
|
8
|
+
export interface QueryableModuleParams<TConfig extends AnyConfigSchema<ModuleConfig> = AnyConfigSchema<ModuleConfig>> extends CreatableParams {
|
|
9
|
+
account?: AccountInstance | 'random'
|
|
10
|
+
addToResolvers?: boolean
|
|
11
|
+
additionalSigners?: AccountInstance[]
|
|
12
|
+
allowNameResolution?: boolean
|
|
13
|
+
config: Partial<TConfig>
|
|
14
|
+
ephemeralQueryAccountEnabled?: boolean
|
|
15
|
+
moduleIdentifierTransformers?: ModuleIdentifierTransformer[]
|
|
16
|
+
statusReporter?: ModuleStatusReporter
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** @deprecated use QueryableModuleParams instead */
|
|
20
|
+
export interface ModuleParams<TConfig extends AnyConfigSchema<ModuleConfig> = AnyConfigSchema<ModuleConfig>> extends QueryableModuleParams<TConfig> {}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AsObjectFactory } from '@xylabs/sdk-js'
|
|
2
|
+
|
|
3
|
+
import { isQueryableModule } from './isQueryableModule.ts'
|
|
4
|
+
|
|
5
|
+
export const asQueryableModule = AsObjectFactory.create(isQueryableModule)
|
|
6
|
+
|
|
7
|
+
/** @deprecated use asQueryableModule instead */
|
|
8
|
+
export const asModule = asQueryableModule
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AsObjectFactory } from '@xylabs/sdk-js'
|
|
2
|
+
|
|
3
|
+
import { isQueryableModuleObject } from './isQueryableModuleObject.ts'
|
|
4
|
+
|
|
5
|
+
export const asQueryableModuleObject = AsObjectFactory.create(isQueryableModuleObject)
|
|
6
|
+
|
|
7
|
+
/** @deprecated use asQueryableModuleObject instead */
|
|
8
|
+
export const asModuleObject = asQueryableModuleObject
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './asQueryableModule.ts'
|
|
2
|
+
export * from './asQueryableModuleObject.ts'
|
|
3
|
+
export * from './isQueryableModule.ts'
|
|
4
|
+
export * from './IsQueryableModuleFactory.ts'
|
|
5
|
+
export * from './isQueryableModuleObject.ts'
|
|
6
|
+
export * from './QueryableModule.ts'
|
|
7
|
+
export * from './QueryableModuleFields.ts'
|
|
8
|
+
export * from './QueryableModuleFunctions.ts'
|
|
9
|
+
export * from './QueryableModuleParams.ts'
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TypeCheck } from '@xylabs/sdk-js'
|
|
2
|
+
import type { Schema } from '@xyo-network/payload-model'
|
|
3
|
+
|
|
4
|
+
import { ModuleStateQuerySchema } from '../Queries/index.ts'
|
|
5
|
+
import { IsQueryableModuleFactory } from './IsQueryableModuleFactory.ts'
|
|
6
|
+
import { isQueryableModuleObject } from './isQueryableModuleObject.ts'
|
|
7
|
+
import type { QueryableModule } from './QueryableModule.ts'
|
|
8
|
+
|
|
9
|
+
export const requiredQueryableModuleQueries: Schema[] = [ModuleStateQuerySchema]
|
|
10
|
+
|
|
11
|
+
/** @deprecated use requiredQueryableModuleQueries instead */
|
|
12
|
+
export const requiredModuleQueries: Schema[] = requiredQueryableModuleQueries
|
|
13
|
+
|
|
14
|
+
// we do not use IsInstanceFactory here to prevent a cycle
|
|
15
|
+
const factory = new IsQueryableModuleFactory<QueryableModule>()
|
|
16
|
+
|
|
17
|
+
export const isQueryableModule: TypeCheck<QueryableModule> = factory.create(requiredQueryableModuleQueries, [isQueryableModuleObject])
|
|
18
|
+
|
|
19
|
+
/** @deprecated use isQueryableModule instead */
|
|
20
|
+
export const isModule: TypeCheck<QueryableModule> = isQueryableModule
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk-js'
|
|
2
|
+
import { IsObjectFactory } from '@xylabs/sdk-js'
|
|
3
|
+
|
|
4
|
+
import type { QueryableModule } from './QueryableModule.ts'
|
|
5
|
+
|
|
6
|
+
export const requiredQueryableModuleShape: ObjectTypeShape = {
|
|
7
|
+
address: 'string',
|
|
8
|
+
queries: 'array',
|
|
9
|
+
query: 'function',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** @deprecated use requiredQueryableModuleShape instead */
|
|
13
|
+
export const requiredModuleShape: ObjectTypeShape = requiredQueryableModuleShape
|
|
14
|
+
|
|
15
|
+
const factory = new IsObjectFactory<QueryableModule>()
|
|
16
|
+
|
|
17
|
+
export const isQueryableModuleObject: TypeCheck<QueryableModule> = factory.create(requiredQueryableModuleShape)
|
|
18
|
+
|
|
19
|
+
/** @deprecated use isQueryableModuleObject instead */
|
|
20
|
+
export const isModuleObject: TypeCheck<QueryableModule> = isQueryableModuleObject
|
package/src/index.ts
CHANGED
|
@@ -6,16 +6,15 @@ export * from './EventsModels/index.ts'
|
|
|
6
6
|
export * from './instance/index.ts'
|
|
7
7
|
export * from './Labels/index.ts'
|
|
8
8
|
export * from './lib/index.ts'
|
|
9
|
-
export * from './module/index.ts'
|
|
10
9
|
export * from './ModuleDescription.ts'
|
|
11
10
|
export * from './ModuleFactoryLocatorInstance.ts'
|
|
12
11
|
export * from './ModuleIdentifier.ts'
|
|
13
12
|
export * from './ModuleIdentifierTransformer.ts'
|
|
14
|
-
export * from './ModuleParams.ts'
|
|
15
13
|
export * from './ModuleQueryHandlerResult.ts'
|
|
16
14
|
export * from './ModuleQueryResult.ts'
|
|
17
15
|
export * from './ModuleStatusReporter.ts'
|
|
18
16
|
export * from './Payload/index.ts'
|
|
19
17
|
export * from './Queries/index.ts'
|
|
18
|
+
export * from './QueryableModule/index.ts'
|
|
20
19
|
export * from './ResolveHelper/index.ts'
|
|
21
20
|
export * from './withModule.ts'
|
package/src/instance/Instance.ts
CHANGED
|
@@ -6,9 +6,11 @@ import { IsObjectFactory, toSafeJsonString } from '@xylabs/sdk-js'
|
|
|
6
6
|
import type { AccountInstance } from '@xyo-network/account-model'
|
|
7
7
|
|
|
8
8
|
import type { ModuleEventData } from '../EventsModels/index.ts'
|
|
9
|
-
import type { Module, ModuleQueryFunctions } from '../module/index.ts'
|
|
10
9
|
import type { ModuleIdentifier, ModuleName } from '../ModuleIdentifier.ts'
|
|
11
|
-
import type {
|
|
10
|
+
import type {
|
|
11
|
+
QueryableModule, QueryableModuleFunctions,
|
|
12
|
+
QueryableModuleParams,
|
|
13
|
+
} from '../QueryableModule/index.ts'
|
|
12
14
|
import type { Direction } from './ObjectFilter.ts'
|
|
13
15
|
import type { ObjectResolver } from './ObjectResolver.ts'
|
|
14
16
|
|
|
@@ -50,10 +52,10 @@ export interface ModuleFamilyFunctions {
|
|
|
50
52
|
siblings: () => Promisable<ModuleInstance[]>
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
export interface ModuleInstance<TParams extends
|
|
54
|
-
extends
|
|
55
|
+
export interface ModuleInstance<TParams extends QueryableModuleParams = QueryableModuleParams, TEventData extends ModuleEventData = ModuleEventData>
|
|
56
|
+
extends QueryableModule<TParams, TEventData>,
|
|
55
57
|
ObjectResolver<ModuleInstance>,
|
|
56
|
-
|
|
58
|
+
QueryableModuleFunctions,
|
|
57
59
|
ModuleFamilyFunctions {
|
|
58
60
|
readonly pipeline?: ModulePipeLine
|
|
59
61
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AnyConfigSchema, ModuleConfig } from '../Config/index.ts'
|
|
2
|
+
import type { QueryableModuleParams } from '../QueryableModule/index.ts'
|
|
3
|
+
import type { ModuleInstance } from './Instance.ts'
|
|
4
|
+
|
|
5
|
+
export type ModuleInstanceChildrenParams = {
|
|
6
|
+
privateChildren?: ModuleInstance[]
|
|
7
|
+
publicChildren?: ModuleInstance[]
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ModuleInstanceParams<TConfig extends AnyConfigSchema<ModuleConfig> = AnyConfigSchema<ModuleConfig>> extends
|
|
11
|
+
QueryableModuleParams<TConfig>, ModuleInstanceChildrenParams {}
|
|
@@ -22,8 +22,6 @@ export type ObjectResolverPriority = typeof ObjectResolverPriority[keyof typeof
|
|
|
22
22
|
|
|
23
23
|
export interface ObjectResolver<TResult extends EmptyObject> {
|
|
24
24
|
priority: ObjectResolverPriority
|
|
25
|
-
/** @deprecated do not pass undefined. If trying to get all, pass '*' */
|
|
26
|
-
resolve<T extends TResult = TResult>(): Promisable<T | undefined>
|
|
27
25
|
resolve<T extends TResult = TResult>(all: '*', options?: ObjectFilterOptions<T>): Promisable<T[]>
|
|
28
26
|
resolve<T extends TResult = TResult>(id: ModuleIdentifier, options?: ObjectFilterOptions<T>): Promisable<T | undefined>
|
|
29
27
|
resolve<T extends TResult = TResult>(
|
|
@@ -2,11 +2,11 @@ import type { CreatableInstance, TypeCheck } from '@xylabs/sdk-js'
|
|
|
2
2
|
import { IsObjectFactory } from '@xylabs/sdk-js'
|
|
3
3
|
|
|
4
4
|
import type { ModuleEventData } from '../../EventsModels/index.ts'
|
|
5
|
-
import type {
|
|
5
|
+
import type { QueryableModuleParams } from '../../QueryableModule/index.ts'
|
|
6
6
|
import type { ModuleInstance } from '../Instance.ts'
|
|
7
7
|
import type { ModuleResolverInstance } from '../ModuleResolver.ts'
|
|
8
8
|
|
|
9
|
-
export interface AttachableModuleInstance<TParams extends
|
|
9
|
+
export interface AttachableModuleInstance<TParams extends QueryableModuleParams = QueryableModuleParams, TEventData extends ModuleEventData = ModuleEventData>
|
|
10
10
|
extends ModuleInstance<TParams, TEventData>, CreatableInstance<TParams, TEventData> {
|
|
11
11
|
config: TParams['config']
|
|
12
12
|
/* The resolver is a 'down' resolver. It can resolve the module or any children (if it is a node for example), that are in the module */
|
package/src/instance/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './attachable/index.ts'
|
|
|
3
3
|
export * from './Instance.ts'
|
|
4
4
|
export * from './isModuleInstance.ts'
|
|
5
5
|
export * from './ModuleFilter.ts'
|
|
6
|
+
export * from './ModuleInstanceParams.ts'
|
|
6
7
|
export * from './ModuleRepository.ts'
|
|
7
8
|
export * from './ModuleResolver.ts'
|
|
8
9
|
export * from './ObjectFilter.ts'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk-js'
|
|
2
2
|
import { IsObjectFactory } from '@xylabs/sdk-js'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { isQueryableModule } from '../QueryableModule/index.ts'
|
|
5
5
|
import type { ModuleInstance } from './Instance.ts'
|
|
6
6
|
|
|
7
7
|
export const requiredModuleInstanceFunctions: ObjectTypeShape = {
|
|
@@ -12,4 +12,4 @@ export const requiredModuleInstanceFunctions: ObjectTypeShape = {
|
|
|
12
12
|
// we do not use IsInstanceFactory here to prevent a cycle
|
|
13
13
|
const factory = new IsObjectFactory<ModuleInstance>()
|
|
14
14
|
|
|
15
|
-
export const isModuleInstance: TypeCheck<ModuleInstance> = factory.create(requiredModuleInstanceFunctions, [
|
|
15
|
+
export const isModuleInstance: TypeCheck<ModuleInstance> = factory.create(requiredModuleInstanceFunctions, [isQueryableModule])
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { QueryableModule } from '../QueryableModule/index.ts'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Used to filter duplicates from an array of modules
|
|
@@ -9,6 +9,6 @@ import type { Module } from '../module/index.ts'
|
|
|
9
9
|
* @returns True if the Module's address is the first occurrence of
|
|
10
10
|
* that address in the array, false otherwise
|
|
11
11
|
*/
|
|
12
|
-
export const duplicateModules = (value:
|
|
12
|
+
export const duplicateModules = (value: QueryableModule, index: number, array: QueryableModule[]): value is QueryableModule => {
|
|
13
13
|
return array.findIndex(v => v.address === value.address) === index
|
|
14
14
|
}
|
package/src/withModule.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { TypeCheck } from '@xylabs/sdk-js'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import { isModule } from './module/index.ts'
|
|
5
|
-
|
|
3
|
+
/** @deprecated use narrowing instead [ if(is) ] */
|
|
6
4
|
export const WithFactory = {
|
|
7
5
|
create: <T extends object>(typeCheck: TypeCheck<T>) => {
|
|
8
6
|
return <R>(
|
|
@@ -15,6 +13,3 @@ export const WithFactory = {
|
|
|
15
13
|
}
|
|
16
14
|
},
|
|
17
15
|
}
|
|
18
|
-
|
|
19
|
-
export const withModule = WithFactory.create(isModule)
|
|
20
|
-
export const withModuleInstance = WithFactory.create(isModuleInstance)
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { CreatableParams } from '@xylabs/sdk-js';
|
|
2
|
-
import type { AccountInstance } from '@xyo-network/account-model';
|
|
3
|
-
import type { AnyConfigSchema, ModuleConfig } from './Config/index.ts';
|
|
4
|
-
import type { ModuleInstance } from './instance/index.ts';
|
|
5
|
-
import type { ModuleIdentifierTransformer } from './ModuleIdentifierTransformer.ts';
|
|
6
|
-
import type { ModuleStatusReporter } from './ModuleStatusReporter.ts';
|
|
7
|
-
export type ModuleChildrenParams = {
|
|
8
|
-
privateChildren?: ModuleInstance[];
|
|
9
|
-
publicChildren?: ModuleInstance[];
|
|
10
|
-
};
|
|
11
|
-
export interface ModuleParams<TConfig extends AnyConfigSchema<ModuleConfig> = AnyConfigSchema<ModuleConfig>> extends CreatableParams, ModuleChildrenParams {
|
|
12
|
-
account?: AccountInstance | 'random';
|
|
13
|
-
addToResolvers?: boolean;
|
|
14
|
-
additionalSigners?: AccountInstance[];
|
|
15
|
-
allowNameResolution?: boolean;
|
|
16
|
-
config: Partial<TConfig>;
|
|
17
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
18
|
-
moduleIdentifierTransformers?: ModuleIdentifierTransformer[];
|
|
19
|
-
statusReporter?: ModuleStatusReporter;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=ModuleParams.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleParams.d.ts","sourceRoot":"","sources":["../../src/ModuleParams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AACnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAErE,MAAM,MAAM,oBAAoB,GAAG;IACjC,eAAe,CAAC,EAAE,cAAc,EAAE,CAAA;IAClC,cAAc,CAAC,EAAE,cAAc,EAAE,CAAA;CAClC,CAAA;AAED,MAAM,WAAW,YAAY,CAAC,OAAO,SAAS,eAAe,CAAC,YAAY,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,CAAE,SAAQ,eAAe,EAAE,oBAAoB;IACxJ,OAAO,CAAC,EAAE,eAAe,GAAG,QAAQ,CAAA;IACpC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,eAAe,EAAE,CAAA;IACrC,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;IACxB,4BAA4B,CAAC,EAAE,OAAO,CAAA;IACtC,4BAA4B,CAAC,EAAE,2BAA2B,EAAE,CAAA;IAC5D,cAAc,CAAC,EAAE,oBAAoB,CAAA;CACtC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { AnyObject, EmptyObject, TypeCheck } from '@xylabs/sdk-js';
|
|
2
|
-
import type { Module } from './Module.ts';
|
|
3
|
-
export type ModuleTypeCheck<T extends Module = Module> = TypeCheck<T>;
|
|
4
|
-
export declare class IsModuleFactory<T extends Module = Module> {
|
|
5
|
-
create(expectedQueries?: string[], additionalChecks?: TypeCheck<AnyObject | EmptyObject>[]): ModuleTypeCheck<T>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=IsModuleFactory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IsModuleFactory.d.ts","sourceRoot":"","sources":["../../../src/module/IsModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,SAAS,EAAE,WAAW,EAAE,SAAS,EAElC,MAAM,gBAAgB,CAAA;AAIvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,SAAS,CAAC,CAAC,CAAC,CAAA;AAErE,qBAAa,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACpD,MAAM,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,GAAG,WAAW,CAAC,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC;CAchH"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CreatableInstance } from '@xylabs/sdk-js';
|
|
2
|
-
import type { ModuleEventData } from '../EventsModels/index.ts';
|
|
3
|
-
import type { ModuleParams } from '../ModuleParams.ts';
|
|
4
|
-
import type { ModuleFields } from './ModuleFields.ts';
|
|
5
|
-
export interface Module<TParams extends ModuleParams = ModuleParams, TEventData extends ModuleEventData<object> = ModuleEventData<object>> extends ModuleFields<TParams>, CreatableInstance<TParams, TEventData> {
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=Module.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Module.d.ts","sourceRoot":"","sources":["../../../src/module/Module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,MAAM,WAAW,MAAM,CAAC,OAAO,SAAS,YAAY,GAAG,YAAY,EAAE,UAAU,SAAS,eAAe,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,CAAC,CACvI,SAAQ,YAAY,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC;CACtE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleFields.d.ts","sourceRoot":"","sources":["../../../src/module/ModuleFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAEhE,MAAM,WAAW,YAAY,CAAC,OAAO,SAAS,YAAY,GAAG,YAAY;IACvE,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;IAEzB,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAA;IAEV,OAAO,CAAC,EAAE,UAAU,CAAA;IAEpB,MAAM,EAAE,OAAO,CAAA;IAEf,YAAY,EAAE,MAAM,UAAU,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAElD,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,KAAK,EAAE,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,EAAE,KAAK,SAAS,YAAY,GAAG,YAAY,EAChG,KAAK,EAAE,CAAC,EACR,QAAQ,CAAC,EAAE,OAAO,EAAE,EACpB,WAAW,CAAC,EAAE,KAAK,KAChB,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAClC,SAAS,EAAE,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,EAAE,KAAK,SAAS,YAAY,GAAG,YAAY,EACpG,KAAK,EAAE,CAAC,EACR,QAAQ,CAAC,EAAE,OAAO,EAAE,EACpB,WAAW,CAAC,EAAE,KAAK,KAChB,UAAU,CAAC,OAAO,CAAC,CAAA;CACzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleQueryFunctions.d.ts","sourceRoot":"","sources":["../../../src/module/ModuleQueryFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAErF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,OAAO,EAAE,KAAK,UAAU,CAAC,qBAAqB,CAAC,CAAA;IAC/F,aAAa,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,OAAO,EAAE,KAAK,UAAU,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,CAAC,CAAA;IACjJ,aAAa,EAAE,MAAM,UAAU,CAAC,CAAC,0BAA0B,GAAG,cAAc,CAAC,EAAE,CAAC,CAAA;IAChF,KAAK,EAAE,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC,CAAA;IAClC,UAAU,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,UAAU,CAAC,iBAAiB,CAAC,CAAA;CACxE"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const asModule: import("@xylabs/sdk-js").AsTypeFunction<import("./Module.ts").Module<import("../ModuleParams.ts").ModuleParams<import("../index.ts").AnyConfigSchema<import("../index.ts").ModuleConfig>>, import("../index.ts").ModuleEventData<object>>>;
|
|
2
|
-
//# sourceMappingURL=asModule.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asModule.d.ts","sourceRoot":"","sources":["../../../src/module/asModule.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,4OAAmC,CAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const asModuleObject: import("@xylabs/sdk-js").AsTypeFunction<import("./Module.ts").Module<import("../ModuleParams.ts").ModuleParams<import("../index.ts").AnyConfigSchema<import("../index.ts").ModuleConfig>>, import("../index.ts").ModuleEventData<object>>>;
|
|
2
|
-
//# sourceMappingURL=asModuleObject.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asModuleObject.d.ts","sourceRoot":"","sources":["../../../src/module/asModuleObject.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,4OAAyC,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './asModule.ts';
|
|
2
|
-
export * from './asModuleObject.ts';
|
|
3
|
-
export * from './isModule.ts';
|
|
4
|
-
export * from './IsModuleFactory.ts';
|
|
5
|
-
export * from './isModuleObject.ts';
|
|
6
|
-
export * from './Module.ts';
|
|
7
|
-
export * from './ModuleFields.ts';
|
|
8
|
-
export * from './ModuleQueryFunctions.ts';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/module/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,2BAA2B,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { TypeCheck } from '@xylabs/sdk-js';
|
|
2
|
-
import type { Schema } from '@xyo-network/payload-model';
|
|
3
|
-
import type { Module } from './Module.ts';
|
|
4
|
-
export declare const requiredModuleQueries: Schema[];
|
|
5
|
-
export declare const isModule: TypeCheck<Module>;
|
|
6
|
-
//# sourceMappingURL=isModule.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isModule.d.ts","sourceRoot":"","sources":["../../../src/module/isModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAKxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,eAAO,MAAM,qBAAqB,EAAE,MAAM,EAA6B,CAAA;AAKvE,eAAO,MAAM,QAAQ,EAAE,SAAS,CAAC,MAAM,CAA2D,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk-js';
|
|
2
|
-
import type { Module } from './Module.ts';
|
|
3
|
-
export declare const requiredModuleShape: ObjectTypeShape;
|
|
4
|
-
export declare const isModuleObject: TypeCheck<Module>;
|
|
5
|
-
//# sourceMappingURL=isModuleObject.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isModuleObject.d.ts","sourceRoot":"","sources":["../../../src/module/isModuleObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAGhE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,eAAO,MAAM,mBAAmB,EAAE,eAIjC,CAAA;AAID,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,MAAM,CAAuC,CAAA"}
|
package/src/ModuleParams.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { CreatableParams } from '@xylabs/sdk-js'
|
|
2
|
-
import type { AccountInstance } from '@xyo-network/account-model'
|
|
3
|
-
|
|
4
|
-
import type { AnyConfigSchema, ModuleConfig } from './Config/index.ts'
|
|
5
|
-
import type { ModuleInstance } from './instance/index.ts'
|
|
6
|
-
import type { ModuleIdentifierTransformer } from './ModuleIdentifierTransformer.ts'
|
|
7
|
-
import type { ModuleStatusReporter } from './ModuleStatusReporter.ts'
|
|
8
|
-
|
|
9
|
-
export type ModuleChildrenParams = {
|
|
10
|
-
privateChildren?: ModuleInstance[]
|
|
11
|
-
publicChildren?: ModuleInstance[]
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface ModuleParams<TConfig extends AnyConfigSchema<ModuleConfig> = AnyConfigSchema<ModuleConfig>> extends CreatableParams, ModuleChildrenParams {
|
|
15
|
-
account?: AccountInstance | 'random'
|
|
16
|
-
addToResolvers?: boolean
|
|
17
|
-
additionalSigners?: AccountInstance[]
|
|
18
|
-
allowNameResolution?: boolean
|
|
19
|
-
config: Partial<TConfig>
|
|
20
|
-
ephemeralQueryAccountEnabled?: boolean
|
|
21
|
-
moduleIdentifierTransformers?: ModuleIdentifierTransformer[]
|
|
22
|
-
statusReporter?: ModuleStatusReporter
|
|
23
|
-
}
|