@xyo-network/api 5.3.0 → 5.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.ts +6 -2
  2. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.ts.map +1 -1
  3. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.ts +6 -2
  4. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.ts.map +1 -1
  5. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.ts +2 -1
  6. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.ts.map +1 -1
  7. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.ts +6 -2
  8. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.ts.map +1 -1
  9. package/dist/neutral/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.d.ts +4 -2
  10. package/dist/neutral/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.d.ts.map +1 -1
  11. package/dist/neutral/Diviner/LocationDiviner/Witnesses/LocationWitness.d.ts +4 -2
  12. package/dist/neutral/Diviner/LocationDiviner/Witnesses/LocationWitness.d.ts.map +1 -1
  13. package/dist/neutral/Diviner/RemoteDivinerConfig.d.ts +3 -1
  14. package/dist/neutral/Diviner/RemoteDivinerConfig.d.ts.map +1 -1
  15. package/dist/neutral/index.mjs +15 -10
  16. package/dist/neutral/index.mjs.map +1 -1
  17. package/package.json +8 -8
  18. package/src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.ts +4 -2
  19. package/src/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.ts +4 -2
  20. package/src/Diviner/LocationDiviner/Queries/LocationQuerySchema.ts +4 -2
  21. package/src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.ts +3 -3
  22. package/src/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.ts +2 -2
  23. package/src/Diviner/LocationDiviner/Witnesses/LocationWitness.ts +2 -2
  24. package/src/Diviner/RemoteDivinerConfig.ts +2 -1
@@ -1,7 +1,11 @@
1
1
  import type { LocationWitnessSchema } from '../../Witnesses/index.ts';
2
- export declare const LocationHeatmapQuerySchema: "network.xyo.location.heatmap.query";
2
+ export declare const LocationHeatmapQuerySchema: "network.xyo.location.heatmap.query" & {
3
+ readonly __schema: true;
4
+ };
3
5
  export type LocationHeatmapQuerySchema = typeof LocationHeatmapQuerySchema;
4
- export declare const LocationHeatmapAnswerSchema: "network.xyo.location.heatmap.answer";
6
+ export declare const LocationHeatmapAnswerSchema: "network.xyo.location.heatmap.answer" & {
7
+ readonly __schema: true;
8
+ };
5
9
  export type LocationHeatmapAnswerSchema = typeof LocationHeatmapAnswerSchema;
6
10
  export type LocationHeatmapQuery = {
7
11
  schema: LocationWitnessSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"LocationHeatmapQuery.d.ts","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAErE,eAAO,MAAM,0BAA0B,EAAG,oCAA6C,CAAA;AACvF,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAA;AAE1E,eAAO,MAAM,2BAA2B,EAAG,qCAA8C,CAAA;AACzF,MAAM,MAAM,2BAA2B,GAAG,OAAO,2BAA2B,CAAA;AAE5E,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,qBAAqB,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,KAAK,IAAI,oBAEhF,CAAA"}
1
+ {"version":3,"file":"LocationHeatmapQuery.d.ts","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAErE,eAAO,MAAM,0BAA0B;;CAAuD,CAAA;AAC9F,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAA;AAE1E,eAAO,MAAM,2BAA2B;;CAAwD,CAAA;AAChG,MAAM,MAAM,2BAA2B,GAAG,OAAO,2BAA2B,CAAA;AAE5E,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,qBAAqB,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,KAAK,IAAI,oBAEhF,CAAA"}
@@ -1,7 +1,11 @@
1
1
  import type { LocationWitnessSchema } from '../../Witnesses/index.ts';
2
- export declare const LocationQuadkeyHeatmapQuerySchema: "network.xyo.location.heatmap.quadkey.query";
2
+ export declare const LocationQuadkeyHeatmapQuerySchema: "network.xyo.location.heatmap.quadkey.query" & {
3
+ readonly __schema: true;
4
+ };
3
5
  export type LocationQuadkeyHeatmapQuerySchema = typeof LocationQuadkeyHeatmapQuerySchema;
4
- export declare const LocationQuadkeyHeatmapAnswerSchema: "network.xyo.location.heatmap.quadkey.answer";
6
+ export declare const LocationQuadkeyHeatmapAnswerSchema: "network.xyo.location.heatmap.quadkey.answer" & {
7
+ readonly __schema: true;
8
+ };
5
9
  export type LocationQuadkeyHeatmapAnswerSchema = typeof LocationQuadkeyHeatmapAnswerSchema;
6
10
  export type LocationQuadkeyHeatmapQuery = {
7
11
  schema: LocationWitnessSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"LocationQuadkeyHeatmapQuery.d.ts","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAErE,eAAO,MAAM,iCAAiC,EAAG,4CAAqD,CAAA;AACtG,MAAM,MAAM,iCAAiC,GAAG,OAAO,iCAAiC,CAAA;AAExF,eAAO,MAAM,kCAAkC,EAAG,6CAAsD,CAAA;AACxG,MAAM,MAAM,kCAAkC,GAAG,OAAO,kCAAkC,CAAA;AAE1F,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,EAAE,qBAAqB,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,6BAA6B,GAAI,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,KAAK,IAAI,2BAEvF,CAAA"}
1
+ {"version":3,"file":"LocationQuadkeyHeatmapQuery.d.ts","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAErE,eAAO,MAAM,iCAAiC;;CAA+D,CAAA;AAC7G,MAAM,MAAM,iCAAiC,GAAG,OAAO,iCAAiC,CAAA;AAExF,eAAO,MAAM,kCAAkC;;CAAgE,CAAA;AAC/G,MAAM,MAAM,kCAAkC,GAAG,OAAO,kCAAkC,CAAA;AAE1F,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,EAAE,qBAAqB,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,6BAA6B,GAAI,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,KAAK,IAAI,2BAEvF,CAAA"}
@@ -1,6 +1,7 @@
1
+ import type { Schema } from '@xyo-network/payload-model';
1
2
  import type { LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.ts';
2
3
  import type { LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.ts';
3
4
  import type { LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery/index.ts';
4
5
  export type LocationQuerySchema = LocationQuadkeyHeatmapQuerySchema | LocationHeatmapQuerySchema | LocationTimeRangeQuerySchema;
5
- export declare const isSupportedLocationQuerySchema: (schema: string) => schema is LocationQuerySchema;
6
+ export declare const isSupportedLocationQuerySchema: (schema: Schema) => schema is LocationQuerySchema;
6
7
  //# sourceMappingURL=LocationQuerySchema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LocationQuerySchema.d.ts","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Queries/LocationQuerySchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AACjF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAA;AAC/F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAErF,MAAM,MAAM,mBAAmB,GAAG,iCAAiC,GAAG,0BAA0B,GAAG,4BAA4B,CAAA;AAQ/H,eAAO,MAAM,8BAA8B,GAAI,QAAQ,MAAM,KAAG,MAAM,IAAI,mBAEzE,CAAA"}
1
+ {"version":3,"file":"LocationQuerySchema.d.ts","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Queries/LocationQuerySchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AACjF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAA;AAC/F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAErF,MAAM,MAAM,mBAAmB,GAAG,iCAAiC,GAAG,0BAA0B,GAAG,4BAA4B,CAAA;AAQ/H,eAAO,MAAM,8BAA8B,GAAI,QAAQ,MAAM,KAAG,MAAM,IAAI,mBAEzE,CAAA"}
@@ -1,7 +1,11 @@
1
1
  import { LocationWitnessSchema } from '../../Witnesses/index.ts';
2
- export declare const LocationTimeRangeQuerySchema: "network.xyo.location.range.query";
2
+ export declare const LocationTimeRangeQuerySchema: "network.xyo.location.range.query" & {
3
+ readonly __schema: true;
4
+ };
3
5
  export type LocationTimeRangeQuerySchema = typeof LocationTimeRangeQuerySchema;
4
- export declare const LocationTimeRangeAnswerSchema: "network.xyo.location.range.answer";
6
+ export declare const LocationTimeRangeAnswerSchema: "network.xyo.location.range.answer" & {
7
+ readonly __schema: true;
8
+ };
5
9
  export type LocationTimeRangeAnswerSchema = typeof LocationTimeRangeAnswerSchema;
6
10
  export type LocationTimeRangeQuery = {
7
11
  schema: LocationWitnessSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"LocationTimeRangeQuery.d.ts","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,eAAO,MAAM,4BAA4B,EAAG,kCAA2C,CAAA;AACvF,MAAM,MAAM,4BAA4B,GAAG,OAAO,4BAA4B,CAAA;AAE9E,eAAO,MAAM,6BAA6B,EAAG,mCAA4C,CAAA;AACzF,MAAM,MAAM,6BAA6B,GAAG,OAAO,6BAA6B,CAAA;AAEhF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,qBAAqB,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAGlB,CAAA;AAED,eAAO,MAAM,wBAAwB,2EAAqC,CAAA"}
1
+ {"version":3,"file":"LocationTimeRangeQuery.d.ts","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,eAAO,MAAM,4BAA4B;;CAAqD,CAAA;AAC9F,MAAM,MAAM,4BAA4B,GAAG,OAAO,4BAA4B,CAAA;AAE9E,eAAO,MAAM,6BAA6B;;CAAsD,CAAA;AAChG,MAAM,MAAM,6BAA6B,GAAG,OAAO,6BAA6B,CAAA;AAEhF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,qBAAqB,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAGlB,CAAA;AAED,eAAO,MAAM,wBAAwB,2EAAqC,CAAA"}
@@ -1,5 +1,7 @@
1
- import type { Payload } from '@xyo-network/payload-model';
2
- export declare const CurrentLocationWitnessSchema: "co.coinapp.currentlocationwitness";
1
+ import { type Payload } from '@xyo-network/payload-model';
2
+ export declare const CurrentLocationWitnessSchema: "co.coinapp.currentlocationwitness" & {
3
+ readonly __schema: true;
4
+ };
3
5
  export type CurrentLocationWitnessSchema = typeof CurrentLocationWitnessSchema;
4
6
  export type CurrentLocationWitnessPayload = Payload<{
5
7
  altitudeMeters: number;
@@ -1 +1 @@
1
- {"version":3,"file":"CurrentLocationWitness.d.ts","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,eAAO,MAAM,4BAA4B,EAAG,mCAA4C,CAAA;AACxF,MAAM,MAAM,4BAA4B,GAAG,OAAO,4BAA4B,CAAA;AAE9E,MAAM,MAAM,6BAA6B,GAAG,OAAO,CAAC;IAClD,cAAc,EAAE,MAAM,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,4BAA4B,CAAA;IACpC,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAC,CAAA"}
1
+ {"version":3,"file":"CurrentLocationWitness.d.ts","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEnE,eAAO,MAAM,4BAA4B;;CAAsD,CAAA;AAC/F,MAAM,MAAM,4BAA4B,GAAG,OAAO,4BAA4B,CAAA;AAE9E,MAAM,MAAM,6BAA6B,GAAG,OAAO,CAAC;IAClD,cAAc,EAAE,MAAM,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,4BAA4B,CAAA;IACpC,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAC,CAAA"}
@@ -1,5 +1,7 @@
1
- import type { Payload } from '@xyo-network/payload-model';
2
- export declare const LocationWitnessSchema: "network.xyo.location";
1
+ import { type Payload } from '@xyo-network/payload-model';
2
+ export declare const LocationWitnessSchema: "network.xyo.location" & {
3
+ readonly __schema: true;
4
+ };
3
5
  export type LocationWitnessSchema = typeof LocationWitnessSchema;
4
6
  export interface Coordinates {
5
7
  accuracy: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"LocationWitness.d.ts","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Witnesses/LocationWitness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,eAAO,MAAM,qBAAqB,EAAG,sBAA+B,CAAA;AACpE,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,CAAA;AAEhE,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AACD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,WAAW,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC;IAC3C,eAAe,EAAE,eAAe,CAAA;IAChC,MAAM,EAAE,qBAAqB,CAAA;CAC9B,CAAC,CAAA"}
1
+ {"version":3,"file":"LocationWitness.d.ts","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Witnesses/LocationWitness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEnE,eAAO,MAAM,qBAAqB;;CAAyC,CAAA;AAC3E,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,CAAA;AAEhE,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AACD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,WAAW,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC;IAC3C,eAAe,EAAE,eAAe,CAAA;IAChC,MAAM,EAAE,qBAAqB,CAAA;CAC9B,CAAC,CAAA"}
@@ -1,6 +1,8 @@
1
1
  import type { DivinerConfig } from '@xyo-network/diviner-model';
2
2
  import type { ArchivistApi } from '../Api/index.ts';
3
- export declare const RemoteDivinerConfigSchema: "network.xyo.diviner.remote.config";
3
+ export declare const RemoteDivinerConfigSchema: "network.xyo.diviner.remote.config" & {
4
+ readonly __schema: true;
5
+ };
4
6
  export type RemoteDivinerConfigSchema = typeof RemoteDivinerConfigSchema;
5
7
  export type RemoteDivinerConfig = DivinerConfig & {
6
8
  /** @deprecated use in params instead */
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteDivinerConfig.d.ts","sourceRoot":"","sources":["../../../src/Diviner/RemoteDivinerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAEnD,eAAO,MAAM,yBAAyB,EAAG,mCAA4C,CAAA;AACrF,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAA;AAExE,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAChD,wCAAwC;IACxC,GAAG,CAAC,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,yBAAyB,CAAA;CAClC,CAAA"}
1
+ {"version":3,"file":"RemoteDivinerConfig.d.ts","sourceRoot":"","sources":["../../../src/Diviner/RemoteDivinerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAG/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAEnD,eAAO,MAAM,yBAAyB;;CAAsD,CAAA;AAC5F,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAA;AAExE,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAChD,wCAAwC;IACxC,GAAG,CAAC,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,yBAAyB,CAAA;CAClC,CAAA"}
@@ -206,15 +206,17 @@ var LocationDivinerApi = class {
206
206
  };
207
207
 
208
208
  // src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.ts
209
- var LocationHeatmapQuerySchema = "network.xyo.location.heatmap.query";
210
- var LocationHeatmapAnswerSchema = "network.xyo.location.heatmap.answer";
209
+ import { asSchema } from "@xyo-network/payload-model";
210
+ var LocationHeatmapQuerySchema = asSchema("network.xyo.location.heatmap.query", true);
211
+ var LocationHeatmapAnswerSchema = asSchema("network.xyo.location.heatmap.answer", true);
211
212
  var isLocationHeatmapQuery = (query) => {
212
213
  return query && query?.schema === LocationHeatmapQuerySchema;
213
214
  };
214
215
 
215
216
  // src/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.ts
216
- var LocationQuadkeyHeatmapQuerySchema = "network.xyo.location.heatmap.quadkey.query";
217
- var LocationQuadkeyHeatmapAnswerSchema = "network.xyo.location.heatmap.quadkey.answer";
217
+ import { asSchema as asSchema2 } from "@xyo-network/payload-model";
218
+ var LocationQuadkeyHeatmapQuerySchema = asSchema2("network.xyo.location.heatmap.quadkey.query", true);
219
+ var LocationQuadkeyHeatmapAnswerSchema = asSchema2("network.xyo.location.heatmap.quadkey.answer", true);
218
220
  var isLocationQuadkeyHeatmapQuery = (query) => {
219
221
  return query && query?.schema === LocationQuadkeyHeatmapQuerySchema;
220
222
  };
@@ -230,21 +232,24 @@ var isSupportedLocationQuerySchema = (schema) => {
230
232
  };
231
233
 
232
234
  // src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.ts
233
- import { isPayload } from "@xyo-network/payload-model";
235
+ import { asSchema as asSchema5, isPayload } from "@xyo-network/payload-model";
234
236
 
235
237
  // src/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.ts
236
- var CurrentLocationWitnessSchema = "co.coinapp.currentlocationwitness";
238
+ import { asSchema as asSchema3 } from "@xyo-network/payload-model";
239
+ var CurrentLocationWitnessSchema = asSchema3("co.coinapp.currentlocationwitness", true);
237
240
 
238
241
  // src/Diviner/LocationDiviner/Witnesses/LocationWitness.ts
239
- var LocationWitnessSchema = "network.xyo.location";
242
+ import { asSchema as asSchema4 } from "@xyo-network/payload-model";
243
+ var LocationWitnessSchema = asSchema4("network.xyo.location", true);
240
244
 
241
245
  // src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.ts
242
- var LocationTimeRangeQuerySchema = "network.xyo.location.range.query";
243
- var LocationTimeRangeAnswerSchema = "network.xyo.location.range.answer";
246
+ var LocationTimeRangeQuerySchema = asSchema5("network.xyo.location.range.query", true);
247
+ var LocationTimeRangeAnswerSchema = asSchema5("network.xyo.location.range.answer", true);
244
248
  var isLocationTimeRangeQuery = isPayload([LocationWitnessSchema]);
245
249
 
246
250
  // src/Diviner/RemoteDivinerConfig.ts
247
- var RemoteDivinerConfigSchema = "network.xyo.diviner.remote.config";
251
+ import { asSchema as asSchema6 } from "@xyo-network/payload-model";
252
+ var RemoteDivinerConfigSchema = asSchema6("network.xyo.diviner.remote.config", true);
248
253
 
249
254
  // src/Diviner/RemoteDivinerError.ts
250
255
  import { isString as isString2 } from "@xylabs/sdk-js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Api/Api.ts","../../src/Base.ts","../../src/objToQuery.ts","../../src/Simple.ts","../../src/Diviner/LocationDiviner/LocationDivinerApi.ts","../../src/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.ts","../../src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.ts","../../src/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.ts","../../src/Diviner/LocationDiviner/Queries/LocationQuerySchema.ts","../../src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.ts","../../src/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.ts","../../src/Diviner/LocationDiviner/Witnesses/LocationWitness.ts","../../src/Diviner/RemoteDivinerConfig.ts","../../src/Diviner/RemoteDivinerError.ts"],"sourcesContent":["import type { ApiConfig } from '@xyo-network/api-models'\nimport { Huri } from '@xyo-network/huri'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport { ApiSimple } from '../Simple.ts'\n\nexport class ArchivistApi<C extends ApiConfig = ApiConfig> extends ApiSimple<Payload[], C> {\n huri(huri: Huri | string) {\n const huriObj = typeof huri === 'string' ? new Huri(huri) : huri\n return new ApiSimple<Payload>({\n ...this.config,\n root: `${this.root}${huriObj.href}/`,\n })\n }\n}\n","import { axiosJsonConfig, isString } from '@xylabs/sdk-js'\nimport type {\n ApiConfig,\n ApiEnvelope,\n ApiError,\n ApiReportable,\n ApiResponse,\n ApiResponseBody,\n ApiResponseTuple,\n ApiResponseTupleOrBody,\n ApiResponseType,\n} from '@xyo-network/api-models'\nimport { Axios } from 'axios'\n\nexport class ApiBase<C extends ApiConfig = ApiConfig> implements ApiReportable {\n readonly config: C\n protected axios: Axios\n\n constructor(config: C) {\n this.config = config\n this.axios = new Axios(axiosJsonConfig({ ...this.config, headers: this.headers }))\n }\n\n get authenticated() {\n return isString(this.config.apiKey) || isString(this.config.jwtToken)\n }\n\n protected get headers(): Record<string, string> {\n const headers: Record<string, string> = {}\n if (isString(this.config.jwtToken)) {\n headers.Authorization = `Bearer ${this.config.jwtToken}`\n }\n if (isString(this.config.apiKey)) {\n headers['x-api-key'] = this.config.apiKey\n }\n return headers\n }\n\n protected get query() {\n return this.config.query ?? ''\n }\n\n protected get root() {\n return this.config.root ?? '/'\n }\n\n private static resolveResponse<T>(result?: ApiResponse<ApiEnvelope<T>>) {\n return [result?.data?.data, result?.data, result] as ApiResponseTuple<T>\n }\n\n private static shapeResponse<T = unknown>(response: ApiResponse<ApiEnvelope<T>> | undefined, responseType?: ApiResponseType) {\n const resolvedResponse = ApiBase.resolveResponse(response)\n return responseType === 'tuple' ? resolvedResponse : resolvedResponse[0]\n }\n\n onError(error: ApiError, depth = 0) {\n this.config.reportableParent?.onError?.(error, depth + 1)\n this.config.onError?.(error, depth)\n }\n\n onFailure(response: ApiResponse, depth = 0) {\n this.config.reportableParent?.onFailure?.(response, depth + 1)\n this.config.onFailure?.(response, depth)\n }\n\n onSuccess(response: ApiResponse, depth = 0) {\n this.config.reportableParent?.onSuccess?.(response, depth + 1)\n this.config.onSuccess?.(response, depth)\n }\n\n protected async deleteEndpoint<T = unknown>(endPoint?: string): Promise<ApiResponseBody<T>>\n protected async deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<ApiResponseBody<T>>\n protected async deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n protected async deleteEndpoint<T = unknown>(endPoint = '', responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n const response = await this.monitorResponse<T>(async () => {\n return await this.axios.delete<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>>>(`${this.resolveRoot()}${endPoint}${this.query}`)\n })\n return ApiBase.shapeResponse<T>(response, responseType)\n }\n\n protected async getEndpoint<T = unknown>(endPoint?: string): Promise<ApiResponseBody<T>>\n protected async getEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<ApiResponseBody<T>>\n protected async getEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n protected async getEndpoint<T = unknown>(endPoint = '', responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n const response = await this.monitorResponse<T>(async () => {\n return await this.axios.get<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>>>(`${this.resolveRoot()}${endPoint}${this.query}`)\n })\n return ApiBase.shapeResponse<T>(response, responseType)\n }\n\n protected handleMonitorResponseError<T>(error: ApiError, trapAxiosException: boolean) {\n if (!error.isError) {\n throw error\n }\n\n if (trapAxiosException) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n error.response ? this.onFailure(error.response) : this.onError(error)\n if (this.config.throwFailure) {\n throw error\n }\n return error.response as ApiResponse<ApiEnvelope<T>>\n }\n }\n\n protected async monitorResponse<T>(closure: () => Promise<ApiResponse<ApiEnvelope<T>>>) {\n // we use this to prevent accidental catching on exceptions in callbacks\n let trapAxiosException = true\n try {\n const response = await closure()\n // eslint-disable-next-line sonarjs/no-dead-store\n trapAxiosException = false\n\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n response.status < 300 ? this.onSuccess(response) : this.onFailure(response)\n\n return response\n } catch (error) {\n this.handleMonitorResponseError(error as ApiError, trapAxiosException)\n }\n }\n\n protected async postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<ApiResponseBody<T>>\n protected async postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>\n protected async postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n protected async postEndpoint<T = unknown, D = unknown>(\n endPoint = '',\n data?: D,\n responseType?: ApiResponseType,\n ): Promise<ApiResponseTupleOrBody<T>> {\n const response = await this.monitorResponse<T>(async () => {\n return await this.axios.post<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>, D>, D>(`${this.resolveRoot()}${endPoint}${this.query}`, data)\n })\n return ApiBase.shapeResponse<T>(response, responseType)\n }\n\n protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<ApiResponseBody<T>>\n protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>\n protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n protected async putEndpoint<T = unknown, D = unknown>(endPoint = '', data?: D, responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n const response = await this.monitorResponse<T>(async () => {\n return await this.axios.put<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>, D>, D>(`${this.resolveRoot()}${endPoint}${this.query}`, data)\n })\n return ApiBase.shapeResponse<T>(response, responseType)\n }\n\n private resolveRoot() {\n return `${this.config.apiDomain}${this.root}`\n }\n}\n","export const objToQuery = (obj: Record<string, string | number | undefined>) => {\n return `?${Object.entries(obj)\n .map(([key, value]) => {\n return `${key}=${value}`\n })\n .filter(value => value !== undefined)\n .join('&')}`\n}\n","import type {\n ApiConfig, ApiResponseBody, ApiResponseTuple, ApiResponseTupleOrBody, ApiResponseType,\n} from '@xyo-network/api-models'\nimport type { Payload, PayloadFindFilter } from '@xyo-network/payload-model'\n\nimport { ApiBase } from './Base.ts'\nimport { objToQuery } from './objToQuery.ts'\n\nexport type ApiSimpleQuery = PayloadFindFilter\n\nexport class ApiSimple<T = Payload, D = T, Q extends ApiSimpleQuery = ApiSimpleQuery, C extends ApiConfig = ApiConfig> extends ApiBase<C> {\n async delete(): Promise<ApiResponseBody<T>>\n async delete(responseType?: 'body'): Promise<ApiResponseBody<T>>\n async delete(responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n async delete(responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n switch (responseType) {\n case 'tuple': {\n return await this.deleteEndpoint(undefined, 'tuple')\n }\n default: {\n return await this.deleteEndpoint()\n }\n }\n }\n\n async find(query?: Q): Promise<ApiResponseBody<T>>\n async find(query?: Q, responseType?: 'body'): Promise<ApiResponseBody<T>>\n async find(query?: Q, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n async find(query = {}, responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n switch (responseType) {\n case 'tuple': {\n return await this.getEndpoint(objToQuery(query), 'tuple')\n }\n default: {\n return await this.getEndpoint(objToQuery(query))\n }\n }\n }\n\n async get(): Promise<ApiResponseBody<T>>\n async get(responseType?: 'body'): Promise<ApiResponseBody<T>>\n async get(responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n async get(responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n switch (responseType) {\n case 'tuple': {\n return await this.getEndpoint(undefined, 'tuple')\n }\n default: {\n return await this.getEndpoint()\n }\n }\n }\n\n async post(data?: D): Promise<ApiResponseBody<T>>\n async post(data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>\n async post(data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n async post(data?: D, responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n switch (responseType) {\n case 'tuple': {\n return await this.postEndpoint(undefined, data, 'tuple')\n }\n default: {\n return await this.postEndpoint(undefined, data)\n }\n }\n }\n\n async put(data?: D): Promise<ApiResponseBody<T>>\n async put(data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>\n async put(data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n async put(data?: D, responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n switch (responseType) {\n case 'tuple': {\n return await this.putEndpoint(undefined, data, 'tuple')\n }\n default: {\n return await this.putEndpoint(undefined, data)\n }\n }\n }\n}\n","import { axiosJson } from '@xylabs/sdk-js'\nimport type { ApiConfig } from '@xyo-network/api-models'\nimport type { RawAxiosRequestConfig } from 'axios'\n\nimport { getLocationDivinerApiResponseTransformer } from './LocationDivinerApiResponseTransformer.ts'\nimport type { GetLocationQueryResponse } from './models.ts'\nimport type { LocationQueryCreationResponse, SupportedLocationQueryCreationRequest } from './Queries/index.ts'\n\nclass LocationDivinerApi {\n config: ApiConfig\n constructor(config: ApiConfig) {\n this.config = config\n }\n\n private get axiosRequestConfig(): RawAxiosRequestConfig {\n return { transformResponse: getLocationDivinerApiResponseTransformer() }\n }\n\n async getLocationQuery(hash: string) {\n return (await axiosJson.get<GetLocationQueryResponse>(`${this.config.apiDomain}/location/query/${hash}`, this.axiosRequestConfig)).data\n }\n\n async postLocationQuery(request: SupportedLocationQueryCreationRequest) {\n return (await axiosJson.post<LocationQueryCreationResponse>(`${this.config.apiDomain}/location/query`, { ...request }, this.axiosRequestConfig)).data\n }\n}\n\nexport { LocationDivinerApi }\n","import type { AxiosResponseTransformer } from 'axios'\nimport axios from 'axios'\n\nexport const locationDivinerApiResponseTransformer: AxiosResponseTransformer = (data, _headers) => {\n return data.data\n}\n\n/**\n * Gets the response transformers for the LocationDiviner API. Done as a method instead of a property\n * to allow detection of dynamically added response transformers.\n * @param axiosInstance The axios instance (defaults to the global instance if none provided)\n * @returns the response transformers for the LocationDiviner API\n */\nexport const getLocationDivinerApiResponseTransformer = (axiosInstance = axios): AxiosResponseTransformer[] => {\n // If there's any existing response transforms preserve them and\n // append our response transform, otherwise just return ours\n return axiosInstance.defaults.transformResponse\n ? [\n ...(Array.isArray(axiosInstance.defaults.transformResponse)\n ? axiosInstance.defaults.transformResponse\n : [axiosInstance.defaults.transformResponse]),\n locationDivinerApiResponseTransformer,\n ]\n : [locationDivinerApiResponseTransformer]\n}\n","import type { LocationWitnessSchema } from '../../Witnesses/index.ts'\n\nexport const LocationHeatmapQuerySchema = 'network.xyo.location.heatmap.query' as const\nexport type LocationHeatmapQuerySchema = typeof LocationHeatmapQuerySchema\n\nexport const LocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer' as const\nexport type LocationHeatmapAnswerSchema = typeof LocationHeatmapAnswerSchema\n\nexport type LocationHeatmapQuery = {\n schema: LocationWitnessSchema\n startTime?: string\n stopTime?: string\n}\n\nexport const isLocationHeatmapQuery = (query: Record<string, unknown>): query is LocationHeatmapQuery => {\n return query && query?.schema === LocationHeatmapQuerySchema\n}\n","import type { LocationWitnessSchema } from '../../Witnesses/index.ts'\n\nexport const LocationQuadkeyHeatmapQuerySchema = 'network.xyo.location.heatmap.quadkey.query' as const\nexport type LocationQuadkeyHeatmapQuerySchema = typeof LocationQuadkeyHeatmapQuerySchema\n\nexport const LocationQuadkeyHeatmapAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer' as const\nexport type LocationQuadkeyHeatmapAnswerSchema = typeof LocationQuadkeyHeatmapAnswerSchema\n\nexport type LocationQuadkeyHeatmapQuery = {\n schema: LocationWitnessSchema\n startTime?: string\n stopTime?: string\n}\n\nexport const isLocationQuadkeyHeatmapQuery = (query: Record<string, unknown>): query is LocationQuadkeyHeatmapQuery => {\n return query && query?.schema === LocationQuadkeyHeatmapQuerySchema\n}\n","import type { LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.ts'\nimport type { LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.ts'\nimport type { LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery/index.ts'\n\nexport type LocationQuerySchema = LocationQuadkeyHeatmapQuerySchema | LocationHeatmapQuerySchema | LocationTimeRangeQuerySchema\n\nconst locationQuerySchemas: Record<LocationQuerySchema, true> = {\n 'network.xyo.location.heatmap.quadkey.query': true,\n 'network.xyo.location.heatmap.query': true,\n 'network.xyo.location.range.query': true,\n}\n\nexport const isSupportedLocationQuerySchema = (schema: string): schema is LocationQuerySchema => {\n return locationQuerySchemas[schema as LocationQuerySchema] || false\n}\n","import { isPayload } from '@xyo-network/payload-model'\n\nimport { LocationWitnessSchema } from '../../Witnesses/index.ts'\n\nexport const LocationTimeRangeQuerySchema = 'network.xyo.location.range.query' as const\nexport type LocationTimeRangeQuerySchema = typeof LocationTimeRangeQuerySchema\n\nexport const LocationTimeRangeAnswerSchema = 'network.xyo.location.range.answer' as const\nexport type LocationTimeRangeAnswerSchema = typeof LocationTimeRangeAnswerSchema\n\nexport type LocationTimeRangeQuery = {\n schema: LocationWitnessSchema\n startTime?: string\n stopTime?: string\n\n // TODO: Bounding rectangle, etc.\n}\n\nexport const isLocationTimeRangeQuery = isPayload([LocationWitnessSchema])\n","import type { Payload } from '@xyo-network/payload-model'\n\nexport const CurrentLocationWitnessSchema = 'co.coinapp.currentlocationwitness' as const\nexport type CurrentLocationWitnessSchema = typeof CurrentLocationWitnessSchema\n\nexport type CurrentLocationWitnessPayload = Payload<{\n altitudeMeters: number\n directionDegrees: number\n latitude: number\n longitude: number\n quadkey: string\n schema: CurrentLocationWitnessSchema\n speedKph: number\n}>\n","import type { Payload } from '@xyo-network/payload-model'\n\nexport const LocationWitnessSchema = 'network.xyo.location' as const\nexport type LocationWitnessSchema = typeof LocationWitnessSchema\n\nexport interface Coordinates {\n accuracy: number | null\n altitude: number | null\n altitudeAccuracy: number | null\n heading: number | null\n latitude: number\n longitude: number\n speed: number | null\n}\nexport interface CurrentLocation {\n coords: Coordinates\n timestamp: number\n}\n\nexport type LocationWitnessPayload = Payload<{\n currentLocation: CurrentLocation\n schema: LocationWitnessSchema\n}>\n","import type { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport type { ArchivistApi } from '../Api/index.ts'\n\nexport const RemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config' as const\nexport type RemoteDivinerConfigSchema = typeof RemoteDivinerConfigSchema\n\nexport type RemoteDivinerConfig = DivinerConfig & {\n /** @deprecated use in params instead */\n api?: ArchivistApi\n archive?: string\n schema: RemoteDivinerConfigSchema\n}\n","import { isString } from '@xylabs/sdk-js'\n\nexport class RemoteDivinerError extends Error {\n isRemoteDivinerError = true\n constructor(action: string, error: Error['cause'], message?: string) {\n const messageString = isString(message) ? ` (${message})` : ''\n super(`Remote Diviner [${action}] failed${messageString}`, { cause: error })\n }\n\n static isRemoteDivinerError(error: unknown): RemoteDivinerError | undefined {\n return (error as RemoteDivinerError).isRemoteDivinerError ? (error as RemoteDivinerError) : undefined\n }\n}\n"],"mappings":";AACA,SAAS,YAAY;;;ACDrB,SAAS,iBAAiB,gBAAgB;AAY1C,SAAS,aAAa;AAEf,IAAM,UAAN,MAAM,SAAkE;AAAA,EACpE;AAAA,EACC;AAAA,EAEV,YAAY,QAAW;AACrB,SAAK,SAAS;AACd,SAAK,QAAQ,IAAI,MAAM,gBAAgB,EAAE,GAAG,KAAK,QAAQ,SAAS,KAAK,QAAQ,CAAC,CAAC;AAAA,EACnF;AAAA,EAEA,IAAI,gBAAgB;AAClB,WAAO,SAAS,KAAK,OAAO,MAAM,KAAK,SAAS,KAAK,OAAO,QAAQ;AAAA,EACtE;AAAA,EAEA,IAAc,UAAkC;AAC9C,UAAM,UAAkC,CAAC;AACzC,QAAI,SAAS,KAAK,OAAO,QAAQ,GAAG;AAClC,cAAQ,gBAAgB,UAAU,KAAK,OAAO,QAAQ;AAAA,IACxD;AACA,QAAI,SAAS,KAAK,OAAO,MAAM,GAAG;AAChC,cAAQ,WAAW,IAAI,KAAK,OAAO;AAAA,IACrC;AACA,WAAO;AAAA,EACT;AAAA,EAEA,IAAc,QAAQ;AACpB,WAAO,KAAK,OAAO,SAAS;AAAA,EAC9B;AAAA,EAEA,IAAc,OAAO;AACnB,WAAO,KAAK,OAAO,QAAQ;AAAA,EAC7B;AAAA,EAEA,OAAe,gBAAmB,QAAsC;AACtE,WAAO,CAAC,QAAQ,MAAM,MAAM,QAAQ,MAAM,MAAM;AAAA,EAClD;AAAA,EAEA,OAAe,cAA2B,UAAmD,cAAgC;AAC3H,UAAM,mBAAmB,SAAQ,gBAAgB,QAAQ;AACzD,WAAO,iBAAiB,UAAU,mBAAmB,iBAAiB,CAAC;AAAA,EACzE;AAAA,EAEA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AiC,CAAC,WAAkD;AAC/F,SAAO,qBAAqB,MAA6B,KAAK;AAChE;;;ACdA,SAAS,iBAAiB;;;ACEnB,IAAM,+BAA+B;;;ACArC,IAAM,wBAAwB;;;AFE9B,IAAM,+BAA+B;AAGrC,IAAM,gCAAgC;AAWtC,IAAM,2BAA2B,UAAU,CAAC,qBAAqB,CAAC;;;AGdlE,IAAM,4BAA4B;;;ACJzC,SAAS,YAAAA,iBAAgB;AAElB,IAAM,qBAAN,cAAiC,MAAM;AAAA,EAC5C,uBAAuB;AAAA,EACvB,YAAY,QAAgB,OAAuB,SAAkB;AACnE,UAAM,gBAAgBA,UAAS,OAAO,IAAI,KAAK,OAAO,MAAM;AAC5D,UAAM,mBAAmB,MAAM,WAAW,aAAa,IAAI,EAAE,OAAO,MAAM,CAAC;AAAA,EAC7E;AAAA,EAEA,OAAO,qBAAqB,OAAgD;AAC1E,WAAQ,MAA6B,uBAAwB,QAA+B;AAAA,EAC9F;AACF;","names":["isString"]}
1
+ {"version":3,"sources":["../../src/Api/Api.ts","../../src/Base.ts","../../src/objToQuery.ts","../../src/Simple.ts","../../src/Diviner/LocationDiviner/LocationDivinerApi.ts","../../src/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.ts","../../src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.ts","../../src/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.ts","../../src/Diviner/LocationDiviner/Queries/LocationQuerySchema.ts","../../src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.ts","../../src/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.ts","../../src/Diviner/LocationDiviner/Witnesses/LocationWitness.ts","../../src/Diviner/RemoteDivinerConfig.ts","../../src/Diviner/RemoteDivinerError.ts"],"sourcesContent":["import type { ApiConfig } from '@xyo-network/api-models'\nimport { Huri } from '@xyo-network/huri'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport { ApiSimple } from '../Simple.ts'\n\nexport class ArchivistApi<C extends ApiConfig = ApiConfig> extends ApiSimple<Payload[], C> {\n huri(huri: Huri | string) {\n const huriObj = typeof huri === 'string' ? new Huri(huri) : huri\n return new ApiSimple<Payload>({\n ...this.config,\n root: `${this.root}${huriObj.href}/`,\n })\n }\n}\n","import { axiosJsonConfig, isString } from '@xylabs/sdk-js'\nimport type {\n ApiConfig,\n ApiEnvelope,\n ApiError,\n ApiReportable,\n ApiResponse,\n ApiResponseBody,\n ApiResponseTuple,\n ApiResponseTupleOrBody,\n ApiResponseType,\n} from '@xyo-network/api-models'\nimport { Axios } from 'axios'\n\nexport class ApiBase<C extends ApiConfig = ApiConfig> implements ApiReportable {\n readonly config: C\n protected axios: Axios\n\n constructor(config: C) {\n this.config = config\n this.axios = new Axios(axiosJsonConfig({ ...this.config, headers: this.headers }))\n }\n\n get authenticated() {\n return isString(this.config.apiKey) || isString(this.config.jwtToken)\n }\n\n protected get headers(): Record<string, string> {\n const headers: Record<string, string> = {}\n if (isString(this.config.jwtToken)) {\n headers.Authorization = `Bearer ${this.config.jwtToken}`\n }\n if (isString(this.config.apiKey)) {\n headers['x-api-key'] = this.config.apiKey\n }\n return headers\n }\n\n protected get query() {\n return this.config.query ?? ''\n }\n\n protected get root() {\n return this.config.root ?? '/'\n }\n\n private static resolveResponse<T>(result?: ApiResponse<ApiEnvelope<T>>) {\n return [result?.data?.data, result?.data, result] as ApiResponseTuple<T>\n }\n\n private static shapeResponse<T = unknown>(response: ApiResponse<ApiEnvelope<T>> | undefined, responseType?: ApiResponseType) {\n const resolvedResponse = ApiBase.resolveResponse(response)\n return responseType === 'tuple' ? resolvedResponse : resolvedResponse[0]\n }\n\n onError(error: ApiError, depth = 0) {\n this.config.reportableParent?.onError?.(error, depth + 1)\n this.config.onError?.(error, depth)\n }\n\n onFailure(response: ApiResponse, depth = 0) {\n this.config.reportableParent?.onFailure?.(response, depth + 1)\n this.config.onFailure?.(response, depth)\n }\n\n onSuccess(response: ApiResponse, depth = 0) {\n this.config.reportableParent?.onSuccess?.(response, depth + 1)\n this.config.onSuccess?.(response, depth)\n }\n\n protected async deleteEndpoint<T = unknown>(endPoint?: string): Promise<ApiResponseBody<T>>\n protected async deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<ApiResponseBody<T>>\n protected async deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n protected async deleteEndpoint<T = unknown>(endPoint = '', responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n const response = await this.monitorResponse<T>(async () => {\n return await this.axios.delete<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>>>(`${this.resolveRoot()}${endPoint}${this.query}`)\n })\n return ApiBase.shapeResponse<T>(response, responseType)\n }\n\n protected async getEndpoint<T = unknown>(endPoint?: string): Promise<ApiResponseBody<T>>\n protected async getEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<ApiResponseBody<T>>\n protected async getEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n protected async getEndpoint<T = unknown>(endPoint = '', responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n const response = await this.monitorResponse<T>(async () => {\n return await this.axios.get<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>>>(`${this.resolveRoot()}${endPoint}${this.query}`)\n })\n return ApiBase.shapeResponse<T>(response, responseType)\n }\n\n protected handleMonitorResponseError<T>(error: ApiError, trapAxiosException: boolean) {\n if (!error.isError) {\n throw error\n }\n\n if (trapAxiosException) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n error.response ? this.onFailure(error.response) : this.onError(error)\n if (this.config.throwFailure) {\n throw error\n }\n return error.response as ApiResponse<ApiEnvelope<T>>\n }\n }\n\n protected async monitorResponse<T>(closure: () => Promise<ApiResponse<ApiEnvelope<T>>>) {\n // we use this to prevent accidental catching on exceptions in callbacks\n let trapAxiosException = true\n try {\n const response = await closure()\n // eslint-disable-next-line sonarjs/no-dead-store\n trapAxiosException = false\n\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n response.status < 300 ? this.onSuccess(response) : this.onFailure(response)\n\n return response\n } catch (error) {\n this.handleMonitorResponseError(error as ApiError, trapAxiosException)\n }\n }\n\n protected async postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<ApiResponseBody<T>>\n protected async postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>\n protected async postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n protected async postEndpoint<T = unknown, D = unknown>(\n endPoint = '',\n data?: D,\n responseType?: ApiResponseType,\n ): Promise<ApiResponseTupleOrBody<T>> {\n const response = await this.monitorResponse<T>(async () => {\n return await this.axios.post<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>, D>, D>(`${this.resolveRoot()}${endPoint}${this.query}`, data)\n })\n return ApiBase.shapeResponse<T>(response, responseType)\n }\n\n protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<ApiResponseBody<T>>\n protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>\n protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n protected async putEndpoint<T = unknown, D = unknown>(endPoint = '', data?: D, responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n const response = await this.monitorResponse<T>(async () => {\n return await this.axios.put<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>, D>, D>(`${this.resolveRoot()}${endPoint}${this.query}`, data)\n })\n return ApiBase.shapeResponse<T>(response, responseType)\n }\n\n private resolveRoot() {\n return `${this.config.apiDomain}${this.root}`\n }\n}\n","export const objToQuery = (obj: Record<string, string | number | undefined>) => {\n return `?${Object.entries(obj)\n .map(([key, value]) => {\n return `${key}=${value}`\n })\n .filter(value => value !== undefined)\n .join('&')}`\n}\n","import type {\n ApiConfig, ApiResponseBody, ApiResponseTuple, ApiResponseTupleOrBody, ApiResponseType,\n} from '@xyo-network/api-models'\nimport type { Payload, PayloadFindFilter } from '@xyo-network/payload-model'\n\nimport { ApiBase } from './Base.ts'\nimport { objToQuery } from './objToQuery.ts'\n\nexport type ApiSimpleQuery = PayloadFindFilter\n\nexport class ApiSimple<T = Payload, D = T, Q extends ApiSimpleQuery = ApiSimpleQuery, C extends ApiConfig = ApiConfig> extends ApiBase<C> {\n async delete(): Promise<ApiResponseBody<T>>\n async delete(responseType?: 'body'): Promise<ApiResponseBody<T>>\n async delete(responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n async delete(responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n switch (responseType) {\n case 'tuple': {\n return await this.deleteEndpoint(undefined, 'tuple')\n }\n default: {\n return await this.deleteEndpoint()\n }\n }\n }\n\n async find(query?: Q): Promise<ApiResponseBody<T>>\n async find(query?: Q, responseType?: 'body'): Promise<ApiResponseBody<T>>\n async find(query?: Q, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n async find(query = {}, responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n switch (responseType) {\n case 'tuple': {\n return await this.getEndpoint(objToQuery(query), 'tuple')\n }\n default: {\n return await this.getEndpoint(objToQuery(query))\n }\n }\n }\n\n async get(): Promise<ApiResponseBody<T>>\n async get(responseType?: 'body'): Promise<ApiResponseBody<T>>\n async get(responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n async get(responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n switch (responseType) {\n case 'tuple': {\n return await this.getEndpoint(undefined, 'tuple')\n }\n default: {\n return await this.getEndpoint()\n }\n }\n }\n\n async post(data?: D): Promise<ApiResponseBody<T>>\n async post(data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>\n async post(data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n async post(data?: D, responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n switch (responseType) {\n case 'tuple': {\n return await this.postEndpoint(undefined, data, 'tuple')\n }\n default: {\n return await this.postEndpoint(undefined, data)\n }\n }\n }\n\n async put(data?: D): Promise<ApiResponseBody<T>>\n async put(data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>\n async put(data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>\n async put(data?: D, responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {\n switch (responseType) {\n case 'tuple': {\n return await this.putEndpoint(undefined, data, 'tuple')\n }\n default: {\n return await this.putEndpoint(undefined, data)\n }\n }\n }\n}\n","import { axiosJson } from '@xylabs/sdk-js'\nimport type { ApiConfig } from '@xyo-network/api-models'\nimport type { RawAxiosRequestConfig } from 'axios'\n\nimport { getLocationDivinerApiResponseTransformer } from './LocationDivinerApiResponseTransformer.ts'\nimport type { GetLocationQueryResponse } from './models.ts'\nimport type { LocationQueryCreationResponse, SupportedLocationQueryCreationRequest } from './Queries/index.ts'\n\nclass LocationDivinerApi {\n config: ApiConfig\n constructor(config: ApiConfig) {\n this.config = config\n }\n\n private get axiosRequestConfig(): RawAxiosRequestConfig {\n return { transformResponse: getLocationDivinerApiResponseTransformer() }\n }\n\n async getLocationQuery(hash: string) {\n return (await axiosJson.get<GetLocationQueryResponse>(`${this.config.apiDomain}/location/query/${hash}`, this.axiosRequestConfig)).data\n }\n\n async postLocationQuery(request: SupportedLocationQueryCreationRequest) {\n return (await axiosJson.post<LocationQueryCreationResponse>(`${this.config.apiDomain}/location/query`, { ...request }, this.axiosRequestConfig)).data\n }\n}\n\nexport { LocationDivinerApi }\n","import type { AxiosResponseTransformer } from 'axios'\nimport axios from 'axios'\n\nexport const locationDivinerApiResponseTransformer: AxiosResponseTransformer = (data, _headers) => {\n return data.data\n}\n\n/**\n * Gets the response transformers for the LocationDiviner API. Done as a method instead of a property\n * to allow detection of dynamically added response transformers.\n * @param axiosInstance The axios instance (defaults to the global instance if none provided)\n * @returns the response transformers for the LocationDiviner API\n */\nexport const getLocationDivinerApiResponseTransformer = (axiosInstance = axios): AxiosResponseTransformer[] => {\n // If there's any existing response transforms preserve them and\n // append our response transform, otherwise just return ours\n return axiosInstance.defaults.transformResponse\n ? [\n ...(Array.isArray(axiosInstance.defaults.transformResponse)\n ? axiosInstance.defaults.transformResponse\n : [axiosInstance.defaults.transformResponse]),\n locationDivinerApiResponseTransformer,\n ]\n : [locationDivinerApiResponseTransformer]\n}\n","import { asSchema } from '@xyo-network/payload-model'\n\nimport type { LocationWitnessSchema } from '../../Witnesses/index.ts'\n\nexport const LocationHeatmapQuerySchema = asSchema('network.xyo.location.heatmap.query', true)\nexport type LocationHeatmapQuerySchema = typeof LocationHeatmapQuerySchema\n\nexport const LocationHeatmapAnswerSchema = asSchema('network.xyo.location.heatmap.answer', true)\nexport type LocationHeatmapAnswerSchema = typeof LocationHeatmapAnswerSchema\n\nexport type LocationHeatmapQuery = {\n schema: LocationWitnessSchema\n startTime?: string\n stopTime?: string\n}\n\nexport const isLocationHeatmapQuery = (query: Record<string, unknown>): query is LocationHeatmapQuery => {\n return query && query?.schema === LocationHeatmapQuerySchema\n}\n","import { asSchema } from '@xyo-network/payload-model'\n\nimport type { LocationWitnessSchema } from '../../Witnesses/index.ts'\n\nexport const LocationQuadkeyHeatmapQuerySchema = asSchema('network.xyo.location.heatmap.quadkey.query', true)\nexport type LocationQuadkeyHeatmapQuerySchema = typeof LocationQuadkeyHeatmapQuerySchema\n\nexport const LocationQuadkeyHeatmapAnswerSchema = asSchema('network.xyo.location.heatmap.quadkey.answer', true)\nexport type LocationQuadkeyHeatmapAnswerSchema = typeof LocationQuadkeyHeatmapAnswerSchema\n\nexport type LocationQuadkeyHeatmapQuery = {\n schema: LocationWitnessSchema\n startTime?: string\n stopTime?: string\n}\n\nexport const isLocationQuadkeyHeatmapQuery = (query: Record<string, unknown>): query is LocationQuadkeyHeatmapQuery => {\n return query && query?.schema === LocationQuadkeyHeatmapQuerySchema\n}\n","import type { Schema } from '@xyo-network/payload-model'\n\nimport type { LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.ts'\nimport type { LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.ts'\nimport type { LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery/index.ts'\n\nexport type LocationQuerySchema = LocationQuadkeyHeatmapQuerySchema | LocationHeatmapQuerySchema | LocationTimeRangeQuerySchema\n\nconst locationQuerySchemas: Record<string, true> = {\n 'network.xyo.location.heatmap.quadkey.query': true,\n 'network.xyo.location.heatmap.query': true,\n 'network.xyo.location.range.query': true,\n}\n\nexport const isSupportedLocationQuerySchema = (schema: Schema): schema is LocationQuerySchema => {\n return locationQuerySchemas[schema as LocationQuerySchema] || false\n}\n","import { asSchema, isPayload } from '@xyo-network/payload-model'\n\nimport { LocationWitnessSchema } from '../../Witnesses/index.ts'\n\nexport const LocationTimeRangeQuerySchema = asSchema('network.xyo.location.range.query', true)\nexport type LocationTimeRangeQuerySchema = typeof LocationTimeRangeQuerySchema\n\nexport const LocationTimeRangeAnswerSchema = asSchema('network.xyo.location.range.answer', true)\nexport type LocationTimeRangeAnswerSchema = typeof LocationTimeRangeAnswerSchema\n\nexport type LocationTimeRangeQuery = {\n schema: LocationWitnessSchema\n startTime?: string\n stopTime?: string\n\n // TODO: Bounding rectangle, etc.\n}\n\nexport const isLocationTimeRangeQuery = isPayload([LocationWitnessSchema])\n","import { asSchema, type Payload } from '@xyo-network/payload-model'\n\nexport const CurrentLocationWitnessSchema = asSchema('co.coinapp.currentlocationwitness', true)\nexport type CurrentLocationWitnessSchema = typeof CurrentLocationWitnessSchema\n\nexport type CurrentLocationWitnessPayload = Payload<{\n altitudeMeters: number\n directionDegrees: number\n latitude: number\n longitude: number\n quadkey: string\n schema: CurrentLocationWitnessSchema\n speedKph: number\n}>\n","import { asSchema, type Payload } from '@xyo-network/payload-model'\n\nexport const LocationWitnessSchema = asSchema('network.xyo.location', true)\nexport type LocationWitnessSchema = typeof LocationWitnessSchema\n\nexport interface Coordinates {\n accuracy: number | null\n altitude: number | null\n altitudeAccuracy: number | null\n heading: number | null\n latitude: number\n longitude: number\n speed: number | null\n}\nexport interface CurrentLocation {\n coords: Coordinates\n timestamp: number\n}\n\nexport type LocationWitnessPayload = Payload<{\n currentLocation: CurrentLocation\n schema: LocationWitnessSchema\n}>\n","import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport { asSchema } from '@xyo-network/payload-model'\n\nimport type { ArchivistApi } from '../Api/index.ts'\n\nexport const RemoteDivinerConfigSchema = asSchema('network.xyo.diviner.remote.config', true)\nexport type RemoteDivinerConfigSchema = typeof RemoteDivinerConfigSchema\n\nexport type RemoteDivinerConfig = DivinerConfig & {\n /** @deprecated use in params instead */\n api?: ArchivistApi\n archive?: string\n schema: RemoteDivinerConfigSchema\n}\n","import { isString } from '@xylabs/sdk-js'\n\nexport class RemoteDivinerError extends Error {\n isRemoteDivinerError = true\n constructor(action: string, error: Error['cause'], message?: string) {\n const messageString = isString(message) ? ` (${message})` : ''\n super(`Remote Diviner [${action}] failed${messageString}`, { cause: error })\n }\n\n static isRemoteDivinerError(error: unknown): RemoteDivinerError | undefined {\n return (error as RemoteDivinerError).isRemoteDivinerError ? (error as RemoteDivinerError) : undefined\n }\n}\n"],"mappings":";AACA,SAAS,YAAY;;;ACDrB,SAAS,iBAAiB,gBAAgB;AAY1C,SAAS,aAAa;AAEf,IAAM,UAAN,MAAM,SAAkE;AAAA,EACpE;AAAA,EACC;AAAA,EAEV,YAAY,QAAW;AACrB,SAAK,SAAS;AACd,SAAK,QAAQ,IAAI,MAAM,gBAAgB,EAAE,GAAG,KAAK,QAAQ,SAAS,KAAK,QAAQ,CAAC,CAAC;AAAA,EACnF;AAAA,EAEA,IAAI,gBAAgB;AAClB,WAAO,SAAS,KAAK,OAAO,M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,SAAS,YAAAC,iBAAgB;AAIlB,IAAM,4BAA4BA,UAAS,qCAAqC,IAAI;;;ACL3F,SAAS,YAAAC,iBAAgB;AAElB,IAAM,qBAAN,cAAiC,MAAM;AAAA,EAC5C,uBAAuB;AAAA,EACvB,YAAY,QAAgB,OAAuB,SAAkB;AACnE,UAAM,gBAAgBA,UAAS,OAAO,IAAI,KAAK,OAAO,MAAM;AAC5D,UAAM,mBAAmB,MAAM,WAAW,aAAa,IAAI,EAAE,OAAO,MAAM,CAAC;AAAA,EAC7E;AAAA,EAEA,OAAO,qBAAqB,OAAgD;AAC1E,WAAQ,MAA6B,uBAAwB,QAA+B;AAAA,EAC9F;AACF;","names":["asSchema","asSchema","asSchema","asSchema","asSchema","asSchema","isString"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/api",
3
- "version": "5.3.0",
3
+ "version": "5.3.1",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -37,10 +37,10 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@xylabs/sdk-js": "~5.0.64",
40
- "@xyo-network/api-models": "~5.3.0",
41
- "@xyo-network/diviner-model": "~5.3.0",
42
- "@xyo-network/huri": "~5.3.0",
43
- "@xyo-network/payload-model": "~5.3.0",
40
+ "@xyo-network/api-models": "~5.3.1",
41
+ "@xyo-network/diviner-model": "~5.3.1",
42
+ "@xyo-network/huri": "~5.3.1",
43
+ "@xyo-network/payload-model": "~5.3.1",
44
44
  "axios": "^1.13.3"
45
45
  },
46
46
  "devDependencies": {
@@ -50,9 +50,9 @@
50
50
  "@xylabs/ts-scripts-yarn3": "~7.3.2",
51
51
  "@xylabs/tsconfig": "~7.3.2",
52
52
  "@xylabs/vitest-extended": "~5.0.64",
53
- "@xyo-network/boundwitness-model": "~5.3.0",
54
- "@xyo-network/module-model": "~5.3.0",
55
- "@xyo-network/query-payload-plugin": "~5.3.0",
53
+ "@xyo-network/boundwitness-model": "~5.3.1",
54
+ "@xyo-network/module-model": "~5.3.1",
55
+ "@xyo-network/query-payload-plugin": "~5.3.1",
56
56
  "typescript": "~5.9.3",
57
57
  "uuid": "~13.0.0",
58
58
  "vitest": "~4.0.18"
@@ -1,9 +1,11 @@
1
+ import { asSchema } from '@xyo-network/payload-model'
2
+
1
3
  import type { LocationWitnessSchema } from '../../Witnesses/index.ts'
2
4
 
3
- export const LocationHeatmapQuerySchema = 'network.xyo.location.heatmap.query' as const
5
+ export const LocationHeatmapQuerySchema = asSchema('network.xyo.location.heatmap.query', true)
4
6
  export type LocationHeatmapQuerySchema = typeof LocationHeatmapQuerySchema
5
7
 
6
- export const LocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer' as const
8
+ export const LocationHeatmapAnswerSchema = asSchema('network.xyo.location.heatmap.answer', true)
7
9
  export type LocationHeatmapAnswerSchema = typeof LocationHeatmapAnswerSchema
8
10
 
9
11
  export type LocationHeatmapQuery = {
@@ -1,9 +1,11 @@
1
+ import { asSchema } from '@xyo-network/payload-model'
2
+
1
3
  import type { LocationWitnessSchema } from '../../Witnesses/index.ts'
2
4
 
3
- export const LocationQuadkeyHeatmapQuerySchema = 'network.xyo.location.heatmap.quadkey.query' as const
5
+ export const LocationQuadkeyHeatmapQuerySchema = asSchema('network.xyo.location.heatmap.quadkey.query', true)
4
6
  export type LocationQuadkeyHeatmapQuerySchema = typeof LocationQuadkeyHeatmapQuerySchema
5
7
 
6
- export const LocationQuadkeyHeatmapAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer' as const
8
+ export const LocationQuadkeyHeatmapAnswerSchema = asSchema('network.xyo.location.heatmap.quadkey.answer', true)
7
9
  export type LocationQuadkeyHeatmapAnswerSchema = typeof LocationQuadkeyHeatmapAnswerSchema
8
10
 
9
11
  export type LocationQuadkeyHeatmapQuery = {
@@ -1,15 +1,17 @@
1
+ import type { Schema } from '@xyo-network/payload-model'
2
+
1
3
  import type { LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.ts'
2
4
  import type { LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.ts'
3
5
  import type { LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery/index.ts'
4
6
 
5
7
  export type LocationQuerySchema = LocationQuadkeyHeatmapQuerySchema | LocationHeatmapQuerySchema | LocationTimeRangeQuerySchema
6
8
 
7
- const locationQuerySchemas: Record<LocationQuerySchema, true> = {
9
+ const locationQuerySchemas: Record<string, true> = {
8
10
  'network.xyo.location.heatmap.quadkey.query': true,
9
11
  'network.xyo.location.heatmap.query': true,
10
12
  'network.xyo.location.range.query': true,
11
13
  }
12
14
 
13
- export const isSupportedLocationQuerySchema = (schema: string): schema is LocationQuerySchema => {
15
+ export const isSupportedLocationQuerySchema = (schema: Schema): schema is LocationQuerySchema => {
14
16
  return locationQuerySchemas[schema as LocationQuerySchema] || false
15
17
  }
@@ -1,11 +1,11 @@
1
- import { isPayload } from '@xyo-network/payload-model'
1
+ import { asSchema, isPayload } from '@xyo-network/payload-model'
2
2
 
3
3
  import { LocationWitnessSchema } from '../../Witnesses/index.ts'
4
4
 
5
- export const LocationTimeRangeQuerySchema = 'network.xyo.location.range.query' as const
5
+ export const LocationTimeRangeQuerySchema = asSchema('network.xyo.location.range.query', true)
6
6
  export type LocationTimeRangeQuerySchema = typeof LocationTimeRangeQuerySchema
7
7
 
8
- export const LocationTimeRangeAnswerSchema = 'network.xyo.location.range.answer' as const
8
+ export const LocationTimeRangeAnswerSchema = asSchema('network.xyo.location.range.answer', true)
9
9
  export type LocationTimeRangeAnswerSchema = typeof LocationTimeRangeAnswerSchema
10
10
 
11
11
  export type LocationTimeRangeQuery = {
@@ -1,6 +1,6 @@
1
- import type { Payload } from '@xyo-network/payload-model'
1
+ import { asSchema, type Payload } from '@xyo-network/payload-model'
2
2
 
3
- export const CurrentLocationWitnessSchema = 'co.coinapp.currentlocationwitness' as const
3
+ export const CurrentLocationWitnessSchema = asSchema('co.coinapp.currentlocationwitness', true)
4
4
  export type CurrentLocationWitnessSchema = typeof CurrentLocationWitnessSchema
5
5
 
6
6
  export type CurrentLocationWitnessPayload = Payload<{
@@ -1,6 +1,6 @@
1
- import type { Payload } from '@xyo-network/payload-model'
1
+ import { asSchema, type Payload } from '@xyo-network/payload-model'
2
2
 
3
- export const LocationWitnessSchema = 'network.xyo.location' as const
3
+ export const LocationWitnessSchema = asSchema('network.xyo.location', true)
4
4
  export type LocationWitnessSchema = typeof LocationWitnessSchema
5
5
 
6
6
  export interface Coordinates {
@@ -1,8 +1,9 @@
1
1
  import type { DivinerConfig } from '@xyo-network/diviner-model'
2
+ import { asSchema } from '@xyo-network/payload-model'
2
3
 
3
4
  import type { ArchivistApi } from '../Api/index.ts'
4
5
 
5
- export const RemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config' as const
6
+ export const RemoteDivinerConfigSchema = asSchema('network.xyo.diviner.remote.config', true)
6
7
  export type RemoteDivinerConfigSchema = typeof RemoteDivinerConfigSchema
7
8
 
8
9
  export type RemoteDivinerConfig = DivinerConfig & {