@xyo-network/api 2.20.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +165 -0
- package/README.md +79 -0
- package/babel.config.json +5 -0
- package/dist/cjs/Archivist/Account/Api.d.ts +18 -0
- package/dist/cjs/Archivist/Account/Api.js +15 -0
- package/dist/cjs/Archivist/Account/Api.js.map +1 -0
- package/dist/cjs/Archivist/Account/index.d.ts +1 -0
- package/dist/cjs/Archivist/Account/index.js +5 -0
- package/dist/cjs/Archivist/Account/index.js.map +1 -0
- package/dist/cjs/Archivist/Api.d.ts +27 -0
- package/dist/cjs/Archivist/Api.js +60 -0
- package/dist/cjs/Archivist/Api.js.map +1 -0
- package/dist/cjs/Archivist/Archive/Api.d.ts +18 -0
- package/dist/cjs/Archivist/Archive/Api.js +40 -0
- package/dist/cjs/Archivist/Archive/Api.js.map +1 -0
- package/dist/cjs/Archivist/Archive/Schema/Api.d.ts +7 -0
- package/dist/cjs/Archivist/Archive/Schema/Api.js +15 -0
- package/dist/cjs/Archivist/Archive/Schema/Api.js.map +1 -0
- package/dist/cjs/Archivist/Archive/Schema/index.d.ts +1 -0
- package/dist/cjs/Archivist/Archive/Schema/index.js +5 -0
- package/dist/cjs/Archivist/Archive/Schema/index.js.map +1 -0
- package/dist/cjs/Archivist/Archive/Schemas/Api.d.ts +6 -0
- package/dist/cjs/Archivist/Archive/Schemas/Api.js +14 -0
- package/dist/cjs/Archivist/Archive/Schemas/Api.js.map +1 -0
- package/dist/cjs/Archivist/Archive/Schemas/index.d.ts +1 -0
- package/dist/cjs/Archivist/Archive/Schemas/index.js +5 -0
- package/dist/cjs/Archivist/Archive/Schemas/index.js.map +1 -0
- package/dist/cjs/Archivist/Archive/Settings/Api.d.ts +6 -0
- package/dist/cjs/Archivist/Archive/Settings/Api.js +15 -0
- package/dist/cjs/Archivist/Archive/Settings/Api.js.map +1 -0
- package/dist/cjs/Archivist/Archive/Settings/Key/Api.d.ts +5 -0
- package/dist/cjs/Archivist/Archive/Settings/Key/Api.js +11 -0
- package/dist/cjs/Archivist/Archive/Settings/Key/Api.js.map +1 -0
- package/dist/cjs/Archivist/Archive/Settings/Key/index.d.ts +1 -0
- package/dist/cjs/Archivist/Archive/Settings/Key/index.js +5 -0
- package/dist/cjs/Archivist/Archive/Settings/Key/index.js.map +1 -0
- package/dist/cjs/Archivist/Archive/Settings/index.d.ts +2 -0
- package/dist/cjs/Archivist/Archive/Settings/index.js +6 -0
- package/dist/cjs/Archivist/Archive/Settings/index.js.map +1 -0
- package/dist/cjs/Archivist/Archive/index.d.ts +4 -0
- package/dist/cjs/Archivist/Archive/index.js +8 -0
- package/dist/cjs/Archivist/Archive/index.js.map +1 -0
- package/dist/cjs/Archivist/Archives/Api.d.ts +8 -0
- package/dist/cjs/Archivist/Archives/Api.js +16 -0
- package/dist/cjs/Archivist/Archives/Api.js.map +1 -0
- package/dist/cjs/Archivist/Archives/index.d.ts +1 -0
- package/dist/cjs/Archivist/Archives/index.js +5 -0
- package/dist/cjs/Archivist/Archives/index.js.map +1 -0
- package/dist/cjs/Archivist/Block/Api.d.ts +8 -0
- package/dist/cjs/Archivist/Block/Api.js +12 -0
- package/dist/cjs/Archivist/Block/Api.js.map +1 -0
- package/dist/cjs/Archivist/Block/index.d.ts +1 -0
- package/dist/cjs/Archivist/Block/index.js +5 -0
- package/dist/cjs/Archivist/Block/index.js.map +1 -0
- package/dist/cjs/Archivist/Payload/Api.d.ts +40 -0
- package/dist/cjs/Archivist/Payload/Api.js +84 -0
- package/dist/cjs/Archivist/Payload/Api.js.map +1 -0
- package/dist/cjs/Archivist/Payload/Schema/Api.d.ts +8 -0
- package/dist/cjs/Archivist/Payload/Schema/Api.js +14 -0
- package/dist/cjs/Archivist/Payload/Schema/Api.js.map +1 -0
- package/dist/cjs/Archivist/Payload/Schema/index.d.ts +1 -0
- package/dist/cjs/Archivist/Payload/Schema/index.js +5 -0
- package/dist/cjs/Archivist/Payload/Schema/index.js.map +1 -0
- package/dist/cjs/Archivist/Payload/index.d.ts +2 -0
- package/dist/cjs/Archivist/Payload/index.js +6 -0
- package/dist/cjs/Archivist/Payload/index.js.map +1 -0
- package/dist/cjs/Archivist/index.d.ts +6 -0
- package/dist/cjs/Archivist/index.js +10 -0
- package/dist/cjs/Archivist/index.js.map +1 -0
- package/dist/cjs/Base.d.ts +33 -0
- package/dist/cjs/Base.js +147 -0
- package/dist/cjs/Base.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApi.d.ts +11 -0
- package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApi.js +28 -0
- package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApi.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.d.ts +9 -0
- package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.js +24 -0
- package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.d.ts +4 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.js +3 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.ts +11 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.js +10 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.ts +2 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.js +6 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.ts +11 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.js +10 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.ts +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.js +5 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts +17 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.js +3 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.ts +4 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.js +3 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.ts +5 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuerySchema.js +13 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuerySchema.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.ts +7 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.js +3 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.ts +11 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.js +10 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.ts +2 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.js +6 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/index.d.ts +6 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/index.js +10 -0
- package/dist/cjs/Diviner/LocationDiviner/Queries/index.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.d.ts +13 -0
- package/dist/cjs/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.js +5 -0
- package/dist/cjs/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Witnesses/LocationWitness.d.ts +21 -0
- package/dist/cjs/Diviner/LocationDiviner/Witnesses/LocationWitness.js +5 -0
- package/dist/cjs/Diviner/LocationDiviner/Witnesses/LocationWitness.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/Witnesses/index.d.ts +2 -0
- package/dist/cjs/Diviner/LocationDiviner/Witnesses/index.js +6 -0
- package/dist/cjs/Diviner/LocationDiviner/Witnesses/index.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/index.d.ts +4 -0
- package/dist/cjs/Diviner/LocationDiviner/index.js +8 -0
- package/dist/cjs/Diviner/LocationDiviner/index.js.map +1 -0
- package/dist/cjs/Diviner/LocationDiviner/models.d.ts +4 -0
- package/dist/cjs/Diviner/LocationDiviner/models.js +3 -0
- package/dist/cjs/Diviner/LocationDiviner/models.js.map +1 -0
- package/dist/cjs/Diviner/index.d.ts +1 -0
- package/dist/cjs/Diviner/index.js +5 -0
- package/dist/cjs/Diviner/index.js.map +1 -0
- package/dist/cjs/Simple.d.ts +21 -0
- package/dist/cjs/Simple.js +60 -0
- package/dist/cjs/Simple.js.map +1 -0
- package/dist/cjs/Test/index.d.ts +2 -0
- package/dist/cjs/Test/index.js +6 -0
- package/dist/cjs/Test/index.js.map +1 -0
- package/dist/cjs/Test/testBoundWitness.d.ts +3 -0
- package/dist/cjs/Test/testBoundWitness.js +17 -0
- package/dist/cjs/Test/testBoundWitness.js.map +1 -0
- package/dist/cjs/Test/testPayload.d.ts +4 -0
- package/dist/cjs/Test/testPayload.js +19 -0
- package/dist/cjs/Test/testPayload.js.map +1 -0
- package/dist/cjs/User/Api.d.ts +31 -0
- package/dist/cjs/User/Api.js +25 -0
- package/dist/cjs/User/Api.js.map +1 -0
- package/dist/cjs/User/index.d.ts +1 -0
- package/dist/cjs/User/index.js +5 -0
- package/dist/cjs/User/index.js.map +1 -0
- package/dist/cjs/WithArchive.d.ts +3 -0
- package/dist/cjs/WithArchive.js +3 -0
- package/dist/cjs/WithArchive.js.map +1 -0
- package/dist/cjs/index.d.ts +7 -0
- package/dist/cjs/index.js +11 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/models/Api/Config.d.ts +24 -0
- package/dist/cjs/models/Api/Config.js +3 -0
- package/dist/cjs/models/Api/Config.js.map +1 -0
- package/dist/cjs/models/Api/Envelope.d.ts +14 -0
- package/dist/cjs/models/Api/Envelope.js +3 -0
- package/dist/cjs/models/Api/Envelope.js.map +1 -0
- package/dist/cjs/models/Api/Error.d.ts +4 -0
- package/dist/cjs/models/Api/Error.js +3 -0
- package/dist/cjs/models/Api/Error.js.map +1 -0
- package/dist/cjs/models/Api/Reportable.d.ts +7 -0
- package/dist/cjs/models/Api/Reportable.js +3 -0
- package/dist/cjs/models/Api/Reportable.js.map +1 -0
- package/dist/cjs/models/Api/Response.d.ts +7 -0
- package/dist/cjs/models/Api/Response.js +3 -0
- package/dist/cjs/models/Api/Response.js.map +1 -0
- package/dist/cjs/models/Api/Warning.d.ts +1 -0
- package/dist/cjs/models/Api/Warning.js +3 -0
- package/dist/cjs/models/Api/Warning.js.map +1 -0
- package/dist/cjs/models/Api/index.d.ts +6 -0
- package/dist/cjs/models/Api/index.js +10 -0
- package/dist/cjs/models/Api/index.js.map +1 -0
- package/dist/cjs/models/Archive.d.ts +24 -0
- package/dist/cjs/models/Archive.js +3 -0
- package/dist/cjs/models/Archive.js.map +1 -0
- package/dist/cjs/models/ArchiveKey.d.ts +5 -0
- package/dist/cjs/models/ArchiveKey.js +3 -0
- package/dist/cjs/models/ArchiveKey.js.map +1 -0
- package/dist/cjs/models/ArchivePath.d.ts +3 -0
- package/dist/cjs/models/ArchivePath.js +3 -0
- package/dist/cjs/models/ArchivePath.js.map +1 -0
- package/dist/cjs/models/index.d.ts +4 -0
- package/dist/cjs/models/index.js +8 -0
- package/dist/cjs/models/index.js.map +1 -0
- package/dist/cjs/objToQuery.d.ts +1 -0
- package/dist/cjs/objToQuery.js +13 -0
- package/dist/cjs/objToQuery.js.map +1 -0
- package/dist/docs.json +44344 -0
- package/dist/esm/Archivist/Account/Api.d.ts +18 -0
- package/dist/esm/Archivist/Account/Api.js +17 -0
- package/dist/esm/Archivist/Account/Api.js.map +1 -0
- package/dist/esm/Archivist/Account/index.d.ts +1 -0
- package/dist/esm/Archivist/Account/index.js +2 -0
- package/dist/esm/Archivist/Account/index.js.map +1 -0
- package/dist/esm/Archivist/Api.d.ts +27 -0
- package/dist/esm/Archivist/Api.js +71 -0
- package/dist/esm/Archivist/Api.js.map +1 -0
- package/dist/esm/Archivist/Archive/Api.d.ts +18 -0
- package/dist/esm/Archivist/Archive/Api.js +51 -0
- package/dist/esm/Archivist/Archive/Api.js.map +1 -0
- package/dist/esm/Archivist/Archive/Schema/Api.d.ts +7 -0
- package/dist/esm/Archivist/Archive/Schema/Api.js +14 -0
- package/dist/esm/Archivist/Archive/Schema/Api.js.map +1 -0
- package/dist/esm/Archivist/Archive/Schema/index.d.ts +1 -0
- package/dist/esm/Archivist/Archive/Schema/index.js +2 -0
- package/dist/esm/Archivist/Archive/Schema/index.js.map +1 -0
- package/dist/esm/Archivist/Archive/Schemas/Api.d.ts +6 -0
- package/dist/esm/Archivist/Archive/Schemas/Api.js +13 -0
- package/dist/esm/Archivist/Archive/Schemas/Api.js.map +1 -0
- package/dist/esm/Archivist/Archive/Schemas/index.d.ts +1 -0
- package/dist/esm/Archivist/Archive/Schemas/index.js +2 -0
- package/dist/esm/Archivist/Archive/Schemas/index.js.map +1 -0
- package/dist/esm/Archivist/Archive/Settings/Api.d.ts +6 -0
- package/dist/esm/Archivist/Archive/Settings/Api.js +14 -0
- package/dist/esm/Archivist/Archive/Settings/Api.js.map +1 -0
- package/dist/esm/Archivist/Archive/Settings/Key/Api.d.ts +5 -0
- package/dist/esm/Archivist/Archive/Settings/Key/Api.js +10 -0
- package/dist/esm/Archivist/Archive/Settings/Key/Api.js.map +1 -0
- package/dist/esm/Archivist/Archive/Settings/Key/index.d.ts +1 -0
- package/dist/esm/Archivist/Archive/Settings/Key/index.js +2 -0
- package/dist/esm/Archivist/Archive/Settings/Key/index.js.map +1 -0
- package/dist/esm/Archivist/Archive/Settings/index.d.ts +2 -0
- package/dist/esm/Archivist/Archive/Settings/index.js +3 -0
- package/dist/esm/Archivist/Archive/Settings/index.js.map +1 -0
- package/dist/esm/Archivist/Archive/index.d.ts +4 -0
- package/dist/esm/Archivist/Archive/index.js +5 -0
- package/dist/esm/Archivist/Archive/index.js.map +1 -0
- package/dist/esm/Archivist/Archives/Api.d.ts +8 -0
- package/dist/esm/Archivist/Archives/Api.js +15 -0
- package/dist/esm/Archivist/Archives/Api.js.map +1 -0
- package/dist/esm/Archivist/Archives/index.d.ts +1 -0
- package/dist/esm/Archivist/Archives/index.js +2 -0
- package/dist/esm/Archivist/Archives/index.js.map +1 -0
- package/dist/esm/Archivist/Block/Api.d.ts +8 -0
- package/dist/esm/Archivist/Block/Api.js +11 -0
- package/dist/esm/Archivist/Block/Api.js.map +1 -0
- package/dist/esm/Archivist/Block/index.d.ts +1 -0
- package/dist/esm/Archivist/Block/index.js +2 -0
- package/dist/esm/Archivist/Block/index.js.map +1 -0
- package/dist/esm/Archivist/Payload/Api.d.ts +40 -0
- package/dist/esm/Archivist/Payload/Api.js +68 -0
- package/dist/esm/Archivist/Payload/Api.js.map +1 -0
- package/dist/esm/Archivist/Payload/Schema/Api.d.ts +8 -0
- package/dist/esm/Archivist/Payload/Schema/Api.js +13 -0
- package/dist/esm/Archivist/Payload/Schema/Api.js.map +1 -0
- package/dist/esm/Archivist/Payload/Schema/index.d.ts +1 -0
- package/dist/esm/Archivist/Payload/Schema/index.js +2 -0
- package/dist/esm/Archivist/Payload/Schema/index.js.map +1 -0
- package/dist/esm/Archivist/Payload/index.d.ts +2 -0
- package/dist/esm/Archivist/Payload/index.js +3 -0
- package/dist/esm/Archivist/Payload/index.js.map +1 -0
- package/dist/esm/Archivist/index.d.ts +6 -0
- package/dist/esm/Archivist/index.js +7 -0
- package/dist/esm/Archivist/index.js.map +1 -0
- package/dist/esm/Base.d.ts +33 -0
- package/dist/esm/Base.js +129 -0
- package/dist/esm/Base.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/LocationDivinerApi.d.ts +11 -0
- package/dist/esm/Diviner/LocationDiviner/LocationDivinerApi.js +20 -0
- package/dist/esm/Diviner/LocationDiviner/LocationDivinerApi.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.d.ts +9 -0
- package/dist/esm/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.js +18 -0
- package/dist/esm/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.d.ts +4 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.js +2 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.ts +11 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.js +6 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.ts +2 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.js +3 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.ts +11 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.js +6 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.ts +1 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.js +2 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts +17 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.js +2 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.ts +4 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.js +2 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.ts +5 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuerySchema.js +9 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuerySchema.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.ts +7 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.js +2 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.ts +11 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.js +6 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.ts +2 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.js +3 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/index.d.ts +6 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/index.js +7 -0
- package/dist/esm/Diviner/LocationDiviner/Queries/index.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.d.ts +13 -0
- package/dist/esm/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.js +2 -0
- package/dist/esm/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Witnesses/LocationWitness.d.ts +21 -0
- package/dist/esm/Diviner/LocationDiviner/Witnesses/LocationWitness.js +2 -0
- package/dist/esm/Diviner/LocationDiviner/Witnesses/LocationWitness.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/Witnesses/index.d.ts +2 -0
- package/dist/esm/Diviner/LocationDiviner/Witnesses/index.js +3 -0
- package/dist/esm/Diviner/LocationDiviner/Witnesses/index.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/index.d.ts +4 -0
- package/dist/esm/Diviner/LocationDiviner/index.js +5 -0
- package/dist/esm/Diviner/LocationDiviner/index.js.map +1 -0
- package/dist/esm/Diviner/LocationDiviner/models.d.ts +4 -0
- package/dist/esm/Diviner/LocationDiviner/models.js +2 -0
- package/dist/esm/Diviner/LocationDiviner/models.js.map +1 -0
- package/dist/esm/Diviner/index.d.ts +1 -0
- package/dist/esm/Diviner/index.js +2 -0
- package/dist/esm/Diviner/index.js.map +1 -0
- package/dist/esm/Simple.d.ts +21 -0
- package/dist/esm/Simple.js +45 -0
- package/dist/esm/Simple.js.map +1 -0
- package/dist/esm/Test/index.d.ts +2 -0
- package/dist/esm/Test/index.js +3 -0
- package/dist/esm/Test/index.js.map +1 -0
- package/dist/esm/Test/testBoundWitness.d.ts +3 -0
- package/dist/esm/Test/testBoundWitness.js +14 -0
- package/dist/esm/Test/testBoundWitness.js.map +1 -0
- package/dist/esm/Test/testPayload.d.ts +4 -0
- package/dist/esm/Test/testPayload.js +15 -0
- package/dist/esm/Test/testPayload.js.map +1 -0
- package/dist/esm/User/Api.d.ts +31 -0
- package/dist/esm/User/Api.js +27 -0
- package/dist/esm/User/Api.js.map +1 -0
- package/dist/esm/User/index.d.ts +1 -0
- package/dist/esm/User/index.js +2 -0
- package/dist/esm/User/index.js.map +1 -0
- package/dist/esm/WithArchive.d.ts +3 -0
- package/dist/esm/WithArchive.js +2 -0
- package/dist/esm/WithArchive.js.map +1 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/models/Api/Config.d.ts +24 -0
- package/dist/esm/models/Api/Config.js +2 -0
- package/dist/esm/models/Api/Config.js.map +1 -0
- package/dist/esm/models/Api/Envelope.d.ts +14 -0
- package/dist/esm/models/Api/Envelope.js +2 -0
- package/dist/esm/models/Api/Envelope.js.map +1 -0
- package/dist/esm/models/Api/Error.d.ts +4 -0
- package/dist/esm/models/Api/Error.js +2 -0
- package/dist/esm/models/Api/Error.js.map +1 -0
- package/dist/esm/models/Api/Reportable.d.ts +7 -0
- package/dist/esm/models/Api/Reportable.js +2 -0
- package/dist/esm/models/Api/Reportable.js.map +1 -0
- package/dist/esm/models/Api/Response.d.ts +7 -0
- package/dist/esm/models/Api/Response.js +2 -0
- package/dist/esm/models/Api/Response.js.map +1 -0
- package/dist/esm/models/Api/Warning.d.ts +1 -0
- package/dist/esm/models/Api/Warning.js +2 -0
- package/dist/esm/models/Api/Warning.js.map +1 -0
- package/dist/esm/models/Api/index.d.ts +6 -0
- package/dist/esm/models/Api/index.js +7 -0
- package/dist/esm/models/Api/index.js.map +1 -0
- package/dist/esm/models/Archive.d.ts +24 -0
- package/dist/esm/models/Archive.js +2 -0
- package/dist/esm/models/Archive.js.map +1 -0
- package/dist/esm/models/ArchiveKey.d.ts +5 -0
- package/dist/esm/models/ArchiveKey.js +2 -0
- package/dist/esm/models/ArchiveKey.js.map +1 -0
- package/dist/esm/models/ArchivePath.d.ts +3 -0
- package/dist/esm/models/ArchivePath.js +2 -0
- package/dist/esm/models/ArchivePath.js.map +1 -0
- package/dist/esm/models/index.d.ts +4 -0
- package/dist/esm/models/index.js +5 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/objToQuery.d.ts +1 -0
- package/dist/esm/objToQuery.js +9 -0
- package/dist/esm/objToQuery.js.map +1 -0
- package/jest.config.cjs +25 -0
- package/package.json +118 -0
- package/rollup.config.js +5 -0
- package/src/Archivist/Account/Api.spec.ts +71 -0
- package/src/Archivist/Account/Api.ts +32 -0
- package/src/Archivist/Account/index.ts +1 -0
- package/src/Archivist/Api.spec.ts +219 -0
- package/src/Archivist/Api.ts +89 -0
- package/src/Archivist/ApiUtil.spec.ts +37 -0
- package/src/Archivist/Archive/Api.ts +60 -0
- package/src/Archivist/Archive/Schema/Api.spec.ts +23 -0
- package/src/Archivist/Archive/Schema/Api.ts +17 -0
- package/src/Archivist/Archive/Schema/index.ts +1 -0
- package/src/Archivist/Archive/Schemas/Api.spec.ts +23 -0
- package/src/Archivist/Archive/Schemas/Api.ts +16 -0
- package/src/Archivist/Archive/Schemas/index.ts +1 -0
- package/src/Archivist/Archive/Settings/Api.ts +15 -0
- package/src/Archivist/Archive/Settings/Key/Api.ts +11 -0
- package/src/Archivist/Archive/Settings/Key/index.ts +1 -0
- package/src/Archivist/Archive/Settings/index.ts +2 -0
- package/src/Archivist/Archive/index.ts +4 -0
- package/src/Archivist/Archives/Api.ts +17 -0
- package/src/Archivist/Archives/index.ts +1 -0
- package/src/Archivist/Block/Api.ts +18 -0
- package/src/Archivist/Block/index.ts +1 -0
- package/src/Archivist/Payload/Api.spec.ts +61 -0
- package/src/Archivist/Payload/Api.ts +102 -0
- package/src/Archivist/Payload/Schema/Api.spec.ts +59 -0
- package/src/Archivist/Payload/Schema/Api.ts +18 -0
- package/src/Archivist/Payload/Schema/index.ts +1 -0
- package/src/Archivist/Payload/index.ts +2 -0
- package/src/Archivist/index.ts +6 -0
- package/src/Base.ts +175 -0
- package/src/Diviner/LocationDiviner/LocationDivinerApi.spec.ts +101 -0
- package/src/Diviner/LocationDiviner/LocationDivinerApi.ts +29 -0
- package/src/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.ts +19 -0
- package/src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.ts +4 -0
- package/src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.ts +17 -0
- package/src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.ts +2 -0
- package/src/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.ts +15 -0
- package/src/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.ts +1 -0
- package/src/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.ts +21 -0
- package/src/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.ts +5 -0
- package/src/Diviner/LocationDiviner/Queries/LocationQuerySchema.ts +15 -0
- package/src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.ts +8 -0
- package/src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.ts +18 -0
- package/src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.ts +2 -0
- package/src/Diviner/LocationDiviner/Queries/index.ts +6 -0
- package/src/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.ts +16 -0
- package/src/Diviner/LocationDiviner/Witnesses/LocationWitness.ts +25 -0
- package/src/Diviner/LocationDiviner/Witnesses/index.ts +2 -0
- package/src/Diviner/LocationDiviner/index.ts +4 -0
- package/src/Diviner/LocationDiviner/models.ts +4 -0
- package/src/Diviner/index.ts +1 -0
- package/src/Simple.ts +69 -0
- package/src/Test/index.ts +2 -0
- package/src/Test/testBoundWitness.ts +16 -0
- package/src/Test/testPayload.ts +17 -0
- package/src/User/Api.spec.ts +41 -0
- package/src/User/Api.ts +39 -0
- package/src/User/index.ts +1 -0
- package/src/WithArchive.ts +3 -0
- package/src/index.ts +7 -0
- package/src/models/Api/Config.ts +35 -0
- package/src/models/Api/Envelope.ts +18 -0
- package/src/models/Api/Error.ts +6 -0
- package/src/models/Api/Reportable.ts +10 -0
- package/src/models/Api/Response.ts +13 -0
- package/src/models/Api/Warning.ts +1 -0
- package/src/models/Api/index.ts +6 -0
- package/src/models/Archive.ts +28 -0
- package/src/models/ArchiveKey.ts +5 -0
- package/src/models/ArchivePath.ts +3 -0
- package/src/models/index.ts +4 -0
- package/src/objToQuery.ts +8 -0
- package/typedoc.json +10 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ApiConfig } from '@xylabs/sdk-js'
|
|
2
|
+
import axios, { AxiosRequestConfig } from 'axios'
|
|
3
|
+
|
|
4
|
+
import { getLocationDivinerApiResponseTransformer } from './LocationDivinerApiResponseTransformer'
|
|
5
|
+
import { GetLocationQueryResponse } from './models'
|
|
6
|
+
import { LocationQueryCreationResponse, SupportedLocationQueryCreationRequest } from './Queries'
|
|
7
|
+
|
|
8
|
+
class XyoLocationDivinerApi {
|
|
9
|
+
public config: ApiConfig
|
|
10
|
+
constructor(config: ApiConfig) {
|
|
11
|
+
this.config = config
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
private get axiosRequestConfig(): AxiosRequestConfig {
|
|
15
|
+
return {
|
|
16
|
+
transformResponse: getLocationDivinerApiResponseTransformer(),
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public async getLocationQuery(hash: string) {
|
|
21
|
+
return (await axios.get<GetLocationQueryResponse>(`${this.config.apiDomain}/location/query/${hash}`, this.axiosRequestConfig)).data
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public async postLocationQuery(request: SupportedLocationQueryCreationRequest) {
|
|
25
|
+
return (await axios.post<LocationQueryCreationResponse>(`${this.config.apiDomain}/location/query`, { ...request }, this.axiosRequestConfig)).data
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { XyoLocationDivinerApi }
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import axios, { AxiosResponseTransformer } from 'axios'
|
|
2
|
+
|
|
3
|
+
export const locationDivinerApiResponseTransformer: AxiosResponseTransformer = (data, _headers) => {
|
|
4
|
+
return data.data
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Gets the response transformers for the LocationDiviner API. Done as a method instead of a property
|
|
9
|
+
* to allow detection of dynamically added response transformers.
|
|
10
|
+
* @param axiosInstance The axios instance (defaults to the global instance if none provided)
|
|
11
|
+
* @returns the response transformers for the LocationDiviner API
|
|
12
|
+
*/
|
|
13
|
+
export const getLocationDivinerApiResponseTransformer = (axiosInstance = axios): AxiosResponseTransformer[] => {
|
|
14
|
+
// If there's any existing response transforms preserve them and
|
|
15
|
+
// append our response transform, otherwise just return ours
|
|
16
|
+
return axiosInstance.defaults.transformResponse
|
|
17
|
+
? ([] as AxiosResponseTransformer[]).concat(axiosInstance.defaults.transformResponse, locationDivinerApiResponseTransformer)
|
|
18
|
+
: [locationDivinerApiResponseTransformer]
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LocationWitnessPayloadSchema } from '../../Witnesses'
|
|
2
|
+
|
|
3
|
+
export type LocationHeatmapQuerySchema = 'network.xyo.location.heatmap.query'
|
|
4
|
+
export const locationHeatmapQuerySchema: LocationHeatmapQuerySchema = 'network.xyo.location.heatmap.query'
|
|
5
|
+
|
|
6
|
+
export type LocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer'
|
|
7
|
+
export const locationHeatmapAnswerSchema: LocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer'
|
|
8
|
+
|
|
9
|
+
export type LocationHeatmapQuery = {
|
|
10
|
+
startTime?: string
|
|
11
|
+
stopTime?: string
|
|
12
|
+
schema: LocationWitnessPayloadSchema
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const isLocationHeatmapQuery = (query: Record<string, unknown>): query is LocationHeatmapQuery => {
|
|
16
|
+
return query && query?.schema === locationHeatmapQuerySchema
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LocationWitnessPayloadSchema } from '../../Witnesses'
|
|
2
|
+
|
|
3
|
+
export type LocationQuadkeyHeatmapQuerySchema = 'network.xyo.location.heatmap.quadkey.query'
|
|
4
|
+
export const locationQuadkeyHeatmapQuerySchema: LocationQuadkeyHeatmapQuerySchema = 'network.xyo.location.heatmap.quadkey.query'
|
|
5
|
+
export type LocationQuadkeyHeatmapAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer'
|
|
6
|
+
export const locationQuadkeyHeatmapAnswerSchema: LocationQuadkeyHeatmapAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer'
|
|
7
|
+
export type LocationQuadkeyHeatmapQuery = {
|
|
8
|
+
startTime?: string
|
|
9
|
+
stopTime?: string
|
|
10
|
+
schema: LocationWitnessPayloadSchema
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const isLocationQuadkeyHeatmapQuery = (query: Record<string, unknown>): query is LocationQuadkeyHeatmapQuery => {
|
|
14
|
+
return query && query?.schema === locationQuadkeyHeatmapQuerySchema
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LocationQuadkeyHeatmapQuery'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { XyoApiConfig } from '../../../models'
|
|
2
|
+
import { LocationHeatmapQuery, LocationHeatmapQuerySchema } from './LocationHeatmapQuery'
|
|
3
|
+
import { LocationQuadkeyHeatmapQuery, LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery'
|
|
4
|
+
import { LocationQuerySchema } from './LocationQuerySchema'
|
|
5
|
+
import { LocationTimeRangeQuery, LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery'
|
|
6
|
+
|
|
7
|
+
export interface LocationQueryCreationRequest<TSchema extends LocationQuerySchema = LocationQuerySchema, TQuery extends Record<string, unknown> = Record<string, unknown>> {
|
|
8
|
+
sourceArchivist: XyoApiConfig
|
|
9
|
+
sourceArchive: string
|
|
10
|
+
resultArchivist: XyoApiConfig
|
|
11
|
+
resultArchive: string
|
|
12
|
+
schema: TSchema
|
|
13
|
+
query: TQuery
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type LocationTimeRangeQueryCreationRequest = LocationQueryCreationRequest<LocationTimeRangeQuerySchema, LocationTimeRangeQuery>
|
|
17
|
+
export type LocationHeatmapQueryCreationRequest = LocationQueryCreationRequest<LocationHeatmapQuerySchema, LocationHeatmapQuery>
|
|
18
|
+
|
|
19
|
+
export type LocationQuadkeyHeatmapQueryCreationRequest = LocationQueryCreationRequest<LocationQuadkeyHeatmapQuerySchema, LocationQuadkeyHeatmapQuery>
|
|
20
|
+
|
|
21
|
+
export type SupportedLocationQueryCreationRequest = LocationTimeRangeQueryCreationRequest | LocationHeatmapQueryCreationRequest | LocationQuadkeyHeatmapQueryCreationRequest
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LocationHeatmapQuerySchema } from './LocationHeatmapQuery'
|
|
2
|
+
import { LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery'
|
|
3
|
+
import { LocationTimeRangeQuerySchema } from './LocationTimeRangeQuery'
|
|
4
|
+
|
|
5
|
+
export type LocationQuerySchema = LocationQuadkeyHeatmapQuerySchema | LocationHeatmapQuerySchema | LocationTimeRangeQuerySchema
|
|
6
|
+
|
|
7
|
+
const locationQuerySchemas: Record<LocationQuerySchema, true> = {
|
|
8
|
+
'network.xyo.location.heatmap.quadkey.query': true,
|
|
9
|
+
'network.xyo.location.heatmap.query': true,
|
|
10
|
+
'network.xyo.location.range.query': true,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const isSupportedLocationQuerySchema = (schema: string): schema is LocationQuerySchema => {
|
|
14
|
+
return locationQuerySchemas[schema as LocationQuerySchema] || false
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LocationWitnessPayloadSchema } from '../../Witnesses'
|
|
2
|
+
|
|
3
|
+
export type LocationTimeRangeQuerySchema = 'network.xyo.location.range.query'
|
|
4
|
+
export const locationTimeRangeQuerySchema = 'network.xyo.location.range.query'
|
|
5
|
+
|
|
6
|
+
export type LocationTimeRangeAnswerSchema = 'network.xyo.location.range.answer'
|
|
7
|
+
export const locationTimeRangeAnswerSchema = 'network.xyo.location.range.answer'
|
|
8
|
+
|
|
9
|
+
export type LocationTimeRangeQuery = {
|
|
10
|
+
startTime?: string
|
|
11
|
+
stopTime?: string
|
|
12
|
+
schema: LocationWitnessPayloadSchema
|
|
13
|
+
// TODO: Bounding rectangle, etc.
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const isLocationTimeRangeQuery = (query: Record<string, unknown>): query is LocationTimeRangeQuery => {
|
|
17
|
+
return query && query?.schema === locationTimeRangeQuerySchema
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { WithXyoPayloadMeta, XyoPayloadBody } from '@xyo-network/core'
|
|
2
|
+
|
|
3
|
+
export const currentLocationWitnessPayloadSchema = 'co.coinapp.currentlocationwitness'
|
|
4
|
+
export type CurrentLocationWitnessPayloadSchema = 'co.coinapp.currentlocationwitness'
|
|
5
|
+
|
|
6
|
+
export interface CurrentLocationWitnessPayloadBody extends XyoPayloadBody {
|
|
7
|
+
altitudeMeters: number
|
|
8
|
+
directionDegrees: number
|
|
9
|
+
latitude: number
|
|
10
|
+
longitude: number
|
|
11
|
+
quadkey: string
|
|
12
|
+
schema: CurrentLocationWitnessPayloadSchema
|
|
13
|
+
speedKph: number
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare type CurrentLocationWitnessPayload = WithXyoPayloadMeta<CurrentLocationWitnessPayloadBody>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { WithXyoPayloadMeta, XyoPayloadBody } from '@xyo-network/core'
|
|
2
|
+
|
|
3
|
+
export const locationWitnessPayloadSchema: LocationWitnessPayloadSchema = 'network.xyo.location'
|
|
4
|
+
export type LocationWitnessPayloadSchema = 'network.xyo.location'
|
|
5
|
+
|
|
6
|
+
export interface Coordinates {
|
|
7
|
+
accuracy: number | null
|
|
8
|
+
altitude: number | null
|
|
9
|
+
altitudeAccuracy: number | null
|
|
10
|
+
heading: number | null
|
|
11
|
+
latitude: number
|
|
12
|
+
longitude: number
|
|
13
|
+
speed: number | null
|
|
14
|
+
}
|
|
15
|
+
export interface CurrentLocation {
|
|
16
|
+
coords: Coordinates
|
|
17
|
+
timestamp: number
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface LocationWitnessPayloadBody extends XyoPayloadBody {
|
|
21
|
+
currentLocation: CurrentLocation
|
|
22
|
+
schema: LocationWitnessPayloadSchema
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type LocationWitnessPayload = WithXyoPayloadMeta<LocationWitnessPayloadBody>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LocationDiviner'
|
package/src/Simple.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { XyoPayload } from '@xyo-network/core'
|
|
2
|
+
|
|
3
|
+
import { XyoApiBase } from './Base'
|
|
4
|
+
import { XyoApiConfig, XyoApiResponseBody, XyoApiResponseTuple, XyoApiResponseTupleOrBody, XyoApiResponseType } from './models'
|
|
5
|
+
import { objToQuery } from './objToQuery'
|
|
6
|
+
|
|
7
|
+
export type XyoApiSimpleQuery = Record<string, unknown>
|
|
8
|
+
|
|
9
|
+
export class XyoApiSimple<T = XyoPayload, D = T, Q extends XyoApiSimpleQuery = Record<string, never>, C extends XyoApiConfig = XyoApiConfig> extends XyoApiBase<C> {
|
|
10
|
+
public async get(): Promise<XyoApiResponseBody<T>>
|
|
11
|
+
public async get(responseType?: 'body'): Promise<XyoApiResponseBody<T>>
|
|
12
|
+
public async get(responseType?: 'tuple'): Promise<XyoApiResponseTuple<T>>
|
|
13
|
+
public async get(responseType?: XyoApiResponseType): Promise<XyoApiResponseTupleOrBody<T>> {
|
|
14
|
+
switch (responseType) {
|
|
15
|
+
case 'tuple':
|
|
16
|
+
return await this.getEndpoint(undefined, 'tuple')
|
|
17
|
+
default:
|
|
18
|
+
return await this.getEndpoint(undefined)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public async find(query?: Q): Promise<XyoApiResponseBody<T>>
|
|
23
|
+
public async find(query?: Q, responseType?: 'body'): Promise<XyoApiResponseBody<T>>
|
|
24
|
+
public async find(query?: Q, responseType?: 'tuple'): Promise<XyoApiResponseTuple<T>>
|
|
25
|
+
public async find(query = {}, responseType?: XyoApiResponseType): Promise<XyoApiResponseTupleOrBody<T>> {
|
|
26
|
+
switch (responseType) {
|
|
27
|
+
case 'tuple':
|
|
28
|
+
return await this.getEndpoint(objToQuery(query), 'tuple')
|
|
29
|
+
default:
|
|
30
|
+
return await this.getEndpoint(objToQuery(query))
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public async post(data?: D): Promise<XyoApiResponseBody<T>>
|
|
35
|
+
public async post(data?: D, responseType?: 'body'): Promise<XyoApiResponseBody<T>>
|
|
36
|
+
public async post(data?: D, responseType?: 'tuple'): Promise<XyoApiResponseTuple<T>>
|
|
37
|
+
public async post(data?: D, responseType?: XyoApiResponseType): Promise<XyoApiResponseTupleOrBody<T>> {
|
|
38
|
+
switch (responseType) {
|
|
39
|
+
case 'tuple':
|
|
40
|
+
return await this.postEndpoint(undefined, data, 'tuple')
|
|
41
|
+
default:
|
|
42
|
+
return await this.postEndpoint(undefined, data)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public async put(data?: D): Promise<XyoApiResponseBody<T>>
|
|
47
|
+
public async put(data?: D, responseType?: 'body'): Promise<XyoApiResponseBody<T>>
|
|
48
|
+
public async put(data?: D, responseType?: 'tuple'): Promise<XyoApiResponseTuple<T>>
|
|
49
|
+
public async put(data?: D, responseType?: XyoApiResponseType): Promise<XyoApiResponseTupleOrBody<T>> {
|
|
50
|
+
switch (responseType) {
|
|
51
|
+
case 'tuple':
|
|
52
|
+
return await this.putEndpoint(undefined, data, 'tuple')
|
|
53
|
+
default:
|
|
54
|
+
return await this.putEndpoint(undefined, data)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public async delete(): Promise<XyoApiResponseBody<T>>
|
|
59
|
+
public async delete(responseType?: 'body'): Promise<XyoApiResponseBody<T>>
|
|
60
|
+
public async delete(responseType?: 'tuple'): Promise<XyoApiResponseTuple<T>>
|
|
61
|
+
public async delete(responseType?: XyoApiResponseType): Promise<XyoApiResponseTupleOrBody<T>> {
|
|
62
|
+
switch (responseType) {
|
|
63
|
+
case 'tuple':
|
|
64
|
+
return await this.deleteEndpoint(undefined, 'tuple')
|
|
65
|
+
default:
|
|
66
|
+
return await this.deleteEndpoint(undefined)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { XyoBoundWitness } from '@xyo-network/core'
|
|
2
|
+
|
|
3
|
+
const testBoundWitness: XyoBoundWitness = {
|
|
4
|
+
_archive: 'temp',
|
|
5
|
+
_client: 'js',
|
|
6
|
+
_hash: 'b0ffb9ebf872dc316b7be48327256c5316f7cb84d7c706861b18b86af1942dea',
|
|
7
|
+
_signatures: ['95100e5fd2012b958e96895870cfac5353c3a33a19314cfd1304ef7d01d052ec2a3ef80d6449cf88d463027fe0d868ed8cfb8b7323d37e93a08570233eea0b17'],
|
|
8
|
+
_timestamp: 1650067385598,
|
|
9
|
+
addresses: ['5346a2ce56ec4177b67092bda710e150ba6fa046'],
|
|
10
|
+
payload_hashes: ['20e14207f952a09f767ff614a648546c037fe524ace0bfe55db31f818aff1f1c'],
|
|
11
|
+
payload_schemas: ['network.xyo.test'],
|
|
12
|
+
previous_hashes: [null],
|
|
13
|
+
schema: 'network.xyo.boundwitness',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { testBoundWitness }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { XyoPayload } from '@xyo-network/core'
|
|
2
|
+
|
|
3
|
+
const testSchema = 'network.xyo.test'
|
|
4
|
+
const testPayload: XyoPayload = {
|
|
5
|
+
_archive: 'test',
|
|
6
|
+
_hash: '20e14207f952a09f767ff614a648546c037fe524ace0bfe55db31f818aff1f1c',
|
|
7
|
+
_timestamp: 1609459255555,
|
|
8
|
+
numberField: 1,
|
|
9
|
+
objectField: {
|
|
10
|
+
numberField: 1,
|
|
11
|
+
stringField: 'stringValue',
|
|
12
|
+
},
|
|
13
|
+
schema: testSchema,
|
|
14
|
+
stringField: 'stringValue',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { testPayload, testSchema }
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { typeOf } from '@xyo-network/core'
|
|
2
|
+
|
|
3
|
+
import { XyoArchivistApi } from '../Archivist'
|
|
4
|
+
import { XyoApiConfig, XyoApiError } from '../models'
|
|
5
|
+
import { XyoUserApi } from './Api'
|
|
6
|
+
|
|
7
|
+
const timeout = 20000
|
|
8
|
+
const config: XyoApiConfig = {
|
|
9
|
+
apiDomain: process.env.API_DOMAIN || 'http://localhost:8080',
|
|
10
|
+
jwtToken: process.env.JWT_TOKEN || undefined,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const describeSkipIfNoToken = config.jwtToken ? describe : describe.skip
|
|
14
|
+
|
|
15
|
+
describe('XyoAuthApi', () => {
|
|
16
|
+
describe('get', () => {
|
|
17
|
+
it('returns a new XyoAuthApi', () => {
|
|
18
|
+
const api = new XyoUserApi(config)
|
|
19
|
+
expect(api).toBeDefined()
|
|
20
|
+
})
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
describeSkipIfNoToken('walletChallenge', function () {
|
|
24
|
+
it(
|
|
25
|
+
'returns a nonce',
|
|
26
|
+
async () => {
|
|
27
|
+
const api = new XyoArchivistApi(config)
|
|
28
|
+
try {
|
|
29
|
+
const response = await api.account('0xfEf40940e776A3686Cb29eC712d60859EA9f99F7').challenge.post()
|
|
30
|
+
expect(response?.state).toBeDefined()
|
|
31
|
+
expect(typeOf(response?.state)).toBe('string')
|
|
32
|
+
} catch (ex) {
|
|
33
|
+
const error = ex as XyoApiError
|
|
34
|
+
console.log(JSON.stringify(error.response?.data, null, 2))
|
|
35
|
+
throw ex
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
timeout
|
|
39
|
+
)
|
|
40
|
+
})
|
|
41
|
+
})
|
package/src/User/Api.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { XyoApiBase } from '../Base'
|
|
2
|
+
import { XyoApiSimple } from '../Simple'
|
|
3
|
+
|
|
4
|
+
export interface XyoUserLogin {
|
|
5
|
+
/** @field Email address of the user [in] */
|
|
6
|
+
email?: string
|
|
7
|
+
/** @field Password of the user [in] */
|
|
8
|
+
password?: string
|
|
9
|
+
/** @field Token to access the API as that user [out] */
|
|
10
|
+
token?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class XyoUserApi extends XyoApiBase {
|
|
14
|
+
public get authenticated() {
|
|
15
|
+
return !!this.config.jwtToken
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public get headers(): Record<string, string> {
|
|
19
|
+
const headers: Record<string, string> = {}
|
|
20
|
+
if (this.config.jwtToken) {
|
|
21
|
+
headers.Authorization = `Bearer ${this.config.jwtToken}`
|
|
22
|
+
}
|
|
23
|
+
return headers
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public get login() {
|
|
27
|
+
return new XyoApiSimple<XyoUserLogin>({
|
|
28
|
+
...this.config,
|
|
29
|
+
root: `${this.root}login/`,
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public get profile() {
|
|
34
|
+
return new XyoApiSimple({
|
|
35
|
+
...this.config,
|
|
36
|
+
root: `${this.root}profile/`,
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Api'
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { XyoApiReportable } from './Reportable'
|
|
2
|
+
|
|
3
|
+
interface XyoApiConfig extends XyoApiReportable {
|
|
4
|
+
/** @description The domain where the api is located */
|
|
5
|
+
apiDomain: string
|
|
6
|
+
|
|
7
|
+
/** @deprecated use the jwtToken instead*/
|
|
8
|
+
userid?: string
|
|
9
|
+
|
|
10
|
+
/** @description The jwtToken of the currently logged in user */
|
|
11
|
+
jwtToken?: string
|
|
12
|
+
|
|
13
|
+
/** @description The apiKey used for authentication */
|
|
14
|
+
apiKey?: string
|
|
15
|
+
|
|
16
|
+
/** @description The location in the API tree where this API object is mounted */
|
|
17
|
+
root?: string
|
|
18
|
+
|
|
19
|
+
/** @description The query string, if any, that is added to the end of every request */
|
|
20
|
+
query?: string
|
|
21
|
+
|
|
22
|
+
/** @description Threshold for Content-Size to cause automatic gzip of request body [default = 1024] */
|
|
23
|
+
compressionThreshold?: number
|
|
24
|
+
|
|
25
|
+
/** @description Throw on failures */
|
|
26
|
+
throwFailure?: boolean
|
|
27
|
+
|
|
28
|
+
/** @description Throw on error */
|
|
29
|
+
throwError?: boolean
|
|
30
|
+
|
|
31
|
+
/** @description Parent that should also report events from this api */
|
|
32
|
+
reportableParent?: XyoApiReportable
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type { XyoApiConfig }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { XyoApiError } from './Error'
|
|
2
|
+
import { XyoApiWarning } from './Warning'
|
|
3
|
+
|
|
4
|
+
export interface XyoApiEnvelopeBase {
|
|
5
|
+
warning?: XyoApiWarning[]
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface XyoApiEnvelopeSuccess<T> extends XyoApiEnvelopeBase {
|
|
9
|
+
data: T
|
|
10
|
+
error: never
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface XyoApiEnvelopeError extends XyoApiEnvelopeBase {
|
|
14
|
+
data: never
|
|
15
|
+
error: XyoApiError[]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type XyoApiEnvelope<T> = XyoApiEnvelopeSuccess<T> | XyoApiEnvelopeError
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { XyoApiError } from './Error'
|
|
2
|
+
import { XyoApiResponse } from './Response'
|
|
3
|
+
|
|
4
|
+
export interface XyoApiReportable {
|
|
5
|
+
onError?: (error: XyoApiError, depth: number) => void
|
|
6
|
+
|
|
7
|
+
onFailure?: (response: XyoApiResponse, depth: number) => void
|
|
8
|
+
|
|
9
|
+
onSuccess?: (response: XyoApiResponse, depth: number) => void
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios'
|
|
2
|
+
|
|
3
|
+
import { XyoApiEnvelope } from './Envelope'
|
|
4
|
+
|
|
5
|
+
export type XyoApiResponse<T = unknown, D = unknown> = AxiosResponse<T, D>
|
|
6
|
+
|
|
7
|
+
export type XyoApiResponseBody<T> = T | undefined
|
|
8
|
+
|
|
9
|
+
export type XyoApiResponseTuple<T> = [T | undefined, XyoApiEnvelope<T | undefined>, XyoApiResponse<XyoApiEnvelope<T | undefined>>]
|
|
10
|
+
|
|
11
|
+
export type XyoApiResponseTupleOrBody<T> = XyoApiResponseTuple<T> | XyoApiResponseBody<T>
|
|
12
|
+
|
|
13
|
+
export type XyoApiResponseType = 'body' | 'tuple'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type XyoApiWarning = Error
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { XyoArchivePath } from './ArchivePath'
|
|
2
|
+
|
|
3
|
+
export type AccessLevel = 'public' | 'private' | 'none'
|
|
4
|
+
export type AccessType = 'read' | 'remove' | 'create' | 'list'
|
|
5
|
+
export type ExpirationWindow = 'create' | 'read'
|
|
6
|
+
|
|
7
|
+
export interface XyoAccessControl {
|
|
8
|
+
access?: Record<AccessType, AccessLevel>
|
|
9
|
+
expiration?: {
|
|
10
|
+
window?: ExpirationWindow
|
|
11
|
+
delay?: number
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface XyoAccessControls {
|
|
16
|
+
/**
|
|
17
|
+
* Set access controls on a per schema basis.
|
|
18
|
+
* '*' can be used as a wildcard
|
|
19
|
+
* Access control is set from a generic to specific direction if
|
|
20
|
+
* multiple wildcard versions apply to a schema
|
|
21
|
+
*/
|
|
22
|
+
schema?: Record<string, XyoAccessControl>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface XyoArchive extends XyoArchivePath {
|
|
26
|
+
user?: string
|
|
27
|
+
accessControl?: XyoAccessControl | boolean
|
|
28
|
+
}
|