@xyo-network/api 2.72.9 → 2.73.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/dist/index.d.mts +192 -0
  2. package/dist/index.d.ts +192 -0
  3. package/dist/index.js +297 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +254 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +36 -23
  8. package/tsup.config.ts +16 -0
  9. package/dist/cjs/Api/Api.js +0 -13
  10. package/dist/cjs/Api/Api.js.map +0 -1
  11. package/dist/cjs/Api/index.js +0 -5
  12. package/dist/cjs/Api/index.js.map +0 -1
  13. package/dist/cjs/Base.js +0 -119
  14. package/dist/cjs/Base.js.map +0 -1
  15. package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApi.js +0 -28
  16. package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApi.js.map +0 -1
  17. package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.js +0 -23
  18. package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.js.map +0 -1
  19. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.js +0 -3
  20. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.js.map +0 -1
  21. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.js +0 -10
  22. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.js.map +0 -1
  23. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.js +0 -6
  24. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.js.map +0 -1
  25. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.js +0 -10
  26. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.js.map +0 -1
  27. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.js +0 -5
  28. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.js.map +0 -1
  29. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.js +0 -3
  30. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.js.map +0 -1
  31. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.js +0 -3
  32. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.js.map +0 -1
  33. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuerySchema.js +0 -13
  34. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuerySchema.js.map +0 -1
  35. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.js +0 -3
  36. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.js.map +0 -1
  37. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.js +0 -10
  38. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.js.map +0 -1
  39. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.js +0 -6
  40. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.js.map +0 -1
  41. package/dist/cjs/Diviner/LocationDiviner/Queries/index.js +0 -10
  42. package/dist/cjs/Diviner/LocationDiviner/Queries/index.js.map +0 -1
  43. package/dist/cjs/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.js +0 -5
  44. package/dist/cjs/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.js.map +0 -1
  45. package/dist/cjs/Diviner/LocationDiviner/Witnesses/LocationWitness.js +0 -5
  46. package/dist/cjs/Diviner/LocationDiviner/Witnesses/LocationWitness.js.map +0 -1
  47. package/dist/cjs/Diviner/LocationDiviner/Witnesses/index.js +0 -6
  48. package/dist/cjs/Diviner/LocationDiviner/Witnesses/index.js.map +0 -1
  49. package/dist/cjs/Diviner/LocationDiviner/index.js +0 -8
  50. package/dist/cjs/Diviner/LocationDiviner/index.js.map +0 -1
  51. package/dist/cjs/Diviner/LocationDiviner/models.js +0 -3
  52. package/dist/cjs/Diviner/LocationDiviner/models.js.map +0 -1
  53. package/dist/cjs/Diviner/RemoteDivinerConfig.js +0 -5
  54. package/dist/cjs/Diviner/RemoteDivinerConfig.js.map +0 -1
  55. package/dist/cjs/Diviner/RemoteDivinerError.js +0 -14
  56. package/dist/cjs/Diviner/RemoteDivinerError.js.map +0 -1
  57. package/dist/cjs/Diviner/index.js +0 -6
  58. package/dist/cjs/Diviner/index.js.map +0 -1
  59. package/dist/cjs/Simple.js +0 -60
  60. package/dist/cjs/Simple.js.map +0 -1
  61. package/dist/cjs/Test/index.js +0 -6
  62. package/dist/cjs/Test/index.js.map +0 -1
  63. package/dist/cjs/Test/testBoundWitness.js +0 -17
  64. package/dist/cjs/Test/testBoundWitness.js.map +0 -1
  65. package/dist/cjs/Test/testPayload.js +0 -18
  66. package/dist/cjs/Test/testPayload.js.map +0 -1
  67. package/dist/cjs/WithArchive.js +0 -3
  68. package/dist/cjs/WithArchive.js.map +0 -1
  69. package/dist/cjs/index.js +0 -10
  70. package/dist/cjs/index.js.map +0 -1
  71. package/dist/cjs/models/ArchivePath.js +0 -3
  72. package/dist/cjs/models/ArchivePath.js.map +0 -1
  73. package/dist/cjs/models/index.js +0 -5
  74. package/dist/cjs/models/index.js.map +0 -1
  75. package/dist/cjs/objToQuery.js +0 -13
  76. package/dist/cjs/objToQuery.js.map +0 -1
  77. package/dist/docs.json +0 -16342
  78. package/dist/esm/Api/Api.js +0 -12
  79. package/dist/esm/Api/Api.js.map +0 -1
  80. package/dist/esm/Api/index.js +0 -2
  81. package/dist/esm/Api/index.js.map +0 -1
  82. package/dist/esm/Base.js +0 -100
  83. package/dist/esm/Base.js.map +0 -1
  84. package/dist/esm/Diviner/LocationDiviner/LocationDivinerApi.js +0 -21
  85. package/dist/esm/Diviner/LocationDiviner/LocationDivinerApi.js.map +0 -1
  86. package/dist/esm/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.js +0 -18
  87. package/dist/esm/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.js.map +0 -1
  88. package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.js +0 -2
  89. package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.js.map +0 -1
  90. package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.js +0 -6
  91. package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.js.map +0 -1
  92. package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.js +0 -3
  93. package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.js.map +0 -1
  94. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.js +0 -6
  95. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.js.map +0 -1
  96. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.js +0 -2
  97. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.js.map +0 -1
  98. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.js +0 -2
  99. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.js.map +0 -1
  100. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.js +0 -2
  101. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.js.map +0 -1
  102. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuerySchema.js +0 -9
  103. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuerySchema.js.map +0 -1
  104. package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.js +0 -2
  105. package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.js.map +0 -1
  106. package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.js +0 -6
  107. package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.js.map +0 -1
  108. package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.js +0 -3
  109. package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.js.map +0 -1
  110. package/dist/esm/Diviner/LocationDiviner/Queries/index.js +0 -7
  111. package/dist/esm/Diviner/LocationDiviner/Queries/index.js.map +0 -1
  112. package/dist/esm/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.js +0 -2
  113. package/dist/esm/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.js.map +0 -1
  114. package/dist/esm/Diviner/LocationDiviner/Witnesses/LocationWitness.js +0 -2
  115. package/dist/esm/Diviner/LocationDiviner/Witnesses/LocationWitness.js.map +0 -1
  116. package/dist/esm/Diviner/LocationDiviner/Witnesses/index.js +0 -3
  117. package/dist/esm/Diviner/LocationDiviner/Witnesses/index.js.map +0 -1
  118. package/dist/esm/Diviner/LocationDiviner/index.js +0 -5
  119. package/dist/esm/Diviner/LocationDiviner/index.js.map +0 -1
  120. package/dist/esm/Diviner/LocationDiviner/models.js +0 -2
  121. package/dist/esm/Diviner/LocationDiviner/models.js.map +0 -1
  122. package/dist/esm/Diviner/RemoteDivinerConfig.js +0 -2
  123. package/dist/esm/Diviner/RemoteDivinerConfig.js.map +0 -1
  124. package/dist/esm/Diviner/RemoteDivinerError.js +0 -10
  125. package/dist/esm/Diviner/RemoteDivinerError.js.map +0 -1
  126. package/dist/esm/Diviner/index.js +0 -3
  127. package/dist/esm/Diviner/index.js.map +0 -1
  128. package/dist/esm/Simple.js +0 -45
  129. package/dist/esm/Simple.js.map +0 -1
  130. package/dist/esm/Test/index.js +0 -3
  131. package/dist/esm/Test/index.js.map +0 -1
  132. package/dist/esm/Test/testBoundWitness.js +0 -14
  133. package/dist/esm/Test/testBoundWitness.js.map +0 -1
  134. package/dist/esm/Test/testPayload.js +0 -14
  135. package/dist/esm/Test/testPayload.js.map +0 -1
  136. package/dist/esm/WithArchive.js +0 -2
  137. package/dist/esm/WithArchive.js.map +0 -1
  138. package/dist/esm/index.js +0 -7
  139. package/dist/esm/index.js.map +0 -1
  140. package/dist/esm/models/ArchivePath.js +0 -2
  141. package/dist/esm/models/ArchivePath.js.map +0 -1
  142. package/dist/esm/models/index.js +0 -2
  143. package/dist/esm/models/index.js.map +0 -1
  144. package/dist/esm/objToQuery.js +0 -9
  145. package/dist/esm/objToQuery.js.map +0 -1
  146. package/dist/types/Api/Api.d.ts +0 -12
  147. package/dist/types/Api/Api.d.ts.map +0 -1
  148. package/dist/types/Api/index.d.ts +0 -2
  149. package/dist/types/Api/index.d.ts.map +0 -1
  150. package/dist/types/Base.d.ts +0 -32
  151. package/dist/types/Base.d.ts.map +0 -1
  152. package/dist/types/Diviner/LocationDiviner/LocationDivinerApi.d.ts +0 -12
  153. package/dist/types/Diviner/LocationDiviner/LocationDivinerApi.d.ts.map +0 -1
  154. package/dist/types/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.d.ts +0 -10
  155. package/dist/types/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.d.ts.map +0 -1
  156. package/dist/types/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.d.ts +0 -5
  157. package/dist/types/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.d.ts.map +0 -1
  158. package/dist/types/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.ts +0 -12
  159. package/dist/types/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.ts.map +0 -1
  160. package/dist/types/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.ts +0 -3
  161. package/dist/types/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.ts.map +0 -1
  162. package/dist/types/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.ts +0 -12
  163. package/dist/types/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.ts.map +0 -1
  164. package/dist/types/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.ts +0 -2
  165. package/dist/types/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.ts.map +0 -1
  166. package/dist/types/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts +0 -18
  167. package/dist/types/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts.map +0 -1
  168. package/dist/types/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.ts +0 -5
  169. package/dist/types/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.ts.map +0 -1
  170. package/dist/types/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.ts +0 -6
  171. package/dist/types/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.ts.map +0 -1
  172. package/dist/types/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.ts +0 -8
  173. package/dist/types/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.ts.map +0 -1
  174. package/dist/types/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.ts +0 -12
  175. package/dist/types/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.ts.map +0 -1
  176. package/dist/types/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.ts +0 -3
  177. package/dist/types/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.ts.map +0 -1
  178. package/dist/types/Diviner/LocationDiviner/Queries/index.d.ts +0 -7
  179. package/dist/types/Diviner/LocationDiviner/Queries/index.d.ts.map +0 -1
  180. package/dist/types/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.d.ts +0 -13
  181. package/dist/types/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.d.ts.map +0 -1
  182. package/dist/types/Diviner/LocationDiviner/Witnesses/LocationWitness.d.ts +0 -21
  183. package/dist/types/Diviner/LocationDiviner/Witnesses/LocationWitness.d.ts.map +0 -1
  184. package/dist/types/Diviner/LocationDiviner/Witnesses/index.d.ts +0 -3
  185. package/dist/types/Diviner/LocationDiviner/Witnesses/index.d.ts.map +0 -1
  186. package/dist/types/Diviner/LocationDiviner/index.d.ts +0 -5
  187. package/dist/types/Diviner/LocationDiviner/index.d.ts.map +0 -1
  188. package/dist/types/Diviner/LocationDiviner/models.d.ts +0 -5
  189. package/dist/types/Diviner/LocationDiviner/models.d.ts.map +0 -1
  190. package/dist/types/Diviner/RemoteDivinerConfig.d.ts +0 -11
  191. package/dist/types/Diviner/RemoteDivinerConfig.d.ts.map +0 -1
  192. package/dist/types/Diviner/RemoteDivinerError.d.ts +0 -6
  193. package/dist/types/Diviner/RemoteDivinerError.d.ts.map +0 -1
  194. package/dist/types/Diviner/index.d.ts +0 -3
  195. package/dist/types/Diviner/index.d.ts.map +0 -1
  196. package/dist/types/Simple.d.ts +0 -22
  197. package/dist/types/Simple.d.ts.map +0 -1
  198. package/dist/types/Test/index.d.ts +0 -3
  199. package/dist/types/Test/index.d.ts.map +0 -1
  200. package/dist/types/Test/testBoundWitness.d.ts +0 -4
  201. package/dist/types/Test/testBoundWitness.d.ts.map +0 -1
  202. package/dist/types/Test/testPayload.d.ts +0 -6
  203. package/dist/types/Test/testPayload.d.ts.map +0 -1
  204. package/dist/types/WithArchive.d.ts +0 -4
  205. package/dist/types/WithArchive.d.ts.map +0 -1
  206. package/dist/types/index.d.ts +0 -7
  207. package/dist/types/index.d.ts.map +0 -1
  208. package/dist/types/models/ArchivePath.d.ts +0 -4
  209. package/dist/types/models/ArchivePath.d.ts.map +0 -1
  210. package/dist/types/models/index.d.ts +0 -2
  211. package/dist/types/models/index.d.ts.map +0 -1
  212. package/dist/types/objToQuery.d.ts +0 -2
  213. package/dist/types/objToQuery.d.ts.map +0 -1
@@ -1,12 +0,0 @@
1
- import { Huri } from '@xyo-network/huri';
2
- import { ApiSimple } from '../Simple';
3
- export class ArchivistApi extends ApiSimple {
4
- huri(huri) {
5
- const huriObj = typeof huri === 'string' ? new Huri(huri) : huri;
6
- return new ApiSimple({
7
- ...this.config,
8
- root: `${this.root}${huriObj.href}/`,
9
- });
10
- }
11
- }
12
- //# sourceMappingURL=Api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Api.js","sourceRoot":"","sources":["../../../src/Api/Api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAGxC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,MAAM,OAAO,YAA8C,SAAQ,SAAuB;IACxF,IAAI,CAAC,IAAmB;QACtB,MAAM,OAAO,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QAChE,OAAO,IAAI,SAAS,CAAU;YAC5B,GAAG,IAAI,CAAC,MAAM;YACd,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,GAAG;SACrC,CAAC,CAAA;IACJ,CAAC;CACF"}
@@ -1,2 +0,0 @@
1
- export * from './Api';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Api/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA"}
package/dist/esm/Base.js DELETED
@@ -1,100 +0,0 @@
1
- import { AxiosJson } from '@xyo-network/axios';
2
- export class ApiBase {
3
- config;
4
- axios;
5
- constructor(config) {
6
- this.config = config;
7
- this.axios = new AxiosJson({ ...this.config, headers: this.headers });
8
- }
9
- get authenticated() {
10
- return !!this.config.apiKey || !!this.config.jwtToken;
11
- }
12
- get headers() {
13
- const headers = {};
14
- if (this.config.jwtToken) {
15
- headers.Authorization = `Bearer ${this.config.jwtToken}`;
16
- }
17
- if (this.config.apiKey) {
18
- headers['x-api-key'] = this.config.apiKey;
19
- }
20
- return headers;
21
- }
22
- get query() {
23
- return this.config.query ?? '';
24
- }
25
- get root() {
26
- return this.config.root ?? '/';
27
- }
28
- static resolveResponse(result) {
29
- return [result?.data?.data, result?.data, result];
30
- }
31
- static shapeResponse(response, responseType) {
32
- const resolvedResponse = ApiBase.resolveResponse(response);
33
- return responseType === 'tuple' ? resolvedResponse : resolvedResponse[0];
34
- }
35
- onError(error, depth = 0) {
36
- this.config.reportableParent?.onError?.(error, depth + 1);
37
- this.config.onError?.(error, depth);
38
- }
39
- onFailure(response, depth = 0) {
40
- this.config.reportableParent?.onFailure?.(response, depth + 1);
41
- this.config.onFailure?.(response, depth);
42
- }
43
- onSuccess(response, depth = 0) {
44
- this.config.reportableParent?.onSuccess?.(response, depth + 1);
45
- this.config.onSuccess?.(response, depth);
46
- }
47
- async deleteEndpoint(endPoint = '', responseType) {
48
- const response = await this.monitorResponse(async () => {
49
- return await this.axios.delete(`${this.resolveRoot()}${endPoint}${this.query}`);
50
- });
51
- return ApiBase.shapeResponse(response, responseType);
52
- }
53
- async getEndpoint(endPoint = '', responseType) {
54
- const response = await this.monitorResponse(async () => {
55
- return await this.axios.get(`${this.resolveRoot()}${endPoint}${this.query}`);
56
- });
57
- return ApiBase.shapeResponse(response, responseType);
58
- }
59
- handleMonitorResponseError(error, trapAxiosException) {
60
- if (!error.isError) {
61
- throw error;
62
- }
63
- if (trapAxiosException) {
64
- error.response ? this.onFailure(error.response) : this.onError(error);
65
- if (this.config.throwFailure) {
66
- throw error;
67
- }
68
- return error.response;
69
- }
70
- }
71
- async monitorResponse(closure) {
72
- //we use this to prevent accidental catching on exceptions in callbacks
73
- let trapAxiosException = true;
74
- try {
75
- const response = await closure();
76
- trapAxiosException = false;
77
- response.status < 300 ? this.onSuccess(response) : this.onFailure(response);
78
- return response;
79
- }
80
- catch (ex) {
81
- this.handleMonitorResponseError(ex, trapAxiosException);
82
- }
83
- }
84
- async postEndpoint(endPoint = '', data, responseType) {
85
- const response = await this.monitorResponse(async () => {
86
- return await this.axios.post(`${this.resolveRoot()}${endPoint}${this.query}`, data);
87
- });
88
- return ApiBase.shapeResponse(response, responseType);
89
- }
90
- async putEndpoint(endPoint = '', data, responseType) {
91
- const response = await this.monitorResponse(async () => {
92
- return await this.axios.put(`${this.resolveRoot()}${endPoint}${this.query}`, data);
93
- });
94
- return ApiBase.shapeResponse(response, responseType);
95
- }
96
- resolveRoot() {
97
- return `${this.config.apiDomain}${this.root}`;
98
- }
99
- }
100
- //# sourceMappingURL=Base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Base.js","sourceRoot":"","sources":["../../src/Base.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C,MAAM,OAAO,OAAO;IACT,MAAM,CAAG;IACR,KAAK,CAAW;IAE1B,YAAY,MAAS;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,SAAS,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;IACvE,CAAC;IAED,IAAI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,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,CAAA;QACxI,CAAC,CAAC,CAAA;QACF,OAAO,OAAO,CAAC,aAAa,CAAI,QAAQ,EAAE,YAAY,CAAC,CAAA;IACzD,CAAC;IAKS,KAAK,CAAC,WAAW,CAA2B,QAAQ,GAAG,EAAE,EAAE,IAAQ,EAAE,YAA8B;QAC3G,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAI,KAAK,IAAI,EAAE;YACxD,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAoD,GAAG,IAAI,CAAC,WAAW,EAAE,GAAG,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,CAAA;QACvI,CAAC,CAAC,CAAA;QACF,OAAO,OAAO,CAAC,aAAa,CAAI,QAAQ,EAAE,YAAY,CAAC,CAAA;IACzD,CAAC;IAEO,WAAW;QACjB,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IAC/C,CAAC;CACF"}
@@ -1,21 +0,0 @@
1
- import { axios } from '@xyo-network/axios';
2
- import { getLocationDivinerApiResponseTransformer } from './LocationDivinerApiResponseTransformer';
3
- class LocationDivinerApi {
4
- config;
5
- constructor(config) {
6
- this.config = config;
7
- }
8
- get axiosRequestConfig() {
9
- return {
10
- transformResponse: getLocationDivinerApiResponseTransformer(),
11
- };
12
- }
13
- async getLocationQuery(hash) {
14
- return (await axios.get(`${this.config.apiDomain}/location/query/${hash}`, this.axiosRequestConfig)).data;
15
- }
16
- async postLocationQuery(request) {
17
- return (await axios.post(`${this.config.apiDomain}/location/query`, { ...request }, this.axiosRequestConfig)).data;
18
- }
19
- }
20
- export { LocationDivinerApi };
21
- //# sourceMappingURL=LocationDivinerApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocationDivinerApi.js","sourceRoot":"","sources":["../../../../src/Diviner/LocationDiviner/LocationDivinerApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAyB,MAAM,oBAAoB,CAAA;AAEjE,OAAO,EAAE,wCAAwC,EAAE,MAAM,yCAAyC,CAAA;AAIlG,MAAM,kBAAkB;IACtB,MAAM,CAAW;IACjB,YAAY,MAAiB;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,IAAY,kBAAkB;QAC5B,OAAO;YACL,iBAAiB,EAAE,wCAAwC,EAAE;SAC9D,CAAA;IACH,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,IAAY;QACjC,OAAO,CAAC,MAAM,KAAK,CAAC,GAAG,CAA2B,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,mBAAmB,IAAI,EAAE,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAA;IACrI,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,OAA8C;QACpE,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,CAAgC,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,iBAAiB,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAA;IACnJ,CAAC;CACF;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
@@ -1,18 +0,0 @@
1
- import { axios } from '@xyo-network/axios';
2
- export const locationDivinerApiResponseTransformer = (data, _headers) => {
3
- return data.data;
4
- };
5
- /**
6
- * Gets the response transformers for the LocationDiviner API. Done as a method instead of a property
7
- * to allow detection of dynamically added response transformers.
8
- * @param axiosInstance The axios instance (defaults to the global instance if none provided)
9
- * @returns the response transformers for the LocationDiviner API
10
- */
11
- export const getLocationDivinerApiResponseTransformer = (axiosInstance = axios) => {
12
- // If there's any existing response transforms preserve them and
13
- // append our response transform, otherwise just return ours
14
- return axiosInstance.defaults.transformResponse
15
- ? [].concat(axiosInstance.defaults.transformResponse, locationDivinerApiResponseTransformer)
16
- : [locationDivinerApiResponseTransformer];
17
- };
18
- //# sourceMappingURL=LocationDivinerApiResponseTransformer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocationDivinerApiResponseTransformer.js","sourceRoot":"","sources":["../../../../src/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA4B,MAAM,oBAAoB,CAAA;AAEpE,MAAM,CAAC,MAAM,qCAAqC,GAA6B,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE;IAChG,OAAO,IAAI,CAAC,IAAI,CAAA;AAClB,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC,aAAa,GAAG,KAAK,EAA8B,EAAE;IAC5G,gEAAgE;IAChE,4DAA4D;IAC5D,OAAO,aAAa,CAAC,QAAQ,CAAC,iBAAiB;QAC7C,CAAC,CAAE,EAAiC,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,iBAAiB,EAAE,qCAAqC,CAAC;QAC5H,CAAC,CAAC,CAAC,qCAAqC,CAAC,CAAA;AAC7C,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=LocationHeatmapPointProperties.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocationHeatmapPointProperties.js","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- export const locationHeatmapQuerySchema = 'network.xyo.location.heatmap.query';
2
- export const locationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer';
3
- export const isLocationHeatmapQuery = (query) => {
4
- return query && query?.schema === locationHeatmapQuerySchema;
5
- };
6
- //# sourceMappingURL=LocationHeatmapQuery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocationHeatmapQuery.js","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,0BAA0B,GAA+B,oCAAoC,CAAA;AAG1G,MAAM,CAAC,MAAM,2BAA2B,GAAgC,qCAAqC,CAAA;AAQ7G,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAA8B,EAAiC,EAAE;IACtG,OAAO,KAAK,IAAI,KAAK,EAAE,MAAM,KAAK,0BAA0B,CAAA;AAC9D,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- export * from './LocationHeatmapPointProperties';
2
- export * from './LocationHeatmapQuery';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA;AAChD,cAAc,wBAAwB,CAAA"}
@@ -1,6 +0,0 @@
1
- export const locationQuadkeyHeatmapQuerySchema = 'network.xyo.location.heatmap.quadkey.query';
2
- export const locationQuadkeyHeatmapAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer';
3
- export const isLocationQuadkeyHeatmapQuery = (query) => {
4
- return query && query?.schema === locationQuadkeyHeatmapQuerySchema;
5
- };
6
- //# sourceMappingURL=LocationQuadkeyHeatmapQuery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocationQuadkeyHeatmapQuery.js","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,iCAAiC,GAAsC,4CAA4C,CAAA;AAEhI,MAAM,CAAC,MAAM,kCAAkC,GAAuC,6CAA6C,CAAA;AAOnI,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,KAA8B,EAAwC,EAAE;IACpH,OAAO,KAAK,IAAI,KAAK,EAAE,MAAM,KAAK,iCAAiC,CAAA;AACrE,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './LocationQuadkeyHeatmapQuery';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=LocationQueryCreationRequest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocationQueryCreationRequest.js","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=LocationQueryCreationResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocationQueryCreationResponse.js","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- const locationQuerySchemas = {
2
- 'network.xyo.location.heatmap.quadkey.query': true,
3
- 'network.xyo.location.heatmap.query': true,
4
- 'network.xyo.location.range.query': true,
5
- };
6
- export const isSupportedLocationQuerySchema = (schema) => {
7
- return locationQuerySchemas[schema] || false;
8
- };
9
- //# sourceMappingURL=LocationQuerySchema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocationQuerySchema.js","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Queries/LocationQuerySchema.ts"],"names":[],"mappings":"AAMA,MAAM,oBAAoB,GAAsC;IAC9D,4CAA4C,EAAE,IAAI;IAClD,oCAAoC,EAAE,IAAI;IAC1C,kCAAkC,EAAE,IAAI;CACzC,CAAA;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,MAAc,EAAiC,EAAE;IAC9F,OAAO,oBAAoB,CAAC,MAA6B,CAAC,IAAI,KAAK,CAAA;AACrE,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=LocationTimeRangePointProperties.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocationTimeRangePointProperties.js","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- export const LocationTimeRangeQuerySchema = 'network.xyo.location.range.query';
2
- export const LocationTimeRangeAnswerSchema = 'network.xyo.location.range.answer';
3
- export const isLocationTimeRangeQuery = (query) => {
4
- return query && query?.schema === LocationTimeRangeAnswerSchema;
5
- };
6
- //# sourceMappingURL=LocationTimeRangeQuery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocationTimeRangeQuery.js","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,4BAA4B,GAAiC,kCAAkC,CAAA;AAG5G,MAAM,CAAC,MAAM,6BAA6B,GAAkC,mCAAmC,CAAA;AAU/G,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAA8B,EAAmC,EAAE;IAC1G,OAAO,KAAK,IAAI,KAAK,EAAE,MAAM,KAAK,6BAA6B,CAAA;AACjE,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- export * from './LocationTimeRangePointProperties';
2
- export * from './LocationTimeRangeQuery';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,0BAA0B,CAAA"}
@@ -1,7 +0,0 @@
1
- export * from './LocationHeatmapQuery';
2
- export * from './LocationQuadkeyHeatmapQuery';
3
- export * from './LocationQueryCreationRequest';
4
- export * from './LocationQueryCreationResponse';
5
- export * from './LocationQuerySchema';
6
- export * from './LocationTimeRangeQuery';
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA"}
@@ -1,2 +0,0 @@
1
- export const CurrentLocationWitnessSchema = 'co.coinapp.currentlocationwitness';
2
- //# sourceMappingURL=CurrentLocationWitness.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CurrentLocationWitness.js","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,4BAA4B,GAAiC,mCAAmC,CAAA"}
@@ -1,2 +0,0 @@
1
- export const LocationWitnessSchema = 'network.xyo.location';
2
- //# sourceMappingURL=LocationWitness.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocationWitness.js","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Witnesses/LocationWitness.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,qBAAqB,GAA0B,sBAAsB,CAAA"}
@@ -1,3 +0,0 @@
1
- export * from './CurrentLocationWitness';
2
- export * from './LocationWitness';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/Diviner/LocationDiviner/Witnesses/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA"}
@@ -1,5 +0,0 @@
1
- export * from './LocationDivinerApi';
2
- export * from './models';
3
- export * from './Queries';
4
- export * from './Witnesses';
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Diviner/LocationDiviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../src/Diviner/LocationDiviner/models.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export const RemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config';
2
- //# sourceMappingURL=RemoteDivinerConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RemoteDivinerConfig.js","sourceRoot":"","sources":["../../../src/Diviner/RemoteDivinerConfig.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,yBAAyB,GAA8B,mCAAmC,CAAA"}
@@ -1,10 +0,0 @@
1
- export class RemoteDivinerError extends Error {
2
- isRemoteDivinerError = true;
3
- constructor(action, error, message) {
4
- super(`Remote Diviner [${action}] failed${message ? ` (${message})` : ''}`, { cause: error });
5
- }
6
- static isRemoteDivinerError(error) {
7
- return error.isRemoteDivinerError ? error : undefined;
8
- }
9
- }
10
- //# sourceMappingURL=RemoteDivinerError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RemoteDivinerError.js","sourceRoot":"","sources":["../../../src/Diviner/RemoteDivinerError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAC3C,oBAAoB,GAAG,IAAI,CAAA;IAC3B,YAAY,MAAc,EAAE,KAAqB,EAAE,OAAgB;QACjE,KAAK,CAAC,mBAAmB,MAAM,WAAW,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IAC/F,CAAC;IACD,MAAM,CAAC,oBAAoB,CAAC,KAAc;QACxC,OAAQ,KAA4B,CAAC,oBAAoB,CAAC,CAAC,CAAE,KAA4B,CAAC,CAAC,CAAC,SAAS,CAAA;IACvG,CAAC;CACF"}
@@ -1,3 +0,0 @@
1
- export * from './LocationDiviner';
2
- export * from './RemoteDivinerConfig';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA"}
@@ -1,45 +0,0 @@
1
- import { ApiBase } from './Base';
2
- import { objToQuery } from './objToQuery';
3
- export class ApiSimple extends ApiBase {
4
- async delete(responseType) {
5
- switch (responseType) {
6
- case 'tuple':
7
- return await this.deleteEndpoint(undefined, 'tuple');
8
- default:
9
- return await this.deleteEndpoint(undefined);
10
- }
11
- }
12
- async find(query = {}, responseType) {
13
- switch (responseType) {
14
- case 'tuple':
15
- return await this.getEndpoint(objToQuery(query), 'tuple');
16
- default:
17
- return await this.getEndpoint(objToQuery(query));
18
- }
19
- }
20
- async get(responseType) {
21
- switch (responseType) {
22
- case 'tuple':
23
- return await this.getEndpoint(undefined, 'tuple');
24
- default:
25
- return await this.getEndpoint(undefined);
26
- }
27
- }
28
- async post(data, responseType) {
29
- switch (responseType) {
30
- case 'tuple':
31
- return await this.postEndpoint(undefined, data, 'tuple');
32
- default:
33
- return await this.postEndpoint(undefined, data);
34
- }
35
- }
36
- async put(data, responseType) {
37
- switch (responseType) {
38
- case 'tuple':
39
- return await this.putEndpoint(undefined, data, 'tuple');
40
- default:
41
- return await this.putEndpoint(undefined, data);
42
- }
43
- }
44
- }
45
- //# sourceMappingURL=Simple.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Simple.js","sourceRoot":"","sources":["../../src/Simple.ts"],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,EAAE,YAA8B;QAChD,QAAQ,YAAY,EAAE;YACpB,KAAK,OAAO;gBACV,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;YACzD;gBACE,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;SACjD;IACH,CAAC;CACF"}
@@ -1,3 +0,0 @@
1
- export * from './testBoundWitness';
2
- export * from './testPayload';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Test/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA"}
@@ -1,14 +0,0 @@
1
- import { BoundWitnessSchema } from '@xyo-network/boundwitness-model';
2
- const testBoundWitness = {
3
- _client: 'js',
4
- _hash: 'b0ffb9ebf872dc316b7be48327256c5316f7cb84d7c706861b18b86af1942dea',
5
- _signatures: ['95100e5fd2012b958e96895870cfac5353c3a33a19314cfd1304ef7d01d052ec2a3ef80d6449cf88d463027fe0d868ed8cfb8b7323d37e93a08570233eea0b17'],
6
- _timestamp: 1650067385598,
7
- addresses: ['5346a2ce56ec4177b67092bda710e150ba6fa046'],
8
- payload_hashes: ['20e14207f952a09f767ff614a648546c037fe524ace0bfe55db31f818aff1f1c'],
9
- payload_schemas: ['network.xyo.test'],
10
- previous_hashes: [null],
11
- schema: BoundWitnessSchema,
12
- };
13
- export { testBoundWitness };
14
- //# sourceMappingURL=testBoundWitness.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testBoundWitness.js","sourceRoot":"","sources":["../../../src/Test/testBoundWitness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAElF,MAAM,gBAAgB,GAAiB;IACrC,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,kEAAkE;IACzE,WAAW,EAAE,CAAC,kIAAkI,CAAC;IACjJ,UAAU,EAAE,aAAa;IACzB,SAAS,EAAE,CAAC,0CAA0C,CAAC;IACvD,cAAc,EAAE,CAAC,kEAAkE,CAAC;IACpF,eAAe,EAAE,CAAC,kBAAkB,CAAC;IACrC,eAAe,EAAE,CAAC,IAAI,CAAC;IACvB,MAAM,EAAE,kBAAkB;CACX,CAAA;AAEjB,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
@@ -1,14 +0,0 @@
1
- const testSchema = 'network.xyo.test';
2
- const testPayload = {
3
- _hash: '20e14207f952a09f767ff614a648546c037fe524ace0bfe55db31f818aff1f1c',
4
- _timestamp: 1609459255555,
5
- numberField: 1,
6
- objectField: {
7
- numberField: 1,
8
- stringField: 'stringValue',
9
- },
10
- schema: testSchema,
11
- stringField: 'stringValue',
12
- };
13
- export { testPayload, testSchema };
14
- //# sourceMappingURL=testPayload.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testPayload.js","sourceRoot":"","sources":["../../../src/Test/testPayload.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,GAAG,kBAAkB,CAAA;AACrC,MAAM,WAAW,GAA6B;IAC5C,KAAK,EAAE,kEAAkE;IACzE,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,CAAC;IACd,WAAW,EAAE;QACX,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,aAAa;KAC3B;IACD,MAAM,EAAE,UAAU;IAClB,WAAW,EAAE,aAAa;CAC3B,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=WithArchive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WithArchive.js","sourceRoot":"","sources":["../../src/WithArchive.ts"],"names":[],"mappings":""}
package/dist/esm/index.js DELETED
@@ -1,7 +0,0 @@
1
- export * from './Api';
2
- export * from './Base';
3
- export * from './Diviner';
4
- export * from './models';
5
- export * from './Simple';
6
- export * from './WithArchive';
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ArchivePath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArchivePath.js","sourceRoot":"","sources":["../../../src/models/ArchivePath.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export * from './ArchivePath';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -1,9 +0,0 @@
1
- export const objToQuery = (obj) => {
2
- return `?${Object.entries(obj)
3
- .map(([key, value]) => {
4
- return `${key}=${value}`;
5
- })
6
- .filter((value) => value !== undefined)
7
- .join('&')}`;
8
- };
9
- //# sourceMappingURL=objToQuery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objToQuery.js","sourceRoot":"","sources":["../../src/objToQuery.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAgD,EAAE,EAAE;IAC7E,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;SAC3B,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACpB,OAAO,GAAG,GAAG,IAAI,KAAK,EAAE,CAAA;IAC1B,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC;SACtC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAA;AAChB,CAAC,CAAA"}
@@ -1,12 +0,0 @@
1
- import { ApiConfig } from '@xyo-network/api-models';
2
- import { Huri } from '@xyo-network/huri';
3
- import { Payload } from '@xyo-network/payload-model';
4
- import { ApiSimple } from '../Simple';
5
- export declare class ArchivistApi<C extends ApiConfig = ApiConfig> extends ApiSimple<Payload[], C> {
6
- huri(huri: Huri | string): ApiSimple<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
7
- schema: string;
8
- }, import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
9
- schema: string;
10
- }, import("@xyo-network/payload-model").PayloadFindFilter, ApiConfig>;
11
- }
12
- //# sourceMappingURL=Api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Api.d.ts","sourceRoot":"","sources":["../../../src/Api/Api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,qBAAa,YAAY,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACxF,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM;;;;;CAOzB"}
@@ -1,2 +0,0 @@
1
- export * from './Api';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Api/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA"}
@@ -1,32 +0,0 @@
1
- import { ApiConfig, ApiEnvelope, ApiError, ApiReportable, ApiResponse, ApiResponseBody, ApiResponseTuple } from '@xyo-network/api-models';
2
- import { AxiosJson } from '@xyo-network/axios';
3
- export declare class ApiBase<C extends ApiConfig = ApiConfig> implements ApiReportable {
4
- readonly config: C;
5
- protected axios: AxiosJson;
6
- constructor(config: C);
7
- get authenticated(): boolean;
8
- protected get headers(): Record<string, string>;
9
- protected get query(): string;
10
- protected get root(): string;
11
- private static resolveResponse;
12
- private static shapeResponse;
13
- onError(error: ApiError, depth?: number): void;
14
- onFailure(response: ApiResponse, depth?: number): void;
15
- onSuccess(response: ApiResponse, depth?: number): void;
16
- protected deleteEndpoint<T = unknown>(endPoint?: string): Promise<ApiResponseBody<T>>;
17
- protected deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<ApiResponseBody<T>>;
18
- protected deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
19
- protected getEndpoint<T = unknown>(endPoint?: string): Promise<ApiResponseBody<T>>;
20
- protected getEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<ApiResponseBody<T>>;
21
- protected getEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
22
- protected handleMonitorResponseError<T>(error: ApiError, trapAxiosException: boolean): ApiResponse<ApiEnvelope<T>> | undefined;
23
- protected monitorResponse<T>(closure: () => Promise<ApiResponse<ApiEnvelope<T>>>): Promise<ApiResponse<ApiEnvelope<T>> | undefined>;
24
- protected postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<ApiResponseBody<T>>;
25
- protected postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>;
26
- protected postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
27
- protected putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<ApiResponseBody<T>>;
28
- protected putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>;
29
- protected putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>;
30
- private resolveRoot;
31
- }
32
- //# sourceMappingURL=Base.d.ts.map