@xyo-network/location-plugin 2.99.6 → 3.0.1
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.d.ts +50 -5
- package/package.json +15 -34
- package/src/index.ts +1 -1
- package/xy.config.ts +4 -5
- package/dist/browser/Config.d.cts +0 -11
- package/dist/browser/Config.d.cts.map +0 -1
- package/dist/browser/Config.d.mts +0 -11
- package/dist/browser/Config.d.mts.map +0 -1
- package/dist/browser/Config.d.ts +0 -11
- package/dist/browser/Config.d.ts.map +0 -1
- package/dist/browser/CurrentLocationPayloadSet.d.cts +0 -3
- package/dist/browser/CurrentLocationPayloadSet.d.cts.map +0 -1
- package/dist/browser/CurrentLocationPayloadSet.d.mts +0 -3
- package/dist/browser/CurrentLocationPayloadSet.d.mts.map +0 -1
- package/dist/browser/CurrentLocationPayloadSet.d.ts +0 -3
- package/dist/browser/CurrentLocationPayloadSet.d.ts.map +0 -1
- package/dist/browser/CurrentLocationWitness.d.cts +0 -11
- package/dist/browser/CurrentLocationWitness.d.cts.map +0 -1
- package/dist/browser/CurrentLocationWitness.d.mts +0 -11
- package/dist/browser/CurrentLocationWitness.d.mts.map +0 -1
- package/dist/browser/CurrentLocationWitness.d.ts +0 -11
- package/dist/browser/CurrentLocationWitness.d.ts.map +0 -1
- package/dist/browser/Plugin.d.cts +0 -21
- package/dist/browser/Plugin.d.cts.map +0 -1
- package/dist/browser/Plugin.d.mts +0 -21
- package/dist/browser/Plugin.d.mts.map +0 -1
- package/dist/browser/Plugin.d.ts +0 -21
- package/dist/browser/Plugin.d.ts.map +0 -1
- package/dist/browser/index.cjs +0 -101
- package/dist/browser/index.cjs.map +0 -1
- package/dist/browser/index.d.cts +0 -5
- package/dist/browser/index.d.cts.map +0 -1
- package/dist/browser/index.d.mts +0 -5
- package/dist/browser/index.d.mts.map +0 -1
- package/dist/browser/index.d.ts +0 -5
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.mjs +0 -78
- package/dist/browser/index.mjs.map +0 -1
- package/dist/neutral/Config.d.cts +0 -11
- package/dist/neutral/Config.d.cts.map +0 -1
- package/dist/neutral/Config.d.mts +0 -11
- package/dist/neutral/Config.d.mts.map +0 -1
- package/dist/neutral/Config.d.ts +0 -11
- package/dist/neutral/Config.d.ts.map +0 -1
- package/dist/neutral/CurrentLocationPayloadSet.d.cts +0 -3
- package/dist/neutral/CurrentLocationPayloadSet.d.cts.map +0 -1
- package/dist/neutral/CurrentLocationPayloadSet.d.mts +0 -3
- package/dist/neutral/CurrentLocationPayloadSet.d.mts.map +0 -1
- package/dist/neutral/CurrentLocationPayloadSet.d.ts +0 -3
- package/dist/neutral/CurrentLocationPayloadSet.d.ts.map +0 -1
- package/dist/neutral/CurrentLocationWitness.d.cts +0 -11
- package/dist/neutral/CurrentLocationWitness.d.cts.map +0 -1
- package/dist/neutral/CurrentLocationWitness.d.mts +0 -11
- package/dist/neutral/CurrentLocationWitness.d.mts.map +0 -1
- package/dist/neutral/CurrentLocationWitness.d.ts +0 -11
- package/dist/neutral/CurrentLocationWitness.d.ts.map +0 -1
- package/dist/neutral/Plugin.d.cts +0 -21
- package/dist/neutral/Plugin.d.cts.map +0 -1
- package/dist/neutral/Plugin.d.mts +0 -21
- package/dist/neutral/Plugin.d.mts.map +0 -1
- package/dist/neutral/Plugin.d.ts +0 -21
- package/dist/neutral/Plugin.d.ts.map +0 -1
- package/dist/neutral/index.cjs +0 -101
- package/dist/neutral/index.cjs.map +0 -1
- package/dist/neutral/index.d.cts +0 -5
- package/dist/neutral/index.d.cts.map +0 -1
- package/dist/neutral/index.d.mts +0 -5
- package/dist/neutral/index.d.mts.map +0 -1
- package/dist/neutral/index.d.ts.map +0 -1
- package/dist/node/Config.d.cts +0 -11
- package/dist/node/Config.d.cts.map +0 -1
- package/dist/node/Config.d.mts +0 -11
- package/dist/node/Config.d.mts.map +0 -1
- package/dist/node/Config.d.ts +0 -11
- package/dist/node/Config.d.ts.map +0 -1
- package/dist/node/CurrentLocationPayloadSet.d.cts +0 -3
- package/dist/node/CurrentLocationPayloadSet.d.cts.map +0 -1
- package/dist/node/CurrentLocationPayloadSet.d.mts +0 -3
- package/dist/node/CurrentLocationPayloadSet.d.mts.map +0 -1
- package/dist/node/CurrentLocationPayloadSet.d.ts +0 -3
- package/dist/node/CurrentLocationPayloadSet.d.ts.map +0 -1
- package/dist/node/CurrentLocationWitness.d.cts +0 -11
- package/dist/node/CurrentLocationWitness.d.cts.map +0 -1
- package/dist/node/CurrentLocationWitness.d.mts +0 -11
- package/dist/node/CurrentLocationWitness.d.mts.map +0 -1
- package/dist/node/CurrentLocationWitness.d.ts +0 -11
- package/dist/node/CurrentLocationWitness.d.ts.map +0 -1
- package/dist/node/Plugin.d.cts +0 -21
- package/dist/node/Plugin.d.cts.map +0 -1
- package/dist/node/Plugin.d.mts +0 -21
- package/dist/node/Plugin.d.mts.map +0 -1
- package/dist/node/Plugin.d.ts +0 -21
- package/dist/node/Plugin.d.ts.map +0 -1
- package/dist/node/index.cjs +0 -109
- package/dist/node/index.cjs.map +0 -1
- package/dist/node/index.d.cts +0 -5
- package/dist/node/index.d.cts.map +0 -1
- package/dist/node/index.d.mts +0 -5
- package/dist/node/index.d.mts.map +0 -1
- package/dist/node/index.d.ts +0 -5
- package/dist/node/index.d.ts.map +0 -1
- package/dist/node/index.mjs +0 -79
- package/dist/node/index.mjs.map +0 -1
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as _xyo_network_module_model from '@xyo-network/module-model';
|
|
2
|
+
import { ModuleParams, AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
+
import { WitnessConfig } from '@xyo-network/witness-model';
|
|
4
|
+
import * as _xyo_network_payload_model from '@xyo-network/payload-model';
|
|
5
|
+
import { PayloadSetPayload, Schema, Payload } from '@xyo-network/payload-model';
|
|
6
|
+
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
7
|
+
import * as _xyo_network_payloadset_plugin from '@xyo-network/payloadset-plugin';
|
|
8
|
+
import * as _store__xyo_network_account_model_virtual_96c2d52d44_package from '.store/@xyo-network-account-model-virtual-96c2d52d44/package';
|
|
9
|
+
import * as _store__xylabs_object_npm_4_0_1_bb8d73c5f0_package from '.store/@xylabs-object-npm-4.0.1-bb8d73c5f0/package';
|
|
10
|
+
|
|
11
|
+
type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config';
|
|
12
|
+
declare const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema;
|
|
13
|
+
type CurrentLocationWitnessConfig = WitnessConfig<{
|
|
14
|
+
schema: CurrentLocationWitnessConfigSchema;
|
|
15
|
+
}>;
|
|
16
|
+
type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, {
|
|
17
|
+
geolocation?: Geolocation;
|
|
18
|
+
}>;
|
|
19
|
+
|
|
20
|
+
declare const CurrentLocationPayloadSet: PayloadSetPayload;
|
|
21
|
+
|
|
22
|
+
declare class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {
|
|
23
|
+
static readonly configSchemas: Schema[];
|
|
24
|
+
static readonly defaultConfigSchema: Schema;
|
|
25
|
+
get geolocation(): Geolocation;
|
|
26
|
+
getCurrentPosition(): Promise<GeolocationPosition>;
|
|
27
|
+
protected observeHandler(): Promise<Payload[]>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare const LocationPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<CurrentLocationWitness<_store__xylabs_object_npm_4_0_1_bb8d73c5f0_package.BaseParamsFields & {
|
|
31
|
+
account?: _store__xyo_network_account_model_virtual_96c2d52d44_package.AccountInstance | "random";
|
|
32
|
+
addToResolvers?: boolean;
|
|
33
|
+
additionalSigners?: _store__xyo_network_account_model_virtual_96c2d52d44_package.AccountInstance[];
|
|
34
|
+
allowNameResolution?: boolean;
|
|
35
|
+
config: _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & Omit<_xyo_network_module_model.ArchivingModuleConfig & _xyo_network_module_model.ModuleConfigFields & _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & Omit<_xyo_network_module_model.ArchivingModuleConfig & _xyo_network_module_model.ModuleConfigFields & {
|
|
36
|
+
schema: "network.xyo.location.current.config";
|
|
37
|
+
} & {
|
|
38
|
+
schema: CurrentLocationWitnessConfigSchema;
|
|
39
|
+
}, "schema"> & {
|
|
40
|
+
schema: "network.xyo.location.current.config";
|
|
41
|
+
}, "schema"> & {
|
|
42
|
+
schema: string;
|
|
43
|
+
};
|
|
44
|
+
ephemeralQueryAccountEnabled?: boolean;
|
|
45
|
+
moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
|
|
46
|
+
} & {
|
|
47
|
+
geolocation?: Geolocation;
|
|
48
|
+
}>>;
|
|
49
|
+
|
|
50
|
+
export { CurrentLocationPayloadSet, CurrentLocationWitness, type CurrentLocationWitnessConfig, CurrentLocationWitnessConfigSchema, type CurrentLocationWitnessParams, LocationPlugin, LocationPlugin as default };
|
package/package.json
CHANGED
|
@@ -10,49 +10,30 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/plugins/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/assert": "^
|
|
14
|
-
"@xyo-network/abstract-witness": "^
|
|
15
|
-
"@xyo-network/location-payload-plugin": "^
|
|
16
|
-
"@xyo-network/module-model": "^
|
|
17
|
-
"@xyo-network/payload-model": "^
|
|
18
|
-
"@xyo-network/payloadset-plugin": "^
|
|
19
|
-
"@xyo-network/witness-model": "^
|
|
13
|
+
"@xylabs/assert": "^4.0.1",
|
|
14
|
+
"@xyo-network/abstract-witness": "^3.0.2",
|
|
15
|
+
"@xyo-network/location-payload-plugin": "^3.0.1",
|
|
16
|
+
"@xyo-network/module-model": "^3.0.2",
|
|
17
|
+
"@xyo-network/payload-model": "^3.0.2",
|
|
18
|
+
"@xyo-network/payloadset-plugin": "^3.0.2",
|
|
19
|
+
"@xyo-network/witness-model": "^3.0.2"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
23
|
-
"@xylabs/tsconfig-dom": "^
|
|
24
|
-
"@xylabs/tsconfig-dom-jest": "^
|
|
22
|
+
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.15",
|
|
23
|
+
"@xylabs/tsconfig-dom": "^4.0.0-rc.15",
|
|
24
|
+
"@xylabs/tsconfig-dom-jest": "^4.0.0-rc.15",
|
|
25
25
|
"typescript": "^5.5.4"
|
|
26
26
|
},
|
|
27
27
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
28
|
-
"types": "dist/
|
|
28
|
+
"types": "dist/neutral/index.d.ts",
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
"types": "./dist/browser/index.d.cts",
|
|
34
|
-
"default": "./dist/browser/index.cjs"
|
|
35
|
-
},
|
|
36
|
-
"import": {
|
|
37
|
-
"types": "./dist/browser/index.d.mts",
|
|
38
|
-
"default": "./dist/browser/index.mjs"
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
"node": {
|
|
42
|
-
"require": {
|
|
43
|
-
"types": "./dist/node/index.d.cts",
|
|
44
|
-
"default": "./dist/node/index.cjs"
|
|
45
|
-
},
|
|
46
|
-
"import": {
|
|
47
|
-
"types": "./dist/node/index.d.mts",
|
|
48
|
-
"default": "./dist/node/index.mjs"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
31
|
+
"types": "./dist/neutral/index.d.ts",
|
|
32
|
+
"default": "./dist/neutral/index.mjs"
|
|
51
33
|
},
|
|
52
34
|
"./package.json": "./package.json"
|
|
53
35
|
},
|
|
54
|
-
"
|
|
55
|
-
"module": "dist/node/index.mjs",
|
|
36
|
+
"module": "dist/neutral/index.mjs",
|
|
56
37
|
"homepage": "https://xyo.network",
|
|
57
38
|
"license": "LGPL-3.0-only",
|
|
58
39
|
"publishConfig": {
|
|
@@ -63,6 +44,6 @@
|
|
|
63
44
|
"url": "https://github.com/XYOracleNetwork/plugins.git"
|
|
64
45
|
},
|
|
65
46
|
"sideEffects": false,
|
|
66
|
-
"version": "
|
|
47
|
+
"version": "3.0.1",
|
|
67
48
|
"type": "module"
|
|
68
49
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './Config.ts'
|
|
2
2
|
export * from './CurrentLocationPayloadSet.ts'
|
|
3
3
|
export * from './CurrentLocationWitness.ts'
|
|
4
|
-
// eslint-disable-next-line import/no-default-export
|
|
4
|
+
// eslint-disable-next-line import-x/no-default-export
|
|
5
5
|
export { LocationPlugin as default, LocationPlugin } from './Plugin.ts'
|
package/xy.config.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
|
|
2
2
|
const config: XyTsupConfig = {
|
|
3
3
|
compile: {
|
|
4
|
-
browser: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
node: {
|
|
4
|
+
browser: {},
|
|
5
|
+
node: {},
|
|
6
|
+
neutral: {
|
|
8
7
|
src: true,
|
|
9
8
|
},
|
|
10
9
|
},
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
// eslint-disable-next-line import/no-default-export
|
|
12
|
+
// eslint-disable-next-line import-x/no-default-export
|
|
14
13
|
export default config
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model';
|
|
2
|
-
import { WitnessConfig } from '@xyo-network/witness-model';
|
|
3
|
-
export type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config';
|
|
4
|
-
export declare const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema;
|
|
5
|
-
export type CurrentLocationWitnessConfig = WitnessConfig<{
|
|
6
|
-
schema: CurrentLocationWitnessConfigSchema;
|
|
7
|
-
}>;
|
|
8
|
-
export type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, {
|
|
9
|
-
geolocation?: Geolocation;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,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,MAAM,4BAA4B,GAAG,YAAY,CAAC,eAAe,CAAC,4BAA4B,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model';
|
|
2
|
-
import { WitnessConfig } from '@xyo-network/witness-model';
|
|
3
|
-
export type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config';
|
|
4
|
-
export declare const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema;
|
|
5
|
-
export type CurrentLocationWitnessConfig = WitnessConfig<{
|
|
6
|
-
schema: CurrentLocationWitnessConfigSchema;
|
|
7
|
-
}>;
|
|
8
|
-
export type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, {
|
|
9
|
-
geolocation?: Geolocation;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,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,MAAM,4BAA4B,GAAG,YAAY,CAAC,eAAe,CAAC,4BAA4B,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC,CAAA"}
|
package/dist/browser/Config.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model';
|
|
2
|
-
import { WitnessConfig } from '@xyo-network/witness-model';
|
|
3
|
-
export type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config';
|
|
4
|
-
export declare const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema;
|
|
5
|
-
export type CurrentLocationWitnessConfig = WitnessConfig<{
|
|
6
|
-
schema: CurrentLocationWitnessConfigSchema;
|
|
7
|
-
}>;
|
|
8
|
-
export type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, {
|
|
9
|
-
geolocation?: Geolocation;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,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,MAAM,4BAA4B,GAAG,YAAY,CAAC,eAAe,CAAC,4BAA4B,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CurrentLocationPayloadSet.d.ts","sourceRoot":"","sources":["../../src/CurrentLocationPayloadSet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAoB,MAAM,4BAA4B,CAAA;AAEhF,eAAO,MAAM,yBAAyB,EAAE,iBAQvC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CurrentLocationPayloadSet.d.ts","sourceRoot":"","sources":["../../src/CurrentLocationPayloadSet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAoB,MAAM,4BAA4B,CAAA;AAEhF,eAAO,MAAM,yBAAyB,EAAE,iBAQvC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CurrentLocationPayloadSet.d.ts","sourceRoot":"","sources":["../../src/CurrentLocationPayloadSet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAoB,MAAM,4BAA4B,CAAA;AAEhF,eAAO,MAAM,yBAAyB,EAAE,iBAQvC,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
2
|
-
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
3
|
-
import { CurrentLocationWitnessParams } from './Config.ts';
|
|
4
|
-
export declare class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {
|
|
5
|
-
static readonly configSchemas: Schema[];
|
|
6
|
-
static readonly defaultConfigSchema: Schema;
|
|
7
|
-
get geolocation(): Geolocation;
|
|
8
|
-
getCurrentPosition(): Promise<GeolocationPosition>;
|
|
9
|
-
protected observeHandler(): Promise<Payload[]>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=CurrentLocationWitness.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CurrentLocationWitness.d.ts","sourceRoot":"","sources":["../../src/CurrentLocationWitness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAsC,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAE9F,qBAAa,sBAAsB,CAAC,OAAO,SAAS,4BAA4B,GAAG,4BAA4B,CAAE,SAAQ,eAAe,CAAC,OAAO,CAAC;IAC/I,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA+D;IAC/G,gBAAyB,mBAAmB,EAAE,MAAM,CAAqC;IAEzF,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED,kBAAkB;cAaO,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAqB9D"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
2
|
-
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
3
|
-
import { CurrentLocationWitnessParams } from './Config.ts';
|
|
4
|
-
export declare class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {
|
|
5
|
-
static readonly configSchemas: Schema[];
|
|
6
|
-
static readonly defaultConfigSchema: Schema;
|
|
7
|
-
get geolocation(): Geolocation;
|
|
8
|
-
getCurrentPosition(): Promise<GeolocationPosition>;
|
|
9
|
-
protected observeHandler(): Promise<Payload[]>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=CurrentLocationWitness.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CurrentLocationWitness.d.ts","sourceRoot":"","sources":["../../src/CurrentLocationWitness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAsC,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAE9F,qBAAa,sBAAsB,CAAC,OAAO,SAAS,4BAA4B,GAAG,4BAA4B,CAAE,SAAQ,eAAe,CAAC,OAAO,CAAC;IAC/I,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA+D;IAC/G,gBAAyB,mBAAmB,EAAE,MAAM,CAAqC;IAEzF,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED,kBAAkB;cAaO,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAqB9D"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
2
|
-
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
3
|
-
import { CurrentLocationWitnessParams } from './Config.ts';
|
|
4
|
-
export declare class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {
|
|
5
|
-
static readonly configSchemas: Schema[];
|
|
6
|
-
static readonly defaultConfigSchema: Schema;
|
|
7
|
-
get geolocation(): Geolocation;
|
|
8
|
-
getCurrentPosition(): Promise<GeolocationPosition>;
|
|
9
|
-
protected observeHandler(): Promise<Payload[]>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=CurrentLocationWitness.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CurrentLocationWitness.d.ts","sourceRoot":"","sources":["../../src/CurrentLocationWitness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAsC,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAE9F,qBAAa,sBAAsB,CAAC,OAAO,SAAS,4BAA4B,GAAG,4BAA4B,CAAE,SAAQ,eAAe,CAAC,OAAO,CAAC;IAC/I,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA+D;IAC/G,gBAAyB,mBAAmB,EAAE,MAAM,CAAqC;IAEzF,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED,kBAAkB;cAaO,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAqB9D"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CurrentLocationWitness } from './CurrentLocationWitness.ts';
|
|
2
|
-
export declare const LocationPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CurrentLocationWitness<import(".store/@xylabs-object-npm-3.6.12-443b813787/package").BaseParamsFields & {
|
|
3
|
-
account?: import(".store/@xyo-network-account-model-virtual-c593258ccf/package").AccountInstance | "random";
|
|
4
|
-
addToResolvers?: boolean;
|
|
5
|
-
additionalSigners?: import(".store/@xyo-network-account-model-virtual-c593258ccf/package").AccountInstance[];
|
|
6
|
-
allowNameResolution?: boolean;
|
|
7
|
-
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & {
|
|
8
|
-
schema: "network.xyo.location.current.config";
|
|
9
|
-
} & {
|
|
10
|
-
schema: import("./Config.ts").CurrentLocationWitnessConfigSchema;
|
|
11
|
-
}, "schema"> & {
|
|
12
|
-
schema: "network.xyo.location.current.config";
|
|
13
|
-
}, "schema"> & {
|
|
14
|
-
schema: string;
|
|
15
|
-
};
|
|
16
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
17
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
18
|
-
} & {
|
|
19
|
-
geolocation?: Geolocation;
|
|
20
|
-
}>>;
|
|
21
|
-
//# sourceMappingURL=Plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;;;;;;;;;;;;;;;GAQxB,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CurrentLocationWitness } from './CurrentLocationWitness.ts';
|
|
2
|
-
export declare const LocationPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CurrentLocationWitness<import(".store/@xylabs-object-npm-3.6.12-443b813787/package").BaseParamsFields & {
|
|
3
|
-
account?: import(".store/@xyo-network-account-model-virtual-c593258ccf/package").AccountInstance | "random";
|
|
4
|
-
addToResolvers?: boolean;
|
|
5
|
-
additionalSigners?: import(".store/@xyo-network-account-model-virtual-c593258ccf/package").AccountInstance[];
|
|
6
|
-
allowNameResolution?: boolean;
|
|
7
|
-
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & {
|
|
8
|
-
schema: "network.xyo.location.current.config";
|
|
9
|
-
} & {
|
|
10
|
-
schema: import("./Config.ts").CurrentLocationWitnessConfigSchema;
|
|
11
|
-
}, "schema"> & {
|
|
12
|
-
schema: "network.xyo.location.current.config";
|
|
13
|
-
}, "schema"> & {
|
|
14
|
-
schema: string;
|
|
15
|
-
};
|
|
16
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
17
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
18
|
-
} & {
|
|
19
|
-
geolocation?: Geolocation;
|
|
20
|
-
}>>;
|
|
21
|
-
//# sourceMappingURL=Plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;;;;;;;;;;;;;;;GAQxB,CAAA"}
|
package/dist/browser/Plugin.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CurrentLocationWitness } from './CurrentLocationWitness.ts';
|
|
2
|
-
export declare const LocationPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CurrentLocationWitness<import(".store/@xylabs-object-npm-3.6.12-443b813787/package").BaseParamsFields & {
|
|
3
|
-
account?: import(".store/@xyo-network-account-model-virtual-c593258ccf/package").AccountInstance | "random";
|
|
4
|
-
addToResolvers?: boolean;
|
|
5
|
-
additionalSigners?: import(".store/@xyo-network-account-model-virtual-c593258ccf/package").AccountInstance[];
|
|
6
|
-
allowNameResolution?: boolean;
|
|
7
|
-
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & {
|
|
8
|
-
schema: "network.xyo.location.current.config";
|
|
9
|
-
} & {
|
|
10
|
-
schema: import("./Config.ts").CurrentLocationWitnessConfigSchema;
|
|
11
|
-
}, "schema"> & {
|
|
12
|
-
schema: "network.xyo.location.current.config";
|
|
13
|
-
}, "schema"> & {
|
|
14
|
-
schema: string;
|
|
15
|
-
};
|
|
16
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
17
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
18
|
-
} & {
|
|
19
|
-
geolocation?: Geolocation;
|
|
20
|
-
}>>;
|
|
21
|
-
//# sourceMappingURL=Plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;;;;;;;;;;;;;;;GAQxB,CAAA"}
|
package/dist/browser/index.cjs
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
CurrentLocationPayloadSet: () => CurrentLocationPayloadSet,
|
|
24
|
-
CurrentLocationWitness: () => CurrentLocationWitness,
|
|
25
|
-
CurrentLocationWitnessConfigSchema: () => CurrentLocationWitnessConfigSchema,
|
|
26
|
-
LocationPlugin: () => LocationPlugin,
|
|
27
|
-
default: () => LocationPlugin
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(src_exports);
|
|
30
|
-
|
|
31
|
-
// src/Config.ts
|
|
32
|
-
var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
|
|
33
|
-
|
|
34
|
-
// src/CurrentLocationPayloadSet.ts
|
|
35
|
-
var import_location_payload_plugin = require("@xyo-network/location-payload-plugin");
|
|
36
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
|
37
|
-
var CurrentLocationPayloadSet = {
|
|
38
|
-
optional: {
|
|
39
|
-
[import_location_payload_plugin.LocationHeadingSchema]: 1
|
|
40
|
-
},
|
|
41
|
-
required: {
|
|
42
|
-
[import_location_payload_plugin.LocationSchema]: 1
|
|
43
|
-
},
|
|
44
|
-
schema: import_payload_model.PayloadSetSchema
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// src/CurrentLocationWitness.ts
|
|
48
|
-
var import_assert = require("@xylabs/assert");
|
|
49
|
-
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
50
|
-
var import_location_payload_plugin2 = require("@xyo-network/location-payload-plugin");
|
|
51
|
-
var CurrentLocationWitness = class extends import_abstract_witness.AbstractWitness {
|
|
52
|
-
static configSchemas = [...super.configSchemas, CurrentLocationWitnessConfigSchema];
|
|
53
|
-
static defaultConfigSchema = CurrentLocationWitnessConfigSchema;
|
|
54
|
-
get geolocation() {
|
|
55
|
-
return (0, import_assert.assertEx)(this.params.geolocation, () => "No geolocation provided");
|
|
56
|
-
}
|
|
57
|
-
getCurrentPosition() {
|
|
58
|
-
return new Promise((resolve, reject) => {
|
|
59
|
-
this.geolocation?.getCurrentPosition(
|
|
60
|
-
(position) => {
|
|
61
|
-
resolve(position);
|
|
62
|
-
},
|
|
63
|
-
(error) => {
|
|
64
|
-
reject(error);
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
async observeHandler() {
|
|
70
|
-
const location = await this.getCurrentPosition();
|
|
71
|
-
const locationPayload = {
|
|
72
|
-
altitude: location.coords.altitude ?? void 0,
|
|
73
|
-
altitudeAccuracy: location.coords.altitudeAccuracy ?? void 0,
|
|
74
|
-
latitude: location.coords.latitude,
|
|
75
|
-
longitude: location.coords.longitude,
|
|
76
|
-
schema: import_location_payload_plugin2.LocationSchema
|
|
77
|
-
};
|
|
78
|
-
const heading = location.coords.heading ? [
|
|
79
|
-
{
|
|
80
|
-
heading: location.coords.heading ?? void 0,
|
|
81
|
-
schema: import_location_payload_plugin2.LocationHeadingSchema,
|
|
82
|
-
speed: location.coords.speed ?? void 0
|
|
83
|
-
}
|
|
84
|
-
] : [];
|
|
85
|
-
return [locationPayload, ...heading];
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
// src/Plugin.ts
|
|
90
|
-
var import_location_payload_plugin3 = require("@xyo-network/location-payload-plugin");
|
|
91
|
-
var import_payload_model2 = require("@xyo-network/payload-model");
|
|
92
|
-
var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
|
|
93
|
-
var LocationPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
|
|
94
|
-
{ required: { [import_location_payload_plugin3.LocationSchema]: 1 }, schema: import_payload_model2.PayloadSetSchema },
|
|
95
|
-
{
|
|
96
|
-
witness: async (params) => {
|
|
97
|
-
return await CurrentLocationWitness.create(params);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
);
|
|
101
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Config.ts","../../src/CurrentLocationPayloadSet.ts","../../src/CurrentLocationWitness.ts","../../src/Plugin.ts"],"sourcesContent":["export * from './Config.ts'\nexport * from './CurrentLocationPayloadSet.ts'\nexport * from './CurrentLocationWitness.ts'\n// eslint-disable-next-line import/no-default-export\nexport { LocationPlugin as default, LocationPlugin } from './Plugin.ts'\n","import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { 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 type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, { geolocation?: Geolocation }>\n","import { LocationHeadingSchema, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { PayloadSetPayload, PayloadSetSchema } from '@xyo-network/payload-model'\n\nexport const CurrentLocationPayloadSet: PayloadSetPayload = {\n optional: {\n [LocationHeadingSchema]: 1,\n },\n required: {\n [LocationSchema]: 1,\n },\n schema: PayloadSetSchema,\n}\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } 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.create(params)\n },\n },\n )\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIO,IAAM,qCAAyE;;;ACJtF,qCAAsD;AACtD,2BAAoD;AAE7C,IAAM,4BAA+C;AAAA,EAC1D,UAAU;AAAA,IACR,CAAC,oDAAqB,GAAG;AAAA,EAC3B;AAAA,EACA,UAAU;AAAA,IACR,CAAC,6CAAc,GAAG;AAAA,EACpB;AAAA,EACA,QAAQ;AACV;;;ACXA,oBAAyB;AACzB,8BAAgC;AAChC,IAAAA,kCAA+F;AAKxF,IAAM,yBAAN,cAAkH,wCAAyB;AAAA,EAChJ,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,kCAAkC;AAAA,EAC9G,OAAyB,sBAA8B;AAAA,EAEvD,IAAI,cAA2B;AAC7B,eAAO,wBAAS,KAAK,OAAO,aAAa,MAAM,yBAAyB;AAAA,EAC1E;AAAA,EAEA,qBAAqB;AACnB,WAAO,IAAI,QAA6B,CAAC,SAAS,WAAW;AAC3D,WAAK,aAAa;AAAA,QAChB,CAAC,aAAkC;AACjC,kBAAQ,QAAQ;AAAA,QAClB;AAAA,QACA,CAAC,UAAoC;AACnC,iBAAO,KAAK;AAAA,QACd;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,WAAW,MAAM,KAAK,mBAAmB;AAC/C,UAAM,kBAAmC;AAAA,MACvC,UAAU,SAAS,OAAO,YAAY;AAAA,MACtC,kBAAkB,SAAS,OAAO,oBAAoB;AAAA,MACtD,UAAU,SAAS,OAAO;AAAA,MAC1B,WAAW,SAAS,OAAO;AAAA,MAC3B,QAAQ;AAAA,IACV;AACA,UAAM,UACF,SAAS,OAAO,UACd;AAAA,MACE;AAAA,QACE,SAAS,SAAS,OAAO,WAAW;AAAA,QACpC,QAAQ;AAAA,QACR,OAAO,SAAS,OAAO,SAAS;AAAA,MAClC;AAAA,IACF,IACA,CAAC;AACP,WAAO,CAAC,iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;;;ACjDA,IAAAC,kCAA+B;AAC/B,IAAAC,wBAAiC;AACjC,+BAA8C;AAIvC,IAAM,iBAAiB,UAC5B;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,8CAAc,GAAG,EAAE,GAAG,QAAQ,uCAAiB;AAAA,EAC9D;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAO,MAAM,uBAAuB,OAAO,MAAM;AAAA,IACnD;AAAA,EACF;AACF;","names":["import_location_payload_plugin","import_location_payload_plugin","import_payload_model"]}
|
package/dist/browser/index.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,gCAAgC,CAAA;AAC9C,cAAc,6BAA6B,CAAA;AAE3C,OAAO,EAAE,cAAc,IAAI,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/browser/index.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,gCAAgC,CAAA;AAC9C,cAAc,6BAA6B,CAAA;AAE3C,OAAO,EAAE,cAAc,IAAI,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/browser/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,gCAAgC,CAAA;AAC9C,cAAc,6BAA6B,CAAA;AAE3C,OAAO,EAAE,cAAc,IAAI,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/browser/index.mjs
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// src/Config.ts
|
|
2
|
-
var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
|
|
3
|
-
|
|
4
|
-
// src/CurrentLocationPayloadSet.ts
|
|
5
|
-
import { LocationHeadingSchema, LocationSchema } from "@xyo-network/location-payload-plugin";
|
|
6
|
-
import { PayloadSetSchema } from "@xyo-network/payload-model";
|
|
7
|
-
var CurrentLocationPayloadSet = {
|
|
8
|
-
optional: {
|
|
9
|
-
[LocationHeadingSchema]: 1
|
|
10
|
-
},
|
|
11
|
-
required: {
|
|
12
|
-
[LocationSchema]: 1
|
|
13
|
-
},
|
|
14
|
-
schema: PayloadSetSchema
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// src/CurrentLocationWitness.ts
|
|
18
|
-
import { assertEx } from "@xylabs/assert";
|
|
19
|
-
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
20
|
-
import { LocationHeadingSchema as LocationHeadingSchema2, LocationSchema as LocationSchema2 } from "@xyo-network/location-payload-plugin";
|
|
21
|
-
var CurrentLocationWitness = class extends AbstractWitness {
|
|
22
|
-
static configSchemas = [...super.configSchemas, CurrentLocationWitnessConfigSchema];
|
|
23
|
-
static defaultConfigSchema = CurrentLocationWitnessConfigSchema;
|
|
24
|
-
get geolocation() {
|
|
25
|
-
return assertEx(this.params.geolocation, () => "No geolocation provided");
|
|
26
|
-
}
|
|
27
|
-
getCurrentPosition() {
|
|
28
|
-
return new Promise((resolve, reject) => {
|
|
29
|
-
this.geolocation?.getCurrentPosition(
|
|
30
|
-
(position) => {
|
|
31
|
-
resolve(position);
|
|
32
|
-
},
|
|
33
|
-
(error) => {
|
|
34
|
-
reject(error);
|
|
35
|
-
}
|
|
36
|
-
);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
async observeHandler() {
|
|
40
|
-
const location = await this.getCurrentPosition();
|
|
41
|
-
const locationPayload = {
|
|
42
|
-
altitude: location.coords.altitude ?? void 0,
|
|
43
|
-
altitudeAccuracy: location.coords.altitudeAccuracy ?? void 0,
|
|
44
|
-
latitude: location.coords.latitude,
|
|
45
|
-
longitude: location.coords.longitude,
|
|
46
|
-
schema: LocationSchema2
|
|
47
|
-
};
|
|
48
|
-
const heading = location.coords.heading ? [
|
|
49
|
-
{
|
|
50
|
-
heading: location.coords.heading ?? void 0,
|
|
51
|
-
schema: LocationHeadingSchema2,
|
|
52
|
-
speed: location.coords.speed ?? void 0
|
|
53
|
-
}
|
|
54
|
-
] : [];
|
|
55
|
-
return [locationPayload, ...heading];
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// src/Plugin.ts
|
|
60
|
-
import { LocationSchema as LocationSchema3 } from "@xyo-network/location-payload-plugin";
|
|
61
|
-
import { PayloadSetSchema as PayloadSetSchema2 } from "@xyo-network/payload-model";
|
|
62
|
-
import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
|
|
63
|
-
var LocationPlugin = () => createPayloadSetWitnessPlugin(
|
|
64
|
-
{ required: { [LocationSchema3]: 1 }, schema: PayloadSetSchema2 },
|
|
65
|
-
{
|
|
66
|
-
witness: async (params) => {
|
|
67
|
-
return await CurrentLocationWitness.create(params);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
export {
|
|
72
|
-
CurrentLocationPayloadSet,
|
|
73
|
-
CurrentLocationWitness,
|
|
74
|
-
CurrentLocationWitnessConfigSchema,
|
|
75
|
-
LocationPlugin,
|
|
76
|
-
LocationPlugin as default
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Config.ts","../../src/CurrentLocationPayloadSet.ts","../../src/CurrentLocationWitness.ts","../../src/Plugin.ts"],"sourcesContent":["import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'\nimport { 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 type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, { geolocation?: Geolocation }>\n","import { LocationHeadingSchema, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { PayloadSetPayload, PayloadSetSchema } from '@xyo-network/payload-model'\n\nexport const CurrentLocationPayloadSet: PayloadSetPayload = {\n optional: {\n [LocationHeadingSchema]: 1,\n },\n required: {\n [LocationSchema]: 1,\n },\n schema: PayloadSetSchema,\n}\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } 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.create(params)\n },\n },\n )\n"],"mappings":";AAIO,IAAM,qCAAyE;;;ACJtF,SAAS,uBAAuB,sBAAsB;AACtD,SAA4B,wBAAwB;AAE7C,IAAM,4BAA+C;AAAA,EAC1D,UAAU;AAAA,IACR,CAAC,qBAAqB,GAAG;AAAA,EAC3B;AAAA,EACA,UAAU;AAAA,IACR,CAAC,cAAc,GAAG;AAAA,EACpB;AAAA,EACA,QAAQ;AACV;;;ACXA,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAiC,yBAAAA,wBAAwC,kBAAAC,uBAAsB;AAKxF,IAAM,yBAAN,cAAkH,gBAAyB;AAAA,EAChJ,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,kCAAkC;AAAA,EAC9G,OAAyB,sBAA8B;AAAA,EAEvD,IAAI,cAA2B;AAC7B,WAAO,SAAS,KAAK,OAAO,aAAa,MAAM,yBAAyB;AAAA,EAC1E;AAAA,EAEA,qBAAqB;AACnB,WAAO,IAAI,QAA6B,CAAC,SAAS,WAAW;AAC3D,WAAK,aAAa;AAAA,QAChB,CAAC,aAAkC;AACjC,kBAAQ,QAAQ;AAAA,QAClB;AAAA,QACA,CAAC,UAAoC;AACnC,iBAAO,KAAK;AAAA,QACd;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,WAAW,MAAM,KAAK,mBAAmB;AAC/C,UAAM,kBAAmC;AAAA,MACvC,UAAU,SAAS,OAAO,YAAY;AAAA,MACtC,kBAAkB,SAAS,OAAO,oBAAoB;AAAA,MACtD,UAAU,SAAS,OAAO;AAAA,MAC1B,WAAW,SAAS,OAAO;AAAA,MAC3B,QAAQC;AAAA,IACV;AACA,UAAM,UACF,SAAS,OAAO,UACd;AAAA,MACE;AAAA,QACE,SAAS,SAAS,OAAO,WAAW;AAAA,QACpC,QAAQC;AAAA,QACR,OAAO,SAAS,OAAO,SAAS;AAAA,MAClC;AAAA,IACF,IACA,CAAC;AACP,WAAO,CAAC,iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;;;ACjDA,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"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model';
|
|
2
|
-
import { WitnessConfig } from '@xyo-network/witness-model';
|
|
3
|
-
export type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config';
|
|
4
|
-
export declare const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema;
|
|
5
|
-
export type CurrentLocationWitnessConfig = WitnessConfig<{
|
|
6
|
-
schema: CurrentLocationWitnessConfigSchema;
|
|
7
|
-
}>;
|
|
8
|
-
export type CurrentLocationWitnessParams = ModuleParams<AnyConfigSchema<CurrentLocationWitnessConfig>, {
|
|
9
|
-
geolocation?: Geolocation;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,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,MAAM,4BAA4B,GAAG,YAAY,CAAC,eAAe,CAAC,4BAA4B,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC,CAAA"}
|