@xyo-network/location-plugin 2.42.3 → 2.42.5

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.
@@ -0,0 +1,11 @@
1
+ import { ModuleParams } from '@xyo-network/module';
2
+ import { XyoWitnessConfig } from '@xyo-network/witness';
3
+ export type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config';
4
+ export declare const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema;
5
+ export type CurrentLocationWitnessConfig = XyoWitnessConfig<{
6
+ schema: CurrentLocationWitnessConfigSchema;
7
+ }>;
8
+ export type CurrentLocationWitnessParams = ModuleParams<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,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEvD,MAAM,MAAM,kCAAkC,GAAG,qCAAqC,CAAA;AACtF,eAAO,MAAM,kCAAkC,EAAE,kCAA0E,CAAA;AAE3H,MAAM,MAAM,4BAA4B,GAAG,gBAAgB,CAAC;IAC1D,MAAM,EAAE,kCAAkC,CAAA;CAC3C,CAAC,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,YAAY,CAAC,4BAA4B,CAAC,GAAG;IAAE,WAAW,EAAE,WAAW,CAAA;CAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export const CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config';
2
+ //# sourceMappingURL=Config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,kCAAkC,GAAuC,qCAAqC,CAAA"}
@@ -1,21 +1,14 @@
1
- import { XyoModuleParams } from '@xyo-network/module';
1
+ import { ModuleParams } from '@xyo-network/module';
2
2
  import { XyoPayload } from '@xyo-network/payload';
3
- import { AbstractWitness, XyoWitnessConfig } from '@xyo-network/witness';
4
- export type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config';
5
- export declare const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema;
6
- export type CurrentLocationWitnessConfig = XyoWitnessConfig<{
7
- schema: CurrentLocationWitnessConfigSchema;
8
- }>;
9
- export type CurrentLocationWitnessParams = XyoModuleParams<CurrentLocationWitnessConfig> & {
10
- geolocation: Geolocation;
11
- };
3
+ import { AbstractWitness } from '@xyo-network/witness';
4
+ import { CurrentLocationWitnessConfig, CurrentLocationWitnessParams } from './Config';
12
5
  export declare class CurrentLocationWitness extends AbstractWitness<CurrentLocationWitnessConfig> {
13
6
  static configSchema: "network.xyo.location.current.config";
14
7
  private _geolocation;
15
8
  constructor(params: CurrentLocationWitnessParams);
16
9
  get geolocation(): Geolocation;
17
- static create(params?: XyoModuleParams<CurrentLocationWitnessConfig>): Promise<CurrentLocationWitness>;
10
+ static create(params?: ModuleParams<CurrentLocationWitnessConfig>): Promise<CurrentLocationWitness>;
18
11
  getCurrentPosition(): Promise<GeolocationPosition>;
19
- observe(_fields: XyoPayload[]): Promise<XyoPayload[]>;
12
+ observe(): Promise<XyoPayload[]>;
20
13
  }
21
14
  //# sourceMappingURL=CurrentLocationWitness.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurrentLocationWitness.d.ts","sourceRoot":"","sources":["../../src/CurrentLocationWitness.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAExE,MAAM,MAAM,kCAAkC,GAAG,qCAAqC,CAAA;AACt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B;IAaV,OAAO,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;CAoBhD"}
@@ -1,7 +1,7 @@
1
1
  import { assertEx } from '@xylabs/assert';
2
2
  import { LocationHeadingSchema, LocationSchema } from '@xyo-network/location-payload-plugin';
3
3
  import { AbstractWitness } from '@xyo-network/witness';
4
- export const CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config';
4
+ import { CurrentLocationWitnessConfigSchema } from './Config';
5
5
  export class CurrentLocationWitness extends AbstractWitness {
6
6
  static configSchema = CurrentLocationWitnessConfigSchema;
7
7
  _geolocation;
@@ -24,7 +24,7 @@ export class CurrentLocationWitness extends AbstractWitness {
24
24
  });
25
25
  });
26
26
  }
27
- async observe(_fields) {
27
+ async observe() {
28
28
  const location = await this.getCurrentPosition();
29
29
  const locationPayload = {
30
30
  altitude: location.coords.altitude ?? undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"CurrentLocationWitness.js","sourceRoot":"","sources":["../../src/CurrentLocationWitness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAA0B,qBAAqB,EAAmB,cAAc,EAAE,MAAM,sCAAsC,CAAA;AAGrI,OAAO,EAAE,eAAe,EAAoB,MAAM,sBAAsB,CAAA;AAGxE,MAAM,CAAC,MAAM,kCAAkC,GAAuC,qCAAqC,CAAA;AAQ3H,MAAM,OAAO,sBAAuB,SAAQ,eAA6C;IACvF,MAAM,CAAU,YAAY,GAAG,kCAAkC,CAAA;IAEzD,YAAY,CAAa;IAEjC,YAAY,MAAoC;QAC9C,KAAK,CAAC,MAAM,CAAC,CAAA;QACb,IAAI,CAAC,YAAY,GAAG,MAAM,EAAE,WAAW,CAAA;IACzC,CAAC;IAED,IAAW,WAAW;QACpB,OAAO,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,yBAAyB,CAAC,CAAA;IAC/D,CAAC;IAED,MAAM,CAAU,KAAK,CAAC,MAAM,CAAC,MA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SAAS;YAC/C,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,gBAAgB,IAAI,SAAS;YAC/D,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ;YAClC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS;YACpC,MAAM,EAAE,cAAc;SACvB,CAAA;QACD,MAAM,OAAO,GAA6B,QAAQ,CAAC,MAAM,CAAC,OAAO;YAC/D,CAAC,CAAC;gBACE;oBACE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,IAAI,SAAS;oBAC7C,MAAM,EAAE,qBAAqB;oBAC7B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,IAAI,SAAS;iBAC1C;aACF;YACH,CAAC,CAAC,EAAE,CAAA;QACN,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,GAAG,OAAO,CAAC,CAAC,CAAA;IACrD,CAAC"}
@@ -1,6 +1,6 @@
1
- import { XyoModuleParams } from '@xyo-network/module';
1
+ import { ModuleParams } from '@xyo-network/module';
2
2
  import { PayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin';
3
- export declare const LocationPlugin: () => PayloadSetWitnessPlugin<XyoModuleParams<import("@xyo-network/payload").SchemaFields & import("@xyo-network/payload").PayloadFields & {
3
+ export declare const LocationPlugin: () => PayloadSetWitnessPlugin<ModuleParams<import("@xyo-network/payload").SchemaFields & import("@xyo-network/payload").PayloadFields & {
4
4
  security?: {
5
5
  allowed?: Record<string, string[][]> | undefined;
6
6
  disallowed?: Record<string, string[]> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAA0B,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AAIhG,eAAO,MAAM,cAAc;;;;;;;;;;;GASxB,CAAA"}
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,EAA0B,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AAKhG,eAAO,MAAM,cAAc;;;;;;;;;;;GASxB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.js","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,sBAAsB,EAA2B,MAAM,gCAAgC,CAAA;AAEhG,OAAO,EAAE,sBAAsB,EAAgC,MAAM,0BAA0B,CAAA;AAE/F,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CACjC,sBAAsB,CACpB,EAAE,QAAQ,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAC/D;IACE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QACxB,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAC1D,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CACF,CAAA"}
1
+ {"version":3,"file":"Plugin.js","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,sBAAsB,EAA2B,MAAM,gCAAgC,CAAA;AAGhG,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CACjC,sBAAsB,CACpB,EAAE,QAAQ,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAC/D;IACE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QACxB,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAC1D,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CACF,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { LocationPlugin } from './Plugin';
2
+ export * from './Config';
2
3
  export * from './CurrentLocationPayloadSet';
3
4
  export * from './CurrentLocationWitness';
4
5
  export { LocationPlugin };
@@ -1 +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,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AAExC,OAAO,EAAE,cAAc,EAAE,CAAA;AAGzB,eAAe,cAAc,CAAA"}
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"}
package/dist/esm/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { LocationPlugin } from './Plugin';
2
+ export * from './Config';
2
3
  export * from './CurrentLocationPayloadSet';
3
4
  export * from './CurrentLocationWitness';
4
5
  export { LocationPlugin };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAEzC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AAExC,OAAO,EAAE,cAAc,EAAE,CAAA;AAEzB,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"index.js","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;AAEzB,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
package/package.json CHANGED
@@ -10,12 +10,12 @@
10
10
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xylabs/assert": "^2.6.9",
14
- "@xyo-network/location-payload-plugin": "^2.42.3",
15
- "@xyo-network/module": "^2.42.3",
16
- "@xyo-network/payload": "^2.42.3",
17
- "@xyo-network/payloadset-plugin": "^2.42.3",
18
- "@xyo-network/witness": "^2.42.3",
13
+ "@xylabs/assert": "^2.6.10",
14
+ "@xyo-network/location-payload-plugin": "^2.42.5",
15
+ "@xyo-network/module": "^2.42.5",
16
+ "@xyo-network/payload": "^2.42.5",
17
+ "@xyo-network/payloadset-plugin": "^2.42.5",
18
+ "@xyo-network/witness": "^2.42.5",
19
19
  "tslib": "^2.4.1"
20
20
  },
21
21
  "description": "Primary SDK for using XYO Protocol 2.0",
@@ -51,5 +51,5 @@
51
51
  },
52
52
  "sideEffects": false,
53
53
  "types": "dist/esm/index.d.ts",
54
- "version": "2.42.3"
54
+ "version": "2.42.5"
55
55
  }
package/src/Config.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { ModuleParams } from '@xyo-network/module'
2
+ import { XyoWitnessConfig } from '@xyo-network/witness'
3
+
4
+ export type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'
5
+ export const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'
6
+
7
+ export type CurrentLocationWitnessConfig = XyoWitnessConfig<{
8
+ schema: CurrentLocationWitnessConfigSchema
9
+ }>
10
+
11
+ export type CurrentLocationWitnessParams = ModuleParams<CurrentLocationWitnessConfig> & { geolocation: Geolocation }
@@ -1,17 +1,10 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
2
  import { LocationHeadingPayload, LocationHeadingSchema, LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'
3
- import { XyoModuleParams } from '@xyo-network/module'
3
+ import { ModuleParams } from '@xyo-network/module'
4
4
  import { XyoPayload } from '@xyo-network/payload'
5
- import { AbstractWitness, XyoWitnessConfig } from '@xyo-network/witness'
5
+ import { AbstractWitness } from '@xyo-network/witness'
6
6
 
7
- export type CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'
8
- export const CurrentLocationWitnessConfigSchema: CurrentLocationWitnessConfigSchema = 'network.xyo.location.current.config'
9
-
10
- export type CurrentLocationWitnessConfig = XyoWitnessConfig<{
11
- schema: CurrentLocationWitnessConfigSchema
12
- }>
13
-
14
- export type CurrentLocationWitnessParams = XyoModuleParams<CurrentLocationWitnessConfig> & { geolocation: Geolocation }
7
+ import { CurrentLocationWitnessConfig, CurrentLocationWitnessConfigSchema, CurrentLocationWitnessParams } from './Config'
15
8
 
16
9
  export class CurrentLocationWitness extends AbstractWitness<CurrentLocationWitnessConfig> {
17
10
  static override configSchema = CurrentLocationWitnessConfigSchema
@@ -27,7 +20,7 @@ export class CurrentLocationWitness extends AbstractWitness<CurrentLocationWitne
27
20
  return assertEx(this._geolocation, 'No geolocation provided')
28
21
  }
29
22
 
30
- static override async create(params?: XyoModuleParams<CurrentLocationWitnessConfig>): Promise<CurrentLocationWitness> {
23
+ static override async create(params?: ModuleParams<CurrentLocationWitnessConfig>): Promise<CurrentLocationWitness> {
31
24
  return (await super.create(params)) as CurrentLocationWitness
32
25
  }
33
26
 
@@ -44,7 +37,7 @@ export class CurrentLocationWitness extends AbstractWitness<CurrentLocationWitne
44
37
  })
45
38
  }
46
39
 
47
- override async observe(_fields: XyoPayload[]): Promise<XyoPayload[]> {
40
+ override async observe(): Promise<XyoPayload[]> {
48
41
  const location = await this.getCurrentPosition()
49
42
  const locationPayload: LocationPayload = {
50
43
  altitude: location.coords.altitude ?? undefined,
@@ -5,7 +5,7 @@
5
5
  import { CurrentLocationSchema } from '@xyo-network/location-payload-plugin'
6
6
  import { PayloadSetPluginResolver } from '@xyo-network/payloadset-plugin'
7
7
 
8
- import { CurrentLocationWitnessConfigSchema } from './CurrentLocationWitness'
8
+ import { CurrentLocationWitnessConfigSchema } from './Config'
9
9
  import { LocationPlugin } from './Plugin'
10
10
 
11
11
  describe('LocationPlugin', () => {
package/src/Plugin.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { LocationSchema } from '@xyo-network/location-payload-plugin'
2
- import { XyoModuleParams } from '@xyo-network/module'
2
+ import { ModuleParams } from '@xyo-network/module'
3
3
  import { PayloadSetSchema } from '@xyo-network/payload'
4
4
  import { createPayloadSetPlugin, PayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'
5
5
 
6
- import { CurrentLocationWitness, CurrentLocationWitnessConfig } from './CurrentLocationWitness'
6
+ import { CurrentLocationWitnessConfig } from './Config'
7
+ import { CurrentLocationWitness } from './CurrentLocationWitness'
7
8
 
8
9
  export const LocationPlugin = () =>
9
- createPayloadSetPlugin<PayloadSetWitnessPlugin<XyoModuleParams<CurrentLocationWitnessConfig>>>(
10
+ createPayloadSetPlugin<PayloadSetWitnessPlugin<ModuleParams<CurrentLocationWitnessConfig>>>(
10
11
  { required: { [LocationSchema]: 1 }, schema: PayloadSetSchema },
11
12
  {
12
13
  witness: async (params) => {
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { LocationPlugin } from './Plugin'
2
2
 
3
+ export * from './Config'
3
4
  export * from './CurrentLocationPayloadSet'
4
5
  export * from './CurrentLocationWitness'
5
6