@xyo-network/location-plugin 3.0.2 → 3.0.3
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
CHANGED
|
@@ -5,8 +5,8 @@ import * as _xyo_network_payload_model from '@xyo-network/payload-model';
|
|
|
5
5
|
import { PayloadSetPayload, Schema, Payload } from '@xyo-network/payload-model';
|
|
6
6
|
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
7
7
|
import * as _xyo_network_payloadset_plugin from '@xyo-network/payloadset-plugin';
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
8
|
+
import * as _store__xyo_network_account_model_virtual_e036bb1dc5_package from '.store/@xyo-network-account-model-virtual-e036bb1dc5/package';
|
|
9
|
+
import * as _store__xylabs_object_npm_4_0_2_c4743812cc_package from '.store/@xylabs-object-npm-4.0.2-c4743812cc/package';
|
|
10
10
|
|
|
11
11
|
type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config';
|
|
12
12
|
declare const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema;
|
|
@@ -27,10 +27,10 @@ declare class CurrentLocationWitness<TParams extends CurrentLocationWitnessParam
|
|
|
27
27
|
protected observeHandler(): Promise<Payload[]>;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
declare const LocationPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<CurrentLocationWitness<
|
|
31
|
-
account?:
|
|
30
|
+
declare const LocationPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<CurrentLocationWitness<_store__xylabs_object_npm_4_0_2_c4743812cc_package.BaseParamsFields & {
|
|
31
|
+
account?: _store__xyo_network_account_model_virtual_e036bb1dc5_package.AccountInstance | "random";
|
|
32
32
|
addToResolvers?: boolean;
|
|
33
|
-
additionalSigners?:
|
|
33
|
+
additionalSigners?: _store__xyo_network_account_model_virtual_e036bb1dc5_package.AccountInstance[];
|
|
34
34
|
allowNameResolution?: boolean;
|
|
35
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
36
|
schema: "network.xyo.location.current.config";
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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 type CurrentLocationWitnessParams = 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: {\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 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.create(params)\n },\n },\n )\n"],"mappings":";AAIO,IAAM,qCAAyE;;;ACJtF,SAAS,uBAAuB,sBAAsB;AAEtD,SAAS,wBAAwB;AAE1B,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;;;ACZA,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAEhC,SAAS,yBAAAA,wBAAuB,kBAAAC,uBAAsB;AAM/C,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;;;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"]}
|
package/package.json
CHANGED
|
@@ -7,21 +7,21 @@
|
|
|
7
7
|
},
|
|
8
8
|
"bugs": {
|
|
9
9
|
"email": "support@xyo.network",
|
|
10
|
-
"url": "https://github.com/XYOracleNetwork/plugins/issues"
|
|
10
|
+
"url": "git+https://github.com/XYOracleNetwork/plugins/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/assert": "^4.0.
|
|
14
|
-
"@xyo-network/abstract-witness": "^3.0.
|
|
15
|
-
"@xyo-network/location-payload-plugin": "^3.0.
|
|
16
|
-
"@xyo-network/module-model": "^3.0.
|
|
17
|
-
"@xyo-network/payload-model": "^3.0.
|
|
18
|
-
"@xyo-network/payloadset-plugin": "^3.0.
|
|
19
|
-
"@xyo-network/witness-model": "^3.0.
|
|
13
|
+
"@xylabs/assert": "^4.0.2",
|
|
14
|
+
"@xyo-network/abstract-witness": "^3.0.3",
|
|
15
|
+
"@xyo-network/location-payload-plugin": "^3.0.3",
|
|
16
|
+
"@xyo-network/module-model": "^3.0.3",
|
|
17
|
+
"@xyo-network/payload-model": "^3.0.3",
|
|
18
|
+
"@xyo-network/payloadset-plugin": "^3.0.3",
|
|
19
|
+
"@xyo-network/witness-model": "^3.0.3"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.
|
|
23
|
-
"@xylabs/tsconfig-dom": "^4.0.0-rc.
|
|
24
|
-
"@xylabs/tsconfig-dom-jest": "^4.0.0-rc.
|
|
22
|
+
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.20",
|
|
23
|
+
"@xylabs/tsconfig-dom": "^4.0.0-rc.20",
|
|
24
|
+
"@xylabs/tsconfig-dom-jest": "^4.0.0-rc.20",
|
|
25
25
|
"typescript": "^5.5.4"
|
|
26
26
|
},
|
|
27
27
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
},
|
|
42
42
|
"repository": {
|
|
43
43
|
"type": "git",
|
|
44
|
-
"url": "https://github.com/XYOracleNetwork/plugins.git"
|
|
44
|
+
"url": "git+https://github.com/XYOracleNetwork/plugins.git"
|
|
45
45
|
},
|
|
46
46
|
"sideEffects": false,
|
|
47
|
-
"version": "3.0.
|
|
47
|
+
"version": "3.0.3",
|
|
48
48
|
"type": "module"
|
|
49
49
|
}
|
package/src/Config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'
|
|
2
|
-
import { WitnessConfig } from '@xyo-network/witness-model'
|
|
1
|
+
import type { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'
|
|
2
|
+
import type { WitnessConfig } from '@xyo-network/witness-model'
|
|
3
3
|
|
|
4
4
|
export type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'
|
|
5
5
|
export const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LocationHeadingSchema, LocationSchema } from '@xyo-network/location-payload-plugin'
|
|
2
|
-
import { PayloadSetPayload
|
|
2
|
+
import type { PayloadSetPayload } from '@xyo-network/payload-model'
|
|
3
|
+
import { PayloadSetSchema } from '@xyo-network/payload-model'
|
|
3
4
|
|
|
4
5
|
export const CurrentLocationPayloadSet: PayloadSetPayload = {
|
|
5
6
|
optional: {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
2
|
import { AbstractWitness } from '@xyo-network/abstract-witness'
|
|
3
|
-
import { LocationHeadingPayload,
|
|
4
|
-
import {
|
|
3
|
+
import type { LocationHeadingPayload, LocationPayload } from '@xyo-network/location-payload-plugin'
|
|
4
|
+
import { LocationHeadingSchema, LocationSchema } from '@xyo-network/location-payload-plugin'
|
|
5
|
+
import type { Payload, Schema } from '@xyo-network/payload-model'
|
|
5
6
|
|
|
6
|
-
import {
|
|
7
|
+
import type { CurrentLocationWitnessParams } from './Config.ts'
|
|
8
|
+
import { CurrentLocationWitnessConfigSchema } from './Config.ts'
|
|
7
9
|
|
|
8
10
|
export class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {
|
|
9
11
|
static override readonly configSchemas: Schema[] = [...super.configSchemas, CurrentLocationWitnessConfigSchema]
|
package/xy.config.ts
CHANGED