@xyo-network/location-plugin 2.75.0 → 2.75.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.
Files changed (52) hide show
  1. package/dist/browser/Config.d.cts +11 -0
  2. package/dist/browser/Config.d.cts.map +1 -0
  3. package/dist/browser/Config.js +1 -2
  4. package/dist/browser/Config.js.map +1 -1
  5. package/dist/browser/CurrentLocationPayloadSet.d.cts +3 -0
  6. package/dist/browser/CurrentLocationPayloadSet.d.cts.map +1 -0
  7. package/dist/browser/CurrentLocationPayloadSet.js +1 -2
  8. package/dist/browser/CurrentLocationPayloadSet.js.map +1 -1
  9. package/dist/browser/CurrentLocationWitness.d.cts +10 -0
  10. package/dist/browser/CurrentLocationWitness.d.cts.map +1 -0
  11. package/dist/browser/CurrentLocationWitness.js +3 -8
  12. package/dist/browser/CurrentLocationWitness.js.map +1 -1
  13. package/dist/browser/Plugin.d.cts +56 -0
  14. package/dist/browser/Plugin.d.cts.map +1 -0
  15. package/dist/browser/Plugin.js +4 -52
  16. package/dist/browser/Plugin.js.map +1 -1
  17. package/dist/browser/index.d.cts +7 -0
  18. package/dist/browser/index.d.cts.map +1 -0
  19. package/dist/browser/index.js +4 -78
  20. package/dist/browser/index.js.map +1 -1
  21. package/dist/docs.json +22629 -0
  22. package/dist/node/Config.d.cts +11 -0
  23. package/dist/node/Config.d.cts.map +1 -0
  24. package/dist/node/Config.js +3 -1
  25. package/dist/node/Config.js.map +1 -1
  26. package/dist/node/Config.mjs +2 -1
  27. package/dist/node/Config.mjs.map +1 -1
  28. package/dist/node/CurrentLocationPayloadSet.d.cts +3 -0
  29. package/dist/node/CurrentLocationPayloadSet.d.cts.map +1 -0
  30. package/dist/node/CurrentLocationPayloadSet.js +3 -1
  31. package/dist/node/CurrentLocationPayloadSet.js.map +1 -1
  32. package/dist/node/CurrentLocationPayloadSet.mjs +2 -1
  33. package/dist/node/CurrentLocationPayloadSet.mjs.map +1 -1
  34. package/dist/node/CurrentLocationWitness.d.cts +10 -0
  35. package/dist/node/CurrentLocationWitness.d.cts.map +1 -0
  36. package/dist/node/CurrentLocationWitness.js +12 -5
  37. package/dist/node/CurrentLocationWitness.js.map +1 -1
  38. package/dist/node/CurrentLocationWitness.mjs +10 -4
  39. package/dist/node/CurrentLocationWitness.mjs.map +1 -1
  40. package/dist/node/Plugin.d.cts +56 -0
  41. package/dist/node/Plugin.d.cts.map +1 -0
  42. package/dist/node/Plugin.js +55 -5
  43. package/dist/node/Plugin.js.map +1 -1
  44. package/dist/node/Plugin.mjs +53 -4
  45. package/dist/node/Plugin.mjs.map +1 -1
  46. package/dist/node/index.d.cts +7 -0
  47. package/dist/node/index.d.cts.map +1 -0
  48. package/dist/node/index.js +88 -11
  49. package/dist/node/index.js.map +1 -1
  50. package/dist/node/index.mjs +79 -4
  51. package/dist/node/index.mjs.map +1 -1
  52. package/package.json +11 -11
@@ -0,0 +1,11 @@
1
+ import { AnyConfigSchema, ModuleParams } from '@xyo-network/module';
2
+ import { WitnessConfig } from '@xyo-network/witness';
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,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,5 +1,4 @@
1
- // src/Config.ts
2
- var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
1
+ const CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
3
2
  export {
4
3
  CurrentLocationWitnessConfigSchema
5
4
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Config.ts"],"sourcesContent":["import { AnyConfigSchema, ModuleParams } from '@xyo-network/module'\nimport { WitnessConfig } from '@xyo-network/witness'\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"],"mappings":";AAIO,IAAM,qCAAyE;","names":[]}
1
+ {"version":3,"sources":["../../src/Config.ts"],"sourcesContent":["import { AnyConfigSchema, ModuleParams } from '@xyo-network/module'\nimport { WitnessConfig } from '@xyo-network/witness'\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"],"mappings":"AAIO,MAAM,qCAAyE;","names":[]}
@@ -0,0 +1,3 @@
1
+ import { PayloadSetPayload } from '@xyo-network/payload-model';
2
+ export declare const CurrentLocationPayloadSet: PayloadSetPayload;
3
+ //# sourceMappingURL=CurrentLocationPayloadSet.d.ts.map
@@ -0,0 +1 @@
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,7 +1,6 @@
1
- // src/CurrentLocationPayloadSet.ts
2
1
  import { LocationHeadingSchema, LocationSchema } from "@xyo-network/location-payload-plugin";
3
2
  import { PayloadSetSchema } from "@xyo-network/payload-model";
4
- var CurrentLocationPayloadSet = {
3
+ const CurrentLocationPayloadSet = {
5
4
  optional: {
6
5
  [LocationHeadingSchema]: 1
7
6
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/CurrentLocationPayloadSet.ts"],"sourcesContent":["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"],"mappings":";AAAA,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;","names":[]}
1
+ {"version":3,"sources":["../../src/CurrentLocationPayloadSet.ts"],"sourcesContent":["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"],"mappings":"AAAA,SAAS,uBAAuB,sBAAsB;AACtD,SAA4B,wBAAwB;AAE7C,MAAM,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;","names":[]}
@@ -0,0 +1,10 @@
1
+ import { Payload } from '@xyo-network/payload-model';
2
+ import { AbstractWitness } from '@xyo-network/witness';
3
+ import { CurrentLocationWitnessParams } from './Config';
4
+ export declare class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {
5
+ static configSchemas: "network.xyo.location.current.config"[];
6
+ get geolocation(): Geolocation;
7
+ getCurrentPosition(): Promise<GeolocationPosition>;
8
+ protected observeHandler(): Promise<Payload[]>;
9
+ }
10
+ //# sourceMappingURL=CurrentLocationWitness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CurrentLocationWitness.d.ts","sourceRoot":"","sources":["../../src/CurrentLocationWitness.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,OAAO,EAAsC,4BAA4B,EAAE,MAAM,UAAU,CAAA;AAE3F,qBAAa,sBAAsB,CAAC,OAAO,SAAS,4BAA4B,GAAG,4BAA4B,CAAE,SAAQ,eAAe,CAAC,OAAO,CAAC;IAC/I,OAAgB,aAAa,0CAAuC;IAEpE,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED,kBAAkB;cAaO,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAoB9D"}
@@ -1,13 +1,8 @@
1
- // src/CurrentLocationWitness.ts
2
1
  import { assertEx } from "@xylabs/assert";
3
2
  import { LocationHeadingSchema, LocationSchema } from "@xyo-network/location-payload-plugin";
4
3
  import { AbstractWitness } from "@xyo-network/witness";
5
-
6
- // src/Config.ts
7
- var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
8
-
9
- // src/CurrentLocationWitness.ts
10
- var CurrentLocationWitness = class extends AbstractWitness {
4
+ import { CurrentLocationWitnessConfigSchema } from "./Config";
5
+ class CurrentLocationWitness extends AbstractWitness {
11
6
  static configSchemas = [CurrentLocationWitnessConfigSchema];
12
7
  get geolocation() {
13
8
  return assertEx(this.params.geolocation, "No geolocation provided");
@@ -42,7 +37,7 @@ var CurrentLocationWitness = class extends AbstractWitness {
42
37
  ] : [];
43
38
  return [locationPayload, ...heading];
44
39
  }
45
- };
40
+ }
46
41
  export {
47
42
  CurrentLocationWitness
48
43
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/CurrentLocationWitness.ts","../../src/Config.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\nimport { AbstractWitness } from '@xyo-network/witness'\n\nimport { CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } from './Config'\n\nexport class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {\n static override configSchemas = [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[] = 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 { AnyConfigSchema, ModuleParams } from '@xyo-network/module'\nimport { WitnessConfig } from '@xyo-network/witness'\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"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAiC,uBAAwC,sBAAsB;AAE/F,SAAS,uBAAuB;;;ACCzB,IAAM,qCAAyE;;;ADG/E,IAAM,yBAAN,cAAkH,gBAAyB;AAAA,EAChJ,OAAgB,gBAAgB,CAAC,kCAAkC;AAAA,EAEnE,IAAI,cAA2B;AAC7B,WAAO,SAAS,KAAK,OAAO,aAAa,yBAAyB;AAAA,EACpE;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,UAAoC,SAAS,OAAO,UACtD;AAAA,MACE;AAAA,QACE,SAAS,SAAS,OAAO,WAAW;AAAA,QACpC,QAAQ;AAAA,QACR,OAAO,SAAS,OAAO,SAAS;AAAA,MAClC;AAAA,IACF,IACA,CAAC;AACL,WAAO,CAAC,iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/CurrentLocationWitness.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\nimport { AbstractWitness } from '@xyo-network/witness'\n\nimport { CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } from './Config'\n\nexport class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {\n static override configSchemas = [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[] = 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"],"mappings":"AAAA,SAAS,gBAAgB;AACzB,SAAiC,uBAAwC,sBAAsB;AAE/F,SAAS,uBAAuB;AAEhC,SAAS,0CAAwE;AAE1E,MAAM,+BAA4G,gBAAyB;AAAA,EAChJ,OAAgB,gBAAgB,CAAC,kCAAkC;AAAA,EAEnE,IAAI,cAA2B;AAC7B,WAAO,SAAS,KAAK,OAAO,aAAa,yBAAyB;AAAA,EACpE;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,UAAoC,SAAS,OAAO,UACtD;AAAA,MACE;AAAA,QACE,SAAS,SAAS,OAAO,WAAW;AAAA,QACpC,QAAQ;AAAA,QACR,OAAO,SAAS,OAAO,SAAS;AAAA,MAClC;AAAA,IACF,IACA,CAAC;AACL,WAAO,CAAC,iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;","names":[]}
@@ -0,0 +1,56 @@
1
+ import { CurrentLocationWitness } from './CurrentLocationWitness';
2
+ export declare const LocationPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CurrentLocationWitness<import("@xyo-network/core").BaseParamsFields & {
3
+ account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
4
+ config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<{
5
+ accountDerivationPath?: string | undefined;
6
+ readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
7
+ readonly labels?: import("@xyo-network/module-model").Labels | undefined;
8
+ readonly name?: string | undefined;
9
+ readonly paging?: Record<string, {
10
+ size?: number | undefined;
11
+ }> | undefined;
12
+ readonly security?: {
13
+ readonly allowAnonymous?: boolean | undefined;
14
+ readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
15
+ readonly disallowed?: Record<string, string[]> | undefined;
16
+ } | undefined;
17
+ readonly sign?: boolean | undefined;
18
+ readonly storeQueries?: boolean | undefined;
19
+ readonly timestamp?: boolean | undefined;
20
+ } & Omit<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<{
21
+ accountDerivationPath?: string | undefined;
22
+ readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
23
+ readonly labels?: import("@xyo-network/module-model").Labels | undefined;
24
+ readonly name?: string | undefined;
25
+ readonly paging?: Record<string, {
26
+ size?: number | undefined;
27
+ }> | undefined;
28
+ readonly security?: {
29
+ readonly allowAnonymous?: boolean | undefined;
30
+ readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
31
+ readonly disallowed?: Record<string, string[]> | undefined;
32
+ } | undefined;
33
+ readonly sign?: boolean | undefined;
34
+ readonly storeQueries?: boolean | undefined;
35
+ readonly timestamp?: boolean | undefined;
36
+ } & {
37
+ archivist?: string | undefined;
38
+ schema: "network.xyo.location.current.config";
39
+ targetSet?: (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/payload-model").PayloadSet & {
40
+ schema: "network.xyo.payload.set";
41
+ }) | undefined;
42
+ } & {
43
+ schema: "network.xyo.location.current.config";
44
+ }, "schema"> & {
45
+ schema: "network.xyo.location.current.config";
46
+ }, "schema"> & {
47
+ schema: string;
48
+ }, "schema"> & {
49
+ schema: string;
50
+ };
51
+ ephemeralQueryAccountEnabled?: boolean | undefined;
52
+ wallet?: import("@xyo-network/wallet-model").WalletInstance | undefined;
53
+ } & {
54
+ geolocation?: Geolocation | undefined;
55
+ }>>;
56
+ //# sourceMappingURL=Plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQxB,CAAA"}
@@ -1,57 +1,9 @@
1
- // src/Plugin.ts
2
- import { LocationSchema as LocationSchema2 } from "@xyo-network/location-payload-plugin";
1
+ import { LocationSchema } from "@xyo-network/location-payload-plugin";
3
2
  import { PayloadSetSchema } from "@xyo-network/payload-model";
4
3
  import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
5
-
6
- // src/CurrentLocationWitness.ts
7
- import { assertEx } from "@xylabs/assert";
8
- import { LocationHeadingSchema, LocationSchema } from "@xyo-network/location-payload-plugin";
9
- import { AbstractWitness } from "@xyo-network/witness";
10
-
11
- // src/Config.ts
12
- var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
13
-
14
- // src/CurrentLocationWitness.ts
15
- var CurrentLocationWitness = class extends AbstractWitness {
16
- static configSchemas = [CurrentLocationWitnessConfigSchema];
17
- get geolocation() {
18
- return assertEx(this.params.geolocation, "No geolocation provided");
19
- }
20
- getCurrentPosition() {
21
- return new Promise((resolve, reject) => {
22
- this.geolocation?.getCurrentPosition(
23
- (position) => {
24
- resolve(position);
25
- },
26
- (error) => {
27
- reject(error);
28
- }
29
- );
30
- });
31
- }
32
- async observeHandler() {
33
- const location = await this.getCurrentPosition();
34
- const locationPayload = {
35
- altitude: location.coords.altitude ?? void 0,
36
- altitudeAccuracy: location.coords.altitudeAccuracy ?? void 0,
37
- latitude: location.coords.latitude,
38
- longitude: location.coords.longitude,
39
- schema: LocationSchema
40
- };
41
- const heading = location.coords.heading ? [
42
- {
43
- heading: location.coords.heading ?? void 0,
44
- schema: LocationHeadingSchema,
45
- speed: location.coords.speed ?? void 0
46
- }
47
- ] : [];
48
- return [locationPayload, ...heading];
49
- }
50
- };
51
-
52
- // src/Plugin.ts
53
- var LocationPlugin = () => createPayloadSetWitnessPlugin(
54
- { required: { [LocationSchema2]: 1 }, schema: PayloadSetSchema },
4
+ import { CurrentLocationWitness } from "./CurrentLocationWitness";
5
+ const LocationPlugin = () => createPayloadSetWitnessPlugin(
6
+ { required: { [LocationSchema]: 1 }, schema: PayloadSetSchema },
55
7
  {
56
8
  witness: async (params) => {
57
9
  return await CurrentLocationWitness.create(params);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/CurrentLocationWitness.ts","../../src/Config.ts"],"sourcesContent":["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'\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","import { assertEx } from '@xylabs/assert'\nimport { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\nimport { AbstractWitness } from '@xyo-network/witness'\n\nimport { CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } from './Config'\n\nexport class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {\n static override configSchemas = [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[] = 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 { AnyConfigSchema, ModuleParams } from '@xyo-network/module'\nimport { WitnessConfig } from '@xyo-network/witness'\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"],"mappings":";AAAA,SAAS,kBAAAA,uBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,gBAAgB;AACzB,SAAiC,uBAAwC,sBAAsB;AAE/F,SAAS,uBAAuB;;;ACCzB,IAAM,qCAAyE;;;ADG/E,IAAM,yBAAN,cAAkH,gBAAyB;AAAA,EAChJ,OAAgB,gBAAgB,CAAC,kCAAkC;AAAA,EAEnE,IAAI,cAA2B;AAC7B,WAAO,SAAS,KAAK,OAAO,aAAa,yBAAyB;AAAA,EACpE;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,UAAoC,SAAS,OAAO,UACtD;AAAA,MACE;AAAA,QACE,SAAS,SAAS,OAAO,WAAW;AAAA,QACpC,QAAQ;AAAA,QACR,OAAO,SAAS,OAAO,SAAS;AAAA,MAClC;AAAA,IACF,IACA,CAAC;AACL,WAAO,CAAC,iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;;;ADzCO,IAAM,iBAAiB,MAC5B;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,eAAc,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC9D;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAO,MAAM,uBAAuB,OAAO,MAAM;AAAA,IACnD;AAAA,EACF;AACF;","names":["LocationSchema","LocationSchema"]}
1
+ {"version":3,"sources":["../../src/Plugin.ts"],"sourcesContent":["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'\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,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;AAE9C,SAAS,8BAA8B;AAEhC,MAAM,iBAAiB,MAC5B;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,cAAc,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC9D;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAO,MAAM,uBAAuB,OAAO,MAAM;AAAA,IACnD;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,7 @@
1
+ import { LocationPlugin } from './Plugin';
2
+ export * from './Config';
3
+ export * from './CurrentLocationPayloadSet';
4
+ export * from './CurrentLocationWitness';
5
+ export { LocationPlugin };
6
+ export default LocationPlugin;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAEzC,cAAc,UAAU,CAAA;AACxB,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AAExC,OAAO,EAAE,cAAc,EAAE,CAAA;AAGzB,eAAe,cAAc,CAAA"}
@@ -1,83 +1,9 @@
1
- // src/Plugin.ts
2
- import { LocationSchema as LocationSchema2 } from "@xyo-network/location-payload-plugin";
3
- import { PayloadSetSchema } from "@xyo-network/payload-model";
4
- import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
5
-
6
- // src/CurrentLocationWitness.ts
7
- import { assertEx } from "@xylabs/assert";
8
- import { LocationHeadingSchema, LocationSchema } from "@xyo-network/location-payload-plugin";
9
- import { AbstractWitness } from "@xyo-network/witness";
10
-
11
- // src/Config.ts
12
- var CurrentLocationWitnessConfigSchema = "network.xyo.location.current.config";
13
-
14
- // src/CurrentLocationWitness.ts
15
- var CurrentLocationWitness = class extends AbstractWitness {
16
- static configSchemas = [CurrentLocationWitnessConfigSchema];
17
- get geolocation() {
18
- return assertEx(this.params.geolocation, "No geolocation provided");
19
- }
20
- getCurrentPosition() {
21
- return new Promise((resolve, reject) => {
22
- this.geolocation?.getCurrentPosition(
23
- (position) => {
24
- resolve(position);
25
- },
26
- (error) => {
27
- reject(error);
28
- }
29
- );
30
- });
31
- }
32
- async observeHandler() {
33
- const location = await this.getCurrentPosition();
34
- const locationPayload = {
35
- altitude: location.coords.altitude ?? void 0,
36
- altitudeAccuracy: location.coords.altitudeAccuracy ?? void 0,
37
- latitude: location.coords.latitude,
38
- longitude: location.coords.longitude,
39
- schema: LocationSchema
40
- };
41
- const heading = location.coords.heading ? [
42
- {
43
- heading: location.coords.heading ?? void 0,
44
- schema: LocationHeadingSchema,
45
- speed: location.coords.speed ?? void 0
46
- }
47
- ] : [];
48
- return [locationPayload, ...heading];
49
- }
50
- };
51
-
52
- // src/Plugin.ts
53
- var LocationPlugin = () => createPayloadSetWitnessPlugin(
54
- { required: { [LocationSchema2]: 1 }, schema: PayloadSetSchema },
55
- {
56
- witness: async (params) => {
57
- return await CurrentLocationWitness.create(params);
58
- }
59
- }
60
- );
61
-
62
- // src/CurrentLocationPayloadSet.ts
63
- import { LocationHeadingSchema as LocationHeadingSchema2, LocationSchema as LocationSchema3 } from "@xyo-network/location-payload-plugin";
64
- import { PayloadSetSchema as PayloadSetSchema2 } from "@xyo-network/payload-model";
65
- var CurrentLocationPayloadSet = {
66
- optional: {
67
- [LocationHeadingSchema2]: 1
68
- },
69
- required: {
70
- [LocationSchema3]: 1
71
- },
72
- schema: PayloadSetSchema2
73
- };
74
-
75
- // src/index.ts
1
+ import { LocationPlugin } from "./Plugin";
2
+ export * from "./Config";
3
+ export * from "./CurrentLocationPayloadSet";
4
+ export * from "./CurrentLocationWitness";
76
5
  var src_default = LocationPlugin;
77
6
  export {
78
- CurrentLocationPayloadSet,
79
- CurrentLocationWitness,
80
- CurrentLocationWitnessConfigSchema,
81
7
  LocationPlugin,
82
8
  src_default as default
83
9
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/CurrentLocationWitness.ts","../../src/Config.ts","../../src/CurrentLocationPayloadSet.ts","../../src/index.ts"],"sourcesContent":["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'\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","import { assertEx } from '@xylabs/assert'\nimport { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\nimport { AbstractWitness } from '@xyo-network/witness'\n\nimport { CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } from './Config'\n\nexport class CurrentLocationWitness<TParams extends CurrentLocationWitnessParams = CurrentLocationWitnessParams> extends AbstractWitness<TParams> {\n static override configSchemas = [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[] = 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 { AnyConfigSchema, ModuleParams } from '@xyo-network/module'\nimport { WitnessConfig } from '@xyo-network/witness'\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 { LocationPlugin } from './Plugin'\n\nexport * from './Config'\nexport * from './CurrentLocationPayloadSet'\nexport * from './CurrentLocationWitness'\n\nexport { LocationPlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default LocationPlugin\n"],"mappings":";AAAA,SAAS,kBAAAA,uBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,gBAAgB;AACzB,SAAiC,uBAAwC,sBAAsB;AAE/F,SAAS,uBAAuB;;;ACCzB,IAAM,qCAAyE;;;ADG/E,IAAM,yBAAN,cAAkH,gBAAyB;AAAA,EAChJ,OAAgB,gBAAgB,CAAC,kCAAkC;AAAA,EAEnE,IAAI,cAA2B;AAC7B,WAAO,SAAS,KAAK,OAAO,aAAa,yBAAyB;AAAA,EACpE;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,UAAoC,SAAS,OAAO,UACtD;AAAA,MACE;AAAA,QACE,SAAS,SAAS,OAAO,WAAW;AAAA,QACpC,QAAQ;AAAA,QACR,OAAO,SAAS,OAAO,SAAS;AAAA,MAClC;AAAA,IACF,IACA,CAAC;AACL,WAAO,CAAC,iBAAiB,GAAG,OAAO;AAAA,EACrC;AACF;;;ADzCO,IAAM,iBAAiB,MAC5B;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,eAAc,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC9D;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAO,MAAM,uBAAuB,OAAO,MAAM;AAAA,IACnD;AAAA,EACF;AACF;;;AGdF,SAAS,yBAAAC,wBAAuB,kBAAAC,uBAAsB;AACtD,SAA4B,oBAAAC,yBAAwB;AAE7C,IAAM,4BAA+C;AAAA,EAC1D,UAAU;AAAA,IACR,CAACF,sBAAqB,GAAG;AAAA,EAC3B;AAAA,EACA,UAAU;AAAA,IACR,CAACC,eAAc,GAAG;AAAA,EACpB;AAAA,EACA,QAAQC;AACV;;;ACFA,IAAO,cAAQ;","names":["LocationSchema","LocationSchema","LocationHeadingSchema","LocationSchema","PayloadSetSchema"]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import { LocationPlugin } from './Plugin'\n\nexport * from './Config'\nexport * from './CurrentLocationPayloadSet'\nexport * from './CurrentLocationWitness'\n\nexport { LocationPlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default LocationPlugin\n"],"mappings":"AAAA,SAAS,sBAAsB;AAE/B,cAAc;AACd,cAAc;AACd,cAAc;AAKd,IAAO,cAAQ;","names":[]}