@xyo-network/api 2.110.16 → 2.110.17
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/browser/Api/Api.d.cts +1 -1
- package/dist/browser/Api/Api.d.mts +1 -1
- package/dist/browser/Api/Api.d.ts +1 -1
- package/dist/browser/Api/index.d.cts +1 -1
- package/dist/browser/Api/index.d.mts +1 -1
- package/dist/browser/Api/index.d.ts +1 -1
- package/dist/browser/Diviner/LocationDiviner/LocationDivinerApi.d.cts +2 -2
- package/dist/browser/Diviner/LocationDiviner/LocationDivinerApi.d.mts +2 -2
- package/dist/browser/Diviner/LocationDiviner/LocationDivinerApi.d.ts +2 -2
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.cts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.mts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.ts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.cts +2 -2
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.mts +2 -2
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.ts +2 -2
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.cts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.mts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.ts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.cts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.mts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.ts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.cts +4 -4
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.mts +4 -4
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts +4 -4
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.cts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.mts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.ts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.cts +3 -3
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.mts +3 -3
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.ts +3 -3
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.cts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.mts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.ts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.cts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.mts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.ts +1 -1
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.cts +2 -2
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.mts +2 -2
- package/dist/browser/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.ts +2 -2
- package/dist/browser/Diviner/LocationDiviner/Queries/index.d.cts +6 -6
- package/dist/browser/Diviner/LocationDiviner/Queries/index.d.mts +6 -6
- package/dist/browser/Diviner/LocationDiviner/Queries/index.d.ts +6 -6
- package/dist/browser/Diviner/LocationDiviner/Witnesses/index.d.cts +2 -2
- package/dist/browser/Diviner/LocationDiviner/Witnesses/index.d.mts +2 -2
- package/dist/browser/Diviner/LocationDiviner/Witnesses/index.d.ts +2 -2
- package/dist/browser/Diviner/LocationDiviner/index.d.cts +4 -4
- package/dist/browser/Diviner/LocationDiviner/index.d.mts +4 -4
- package/dist/browser/Diviner/LocationDiviner/index.d.ts +4 -4
- package/dist/browser/Diviner/RemoteDivinerConfig.d.cts +1 -1
- package/dist/browser/Diviner/RemoteDivinerConfig.d.mts +1 -1
- package/dist/browser/Diviner/RemoteDivinerConfig.d.ts +1 -1
- package/dist/browser/Diviner/index.d.cts +2 -2
- package/dist/browser/Diviner/index.d.mts +2 -2
- package/dist/browser/Diviner/index.d.ts +2 -2
- package/dist/browser/Simple.d.cts +1 -1
- package/dist/browser/Simple.d.mts +1 -1
- package/dist/browser/Simple.d.ts +1 -1
- package/dist/browser/Test/index.d.cts +2 -2
- package/dist/browser/Test/index.d.mts +2 -2
- package/dist/browser/Test/index.d.ts +2 -2
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +6 -6
- package/dist/browser/index.d.mts +6 -6
- package/dist/browser/index.d.ts +6 -6
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/models/index.d.cts +1 -1
- package/dist/browser/models/index.d.mts +1 -1
- package/dist/browser/models/index.d.ts +1 -1
- package/dist/neutral/Api/Api.d.cts +1 -1
- package/dist/neutral/Api/Api.d.mts +1 -1
- package/dist/neutral/Api/Api.d.ts +1 -1
- package/dist/neutral/Api/index.d.cts +1 -1
- package/dist/neutral/Api/index.d.mts +1 -1
- package/dist/neutral/Api/index.d.ts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/LocationDivinerApi.d.cts +2 -2
- package/dist/neutral/Diviner/LocationDiviner/LocationDivinerApi.d.mts +2 -2
- package/dist/neutral/Diviner/LocationDiviner/LocationDivinerApi.d.ts +2 -2
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.cts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.mts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.ts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.cts +2 -2
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.mts +2 -2
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.ts +2 -2
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.cts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.mts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.ts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.cts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.mts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.ts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.cts +4 -4
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.mts +4 -4
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts +4 -4
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.cts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.mts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.ts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.cts +3 -3
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.mts +3 -3
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.ts +3 -3
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.cts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.mts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.ts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.cts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.mts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.ts +1 -1
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.cts +2 -2
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.mts +2 -2
- package/dist/neutral/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.ts +2 -2
- package/dist/neutral/Diviner/LocationDiviner/Queries/index.d.cts +6 -6
- package/dist/neutral/Diviner/LocationDiviner/Queries/index.d.mts +6 -6
- package/dist/neutral/Diviner/LocationDiviner/Queries/index.d.ts +6 -6
- package/dist/neutral/Diviner/LocationDiviner/Witnesses/index.d.cts +2 -2
- package/dist/neutral/Diviner/LocationDiviner/Witnesses/index.d.mts +2 -2
- package/dist/neutral/Diviner/LocationDiviner/Witnesses/index.d.ts +2 -2
- package/dist/neutral/Diviner/LocationDiviner/index.d.cts +4 -4
- package/dist/neutral/Diviner/LocationDiviner/index.d.mts +4 -4
- package/dist/neutral/Diviner/LocationDiviner/index.d.ts +4 -4
- package/dist/neutral/Diviner/RemoteDivinerConfig.d.cts +1 -1
- package/dist/neutral/Diviner/RemoteDivinerConfig.d.mts +1 -1
- package/dist/neutral/Diviner/RemoteDivinerConfig.d.ts +1 -1
- package/dist/neutral/Diviner/index.d.cts +2 -2
- package/dist/neutral/Diviner/index.d.mts +2 -2
- package/dist/neutral/Diviner/index.d.ts +2 -2
- package/dist/neutral/Simple.d.cts +1 -1
- package/dist/neutral/Simple.d.mts +1 -1
- package/dist/neutral/Simple.d.ts +1 -1
- package/dist/neutral/Test/index.d.cts +2 -2
- package/dist/neutral/Test/index.d.mts +2 -2
- package/dist/neutral/Test/index.d.ts +2 -2
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.d.cts +6 -6
- package/dist/neutral/index.d.mts +6 -6
- package/dist/neutral/index.d.ts +6 -6
- package/dist/neutral/index.js.map +1 -1
- package/dist/neutral/models/index.d.cts +1 -1
- package/dist/neutral/models/index.d.mts +1 -1
- package/dist/neutral/models/index.d.ts +1 -1
- package/dist/node/Api/Api.d.cts +1 -1
- package/dist/node/Api/Api.d.mts +1 -1
- package/dist/node/Api/Api.d.ts +1 -1
- package/dist/node/Api/index.d.cts +1 -1
- package/dist/node/Api/index.d.mts +1 -1
- package/dist/node/Api/index.d.ts +1 -1
- package/dist/node/Diviner/LocationDiviner/LocationDivinerApi.d.cts +2 -2
- package/dist/node/Diviner/LocationDiviner/LocationDivinerApi.d.mts +2 -2
- package/dist/node/Diviner/LocationDiviner/LocationDivinerApi.d.ts +2 -2
- package/dist/node/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.cts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.mts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.ts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.cts +2 -2
- package/dist/node/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.mts +2 -2
- package/dist/node/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.ts +2 -2
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.cts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.mts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.ts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.cts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.mts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.ts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.cts +4 -4
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.mts +4 -4
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts +4 -4
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.cts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.mts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.ts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.cts +3 -3
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.mts +3 -3
- package/dist/node/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.ts +3 -3
- package/dist/node/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.cts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.mts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.ts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.cts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.mts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.ts +1 -1
- package/dist/node/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.cts +2 -2
- package/dist/node/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.mts +2 -2
- package/dist/node/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.ts +2 -2
- package/dist/node/Diviner/LocationDiviner/Queries/index.d.cts +6 -6
- package/dist/node/Diviner/LocationDiviner/Queries/index.d.mts +6 -6
- package/dist/node/Diviner/LocationDiviner/Queries/index.d.ts +6 -6
- package/dist/node/Diviner/LocationDiviner/Witnesses/index.d.cts +2 -2
- package/dist/node/Diviner/LocationDiviner/Witnesses/index.d.mts +2 -2
- package/dist/node/Diviner/LocationDiviner/Witnesses/index.d.ts +2 -2
- package/dist/node/Diviner/LocationDiviner/index.d.cts +4 -4
- package/dist/node/Diviner/LocationDiviner/index.d.mts +4 -4
- package/dist/node/Diviner/LocationDiviner/index.d.ts +4 -4
- package/dist/node/Diviner/RemoteDivinerConfig.d.cts +1 -1
- package/dist/node/Diviner/RemoteDivinerConfig.d.mts +1 -1
- package/dist/node/Diviner/RemoteDivinerConfig.d.ts +1 -1
- package/dist/node/Diviner/index.d.cts +2 -2
- package/dist/node/Diviner/index.d.mts +2 -2
- package/dist/node/Diviner/index.d.ts +2 -2
- package/dist/node/Simple.d.cts +1 -1
- package/dist/node/Simple.d.mts +1 -1
- package/dist/node/Simple.d.ts +1 -1
- package/dist/node/Test/index.d.cts +2 -2
- package/dist/node/Test/index.d.mts +2 -2
- package/dist/node/Test/index.d.ts +2 -2
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +6 -6
- package/dist/node/index.d.mts +6 -6
- package/dist/node/index.d.ts +6 -6
- package/dist/node/index.js.map +1 -1
- package/dist/node/models/index.d.cts +1 -1
- package/dist/node/models/index.d.mts +1 -1
- package/dist/node/models/index.d.ts +1 -1
- package/package.json +8 -8
- package/src/Api/Api.ts +1 -1
- package/src/Api/index.ts +1 -1
- package/src/Diviner/LocationDiviner/LocationDivinerApi.ts +3 -3
- package/src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.ts +1 -1
- package/src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.ts +2 -2
- package/src/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.ts +1 -1
- package/src/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.ts +1 -1
- package/src/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.ts +4 -4
- package/src/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.ts +1 -1
- package/src/Diviner/LocationDiviner/Queries/LocationQuerySchema.ts +3 -3
- package/src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.ts +1 -1
- package/src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.ts +1 -1
- package/src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.ts +2 -2
- package/src/Diviner/LocationDiviner/Queries/index.ts +6 -6
- package/src/Diviner/LocationDiviner/Witnesses/index.ts +2 -2
- package/src/Diviner/LocationDiviner/index.ts +4 -4
- package/src/Diviner/RemoteDivinerConfig.ts +1 -1
- package/src/Diviner/index.ts +2 -2
- package/src/Simple.ts +2 -2
- package/src/Test/index.ts +2 -2
- package/src/index.ts +6 -6
- package/src/models/index.ts +1 -1
package/dist/node/index.cjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../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":["export * from './Api/index.js'\nexport * from './Base.js'\nexport * from './Diviner/index.js'\nexport * from './models/index.js'\nexport * from './Simple.js'\nexport * from './WithArchive.js'\n","import { ApiConfig } from '@xyo-network/api-models'\nimport { Huri } from '@xyo-network/huri'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { ApiSimple } from '../Simple.js'\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 {\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 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 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 { ApiConfig, ApiResponseBody, ApiResponseTuple, ApiResponseTupleOrBody, ApiResponseType } from '@xyo-network/api-models'\nimport { Payload, PayloadFindFilter } from '@xyo-network/payload-model'\n\nimport { ApiBase } from './Base.js'\nimport { objToQuery } from './objToQuery.js'\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, RawAxiosRequestConfig } from '@xylabs/axios'\nimport { ApiConfig } from '@xyo-network/api-models'\n\nimport { getLocationDivinerApiResponseTransformer } from './LocationDivinerApiResponseTransformer.js'\nimport { GetLocationQueryResponse } from './models.js'\nimport { LocationQueryCreationResponse, SupportedLocationQueryCreationRequest } from './Queries/index.js'\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 { axios, AxiosResponseTransformer } from '@xylabs/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 { LocationWitnessSchema } from '../../Witnesses/index.js'\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 { LocationWitnessSchema } from '../../Witnesses/index.js'\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 { LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.js'\nimport { LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.js'\nimport { LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery/index.js'\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 { LocationWitnessSchema } from '../../Witnesses/index.js'\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 { 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 { 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 { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { ArchivistApi } from '../Api/index.js'\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AUrE,IAAM,2BAA2B,CAAC,UAAoE;AAC3G,SAAO,UAAS,+BAAO,YAAW;AACpC;;;ACfO,IAAM,+BAA6D;;;ACAnE,IAAM,wBAA+C;;;ACErD,IAAM,4BAAuD;","names":["import_axios","import_axios"]}
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../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":["export * from './Api/index.ts'\nexport * from './Base.ts'\nexport * from './Diviner/index.ts'\nexport * from './models/index.ts'\nexport * from './Simple.ts'\nexport * from './WithArchive.ts'\n","import { ApiConfig } from '@xyo-network/api-models'\nimport { Huri } from '@xyo-network/huri'\nimport { 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 {\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 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 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 { ApiConfig, ApiResponseBody, ApiResponseTuple, ApiResponseTupleOrBody, ApiResponseType } from '@xyo-network/api-models'\nimport { 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, RawAxiosRequestConfig } from '@xylabs/axios'\nimport { ApiConfig } from '@xyo-network/api-models'\n\nimport { getLocationDivinerApiResponseTransformer } from './LocationDivinerApiResponseTransformer.ts'\nimport { GetLocationQueryResponse } from './models.ts'\nimport { 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 { axios, AxiosResponseTransformer } from '@xylabs/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 { 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 { 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 { LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.ts'\nimport { LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.ts'\nimport { 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 { 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 { 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 { 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 { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { 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?: Arch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8C;AAAA,EAC9C,sCAAsC;AAAA,EACtC,oCAAoC;AACtC;AAEO,IAAM,iCAAiC,CAAC,WAAkD;AAC/F,SAAO,qBAAqB,MAA6B,KAAK;AAChE;;;ACXO,IAAM,+BAA6D;AAGnE,IAAM,gCAA+D;AAUrE,IAAM,2BAA2B,CAAC,UAAoE;AAC3G,SAAO,UAAS,+BAAO,YAAW;AACpC;;;ACfO,IAAM,+BAA6D;;;ACAnE,IAAM,wBAA+C;;;ACErD,IAAM,4BAAuD;","names":["import_axios","import_axios"]}
|
package/dist/node/index.d.cts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
export * from './Api/index.
|
2
|
-
export * from './Base.
|
3
|
-
export * from './Diviner/index.
|
4
|
-
export * from './models/index.
|
5
|
-
export * from './Simple.
|
6
|
-
export * from './WithArchive.
|
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
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.d.mts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
export * from './Api/index.
|
2
|
-
export * from './Base.
|
3
|
-
export * from './Diviner/index.
|
4
|
-
export * from './models/index.
|
5
|
-
export * from './Simple.
|
6
|
-
export * from './WithArchive.
|
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
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
export * from './Api/index.
|
2
|
-
export * from './Base.
|
3
|
-
export * from './Diviner/index.
|
4
|
-
export * from './models/index.
|
5
|
-
export * from './Simple.
|
6
|
-
export * from './WithArchive.
|
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
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.js.map
CHANGED
@@ -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 { ApiConfig } from '@xyo-network/api-models'\nimport { Huri } from '@xyo-network/huri'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { ApiSimple } from '../Simple.js'\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 {\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 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 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 { ApiConfig, ApiResponseBody, ApiResponseTuple, ApiResponseTupleOrBody, ApiResponseType } from '@xyo-network/api-models'\nimport { Payload, PayloadFindFilter } from '@xyo-network/payload-model'\n\nimport { ApiBase } from './Base.js'\nimport { objToQuery } from './objToQuery.js'\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, RawAxiosRequestConfig } from '@xylabs/axios'\nimport { ApiConfig } from '@xyo-network/api-models'\n\nimport { getLocationDivinerApiResponseTransformer } from './LocationDivinerApiResponseTransformer.js'\nimport { GetLocationQueryResponse } from './models.js'\nimport { LocationQueryCreationResponse, SupportedLocationQueryCreationRequest } from './Queries/index.js'\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 { axios, AxiosResponseTransformer } from '@xylabs/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 { LocationWitnessSchema } from '../../Witnesses/index.js'\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 { LocationWitnessSchema } from '../../Witnesses/index.js'\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 { LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.js'\nimport { LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.js'\nimport { LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery/index.js'\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 { LocationWitnessSchema } from '../../Witnesses/index.js'\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 { 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 { 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 { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { ArchivistApi } from '../Api/index.js'\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;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SAAO,UAAS,+BAAO,YAAW;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 { ApiConfig } from '@xyo-network/api-models'\nimport { Huri } from '@xyo-network/huri'\nimport { 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 {\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 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 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 { ApiConfig, ApiResponseBody, ApiResponseTuple, ApiResponseTupleOrBody, ApiResponseType } from '@xyo-network/api-models'\nimport { 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, RawAxiosRequestConfig } from '@xylabs/axios'\nimport { ApiConfig } from '@xyo-network/api-models'\n\nimport { getLocationDivinerApiResponseTransformer } from './LocationDivinerApiResponseTransformer.ts'\nimport { GetLocationQueryResponse } from './models.ts'\nimport { 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 { axios, AxiosResponseTransformer } from '@xylabs/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 { 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 { 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 { LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.ts'\nimport { LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.ts'\nimport { 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 { 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 { 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 { 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 { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { 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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AAuD;","names":["axios","axios"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './ArchivePath.
|
1
|
+
export * from './ArchivePath.ts';
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './ArchivePath.
|
1
|
+
export * from './ArchivePath.ts';
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './ArchivePath.
|
1
|
+
export * from './ArchivePath.ts';
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
@@ -11,11 +11,11 @@
|
|
11
11
|
"dependencies": {
|
12
12
|
"@xylabs/axios": "^3.6.6",
|
13
13
|
"@xylabs/object": "^3.6.6",
|
14
|
-
"@xyo-network/api-models": "^2.110.
|
15
|
-
"@xyo-network/boundwitness-model": "^2.110.
|
16
|
-
"@xyo-network/diviner-model": "^2.110.
|
17
|
-
"@xyo-network/huri": "^2.110.
|
18
|
-
"@xyo-network/payload-model": "^2.110.
|
14
|
+
"@xyo-network/api-models": "^2.110.17",
|
15
|
+
"@xyo-network/boundwitness-model": "^2.110.17",
|
16
|
+
"@xyo-network/diviner-model": "^2.110.17",
|
17
|
+
"@xyo-network/huri": "^2.110.17",
|
18
|
+
"@xyo-network/payload-model": "^2.110.17"
|
19
19
|
},
|
20
20
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
21
21
|
"devDependencies": {
|
@@ -24,8 +24,8 @@
|
|
24
24
|
"@xylabs/jest-helpers": "^3.6.6",
|
25
25
|
"@xylabs/ts-scripts-yarn3": "^3.14.1",
|
26
26
|
"@xylabs/tsconfig": "^3.14.1",
|
27
|
-
"@xyo-network/module-model": "^2.110.
|
28
|
-
"@xyo-network/query-payload-plugin": "^2.110.
|
27
|
+
"@xyo-network/module-model": "^2.110.17",
|
28
|
+
"@xyo-network/query-payload-plugin": "^2.110.17",
|
29
29
|
"jest": "^29.7.0",
|
30
30
|
"typescript": "^5.5.4",
|
31
31
|
"uuid": "^10.0.0"
|
@@ -69,6 +69,6 @@
|
|
69
69
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
70
70
|
},
|
71
71
|
"sideEffects": false,
|
72
|
-
"version": "2.110.
|
72
|
+
"version": "2.110.17",
|
73
73
|
"type": "module"
|
74
74
|
}
|
package/src/Api/Api.ts
CHANGED
@@ -2,7 +2,7 @@ import { ApiConfig } from '@xyo-network/api-models'
|
|
2
2
|
import { Huri } from '@xyo-network/huri'
|
3
3
|
import { Payload } from '@xyo-network/payload-model'
|
4
4
|
|
5
|
-
import { ApiSimple } from '../Simple.
|
5
|
+
import { ApiSimple } from '../Simple.ts'
|
6
6
|
|
7
7
|
export class ArchivistApi<C extends ApiConfig = ApiConfig> extends ApiSimple<Payload[], C> {
|
8
8
|
huri(huri: Huri | string) {
|
package/src/Api/index.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export * from './Api.
|
1
|
+
export * from './Api.ts'
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { axios, RawAxiosRequestConfig } from '@xylabs/axios'
|
2
2
|
import { ApiConfig } from '@xyo-network/api-models'
|
3
3
|
|
4
|
-
import { getLocationDivinerApiResponseTransformer } from './LocationDivinerApiResponseTransformer.
|
5
|
-
import { GetLocationQueryResponse } from './models.
|
6
|
-
import { LocationQueryCreationResponse, SupportedLocationQueryCreationRequest } from './Queries/index.
|
4
|
+
import { getLocationDivinerApiResponseTransformer } from './LocationDivinerApiResponseTransformer.ts'
|
5
|
+
import { GetLocationQueryResponse } from './models.ts'
|
6
|
+
import { LocationQueryCreationResponse, SupportedLocationQueryCreationRequest } from './Queries/index.ts'
|
7
7
|
|
8
8
|
class LocationDivinerApi {
|
9
9
|
config: ApiConfig
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { LocationWitnessSchema } from '../../Witnesses/index.
|
1
|
+
import { LocationWitnessSchema } from '../../Witnesses/index.ts'
|
2
2
|
|
3
3
|
export type LocationHeatmapQuerySchema = 'network.xyo.location.heatmap.query'
|
4
4
|
export const locationHeatmapQuerySchema: LocationHeatmapQuerySchema = 'network.xyo.location.heatmap.query'
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './LocationHeatmapPointProperties.
|
2
|
-
export * from './LocationHeatmapQuery.
|
1
|
+
export * from './LocationHeatmapPointProperties.ts'
|
2
|
+
export * from './LocationHeatmapQuery.ts'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { LocationWitnessSchema } from '../../Witnesses/index.
|
1
|
+
import { LocationWitnessSchema } from '../../Witnesses/index.ts'
|
2
2
|
|
3
3
|
export type LocationQuadkeyHeatmapQuerySchema = 'network.xyo.location.heatmap.quadkey.query'
|
4
4
|
export const locationQuadkeyHeatmapQuerySchema: LocationQuadkeyHeatmapQuerySchema = 'network.xyo.location.heatmap.quadkey.query'
|
@@ -1 +1 @@
|
|
1
|
-
export * from './LocationQuadkeyHeatmapQuery.
|
1
|
+
export * from './LocationQuadkeyHeatmapQuery.ts'
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { ApiConfig } from '@xyo-network/api-models'
|
2
2
|
|
3
|
-
import { LocationHeatmapQuery, LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.
|
4
|
-
import { LocationQuadkeyHeatmapQuery, LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.
|
5
|
-
import { LocationQuerySchema } from './LocationQuerySchema.
|
6
|
-
import { LocationTimeRangeQuery, LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery/index.
|
3
|
+
import { LocationHeatmapQuery, LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.ts'
|
4
|
+
import { LocationQuadkeyHeatmapQuery, LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.ts'
|
5
|
+
import { LocationQuerySchema } from './LocationQuerySchema.ts'
|
6
|
+
import { LocationTimeRangeQuery, LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery/index.ts'
|
7
7
|
|
8
8
|
export interface LocationQueryCreationRequest<
|
9
9
|
TSchema extends LocationQuerySchema = LocationQuerySchema,
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.
|
2
|
-
import { LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.
|
3
|
-
import { LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery/index.
|
1
|
+
import { LocationHeatmapQuerySchema } from './LocationHeatmapQuery/index.ts'
|
2
|
+
import { LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery/index.ts'
|
3
|
+
import { LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery/index.ts'
|
4
4
|
|
5
5
|
export type LocationQuerySchema = LocationQuadkeyHeatmapQuerySchema | LocationHeatmapQuerySchema | LocationTimeRangeQuerySchema
|
6
6
|
|
package/src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { LocationWitnessSchema } from '../../Witnesses/index.
|
1
|
+
import { LocationWitnessSchema } from '../../Witnesses/index.ts'
|
2
2
|
|
3
3
|
export type LocationTimeRangeQuerySchema = 'network.xyo.location.range.query'
|
4
4
|
export const LocationTimeRangeQuerySchema: LocationTimeRangeQuerySchema = 'network.xyo.location.range.query'
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './LocationTimeRangePointProperties.
|
2
|
-
export * from './LocationTimeRangeQuery.
|
1
|
+
export * from './LocationTimeRangePointProperties.ts'
|
2
|
+
export * from './LocationTimeRangeQuery.ts'
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export * from './LocationHeatmapQuery/index.
|
2
|
-
export * from './LocationQuadkeyHeatmapQuery/index.
|
3
|
-
export * from './LocationQueryCreationRequest.
|
4
|
-
export * from './LocationQueryCreationResponse.
|
5
|
-
export * from './LocationQuerySchema.
|
6
|
-
export * from './LocationTimeRangeQuery/index.
|
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'
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './CurrentLocationWitness.
|
2
|
-
export * from './LocationWitness.
|
1
|
+
export * from './CurrentLocationWitness.ts'
|
2
|
+
export * from './LocationWitness.ts'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export * from './LocationDivinerApi.
|
2
|
-
export * from './models.
|
3
|
-
export * from './Queries/index.
|
4
|
-
export * from './Witnesses/index.
|
1
|
+
export * from './LocationDivinerApi.ts'
|
2
|
+
export * from './models.ts'
|
3
|
+
export * from './Queries/index.ts'
|
4
|
+
export * from './Witnesses/index.ts'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { DivinerConfig } from '@xyo-network/diviner-model'
|
2
2
|
|
3
|
-
import { ArchivistApi } from '../Api/index.
|
3
|
+
import { ArchivistApi } from '../Api/index.ts'
|
4
4
|
|
5
5
|
export type RemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config'
|
6
6
|
export const RemoteDivinerConfigSchema: RemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config'
|
package/src/Diviner/index.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './LocationDiviner/index.
|
2
|
-
export * from './RemoteDivinerConfig.
|
1
|
+
export * from './LocationDiviner/index.ts'
|
2
|
+
export * from './RemoteDivinerConfig.ts'
|
package/src/Simple.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { ApiConfig, ApiResponseBody, ApiResponseTuple, ApiResponseTupleOrBody, ApiResponseType } from '@xyo-network/api-models'
|
2
2
|
import { Payload, PayloadFindFilter } from '@xyo-network/payload-model'
|
3
3
|
|
4
|
-
import { ApiBase } from './Base.
|
5
|
-
import { objToQuery } from './objToQuery.
|
4
|
+
import { ApiBase } from './Base.ts'
|
5
|
+
import { objToQuery } from './objToQuery.ts'
|
6
6
|
|
7
7
|
export type ApiSimpleQuery = PayloadFindFilter
|
8
8
|
|
package/src/Test/index.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './testBoundWitness.
|
2
|
-
export * from './testPayload.
|
1
|
+
export * from './testBoundWitness.ts'
|
2
|
+
export * from './testPayload.ts'
|
package/src/index.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
export * from './Api/index.
|
2
|
-
export * from './Base.
|
3
|
-
export * from './Diviner/index.
|
4
|
-
export * from './models/index.
|
5
|
-
export * from './Simple.
|
6
|
-
export * from './WithArchive.
|
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'
|
package/src/models/index.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export * from './ArchivePath.
|
1
|
+
export * from './ArchivePath.ts'
|