@xyo-network/location-certainty-plugin 2.47.8 → 2.47.10
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/docs.json +744 -1044
- package/dist/types/Plugin.d.ts +1 -1
- package/dist/types/Plugin.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/Diviner/spec/Diviner.spec.ts +0 -128
- package/src/spec/Plugin.spec.ts +0 -20
package/dist/types/Plugin.d.ts
CHANGED
|
@@ -15,5 +15,5 @@ export declare const LocationCertaintyPlugin: () => PayloadSetDivinerPlugin<Loca
|
|
|
15
15
|
} & {
|
|
16
16
|
schema: "network.xyo.location.elevation.diviner.config";
|
|
17
17
|
targetSchema: "network.xyo.location.certainty";
|
|
18
|
-
}, import("@xyo-network/core").
|
|
18
|
+
}, import("@xyo-network/core").AnyObject>>;
|
|
19
19
|
//# sourceMappingURL=Plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,EAA0B,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AAEhG,OAAO,EAAE,wBAAwB,EAAkC,MAAM,WAAW,CAAA;AAEpF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,EAA0B,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AAEhG,OAAO,EAAE,wBAAwB,EAAkC,MAAM,WAAW,CAAA;AAEpF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;0CAQjC,CAAA"}
|
package/package.json
CHANGED
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xyo-network/diviner": "^2.47.
|
|
14
|
-
"@xyo-network/diviner-model": "^2.47.
|
|
15
|
-
"@xyo-network/elevation-payload-plugin": "^2.47.
|
|
16
|
-
"@xyo-network/elevation-plugin": "^2.47.
|
|
17
|
-
"@xyo-network/location-certainty-payload-plugin": "^2.47.
|
|
18
|
-
"@xyo-network/location-payload-plugin": "^2.47.
|
|
19
|
-
"@xyo-network/module": "^2.47.
|
|
20
|
-
"@xyo-network/payload-builder": "^2.47.
|
|
21
|
-
"@xyo-network/payload-model": "^2.47.
|
|
22
|
-
"@xyo-network/payloadset-plugin": "^2.47.
|
|
23
|
-
"@xyo-network/shared": "^2.47.
|
|
13
|
+
"@xyo-network/diviner": "^2.47.10",
|
|
14
|
+
"@xyo-network/diviner-model": "^2.47.10",
|
|
15
|
+
"@xyo-network/elevation-payload-plugin": "^2.47.10",
|
|
16
|
+
"@xyo-network/elevation-plugin": "^2.47.10",
|
|
17
|
+
"@xyo-network/location-certainty-payload-plugin": "^2.47.10",
|
|
18
|
+
"@xyo-network/location-payload-plugin": "^2.47.10",
|
|
19
|
+
"@xyo-network/module": "^2.47.10",
|
|
20
|
+
"@xyo-network/payload-builder": "^2.47.10",
|
|
21
|
+
"@xyo-network/payload-model": "^2.47.10",
|
|
22
|
+
"@xyo-network/payloadset-plugin": "^2.47.10",
|
|
23
|
+
"@xyo-network/shared": "^2.47.10"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@xylabs/ts-scripts-yarn3": "^2.
|
|
27
|
-
"@xylabs/tsconfig": "^2.
|
|
26
|
+
"@xylabs/ts-scripts-yarn3": "^2.15.0",
|
|
27
|
+
"@xylabs/tsconfig": "^2.15.0",
|
|
28
28
|
"typescript": "^4.9.5"
|
|
29
29
|
},
|
|
30
30
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
},
|
|
61
61
|
"sideEffects": false,
|
|
62
62
|
"types": "dist/types/index.d.ts",
|
|
63
|
-
"version": "2.47.
|
|
63
|
+
"version": "2.47.10"
|
|
64
64
|
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { AbstractArchivist, MemoryArchivist } from '@xyo-network/archivist'
|
|
2
|
-
import { LocationCertaintyPayload, LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'
|
|
3
|
-
import { LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'
|
|
4
|
-
import { CompositeModuleResolver } from '@xyo-network/module'
|
|
5
|
-
|
|
6
|
-
import { LocationCertaintyDivinerConfigSchema } from '../Config'
|
|
7
|
-
import { LocationCertaintyDiviner } from '../Diviner'
|
|
8
|
-
|
|
9
|
-
const sample1: LocationPayload[] = [
|
|
10
|
-
{
|
|
11
|
-
altitude: -5,
|
|
12
|
-
latitude: 32.71664,
|
|
13
|
-
longitude: -117.12033,
|
|
14
|
-
schema: LocationSchema,
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
altitude: -9,
|
|
18
|
-
latitude: 32.7174,
|
|
19
|
-
longitude: -117.11674,
|
|
20
|
-
schema: LocationSchema,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
altitude: -11,
|
|
24
|
-
latitude: 32.71788,
|
|
25
|
-
longitude: -117.11377,
|
|
26
|
-
schema: LocationSchema,
|
|
27
|
-
},
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
const sample2: LocationPayload[] = [
|
|
31
|
-
{
|
|
32
|
-
altitude: 50,
|
|
33
|
-
latitude: 32.71664,
|
|
34
|
-
longitude: -117.12033,
|
|
35
|
-
schema: LocationSchema,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
altitude: 53,
|
|
39
|
-
latitude: 32.7174,
|
|
40
|
-
longitude: -117.11674,
|
|
41
|
-
schema: LocationSchema,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
altitude: 55,
|
|
45
|
-
latitude: 32.71788,
|
|
46
|
-
longitude: -117.11377,
|
|
47
|
-
schema: LocationSchema,
|
|
48
|
-
},
|
|
49
|
-
]
|
|
50
|
-
|
|
51
|
-
const sample3: LocationPayload[] = [
|
|
52
|
-
{
|
|
53
|
-
altitude: 151,
|
|
54
|
-
latitude: 32.71664,
|
|
55
|
-
longitude: -117.12033,
|
|
56
|
-
schema: LocationSchema,
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
altitude: 163,
|
|
60
|
-
latitude: 32.7174,
|
|
61
|
-
longitude: -117.11674,
|
|
62
|
-
schema: LocationSchema,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
altitude: 168,
|
|
66
|
-
latitude: 32.71788,
|
|
67
|
-
longitude: -117.11377,
|
|
68
|
-
schema: LocationSchema,
|
|
69
|
-
},
|
|
70
|
-
]
|
|
71
|
-
|
|
72
|
-
describe.skip('MongoDBLocationCertaintyDiviner', () => {
|
|
73
|
-
let payloadsArchivist: AbstractArchivist
|
|
74
|
-
let sut: LocationCertaintyDiviner
|
|
75
|
-
beforeEach(async () => {
|
|
76
|
-
payloadsArchivist = await MemoryArchivist.create()
|
|
77
|
-
const params = {
|
|
78
|
-
config: {
|
|
79
|
-
schema: LocationCertaintyDivinerConfigSchema,
|
|
80
|
-
targetSchema: LocationCertaintySchema,
|
|
81
|
-
},
|
|
82
|
-
resolver: new CompositeModuleResolver().add(payloadsArchivist),
|
|
83
|
-
}
|
|
84
|
-
sut = await LocationCertaintyDiviner.create(params)
|
|
85
|
-
})
|
|
86
|
-
describe('divine', () => {
|
|
87
|
-
describe('with valid query', () => {
|
|
88
|
-
it('divines', async () => {
|
|
89
|
-
const noLocations: LocationPayload[] = []
|
|
90
|
-
const noLocationsResult = await sut.divine(noLocations)
|
|
91
|
-
expect(noLocationsResult).toBeArrayOfSize(0)
|
|
92
|
-
const locations: LocationPayload[] = [
|
|
93
|
-
{ altitude: 5, quadkey: '0203', schema: LocationSchema },
|
|
94
|
-
{ altitude: 300, quadkey: '0102', schema: LocationSchema },
|
|
95
|
-
]
|
|
96
|
-
const locationsResult = await sut.divine(locations)
|
|
97
|
-
expect(locationsResult).toBeArrayOfSize(1)
|
|
98
|
-
const actual = locationsResult[0] as LocationCertaintyPayload
|
|
99
|
-
expect(actual).toBeObject()
|
|
100
|
-
expect(actual.schema).toBe(LocationCertaintySchema)
|
|
101
|
-
|
|
102
|
-
const locationsResult1 = (await sut.divine(sample1)) as LocationCertaintyPayload[]
|
|
103
|
-
const locationsResult2 = (await sut.divine(sample2)) as LocationCertaintyPayload[]
|
|
104
|
-
const locationsResult3 = (await sut.divine(sample3)) as LocationCertaintyPayload[]
|
|
105
|
-
;[locationsResult1, locationsResult2, locationsResult3].map(validateLocationResult)
|
|
106
|
-
})
|
|
107
|
-
})
|
|
108
|
-
})
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
const validateLocationResult = (results: LocationCertaintyPayload[]) => {
|
|
112
|
-
expect(results).toBeArrayOfSize(1)
|
|
113
|
-
const [result] = results
|
|
114
|
-
expect(result).toBeObject()
|
|
115
|
-
expect(result.schema).toBe(LocationCertaintySchema)
|
|
116
|
-
expect(result.altitude).toBeObject()
|
|
117
|
-
expect(result.altitude.max).toBeNumber()
|
|
118
|
-
expect(result.altitude.mean).toBeNumber()
|
|
119
|
-
expect(result.altitude.min).toBeNumber()
|
|
120
|
-
expect(result.elevation).toBeObject()
|
|
121
|
-
expect(result.elevation.max).toBeNumber()
|
|
122
|
-
expect(result.elevation.mean).toBeNumber()
|
|
123
|
-
expect(result.elevation.min).toBeNumber()
|
|
124
|
-
expect(result.variance).toBeObject()
|
|
125
|
-
expect(result.variance.max).toBeNumber()
|
|
126
|
-
expect(result.variance.mean).toBeNumber()
|
|
127
|
-
expect(result.variance.min).toBeNumber()
|
|
128
|
-
}
|
package/src/spec/Plugin.spec.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jest-environment jsdom
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'
|
|
6
|
-
import { PayloadSetPluginResolver } from '@xyo-network/payloadset-plugin'
|
|
7
|
-
|
|
8
|
-
import { LocationCertaintyDivinerConfigSchema } from '../Diviner'
|
|
9
|
-
import { LocationCertaintyPlugin } from '../Plugin'
|
|
10
|
-
|
|
11
|
-
describe('LocationCertaintyPlugin', () => {
|
|
12
|
-
test('Add to Resolver', () => {
|
|
13
|
-
const plugin = LocationCertaintyPlugin()
|
|
14
|
-
const resolver = new PayloadSetPluginResolver().register(plugin, {
|
|
15
|
-
diviner: { config: { schema: LocationCertaintyDivinerConfigSchema, targetSchema: LocationCertaintySchema } },
|
|
16
|
-
})
|
|
17
|
-
expect(resolver.resolve(plugin.set)).toBeObject()
|
|
18
|
-
expect(resolver.diviner(LocationCertaintySchema)).toBeObject()
|
|
19
|
-
})
|
|
20
|
-
})
|