@xyo-network/module-instance-plugin 4.1.1 → 5.0.0
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/index.d.ts +3 -28
- package/package.json +17 -14
- package/src/spec/Plugin.dom.spec.ts +19 -0
- package/src/spec/Witness.spec.ts +29 -0
- package/typedoc.json +0 -5
- package/xy.config.ts +0 -10
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { Promisable } from '@xylabs/promise';
|
|
5
|
-
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
6
|
-
import { AbstractModuleInstancePayload } from '@xyo-network/module-instance-payload-plugin';
|
|
7
|
-
import { Schema, Payload } from '@xyo-network/payload-model';
|
|
8
|
-
import { WitnessParams, WitnessConfig } from '@xyo-network/witness-model';
|
|
9
|
-
|
|
10
|
-
type AbstractModuleInstanceWitnessConfigSchema = 'network.xyo.module.instance.config';
|
|
11
|
-
declare const AbstractModuleInstanceWitnessConfigSchema: AbstractModuleInstanceWitnessConfigSchema;
|
|
12
|
-
type AbstractModuleInstanceWitnessConfig = WitnessConfig<{
|
|
13
|
-
schema: AbstractModuleInstanceWitnessConfigSchema;
|
|
14
|
-
}>;
|
|
15
|
-
interface AbstractModuleInstanceWitnessParams extends WitnessParams<AnyConfigSchema<AbstractModuleInstanceWitnessConfig>> {
|
|
16
|
-
mod?: Module;
|
|
17
|
-
}
|
|
18
|
-
declare class AbstractModuleInstanceWitness<TParams extends AbstractModuleInstanceWitnessParams = AbstractModuleInstanceWitnessParams> extends AbstractWitness<TParams> {
|
|
19
|
-
static readonly configSchemas: Schema[];
|
|
20
|
-
static readonly defaultConfigSchema: Schema;
|
|
21
|
-
protected get mod(): Module<_xyo_network_module_model.ModuleParams<AnyConfigSchema<_xyo_network_module_model.ModuleConfig>>, _xyo_network_module_model.ModuleEventData<object>> | undefined;
|
|
22
|
-
protected observeHandler(_payloads?: Partial<Payload>[]): Promisable<AbstractModuleInstancePayload[]>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
declare const AbstractModuleInstancePlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<AbstractModuleInstanceWitness<AbstractModuleInstanceWitnessParams>>;
|
|
26
|
-
|
|
27
|
-
export { AbstractModuleInstancePlugin, AbstractModuleInstanceWitness, AbstractModuleInstanceWitnessConfigSchema, AbstractModuleInstancePlugin as default };
|
|
28
|
-
export type { AbstractModuleInstanceWitnessConfig, AbstractModuleInstanceWitnessParams };
|
|
1
|
+
export { AbstractModuleInstancePlugin, AbstractModuleInstancePlugin as default } from './Plugin.ts';
|
|
2
|
+
export * from './Witness.ts';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/module-instance-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Contains the information about a module instance",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -28,22 +28,25 @@
|
|
|
28
28
|
},
|
|
29
29
|
"module": "dist/neutral/index.mjs",
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"src"
|
|
34
|
+
],
|
|
31
35
|
"dependencies": {
|
|
32
|
-
"@xylabs/promise": "^
|
|
33
|
-
"@xyo-network/abstract-witness": "^
|
|
34
|
-
"@xyo-network/module-instance-payload-plugin": "^
|
|
35
|
-
"@xyo-network/module-model": "^
|
|
36
|
-
"@xyo-network/payload-model": "^
|
|
37
|
-
"@xyo-network/payloadset-plugin": "^
|
|
38
|
-
"@xyo-network/witness-model": "^
|
|
36
|
+
"@xylabs/promise": "^5.0.0",
|
|
37
|
+
"@xyo-network/abstract-witness": "^5.0.0",
|
|
38
|
+
"@xyo-network/module-instance-payload-plugin": "^5.0.0",
|
|
39
|
+
"@xyo-network/module-model": "^5.0.0",
|
|
40
|
+
"@xyo-network/payload-model": "^5.0.0",
|
|
41
|
+
"@xyo-network/payloadset-plugin": "^5.0.0",
|
|
42
|
+
"@xyo-network/witness-model": "^5.0.0"
|
|
39
43
|
},
|
|
40
44
|
"devDependencies": {
|
|
41
|
-
"@xylabs/ts-scripts-yarn3": "^7.0.
|
|
42
|
-
"@xylabs/tsconfig": "^7.0.
|
|
43
|
-
"@xylabs/vitest-extended": "^
|
|
44
|
-
"@xyo-network/archivist-memory": "^
|
|
45
|
-
"@xyo-network/payload-wrapper": "^
|
|
46
|
-
"knip": "^5.62.0",
|
|
45
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.2",
|
|
46
|
+
"@xylabs/tsconfig": "^7.0.2",
|
|
47
|
+
"@xylabs/vitest-extended": "^5.0.0",
|
|
48
|
+
"@xyo-network/archivist-memory": "^5.0.0",
|
|
49
|
+
"@xyo-network/payload-wrapper": "^5.0.0",
|
|
47
50
|
"typescript": "^5.8.3",
|
|
48
51
|
"vitest": "^3.2.4"
|
|
49
52
|
},
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import '@xylabs/vitest-extended'
|
|
2
|
+
|
|
3
|
+
import { PayloadSetPluginResolver } from '@xyo-network/payloadset-plugin'
|
|
4
|
+
import {
|
|
5
|
+
describe, expect,
|
|
6
|
+
test,
|
|
7
|
+
} from 'vitest'
|
|
8
|
+
|
|
9
|
+
import { AbstractModuleInstancePlugin } from '../Plugin.ts'
|
|
10
|
+
import { AbstractModuleInstanceWitnessConfigSchema } from '../Witness.ts'
|
|
11
|
+
|
|
12
|
+
describe('AbstractModuleInstancePlugin', () => {
|
|
13
|
+
test('Add to Resolver', async () => {
|
|
14
|
+
const plugin = AbstractModuleInstancePlugin()
|
|
15
|
+
const resolver = await new PayloadSetPluginResolver().register(plugin, { config: { schema: AbstractModuleInstanceWitnessConfigSchema } })
|
|
16
|
+
expect(await resolver.resolve(plugin.set)).toBeObject()
|
|
17
|
+
expect(await resolver.witness(plugin.set)).toBeObject()
|
|
18
|
+
})
|
|
19
|
+
})
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import '@xylabs/vitest-extended'
|
|
2
|
+
|
|
3
|
+
import { MemoryArchivist } from '@xyo-network/archivist-memory'
|
|
4
|
+
import { PayloadWrapper } from '@xyo-network/payload-wrapper'
|
|
5
|
+
import {
|
|
6
|
+
describe, expect,
|
|
7
|
+
test,
|
|
8
|
+
} from 'vitest'
|
|
9
|
+
|
|
10
|
+
import { AbstractModuleInstanceWitness, AbstractModuleInstanceWitnessConfigSchema } from '../Witness.ts'
|
|
11
|
+
|
|
12
|
+
describe.skip('AbstractModuleInstanceWitness', () => {
|
|
13
|
+
test('Witnessing', async () => {
|
|
14
|
+
const mod = await MemoryArchivist.create({ account: 'random' })
|
|
15
|
+
const witness = await AbstractModuleInstanceWitness.create({
|
|
16
|
+
account: 'random',
|
|
17
|
+
config: { schema: AbstractModuleInstanceWitnessConfigSchema },
|
|
18
|
+
mod,
|
|
19
|
+
})
|
|
20
|
+
const [result] = await witness.observe()
|
|
21
|
+
expect(await PayloadWrapper.wrap(result).getValid()).toBe(true)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
test('Witnessing [no config]', async () => {
|
|
25
|
+
const witness = await AbstractModuleInstanceWitness.create({ account: 'random' })
|
|
26
|
+
const [result] = await witness.observe()
|
|
27
|
+
expect(await PayloadWrapper.wrap(result).getValid()).toBe(true)
|
|
28
|
+
})
|
|
29
|
+
})
|
package/typedoc.json
DELETED