@xyo-network/location-certainty-plugin 2.99.0 → 2.99.2

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 (83) hide show
  1. package/dist/browser/Diviner/Diviner.d.cts +1 -1
  2. package/dist/browser/Diviner/Diviner.d.cts.map +1 -1
  3. package/dist/browser/Diviner/Diviner.d.mts +1 -1
  4. package/dist/browser/Diviner/Diviner.d.mts.map +1 -1
  5. package/dist/browser/Diviner/Diviner.d.ts +1 -1
  6. package/dist/browser/Diviner/Diviner.d.ts.map +1 -1
  7. package/dist/browser/Diviner/index.d.cts +2 -2
  8. package/dist/browser/Diviner/index.d.cts.map +1 -1
  9. package/dist/browser/Diviner/index.d.mts +2 -2
  10. package/dist/browser/Diviner/index.d.mts.map +1 -1
  11. package/dist/browser/Diviner/index.d.ts +2 -2
  12. package/dist/browser/Diviner/index.d.ts.map +1 -1
  13. package/dist/browser/Plugin.d.cts +2 -2
  14. package/dist/browser/Plugin.d.cts.map +1 -1
  15. package/dist/browser/Plugin.d.mts +2 -2
  16. package/dist/browser/Plugin.d.mts.map +1 -1
  17. package/dist/browser/Plugin.d.ts +2 -2
  18. package/dist/browser/Plugin.d.ts.map +1 -1
  19. package/dist/browser/index.cjs.map +1 -1
  20. package/dist/browser/index.d.cts +2 -2
  21. package/dist/browser/index.d.cts.map +1 -1
  22. package/dist/browser/index.d.mts +2 -2
  23. package/dist/browser/index.d.mts.map +1 -1
  24. package/dist/browser/index.d.ts +2 -2
  25. package/dist/browser/index.d.ts.map +1 -1
  26. package/dist/browser/index.js.map +1 -1
  27. package/dist/neutral/Diviner/Diviner.d.cts +1 -1
  28. package/dist/neutral/Diviner/Diviner.d.cts.map +1 -1
  29. package/dist/neutral/Diviner/Diviner.d.mts +1 -1
  30. package/dist/neutral/Diviner/Diviner.d.mts.map +1 -1
  31. package/dist/neutral/Diviner/Diviner.d.ts +1 -1
  32. package/dist/neutral/Diviner/Diviner.d.ts.map +1 -1
  33. package/dist/neutral/Diviner/index.d.cts +2 -2
  34. package/dist/neutral/Diviner/index.d.cts.map +1 -1
  35. package/dist/neutral/Diviner/index.d.mts +2 -2
  36. package/dist/neutral/Diviner/index.d.mts.map +1 -1
  37. package/dist/neutral/Diviner/index.d.ts +2 -2
  38. package/dist/neutral/Diviner/index.d.ts.map +1 -1
  39. package/dist/neutral/Plugin.d.cts +2 -2
  40. package/dist/neutral/Plugin.d.cts.map +1 -1
  41. package/dist/neutral/Plugin.d.mts +2 -2
  42. package/dist/neutral/Plugin.d.mts.map +1 -1
  43. package/dist/neutral/Plugin.d.ts +2 -2
  44. package/dist/neutral/Plugin.d.ts.map +1 -1
  45. package/dist/neutral/index.cjs.map +1 -1
  46. package/dist/neutral/index.d.cts +2 -2
  47. package/dist/neutral/index.d.cts.map +1 -1
  48. package/dist/neutral/index.d.mts +2 -2
  49. package/dist/neutral/index.d.mts.map +1 -1
  50. package/dist/neutral/index.d.ts +2 -2
  51. package/dist/neutral/index.d.ts.map +1 -1
  52. package/dist/neutral/index.js.map +1 -1
  53. package/dist/node/Diviner/Diviner.d.cts +1 -1
  54. package/dist/node/Diviner/Diviner.d.cts.map +1 -1
  55. package/dist/node/Diviner/Diviner.d.mts +1 -1
  56. package/dist/node/Diviner/Diviner.d.mts.map +1 -1
  57. package/dist/node/Diviner/Diviner.d.ts +1 -1
  58. package/dist/node/Diviner/Diviner.d.ts.map +1 -1
  59. package/dist/node/Diviner/index.d.cts +2 -2
  60. package/dist/node/Diviner/index.d.cts.map +1 -1
  61. package/dist/node/Diviner/index.d.mts +2 -2
  62. package/dist/node/Diviner/index.d.mts.map +1 -1
  63. package/dist/node/Diviner/index.d.ts +2 -2
  64. package/dist/node/Diviner/index.d.ts.map +1 -1
  65. package/dist/node/Plugin.d.cts +2 -2
  66. package/dist/node/Plugin.d.cts.map +1 -1
  67. package/dist/node/Plugin.d.mts +2 -2
  68. package/dist/node/Plugin.d.mts.map +1 -1
  69. package/dist/node/Plugin.d.ts +2 -2
  70. package/dist/node/Plugin.d.ts.map +1 -1
  71. package/dist/node/index.cjs.map +1 -1
  72. package/dist/node/index.d.cts +2 -2
  73. package/dist/node/index.d.cts.map +1 -1
  74. package/dist/node/index.d.mts +2 -2
  75. package/dist/node/index.d.mts.map +1 -1
  76. package/dist/node/index.d.ts +2 -2
  77. package/dist/node/index.d.ts.map +1 -1
  78. package/dist/node/index.js.map +1 -1
  79. package/package.json +14 -14
  80. package/src/Diviner/Diviner.ts +1 -1
  81. package/src/Diviner/index.ts +2 -2
  82. package/src/Plugin.ts +1 -1
  83. package/src/index.ts +2 -2
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import { DivinerModule, DivinerParams } from '@xyo-network/diviner-model';
3
3
  import { AnyConfigSchema } from '@xyo-network/module-model';
4
4
  import { Payload, Schema } from '@xyo-network/payload-model';
5
- import { LocationCertaintyDivinerConfig } from './Config';
5
+ import { LocationCertaintyDivinerConfig } from './Config.js';
6
6
  export type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>;
7
7
  export declare class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams> extends AbstractDiviner<TParam> implements DivinerModule {
8
8
  static readonly configSchemas: Schema[];
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAKzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,8BAA8B,EAAwC,MAAM,UAAU,CAAA;AAE/F,MAAM,MAAM,8BAA8B,GAAG,aAAa,CA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AAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4BjF"}
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import { DivinerModule, DivinerParams } from '@xyo-network/diviner-model';
3
3
  import { AnyConfigSchema } from '@xyo-network/module-model';
4
4
  import { Payload, Schema } from '@xyo-network/payload-model';
5
- import { LocationCertaintyDivinerConfig } from './Config';
5
+ import { LocationCertaintyDivinerConfig } from './Config.js';
6
6
  export type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>;
7
7
  export declare class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams> extends AbstractDiviner<TParam> implements DivinerModule {
8
8
  static readonly configSchemas: Schema[];
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAKzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,8BAA8B,EAAwC,MAAM,UAAU,CAAA;AAE/F,MAAM,MAAM,8BAA8B,GAAG,aAAa,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC,CAAA;AAE3G,qBAAa,wBAAwB,CAAC,MAAM,SAAS,8BAA8B,GAAG,8BAA8B,CAClH,SAAQ,eAAe,CAAC,MAAM,CAC9B,YAAW,aAAa;IAExB,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAiE;IACjH,gBAAyB,mBAAmB,EAAE,MAAM,CAAuC;IAC3F,OAAgB,YAAY,mCAA0B;IAGtD,OAAO,CAAC,MAAM,CAAC,aAAa;IAgC5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;cAoBX,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4BjF"}
1
+ {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAKzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,8BAA8B,EAAwC,MAAM,aAAa,CAAA;AAElG,MAAM,MAAM,8BAA8B,GAAG,aAAa,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC,CAAA;AAE3G,qBAAa,wBAAwB,CAAC,MAAM,SAAS,8BAA8B,GAAG,8BAA8B,CAClH,SAAQ,eAAe,CAAC,MAAM,CAC9B,YAAW,aAAa;IAExB,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAiE;IACjH,gBAAyB,mBAAmB,EAAE,MAAM,CAAuC;IAC3F,OAAgB,YAAY,mCAA0B;IAGtD,OAAO,CAAC,MAAM,CAAC,aAAa;IAgC5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;cAoBX,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4BjF"}
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import { DivinerModule, DivinerParams } from '@xyo-network/diviner-model';
3
3
  import { AnyConfigSchema } from '@xyo-network/module-model';
4
4
  import { Payload, Schema } from '@xyo-network/payload-model';
5
- import { LocationCertaintyDivinerConfig } from './Config';
5
+ import { LocationCertaintyDivinerConfig } from './Config.js';
6
6
  export type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>;
7
7
  export declare class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams> extends AbstractDiviner<TParam> implements DivinerModule {
8
8
  static readonly configSchemas: Schema[];
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAKzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,8BAA8B,EAAwC,MAAM,UAAU,CAAA;AAE/F,MAAM,MAAM,8BAA8B,GAAG,aAAa,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC,CAAA;AAE3G,qBAAa,wBAAwB,CAAC,MAAM,SAAS,8BAA8B,GAAG,8BAA8B,CAClH,SAAQ,eAAe,CAAC,MAAM,CAC9B,YAAW,aAAa;IAExB,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAiE;IACjH,gBAAyB,mBAAmB,EAAE,MAAM,CAAuC;IAC3F,OAAgB,YAAY,mCAA0B;IAGtD,OAAO,CAAC,MAAM,CAAC,aAAa;IAgC5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;cAoBX,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4BjF"}
1
+ {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAKzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,8BAA8B,EAAwC,MAAM,aAAa,CAAA;AAElG,MAAM,MAAM,8BAA8B,GAAG,aAAa,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC,CAAA;AAE3G,qBAAa,wBAAwB,CAAC,MAAM,SAAS,8BAA8B,GAAG,8BAA8B,CAClH,SAAQ,eAAe,CAAC,MAAM,CAC9B,YAAW,aAAa;IAExB,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAiE;IACjH,gBAAyB,mBAAmB,EAAE,MAAM,CAAuC;IAC3F,OAAgB,YAAY,mCAA0B;IAGtD,OAAO,CAAC,MAAM,CAAC,aAAa;IAgC5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;cAoBX,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4BjF"}
@@ -1,3 +1,3 @@
1
- export * from './Config';
2
- export * from './Diviner';
1
+ export * from './Config.js';
2
+ export * from './Diviner.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './Config';
2
- export * from './Diviner';
1
+ export * from './Config.js';
2
+ export * from './Diviner.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './Config';
2
- export * from './Diviner';
1
+ export * from './Config.js';
2
+ export * from './Diviner.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin';
2
- import { LocationCertaintyDiviner } from './Diviner';
2
+ import { LocationCertaintyDiviner } from './Diviner/index.js';
3
3
  export declare const LocationCertaintyPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<LocationCertaintyDiviner<import("@xylabs/object").BaseParamsFields & {
4
4
  account?: import("@xyo-network/account-model").AccountInstance | "random";
5
5
  addToResolvers?: boolean;
@@ -10,7 +10,7 @@ export declare const LocationCertaintyPlugin: () => import("@xyo-network/payload
10
10
  } & {
11
11
  schema: string;
12
12
  } & import("@xyo-network/payload-model").PayloadFields & {
13
- schema: import("./Diviner").LocationCertaintyDivinerConfigSchema;
13
+ schema: import("./Diviner/Config.js").LocationCertaintyDivinerConfigSchema;
14
14
  targetSchema?: LocationCertaintySchema;
15
15
  }, "schema"> & {
16
16
  schema: "network.xyo.location.elevation.diviner.config";
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin';
2
- import { LocationCertaintyDiviner } from './Diviner';
2
+ import { LocationCertaintyDiviner } from './Diviner/index.js';
3
3
  export declare const LocationCertaintyPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<LocationCertaintyDiviner<import("@xylabs/object").BaseParamsFields & {
4
4
  account?: import("@xyo-network/account-model").AccountInstance | "random";
5
5
  addToResolvers?: boolean;
@@ -10,7 +10,7 @@ export declare const LocationCertaintyPlugin: () => import("@xyo-network/payload
10
10
  } & {
11
11
  schema: string;
12
12
  } & import("@xyo-network/payload-model").PayloadFields & {
13
- schema: import("./Diviner").LocationCertaintyDivinerConfigSchema;
13
+ schema: import("./Diviner/Config.js").LocationCertaintyDivinerConfigSchema;
14
14
  targetSchema?: LocationCertaintySchema;
15
15
  }, "schema"> & {
16
16
  schema: "network.xyo.location.elevation.diviner.config";
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin';
2
- import { LocationCertaintyDiviner } from './Diviner';
2
+ import { LocationCertaintyDiviner } from './Diviner/index.js';
3
3
  export declare const LocationCertaintyPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<LocationCertaintyDiviner<import("@xylabs/object").BaseParamsFields & {
4
4
  account?: import("@xyo-network/account-model").AccountInstance | "random";
5
5
  addToResolvers?: boolean;
@@ -10,7 +10,7 @@ export declare const LocationCertaintyPlugin: () => import("@xyo-network/payload
10
10
  } & {
11
11
  schema: string;
12
12
  } & import("@xyo-network/payload-model").PayloadFields & {
13
- schema: import("./Diviner").LocationCertaintyDivinerConfigSchema;
13
+ schema: import("./Diviner/Config.js").LocationCertaintyDivinerConfigSchema;
14
14
  targetSchema?: LocationCertaintySchema;
15
15
  }, "schema"> & {
16
16
  schema: "network.xyo.location.elevation.diviner.config";
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Diviner/Config.ts","../../src/Diviner/Diviner.ts","../../src/Plugin.ts"],"sourcesContent":["export * from './Diviner'\n// eslint-disable-next-line import/no-default-export\nexport { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin'\n","import { DivinerConfig } from '@xyo-network/diviner-model'\nimport { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\nexport const LocationCertaintyDivinerConfigSchema: LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\n\nexport type LocationCertaintyDivinerConfig<TConfig extends Payload = Payload> = DivinerConfig<\n TConfig & {\n schema: LocationCertaintyDivinerConfigSchema\n targetSchema?: LocationCertaintySchema\n }\n>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerModule, DivinerParams } from '@xyo-network/diviner-model'\nimport { ElevationPayload } from '@xyo-network/elevation-payload-plugin'\nimport { ElevationWitness, ElevationWitnessConfigSchema } from '@xyo-network/elevation-plugin'\nimport { LocationCertaintyHeuristic, LocationCertaintyPayload, LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { LocationCertaintyDivinerConfig, LocationCertaintyDivinerConfigSchema } from './Config'\n\nexport type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>\n\nexport class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams>\n extends AbstractDiviner<TParam>\n implements DivinerModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, LocationCertaintyDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = LocationCertaintyDivinerConfigSchema\n static override targetSchema = LocationCertaintySchema\n\n /* Given an array of numbers, find the min/max/mean */\n private static calcHeuristic(heuristic: (number | null)[]): LocationCertaintyHeuristic {\n return {\n // eslint-disable-next-line unicorn/no-array-reduce\n max: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value > prev ? value\n : prev\n )\n }, Number.NEGATIVE_INFINITY),\n mean: (() => {\n // eslint-disable-next-line unicorn/no-array-reduce\n const values = heuristic.reduce<number[]>(\n (prev, value) => {\n return value === null ? prev : [value + prev[0], prev[1] + 1]\n },\n [0, 0],\n )\n return values[0] / values[1]\n })(),\n // eslint-disable-next-line unicorn/no-array-reduce\n min: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value < prev ? value\n : prev\n )\n }, Number.POSITIVE_INFINITY),\n }\n }\n\n /* Given elevation and location payloads, generate heuristic arrays */\n private static locationsToHeuristics(elevations: ElevationPayload[], locations: LocationPayload[]) {\n // eslint-disable-next-line unicorn/no-array-reduce\n const heuristics = elevations.reduce<{ altitude: (number | null)[]; elevation: number[]; variance: (number | null)[] }>(\n (prev, elev, index) => {\n const elevation = elev.elevation\n if (elevation === undefined || elevation === null) {\n throw new Error('Invalid Elevation')\n }\n const altitude = locations[index].altitude\n prev.altitude.push(altitude ?? null)\n prev.elevation.push(elevation)\n prev.variance.push(altitude !== undefined && altitude !== null ? altitude - elevation : null)\n return prev\n },\n { altitude: [], elevation: [], variance: [] },\n )\n return heuristics\n }\n\n /** @description Given a set of locations, get the expected elevations (witness if needed), and return score/variance */\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const locations = payloads?.filter<LocationPayload>((payload): payload is LocationPayload => payload?.schema === LocationSchema)\n // If this is a query we support\n if (locations && locations?.length > 0) {\n const elevationWitness = await ElevationWitness.create({\n account: this.account,\n config: {\n locations,\n schema: ElevationWitnessConfigSchema,\n },\n })\n const elevations = (await elevationWitness.observe()) as ElevationPayload[]\n\n const heuristics = LocationCertaintyDiviner.locationsToHeuristics(elevations, locations)\n\n const result = await new PayloadBuilder<LocationCertaintyPayload>({ schema: LocationCertaintySchema })\n .fields({\n altitude: LocationCertaintyDiviner.calcHeuristic(heuristics.altitude),\n elevation: LocationCertaintyDiviner.calcHeuristic(heuristics.elevation),\n variance: LocationCertaintyDiviner.calcHeuristic(heuristics.variance),\n })\n .build()\n\n this.logger?.log('LocationCertaintyDiviner.Divine: Processed query')\n return [result]\n }\n return []\n }\n}\n","import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { LocationCertaintyDiviner } from './Diviner'\n\nexport const LocationCertaintyPlugin = () =>\n createPayloadSetDivinerPlugin<LocationCertaintyDiviner>(\n { required: { [LocationCertaintySchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await LocationCertaintyDiviner.create(params)) as LocationCertaintyDiviner\n },\n },\n )\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,uCAA6E;;;ACL1F,8BAAgC;AAGhC,8BAA+D;AAC/D,+CAA8F;AAC9F,qCAAgD;AAEhD,6BAA+B;AAOxB,IAAM,2BAAN,MAAM,kCACH,wCAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,oCAAoC;AAAA,EAChH,OAAyB,sBAA8B;AAAA,EACvD,OAAgB,eAAe;AAAA;AAAA,EAG/B,OAAe,cAAc,WAA0D;AACrF,WAAO;AAAA;AAAA,M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AAM,yCAAiB,OAAO;AAAA,QACrD,SAAS,KAAK;AAAA,QACd,QAAQ;AAAA,UACN;AAAA,UACA,QAAQ;AAAA,QACV;AAAA,MACF,CAAC;AACD,YAAM,aAAc,MAAM,iBAAiB,QAAQ;AAEnD,YAAM,aAAa,0BAAyB,sBAAsB,YAAY,SAAS;AAEvF,YAAM,SAAS,MAAM,IAAI,sCAAyC,EAAE,QAAQ,iEAAwB,CAAC,EAClG,OAAO;AAAA,QACN,UAAU,0BAAyB,cAAc,WAAW,QAAQ;AAAA,QACpE,WAAW,0BAAyB,cAAc,WAAW,SAAS;AAAA,QACtE,UAAU,0BAAyB,cAAc,WAAW,QAAQ;AAAA,MACtE,CAAC,EACA,MAAM;AAET,WAAK,QAAQ,IAAI,kDAAkD;AACnE,aAAO,CAAC,MAAM;AAAA,IAChB;AACA,WAAO,CAAC;AAAA,EACV;AACF;;;ACvGA,IAAAA,4CAAwC;AACxC,2BAAiC;AACjC,+BAA8C;AAIvC,IAAM,0BAA0B,UACrC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,iEAAuB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACvE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,yBAAyB,OAAO,MAAM;AAAA,IACtD;AAAA,EACF;AACF;","names":["import_location_certainty_payload_plugin"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Diviner/Config.ts","../../src/Diviner/Diviner.ts","../../src/Plugin.ts"],"sourcesContent":["export * from './Diviner/index.js'\n// eslint-disable-next-line import/no-default-export\nexport { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin.js'\n","import { DivinerConfig } from '@xyo-network/diviner-model'\nimport { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\nexport const LocationCertaintyDivinerConfigSchema: LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\n\nexport type LocationCertaintyDivinerConfig<TConfig extends Payload = Payload> = DivinerConfig<\n TConfig & {\n schema: LocationCertaintyDivinerConfigSchema\n targetSchema?: LocationCertaintySchema\n }\n>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerModule, DivinerParams } from '@xyo-network/diviner-model'\nimport { ElevationPayload } from '@xyo-network/elevation-payload-plugin'\nimport { ElevationWitness, ElevationWitnessConfigSchema } from '@xyo-network/elevation-plugin'\nimport { LocationCertaintyHeuristic, LocationCertaintyPayload, LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { LocationCertaintyDivinerConfig, LocationCertaintyDivinerConfigSchema } from './Config.js'\n\nexport type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>\n\nexport class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams>\n extends AbstractDiviner<TParam>\n implements DivinerModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, LocationCertaintyDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = LocationCertaintyDivinerConfigSchema\n static override targetSchema = LocationCertaintySchema\n\n /* Given an array of numbers, find the min/max/mean */\n private static calcHeuristic(heuristic: (number | null)[]): LocationCertaintyHeuristic {\n return {\n // eslint-disable-next-line unicorn/no-array-reduce\n max: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value > prev ? value\n : prev\n )\n }, Number.NEGATIVE_INFINITY),\n mean: (() => {\n // eslint-disable-next-line unicorn/no-array-reduce\n const values = heuristic.reduce<number[]>(\n (prev, value) => {\n return value === null ? prev : [value + prev[0], prev[1] + 1]\n },\n [0, 0],\n )\n return values[0] / values[1]\n })(),\n // eslint-disable-next-line unicorn/no-array-reduce\n min: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value < prev ? value\n : prev\n )\n }, Number.POSITIVE_INFINITY),\n }\n }\n\n /* Given elevation and location payloads, generate heuristic arrays */\n private static locationsToHeuristics(elevations: ElevationPayload[], locations: LocationPayload[]) {\n // eslint-disable-next-line unicorn/no-array-reduce\n const heuristics = elevations.reduce<{ altitude: (number | null)[]; elevation: number[]; variance: (number | null)[] }>(\n (prev, elev, index) => {\n const elevation = elev.elevation\n if (elevation === undefined || elevation === null) {\n throw new Error('Invalid Elevation')\n }\n const altitude = locations[index].altitude\n prev.altitude.push(altitude ?? null)\n prev.elevation.push(elevation)\n prev.variance.push(altitude !== undefined && altitude !== null ? altitude - elevation : null)\n return prev\n },\n { altitude: [], elevation: [], variance: [] },\n )\n return heuristics\n }\n\n /** @description Given a set of locations, get the expected elevations (witness if needed), and return score/variance */\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const locations = payloads?.filter<LocationPayload>((payload): payload is LocationPayload => payload?.schema === LocationSchema)\n // If this is a query we support\n if (locations && locations?.length > 0) {\n const elevationWitness = await ElevationWitness.create({\n account: this.account,\n config: {\n locations,\n schema: ElevationWitnessConfigSchema,\n },\n })\n const elevations = (await elevationWitness.observe()) as ElevationPayload[]\n\n const heuristics = LocationCertaintyDiviner.locationsToHeuristics(elevations, locations)\n\n const result = await new PayloadBuilder<LocationCertaintyPayload>({ schema: LocationCertaintySchema })\n .fields({\n altitude: LocationCertaintyDiviner.calcHeuristic(heuristics.altitude),\n elevation: LocationCertaintyDiviner.calcHeuristic(heuristics.elevation),\n variance: LocationCertaintyDiviner.calcHeuristic(heuristics.variance),\n })\n .build()\n\n this.logger?.log('LocationCertaintyDiviner.Divine: Processed query')\n return [result]\n }\n return []\n }\n}\n","import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { LocationCertaintyDiviner } from './Diviner/index.js'\n\nexport const LocationCertaintyPlugin = () =>\n createPayloadSetDivinerPlugin<LocationCertaintyDiviner>(\n { required: { [LocationCertaintySchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await LocationCertaintyDiviner.create(params)) as LocationCertaintyDiviner\n },\n },\n )\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,uCAA6E;;;ACL1F,8BAAgC;AAGhC,8BAA+D;AAC/D,+CAA8F;AAC9F,qCAAgD;AAEhD,6BAA+B;AAOxB,IAAM,2BAAN,MAAM,kCACH,wCAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,oCAAoC;AAAA,EAChH,OAAyB,sBAA8B;AAAA,EACvD,OAAgB,eAAe;AAAA;AAAA,EAG/B,OAAe,cAAc,WAA0D;AACrF,WAAO;AAAA;AAAA,MAEL,KAAK,UAAU,OAAe,CAAC,MAAM,UAAU;AAC7C,eACE,UAAU,OAAO,OACf,QAAQ,OAAO,QACf;AAAA,MAEN,GAAG,OAAO,iBAAiB;AAAA,MAC3B,OAAO,MAAM;AAEX,cAAM,SAAS,UAAU;AAAA,UACvB,CAAC,MAAM,UAAU;AACf,mBAAO,UAAU,OAAO,OAAO,CAAC,QAAQ,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;AAAA,UAC9D;AAAA,UACA,CAAC,GAAG,CAAC;AAAA,QACP;AACA,eAAO,OAAO,CAAC,IAAI,OAAO,CAAC;AAAA,MAC7B,GAAG;AAAA;AAAA,MAEH,KAAK,UAAU,OAAe,CAAC,MAAM,UAAU;AAC7C,eACE,UAAU,OAAO,OACf,QAAQ,OAAO,QACf;AAAA,MAEN,GAAG,OAAO,iBAAiB;AAAA,IAC7B;AAAA,EACF;AA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IAAAA,4CAAwC;AACxC,2BAAiC;AACjC,+BAA8C;AAIvC,IAAM,0BAA0B,UACrC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,iEAAuB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACvE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,yBAAyB,OAAO,MAAM;AAAA,IACtD;AAAA,EACF;AACF;","names":["import_location_certainty_payload_plugin"]}
@@ -1,3 +1,3 @@
1
- export * from './Diviner';
2
- export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin';
1
+ export * from './Diviner/index.js';
2
+ export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAElC,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './Diviner';
2
- export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin';
1
+ export * from './Diviner/index.js';
2
+ export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAElC,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './Diviner';
2
- export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin';
1
+ export * from './Diviner/index.js';
2
+ export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAElC,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Diviner/Config.ts","../../src/Diviner/Diviner.ts","../../src/Plugin.ts"],"sourcesContent":["import { DivinerConfig } from '@xyo-network/diviner-model'\nimport { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\nexport const LocationCertaintyDivinerConfigSchema: LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\n\nexport type LocationCertaintyDivinerConfig<TConfig extends Payload = Payload> = DivinerConfig<\n TConfig & {\n schema: LocationCertaintyDivinerConfigSchema\n targetSchema?: LocationCertaintySchema\n }\n>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerModule, DivinerParams } from '@xyo-network/diviner-model'\nimport { ElevationPayload } from '@xyo-network/elevation-payload-plugin'\nimport { ElevationWitness, ElevationWitnessConfigSchema } from '@xyo-network/elevation-plugin'\nimport { LocationCertaintyHeuristic, LocationCertaintyPayload, LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { LocationCertaintyDivinerConfig, LocationCertaintyDivinerConfigSchema } from './Config'\n\nexport type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>\n\nexport class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams>\n extends AbstractDiviner<TParam>\n implements DivinerModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, LocationCertaintyDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = LocationCertaintyDivinerConfigSchema\n static override targetSchema = LocationCertaintySchema\n\n /* Given an array of numbers, find the min/max/mean */\n private static calcHeuristic(heuristic: (number | null)[]): LocationCertaintyHeuristic {\n return {\n // eslint-disable-next-line unicorn/no-array-reduce\n max: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value > prev ? value\n : prev\n )\n }, Number.NEGATIVE_INFINITY),\n mean: (() => {\n // eslint-disable-next-line unicorn/no-array-reduce\n const values = heuristic.reduce<number[]>(\n (prev, value) => {\n return value === null ? prev : [value + prev[0], prev[1] + 1]\n },\n [0, 0],\n )\n return values[0] / values[1]\n })(),\n // eslint-disable-next-line unicorn/no-array-reduce\n min: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value < prev ? value\n : prev\n )\n }, Number.POSITIVE_INFINITY),\n }\n }\n\n /* Given elevation and location payloads, generate heuristic arrays */\n private static locationsToHeuristics(elevations: ElevationPayload[], locations: LocationPayload[]) {\n // eslint-disable-next-line unicorn/no-array-reduce\n const heuristics = elevations.reduce<{ altitude: (number | null)[]; elevation: number[]; variance: (number | null)[] }>(\n (prev, elev, index) => {\n const elevation = elev.elevation\n if (elevation === undefined || elevation === null) {\n throw new Error('Invalid Elevation')\n }\n const altitude = locations[index].altitude\n prev.altitude.push(altitude ?? null)\n prev.elevation.push(elevation)\n prev.variance.push(altitude !== undefined && altitude !== null ? altitude - elevation : null)\n return prev\n },\n { altitude: [], elevation: [], variance: [] },\n )\n return heuristics\n }\n\n /** @description Given a set of locations, get the expected elevations (witness if needed), and return score/variance */\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const locations = payloads?.filter<LocationPayload>((payload): payload is LocationPayload => payload?.schema === LocationSchema)\n // If this is a query we support\n if (locations && locations?.length > 0) {\n const elevationWitness = await ElevationWitness.create({\n account: this.account,\n config: {\n locations,\n schema: ElevationWitnessConfigSchema,\n },\n })\n const elevations = (await elevationWitness.observe()) as ElevationPayload[]\n\n const heuristics = LocationCertaintyDiviner.locationsToHeuristics(elevations, locations)\n\n const result = await new PayloadBuilder<LocationCertaintyPayload>({ schema: LocationCertaintySchema })\n .fields({\n altitude: LocationCertaintyDiviner.calcHeuristic(heuristics.altitude),\n elevation: LocationCertaintyDiviner.calcHeuristic(heuristics.elevation),\n variance: LocationCertaintyDiviner.calcHeuristic(heuristics.variance),\n })\n .build()\n\n this.logger?.log('LocationCertaintyDiviner.Divine: Processed query')\n return [result]\n }\n return []\n }\n}\n","import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { LocationCertaintyDiviner } from './Diviner'\n\nexport const LocationCertaintyPlugin = () =>\n createPayloadSetDivinerPlugin<LocationCertaintyDiviner>(\n { required: { [LocationCertaintySchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await LocationCertaintyDiviner.create(params)) as LocationCerta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intySchema","LocationCertaintySchema"]}
1
+ {"version":3,"sources":["../../src/Diviner/Config.ts","../../src/Diviner/Diviner.ts","../../src/Plugin.ts"],"sourcesContent":["import { DivinerConfig } from '@xyo-network/diviner-model'\nimport { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\nexport const LocationCertaintyDivinerConfigSchema: LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\n\nexport type LocationCertaintyDivinerConfig<TConfig extends Payload = Payload> = DivinerConfig<\n TConfig & {\n schema: LocationCertaintyDivinerConfigSchema\n targetSchema?: LocationCertaintySchema\n }\n>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerModule, DivinerParams } from '@xyo-network/diviner-model'\nimport { ElevationPayload } from '@xyo-network/elevation-payload-plugin'\nimport { ElevationWitness, ElevationWitnessConfigSchema } from '@xyo-network/elevation-plugin'\nimport { LocationCertaintyHeuristic, LocationCertaintyPayload, LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { LocationCertaintyDivinerConfig, LocationCertaintyDivinerConfigSchema } from './Config.js'\n\nexport type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>\n\nexport class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams>\n extends AbstractDiviner<TParam>\n implements DivinerModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, LocationCertaintyDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = LocationCertaintyDivinerConfigSchema\n static override targetSchema = LocationCertaintySchema\n\n /* Given an array of numbers, find the min/max/mean */\n private static calcHeuristic(heuristic: (number | null)[]): LocationCertaintyHeuristic {\n return {\n // eslint-disable-next-line unicorn/no-array-reduce\n max: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value > prev ? value\n : prev\n )\n }, Number.NEGATIVE_INFINITY),\n mean: (() => {\n // eslint-disable-next-line unicorn/no-array-reduce\n const values = heuristic.reduce<number[]>(\n (prev, value) => {\n return value === null ? prev : [value + prev[0], prev[1] + 1]\n },\n [0, 0],\n )\n return values[0] / values[1]\n })(),\n // eslint-disable-next-line unicorn/no-array-reduce\n min: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value < prev ? value\n : prev\n )\n }, Number.POSITIVE_INFINITY),\n }\n }\n\n /* Given elevation and location payloads, generate heuristic arrays */\n private static locationsToHeuristics(elevations: ElevationPayload[], locations: LocationPayload[]) {\n // eslint-disable-next-line unicorn/no-array-reduce\n const heuristics = elevations.reduce<{ altitude: (number | null)[]; elevation: number[]; variance: (number | null)[] }>(\n (prev, elev, index) => {\n const elevation = elev.elevation\n if (elevation === undefined || elevation === null) {\n throw new Error('Invalid Elevation')\n }\n const altitude = locations[index].altitude\n prev.altitude.push(altitude ?? null)\n prev.elevation.push(elevation)\n prev.variance.push(altitude !== undefined && altitude !== null ? altitude - elevation : null)\n return prev\n },\n { altitude: [], elevation: [], variance: [] },\n )\n return heuristics\n }\n\n /** @description Given a set of locations, get the expected elevations (witness if needed), and return score/variance */\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const locations = payloads?.filter<LocationPayload>((payload): payload is LocationPayload => payload?.schema === LocationSchema)\n // If this is a query we support\n if (locations && locations?.length > 0) {\n const elevationWitness = await ElevationWitness.create({\n account: this.account,\n config: {\n locations,\n schema: ElevationWitnessConfigSchema,\n },\n })\n const elevations = (await elevationWitness.observe()) as ElevationPayload[]\n\n const heuristics = LocationCertaintyDiviner.locationsToHeuristics(elevations, locations)\n\n const result = await new PayloadBuilder<LocationCertaintyPayload>({ schema: LocationCertaintySchema })\n .fields({\n altitude: LocationCertaintyDiviner.calcHeuristic(heuristics.altitude),\n elevation: LocationCertaintyDiviner.calcHeuristic(heuristics.elevation),\n variance: LocationCertaintyDiviner.calcHeuristic(heuristics.variance),\n })\n .build()\n\n this.logger?.log('LocationCertaintyDiviner.Divine: Processed query')\n return [result]\n }\n return []\n }\n}\n","import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { LocationCertaintyDiviner } from './Diviner/index.js'\n\nexport const LocationCertaintyPlugin = () =>\n createPayloadSetDivinerPlugin<LocationCertaintyDiviner>(\n { required: { [LocationCertaintySchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await LocationCertaintyDiviner.create(params)) as LocationCertaintyDiviner\n },\n },\n )\n"],"mappings":";AAKO,IAAM,uCAA6E;;;ACL1F,SAAS,uBAAuB;AAGhC,SAAS,kBAAkB,oCAAoC;AAC/D,SAA+D,+BAA+B;AAC9F,SAA0B,sBAAsB;AAEhD,SAAS,sBAAsB;AAOxB,IAAM,2BAAN,MAAM,kCACH,gBAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,oCAAoC;AAAA,EAChH,OAAyB,sBAA8B;AAAA,EACvD,OAAgB,eAAe;AAAA;AAAA,EAG/B,OAAe,cAAc,WAA0D;AACrF,WAAO;AAAA;AAAA,MAEL,KAAK,UAAU,OAAe,CAAC,MAAM,UAAU;AAC7C,eACE,UAAU,OAAO,OACf,QAAQ,OAAO,QACf;AAAA,MAEN,GAAG,OAAO,iBAAiB;AAAA,MAC3B,OAAO,MAAM;AAEX,cAAM,SAAS,UAAU;AAAA,UACvB,CAAC,MAAM,UAAU;AACf,mBAAO,UAAU,OAAO,OAAO,CAAC,QAAQ,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAA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AAA,QACN,UAAU,0BAAyB,cAAc,WAAW,QAAQ;AAAA,QACpE,WAAW,0BAAyB,cAAc,WAAW,SAAS;AAAA,QACtE,UAAU,0BAAyB,cAAc,WAAW,QAAQ;AAAA,MACtE,CAAC,EACA,MAAM;AAET,WAAK,QAAQ,IAAI,kDAAkD;AACnE,aAAO,CAAC,MAAM;AAAA,IAChB;AACA,WAAO,CAAC;AAAA,EACV;AACF;;;ACvGA,SAAS,2BAAAA,gCAA+B;AACxC,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;AAIvC,IAAM,0BAA0B,MACrC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,wBAAuB,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACvE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,yBAAyB,OAAO,MAAM;AAAA,IACtD;AAAA,EACF;AACF;","names":["LocationCertaintySchema","LocationCertaintySchema"]}
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import { DivinerModule, DivinerParams } from '@xyo-network/diviner-model';
3
3
  import { AnyConfigSchema } from '@xyo-network/module-model';
4
4
  import { Payload, Schema } from '@xyo-network/payload-model';
5
- import { LocationCertaintyDivinerConfig } from './Config';
5
+ import { LocationCertaintyDivinerConfig } from './Config.js';
6
6
  export type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>;
7
7
  export declare class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams> extends AbstractDiviner<TParam> implements DivinerModule {
8
8
  static readonly configSchemas: Schema[];
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAKz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Aa,EAAE,MAAM,EAAE,CAAiE;IACjH,gBAAyB,mBAAmB,EAAE,MAAM,CAAuC;IAC3F,OAAgB,YAAY,mCAA0B;IAGtD,OAAO,CAAC,MAAM,CAAC,aAAa;IAgC5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;cAoBX,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4BjF"}
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import { DivinerModule, DivinerParams } from '@xyo-network/diviner-model';
3
3
  import { AnyConfigSchema } from '@xyo-network/module-model';
4
4
  import { Payload, Schema } from '@xyo-network/payload-model';
5
- import { LocationCertaintyDivinerConfig } from './Config';
5
+ import { LocationCertaintyDivinerConfig } from './Config.js';
6
6
  export type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>;
7
7
  export declare class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams> extends AbstractDiviner<TParam> implements DivinerModule {
8
8
  static readonly configSchemas: Schema[];
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAKzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,8BAA8B,EAAwC,MAAM,UAAU,CAAA;AAE/F,MAAM,MAAM,8BAA8B,GAAG,aAAa,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC,CAAA;AAE3G,qBAAa,wBAAwB,CAAC,MAAM,SAAS,8BAA8B,GAAG,8BAA8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'@xyo-network/diviner-abstract';
2
2
  import { DivinerModule, DivinerParams } from '@xyo-network/diviner-model';
3
3
  import { AnyConfigSchema } from '@xyo-network/module-model';
4
4
  import { Payload, Schema } from '@xyo-network/payload-model';
5
- import { LocationCertaintyDivinerConfig } from './Config';
5
+ import { LocationCertaintyDivinerConfig } from './Config.js';
6
6
  export type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>;
7
7
  export declare class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams> extends AbstractDiviner<TParam> implements DivinerModule {
8
8
  static readonly configSchemas: Schema[];
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAKzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,8BAA8B,EAAwC,MAAM,UAAU,CAAA;AAE/F,MAAM,MAAM,8BAA8B,GAAG,aAAa,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC,CAAA;AAE3G,qBAAa,wBAAwB,CAAC,MAAM,SAAS,8BAA8B,GAAG,8BAA8B,CAClH,SAAQ,eAAe,CAAC,MAAM,CAC9B,YAAW,aAAa;IAExB,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAiE;IACjH,gBAAyB,mBAAmB,EAAE,MAAM,CAAuC;IAC3F,OAAgB,YAAY,mCAA0B;IAGtD,OAAO,CAAC,MAAM,CAAC,aAAa;IAgC5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;cAoBX,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4BjF"}
1
+ {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAKzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,8BAA8B,EAAwC,MAAM,aAAa,CAAA;AAElG,MAAM,MAAM,8BAA8B,GAAG,aAAa,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC,CAAA;AAE3G,qBAAa,wBAAwB,CAAC,MAAM,SAAS,8BAA8B,GAAG,8BAA8B,CAClH,SAAQ,eAAe,CAAC,MAAM,CAC9B,YAAW,aAAa;IAExB,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAiE;IACjH,gBAAyB,mBAAmB,EAAE,MAAM,CAAuC;IAC3F,OAAgB,YAAY,mCAA0B;IAGtD,OAAO,CAAC,MAAM,CAAC,aAAa;IAgC5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;cAoBX,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4BjF"}
@@ -1,3 +1,3 @@
1
- export * from './Config';
2
- export * from './Diviner';
1
+ export * from './Config.js';
2
+ export * from './Diviner.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './Config';
2
- export * from './Diviner';
1
+ export * from './Config.js';
2
+ export * from './Diviner.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './Config';
2
- export * from './Diviner';
1
+ export * from './Config.js';
2
+ export * from './Diviner.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin';
2
- import { LocationCertaintyDiviner } from './Diviner';
2
+ import { LocationCertaintyDiviner } from './Diviner/index.js';
3
3
  export declare const LocationCertaintyPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<LocationCertaintyDiviner<import("@xylabs/object").BaseParamsFields & {
4
4
  account?: import("@xyo-network/account-model").AccountInstance | "random";
5
5
  addToResolvers?: boolean;
@@ -10,7 +10,7 @@ export declare const LocationCertaintyPlugin: () => import("@xyo-network/payload
10
10
  } & {
11
11
  schema: string;
12
12
  } & import("@xyo-network/payload-model").PayloadFields & {
13
- schema: import("./Diviner").LocationCertaintyDivinerConfigSchema;
13
+ schema: import("./Diviner/Config.js").LocationCertaintyDivinerConfigSchema;
14
14
  targetSchema?: LocationCertaintySchema;
15
15
  }, "schema"> & {
16
16
  schema: "network.xyo.location.elevation.diviner.config";
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin';
2
- import { LocationCertaintyDiviner } from './Diviner';
2
+ import { LocationCertaintyDiviner } from './Diviner/index.js';
3
3
  export declare const LocationCertaintyPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<LocationCertaintyDiviner<import("@xylabs/object").BaseParamsFields & {
4
4
  account?: import("@xyo-network/account-model").AccountInstance | "random";
5
5
  addToResolvers?: boolean;
@@ -10,7 +10,7 @@ export declare const LocationCertaintyPlugin: () => import("@xyo-network/payload
10
10
  } & {
11
11
  schema: string;
12
12
  } & import("@xyo-network/payload-model").PayloadFields & {
13
- schema: import("./Diviner").LocationCertaintyDivinerConfigSchema;
13
+ schema: import("./Diviner/Config.js").LocationCertaintyDivinerConfigSchema;
14
14
  targetSchema?: LocationCertaintySchema;
15
15
  }, "schema"> & {
16
16
  schema: "network.xyo.location.elevation.diviner.config";
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin';
2
- import { LocationCertaintyDiviner } from './Diviner';
2
+ import { LocationCertaintyDiviner } from './Diviner/index.js';
3
3
  export declare const LocationCertaintyPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<LocationCertaintyDiviner<import("@xylabs/object").BaseParamsFields & {
4
4
  account?: import("@xyo-network/account-model").AccountInstance | "random";
5
5
  addToResolvers?: boolean;
@@ -10,7 +10,7 @@ export declare const LocationCertaintyPlugin: () => import("@xyo-network/payload
10
10
  } & {
11
11
  schema: string;
12
12
  } & import("@xyo-network/payload-model").PayloadFields & {
13
- schema: import("./Diviner").LocationCertaintyDivinerConfigSchema;
13
+ schema: import("./Diviner/Config.js").LocationCertaintyDivinerConfigSchema;
14
14
  targetSchema?: LocationCertaintySchema;
15
15
  }, "schema"> & {
16
16
  schema: "network.xyo.location.elevation.diviner.config";
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Diviner/Config.ts","../../src/Diviner/Diviner.ts","../../src/Plugin.ts"],"sourcesContent":["export * from './Diviner'\n// eslint-disable-next-line import/no-default-export\nexport { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin'\n","import { DivinerConfig } from '@xyo-network/diviner-model'\nimport { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\nexport const LocationCertaintyDivinerConfigSchema: LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\n\nexport type LocationCertaintyDivinerConfig<TConfig extends Payload = Payload> = DivinerConfig<\n TConfig & {\n schema: LocationCertaintyDivinerConfigSchema\n targetSchema?: LocationCertaintySchema\n }\n>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerModule, DivinerParams } from '@xyo-network/diviner-model'\nimport { ElevationPayload } from '@xyo-network/elevation-payload-plugin'\nimport { ElevationWitness, ElevationWitnessConfigSchema } from '@xyo-network/elevation-plugin'\nimport { LocationCertaintyHeuristic, LocationCertaintyPayload, LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { LocationCertaintyDivinerConfig, LocationCertaintyDivinerConfigSchema } from './Config'\n\nexport type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>\n\nexport class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams>\n extends AbstractDiviner<TParam>\n implements DivinerModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, LocationCertaintyDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = LocationCertaintyDivinerConfigSchema\n static override targetSchema = LocationCertaintySchema\n\n /* Given an array of numbers, find the min/max/mean */\n private static calcHeuristic(heuristic: (number | null)[]): LocationCertaintyHeuristic {\n return {\n // eslint-disable-next-line unicorn/no-array-reduce\n max: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value > prev ? value\n : prev\n )\n }, Number.NEGATIVE_INFINITY),\n mean: (() => {\n // eslint-disable-next-line unicorn/no-array-reduce\n const values = heuristic.reduce<number[]>(\n (prev, value) => {\n return value === null ? prev : [value + prev[0], prev[1] + 1]\n },\n [0, 0],\n )\n return values[0] / values[1]\n })(),\n // eslint-disable-next-line unicorn/no-array-reduce\n min: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value < prev ? value\n : prev\n )\n }, Number.POSITIVE_INFINITY),\n }\n }\n\n /* Given elevation and location payloads, generate heuristic arrays */\n private static locationsToHeuristics(elevations: ElevationPayload[], locations: LocationPayload[]) {\n // eslint-disable-next-line unicorn/no-array-reduce\n const heuristics = elevations.reduce<{ altitude: (number | null)[]; elevation: number[]; variance: (number | null)[] }>(\n (prev, elev, index) => {\n const elevation = elev.elevation\n if (elevation === undefined || elevation === null) {\n throw new Error('Invalid Elevation')\n }\n const altitude = locations[index].altitude\n prev.altitude.push(altitude ?? null)\n prev.elevation.push(elevation)\n prev.variance.push(altitude !== undefined && altitude !== null ? altitude - elevation : null)\n return prev\n },\n { altitude: [], elevation: [], variance: [] },\n )\n return heuristics\n }\n\n /** @description Given a set of locations, get the expected elevations (witness if needed), and return score/variance */\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const locations = payloads?.filter<LocationPayload>((payload): payload is LocationPayload => payload?.schema === LocationSchema)\n // If this is a query we support\n if (locations && locations?.length > 0) {\n const elevationWitness = await ElevationWitness.create({\n account: this.account,\n config: {\n locations,\n schema: ElevationWitnessConfigSchema,\n },\n })\n const elevations = (await elevationWitness.observe()) as ElevationPayload[]\n\n const heuristics = LocationCertaintyDiviner.locationsToHeuristics(elevations, locations)\n\n const result = await new PayloadBuilder<LocationCertaintyPayload>({ schema: LocationCertaintySchema })\n .fields({\n altitude: LocationCertaintyDiviner.calcHeuristic(heuristics.altitude),\n elevation: LocationCertaintyDiviner.calcHeuristic(heuristics.elevation),\n variance: LocationCertaintyDiviner.calcHeuristic(heuristics.variance),\n })\n .build()\n\n this.logger?.log('LocationCertaintyDiviner.Divine: Processed query')\n return [result]\n }\n return []\n }\n}\n","import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { LocationCertaintyDiviner } from './Diviner'\n\nexport const LocationCertaintyPlugin = () =>\n createPayloadSetDivinerPlugin<LocationCertaintyDiviner>(\n { required: { [LocationCertaintySchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await LocationCertaintyDiviner.create(params)) as LocationCertaintyDiviner\n },\n },\n )\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,uCAA6E;;;ACL1F,8BAAgC;AAGhC,8BAA+D;AAC/D,+CAA8F;AAC9F,qCAAgD;AAEhD,6BAA+B;AAOxB,IA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C,EAAE;AAAA,IAC9C;AACA,WAAO;AAAA,EACT;AAAA;AAAA,EAGA,MAAyB,cAAc,UAA0C;AAC/E,UAAM,YAAY,UAAU,OAAwB,CAAC,YAAwC,SAAS,WAAW,6CAAc;AAE/H,QAAI,aAAa,WAAW,SAAS,GAAG;AACtC,YAAM,mBAAmB,MAAM,yCAAiB,OAAO;AAAA,QACrD,SAAS,KAAK;AAAA,QACd,QAAQ;AAAA,UACN;AAAA,UACA,QAAQ;AAAA,QACV;AAAA,MACF,CAAC;AACD,YAAM,aAAc,MAAM,iBAAiB,QAAQ;AAEnD,YAAM,aAAa,0BAAyB,sBAAsB,YAAY,SAAS;AAEvF,YAAM,SAAS,MAAM,IAAI,sCAAyC,EAAE,QAAQ,iEAAwB,CAAC,EAClG,OAAO;AAAA,QACN,UAAU,0BAAyB,cAAc,WAAW,QAAQ;AAAA,QACpE,WAAW,0BAAyB,cAAc,WAAW,SAAS;AAAA,QACtE,UAAU,0BAAyB,cAAc,WAAW,QAAQ;AAAA,MACtE,CAAC,EACA,MAAM;AAET,WAAK,QAAQ,IAAI,kDAAkD;AACnE,aAAO,CAAC,MAAM;AAAA,IAChB;AACA,WAAO,CAAC;AAAA,EACV;AACF;;;ACvGA,IAAAA,4CAAwC;AACxC,2BAAiC;AACjC,+BAA8C;AAIvC,IAAM,0BAA0B,UACrC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,iEAAuB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACvE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,yBAAyB,OAAO,MAAM;AAAA,IACtD;AAAA,EACF;AACF;","names":["import_location_certainty_payload_plugin"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Diviner/Config.ts","../../src/Diviner/Diviner.ts","../../src/Plugin.ts"],"sourcesContent":["export * from './Diviner/index.js'\n// eslint-disable-next-line import/no-default-export\nexport { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin.js'\n","import { DivinerConfig } from '@xyo-network/diviner-model'\nimport { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\nexport const LocationCertaintyDivinerConfigSchema: LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\n\nexport type LocationCertaintyDivinerConfig<TConfig extends Payload = Payload> = DivinerConfig<\n TConfig & {\n schema: LocationCertaintyDivinerConfigSchema\n targetSchema?: LocationCertaintySchema\n }\n>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerModule, DivinerParams } from '@xyo-network/diviner-model'\nimport { ElevationPayload } from '@xyo-network/elevation-payload-plugin'\nimport { ElevationWitness, ElevationWitnessConfigSchema } from '@xyo-network/elevation-plugin'\nimport { LocationCertaintyHeuristic, LocationCertaintyPayload, LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { LocationCertaintyDivinerConfig, LocationCertaintyDivinerConfigSchema } from './Config.js'\n\nexport type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>\n\nexport class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams>\n extends AbstractDiviner<TParam>\n implements DivinerModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, LocationCertaintyDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = LocationCertaintyDivinerConfigSchema\n static override targetSchema = LocationCertaintySchema\n\n /* Given an array of numbers, find the min/max/mean */\n private static calcHeuristic(heuristic: (number | null)[]): LocationCertaintyHeuristic {\n return {\n // eslint-disable-next-line unicorn/no-array-reduce\n max: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value > prev ? value\n : prev\n )\n }, Number.NEGATIVE_INFINITY),\n mean: (() => {\n // eslint-disable-next-line unicorn/no-array-reduce\n const values = heuristic.reduce<number[]>(\n (prev, value) => {\n return value === null ? prev : [value + prev[0], prev[1] + 1]\n },\n [0, 0],\n )\n return values[0] / values[1]\n })(),\n // eslint-disable-next-line unicorn/no-array-reduce\n min: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value < prev ? value\n : prev\n )\n }, Number.POSITIVE_INFINITY),\n }\n }\n\n /* Given elevation and location payloads, generate heuristic arrays */\n private static locationsToHeuristics(elevations: ElevationPayload[], locations: LocationPayload[]) {\n // eslint-disable-next-line unicorn/no-array-reduce\n const heuristics = elevations.reduce<{ altitude: (number | null)[]; elevation: number[]; variance: (number | null)[] }>(\n (prev, elev, index) => {\n const elevation = elev.elevation\n if (elevation === undefined || elevation === null) {\n throw new Error('Invalid Elevation')\n }\n const altitude = locations[index].altitude\n prev.altitude.push(altitude ?? null)\n prev.elevation.push(elevation)\n prev.variance.push(altitude !== undefined && altitude !== null ? altitude - elevation : null)\n return prev\n },\n { altitude: [], elevation: [], variance: [] },\n )\n return heuristics\n }\n\n /** @description Given a set of locations, get the expected elevations (witness if needed), and return score/variance */\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const locations = payloads?.filter<LocationPayload>((payload): payload is LocationPayload => payload?.schema === LocationSchema)\n // If this is a query we support\n if (locations && locations?.length > 0) {\n const elevationWitness = await ElevationWitness.create({\n account: this.account,\n config: {\n locations,\n schema: ElevationWitnessConfigSchema,\n },\n })\n const elevations = (await elevationWitness.observe()) as ElevationPayload[]\n\n const heuristics = LocationCertaintyDiviner.locationsToHeuristics(elevations, locations)\n\n const result = await new PayloadBuilder<LocationCertaintyPayload>({ schema: LocationCertaintySchema })\n .fields({\n altitude: LocationCertaintyDiviner.calcHeuristic(heuristics.altitude),\n elevation: LocationCertaintyDiviner.calcHeuristic(heuristics.elevation),\n variance: LocationCertaintyDiviner.calcHeuristic(heuristics.variance),\n })\n .build()\n\n this.logger?.log('LocationCertaintyDiviner.Divine: Processed query')\n return [result]\n }\n return []\n }\n}\n","import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { LocationCertaintyDiviner } from './Diviner/index.js'\n\nexport const LocationCertaintyPlugin = () =>\n createPayloadSetDivinerPlugin<LocationCertaintyDiviner>(\n { required: { [LocationCertaintySchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await LocationCertaintyDiviner.create(params)) as LocationCertaintyDiviner\n },\n },\n )\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,uCAA6E;;;ACL1F,8BAAgC;AAGhC,8BAA+D;AAC/D,+CAA8F;AAC9F,qCAAgD;AAEhD,6BAA+B;AAOxB,IAAM,2BAAN,MAAM,kCACH,wCAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,oCAAoC;AAAA,EAChH,OAAyB,sBAA8B;AAAA,EACvD,OAAgB,eAAe;AAAA;AAAA,EAG/B,OAAe,cAAc,WAA0D;AACrF,WAAO;AAAA;AAAA,MAEL,KAAK,UAAU,OAAe,CAAC,MAAM,UAAU;AAC7C,eACE,UAAU,OAAO,OACf,QAAQ,OAAO,QACf;AAAA,MAEN,GAAG,OAAO,iBAAiB;AAAA,MAC3B,OAAO,MAAM;AAEX,cAAM,SAAS,UAAU;AAAA,UACvB,CAAC,MAAM,UAAU;AACf,mBAAO,UAAU,OAAO,OAAO,CAAC,QAAQ,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;AAAA,UAC9D;AAAA,UACA,CAAC,GAAG,CAAC;AAAA,QACP;AACA,eAAO,OAA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B,cAAc,WAAW,SAAS;AAAA,QACtE,UAAU,0BAAyB,cAAc,WAAW,QAAQ;AAAA,MACtE,CAAC,EACA,MAAM;AAET,WAAK,QAAQ,IAAI,kDAAkD;AACnE,aAAO,CAAC,MAAM;AAAA,IAChB;AACA,WAAO,CAAC;AAAA,EACV;AACF;;;ACvGA,IAAAA,4CAAwC;AACxC,2BAAiC;AACjC,+BAA8C;AAIvC,IAAM,0BAA0B,UACrC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,iEAAuB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACvE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,yBAAyB,OAAO,MAAM;AAAA,IACtD;AAAA,EACF;AACF;","names":["import_location_certainty_payload_plugin"]}
@@ -1,3 +1,3 @@
1
- export * from './Diviner';
2
- export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin';
1
+ export * from './Diviner/index.js';
2
+ export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAElC,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './Diviner';
2
- export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin';
1
+ export * from './Diviner/index.js';
2
+ export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAElC,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './Diviner';
2
- export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin';
1
+ export * from './Diviner/index.js';
2
+ export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAElC,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Diviner/Config.ts","../../src/Diviner/Diviner.ts","../../src/Plugin.ts"],"sourcesContent":["import { DivinerConfig } from '@xyo-network/diviner-model'\nimport { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\nexport const LocationCertaintyDivinerConfigSchema: LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\n\nexport type LocationCertaintyDivinerConfig<TConfig extends Payload = Payload> = DivinerConfig<\n TConfig & {\n schema: LocationCertaintyDivinerConfigSchema\n targetSchema?: LocationCertaintySchema\n }\n>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerModule, DivinerParams } from '@xyo-network/diviner-model'\nimport { ElevationPayload } from '@xyo-network/elevation-payload-plugin'\nimport { ElevationWitness, ElevationWitnessConfigSchema } from '@xyo-network/elevation-plugin'\nimport { LocationCertaintyHeuristic, LocationCertaintyPayload, LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { LocationCertaintyDivinerConfig, LocationCertaintyDivinerConfigSchema } from './Config'\n\nexport type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>\n\nexport class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams>\n extends AbstractDiviner<TParam>\n implements DivinerModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, LocationCertaintyDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = LocationCertaintyDivinerConfigSchema\n static override targetSchema = LocationCertaintySchema\n\n /* Given an array of numbers, find the min/max/mean */\n private static calcHeuristic(heuristic: (number | null)[]): LocationCertaintyHeuristic {\n return {\n // eslint-disable-next-line unicorn/no-array-reduce\n max: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value > prev ? value\n : prev\n )\n }, Number.NEGATIVE_INFINITY),\n mean: (() => {\n // eslint-disable-next-line unicorn/no-array-reduce\n const values = heuristic.reduce<number[]>(\n (prev, value) => {\n return value === null ? prev : [value + prev[0], prev[1] + 1]\n },\n [0, 0],\n )\n return values[0] / values[1]\n })(),\n // eslint-disable-next-line unicorn/no-array-reduce\n min: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value < prev ? value\n : prev\n )\n }, Number.POSITIVE_INFINITY),\n }\n }\n\n /* Given elevation and location payloads, generate heuristic arrays */\n private static locationsToHeuristics(elevations: ElevationPayload[], locations: LocationPayload[]) {\n // eslint-disable-next-line unicorn/no-array-reduce\n const heuristics = elevations.reduce<{ altitude: (number | null)[]; elevation: number[]; variance: (number | null)[] }>(\n (prev, elev, index) => {\n const elevation = elev.elevation\n if (elevation === undefined || elevation === null) {\n throw new Error('Invalid Elevation')\n }\n const altitude = locations[index].altitude\n prev.altitude.push(altitude ?? null)\n prev.elevation.push(elevation)\n prev.variance.push(altitude !== undefined && altitude !== null ? altitude - elevation : null)\n return prev\n },\n { altitude: [], elevation: [], variance: [] },\n )\n return heuristics\n }\n\n /** @description Given a set of locations, get the expected elevations (witness if needed), and return score/variance */\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const locations = payloads?.filter<LocationPayload>((payload): payload is LocationPayload => payload?.schema === LocationSchema)\n // If this is a query we support\n if (locations && locations?.length > 0) {\n const elevationWitness = await ElevationWitness.create({\n account: this.account,\n config: {\n locations,\n schema: ElevationWitnessConfigSchema,\n },\n })\n const elevations = (await elevationWitness.observe()) as ElevationPayload[]\n\n const heuristics = LocationCertaintyDiviner.locationsToHeuristics(elevations, locations)\n\n const result = await new PayloadBuilder<LocationCertaintyPayload>({ schema: LocationCertaintySchema })\n .fields({\n altitude: LocationCertaintyDiviner.calcHeuristic(heuristics.altitude),\n elevation: LocationCertaintyDiviner.calcHeuristic(heuristics.elevation),\n variance: LocationCertaintyDiviner.calcHeuristic(heuristics.variance),\n })\n .build()\n\n this.logger?.log('LocationCertaintyDiviner.Divine: Processed query')\n return [result]\n }\n return []\n }\n}\n","import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { LocationCertaintyDiviner } from './Diviner'\n\nexport const LocationCertaintyPlugin = () =>\n createPayloadSetDivinerPlugin<LocationCertaintyDiviner>(\n { required: { [LocationCertaintySchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await LocationCertaintyDiviner.create(params)) as LocationCertaintyDiviner\n },\n },\n )\n"],"mappings":";AAKO,IAAM,uCAA6E;;;ACL1F,SAAS,uBAAuB;AAGhC,SAAS,kBAAkB,oCAAoC;AAC/D,SAA+D,+BAA+B;AAC9F,SAA0B,sBAAsB;AAEhD,SAAS,sBAAsB;AAOxB,IAAM,2BAAN,MAAM,kCACH,gBAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,oCAAoC;AAAA,EAChH,OAAyB,sBAA8B;AAAA,EACvD,OAAgB,eAAe;AAAA;AAAA,EAG/B,OAAe,cAAc,WAA0D;AACrF,WAAO;AAAA;AAAA,MAEL,KAAK,UAAU,OAAe,CAAC,MAAM,UAAU;AAC7C,eACE,UAAU,OAAO,OACf,QAAQ,OAAO,QACf;AAAA,MAEN,GAAG,OAAO,iBAAiB;AAAA,MAC3B,OAAO,MAAM;AAEX,cAAM,SAAS,UAAU;AAAA,UACvB,CAAC,MAAM,UAAU;AACf,mBAAO,UAAU,OAAO,OAAO,CAAC,QAAQ,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;AAAA,UAC9D;AAAA,UACA,CAAC,GAAG,CAAC;AAAA,QACP;AACA,eAAO,OAAO,CAAC,IAAI,OAAO,CAAC;AAAA,MAC7B,GAAG;AAAA;AAAA,MAEH,KAAK,UAAU,OAAe,CAAC,MAAM,UAAU;AAC7C,eACE,UAAU,OAAO,OACf,QAAQ,OAAO,QACf;AAAA,MAEN,GAAG,OAAO,iBAAiB;AAAA,IAC7B;AAAA,EACF;AAAA;AAAA,EAGA,OAAe,sBAAsB,YAAgC,WAA8B;AAEjG,UAAM,aAAa,WAAW;AAAA,MAC5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B,MACrC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,wBAAuB,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACvE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,yBAAyB,OAAO,MAAM;AAAA,IACtD;AAAA,EACF;AACF;","names":["LocationCertaintySchema","LocationCertaintySchema"]}
1
+ {"version":3,"sources":["../../src/Diviner/Config.ts","../../src/Diviner/Diviner.ts","../../src/Plugin.ts"],"sourcesContent":["import { DivinerConfig } from '@xyo-network/diviner-model'\nimport { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\nexport const LocationCertaintyDivinerConfigSchema: LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\n\nexport type LocationCertaintyDivinerConfig<TConfig extends Payload = Payload> = DivinerConfig<\n TConfig & {\n schema: LocationCertaintyDivinerConfigSchema\n targetSchema?: LocationCertaintySchema\n }\n>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerModule, DivinerParams } from '@xyo-network/diviner-model'\nimport { ElevationPayload } from '@xyo-network/elevation-payload-plugin'\nimport { ElevationWitness, ElevationWitnessConfigSchema } from '@xyo-network/elevation-plugin'\nimport { LocationCertaintyHeuristic, LocationCertaintyPayload, LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { LocationCertaintyDivinerConfig, LocationCertaintyDivinerConfigSchema } from './Config.js'\n\nexport type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>\n\nexport class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams>\n extends AbstractDiviner<TParam>\n implements DivinerModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, LocationCertaintyDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = LocationCertaintyDivinerConfigSchema\n static override targetSchema = LocationCertaintySchema\n\n /* Given an array of numbers, find the min/max/mean */\n private static calcHeuristic(heuristic: (number | null)[]): LocationCertaintyHeuristic {\n return {\n // eslint-disable-next-line unicorn/no-array-reduce\n max: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value > prev ? value\n : prev\n )\n }, Number.NEGATIVE_INFINITY),\n mean: (() => {\n // eslint-disable-next-line unicorn/no-array-reduce\n const values = heuristic.reduce<number[]>(\n (prev, value) => {\n return value === null ? prev : [value + prev[0], prev[1] + 1]\n },\n [0, 0],\n )\n return values[0] / values[1]\n })(),\n // eslint-disable-next-line unicorn/no-array-reduce\n min: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value < prev ? value\n : prev\n )\n }, Number.POSITIVE_INFINITY),\n }\n }\n\n /* Given elevation and location payloads, generate heuristic arrays */\n private static locationsToHeuristics(elevations: ElevationPayload[], locations: LocationPayload[]) {\n // eslint-disable-next-line unicorn/no-array-reduce\n const heuristics = elevations.reduce<{ altitude: (number | null)[]; elevation: number[]; variance: (number | null)[] }>(\n (prev, elev, index) => {\n const elevation = elev.elevation\n if (elevation === undefined || elevation === null) {\n throw new Error('Invalid Elevation')\n }\n const altitude = locations[index].altitude\n prev.altitude.push(altitude ?? null)\n prev.elevation.push(elevation)\n prev.variance.push(altitude !== undefined && altitude !== null ? altitude - elevation : null)\n return prev\n },\n { altitude: [], elevation: [], variance: [] },\n )\n return heuristics\n }\n\n /** @description Given a set of locations, get the expected elevations (witness if needed), and return score/variance */\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const locations = payloads?.filter<LocationPayload>((payload): payload is LocationPayload => payload?.schema === LocationSchema)\n // If this is a query we support\n if (locations && locations?.length > 0) {\n const elevationWitness = await ElevationWitness.create({\n account: this.account,\n config: {\n locations,\n schema: ElevationWitnessConfigSchema,\n },\n })\n const elevations = (await elevationWitness.observe()) as ElevationPayload[]\n\n const heuristics = LocationCertaintyDiviner.locationsToHeuristics(elevations, locations)\n\n const result = await new PayloadBuilder<LocationCertaintyPayload>({ schema: LocationCertaintySchema })\n .fields({\n altitude: LocationCertaintyDiviner.calcHeuristic(heuristics.altitude),\n elevation: LocationCertaintyDiviner.calcHeuristic(heuristics.elevation),\n variance: LocationCertaintyDiviner.calcHeuristic(heuristics.variance),\n })\n .build()\n\n this.logger?.log('LocationCertaintyDiviner.Divine: Processed query')\n return [result]\n }\n return []\n }\n}\n","import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { LocationCertaintyDiviner } from './Diviner/index.js'\n\nexport const LocationCertaintyPlugin = () =>\n createPayloadSetDivinerPlugin<LocationCertaintyDiviner>(\n { required: { [LocationCertaintySchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await LocationCertaintyDiviner.create(params)) as LocationCertaintyDiviner\n },\n },\n )\n"],"mappings":";AAKO,IAAM,uCAA6E;;;ACL1F,SAAS,uBAAuB;AAGhC,SAAS,kBAAkB,oCAAoC;AAC/D,SAA+D,+BAA+B;AAC9F,SAA0B,sBAAsB;AAEhD,SAAS,sBAAsB;AAOxB,IAAM,2BAAN,MAAM,kCACH,gBAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,oCAAoC;AAAA,EAChH,OAAyB,sBAA8B;AAAA,EACvD,OAAgB,eAAe;AAAA;AAAA,EAG/B,OAAe,cAAc,WAA0D;AACrF,WAAO;AAAA;AAAA,MAEL,KAAK,UAAU,OAAe,CAAC,MAAM,UAAU;AAC7C,eACE,UAAU,OAAO,OACf,QAAQ,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UACA,QAAQ;AAAA,QACV;AAAA,MACF,CAAC;AACD,YAAM,aAAc,MAAM,iBAAiB,QAAQ;AAEnD,YAAM,aAAa,0BAAyB,sBAAsB,YAAY,SAAS;AAEvF,YAAM,SAAS,MAAM,IAAI,eAAyC,EAAE,QAAQ,wBAAwB,CAAC,EAClG,OAAO;AAAA,QACN,UAAU,0BAAyB,cAAc,WAAW,QAAQ;AAAA,QACpE,WAAW,0BAAyB,cAAc,WAAW,SAAS;AAAA,QACtE,UAAU,0BAAyB,cAAc,WAAW,QAAQ;AAAA,MACtE,CAAC,EACA,MAAM;AAET,WAAK,QAAQ,IAAI,kDAAkD;AACnE,aAAO,CAAC,MAAM;AAAA,IAChB;AACA,WAAO,CAAC;AAAA,EACV;AACF;;;ACvGA,SAAS,2BAAAA,gCAA+B;AACxC,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;AAIvC,IAAM,0BAA0B,MACrC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,wBAAuB,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACvE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,yBAAyB,OAAO,MAAM;AAAA,IACtD;AAAA,EACF;AACF;","names":["LocationCertaintySchema","LocationCertaintySchema"]}
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import { DivinerModule, DivinerParams } from '@xyo-network/diviner-model';
3
3
  import { AnyConfigSchema } from '@xyo-network/module-model';
4
4
  import { Payload, Schema } from '@xyo-network/payload-model';
5
- import { LocationCertaintyDivinerConfig } from './Config';
5
+ import { LocationCertaintyDivinerConfig } from './Config.js';
6
6
  export type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>;
7
7
  export declare class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams> extends AbstractDiviner<TParam> implements DivinerModule {
8
8
  static readonly configSchemas: Schema[];
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAKzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,8BAA8B,EAAwC,MAAM,UAAU,CAAA;AAE/F,MAAM,MAAM,8BAA8B,GAAG,aAAa,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC,CAAA;AAE3G,qBAAa,wBAAwB,CAAC,MAAM,SAAS,8BAA8B,GAAG,8BAA8B,CAClH,SAAQ,eAAe,CAAC,MAAM,CAC9B,YAAW,aAAa;IAExB,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAiE;IACjH,gBAAyB,mBAAmB,EAAE,MAAM,CAAuC;IAC3F,OAAgB,YAAY,mCAA0B;IAGtD,OAAO,CAAC,MAAM,CAAC,aAAa;IAgC5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;cAoBX,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4BjF"}
1
+ {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAKzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,8BAA8B,EAAwC,MAAM,aAAa,CAAA;AAElG,MAAM,MAAM,8BAA8B,GAAG,aAAa,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC,CAAA;AAE3G,qBAAa,wBAAwB,CAAC,MAAM,SAAS,8BAA8B,GAAG,8BAA8B,CAClH,SAAQ,eAAe,CAAC,MAAM,CAC9B,YAAW,aAAa;IAExB,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAiE;IACjH,gBAAyB,mBAAmB,EAAE,MAAM,CAAuC;IAC3F,OAAgB,YAAY,mCAA0B;IAGtD,OAAO,CAAC,MAAM,CAAC,aAAa;IAgC5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;cAoBX,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4BjF"}
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import { DivinerModule, DivinerParams } from '@xyo-network/diviner-model';
3
3
  import { AnyConfigSchema } from '@xyo-network/module-model';
4
4
  import { Payload, Schema } from '@xyo-network/payload-model';
5
- import { LocationCertaintyDivinerConfig } from './Config';
5
+ import { LocationCertaintyDivinerConfig } from './Config.js';
6
6
  export type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>;
7
7
  export declare class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams> extends AbstractDiviner<TParam> implements DivinerModule {
8
8
  static readonly configSchemas: Schema[];
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAKzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B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tD,OAAO,CAAC,MAAM,CAAC,aAAa;IAgC5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;cAoBX,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4BjF"}
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import { DivinerModule, DivinerParams } from '@xyo-network/diviner-model';
3
3
  import { AnyConfigSchema } from '@xyo-network/module-model';
4
4
  import { Payload, Schema } from '@xyo-network/payload-model';
5
- import { LocationCertaintyDivinerConfig } from './Config';
5
+ import { LocationCertaintyDivinerConfig } from './Config.js';
6
6
  export type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>;
7
7
  export declare class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams> extends AbstractDiviner<TParam> implements DivinerModule {
8
8
  static readonly configSchemas: Schema[];
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAKzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,8BAA8B,EAAwC,MAAM,UAAU,CAAA;AAE/F,MAAM,MAAM,8BAA8B,GAAG,aAAa,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC,CAAA;AAE3G,qBAAa,wBAAwB,CAAC,MAAM,SAAS,8BAA8B,GAAG,8BAA8B,CAClH,SAAQ,eAAe,CAAC,MAAM,CAC9B,YAAW,aAAa;IAExB,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAiE;IACjH,gBAAyB,mBAAmB,EAAE,MAAM,CAAuC;IAC3F,OAAgB,YAAY,mCAA0B;IAGtD,OAAO,CAAC,MAAM,CAAC,aAAa;IAgC5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;cAoBX,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4BjF"}
1
+ {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAKzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,8BAA8B,EAAwC,MAAM,aAAa,CAAA;AAElG,MAAM,MAAM,8BAA8B,GAAG,aAAa,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC,CAAA;AAE3G,qBAAa,wBAAwB,CAAC,MAAM,SAAS,8BAA8B,GAAG,8BAA8B,CAClH,SAAQ,eAAe,CAAC,MAAM,CAC9B,YAAW,aAAa;IAExB,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAiE;IACjH,gBAAyB,mBAAmB,EAAE,MAAM,CAAuC;IAC3F,OAAgB,YAAY,mCAA0B;IAGtD,OAAO,CAAC,MAAM,CAAC,aAAa;IAgC5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;cAoBX,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4BjF"}
@@ -1,3 +1,3 @@
1
- export * from './Config';
2
- export * from './Diviner';
1
+ export * from './Config.js';
2
+ export * from './Diviner.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './Config';
2
- export * from './Diviner';
1
+ export * from './Config.js';
2
+ export * from './Diviner.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './Config';
2
- export * from './Diviner';
1
+ export * from './Config.js';
2
+ export * from './Diviner.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin';
2
- import { LocationCertaintyDiviner } from './Diviner';
2
+ import { LocationCertaintyDiviner } from './Diviner/index.js';
3
3
  export declare const LocationCertaintyPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<LocationCertaintyDiviner<import("@xylabs/object").BaseParamsFields & {
4
4
  account?: import("@xyo-network/account-model").AccountInstance | "random";
5
5
  addToResolvers?: boolean;
@@ -10,7 +10,7 @@ export declare const LocationCertaintyPlugin: () => import("@xyo-network/payload
10
10
  } & {
11
11
  schema: string;
12
12
  } & import("@xyo-network/payload-model").PayloadFields & {
13
- schema: import("./Diviner").LocationCertaintyDivinerConfigSchema;
13
+ schema: import("./Diviner/Config.js").LocationCertaintyDivinerConfigSchema;
14
14
  targetSchema?: LocationCertaintySchema;
15
15
  }, "schema"> & {
16
16
  schema: "network.xyo.location.elevation.diviner.config";
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin';
2
- import { LocationCertaintyDiviner } from './Diviner';
2
+ import { LocationCertaintyDiviner } from './Diviner/index.js';
3
3
  export declare const LocationCertaintyPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<LocationCertaintyDiviner<import("@xylabs/object").BaseParamsFields & {
4
4
  account?: import("@xyo-network/account-model").AccountInstance | "random";
5
5
  addToResolvers?: boolean;
@@ -10,7 +10,7 @@ export declare const LocationCertaintyPlugin: () => import("@xyo-network/payload
10
10
  } & {
11
11
  schema: string;
12
12
  } & import("@xyo-network/payload-model").PayloadFields & {
13
- schema: import("./Diviner").LocationCertaintyDivinerConfigSchema;
13
+ schema: import("./Diviner/Config.js").LocationCertaintyDivinerConfigSchema;
14
14
  targetSchema?: LocationCertaintySchema;
15
15
  }, "schema"> & {
16
16
  schema: "network.xyo.location.elevation.diviner.config";
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin';
2
- import { LocationCertaintyDiviner } from './Diviner';
2
+ import { LocationCertaintyDiviner } from './Diviner/index.js';
3
3
  export declare const LocationCertaintyPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<LocationCertaintyDiviner<import("@xylabs/object").BaseParamsFields & {
4
4
  account?: import("@xyo-network/account-model").AccountInstance | "random";
5
5
  addToResolvers?: boolean;
@@ -10,7 +10,7 @@ export declare const LocationCertaintyPlugin: () => import("@xyo-network/payload
10
10
  } & {
11
11
  schema: string;
12
12
  } & import("@xyo-network/payload-model").PayloadFields & {
13
- schema: import("./Diviner").LocationCertaintyDivinerConfigSchema;
13
+ schema: import("./Diviner/Config.js").LocationCertaintyDivinerConfigSchema;
14
14
  targetSchema?: LocationCertaintySchema;
15
15
  }, "schema"> & {
16
16
  schema: "network.xyo.location.elevation.diviner.config";
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AAIxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Diviner/Config.ts","../../src/Diviner/Diviner.ts","../../src/Plugin.ts"],"sourcesContent":["export * from './Diviner'\n// eslint-disable-next-line import/no-default-export\nexport { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin'\n","import { DivinerConfig } from '@xyo-network/diviner-model'\nimport { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\nexport const LocationCertaintyDivinerConfigSchema: LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\n\nexport type LocationCertaintyDivinerConfig<TConfig extends Payload = Payload> = DivinerConfig<\n TConfig & {\n schema: LocationCertaintyDivinerConfigSchema\n targetSchema?: LocationCertaintySchema\n }\n>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerModule, DivinerParams } from '@xyo-network/diviner-model'\nimport { ElevationPayload } from '@xyo-network/elevation-payload-plugin'\nimport { ElevationWitness, ElevationWitnessConfigSchema } from '@xyo-network/elevation-plugin'\nimport { LocationCertaintyHeuristic, LocationCertaintyPayload, LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { LocationCertaintyDivinerConfig, LocationCertaintyDivinerConfigSchema } from './Config'\n\nexport type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>\n\nexport class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams>\n extends AbstractDiviner<TParam>\n implements DivinerModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, LocationCertaintyDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = LocationCertaintyDivinerConfigSchema\n static override targetSchema = LocationCertaintySchema\n\n /* Given an array of numbers, find the min/max/mean */\n private static calcHeuristic(heuristic: (number | null)[]): LocationCertaintyHeuristic {\n return {\n // eslint-disable-next-line unicorn/no-array-reduce\n max: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value > prev ? value\n : prev\n )\n }, Number.NEGATIVE_INFINITY),\n mean: (() => {\n // eslint-disable-next-line unicorn/no-array-reduce\n const values = heuristic.reduce<number[]>(\n (prev, value) => {\n return value === null ? prev : [value + prev[0], prev[1] + 1]\n },\n [0, 0],\n )\n return values[0] / values[1]\n })(),\n // eslint-disable-next-line unicorn/no-array-reduce\n min: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value < prev ? value\n : prev\n )\n }, Number.POSITIVE_INFINITY),\n }\n }\n\n /* Given elevation and location payloads, generate heuristic arrays */\n private static locationsToHeuristics(elevations: ElevationPayload[], locations: LocationPayload[]) {\n // eslint-disable-next-line unicorn/no-array-reduce\n const heuristics = elevations.reduce<{ altitude: (number | null)[]; elevation: number[]; variance: (number | null)[] }>(\n (prev, elev, index) => {\n const elevation = elev.elevation\n if (elevation === undefined || elevation === null) {\n throw new Error('Invalid Elevation')\n }\n const altitude = locations[index].altitude\n prev.altitude.push(altitude ?? null)\n prev.elevation.push(elevation)\n prev.variance.push(altitude !== undefined && altitude !== null ? altitude - elevation : null)\n return prev\n },\n { altitude: [], elevation: [], variance: [] },\n )\n return heuristics\n }\n\n /** @description Given a set of locations, get the expected elevations (witness if needed), and return score/variance */\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const locations = payloads?.filter<LocationPayload>((payload): payload is LocationPayload => payload?.schema === LocationSchema)\n // If this is a query we support\n if (locations && locations?.length > 0) {\n const elevationWitness = await ElevationWitness.create({\n account: this.account,\n config: {\n locations,\n schema: ElevationWitnessConfigSchema,\n },\n })\n const elevations = (await elevationWitness.observe()) as ElevationPayload[]\n\n const heuristics = LocationCertaintyDiviner.locationsToHeuristics(elevations, locations)\n\n const result = await new PayloadBuilder<LocationCertaintyPayload>({ schema: LocationCertaintySchema })\n .fields({\n altitude: LocationCertaintyDiviner.calcHeuristic(heuristics.altitude),\n elevation: LocationCertaintyDiviner.calcHeuristic(heuristics.elevation),\n variance: LocationCertaintyDiviner.calcHeuristic(heuristics.variance),\n })\n .build()\n\n this.logger?.log('LocationCertaintyDiviner.Divine: Processed query')\n return [result]\n }\n return []\n }\n}\n","import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { LocationCertaintyDiviner } from './Diviner'\n\nexport const LocationCertaintyPlugin = () =>\n createPayloadSetDivinerPlugin<LocationCertaintyDiviner>(\n { required: { [LocationCertaintySchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await LocationCertaintyDiviner.create(params)) as LocationCertaintyDiviner\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names":["import_location_certainty_payload_plugin"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Diviner/Config.ts","../../src/Diviner/Diviner.ts","../../src/Plugin.ts"],"sourcesContent":["export * from './Diviner/index.js'\n// eslint-disable-next-line import/no-default-export\nexport { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin.js'\n","import { DivinerConfig } from '@xyo-network/diviner-model'\nimport { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\nexport const LocationCertaintyDivinerConfigSchema: LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\n\nexport type LocationCertaintyDivinerConfig<TConfig extends Payload = Payload> = DivinerConfig<\n TConfig & {\n schema: LocationCertaintyDivinerConfigSchema\n targetSchema?: LocationCertaintySchema\n }\n>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerModule, DivinerParams } from '@xyo-network/diviner-model'\nimport { ElevationPayload } from '@xyo-network/elevation-payload-plugin'\nimport { ElevationWitness, ElevationWitnessConfigSchema } from '@xyo-network/elevation-plugin'\nimport { LocationCertaintyHeuristic, LocationCertaintyPayload, LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { LocationCertaintyDivinerConfig, LocationCertaintyDivinerConfigSchema } from './Config.js'\n\nexport type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>\n\nexport class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams>\n extends AbstractDiviner<TParam>\n implements DivinerModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, LocationCertaintyDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = LocationCertaintyDivinerConfigSchema\n static override targetSchema = LocationCertaintySchema\n\n /* Given an array of numbers, find the min/max/mean */\n private static calcHeuristic(heuristic: (number | null)[]): LocationCertaintyHeuristic {\n return {\n // eslint-disable-next-line unicorn/no-array-reduce\n max: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value > prev ? value\n : prev\n )\n }, Number.NEGATIVE_INFINITY),\n mean: (() => {\n // eslint-disable-next-line unicorn/no-array-reduce\n const values = heuristic.reduce<number[]>(\n (prev, value) => {\n return value === null ? prev : [value + prev[0], prev[1] + 1]\n },\n [0, 0],\n )\n return values[0] / values[1]\n })(),\n // eslint-disable-next-line unicorn/no-array-reduce\n min: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value < prev ? value\n : prev\n )\n }, Number.POSITIVE_INFINITY),\n }\n }\n\n /* Given elevation and location payloads, generate heuristic arrays */\n private static locationsToHeuristics(elevations: ElevationPayload[], locations: LocationPayload[]) {\n // eslint-disable-next-line unicorn/no-array-reduce\n const heuristics = elevations.reduce<{ altitude: (number | null)[]; elevation: number[]; variance: (number | null)[] }>(\n (prev, elev, index) => {\n const elevation = elev.elevation\n if (elevation === undefined || elevation === null) {\n throw new Error('Invalid Elevation')\n }\n const altitude = locations[index].altitude\n prev.altitude.push(altitude ?? null)\n prev.elevation.push(elevation)\n prev.variance.push(altitude !== undefined && altitude !== null ? altitude - elevation : null)\n return prev\n },\n { altitude: [], elevation: [], variance: [] },\n )\n return heuristics\n }\n\n /** @description Given a set of locations, get the expected elevations (witness if needed), and return score/variance */\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const locations = payloads?.filter<LocationPayload>((payload): payload is LocationPayload => payload?.schema === LocationSchema)\n // If this is a query we support\n if (locations && locations?.length > 0) {\n const elevationWitness = await ElevationWitness.create({\n account: this.account,\n config: {\n locations,\n schema: ElevationWitnessConfigSchema,\n },\n })\n const elevations = (await elevationWitness.observe()) as ElevationPayload[]\n\n const heuristics = LocationCertaintyDiviner.locationsToHeuristics(elevations, locations)\n\n const result = await new PayloadBuilder<LocationCertaintyPayload>({ schema: LocationCertaintySchema })\n .fields({\n altitude: LocationCertaintyDiviner.calcHeuristic(heuristics.altitude),\n elevation: LocationCertaintyDiviner.calcHeuristic(heuristics.elevation),\n variance: LocationCertaintyDiviner.calcHeuristic(heuristics.variance),\n })\n .build()\n\n this.logger?.log('LocationCertaintyDiviner.Divine: Processed query')\n return [result]\n }\n return []\n }\n}\n","import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { LocationCertaintyDiviner } from './Diviner/index.js'\n\nexport const LocationCertaintyPlugin = () =>\n createPayloadSetDivinerPlugin<LocationCertaintyDiviner>(\n { required: { [LocationCertaintySchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await LocationCertaintyDiviner.create(params)) as LocationCertaintyDiviner\n },\n },\n )\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,uCAA6E;;;ACL1F,8BAAgC;AAGhC,8BAA+D;AAC/D,+CAA8F;AAC9F,qCAAgD;AAEhD,6BAA+B;AAOxB,IAAM,2BAAN,MAAM,kCACH,wCAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,oCAAoC;AAAA,EAChH,OAAyB,sBAA8B;AAAA,EACvD,OAAgB,eAAe;AAAA;AAAA,EAG/B,OAAe,cAAc,WAA0D;AACrF,WAAO;AAAA;AAAA,MAEL,KAAK,UAAU,OAAe,CAAC,MAAM,UAAU;AAC7C,eACE,UAAU,OAAO,OACf,QAAQ,OAAO,QACf;AAAA,MAEN,GAAG,OAAO,iBAAiB;AAAA,MAC3B,OAAO,MAA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M,iBAAiB,QAAQ;AAEnD,YAAM,aAAa,0BAAyB,sBAAsB,YAAY,SAAS;AAEvF,YAAM,SAAS,MAAM,IAAI,sCAAyC,EAAE,QAAQ,iEAAwB,CAAC,EAClG,OAAO;AAAA,QACN,UAAU,0BAAyB,cAAc,WAAW,QAAQ;AAAA,QACpE,WAAW,0BAAyB,cAAc,WAAW,SAAS;AAAA,QACtE,UAAU,0BAAyB,cAAc,WAAW,QAAQ;AAAA,MACtE,CAAC,EACA,MAAM;AAET,iBAAK,WAAL,mBAAa,IAAI;AACjB,aAAO,CAAC,MAAM;AAAA,IAChB;AACA,WAAO,CAAC;AAAA,EACV;AACF;;;ACvGA,IAAAA,4CAAwC;AACxC,2BAAiC;AACjC,+BAA8C;AAIvC,IAAM,0BAA0B,UACrC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,iEAAuB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACvE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,yBAAyB,OAAO,MAAM;AAAA,IACtD;AAAA,EACF;AACF;","names":["import_location_certainty_payload_plugin"]}
@@ -1,3 +1,3 @@
1
- export * from './Diviner';
2
- export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin';
1
+ export * from './Diviner/index.js';
2
+ export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAElC,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './Diviner';
2
- export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin';
1
+ export * from './Diviner/index.js';
2
+ export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAElC,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './Diviner';
2
- export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin';
1
+ export * from './Diviner/index.js';
2
+ export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAElC,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Diviner/Config.ts","../../src/Diviner/Diviner.ts","../../src/Plugin.ts"],"sourcesContent":["import { DivinerConfig } from '@xyo-network/diviner-model'\nimport { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\nexport const LocationCertaintyDivinerConfigSchema: LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\n\nexport type LocationCertaintyDivinerConfig<TConfig extends Payload = Payload> = DivinerConfig<\n TConfig & {\n schema: LocationCertaintyDivinerConfigSchema\n targetSchema?: LocationCertaintySchema\n }\n>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerModule, DivinerParams } from '@xyo-network/diviner-model'\nimport { ElevationPayload } from '@xyo-network/elevation-payload-plugin'\nimport { ElevationWitness, ElevationWitnessConfigSchema } from '@xyo-network/elevation-plugin'\nimport { LocationCertaintyHeuristic, LocationCertaintyPayload, LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { LocationCertaintyDivinerConfig, LocationCertaintyDivinerConfigSchema } from './Config'\n\nexport type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>\n\nexport class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams>\n extends AbstractDiviner<TParam>\n implements DivinerModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, LocationCertaintyDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = LocationCertaintyDivinerConfigSchema\n static override targetSchema = LocationCertaintySchema\n\n /* Given an array of numbers, find the min/max/mean */\n private static calcHeuristic(heuristic: (number | null)[]): LocationCertaintyHeuristic {\n return {\n // eslint-disable-next-line unicorn/no-array-reduce\n max: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value > prev ? value\n : prev\n )\n }, Number.NEGATIVE_INFINITY),\n mean: (() => {\n // eslint-disable-next-line unicorn/no-array-reduce\n const values = heuristic.reduce<number[]>(\n (prev, value) => {\n return value === null ? prev : [value + prev[0], prev[1] + 1]\n },\n [0, 0],\n )\n return values[0] / values[1]\n })(),\n // eslint-disable-next-line unicorn/no-array-reduce\n min: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value < prev ? value\n : prev\n )\n }, Number.POSITIVE_INFINITY),\n }\n }\n\n /* Given elevation and location payloads, generate heuristic arrays */\n private static locationsToHeuristics(elevations: ElevationPayload[], locations: LocationPayload[]) {\n // eslint-disable-next-line unicorn/no-array-reduce\n const heuristics = elevations.reduce<{ altitude: (number | null)[]; elevation: number[]; variance: (number | null)[] }>(\n (prev, elev, index) => {\n const elevation = elev.elevation\n if (elevation === undefined || elevation === null) {\n throw new Error('Invalid Elevation')\n }\n const altitude = locations[index].altitude\n prev.altitude.push(altitude ?? null)\n prev.elevation.push(elevation)\n prev.variance.push(altitude !== undefined && altitude !== null ? altitude - elevation : null)\n return prev\n },\n { altitude: [], elevation: [], variance: [] },\n )\n return heuristics\n }\n\n /** @description Given a set of locations, get the expected elevations (witness if needed), and return score/variance */\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const locations = payloads?.filter<LocationPayload>((payload): payload is LocationPayload => payload?.schema === LocationSchema)\n // If this is a query we support\n if (locations && locations?.length > 0) {\n const elevationWitness = await ElevationWitness.create({\n account: this.account,\n config: {\n locations,\n schema: ElevationWitnessConfigSchema,\n },\n })\n const elevations = (await elevationWitness.observe()) as ElevationPayload[]\n\n const heuristics = LocationCertaintyDiviner.locationsToHeuristics(elevations, locations)\n\n const result = await new PayloadBuilder<LocationCertaintyPayload>({ schema: LocationCertaintySchema })\n .fields({\n altitude: LocationCertaintyDiviner.calcHeuristic(heuristics.altitude),\n elevation: LocationCertaintyDiviner.calcHeuristic(heuristics.elevation),\n variance: LocationCertaintyDiviner.calcHeuristic(heuristics.variance),\n })\n .build()\n\n this.logger?.log('LocationCertaintyDiviner.Divine: Processed query')\n return [result]\n }\n return []\n }\n}\n","import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { LocationCertaintyDiviner } from './Diviner'\n\nexport const LocationCertaintyPlugin = () =>\n createPayloadSetDivinerPlugin<LocationCertaintyDiviner>(\n { required: { [LocationCertaintySchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await LocationCertaintyDiviner.create(params)) as LocationCertaintyDiviner\n },\n },\n )\n"],"mappings":";AAKO,IAAM,uCAA6E;;;ACL1F,SAAS,uBAAuB;AAGhC,SAAS,kBAAkB,oCAAoC;AAC/D,SAA+D,+BAA+B;AAC9F,SAA0B,sBAAsB;AAEhD,SAAS,sBAAsB;AAOxB,IAAM,2BAAN,MAAM,kCACH,gBAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,oCAAoC;AAAA,EAChH,OAAyB,sBAA8B;AAAA,EACvD,OAAgB,eAAe;AAAA;AAAA,EAG/B,OAAe,cAAc,WAA0D;AACrF,WAAO;AAAA;AAAA,MAEL,KAAK,UAAU,OAAe,CAAC,MAAM,UAAU;AAC7C,eACE,UAAU,OAAO,OACf,QAAQ,OAAO,QACf;AAAA,MAEN,GAAG,OAAO,iBAAiB;AAAA,MAC3B,OAAO,MAAM;AAEX,cAAM,SAAS,UAAU;AAAA,UACvB,CAAC,MAAM,UAAU;AACf,mBAAO,UAAU,OAAO,OAAO,CAAC,QAAQ,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;AAAA,UAC9D;AAAA,UACA,CAAC,GAAG,CAAC;AAAA,QACP;AACA,eAAO,OAAO,CAAC,IAAI,OAAO,CAAC;AAAA,MAC7B,GAAG;AAAA;AAAA,MAEH,KAAK,UAA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A,MACtE,CAAC,EACA,MAAM;AAET,iBAAK,WAAL,mBAAa,IAAI;AACjB,aAAO,CAAC,MAAM;AAAA,IAChB;AACA,WAAO,CAAC;AAAA,EACV;AACF;;;ACvGA,SAAS,2BAAAA,gCAA+B;AACxC,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;AAIvC,IAAM,0BAA0B,MACrC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,wBAAuB,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACvE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,yBAAyB,OAAO,MAAM;AAAA,IACtD;AAAA,EACF;AACF;","names":["LocationCertaintySchema","LocationCertaintySchema"]}
1
+ {"version":3,"sources":["../../src/Diviner/Config.ts","../../src/Diviner/Diviner.ts","../../src/Plugin.ts"],"sourcesContent":["import { DivinerConfig } from '@xyo-network/diviner-model'\nimport { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\nexport const LocationCertaintyDivinerConfigSchema: LocationCertaintyDivinerConfigSchema = 'network.xyo.location.elevation.diviner.config'\n\nexport type LocationCertaintyDivinerConfig<TConfig extends Payload = Payload> = DivinerConfig<\n TConfig & {\n schema: LocationCertaintyDivinerConfigSchema\n targetSchema?: LocationCertaintySchema\n }\n>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerModule, DivinerParams } from '@xyo-network/diviner-model'\nimport { ElevationPayload } from '@xyo-network/elevation-payload-plugin'\nimport { ElevationWitness, ElevationWitnessConfigSchema } from '@xyo-network/elevation-plugin'\nimport { LocationCertaintyHeuristic, LocationCertaintyPayload, LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { LocationPayload, LocationSchema } from '@xyo-network/location-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { LocationCertaintyDivinerConfig, LocationCertaintyDivinerConfigSchema } from './Config.js'\n\nexport type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>\n\nexport class LocationCertaintyDiviner<TParam extends LocationCertaintyDivinerParams = LocationCertaintyDivinerParams>\n extends AbstractDiviner<TParam>\n implements DivinerModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, LocationCertaintyDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = LocationCertaintyDivinerConfigSchema\n static override targetSchema = LocationCertaintySchema\n\n /* Given an array of numbers, find the min/max/mean */\n private static calcHeuristic(heuristic: (number | null)[]): LocationCertaintyHeuristic {\n return {\n // eslint-disable-next-line unicorn/no-array-reduce\n max: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value > prev ? value\n : prev\n )\n }, Number.NEGATIVE_INFINITY),\n mean: (() => {\n // eslint-disable-next-line unicorn/no-array-reduce\n const values = heuristic.reduce<number[]>(\n (prev, value) => {\n return value === null ? prev : [value + prev[0], prev[1] + 1]\n },\n [0, 0],\n )\n return values[0] / values[1]\n })(),\n // eslint-disable-next-line unicorn/no-array-reduce\n min: heuristic.reduce<number>((prev, value) => {\n return (\n value === null ? prev\n : value < prev ? value\n : prev\n )\n }, Number.POSITIVE_INFINITY),\n }\n }\n\n /* Given elevation and location payloads, generate heuristic arrays */\n private static locationsToHeuristics(elevations: ElevationPayload[], locations: LocationPayload[]) {\n // eslint-disable-next-line unicorn/no-array-reduce\n const heuristics = elevations.reduce<{ altitude: (number | null)[]; elevation: number[]; variance: (number | null)[] }>(\n (prev, elev, index) => {\n const elevation = elev.elevation\n if (elevation === undefined || elevation === null) {\n throw new Error('Invalid Elevation')\n }\n const altitude = locations[index].altitude\n prev.altitude.push(altitude ?? null)\n prev.elevation.push(elevation)\n prev.variance.push(altitude !== undefined && altitude !== null ? altitude - elevation : null)\n return prev\n },\n { altitude: [], elevation: [], variance: [] },\n )\n return heuristics\n }\n\n /** @description Given a set of locations, get the expected elevations (witness if needed), and return score/variance */\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const locations = payloads?.filter<LocationPayload>((payload): payload is LocationPayload => payload?.schema === LocationSchema)\n // If this is a query we support\n if (locations && locations?.length > 0) {\n const elevationWitness = await ElevationWitness.create({\n account: this.account,\n config: {\n locations,\n schema: ElevationWitnessConfigSchema,\n },\n })\n const elevations = (await elevationWitness.observe()) as ElevationPayload[]\n\n const heuristics = LocationCertaintyDiviner.locationsToHeuristics(elevations, locations)\n\n const result = await new PayloadBuilder<LocationCertaintyPayload>({ schema: LocationCertaintySchema })\n .fields({\n altitude: LocationCertaintyDiviner.calcHeuristic(heuristics.altitude),\n elevation: LocationCertaintyDiviner.calcHeuristic(heuristics.elevation),\n variance: LocationCertaintyDiviner.calcHeuristic(heuristics.variance),\n })\n .build()\n\n this.logger?.log('LocationCertaintyDiviner.Divine: Processed query')\n return [result]\n }\n return []\n }\n}\n","import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { LocationCertaintyDiviner } from './Diviner/index.js'\n\nexport const LocationCertaintyPlugin = () =>\n createPayloadSetDivinerPlugin<LocationCertaintyDiviner>(\n { required: { [LocationCertaintySchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await LocationCertaintyDiviner.create(params)) as LocationCertaintyDiviner\n },\n },\n )\n"],"mappings":";AAKO,IAAM,uCAA6E;;;ACL1F,SAAS,uBAAuB;AAGhC,SAAS,kBAAkB,oCAAoC;AAC/D,SAA+D,+BAA+B;AAC9F,SAA0B,sBAAsB;AAEhD,SAAS,sBAAsB;AAOxB,IAAM,2BAAN,MAAM,kCACH,gBAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GA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yB,cAAc,UAA0C;AA3EnF;AA4EI,UAAM,YAAY,qCAAU,OAAwB,CAAC,aAAwC,mCAAS,YAAW;AAEjH,QAAI,cAAa,uCAAW,UAAS,GAAG;AACtC,YAAM,mBAAmB,MAAM,iBAAiB,OAAO;AAAA,QACrD,SAAS,KAAK;AAAA,QACd,QAAQ;AAAA,UACN;AAAA,UACA,QAAQ;AAAA,QACV;AAAA,MACF,CAAC;AACD,YAAM,aAAc,MAAM,iBAAiB,QAAQ;AAEnD,YAAM,aAAa,0BAAyB,sBAAsB,YAAY,SAAS;AAEvF,YAAM,SAAS,MAAM,IAAI,eAAyC,EAAE,QAAQ,wBAAwB,CAAC,EAClG,OAAO;AAAA,QACN,UAAU,0BAAyB,cAAc,WAAW,QAAQ;AAAA,QACpE,WAAW,0BAAyB,cAAc,WAAW,SAAS;AAAA,QACtE,UAAU,0BAAyB,cAAc,WAAW,QAAQ;AAAA,MACtE,CAAC,EACA,MAAM;AAET,iBAAK,WAAL,mBAAa,IAAI;AACjB,aAAO,CAAC,MAAM;AAAA,IAChB;AACA,WAAO,CAAC;AAAA,EACV;AACF;;;ACvGA,SAAS,2BAAAA,gCAA+B;AACxC,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;AAIvC,IAAM,0BAA0B,MACrC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,wBAAuB,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACvE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,yBAAyB,OAAO,MAAM;AAAA,IACtD;AAAA,EACF;AACF;","names":["LocationCertaintySchema","LocationCertaintySchema"]}
package/package.json CHANGED
@@ -10,24 +10,24 @@
10
10
  "url": "https://github.com/XYOracleNetwork/plugins/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xyo-network/diviner-abstract": "^2.109.0",
14
- "@xyo-network/diviner-model": "^2.109.0",
15
- "@xyo-network/elevation-payload-plugin": "^2.99.0",
16
- "@xyo-network/elevation-plugin": "^2.99.0",
17
- "@xyo-network/location-certainty-payload-plugin": "^2.99.0",
18
- "@xyo-network/location-payload-plugin": "^2.99.0",
19
- "@xyo-network/module-model": "^2.109.0",
20
- "@xyo-network/payload-builder": "^2.109.0",
21
- "@xyo-network/payload-model": "^2.109.0",
22
- "@xyo-network/payloadset-plugin": "^2.109.0"
13
+ "@xyo-network/diviner-abstract": "^2.110.0",
14
+ "@xyo-network/diviner-model": "^2.110.0",
15
+ "@xyo-network/elevation-payload-plugin": "^2.99.2",
16
+ "@xyo-network/elevation-plugin": "^2.99.2",
17
+ "@xyo-network/location-certainty-payload-plugin": "^2.99.2",
18
+ "@xyo-network/location-payload-plugin": "^2.99.2",
19
+ "@xyo-network/module-model": "^2.110.0",
20
+ "@xyo-network/payload-builder": "^2.110.0",
21
+ "@xyo-network/payload-model": "^2.110.0",
22
+ "@xyo-network/payloadset-plugin": "^2.110.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@xylabs/ts-scripts-yarn3": "^3.11.12",
26
26
  "@xylabs/tsconfig": "^3.11.12",
27
27
  "@xylabs/tsconfig-jest": "^3.11.12",
28
- "@xyo-network/archivist-abstract": "^2.109.0",
29
- "@xyo-network/archivist-memory": "^2.109.0",
30
- "@xyo-network/module-resolver": "^2.109.0",
28
+ "@xyo-network/archivist-abstract": "^2.110.0",
29
+ "@xyo-network/archivist-memory": "^2.110.0",
30
+ "@xyo-network/module-resolver": "^2.110.0",
31
31
  "typescript": "^5.5.3"
32
32
  },
33
33
  "description": "Typescript/Javascript Plugins for XYO Platform",
@@ -69,6 +69,6 @@
69
69
  "url": "https://github.com/XYOracleNetwork/plugins.git"
70
70
  },
71
71
  "sideEffects": false,
72
- "version": "2.99.0",
72
+ "version": "2.99.2",
73
73
  "type": "module"
74
74
  }
@@ -8,7 +8,7 @@ import { AnyConfigSchema } from '@xyo-network/module-model'
8
8
  import { PayloadBuilder } from '@xyo-network/payload-builder'
9
9
  import { Payload, Schema } from '@xyo-network/payload-model'
10
10
 
11
- import { LocationCertaintyDivinerConfig, LocationCertaintyDivinerConfigSchema } from './Config'
11
+ import { LocationCertaintyDivinerConfig, LocationCertaintyDivinerConfigSchema } from './Config.js'
12
12
 
13
13
  export type LocationCertaintyDivinerParams = DivinerParams<AnyConfigSchema<LocationCertaintyDivinerConfig>>
14
14
 
@@ -1,2 +1,2 @@
1
- export * from './Config'
2
- export * from './Diviner'
1
+ export * from './Config.js'
2
+ export * from './Diviner.js'
package/src/Plugin.ts CHANGED
@@ -2,7 +2,7 @@ import { LocationCertaintySchema } from '@xyo-network/location-certainty-payload
2
2
  import { PayloadSetSchema } from '@xyo-network/payload-model'
3
3
  import { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'
4
4
 
5
- import { LocationCertaintyDiviner } from './Diviner'
5
+ import { LocationCertaintyDiviner } from './Diviner/index.js'
6
6
 
7
7
  export const LocationCertaintyPlugin = () =>
8
8
  createPayloadSetDivinerPlugin<LocationCertaintyDiviner>(
package/src/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './Diviner'
1
+ export * from './Diviner/index.js'
2
2
  // eslint-disable-next-line import/no-default-export
3
- export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin'
3
+ export { LocationCertaintyPlugin as default, LocationCertaintyPlugin } from './Plugin.js'