@xyo-network/location-certainty-plugin 2.47.9 → 2.48.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/docs.json +1016 -948
- package/package.json +12 -12
- package/src/Diviner/spec/Diviner.spec.ts +0 -128
- package/src/spec/Plugin.spec.ts +0 -20
package/package.json
CHANGED
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xyo-network/diviner": "^2.
|
|
14
|
-
"@xyo-network/diviner-model": "^2.
|
|
15
|
-
"@xyo-network/elevation-payload-plugin": "^2.
|
|
16
|
-
"@xyo-network/elevation-plugin": "^2.
|
|
17
|
-
"@xyo-network/location-certainty-payload-plugin": "^2.
|
|
18
|
-
"@xyo-network/location-payload-plugin": "^2.
|
|
19
|
-
"@xyo-network/module": "^2.
|
|
20
|
-
"@xyo-network/payload-builder": "^2.
|
|
21
|
-
"@xyo-network/payload-model": "^2.
|
|
22
|
-
"@xyo-network/payloadset-plugin": "^2.
|
|
23
|
-
"@xyo-network/shared": "^2.
|
|
13
|
+
"@xyo-network/diviner": "^2.48.0",
|
|
14
|
+
"@xyo-network/diviner-model": "^2.48.0",
|
|
15
|
+
"@xyo-network/elevation-payload-plugin": "^2.48.0",
|
|
16
|
+
"@xyo-network/elevation-plugin": "^2.48.0",
|
|
17
|
+
"@xyo-network/location-certainty-payload-plugin": "^2.48.0",
|
|
18
|
+
"@xyo-network/location-payload-plugin": "^2.48.0",
|
|
19
|
+
"@xyo-network/module": "^2.48.0",
|
|
20
|
+
"@xyo-network/payload-builder": "^2.48.0",
|
|
21
|
+
"@xyo-network/payload-model": "^2.48.0",
|
|
22
|
+
"@xyo-network/payloadset-plugin": "^2.48.0",
|
|
23
|
+
"@xyo-network/shared": "^2.48.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@xylabs/ts-scripts-yarn3": "^2.15.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
},
|
|
61
61
|
"sideEffects": false,
|
|
62
62
|
"types": "dist/types/index.d.ts",
|
|
63
|
-
"version": "2.
|
|
63
|
+
"version": "2.48.0"
|
|
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
|
-
})
|