@xyo-network/api 3.0.6 → 3.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. package/dist/neutral/Api/Api.d.ts +12 -0
  2. package/dist/neutral/Api/Api.d.ts.map +1 -0
  3. package/dist/neutral/Api/index.d.ts +2 -0
  4. package/dist/neutral/Api/index.d.ts.map +1 -0
  5. package/dist/neutral/Base.d.ts +32 -0
  6. package/dist/neutral/Base.d.ts.map +1 -0
  7. package/dist/neutral/Diviner/LocationDiviner/LocationDivinerApi.d.ts +12 -0
  8. package/dist/neutral/Diviner/LocationDiviner/LocationDivinerApi.d.ts.map +1 -0
  9. package/dist/neutral/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.d.ts +4 -0
  10. package/dist/neutral/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.d.ts.map +1 -0
  11. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.d.ts +5 -0
  12. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.d.ts.map +1 -0
  13. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.ts +12 -0
  14. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.ts.map +1 -0
  15. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.ts +3 -0
  16. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.ts.map +1 -0
  17. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.ts +12 -0
  18. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.ts.map +1 -0
  19. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.ts +2 -0
  20. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.ts.map +1 -0
  21. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts +18 -0
  22. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts.map +1 -0
  23. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.ts +5 -0
  24. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.ts.map +1 -0
  25. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.ts +6 -0
  26. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.ts.map +1 -0
  27. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.ts +8 -0
  28. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.ts.map +1 -0
  29. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.ts +12 -0
  30. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.ts.map +1 -0
  31. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.ts +3 -0
  32. package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.ts.map +1 -0
  33. package/dist/neutral/Diviner/LocationDiviner/Queries/index.d.ts +7 -0
  34. package/dist/neutral/Diviner/LocationDiviner/Queries/index.d.ts.map +1 -0
  35. package/dist/neutral/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.d.ts +13 -0
  36. package/dist/neutral/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.d.ts.map +1 -0
  37. package/dist/neutral/Diviner/LocationDiviner/Witnesses/LocationWitness.d.ts +21 -0
  38. package/dist/neutral/Diviner/LocationDiviner/Witnesses/LocationWitness.d.ts.map +1 -0
  39. package/dist/neutral/Diviner/LocationDiviner/Witnesses/index.d.ts +3 -0
  40. package/dist/neutral/Diviner/LocationDiviner/Witnesses/index.d.ts.map +1 -0
  41. package/dist/neutral/Diviner/LocationDiviner/index.d.ts +5 -0
  42. package/dist/neutral/Diviner/LocationDiviner/index.d.ts.map +1 -0
  43. package/dist/neutral/Diviner/LocationDiviner/models.d.ts +5 -0
  44. package/dist/neutral/Diviner/LocationDiviner/models.d.ts.map +1 -0
  45. package/dist/neutral/Diviner/RemoteDivinerConfig.d.ts +10 -0
  46. package/dist/neutral/Diviner/RemoteDivinerConfig.d.ts.map +1 -0
  47. package/dist/neutral/Diviner/RemoteDivinerError.d.ts +6 -0
  48. package/dist/neutral/Diviner/RemoteDivinerError.d.ts.map +1 -0
  49. package/dist/neutral/Diviner/index.d.ts +3 -0
  50. package/dist/neutral/Diviner/index.d.ts.map +1 -0
  51. package/dist/neutral/Simple.d.ts +22 -0
  52. package/dist/neutral/Simple.d.ts.map +1 -0
  53. package/dist/neutral/Test/index.d.ts +3 -0
  54. package/dist/neutral/Test/index.d.ts.map +1 -0
  55. package/dist/neutral/Test/testBoundWitness.d.ts +4 -0
  56. package/dist/neutral/Test/testBoundWitness.d.ts.map +1 -0
  57. package/dist/neutral/Test/testPayload.d.ts +6 -0
  58. package/dist/neutral/Test/testPayload.d.ts.map +1 -0
  59. package/dist/neutral/WithArchive.d.ts +4 -0
  60. package/dist/neutral/WithArchive.d.ts.map +1 -0
  61. package/dist/neutral/index.d.ts +7 -191
  62. package/dist/neutral/index.d.ts.map +1 -0
  63. package/dist/neutral/index.mjs +1 -3
  64. package/dist/neutral/index.mjs.map +1 -1
  65. package/dist/neutral/models/ArchivePath.d.ts +4 -0
  66. package/dist/neutral/models/ArchivePath.d.ts.map +1 -0
  67. package/dist/neutral/models/index.d.ts +2 -0
  68. package/dist/neutral/models/index.d.ts.map +1 -0
  69. package/dist/neutral/objToQuery.d.ts +2 -0
  70. package/dist/neutral/objToQuery.d.ts.map +1 -0
  71. package/package.json +38 -38
  72. package/src/Diviner/LocationDiviner/LocationDivinerApi.ts +1 -3
  73. package/src/Simple.ts +3 -1
  74. package/src/Test/testBoundWitness.ts +1 -3
  75. package/xy.config.ts +1 -3
@@ -0,0 +1,12 @@
1
+ import type { ApiConfig } from '@xyo-network/api-models';
2
+ import { Huri } from '@xyo-network/huri';
3
+ import type { Payload } from '@xyo-network/payload-model';
4
+ import { ApiSimple } from '../Simple.ts';
5
+ export declare class ArchivistApi<C extends ApiConfig = ApiConfig> extends ApiSimple<Payload[], C> {
6
+ huri(huri: Huri | string): ApiSimple<{
7
+ schema: string;
8
+ } & import("@xyo-network/payload-model").PayloadFields, {
9
+ schema: string;
10
+ } & import("@xyo-network/payload-model").PayloadFields, import("@xyo-network/payload-model").PayloadFindFilter, ApiConfig>;
11
+ }
12
+ //# sourceMappingURL=Api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Api.d.ts","sourceRoot":"","sources":["../../../src/Api/Api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,qBAAa,YAAY,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACxF,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM;;;;;CAOzB"}
@@ -0,0 +1,2 @@
1
+ export * from './Api.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Api/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
@@ -0,0 +1,32 @@
1
+ import { AxiosJson } from '@xylabs/axios';
2
+ import type { ApiConfig, ApiEnvelope, ApiError, ApiReportable, ApiResponse, ApiResponseBody, ApiResponseTuple } from '@xyo-network/api-models';
3
+ export declare class ApiBase<C extends ApiConfig = ApiConfig> implements ApiReportable {
4
+ readonly config: C;
5
+ protected axios: AxiosJson;
6
+ constructor(config: C);
7
+ get authenticated(): boolean;
8
+ protected get headers(): Record<string, string>;
9
+ protected get query(): string;
10
+ protected get root(): string;
11
+ private static resolveResponse;
12
+ private static shapeResponse;
13
+ onError(error: ApiError, depth?: number): void;
14
+ onFailure(response: ApiResponse, depth?: number): void;
15
+ onSuccess(response: ApiResponse, depth?: number): void;
16
+ protected deleteEndpoint<T = unknown>(endPoint?: string): Promise<ApiResponseBody<T>>;
17
+ protected deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<ApiResponseBody<T>>;
18
+ protected deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
19
+ protected getEndpoint<T = unknown>(endPoint?: string): Promise<ApiResponseBody<T>>;
20
+ protected getEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<ApiResponseBody<T>>;
21
+ protected getEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
22
+ protected handleMonitorResponseError<T>(error: ApiError, trapAxiosException: boolean): ApiResponse<ApiEnvelope<T>> | undefined;
23
+ protected monitorResponse<T>(closure: () => Promise<ApiResponse<ApiEnvelope<T>>>): Promise<ApiResponse<ApiEnvelope<T>> | undefined>;
24
+ protected postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<ApiResponseBody<T>>;
25
+ protected postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>;
26
+ protected postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
27
+ protected putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<ApiResponseBody<T>>;
28
+ protected putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>;
29
+ protected putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
30
+ private resolveRoot;
31
+ }
32
+ //# sourceMappingURL=Base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Base.d.ts","sourceRoot":"","sources":["../../src/Base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,QAAQ,EACR,aAAa,EACb,WAAW,EACX,eAAe,EACf,gBAAgB,EAGjB,MAAM,yBAAyB,CAAA;AAEhC,qBAAa,OAAO,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,CAAE,YAAW,aAAa;IAC5E,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;IAClB,SAAS,CAAC,KAAK,EAAE,SAAS,CAAA;gBAEd,MAAM,EAAE,CAAC;IAKrB,IAAI,aAAa,YAEhB;IAED,SAAS,KAAK,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAS9C;IAED,SAAS,KAAK,KAAK,WAElB;IAED,SAAS,KAAK,IAAI,WAEjB;IAED,OAAO,CAAC,MAAM,CAAC,eAAe;IAI9B,OAAO,CAAC,MAAM,CAAC,aAAa;IAK5B,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,SAAI;IAKlC,SAAS,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,SAAI;IAK1C,SAAS,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,SAAI;cAK1B,cAAc,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;cAC3E,cAAc,CAAC,CAA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AAC,CAAC,CAAC,CAAC;cACvH,YAAY,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;cAYzH,WAAW,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;cAC/F,WAAW,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;cACtH,WAAW,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAQxI,OAAO,CAAC,WAAW;CAGpB"}
@@ -0,0 +1,12 @@
1
+ import type { ApiConfig } from '@xyo-network/api-models';
2
+ import type { GetLocationQueryResponse } from './models.ts';
3
+ import type { LocationQueryCreationResponse, SupportedLocationQueryCreationRequest } from './Queries/index.ts';
4
+ declare class LocationDivinerApi {
5
+ config: ApiConfig;
6
+ constructor(config: ApiConfig);
7
+ private get axiosRequestConfig();
8
+ getLocationQuery(hash: string): Promise<GetLocationQueryResponse>;
9
+ postLocationQuery(request: SupportedLocationQueryCreationRequest): Promise<LocationQueryCreationResponse>;
10
+ }
11
+ export { LocationDivinerApi };
12
+ //# sourceMappingURL=LocationDivinerApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocationDivinerApi.d.ts","sourceRoot":"","sources":["../../../../src/Diviner/LocationDiviner/LocationDivinerApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAIxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EAAE,6BAA6B,EAAE,qCAAqC,EAAE,MAAM,oBAAoB,CAAA;AAE9G,cAAM,kBAAkB;IACtB,MAAM,EAAE,SAAS,CAAA;gBACL,MAAM,EAAE,SAAS;IAI7B,OAAO,KAAK,kBAAkB,GAE7B;IAEK,gBAAgB,CAAC,IAAI,EAAE,MAAM;IAI7B,iBAAiB,CAAC,OAAO,EAAE,qCAAqC;CAGvE;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { AxiosResponseTransformer } from 'axios';
2
+ export declare const locationDivinerApiResponseTransformer: AxiosResponseTransformer;
3
+ export declare const getLocationDivinerApiResponseTransformer: (axiosInstance?: import("axios").AxiosStatic) => AxiosResponseTransformer[];
4
+ //# sourceMappingURL=LocationDivinerApiResponseTransformer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocationDivinerApiResponseTransformer.d.ts","sourceRoot":"","sources":["../../../../src/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAA;AAGrD,eAAO,MAAM,qCAAqC,EAAE,wBAEnD,CAAA;AAQD,eAAO,MAAM,wCAAwC,mDAA4B,wBAAwB,EAWxG,CAAA"}
@@ -0,0 +1,5 @@
1
+ export interface LocationHeatmapPointProperties {
2
+ hash: string;
3
+ value: number;
4
+ }
5
+ //# sourceMappingURL=LocationHeatmapPointProperties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocationHeatmapPointProperties.d.ts","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd"}
@@ -0,0 +1,12 @@
1
+ import type { LocationWitnessSchema } from '../../Witnesses/index.ts';
2
+ export type LocationHeatmapQuerySchema = 'network.xyo.location.heatmap.query';
3
+ export declare const locationHeatmapQuerySchema: LocationHeatmapQuerySchema;
4
+ export type LocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer';
5
+ export declare const locationHeatmapAnswerSchema: LocationHeatmapAnswerSchema;
6
+ export type LocationHeatmapQuery = {
7
+ schema: LocationWitnessSchema;
8
+ startTime?: string;
9
+ stopTime?: string;
10
+ };
11
+ export declare const isLocationHeatmapQuery: (query: Record<string, unknown>) => query is LocationHeatmapQuery;
12
+ //# sourceMappingURL=LocationHeatmapQuery.d.ts.map
@@ -0,0 +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,MAAM,MAAM,0BAA0B,GAAG,oCAAoC,CAAA;AAC7E,eAAO,MAAM,0BAA0B,EAAE,0BAAiE,CAAA;AAE1G,MAAM,MAAM,2BAA2B,GAAG,qCAAqC,CAAA;AAC/E,eAAO,MAAM,2BAA2B,EAAE,2BAAmE,CAAA;AAE7G,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,UAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,KAAK,IAAI,oBAEhF,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './LocationHeatmapPointProperties.ts';
2
+ export * from './LocationHeatmapQuery.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAA;AACnD,cAAc,2BAA2B,CAAA"}
@@ -0,0 +1,12 @@
1
+ import type { LocationWitnessSchema } from '../../Witnesses/index.ts';
2
+ export type LocationQuadkeyHeatmapQuerySchema = 'network.xyo.location.heatmap.quadkey.query';
3
+ export declare const locationQuadkeyHeatmapQuerySchema: LocationQuadkeyHeatmapQuerySchema;
4
+ export type LocationQuadkeyHeatmapAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer';
5
+ export declare const locationQuadkeyHeatmapAnswerSchema: LocationQuadkeyHeatmapAnswerSchema;
6
+ export type LocationQuadkeyHeatmapQuery = {
7
+ schema: LocationWitnessSchema;
8
+ startTime?: string;
9
+ stopTime?: string;
10
+ };
11
+ export declare const isLocationQuadkeyHeatmapQuery: (query: Record<string, unknown>) => query is LocationQuadkeyHeatmapQuery;
12
+ //# sourceMappingURL=LocationQuadkeyHeatmapQuery.d.ts.map
@@ -0,0 +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,MAAM,MAAM,iCAAiC,GAAG,4CAA4C,CAAA;AAC5F,eAAO,MAAM,iCAAiC,EAAE,iCAAgF,CAAA;AAChI,MAAM,MAAM,kCAAkC,GAAG,6CAA6C,CAAA;AAC9F,eAAO,MAAM,kCAAkC,EAAE,kCAAkF,CAAA;AACnI,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,UAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,KAAK,IAAI,2BAEvF,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './LocationQuadkeyHeatmapQuery.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA"}
@@ -0,0 +1,18 @@
1
+ import type { ApiConfig } from '@xyo-network/api-models';
2
+ import type { LocationHeatmapQuery, LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.ts';
3
+ import type { LocationQuadkeyHeatmapQuery, LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.ts';
4
+ import type { LocationQuerySchema } from './LocationQuerySchema.ts';
5
+ import type { LocationTimeRangeQuery, LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery/index.ts';
6
+ export interface LocationQueryCreationRequest<TSchema extends LocationQuerySchema = LocationQuerySchema, TQuery extends Record<string, unknown> = Record<string, unknown>> {
7
+ query: TQuery;
8
+ resultArchive: string;
9
+ resultArchivist: ApiConfig;
10
+ schema: TSchema;
11
+ sourceArchive: string;
12
+ sourceArchivist: ApiConfig;
13
+ }
14
+ export type LocationTimeRangeQueryCreationRequest = LocationQueryCreationRequest<LocationTimeRangeQuerySchema, LocationTimeRangeQuery>;
15
+ export type LocationHeatmapQueryCreationRequest = LocationQueryCreationRequest<LocationHeatmapQuerySchema, LocationHeatmapQuery>;
16
+ export type LocationQuadkeyHeatmapQueryCreationRequest = LocationQueryCreationRequest<LocationQuadkeyHeatmapQuerySchema, LocationQuadkeyHeatmapQuery>;
17
+ export type SupportedLocationQueryCreationRequest = LocationTimeRangeQueryCreationRequest | LocationHeatmapQueryCreationRequest | LocationQuadkeyHeatmapQueryCreationRequest;
18
+ //# sourceMappingURL=LocationQueryCreationRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocationQueryCreationRequest.d.ts","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AACvG,OAAO,KAAK,EAAE,2BAA2B,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAA;AAC5H,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAE7G,MAAM,WAAW,4BAA4B,CAC3C,OAAO,SAAS,mBAAmB,GAAG,mBAAmB,EACzD,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAEhE,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,SAAS,CAAA;IAC1B,MAAM,EAAE,OAAO,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,SAAS,CAAA;CAC3B;AAED,MAAM,MAAM,qCAAqC,GAAG,4BAA4B,CAAC,4BAA4B,EAAE,sBAAsB,CAAC,CAAA;AACtI,MAAM,MAAM,mCAAmC,GAAG,4BAA4B,CAAC,0BAA0B,EAAE,oBAAoB,CAAC,CAAA;AAEhI,MAAM,MAAM,0CAA0C,GAAG,4BAA4B,CAAC,iCAAiC,EAAE,2BAA2B,CAAC,CAAA;AAErJ,MAAM,MAAM,qCAAqC,GAC7C,qCAAqC,GACrC,mCAAmC,GACnC,0CAA0C,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { LocationQueryCreationRequest } from './LocationQueryCreationRequest.ts';
2
+ export interface LocationQueryCreationResponse extends LocationQueryCreationRequest {
3
+ hash: string;
4
+ }
5
+ //# sourceMappingURL=LocationQueryCreationResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocationQueryCreationResponse.d.ts","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAErF,MAAM,WAAW,6BAA8B,SAAQ,4BAA4B;IACjF,IAAI,EAAE,MAAM,CAAA;CACb"}
@@ -0,0 +1,6 @@
1
+ import type { LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.ts';
2
+ import type { LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.ts';
3
+ import type { LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery/index.ts';
4
+ export type LocationQuerySchema = LocationQuadkeyHeatmapQuerySchema | LocationHeatmapQuerySchema | LocationTimeRangeQuerySchema;
5
+ export declare const isSupportedLocationQuerySchema: (schema: string) => schema is LocationQuerySchema;
6
+ //# sourceMappingURL=LocationQuerySchema.d.ts.map
@@ -0,0 +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,WAAY,MAAM,KAAG,MAAM,IAAI,mBAEzE,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { LocationWitnessSchema } from '../../Witnesses/index.ts';
2
+ export interface LocationTimeRangePointProperties {
3
+ _archive: string;
4
+ _client: string;
5
+ _timestamp: number;
6
+ schema: LocationWitnessSchema;
7
+ }
8
+ //# sourceMappingURL=LocationTimeRangePointProperties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocationTimeRangePointProperties.d.ts","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAErE,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,qBAAqB,CAAA;CAC9B"}
@@ -0,0 +1,12 @@
1
+ import type { LocationWitnessSchema } from '../../Witnesses/index.ts';
2
+ export type LocationTimeRangeQuerySchema = 'network.xyo.location.range.query';
3
+ export declare const LocationTimeRangeQuerySchema: LocationTimeRangeQuerySchema;
4
+ export type LocationTimeRangeAnswerSchema = 'network.xyo.location.range.answer';
5
+ export declare const LocationTimeRangeAnswerSchema: LocationTimeRangeAnswerSchema;
6
+ export type LocationTimeRangeQuery = {
7
+ schema: LocationWitnessSchema;
8
+ startTime?: string;
9
+ stopTime?: string;
10
+ };
11
+ export declare const isLocationTimeRangeQuery: (query: Record<string, unknown>) => query is LocationTimeRangeQuery;
12
+ //# sourceMappingURL=LocationTimeRangeQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocationTimeRangeQuery.d.ts","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAErE,MAAM,MAAM,4BAA4B,GAAG,kCAAkC,CAAA;AAC7E,eAAO,MAAM,4BAA4B,EAAE,4BAAiE,CAAA;AAE5G,MAAM,MAAM,6BAA6B,GAAG,mCAAmC,CAAA;AAC/E,eAAO,MAAM,6BAA6B,EAAE,6BAAmE,CAAA;AAE/G,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,UAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,KAAK,IAAI,sBAElF,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './LocationTimeRangePointProperties.ts';
2
+ export * from './LocationTimeRangeQuery.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAA;AACrD,cAAc,6BAA6B,CAAA"}
@@ -0,0 +1,7 @@
1
+ export * from './LocationHeatmapQuery/index.ts';
2
+ export * from './LocationQuadkeyHeatmapQuery/index.ts';
3
+ export * from './LocationQueryCreationRequest.ts';
4
+ export * from './LocationQueryCreationResponse.ts';
5
+ export * from './LocationQuerySchema.ts';
6
+ export * from './LocationTimeRangeQuery/index.ts';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wCAAwC,CAAA;AACtD,cAAc,mCAAmC,CAAA;AACjD,cAAc,oCAAoC,CAAA;AAClD,cAAc,0BAA0B,CAAA;AACxC,cAAc,mCAAmC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import type { Payload } from '@xyo-network/payload-model';
2
+ export type CurrentLocationWitnessSchema = 'co.coinapp.currentlocationwitness';
3
+ export declare const CurrentLocationWitnessSchema: CurrentLocationWitnessSchema;
4
+ export type CurrentLocationWitnessPayload = Payload<{
5
+ altitudeMeters: number;
6
+ directionDegrees: number;
7
+ latitude: number;
8
+ longitude: number;
9
+ quadkey: string;
10
+ schema: CurrentLocationWitnessSchema;
11
+ speedKph: number;
12
+ }>;
13
+ //# sourceMappingURL=CurrentLocationWitness.d.ts.map
@@ -0,0 +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,MAAM,MAAM,4BAA4B,GAAG,mCAAmC,CAAA;AAC9E,eAAO,MAAM,4BAA4B,EAAE,4BAAkE,CAAA;AAE7G,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"}
@@ -0,0 +1,21 @@
1
+ import type { Payload } from '@xyo-network/payload-model';
2
+ export type LocationWitnessSchema = 'network.xyo.location';
3
+ export declare const LocationWitnessSchema: LocationWitnessSchema;
4
+ export interface Coordinates {
5
+ accuracy: number | null;
6
+ altitude: number | null;
7
+ altitudeAccuracy: number | null;
8
+ heading: number | null;
9
+ latitude: number;
10
+ longitude: number;
11
+ speed: number | null;
12
+ }
13
+ export interface CurrentLocation {
14
+ coords: Coordinates;
15
+ timestamp: number;
16
+ }
17
+ export type LocationWitnessPayload = Payload<{
18
+ currentLocation: CurrentLocation;
19
+ schema: LocationWitnessSchema;
20
+ }>;
21
+ //# sourceMappingURL=LocationWitness.d.ts.map
@@ -0,0 +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,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,CAAA;AAC1D,eAAO,MAAM,qBAAqB,EAAE,qBAA8C,CAAA;AAElF,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"}
@@ -0,0 +1,3 @@
1
+ export * from './CurrentLocationWitness.ts';
2
+ export * from './LocationWitness.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Witnesses/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sBAAsB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './LocationDivinerApi.ts';
2
+ export * from './models.ts';
3
+ export * from './Queries/index.ts';
4
+ export * from './Witnesses/index.ts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Diviner/LocationDiviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export interface GetLocationQueryResponse {
2
+ answerHash?: string;
3
+ queryHash: string;
4
+ }
5
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../src/Diviner/LocationDiviner/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB"}
@@ -0,0 +1,10 @@
1
+ import type { DivinerConfig } from '@xyo-network/diviner-model';
2
+ import type { ArchivistApi } from '../Api/index.ts';
3
+ export type RemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config';
4
+ export declare const RemoteDivinerConfigSchema: RemoteDivinerConfigSchema;
5
+ export type RemoteDivinerConfig = DivinerConfig & {
6
+ api?: ArchivistApi;
7
+ archive?: string;
8
+ schema: RemoteDivinerConfigSchema;
9
+ };
10
+ //# sourceMappingURL=RemoteDivinerConfig.d.ts.map
@@ -0,0 +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,MAAM,MAAM,yBAAyB,GAAG,mCAAmC,CAAA;AAC3E,eAAO,MAAM,yBAAyB,EAAE,yBAA+D,CAAA;AAEvG,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAEhD,GAAG,CAAC,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,yBAAyB,CAAA;CAClC,CAAA"}
@@ -0,0 +1,6 @@
1
+ export declare class RemoteDivinerError extends Error {
2
+ isRemoteDivinerError: boolean;
3
+ constructor(action: string, error: Error['cause'], message?: string);
4
+ static isRemoteDivinerError(error: unknown): RemoteDivinerError | undefined;
5
+ }
6
+ //# sourceMappingURL=RemoteDivinerError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RemoteDivinerError.d.ts","sourceRoot":"","sources":["../../../src/Diviner/RemoteDivinerError.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,oBAAoB,UAAO;gBACf,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM;IAKnE,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS;CAG5E"}
@@ -0,0 +1,3 @@
1
+ export * from './LocationDiviner/index.ts';
2
+ export * from './RemoteDivinerConfig.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,0BAA0B,CAAA"}
@@ -0,0 +1,22 @@
1
+ import type { ApiConfig, ApiResponseBody, ApiResponseTuple } from '@xyo-network/api-models';
2
+ import type { Payload, PayloadFindFilter } from '@xyo-network/payload-model';
3
+ import { ApiBase } from './Base.ts';
4
+ export type ApiSimpleQuery = PayloadFindFilter;
5
+ export declare class ApiSimple<T = Payload, D = T, Q extends ApiSimpleQuery = ApiSimpleQuery, C extends ApiConfig = ApiConfig> extends ApiBase<C> {
6
+ delete(): Promise<ApiResponseBody<T>>;
7
+ delete(responseType?: 'body'): Promise<ApiResponseBody<T>>;
8
+ delete(responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
9
+ find(query?: Q): Promise<ApiResponseBody<T>>;
10
+ find(query?: Q, responseType?: 'body'): Promise<ApiResponseBody<T>>;
11
+ find(query?: Q, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
12
+ get(): Promise<ApiResponseBody<T>>;
13
+ get(responseType?: 'body'): Promise<ApiResponseBody<T>>;
14
+ get(responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
15
+ post(data?: D): Promise<ApiResponseBody<T>>;
16
+ post(data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>;
17
+ post(data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
18
+ put(data?: D): Promise<ApiResponseBody<T>>;
19
+ put(data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>;
20
+ put(data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
21
+ }
22
+ //# sourceMappingURL=Simple.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Simple.d.ts","sourceRoot":"","sources":["../../src/Simple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAC7C,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAE5E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGnC,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAA;AAE9C,qBAAa,SA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E,CAAC,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAYpE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAC1C,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IACjE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;CAW1E"}
@@ -0,0 +1,3 @@
1
+ export * from './testBoundWitness.ts';
2
+ export * from './testPayload.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Test/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { BoundWitness } from '@xyo-network/boundwitness-model';
2
+ declare const testBoundWitness: BoundWitness;
3
+ export { testBoundWitness };
4
+ //# sourceMappingURL=testBoundWitness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testBoundWitness.d.ts","sourceRoot":"","sources":["../../../src/Test/testBoundWitness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAGnE,QAAA,MAAM,gBAAgB,EAAE,YAOP,CAAA;AAEjB,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { StringKeyObject } from '@xylabs/object';
2
+ import type { Payload } from '@xyo-network/payload-model';
3
+ declare const testSchema = "network.xyo.test";
4
+ declare const testPayload: Payload<StringKeyObject>;
5
+ export { testPayload, testSchema };
6
+ //# sourceMappingURL=testPayload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testPayload.d.ts","sourceRoot":"","sources":["../../../src/Test/testPayload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,QAAA,MAAM,UAAU,qBAAqB,CAAA;AACrC,QAAA,MAAM,WAAW,EAAE,OAAO,CAAC,eAAe,CAUzC,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAA"}
@@ -0,0 +1,4 @@
1
+ export declare type WithArchive<ArchivistApiConfig> = ArchivistApiConfig & {
2
+ _archive?: string;
3
+ };
4
+ //# sourceMappingURL=WithArchive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithArchive.d.ts","sourceRoot":"","sources":["../../src/WithArchive.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,MAAM,WAAW,CAAC,kBAAkB,IAAI,kBAAkB,GAAG;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA"}
@@ -1,191 +1,7 @@
1
- import * as _xyo_network_payload_model from '@xyo-network/payload-model';
2
- import { PayloadFindFilter, Payload } from '@xyo-network/payload-model';
3
- import { ApiConfig, ApiReportable, ApiError, ApiResponse, ApiResponseBody, ApiResponseTuple, ApiEnvelope } from '@xyo-network/api-models';
4
- import { Huri } from '@xyo-network/huri';
5
- import { AxiosJson } from '@xylabs/axios';
6
- import { DivinerConfig } from '@xyo-network/diviner-model';
7
-
8
- declare class ApiBase<C extends ApiConfig = ApiConfig> implements ApiReportable {
9
- readonly config: C;
10
- protected axios: AxiosJson;
11
- constructor(config: C);
12
- get authenticated(): boolean;
13
- protected get headers(): Record<string, string>;
14
- protected get query(): string;
15
- protected get root(): string;
16
- private static resolveResponse;
17
- private static shapeResponse;
18
- onError(error: ApiError, depth?: number): void;
19
- onFailure(response: ApiResponse, depth?: number): void;
20
- onSuccess(response: ApiResponse, depth?: number): void;
21
- protected deleteEndpoint<T = unknown>(endPoint?: string): Promise<ApiResponseBody<T>>;
22
- protected deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<ApiResponseBody<T>>;
23
- protected deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
24
- protected getEndpoint<T = unknown>(endPoint?: string): Promise<ApiResponseBody<T>>;
25
- protected getEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<ApiResponseBody<T>>;
26
- protected getEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
27
- protected handleMonitorResponseError<T>(error: ApiError, trapAxiosException: boolean): ApiResponse<ApiEnvelope<T>> | undefined;
28
- protected monitorResponse<T>(closure: () => Promise<ApiResponse<ApiEnvelope<T>>>): Promise<ApiResponse<ApiEnvelope<T>> | undefined>;
29
- protected postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<ApiResponseBody<T>>;
30
- protected postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>;
31
- protected postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
32
- protected putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<ApiResponseBody<T>>;
33
- protected putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>;
34
- protected putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
35
- private resolveRoot;
36
- }
37
-
38
- type ApiSimpleQuery = PayloadFindFilter;
39
- declare class ApiSimple<T = Payload, D = T, Q extends ApiSimpleQuery = ApiSimpleQuery, C extends ApiConfig = ApiConfig> extends ApiBase<C> {
40
- delete(): Promise<ApiResponseBody<T>>;
41
- delete(responseType?: 'body'): Promise<ApiResponseBody<T>>;
42
- delete(responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
43
- find(query?: Q): Promise<ApiResponseBody<T>>;
44
- find(query?: Q, responseType?: 'body'): Promise<ApiResponseBody<T>>;
45
- find(query?: Q, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
46
- get(): Promise<ApiResponseBody<T>>;
47
- get(responseType?: 'body'): Promise<ApiResponseBody<T>>;
48
- get(responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
49
- post(data?: D): Promise<ApiResponseBody<T>>;
50
- post(data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>;
51
- post(data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
52
- put(data?: D): Promise<ApiResponseBody<T>>;
53
- put(data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>;
54
- put(data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
55
- }
56
-
57
- declare class ArchivistApi<C extends ApiConfig = ApiConfig> extends ApiSimple<Payload[], C> {
58
- huri(huri: Huri | string): ApiSimple<{
59
- schema: string;
60
- } & _xyo_network_payload_model.PayloadFields, {
61
- schema: string;
62
- } & _xyo_network_payload_model.PayloadFields, _xyo_network_payload_model.PayloadFindFilter, ApiConfig>;
63
- }
64
-
65
- interface GetLocationQueryResponse {
66
- answerHash?: string;
67
- queryHash: string;
68
- }
69
-
70
- interface LocationHeatmapPointProperties {
71
- hash: string;
72
- value: number;
73
- }
74
-
75
- type CurrentLocationWitnessSchema = 'co.coinapp.currentlocationwitness';
76
- declare const CurrentLocationWitnessSchema: CurrentLocationWitnessSchema;
77
- type CurrentLocationWitnessPayload = Payload<{
78
- altitudeMeters: number;
79
- directionDegrees: number;
80
- latitude: number;
81
- longitude: number;
82
- quadkey: string;
83
- schema: CurrentLocationWitnessSchema;
84
- speedKph: number;
85
- }>;
86
-
87
- type LocationWitnessSchema = 'network.xyo.location';
88
- declare const LocationWitnessSchema: LocationWitnessSchema;
89
- interface Coordinates {
90
- accuracy: number | null;
91
- altitude: number | null;
92
- altitudeAccuracy: number | null;
93
- heading: number | null;
94
- latitude: number;
95
- longitude: number;
96
- speed: number | null;
97
- }
98
- interface CurrentLocation {
99
- coords: Coordinates;
100
- timestamp: number;
101
- }
102
- type LocationWitnessPayload = Payload<{
103
- currentLocation: CurrentLocation;
104
- schema: LocationWitnessSchema;
105
- }>;
106
-
107
- type LocationHeatmapQuerySchema = 'network.xyo.location.heatmap.query';
108
- declare const locationHeatmapQuerySchema: LocationHeatmapQuerySchema;
109
- type LocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer';
110
- declare const locationHeatmapAnswerSchema: LocationHeatmapAnswerSchema;
111
- type LocationHeatmapQuery = {
112
- schema: LocationWitnessSchema;
113
- startTime?: string;
114
- stopTime?: string;
115
- };
116
- declare const isLocationHeatmapQuery: (query: Record<string, unknown>) => query is LocationHeatmapQuery;
117
-
118
- type LocationQuadkeyHeatmapQuerySchema = 'network.xyo.location.heatmap.quadkey.query';
119
- declare const locationQuadkeyHeatmapQuerySchema: LocationQuadkeyHeatmapQuerySchema;
120
- type LocationQuadkeyHeatmapAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer';
121
- declare const locationQuadkeyHeatmapAnswerSchema: LocationQuadkeyHeatmapAnswerSchema;
122
- type LocationQuadkeyHeatmapQuery = {
123
- schema: LocationWitnessSchema;
124
- startTime?: string;
125
- stopTime?: string;
126
- };
127
- declare const isLocationQuadkeyHeatmapQuery: (query: Record<string, unknown>) => query is LocationQuadkeyHeatmapQuery;
128
-
129
- interface LocationTimeRangePointProperties {
130
- _archive: string;
131
- _client: string;
132
- _timestamp: number;
133
- schema: LocationWitnessSchema;
134
- }
135
-
136
- type LocationTimeRangeQuerySchema = 'network.xyo.location.range.query';
137
- declare const LocationTimeRangeQuerySchema: LocationTimeRangeQuerySchema;
138
- type LocationTimeRangeAnswerSchema = 'network.xyo.location.range.answer';
139
- declare const LocationTimeRangeAnswerSchema: LocationTimeRangeAnswerSchema;
140
- type LocationTimeRangeQuery = {
141
- schema: LocationWitnessSchema;
142
- startTime?: string;
143
- stopTime?: string;
144
- };
145
- declare const isLocationTimeRangeQuery: (query: Record<string, unknown>) => query is LocationTimeRangeQuery;
146
-
147
- type LocationQuerySchema = LocationQuadkeyHeatmapQuerySchema | LocationHeatmapQuerySchema | LocationTimeRangeQuerySchema;
148
- declare const isSupportedLocationQuerySchema: (schema: string) => schema is LocationQuerySchema;
149
-
150
- interface LocationQueryCreationRequest<TSchema extends LocationQuerySchema = LocationQuerySchema, TQuery extends Record<string, unknown> = Record<string, unknown>> {
151
- query: TQuery;
152
- resultArchive: string;
153
- resultArchivist: ApiConfig;
154
- schema: TSchema;
155
- sourceArchive: string;
156
- sourceArchivist: ApiConfig;
157
- }
158
- type LocationTimeRangeQueryCreationRequest = LocationQueryCreationRequest<LocationTimeRangeQuerySchema, LocationTimeRangeQuery>;
159
- type LocationHeatmapQueryCreationRequest = LocationQueryCreationRequest<LocationHeatmapQuerySchema, LocationHeatmapQuery>;
160
- type LocationQuadkeyHeatmapQueryCreationRequest = LocationQueryCreationRequest<LocationQuadkeyHeatmapQuerySchema, LocationQuadkeyHeatmapQuery>;
161
- type SupportedLocationQueryCreationRequest = LocationTimeRangeQueryCreationRequest | LocationHeatmapQueryCreationRequest | LocationQuadkeyHeatmapQueryCreationRequest;
162
-
163
- interface LocationQueryCreationResponse extends LocationQueryCreationRequest {
164
- hash: string;
165
- }
166
-
167
- declare class LocationDivinerApi {
168
- config: ApiConfig;
169
- constructor(config: ApiConfig);
170
- private get axiosRequestConfig();
171
- getLocationQuery(hash: string): Promise<GetLocationQueryResponse>;
172
- postLocationQuery(request: SupportedLocationQueryCreationRequest): Promise<LocationQueryCreationResponse>;
173
- }
174
-
175
- type RemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config';
176
- declare const RemoteDivinerConfigSchema: RemoteDivinerConfigSchema;
177
- type RemoteDivinerConfig = DivinerConfig & {
178
- api?: ArchivistApi;
179
- archive?: string;
180
- schema: RemoteDivinerConfigSchema;
181
- };
182
-
183
- interface ArchivePath {
184
- archive: string;
185
- }
186
-
187
- declare type WithArchive<ArchivistApiConfig> = ArchivistApiConfig & {
188
- _archive?: string;
189
- };
190
-
191
- export { ApiBase, ApiSimple, type ApiSimpleQuery, type ArchivePath, ArchivistApi, type Coordinates, type CurrentLocation, type CurrentLocationWitnessPayload, CurrentLocationWitnessSchema, type GetLocationQueryResponse, LocationDivinerApi, type LocationHeatmapAnswerSchema, type LocationHeatmapPointProperties, type LocationHeatmapQuery, type LocationHeatmapQueryCreationRequest, type LocationHeatmapQuerySchema, type LocationQuadkeyHeatmapAnswerSchema, type LocationQuadkeyHeatmapQuery, type LocationQuadkeyHeatmapQueryCreationRequest, type LocationQuadkeyHeatmapQuerySchema, type LocationQueryCreationRequest, type LocationQueryCreationResponse, type LocationQuerySchema, LocationTimeRangeAnswerSchema, type LocationTimeRangePointProperties, type LocationTimeRangeQuery, type LocationTimeRangeQueryCreationRequest, LocationTimeRangeQuerySchema, type LocationWitnessPayload, LocationWitnessSchema, type RemoteDivinerConfig, RemoteDivinerConfigSchema, type SupportedLocationQueryCreationRequest, type WithArchive, isLocationHeatmapQuery, isLocationQuadkeyHeatmapQuery, isLocationTimeRangeQuery, isSupportedLocationQuerySchema, locationHeatmapAnswerSchema, locationHeatmapQuerySchema, locationQuadkeyHeatmapAnswerSchema, locationQuadkeyHeatmapQuerySchema };
1
+ export * from './Api/index.ts';
2
+ export * from './Base.ts';
3
+ export * from './Diviner/index.ts';
4
+ export * from './models/index.ts';
5
+ export * from './Simple.ts';
6
+ export * from './WithArchive.ts';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA"}
@@ -194,9 +194,7 @@ var LocationDivinerApi = class {
194
194
  this.config = config;
195
195
  }
196
196
  get axiosRequestConfig() {
197
- return {
198
- transformResponse: getLocationDivinerApiResponseTransformer()
199
- };
197
+ return { transformResponse: getLocationDivinerApiResponseTransformer() };
200
198
  }
201
199
  async getLocationQuery(hash) {
202
200
  return (await axios2.get(`${this.config.apiDomain}/location/query/${hash}`, this.axiosRequestConfig)).data;
@@ -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"],"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 { AxiosJson } from '@xylabs/axios'\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'\n\nexport class ApiBase<C extends ApiConfig = ApiConfig> implements ApiReportable {\n readonly config: C\n protected axios: AxiosJson\n\n constructor(config: C) {\n this.config = config\n this.axios = new AxiosJson({ ...this.config, headers: this.headers })\n }\n\n get authenticated() {\n return !!this.config.apiKey || !!this.config.jwtToken\n }\n\n protected get headers(): Record<string, string> {\n const headers: Record<string, string> = {}\n if (this.config.jwtToken) {\n headers.Authorization = `Bearer ${this.config.jwtToken}`\n }\n if (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 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 { ApiConfig, ApiResponseBody, ApiResponseTuple, ApiResponseTupleOrBody, ApiResponseType } 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 { axios } from '@xylabs/axios'\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 {\n transformResponse: getLocationDivinerApiResponseTransformer(),\n }\n }\n\n async getLocationQuery(hash: string) {\n return (await axios.get<GetLocationQueryResponse>(`${this.config.apiDomain}/location/query/${hash}`, this.axiosRequestConfig)).data\n }\n\n async postLocationQuery(request: SupportedLocationQueryCreationRequest) {\n return (await axios.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 type LocationHeatmapQuerySchema = 'network.xyo.location.heatmap.query'\nexport const locationHeatmapQuerySchema: LocationHeatmapQuerySchema = 'network.xyo.location.heatmap.query'\n\nexport type LocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer'\nexport const locationHeatmapAnswerSchema: LocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer'\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 type LocationQuadkeyHeatmapQuerySchema = 'network.xyo.location.heatmap.quadkey.query'\nexport const locationQuadkeyHeatmapQuerySchema: LocationQuadkeyHeatmapQuerySchema = 'network.xyo.location.heatmap.quadkey.query'\nexport type LocationQuadkeyHeatmapAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer'\nexport const locationQuadkeyHeatmapAnswerSchema: LocationQuadkeyHeatmapAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer'\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 type { LocationWitnessSchema } from '../../Witnesses/index.ts'\n\nexport type LocationTimeRangeQuerySchema = 'network.xyo.location.range.query'\nexport const LocationTimeRangeQuerySchema: LocationTimeRangeQuerySchema = 'network.xyo.location.range.query'\n\nexport type LocationTimeRangeAnswerSchema = 'network.xyo.location.range.answer'\nexport const LocationTimeRangeAnswerSchema: LocationTimeRangeAnswerSchema = 'network.xyo.location.range.answer'\n\nexport type LocationTimeRangeQuery = {\n schema: LocationWitnessSchema\n startTime?: string\n stopTime?: string\n\n // TODO: Bounding rectangle, etc.\n}\n\nexport const isLocationTimeRangeQuery = (query: Record<string, unknown>): query is LocationTimeRangeQuery => {\n return query && query?.schema === LocationTimeRangeAnswerSchema\n}\n","import type { Payload } from '@xyo-network/payload-model'\n\nexport type CurrentLocationWitnessSchema = 'co.coinapp.currentlocationwitness'\nexport const CurrentLocationWitnessSchema: CurrentLocationWitnessSchema = 'co.coinapp.currentlocationwitness'\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 type LocationWitnessSchema = 'network.xyo.location'\nexport const LocationWitnessSchema: LocationWitnessSchema = 'network.xyo.location'\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 type RemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config'\nexport const RemoteDivinerConfigSchema: RemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config'\n\nexport type RemoteDivinerConfig = DivinerConfig & {\n /** @deprecated use in params instead */\n api?: ArchivistApi\n archive?: string\n schema: RemoteDivinerConfigSchema\n}\n"],"mappings":";AACA,SAAS,YAAY;;;ACDrB,SAAS,iBAAiB;AAanB,IAAM,UAAN,MAAM,SAAkE;AAAA,EACpE;AAAA,EACC;AAAA,EAEV,YAAY,QAAW;AACrB,SAAK,SAAS;AACd,SAAK,QAAQ,IAAI,UAAU,EAAE,GAAG,KAAK,QAAQ,SAAS,KAAK,QAAQ,CAAC;AAAA,EACtE;AAAA,EAEA,IAAI,gBAAgB;AAClB,WAAO,CAAC,CAAC,KAAK,OAAO,UAAU,CAAC,CAAC,KAAK,OAAO;AAAA,EAC/C;AAAA,EAEA,IAAc,UAAkC;AAC9C,UAAM,UAAkC,CAAC;AACzC,QAAI,KAAK,OAAO,UAAU;AACxB,cAAQ,gBAAgB,UAAU,KAAK,OAAO,QAAQ;AAAA,IACxD;AACA,QAAI,KAAK,OAAO,QAAQ;AACtB,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,QAAQ,OAAiB,QAAQ,GAA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C,WAAkD;AAC/F,SAAO,qBAAqB,MAA6B,KAAK;AAChE;;;ACXO,IAAM,+BAA6D;AAGnE,IAAM,gCAA+D;AAUrE,IAAM,2BAA2B,CAAC,UAAoE;AAC3G,SAAO,SAAS,OAAO,WAAW;AACpC;;;ACfO,IAAM,+BAA6D;;;ACAnE,IAAM,wBAA+C;;;ACErD,IAAM,4BAAuD;","names":["axios","axios"]}
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"],"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 { AxiosJson } from '@xylabs/axios'\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'\n\nexport class ApiBase<C extends ApiConfig = ApiConfig> implements ApiReportable {\n readonly config: C\n protected axios: AxiosJson\n\n constructor(config: C) {\n this.config = config\n this.axios = new AxiosJson({ ...this.config, headers: this.headers })\n }\n\n get authenticated() {\n return !!this.config.apiKey || !!this.config.jwtToken\n }\n\n protected get headers(): Record<string, string> {\n const headers: Record<string, string> = {}\n if (this.config.jwtToken) {\n headers.Authorization = `Bearer ${this.config.jwtToken}`\n }\n if (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 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 { axios } from '@xylabs/axios'\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 axios.get<GetLocationQueryResponse>(`${this.config.apiDomain}/location/query/${hash}`, this.axiosRequestConfig)).data\n }\n\n async postLocationQuery(request: SupportedLocationQueryCreationRequest) {\n return (await axios.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 type LocationHeatmapQuerySchema = 'network.xyo.location.heatmap.query'\nexport const locationHeatmapQuerySchema: LocationHeatmapQuerySchema = 'network.xyo.location.heatmap.query'\n\nexport type LocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer'\nexport const locationHeatmapAnswerSchema: LocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer'\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 type LocationQuadkeyHeatmapQuerySchema = 'network.xyo.location.heatmap.quadkey.query'\nexport const locationQuadkeyHeatmapQuerySchema: LocationQuadkeyHeatmapQuerySchema = 'network.xyo.location.heatmap.quadkey.query'\nexport type LocationQuadkeyHeatmapAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer'\nexport const locationQuadkeyHeatmapAnswerSchema: LocationQuadkeyHeatmapAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer'\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 type { LocationWitnessSchema } from '../../Witnesses/index.ts'\n\nexport type LocationTimeRangeQuerySchema = 'network.xyo.location.range.query'\nexport const LocationTimeRangeQuerySchema: LocationTimeRangeQuerySchema = 'network.xyo.location.range.query'\n\nexport type LocationTimeRangeAnswerSchema = 'network.xyo.location.range.answer'\nexport const LocationTimeRangeAnswerSchema: LocationTimeRangeAnswerSchema = 'network.xyo.location.range.answer'\n\nexport type LocationTimeRangeQuery = {\n schema: LocationWitnessSchema\n startTime?: string\n stopTime?: string\n\n // TODO: Bounding rectangle, etc.\n}\n\nexport const isLocationTimeRangeQuery = (query: Record<string, unknown>): query is LocationTimeRangeQuery => {\n return query && query?.schema === LocationTimeRangeAnswerSchema\n}\n","import type { Payload } from '@xyo-network/payload-model'\n\nexport type CurrentLocationWitnessSchema = 'co.coinapp.currentlocationwitness'\nexport const CurrentLocationWitnessSchema: CurrentLocationWitnessSchema = 'co.coinapp.currentlocationwitness'\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 type LocationWitnessSchema = 'network.xyo.location'\nexport const LocationWitnessSchema: LocationWitnessSchema = 'network.xyo.location'\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 type RemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config'\nexport const RemoteDivinerConfigSchema: RemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config'\n\nexport type RemoteDivinerConfig = DivinerConfig & {\n /** @deprecated use in params instead */\n api?: ArchivistApi\n archive?: string\n schema: RemoteDivinerConfigSchema\n}\n"],"mappings":";AACA,SAAS,YAAY;;;ACDrB,SAAS,iBAAiB;AAanB,IAAM,UAAN,MAAM,SAAkE;AAAA,EACpE;AAAA,EACC;AAAA,EAEV,YAAY,QAAW;AACrB,SAAK,SAAS;AACd,SAAK,QAAQ,IAAI,UAAU,EAAE,GAAG,KAAK,QAAQ,SAAS,KAAK,QAAQ,CAAC;AAAA,EACtE;AAAA,EAEA,IAAI,gBAAgB;AAClB,WAAO,CAAC,CAAC,KAAK,OAAO,UAAU,CAAC,CAAC,KAAK,OAAO;AAAA,EAC/C;AAAA,EAEA,IAAc,UAAkC;AAC9C,UAAM,UAAkC,CAAC;AACzC,QAAI,KAAK,OAAO,UAAU;AACxB,cAAQ,gBAAgB,UAAU,KAAK,OAAO,QAAQ;AAAA,IACxD;AACA,QAAI,KAAK,OAAO,QAAQ;AACtB,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,QAAQ,OAAiB,QAAQ,GAAG;AAClC,SAAK,OAAO,kBAAkB,UAAU,OAAO,QAAQ,CAAC;AACxD,SAAK,OAAO,UAAU,OAAO,KAAK;AAAA,EACp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BAA2B,CAAC,UAAoE;AAC3G,SAAO,SAAS,OAAO,WAAW;AACpC;;;ACfO,IAAM,+BAA6D;;;ACAnE,IAAM,wBAA+C;;;ACErD,IAAM,4BAAuD;","names":["axios","axios"]}
@@ -0,0 +1,4 @@
1
+ export interface ArchivePath {
2
+ archive: string;
3
+ }
4
+ //# sourceMappingURL=ArchivePath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArchivePath.d.ts","sourceRoot":"","sources":["../../../src/models/ArchivePath.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAA;CAChB"}
@@ -0,0 +1,2 @@
1
+ export * from './ArchivePath.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const objToQuery: (obj: Record<string, string | number | undefined>) => string;
2
+ //# sourceMappingURL=objToQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objToQuery.d.ts","sourceRoot":"","sources":["../../src/objToQuery.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,WAO1E,CAAA"}
package/package.json CHANGED
@@ -1,56 +1,56 @@
1
1
  {
2
+ "name": "@xyo-network/api",
3
+ "version": "3.0.8",
4
+ "description": "Primary SDK for using XYO Protocol 2.0",
5
+ "homepage": "https://xyo.network",
6
+ "bugs": {
7
+ "url": "git+https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues",
8
+ "email": "support@xyo.network"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
13
+ },
14
+ "license": "LGPL-3.0-only",
2
15
  "author": {
3
- "email": "support@xyo.network",
4
16
  "name": "XYO Development Team",
17
+ "email": "support@xyo.network",
5
18
  "url": "https://xyo.network"
6
19
  },
7
- "bugs": {
8
- "email": "support@xyo.network",
9
- "url": "git+https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
20
+ "sideEffects": false,
21
+ "type": "module",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/neutral/index.d.ts",
25
+ "default": "./dist/neutral/index.mjs"
26
+ },
27
+ "./package.json": "./package.json"
10
28
  },
29
+ "module": "dist/neutral/index.mjs",
30
+ "types": "dist/neutral/index.d.ts",
11
31
  "dependencies": {
12
- "@xylabs/axios": "^4.0.2",
13
- "@xylabs/object": "^4.0.2",
14
- "@xyo-network/api-models": "^3.0.6",
15
- "@xyo-network/boundwitness-model": "^3.0.6",
16
- "@xyo-network/diviner-model": "^3.0.6",
17
- "@xyo-network/huri": "^3.0.6",
18
- "@xyo-network/payload-model": "^3.0.6",
19
- "axios": "^1.7.4"
32
+ "@xylabs/axios": "^4.0.3",
33
+ "@xylabs/object": "^4.0.3",
34
+ "@xyo-network/api-models": "^3.0.8",
35
+ "@xyo-network/boundwitness-model": "^3.0.8",
36
+ "@xyo-network/diviner-model": "^3.0.8",
37
+ "@xyo-network/huri": "^3.0.8",
38
+ "@xyo-network/payload-model": "^3.0.8",
39
+ "axios": "^1.7.5"
20
40
  },
21
- "description": "Primary SDK for using XYO Protocol 2.0",
22
41
  "devDependencies": {
23
42
  "@types/node": "^22.5.0",
24
43
  "@types/uuid": "^10.0.0",
25
- "@xylabs/jest-helpers": "^4.0.2",
26
- "@xylabs/ts-scripts-yarn3": "^4.0.0-rc.30",
27
- "@xylabs/tsconfig": "^4.0.0-rc.30",
28
- "@xyo-network/module-model": "^3.0.6",
29
- "@xyo-network/query-payload-plugin": "^3.0.6",
44
+ "@xylabs/jest-helpers": "^4.0.3",
45
+ "@xylabs/ts-scripts-yarn3": "^4.0.7",
46
+ "@xylabs/tsconfig": "^4.0.7",
47
+ "@xyo-network/module-model": "^3.0.8",
48
+ "@xyo-network/query-payload-plugin": "^3.0.8",
30
49
  "jest": "^29.7.0",
31
50
  "typescript": "^5.5.4",
32
51
  "uuid": "^10.0.0"
33
52
  },
34
- "exports": {
35
- ".": {
36
- "types": "./dist/neutral/index.d.ts",
37
- "default": "./dist/neutral/index.mjs"
38
- },
39
- "./package.json": "./package.json"
40
- },
41
- "module": "dist/neutral/index.mjs",
42
- "types": "dist/neutral/index.d.ts",
43
- "homepage": "https://xyo.network",
44
- "license": "LGPL-3.0-only",
45
- "name": "@xyo-network/api",
46
53
  "publishConfig": {
47
54
  "access": "public"
48
- },
49
- "repository": {
50
- "type": "git",
51
- "url": "git+https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
52
- },
53
- "sideEffects": false,
54
- "version": "3.0.6",
55
- "type": "module"
55
+ }
56
56
  }
@@ -13,9 +13,7 @@ class LocationDivinerApi {
13
13
  }
14
14
 
15
15
  private get axiosRequestConfig(): RawAxiosRequestConfig {
16
- return {
17
- transformResponse: getLocationDivinerApiResponseTransformer(),
18
- }
16
+ return { transformResponse: getLocationDivinerApiResponseTransformer() }
19
17
  }
20
18
 
21
19
  async getLocationQuery(hash: string) {
package/src/Simple.ts CHANGED
@@ -1,4 +1,6 @@
1
- import type { ApiConfig, ApiResponseBody, ApiResponseTuple, ApiResponseTupleOrBody, ApiResponseType } from '@xyo-network/api-models'
1
+ import type {
2
+ ApiConfig, ApiResponseBody, ApiResponseTuple, ApiResponseTupleOrBody, ApiResponseType,
3
+ } from '@xyo-network/api-models'
2
4
  import type { Payload, PayloadFindFilter } from '@xyo-network/payload-model'
3
5
 
4
6
  import { ApiBase } from './Base.ts'
@@ -2,9 +2,7 @@ import type { BoundWitness } from '@xyo-network/boundwitness-model'
2
2
  import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'
3
3
 
4
4
  const testBoundWitness: BoundWitness = {
5
- $meta: {
6
- signatures: ['95100e5fd2012b958e96895870cfac5353c3a33a19314cfd1304ef7d01d052ec2a3ef80d6449cf88d463027fe0d868ed8cfb8b7323d37e93a08570233eea0b17'],
7
- },
5
+ $meta: { signatures: ['95100e5fd2012b958e96895870cfac5353c3a33a19314cfd1304ef7d01d052ec2a3ef80d6449cf88d463027fe0d868ed8cfb8b7323d37e93a08570233eea0b17'] },
8
6
  addresses: ['5346a2ce56ec4177b67092bda710e150ba6fa046'],
9
7
  payload_hashes: ['20e14207f952a09f767ff614a648546c037fe524ace0bfe55db31f818aff1f1c'],
10
8
  payload_schemas: ['network.xyo.test'],
package/xy.config.ts CHANGED
@@ -2,9 +2,7 @@ import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
2
  const config: XyTsupConfig = {
3
3
  compile: {
4
4
  browser: {},
5
- neutral: {
6
- src: true,
7
- },
5
+ neutral: { src: true },
8
6
  node: {},
9
7
  },
10
8
  }