@xyo-network/location-plugin 5.5.2 → 6.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.mjs +1 -1
- package/dist/neutral/index.mjs.map +7 -1
- package/package.json +63 -63
package/dist/neutral/index.mjs
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Config.ts", "../../src/CurrentLocationPayloadSet.ts", "../../src/CurrentLocationWitness.ts", "../../src/Plugin.ts"],
|
|
4
|
+
"sourcesContent": ["import type { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { asSchema } from '@xyo-network/payload-model'\nimport type { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = typeof CurrentLocationWitnessConfigSchema\nexport const CurrentLocationWitnessConfigSchema = asSchema('network.xyo.location.current.config', true)\n\nexport type CurrentLocationWitnessConfig = WitnessConfig<{\n schema: CurrentLocationWitnessConfigSchema\n}>\n\nexport interface CurrentLocationWitnessParams extends ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>> { geolocation?: Geolocation }\n", "import { LocationHeadingSchema, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport type { PayloadSetPayload } from '@xyo-network/payload-model'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\n\nexport const CurrentLocationPayloadSet: PayloadSetPayload = {\n optional: { [LocationHeadingSchema]: 1 },\n required: { [LocationSchema]: 1 },\n schema: PayloadSetSchema,\n}\n", "import { assertEx } from '@xylabs/sdk-js'\nimport type { LocationHeadingPayload, LocationPayload } from '@xyo-network/location-payload-plugin'\nimport { LocationHeadingSchema, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport { AbstractWitness } from '@xyo-network/witness-abstract'\n\nimport type { CurrentLocationWitnessParams } from './Config.ts'\nimport { CurrentLocationWitnessConfigSchema } from './Config.ts'\n\nexport class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, CurrentLocationWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = CurrentLocationWitnessConfigSchema\n\n get geolocation(): Geolocation {\n return assertEx(this.params.geolocation, () => 'No geolocation provided')\n }\n\n getCurrentPosition() {\n return new Promise<GeolocationPosition>((resolve, reject) => {\n this.geolocation?.getCurrentPosition(\n (position: GeolocationPosition) => {\n resolve(position)\n },\n (error: GeolocationPositionError) => {\n reject(error)\n },\n )\n })\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n const location = await this.getCurrentPosition()\n const locationPayload: LocationPayload = {\n altitude: location.coords.altitude ?? undefined,\n altitudeAccuracy: location.coords.altitudeAccuracy ?? undefined,\n latitude: location.coords.latitude,\n longitude: location.coords.longitude,\n schema: LocationSchema,\n }\n const heading: LocationHeadingPayload[]\n = location.coords.heading\n ? [\n {\n heading: location.coords.heading ?? undefined,\n schema: LocationHeadingSchema,\n speed: location.coords.speed ?? undefined,\n },\n ]\n : []\n return [locationPayload, ...heading]\n }\n}\n", "import { LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/sdk-js'\n\nimport { CurrentLocationWitness } from './CurrentLocationWitness.ts'\n\nexport const LocationPlugin = () =>\n createPayloadSetWitnessPlugin<CurrentLocationWitness>(\n { required: { [LocationSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return await CurrentLocationWitness.create(params)\n },\n },\n )\n"],
|
|
5
|
+
"mappings": ";AACA,SAAS,gBAAgB;AAIlB,IAAM,qCAAqC,SAAS,uCAAuC,IAAI;;;ACLtG,SAAS,uBAAuB,sBAAsB;AAEtD,SAAS,wBAAwB;AAE1B,IAAM,4BAA+C;AAAA,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AAM,iBAAiB,MAC5B;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,eAAc,GAAG,EAAE,GAAG,QAAQC,kBAAiB;AAAA,EAC9D;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAO,MAAM,uBAAuB,OAAO,MAAM;AAAA,IACnD;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["LocationHeadingSchema", "LocationSchema", "LocationSchema", "LocationHeadingSchema", "LocationSchema", "PayloadSetSchema", "LocationSchema", "PayloadSetSchema"]
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/location-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"README.md"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@xyo-network/location-payload-plugin": "~
|
|
34
|
+
"@xyo-network/location-payload-plugin": "~6.0.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@bitauth/libauth": "~3.0.0",
|
|
@@ -40,53 +40,53 @@
|
|
|
40
40
|
"@opentelemetry/sdk-trace-base": "^2.7.1",
|
|
41
41
|
"@scure/base": "^2.2.0",
|
|
42
42
|
"@scure/bip39": "~2.2.0",
|
|
43
|
-
"@xylabs/geo": "
|
|
44
|
-
"@xylabs/sdk-js": "
|
|
45
|
-
"@xylabs/threads": "
|
|
46
|
-
"@xylabs/toolchain": "~
|
|
47
|
-
"@xylabs/tsconfig": "~
|
|
48
|
-
"@xylabs/tsconfig-dom": "~
|
|
49
|
-
"@xylabs/vitest-extended": "~
|
|
50
|
-
"@xyo-network/account": "~
|
|
51
|
-
"@xyo-network/account-model": "
|
|
52
|
-
"@xyo-network/api": "~
|
|
53
|
-
"@xyo-network/api-models": "~
|
|
54
|
-
"@xyo-network/boundwitness-builder": "~
|
|
55
|
-
"@xyo-network/boundwitness-model": "
|
|
56
|
-
"@xyo-network/boundwitness-wrapper": "~
|
|
57
|
-
"@xyo-network/config-payload-plugin": "~
|
|
58
|
-
"@xyo-network/huri": "~
|
|
59
|
-
"@xyo-network/manifest-model": "~
|
|
60
|
-
"@xyo-network/module-model": "
|
|
61
|
-
"@xyo-network/payload-builder": "~
|
|
62
|
-
"@xyo-network/payload-model": "
|
|
63
|
-
"@xyo-network/payload-plugin": "~
|
|
64
|
-
"@xyo-network/payload-wrapper": "~
|
|
65
|
-
"@xyo-network/query-payload-plugin": "~
|
|
66
|
-
"@xyo-network/sdk-js": "
|
|
67
|
-
"@xyo-network/sdk-protocol-js": "~
|
|
68
|
-
"@xyo-network/wallet": "~
|
|
69
|
-
"@xyo-network/wallet-model": "~
|
|
70
|
-
"@xyo-network/witness-abstract": "
|
|
71
|
-
"@xyo-network/witness-model": "
|
|
43
|
+
"@xylabs/geo": "~6.0",
|
|
44
|
+
"@xylabs/sdk-js": "~6.0",
|
|
45
|
+
"@xylabs/threads": "~6.0",
|
|
46
|
+
"@xylabs/toolchain": "~8.1.1",
|
|
47
|
+
"@xylabs/tsconfig": "~8.1.1",
|
|
48
|
+
"@xylabs/tsconfig-dom": "~8.1.1",
|
|
49
|
+
"@xylabs/vitest-extended": "~6.0.2",
|
|
50
|
+
"@xyo-network/account": "~6.0",
|
|
51
|
+
"@xyo-network/account-model": "~6.0",
|
|
52
|
+
"@xyo-network/api": "~6.0",
|
|
53
|
+
"@xyo-network/api-models": "~6.0",
|
|
54
|
+
"@xyo-network/boundwitness-builder": "~6.0",
|
|
55
|
+
"@xyo-network/boundwitness-model": "~6.0",
|
|
56
|
+
"@xyo-network/boundwitness-wrapper": "~6.0",
|
|
57
|
+
"@xyo-network/config-payload-plugin": "~6.0",
|
|
58
|
+
"@xyo-network/huri": "~6.0",
|
|
59
|
+
"@xyo-network/manifest-model": "~6.0",
|
|
60
|
+
"@xyo-network/module-model": "~6.0",
|
|
61
|
+
"@xyo-network/payload-builder": "~6.0",
|
|
62
|
+
"@xyo-network/payload-model": "~6.0",
|
|
63
|
+
"@xyo-network/payload-plugin": "~6.0",
|
|
64
|
+
"@xyo-network/payload-wrapper": "~6.0",
|
|
65
|
+
"@xyo-network/query-payload-plugin": "~6.0",
|
|
66
|
+
"@xyo-network/sdk-js": "~6.0",
|
|
67
|
+
"@xyo-network/sdk-protocol-js": "~6.0",
|
|
68
|
+
"@xyo-network/wallet": "~6.0",
|
|
69
|
+
"@xyo-network/wallet-model": "~6.0",
|
|
70
|
+
"@xyo-network/witness-abstract": "~6.0",
|
|
71
|
+
"@xyo-network/witness-model": "~6.0",
|
|
72
72
|
"ajv": "^8.20.0",
|
|
73
73
|
"async-mutex": "^0.5.0",
|
|
74
74
|
"bn.js": "^5.2.3",
|
|
75
75
|
"buffer": "^6.0.3",
|
|
76
76
|
"chalk": "^5.6.2",
|
|
77
77
|
"debug": "~4.4.3",
|
|
78
|
-
"eslint": "^10.
|
|
78
|
+
"eslint": "^10.4.0",
|
|
79
79
|
"ethers": "^6.16.0",
|
|
80
80
|
"hash-wasm": "^4.12.0",
|
|
81
81
|
"idb": "^8.0.3",
|
|
82
|
-
"lru-cache": "^11.
|
|
83
|
-
"mapbox-gl": "~3.
|
|
82
|
+
"lru-cache": "^11.5.0",
|
|
83
|
+
"mapbox-gl": "~3.24",
|
|
84
84
|
"observable-fns": "~0.6.1",
|
|
85
85
|
"pako": "~2.1.0",
|
|
86
86
|
"store2": "~2.14.4",
|
|
87
|
-
"typescript": "~
|
|
88
|
-
"vite": "^8.0.
|
|
89
|
-
"vitest": "^4.1.
|
|
87
|
+
"typescript": "~6.0.3",
|
|
88
|
+
"vite": "^8.0.13",
|
|
89
|
+
"vitest": "^4.1.7",
|
|
90
90
|
"wasm-feature-detect": "~1.8.0",
|
|
91
91
|
"webextension-polyfill": "^0.12.0",
|
|
92
92
|
"zod": "^4.4.3"
|
|
@@ -98,31 +98,31 @@
|
|
|
98
98
|
"@opentelemetry/sdk-trace-base": "^2.7",
|
|
99
99
|
"@scure/base": "^2.2",
|
|
100
100
|
"@scure/bip39": "~2.2",
|
|
101
|
-
"@xylabs/geo": "^
|
|
102
|
-
"@xylabs/sdk-js": "^
|
|
103
|
-
"@xylabs/threads": "^
|
|
104
|
-
"@xyo-network/account": "~
|
|
105
|
-
"@xyo-network/account-model": "^
|
|
106
|
-
"@xyo-network/api": "~
|
|
107
|
-
"@xyo-network/api-models": "~
|
|
108
|
-
"@xyo-network/boundwitness-builder": "~
|
|
109
|
-
"@xyo-network/boundwitness-model": "^
|
|
110
|
-
"@xyo-network/boundwitness-wrapper": "~
|
|
111
|
-
"@xyo-network/config-payload-plugin": "~
|
|
112
|
-
"@xyo-network/huri": "~
|
|
113
|
-
"@xyo-network/manifest-model": "~
|
|
114
|
-
"@xyo-network/module-model": "^
|
|
115
|
-
"@xyo-network/payload-builder": "~
|
|
116
|
-
"@xyo-network/payload-model": "^
|
|
117
|
-
"@xyo-network/payload-plugin": "~
|
|
118
|
-
"@xyo-network/payload-wrapper": "~
|
|
119
|
-
"@xyo-network/query-payload-plugin": "~
|
|
120
|
-
"@xyo-network/sdk-js": "^
|
|
121
|
-
"@xyo-network/sdk-protocol-js": "~
|
|
122
|
-
"@xyo-network/wallet": "~
|
|
123
|
-
"@xyo-network/wallet-model": "~
|
|
124
|
-
"@xyo-network/witness-abstract": "^
|
|
125
|
-
"@xyo-network/witness-model": "^
|
|
101
|
+
"@xylabs/geo": "^6.0",
|
|
102
|
+
"@xylabs/sdk-js": "^6.0",
|
|
103
|
+
"@xylabs/threads": "^6.0",
|
|
104
|
+
"@xyo-network/account": "~6.0",
|
|
105
|
+
"@xyo-network/account-model": "^6.0",
|
|
106
|
+
"@xyo-network/api": "~6.0",
|
|
107
|
+
"@xyo-network/api-models": "~6.0",
|
|
108
|
+
"@xyo-network/boundwitness-builder": "~6.0",
|
|
109
|
+
"@xyo-network/boundwitness-model": "^6.0",
|
|
110
|
+
"@xyo-network/boundwitness-wrapper": "~6.0",
|
|
111
|
+
"@xyo-network/config-payload-plugin": "~6.0",
|
|
112
|
+
"@xyo-network/huri": "~6.0",
|
|
113
|
+
"@xyo-network/manifest-model": "~6.0",
|
|
114
|
+
"@xyo-network/module-model": "^6.0",
|
|
115
|
+
"@xyo-network/payload-builder": "~6.0",
|
|
116
|
+
"@xyo-network/payload-model": "^6.0",
|
|
117
|
+
"@xyo-network/payload-plugin": "~6.0",
|
|
118
|
+
"@xyo-network/payload-wrapper": "~6.0",
|
|
119
|
+
"@xyo-network/query-payload-plugin": "~6.0",
|
|
120
|
+
"@xyo-network/sdk-js": "^6.0",
|
|
121
|
+
"@xyo-network/sdk-protocol-js": "~6.0",
|
|
122
|
+
"@xyo-network/wallet": "~6.0",
|
|
123
|
+
"@xyo-network/wallet-model": "~6.0",
|
|
124
|
+
"@xyo-network/witness-abstract": "^6.0",
|
|
125
|
+
"@xyo-network/witness-model": "^6.0",
|
|
126
126
|
"ajv": "^8.20",
|
|
127
127
|
"async-mutex": "^0.5",
|
|
128
128
|
"bn.js": "^5.2",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"hash-wasm": "^4.12",
|
|
134
134
|
"idb": "^8.0",
|
|
135
135
|
"lru-cache": "^11.3",
|
|
136
|
-
"mapbox-gl": "~3.
|
|
136
|
+
"mapbox-gl": "~3.24",
|
|
137
137
|
"observable-fns": "~0.6",
|
|
138
138
|
"pako": "~2.1",
|
|
139
139
|
"store2": "~2.14",
|