@xyo-network/location-plugin 3.6.1 → 4.1.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/{types → neutral}/Config.d.ts +2 -2
- package/dist/{types → neutral}/Config.d.ts.map +1 -1
- package/dist/neutral/Plugin.d.ts +3 -0
- package/dist/{types → neutral}/Plugin.d.ts.map +1 -1
- package/dist/neutral/index.d.ts +29 -0
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/spec/Plugin.dom.spec.d.ts +2 -0
- package/dist/neutral/spec/Plugin.dom.spec.d.ts.map +1 -0
- package/package.json +15 -15
- package/src/Config.ts +1 -1
- package/dist/types/Plugin.d.ts +0 -13
- package/dist/types/index.d.ts +0 -5
- /package/dist/{types → neutral}/CurrentLocationPayloadSet.d.ts +0 -0
- /package/dist/{types → neutral}/CurrentLocationPayloadSet.d.ts.map +0 -0
- /package/dist/{types → neutral}/CurrentLocationWitness.d.ts +0 -0
- /package/dist/{types → neutral}/CurrentLocationWitness.d.ts.map +0 -0
- /package/dist/{types → neutral}/index.d.ts.map +0 -0
|
@@ -5,7 +5,7 @@ export declare const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessC
|
|
|
5
5
|
export type CurrentLocationWitnessConfig = WitnessConfig<{
|
|
6
6
|
schema: CurrentLocationWitnessConfigSchema;
|
|
7
7
|
}>;
|
|
8
|
-
export
|
|
8
|
+
export interface CurrentLocationWitnessParams extends ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>> {
|
|
9
9
|
geolocation?: Geolocation;
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
11
|
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/D,MAAM,MAAM,kCAAkC,GAAG,qCAAqC,CAAA;AACtF,eAAO,MAAM,kCAAkC,EAAE,kCAA0E,CAAA;AAE3H,MAAM,MAAM,4BAA4B,GAAG,aAAa,CAAC;IACvD,MAAM,EAAE,kCAAkC,CAAA;CAC3C,CAAC,CAAA;AAEF,MAAM,
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/D,MAAM,MAAM,kCAAkC,GAAG,qCAAqC,CAAA;AACtF,eAAO,MAAM,kCAAkC,EAAE,kCAA0E,CAAA;AAE3H,MAAM,MAAM,4BAA4B,GAAG,aAAa,CAAC;IACvD,MAAM,EAAE,kCAAkC,CAAA;CAC3C,CAAC,CAAA;AAEF,MAAM,WAAW,4BAA6B,SAAQ,YAAY,CAAC,eAAe,CAAC,4BAA4B,CAAC,CAAC;IAAG,WAAW,CAAC,EAAE,WAAW,CAAA;CAAE"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CurrentLocationWitness } from './CurrentLocationWitness.ts';
|
|
2
|
+
export declare const LocationPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CurrentLocationWitness<import("./Config.ts").CurrentLocationWitnessParams>>;
|
|
3
|
+
//# sourceMappingURL=Plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE,eAAO,MAAM,cAAc,oJAQxB,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ModuleParams, AnyConfigSchema } from '@xyo-network/module-model';
|
|
2
|
+
import { WitnessConfig } from '@xyo-network/witness-model';
|
|
3
|
+
import { PayloadSetPayload, Schema, Payload } from '@xyo-network/payload-model';
|
|
4
|
+
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
5
|
+
import * as _xyo_network_payloadset_plugin from '@xyo-network/payloadset-plugin';
|
|
6
|
+
|
|
7
|
+
type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config';
|
|
8
|
+
declare const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema;
|
|
9
|
+
type CurrentLocationWitnessConfig = WitnessConfig<{
|
|
10
|
+
schema: CurrentLocationWitnessConfigSchema;
|
|
11
|
+
}>;
|
|
12
|
+
interface CurrentLocationWitnessParams extends ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>> {
|
|
13
|
+
geolocation?: Geolocation;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare const CurrentLocationPayloadSet: PayloadSetPayload;
|
|
17
|
+
|
|
18
|
+
declare class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {
|
|
19
|
+
static readonly configSchemas: Schema[];
|
|
20
|
+
static readonly defaultConfigSchema: Schema;
|
|
21
|
+
get geolocation(): Geolocation;
|
|
22
|
+
getCurrentPosition(): Promise<GeolocationPosition>;
|
|
23
|
+
protected observeHandler(): Promise<Payload[]>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare const LocationPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<CurrentLocationWitness<CurrentLocationWitnessParams>>;
|
|
27
|
+
|
|
28
|
+
export { CurrentLocationPayloadSet, CurrentLocationWitness, CurrentLocationWitnessConfigSchema, LocationPlugin, LocationPlugin as default };
|
|
29
|
+
export type { CurrentLocationWitnessConfig, CurrentLocationWitnessParams };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Config.ts","../../src/CurrentLocationPayloadSet.ts","../../src/CurrentLocationWitness.ts","../../src/Plugin.ts"],"sourcesContent":["import type { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport type { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\nexport const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\n\nexport type CurrentLocationWitnessConfig = WitnessConfig<{\n schema: CurrentLocationWitnessConfigSchema\n}>\n\nexport
|
|
1
|
+
{"version":3,"sources":["../../src/Config.ts","../../src/CurrentLocationPayloadSet.ts","../../src/CurrentLocationWitness.ts","../../src/Plugin.ts"],"sourcesContent":["import type { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport type { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\nexport const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'\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/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\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'\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/payloadset-plugin'\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.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iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;;;ACnDA,SAAS,kBAAAC,uBAAsB;AAC/B,SAAS,oBAAAC,yBAAwB;AACjC,SAAS,qCAAqC;AAIvC,IAAM,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;","names":["LocationHeadingSchema","LocationSchema","LocationSchema","LocationHeadingSchema","LocationSchema","PayloadSetSchema","LocationSchema","PayloadSetSchema"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plugin.dom.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Plugin.dom.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/location-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -21,29 +21,29 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
-
"types": "./dist/
|
|
24
|
+
"types": "./dist/neutral/index.d.ts",
|
|
25
25
|
"default": "./dist/neutral/index.mjs"
|
|
26
26
|
},
|
|
27
27
|
"./package.json": "./package.json"
|
|
28
28
|
},
|
|
29
29
|
"module": "dist/neutral/index.mjs",
|
|
30
|
-
"types": "dist/
|
|
30
|
+
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@xylabs/assert": "^4.
|
|
33
|
-
"@xyo-network/abstract-witness": "^
|
|
34
|
-
"@xyo-network/location-payload-plugin": "^
|
|
35
|
-
"@xyo-network/module-model": "^
|
|
36
|
-
"@xyo-network/payload-model": "^
|
|
37
|
-
"@xyo-network/payloadset-plugin": "^
|
|
38
|
-
"@xyo-network/witness-model": "^
|
|
32
|
+
"@xylabs/assert": "^4.13.15",
|
|
33
|
+
"@xyo-network/abstract-witness": "^4.1.1",
|
|
34
|
+
"@xyo-network/location-payload-plugin": "^4.1.0",
|
|
35
|
+
"@xyo-network/module-model": "^4.1.1",
|
|
36
|
+
"@xyo-network/payload-model": "^4.1.1",
|
|
37
|
+
"@xyo-network/payloadset-plugin": "^4.1.1",
|
|
38
|
+
"@xyo-network/witness-model": "^4.1.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
42
|
-
"@xylabs/tsconfig-dom": "^
|
|
43
|
-
"@xylabs/vitest-extended": "^4.
|
|
44
|
-
"knip": "^5.
|
|
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.15",
|
|
44
|
+
"knip": "^5.61.3",
|
|
45
45
|
"typescript": "^5.8.3",
|
|
46
|
-
"vitest": "^3.
|
|
46
|
+
"vitest": "^3.2.4"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
package/src/Config.ts
CHANGED
|
@@ -8,4 +8,4 @@ export type CurrentLocationWitnessConfig = WitnessConfig<{
|
|
|
8
8
|
schema: CurrentLocationWitnessConfigSchema
|
|
9
9
|
}>
|
|
10
10
|
|
|
11
|
-
export
|
|
11
|
+
export interface CurrentLocationWitnessParams extends ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>> { geolocation?: Geolocation }
|
package/dist/types/Plugin.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CurrentLocationWitness } from './CurrentLocationWitness.ts';
|
|
2
|
-
export declare const LocationPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CurrentLocationWitness<import(".store/@xylabs-base-npm-4.11.2-29ff43002f/package").BaseParamsFields & {
|
|
3
|
-
account?: import(".store/@xyo-network-account-model-npm-3.17.1-d1c40ed920/package").AccountInstance | "random";
|
|
4
|
-
addToResolvers?: boolean;
|
|
5
|
-
additionalSigners?: import(".store/@xyo-network-account-model-npm-3.17.1-d1c40ed920/package").AccountInstance[];
|
|
6
|
-
allowNameResolution?: boolean;
|
|
7
|
-
config: import("@xyo-network/module-model").AnyConfigSchema<import("./Config.ts").CurrentLocationWitnessConfig>;
|
|
8
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
9
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
10
|
-
} & import("@xyo-network/module-model").ModuleChildrenParams & {
|
|
11
|
-
geolocation?: Geolocation;
|
|
12
|
-
}>>;
|
|
13
|
-
//# sourceMappingURL=Plugin.d.ts.map
|
package/dist/types/index.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|