@xyo-network/bowser-system-info-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.
@@ -11,7 +11,7 @@ export declare class BowserSystemInfoWitness<TParams extends BowserSystemInfoWit
11
11
  protected get bowser(): Bowser.Parser.ParsedResult;
12
12
  protected observeHandler(payloads?: Payload[]): {
13
13
  schema: "network.xyo.system.info.bowser";
14
- $sources?: Lowercase<string>[] | undefined;
14
+ $sources?: import(".store/@xylabs-hex-npm-5.0.0-93cb11d8fe/package").Hash[] | undefined;
15
15
  bowser: Bowser.Parser.ParsedResult;
16
16
  }[];
17
17
  }
@@ -1,29 +1,4 @@
1
- import { WitnessConfig, WitnessParams, WitnessModule } from '@xyo-network/witness-model';
2
- import * as _xyo_network_payloadset_plugin from '@xyo-network/payloadset-plugin';
3
- import { AbstractWitness } from '@xyo-network/abstract-witness';
4
- import { AnyConfigSchema } from '@xyo-network/module-model';
5
- import { Schema, Payload } from '@xyo-network/payload-model';
6
- import Bowser from 'bowser';
7
-
8
- type BowserSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.bowser.config';
9
- declare const BowserSystemInfoWitnessConfigSchema: BowserSystemInfoWitnessConfigSchema;
10
- type BowserSystemInfoWitnessConfig = WitnessConfig<{
11
- schema: BowserSystemInfoWitnessConfigSchema;
12
- }>;
13
-
14
- type BowserSystemInfoWitnessParams = WitnessParams<AnyConfigSchema<BowserSystemInfoWitnessConfig>>;
15
- declare class BowserSystemInfoWitness<TParams extends BowserSystemInfoWitnessParams = BowserSystemInfoWitnessParams> extends AbstractWitness<TParams> implements WitnessModule {
16
- static readonly configSchemas: Schema[];
17
- static readonly defaultConfigSchema: Schema;
18
- protected get bowser(): Bowser.Parser.ParsedResult;
19
- protected observeHandler(payloads?: Payload[]): {
20
- schema: "network.xyo.system.info.bowser";
21
- $sources?: Lowercase<string>[] | undefined;
22
- bowser: Bowser.Parser.ParsedResult;
23
- }[];
24
- }
25
-
26
- declare const BowserSystemInfoPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<BowserSystemInfoWitness<BowserSystemInfoWitnessParams>>;
27
-
28
- export { BowserSystemInfoPlugin, BowserSystemInfoWitness, BowserSystemInfoWitnessConfigSchema, BowserSystemInfoPlugin as default };
29
- export type { BowserSystemInfoWitnessConfig, BowserSystemInfoWitnessParams };
1
+ export * from './Config.ts';
2
+ export { BowserSystemInfoPlugin, BowserSystemInfoPlugin as default } from './Plugin.ts';
3
+ export * from './Witness.ts';
4
+ //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/bowser-system-info-plugin",
3
- "version": "4.1.1",
3
+ "version": "5.0.0",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -28,23 +28,26 @@
28
28
  },
29
29
  "module": "dist/browser/index.mjs",
30
30
  "types": "dist/browser/index.d.ts",
31
+ "files": [
32
+ "dist",
33
+ "src"
34
+ ],
31
35
  "dependencies": {
32
- "@xyo-network/abstract-witness": "^4.1.7",
33
- "@xyo-network/bowser-system-info-payload-plugin": "^4.1.1",
34
- "@xyo-network/module-model": "^4.1.7",
35
- "@xyo-network/payload-model": "^4.1.7",
36
- "@xyo-network/payloadset-plugin": "^4.1.7",
37
- "@xyo-network/witness-model": "^4.1.7",
36
+ "@xyo-network/abstract-witness": "^5.0.0",
37
+ "@xyo-network/bowser-system-info-payload-plugin": "^5.0.0",
38
+ "@xyo-network/module-model": "^5.0.0",
39
+ "@xyo-network/payload-model": "^5.0.0",
40
+ "@xyo-network/payloadset-plugin": "^5.0.0",
41
+ "@xyo-network/witness-model": "^5.0.0",
38
42
  "bowser": "^2.11.0"
39
43
  },
40
44
  "devDependencies": {
41
- "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.24",
42
- "@xylabs/tsconfig-dom": "^7.0.0-rc.24",
43
- "@xylabs/vitest-extended": "^4.13.23",
44
- "@xyo-network/payload-validator": "^4.1.7",
45
- "@xyo-network/payload-wrapper": "^4.1.7",
46
- "@xyo-network/schema-name-validator": "^4.1.7",
47
- "knip": "^5.62.0",
45
+ "@xylabs/ts-scripts-yarn3": "^7.0.2",
46
+ "@xylabs/tsconfig-dom": "^7.0.2",
47
+ "@xylabs/vitest-extended": "^5.0.0",
48
+ "@xyo-network/payload-validator": "^5.0.0",
49
+ "@xyo-network/payload-wrapper": "^5.0.0",
50
+ "@xyo-network/schema-name-validator": "^5.0.0",
48
51
  "typescript": "^5.8.3",
49
52
  "vitest": "^3.2.4"
50
53
  },
@@ -0,0 +1,18 @@
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 { BowserSystemInfoPlugin } from '../Plugin.ts'
10
+
11
+ describe('BowserSystemInfoPlugin', () => {
12
+ test('Add to Resolver', async () => {
13
+ const plugin = BowserSystemInfoPlugin()
14
+ const resolver = await new PayloadSetPluginResolver().register(plugin)
15
+ expect(await resolver.resolve(plugin.set)).toBeObject()
16
+ expect(await resolver.witness(plugin.set)).toBeObject()
17
+ })
18
+ })
@@ -0,0 +1,40 @@
1
+ import '@xylabs/vitest-extended'
2
+
3
+ import { BowserSystemInfoSchema } from '@xyo-network/bowser-system-info-payload-plugin'
4
+ import { PayloadValidator } from '@xyo-network/payload-validator'
5
+ import { PayloadWrapper } from '@xyo-network/payload-wrapper'
6
+ import { SchemaNameValidator } from '@xyo-network/schema-name-validator'
7
+ import {
8
+ describe, expect,
9
+ test,
10
+ } from 'vitest'
11
+
12
+ import { BowserSystemInfoWitnessConfigSchema } from '../Config.ts'
13
+ import { BowserSystemInfoWitness } from '../Witness.ts'
14
+
15
+ PayloadValidator.setSchemaNameValidatorFactory(schema => new SchemaNameValidator(schema))
16
+
17
+ /* const cryptoPolyfill = (window: Window & typeof globalThis) => {
18
+ window.crypto = window.crypto ?? { getRandomValues: (arr: []) => Crypto.randomBytes(arr.length) }
19
+ }
20
+
21
+ cryptoPolyfill(window)
22
+ */
23
+
24
+ describe('BowserSystemInfo', () => {
25
+ test('observe', async () => {
26
+ const witness = await BowserSystemInfoWitness.create({
27
+ account: 'random',
28
+ config: { schema: BowserSystemInfoWitnessConfigSchema },
29
+ })
30
+ const [observation] = await witness.observe()
31
+ expect(observation.schema).toBe(BowserSystemInfoSchema)
32
+ expect(await PayloadWrapper.wrap(observation).getValid()).toBe(true)
33
+ })
34
+ test('observe [no config]', async () => {
35
+ const witness = await BowserSystemInfoWitness.create({ account: 'random' })
36
+ const [observation] = await witness.observe()
37
+ expect(observation.schema).toBe(BowserSystemInfoSchema)
38
+ expect(await PayloadWrapper.wrap(observation).getValid()).toBe(true)
39
+ })
40
+ })
package/typedoc.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "$schema": "https://typedoc.org/schema.json",
3
- "entryPoints": ["./src/index.ts"],
4
- "tsconfig": "./tsconfig.typedoc.json"
5
- }
package/xy.config.ts DELETED
@@ -1,11 +0,0 @@
1
- import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
- const config: XyTsupConfig = {
3
- compile: {
4
- browser: { src: true },
5
-
6
- node: {},
7
- neutral: {},
8
- },
9
- }
10
-
11
- export default config