@xyo-network/api 2.20.44 → 2.20.47

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 (268) hide show
  1. package/dist/cjs/Archivist/Account/Api.d.ts +18 -18
  2. package/dist/cjs/Archivist/Account/Api.js +14 -14
  3. package/dist/cjs/Archivist/Account/index.d.ts +1 -1
  4. package/dist/cjs/Archivist/Account/index.js +4 -4
  5. package/dist/cjs/Archivist/Api.d.ts +34 -34
  6. package/dist/cjs/Archivist/Api.js +68 -68
  7. package/dist/cjs/Archivist/Archive/Api.d.ts +18 -18
  8. package/dist/cjs/Archivist/Archive/Api.js +39 -39
  9. package/dist/cjs/Archivist/Archive/Schema/Api.d.ts +7 -7
  10. package/dist/cjs/Archivist/Archive/Schema/Api.js +14 -14
  11. package/dist/cjs/Archivist/Archive/Schema/index.d.ts +1 -1
  12. package/dist/cjs/Archivist/Archive/Schema/index.js +4 -4
  13. package/dist/cjs/Archivist/Archive/Schemas/Api.d.ts +6 -6
  14. package/dist/cjs/Archivist/Archive/Schemas/Api.js +13 -13
  15. package/dist/cjs/Archivist/Archive/Schemas/index.d.ts +1 -1
  16. package/dist/cjs/Archivist/Archive/Schemas/index.js +4 -4
  17. package/dist/cjs/Archivist/Archive/Settings/Api.d.ts +6 -6
  18. package/dist/cjs/Archivist/Archive/Settings/Api.js +14 -14
  19. package/dist/cjs/Archivist/Archive/Settings/Key/Api.d.ts +5 -5
  20. package/dist/cjs/Archivist/Archive/Settings/Key/Api.js +10 -10
  21. package/dist/cjs/Archivist/Archive/Settings/Key/index.d.ts +1 -1
  22. package/dist/cjs/Archivist/Archive/Settings/Key/index.js +4 -4
  23. package/dist/cjs/Archivist/Archive/Settings/index.d.ts +2 -2
  24. package/dist/cjs/Archivist/Archive/Settings/index.js +5 -5
  25. package/dist/cjs/Archivist/Archive/index.d.ts +4 -4
  26. package/dist/cjs/Archivist/Archive/index.js +7 -7
  27. package/dist/cjs/Archivist/Archives/Api.d.ts +8 -8
  28. package/dist/cjs/Archivist/Archives/Api.js +15 -15
  29. package/dist/cjs/Archivist/Archives/index.d.ts +1 -1
  30. package/dist/cjs/Archivist/Archives/index.js +4 -4
  31. package/dist/cjs/Archivist/Block/Api.d.ts +8 -8
  32. package/dist/cjs/Archivist/Block/Api.js +11 -11
  33. package/dist/cjs/Archivist/Block/index.d.ts +1 -1
  34. package/dist/cjs/Archivist/Block/index.js +4 -4
  35. package/dist/cjs/Archivist/Node/Api.d.ts +28 -20
  36. package/dist/cjs/Archivist/Node/Api.js +73 -56
  37. package/dist/cjs/Archivist/Node/Api.js.map +1 -1
  38. package/dist/cjs/Archivist/Node/index.d.ts +1 -1
  39. package/dist/cjs/Archivist/Node/index.js +4 -4
  40. package/dist/cjs/Archivist/Payload/Api.d.ts +40 -40
  41. package/dist/cjs/Archivist/Payload/Api.js +83 -83
  42. package/dist/cjs/Archivist/Payload/Schema/Api.d.ts +8 -8
  43. package/dist/cjs/Archivist/Payload/Schema/Api.js +13 -13
  44. package/dist/cjs/Archivist/Payload/Schema/index.d.ts +1 -1
  45. package/dist/cjs/Archivist/Payload/Schema/index.js +4 -4
  46. package/dist/cjs/Archivist/Payload/index.d.ts +2 -2
  47. package/dist/cjs/Archivist/Payload/index.js +5 -5
  48. package/dist/cjs/Archivist/index.d.ts +6 -6
  49. package/dist/cjs/Archivist/index.js +9 -9
  50. package/dist/cjs/Base.d.ts +33 -33
  51. package/dist/cjs/Base.js +146 -146
  52. package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApi.d.ts +11 -11
  53. package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApi.js +27 -27
  54. package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.d.ts +9 -9
  55. package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.js +23 -23
  56. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.d.ts +4 -4
  57. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.js +2 -2
  58. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.ts +11 -11
  59. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.js +9 -9
  60. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.ts +2 -2
  61. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.js +5 -5
  62. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.ts +11 -11
  63. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.js +9 -9
  64. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.ts +1 -1
  65. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.js +4 -4
  66. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts +17 -17
  67. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.js +2 -2
  68. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.ts +4 -4
  69. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.js +2 -2
  70. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.ts +5 -5
  71. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationQuerySchema.js +12 -12
  72. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.ts +7 -7
  73. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.js +2 -2
  74. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.ts +11 -11
  75. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.js +9 -9
  76. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.ts +2 -2
  77. package/dist/cjs/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.js +5 -5
  78. package/dist/cjs/Diviner/LocationDiviner/Queries/index.d.ts +6 -6
  79. package/dist/cjs/Diviner/LocationDiviner/Queries/index.js +9 -9
  80. package/dist/cjs/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.d.ts +13 -13
  81. package/dist/cjs/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.js +4 -4
  82. package/dist/cjs/Diviner/LocationDiviner/Witnesses/LocationWitness.d.ts +21 -21
  83. package/dist/cjs/Diviner/LocationDiviner/Witnesses/LocationWitness.js +4 -4
  84. package/dist/cjs/Diviner/LocationDiviner/Witnesses/index.d.ts +2 -2
  85. package/dist/cjs/Diviner/LocationDiviner/Witnesses/index.js +5 -5
  86. package/dist/cjs/Diviner/LocationDiviner/index.d.ts +4 -4
  87. package/dist/cjs/Diviner/LocationDiviner/index.js +7 -7
  88. package/dist/cjs/Diviner/LocationDiviner/models.d.ts +4 -4
  89. package/dist/cjs/Diviner/LocationDiviner/models.js +2 -2
  90. package/dist/cjs/Diviner/index.d.ts +1 -1
  91. package/dist/cjs/Diviner/index.js +4 -4
  92. package/dist/cjs/Simple.d.ts +21 -21
  93. package/dist/cjs/Simple.js +59 -59
  94. package/dist/cjs/Test/index.d.ts +2 -2
  95. package/dist/cjs/Test/index.js +5 -5
  96. package/dist/cjs/Test/testBoundWitness.d.ts +3 -3
  97. package/dist/cjs/Test/testBoundWitness.js +16 -16
  98. package/dist/cjs/Test/testPayload.d.ts +4 -4
  99. package/dist/cjs/Test/testPayload.js +18 -18
  100. package/dist/cjs/User/Api.d.ts +31 -31
  101. package/dist/cjs/User/Api.js +24 -24
  102. package/dist/cjs/User/index.d.ts +1 -1
  103. package/dist/cjs/User/index.js +4 -4
  104. package/dist/cjs/WithArchive.d.ts +3 -3
  105. package/dist/cjs/WithArchive.js +2 -2
  106. package/dist/cjs/index.d.ts +7 -7
  107. package/dist/cjs/index.js +10 -10
  108. package/dist/cjs/models/Api/Config.d.ts +24 -24
  109. package/dist/cjs/models/Api/Config.js +2 -2
  110. package/dist/cjs/models/Api/Envelope.d.ts +14 -14
  111. package/dist/cjs/models/Api/Envelope.js +2 -2
  112. package/dist/cjs/models/Api/Error.d.ts +4 -4
  113. package/dist/cjs/models/Api/Error.js +2 -2
  114. package/dist/cjs/models/Api/Reportable.d.ts +7 -7
  115. package/dist/cjs/models/Api/Reportable.js +2 -2
  116. package/dist/cjs/models/Api/Response.d.ts +7 -7
  117. package/dist/cjs/models/Api/Response.js +2 -2
  118. package/dist/cjs/models/Api/Warning.d.ts +1 -1
  119. package/dist/cjs/models/Api/Warning.js +2 -2
  120. package/dist/cjs/models/Api/index.d.ts +6 -6
  121. package/dist/cjs/models/Api/index.js +9 -9
  122. package/dist/cjs/models/Archive.d.ts +24 -24
  123. package/dist/cjs/models/Archive.js +2 -2
  124. package/dist/cjs/models/ArchiveKey.d.ts +5 -5
  125. package/dist/cjs/models/ArchiveKey.js +2 -2
  126. package/dist/cjs/models/ArchivePath.d.ts +3 -3
  127. package/dist/cjs/models/ArchivePath.js +2 -2
  128. package/dist/cjs/models/index.d.ts +4 -4
  129. package/dist/cjs/models/index.js +7 -7
  130. package/dist/cjs/objToQuery.d.ts +1 -1
  131. package/dist/cjs/objToQuery.js +12 -12
  132. package/dist/docs.json +1 -44449
  133. package/dist/esm/Archivist/Account/Api.d.ts +18 -18
  134. package/dist/esm/Archivist/Account/Api.js +16 -16
  135. package/dist/esm/Archivist/Account/index.d.ts +1 -1
  136. package/dist/esm/Archivist/Account/index.js +1 -1
  137. package/dist/esm/Archivist/Api.d.ts +34 -34
  138. package/dist/esm/Archivist/Api.js +82 -82
  139. package/dist/esm/Archivist/Archive/Api.d.ts +18 -18
  140. package/dist/esm/Archivist/Archive/Api.js +50 -50
  141. package/dist/esm/Archivist/Archive/Schema/Api.d.ts +7 -7
  142. package/dist/esm/Archivist/Archive/Schema/Api.js +13 -13
  143. package/dist/esm/Archivist/Archive/Schema/index.d.ts +1 -1
  144. package/dist/esm/Archivist/Archive/Schema/index.js +1 -1
  145. package/dist/esm/Archivist/Archive/Schemas/Api.d.ts +6 -6
  146. package/dist/esm/Archivist/Archive/Schemas/Api.js +12 -12
  147. package/dist/esm/Archivist/Archive/Schemas/index.d.ts +1 -1
  148. package/dist/esm/Archivist/Archive/Schemas/index.js +1 -1
  149. package/dist/esm/Archivist/Archive/Settings/Api.d.ts +6 -6
  150. package/dist/esm/Archivist/Archive/Settings/Api.js +13 -13
  151. package/dist/esm/Archivist/Archive/Settings/Key/Api.d.ts +5 -5
  152. package/dist/esm/Archivist/Archive/Settings/Key/Api.js +9 -9
  153. package/dist/esm/Archivist/Archive/Settings/Key/index.d.ts +1 -1
  154. package/dist/esm/Archivist/Archive/Settings/Key/index.js +1 -1
  155. package/dist/esm/Archivist/Archive/Settings/index.d.ts +2 -2
  156. package/dist/esm/Archivist/Archive/Settings/index.js +2 -2
  157. package/dist/esm/Archivist/Archive/index.d.ts +4 -4
  158. package/dist/esm/Archivist/Archive/index.js +4 -4
  159. package/dist/esm/Archivist/Archives/Api.d.ts +8 -8
  160. package/dist/esm/Archivist/Archives/Api.js +14 -14
  161. package/dist/esm/Archivist/Archives/index.d.ts +1 -1
  162. package/dist/esm/Archivist/Archives/index.js +1 -1
  163. package/dist/esm/Archivist/Block/Api.d.ts +8 -8
  164. package/dist/esm/Archivist/Block/Api.js +10 -10
  165. package/dist/esm/Archivist/Block/index.d.ts +1 -1
  166. package/dist/esm/Archivist/Block/index.js +1 -1
  167. package/dist/esm/Archivist/Node/Api.d.ts +28 -20
  168. package/dist/esm/Archivist/Node/Api.js +66 -52
  169. package/dist/esm/Archivist/Node/Api.js.map +1 -1
  170. package/dist/esm/Archivist/Node/index.d.ts +1 -1
  171. package/dist/esm/Archivist/Node/index.js +1 -1
  172. package/dist/esm/Archivist/Payload/Api.d.ts +40 -40
  173. package/dist/esm/Archivist/Payload/Api.js +67 -67
  174. package/dist/esm/Archivist/Payload/Schema/Api.d.ts +8 -8
  175. package/dist/esm/Archivist/Payload/Schema/Api.js +12 -12
  176. package/dist/esm/Archivist/Payload/Schema/index.d.ts +1 -1
  177. package/dist/esm/Archivist/Payload/Schema/index.js +1 -1
  178. package/dist/esm/Archivist/Payload/index.d.ts +2 -2
  179. package/dist/esm/Archivist/Payload/index.js +2 -2
  180. package/dist/esm/Archivist/index.d.ts +6 -6
  181. package/dist/esm/Archivist/index.js +6 -6
  182. package/dist/esm/Base.d.ts +33 -33
  183. package/dist/esm/Base.js +128 -128
  184. package/dist/esm/Diviner/LocationDiviner/LocationDivinerApi.d.ts +11 -11
  185. package/dist/esm/Diviner/LocationDiviner/LocationDivinerApi.js +19 -19
  186. package/dist/esm/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.d.ts +9 -9
  187. package/dist/esm/Diviner/LocationDiviner/LocationDivinerApiResponseTransformer.js +17 -17
  188. package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.d.ts +4 -4
  189. package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapPointProperties.js +1 -1
  190. package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.d.ts +11 -11
  191. package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/LocationHeatmapQuery.js +5 -5
  192. package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.d.ts +2 -2
  193. package/dist/esm/Diviner/LocationDiviner/Queries/LocationHeatmapQuery/index.js +2 -2
  194. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.d.ts +11 -11
  195. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/LocationQuadkeyHeatmapQuery.js +5 -5
  196. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.d.ts +1 -1
  197. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuadkeyHeatmapQuery/index.js +1 -1
  198. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts +17 -17
  199. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.js +1 -1
  200. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.d.ts +4 -4
  201. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQueryCreationResponse.js +1 -1
  202. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuerySchema.d.ts +5 -5
  203. package/dist/esm/Diviner/LocationDiviner/Queries/LocationQuerySchema.js +8 -8
  204. package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.d.ts +7 -7
  205. package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangePointProperties.js +1 -1
  206. package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.d.ts +11 -11
  207. package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/LocationTimeRangeQuery.js +5 -5
  208. package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.d.ts +2 -2
  209. package/dist/esm/Diviner/LocationDiviner/Queries/LocationTimeRangeQuery/index.js +2 -2
  210. package/dist/esm/Diviner/LocationDiviner/Queries/index.d.ts +6 -6
  211. package/dist/esm/Diviner/LocationDiviner/Queries/index.js +6 -6
  212. package/dist/esm/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.d.ts +13 -13
  213. package/dist/esm/Diviner/LocationDiviner/Witnesses/CurrentLocationWitness.js +1 -1
  214. package/dist/esm/Diviner/LocationDiviner/Witnesses/LocationWitness.d.ts +21 -21
  215. package/dist/esm/Diviner/LocationDiviner/Witnesses/LocationWitness.js +1 -1
  216. package/dist/esm/Diviner/LocationDiviner/Witnesses/index.d.ts +2 -2
  217. package/dist/esm/Diviner/LocationDiviner/Witnesses/index.js +2 -2
  218. package/dist/esm/Diviner/LocationDiviner/index.d.ts +4 -4
  219. package/dist/esm/Diviner/LocationDiviner/index.js +4 -4
  220. package/dist/esm/Diviner/LocationDiviner/models.d.ts +4 -4
  221. package/dist/esm/Diviner/LocationDiviner/models.js +1 -1
  222. package/dist/esm/Diviner/index.d.ts +1 -1
  223. package/dist/esm/Diviner/index.js +1 -1
  224. package/dist/esm/Simple.d.ts +21 -21
  225. package/dist/esm/Simple.js +44 -44
  226. package/dist/esm/Test/index.d.ts +2 -2
  227. package/dist/esm/Test/index.js +2 -2
  228. package/dist/esm/Test/testBoundWitness.d.ts +3 -3
  229. package/dist/esm/Test/testBoundWitness.js +13 -13
  230. package/dist/esm/Test/testPayload.d.ts +4 -4
  231. package/dist/esm/Test/testPayload.js +14 -14
  232. package/dist/esm/User/Api.d.ts +31 -31
  233. package/dist/esm/User/Api.js +26 -26
  234. package/dist/esm/User/index.d.ts +1 -1
  235. package/dist/esm/User/index.js +1 -1
  236. package/dist/esm/WithArchive.d.ts +3 -3
  237. package/dist/esm/WithArchive.js +1 -1
  238. package/dist/esm/index.d.ts +7 -7
  239. package/dist/esm/index.js +7 -7
  240. package/dist/esm/models/Api/Config.d.ts +24 -24
  241. package/dist/esm/models/Api/Config.js +1 -1
  242. package/dist/esm/models/Api/Envelope.d.ts +14 -14
  243. package/dist/esm/models/Api/Envelope.js +1 -1
  244. package/dist/esm/models/Api/Error.d.ts +4 -4
  245. package/dist/esm/models/Api/Error.js +1 -1
  246. package/dist/esm/models/Api/Reportable.d.ts +7 -7
  247. package/dist/esm/models/Api/Reportable.js +1 -1
  248. package/dist/esm/models/Api/Response.d.ts +7 -7
  249. package/dist/esm/models/Api/Response.js +1 -1
  250. package/dist/esm/models/Api/Warning.d.ts +1 -1
  251. package/dist/esm/models/Api/Warning.js +1 -1
  252. package/dist/esm/models/Api/index.d.ts +6 -6
  253. package/dist/esm/models/Api/index.js +6 -6
  254. package/dist/esm/models/Archive.d.ts +24 -24
  255. package/dist/esm/models/Archive.js +1 -1
  256. package/dist/esm/models/ArchiveKey.d.ts +5 -5
  257. package/dist/esm/models/ArchiveKey.js +1 -1
  258. package/dist/esm/models/ArchivePath.d.ts +3 -3
  259. package/dist/esm/models/ArchivePath.js +1 -1
  260. package/dist/esm/models/index.d.ts +4 -4
  261. package/dist/esm/models/index.js +4 -4
  262. package/dist/esm/objToQuery.d.ts +1 -1
  263. package/dist/esm/objToQuery.js +8 -8
  264. package/package.json +7 -16
  265. package/src/Archivist/ApiUtil.spec.ts +7 -1
  266. package/src/Archivist/Node/Api.spec.ts +14 -6
  267. package/src/Archivist/Node/Api.ts +18 -4
  268. package/src/Archivist/Payload/Api.spec.ts +8 -5
@@ -1,27 +1,27 @@
1
- import { XyoApiBase } from '../Base';
2
- import { XyoApiSimple } from '../Simple';
3
- export class XyoUserApi extends XyoApiBase {
4
- get authenticated() {
5
- return !!this.config.jwtToken;
6
- }
7
- get headers() {
8
- const headers = {};
9
- if (this.config.jwtToken) {
10
- headers.Authorization = `Bearer ${this.config.jwtToken}`;
11
- }
12
- return headers;
13
- }
14
- get login() {
15
- return new XyoApiSimple({
16
- ...this.config,
17
- root: `${this.root}login/`,
18
- });
19
- }
20
- get profile() {
21
- return new XyoApiSimple({
22
- ...this.config,
23
- root: `${this.root}profile/`,
24
- });
25
- }
26
- }
1
+ import { XyoApiBase } from '../Base';
2
+ import { XyoApiSimple } from '../Simple';
3
+ export class XyoUserApi extends XyoApiBase {
4
+ get authenticated() {
5
+ return !!this.config.jwtToken;
6
+ }
7
+ get headers() {
8
+ const headers = {};
9
+ if (this.config.jwtToken) {
10
+ headers.Authorization = `Bearer ${this.config.jwtToken}`;
11
+ }
12
+ return headers;
13
+ }
14
+ get login() {
15
+ return new XyoApiSimple({
16
+ ...this.config,
17
+ root: `${this.root}login/`,
18
+ });
19
+ }
20
+ get profile() {
21
+ return new XyoApiSimple({
22
+ ...this.config,
23
+ root: `${this.root}profile/`,
24
+ });
25
+ }
26
+ }
27
27
  //# sourceMappingURL=Api.js.map
@@ -1 +1 @@
1
- export * from './Api';
1
+ export * from './Api';
@@ -1,2 +1,2 @@
1
- export * from './Api';
1
+ export * from './Api';
2
2
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
- export declare type WithArchive<XyoArchivistApiConfig> = XyoArchivistApiConfig & {
2
- _archive?: string;
3
- };
1
+ export declare type WithArchive<XyoArchivistApiConfig> = XyoArchivistApiConfig & {
2
+ _archive?: string;
3
+ };
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=WithArchive.js.map
@@ -1,7 +1,7 @@
1
- export * from './Archivist';
2
- export * from './Base';
3
- export * from './Diviner';
4
- export * from './models';
5
- export * from './Simple';
6
- export * from './User';
7
- export * from './WithArchive';
1
+ export * from './Archivist';
2
+ export * from './Base';
3
+ export * from './Diviner';
4
+ export * from './models';
5
+ export * from './Simple';
6
+ export * from './User';
7
+ export * from './WithArchive';
package/dist/esm/index.js CHANGED
@@ -1,8 +1,8 @@
1
- export * from './Archivist';
2
- export * from './Base';
3
- export * from './Diviner';
4
- export * from './models';
5
- export * from './Simple';
6
- export * from './User';
7
- export * from './WithArchive';
1
+ export * from './Archivist';
2
+ export * from './Base';
3
+ export * from './Diviner';
4
+ export * from './models';
5
+ export * from './Simple';
6
+ export * from './User';
7
+ export * from './WithArchive';
8
8
  //# sourceMappingURL=index.js.map
@@ -1,24 +1,24 @@
1
- import { XyoApiReportable } from './Reportable';
2
- interface XyoApiConfig extends XyoApiReportable {
3
- /** @description The domain where the api is located */
4
- apiDomain: string;
5
- /** @deprecated use the jwtToken instead*/
6
- userid?: string;
7
- /** @description The jwtToken of the currently logged in user */
8
- jwtToken?: string;
9
- /** @description The apiKey used for authentication */
10
- apiKey?: string;
11
- /** @description The location in the API tree where this API object is mounted */
12
- root?: string;
13
- /** @description The query string, if any, that is added to the end of every request */
14
- query?: string;
15
- /** @description Threshold for Content-Size to cause automatic gzip of request body [default = 1024] */
16
- compressionThreshold?: number;
17
- /** @description Throw on failures */
18
- throwFailure?: boolean;
19
- /** @description Throw on error */
20
- throwError?: boolean;
21
- /** @description Parent that should also report events from this api */
22
- reportableParent?: XyoApiReportable;
23
- }
24
- export type { XyoApiConfig };
1
+ import { XyoApiReportable } from './Reportable';
2
+ interface XyoApiConfig extends XyoApiReportable {
3
+ /** @description The domain where the api is located */
4
+ apiDomain: string;
5
+ /** @deprecated use the jwtToken instead*/
6
+ userid?: string;
7
+ /** @description The jwtToken of the currently logged in user */
8
+ jwtToken?: string;
9
+ /** @description The apiKey used for authentication */
10
+ apiKey?: string;
11
+ /** @description The location in the API tree where this API object is mounted */
12
+ root?: string;
13
+ /** @description The query string, if any, that is added to the end of every request */
14
+ query?: string;
15
+ /** @description Threshold for Content-Size to cause automatic gzip of request body [default = 1024] */
16
+ compressionThreshold?: number;
17
+ /** @description Throw on failures */
18
+ throwFailure?: boolean;
19
+ /** @description Throw on error */
20
+ throwError?: boolean;
21
+ /** @description Parent that should also report events from this api */
22
+ reportableParent?: XyoApiReportable;
23
+ }
24
+ export type { XyoApiConfig };
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=Config.js.map
@@ -1,14 +1,14 @@
1
- import { XyoApiError } from './Error';
2
- import { XyoApiWarning } from './Warning';
3
- export interface XyoApiEnvelopeBase {
4
- warning?: XyoApiWarning[];
5
- }
6
- export interface XyoApiEnvelopeSuccess<T> extends XyoApiEnvelopeBase {
7
- data: T;
8
- error: never;
9
- }
10
- export interface XyoApiEnvelopeError extends XyoApiEnvelopeBase {
11
- data: never;
12
- error: XyoApiError[];
13
- }
14
- export declare type XyoApiEnvelope<T> = XyoApiEnvelopeSuccess<T> | XyoApiEnvelopeError;
1
+ import { XyoApiError } from './Error';
2
+ import { XyoApiWarning } from './Warning';
3
+ export interface XyoApiEnvelopeBase {
4
+ warning?: XyoApiWarning[];
5
+ }
6
+ export interface XyoApiEnvelopeSuccess<T> extends XyoApiEnvelopeBase {
7
+ data: T;
8
+ error: never;
9
+ }
10
+ export interface XyoApiEnvelopeError extends XyoApiEnvelopeBase {
11
+ data: never;
12
+ error: XyoApiError[];
13
+ }
14
+ export declare type XyoApiEnvelope<T> = XyoApiEnvelopeSuccess<T> | XyoApiEnvelopeError;
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=Envelope.js.map
@@ -1,4 +1,4 @@
1
- import { AxiosError } from 'axios';
2
- export interface XyoApiError<T = any, D = any> extends AxiosError<T, D> {
3
- isXyoError: true;
4
- }
1
+ import { AxiosError } from 'axios';
2
+ export interface XyoApiError<T = any, D = any> extends AxiosError<T, D> {
3
+ isXyoError: true;
4
+ }
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=Error.js.map
@@ -1,7 +1,7 @@
1
- import { XyoApiError } from './Error';
2
- import { XyoApiResponse } from './Response';
3
- export interface XyoApiReportable {
4
- onError?: (error: XyoApiError, depth: number) => void;
5
- onFailure?: (response: XyoApiResponse, depth: number) => void;
6
- onSuccess?: (response: XyoApiResponse, depth: number) => void;
7
- }
1
+ import { XyoApiError } from './Error';
2
+ import { XyoApiResponse } from './Response';
3
+ export interface XyoApiReportable {
4
+ onError?: (error: XyoApiError, depth: number) => void;
5
+ onFailure?: (response: XyoApiResponse, depth: number) => void;
6
+ onSuccess?: (response: XyoApiResponse, depth: number) => void;
7
+ }
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=Reportable.js.map
@@ -1,7 +1,7 @@
1
- import { AxiosResponse } from 'axios';
2
- import { XyoApiEnvelope } from './Envelope';
3
- export declare type XyoApiResponse<T = unknown, D = unknown> = AxiosResponse<T, D>;
4
- export declare type XyoApiResponseBody<T> = T | undefined;
5
- export declare type XyoApiResponseTuple<T> = [T | undefined, XyoApiEnvelope<T | undefined>, XyoApiResponse<XyoApiEnvelope<T | undefined>>];
6
- export declare type XyoApiResponseTupleOrBody<T> = XyoApiResponseTuple<T> | XyoApiResponseBody<T>;
7
- export declare type XyoApiResponseType = 'body' | 'tuple';
1
+ import { AxiosResponse } from 'axios';
2
+ import { XyoApiEnvelope } from './Envelope';
3
+ export declare type XyoApiResponse<T = unknown, D = unknown> = AxiosResponse<T, D>;
4
+ export declare type XyoApiResponseBody<T> = T | undefined;
5
+ export declare type XyoApiResponseTuple<T> = [T | undefined, XyoApiEnvelope<T | undefined>, XyoApiResponse<XyoApiEnvelope<T | undefined>>];
6
+ export declare type XyoApiResponseTupleOrBody<T> = XyoApiResponseTuple<T> | XyoApiResponseBody<T>;
7
+ export declare type XyoApiResponseType = 'body' | 'tuple';
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=Response.js.map
@@ -1 +1 @@
1
- export declare type XyoApiWarning = Error;
1
+ export declare type XyoApiWarning = Error;
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=Warning.js.map
@@ -1,6 +1,6 @@
1
- export * from './Config';
2
- export * from './Envelope';
3
- export * from './Error';
4
- export * from './Reportable';
5
- export * from './Response';
6
- export * from './Warning';
1
+ export * from './Config';
2
+ export * from './Envelope';
3
+ export * from './Error';
4
+ export * from './Reportable';
5
+ export * from './Response';
6
+ export * from './Warning';
@@ -1,7 +1,7 @@
1
- export * from './Config';
2
- export * from './Envelope';
3
- export * from './Error';
4
- export * from './Reportable';
5
- export * from './Response';
6
- export * from './Warning';
1
+ export * from './Config';
2
+ export * from './Envelope';
3
+ export * from './Error';
4
+ export * from './Reportable';
5
+ export * from './Response';
6
+ export * from './Warning';
7
7
  //# sourceMappingURL=index.js.map
@@ -1,24 +1,24 @@
1
- import { XyoArchivePath } from './ArchivePath';
2
- export declare type AccessLevel = 'public' | 'private' | 'none';
3
- export declare type AccessType = 'read' | 'remove' | 'create' | 'list';
4
- export declare type ExpirationWindow = 'create' | 'read';
5
- export interface XyoAccessControl {
6
- access?: Record<AccessType, AccessLevel>;
7
- expiration?: {
8
- window?: ExpirationWindow;
9
- delay?: number;
10
- };
11
- }
12
- export interface XyoAccessControls {
13
- /**
14
- * Set access controls on a per schema basis.
15
- * '*' can be used as a wildcard
16
- * Access control is set from a generic to specific direction if
17
- * multiple wildcard versions apply to a schema
18
- */
19
- schema?: Record<string, XyoAccessControl>;
20
- }
21
- export interface XyoArchive extends XyoArchivePath {
22
- user?: string;
23
- accessControl?: XyoAccessControl | boolean;
24
- }
1
+ import { XyoArchivePath } from './ArchivePath';
2
+ export declare type AccessLevel = 'public' | 'private' | 'none';
3
+ export declare type AccessType = 'read' | 'remove' | 'create' | 'list';
4
+ export declare type ExpirationWindow = 'create' | 'read';
5
+ export interface XyoAccessControl {
6
+ access?: Record<AccessType, AccessLevel>;
7
+ expiration?: {
8
+ window?: ExpirationWindow;
9
+ delay?: number;
10
+ };
11
+ }
12
+ export interface XyoAccessControls {
13
+ /**
14
+ * Set access controls on a per schema basis.
15
+ * '*' can be used as a wildcard
16
+ * Access control is set from a generic to specific direction if
17
+ * multiple wildcard versions apply to a schema
18
+ */
19
+ schema?: Record<string, XyoAccessControl>;
20
+ }
21
+ export interface XyoArchive extends XyoArchivePath {
22
+ user?: string;
23
+ accessControl?: XyoAccessControl | boolean;
24
+ }
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=Archive.js.map
@@ -1,5 +1,5 @@
1
- export interface XyoArchiveKey {
2
- archive: string;
3
- created?: number;
4
- key: string;
5
- }
1
+ export interface XyoArchiveKey {
2
+ archive: string;
3
+ created?: number;
4
+ key: string;
5
+ }
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=ArchiveKey.js.map
@@ -1,3 +1,3 @@
1
- export interface XyoArchivePath {
2
- archive: string;
3
- }
1
+ export interface XyoArchivePath {
2
+ archive: string;
3
+ }
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=ArchivePath.js.map
@@ -1,4 +1,4 @@
1
- export * from './Api';
2
- export * from './Archive';
3
- export * from './ArchiveKey';
4
- export * from './ArchivePath';
1
+ export * from './Api';
2
+ export * from './Archive';
3
+ export * from './ArchiveKey';
4
+ export * from './ArchivePath';
@@ -1,5 +1,5 @@
1
- export * from './Api';
2
- export * from './Archive';
3
- export * from './ArchiveKey';
4
- export * from './ArchivePath';
1
+ export * from './Api';
2
+ export * from './Archive';
3
+ export * from './ArchiveKey';
4
+ export * from './ArchivePath';
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- export declare const objToQuery: (obj: Record<string, string | number | undefined>) => string;
1
+ export declare const objToQuery: (obj: Record<string, string | number | undefined>) => string;
@@ -1,9 +1,9 @@
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
- };
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
9
  //# sourceMappingURL=objToQuery.js.map
package/package.json CHANGED
@@ -9,26 +9,21 @@
9
9
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
10
10
  },
11
11
  "dependencies": {
12
- "@xylabs/sdk-js": "^2.5.7",
13
- "@xyo-network/core": "^2.20.44",
12
+ "@xylabs/sdk-js": "^2.5.9",
13
+ "@xyo-network/core": "^2.20.47",
14
14
  "axios": "^0.27.2",
15
15
  "pako": "^2.0.4",
16
16
  "uuid": "^8.3.2"
17
17
  },
18
18
  "description": "Primary SDK for using XYO Protocol 2.0",
19
19
  "devDependencies": {
20
- "@babel/core": "^7.18.2",
21
- "@babel/preset-env": "^7.18.2",
20
+ "@ethersproject/wallet": "^5.6.2",
22
21
  "@types/pako": "^2.0.0",
23
22
  "@types/uuid": "^8.3.4",
24
- "@xylabs/eslint-config": "^2.3.22",
25
- "@xylabs/ts-scripts": "^1.0.66",
26
- "@xylabs/tsconfig": "^1.0.13",
23
+ "@xylabs/tsconfig": "^1.0.14",
27
24
  "dotenv": "^16.0.1",
28
- "ethers": "^5.6.8",
29
- "license-checker": "^25.0.1",
30
- "tslib": "^2.4.0",
31
- "typescript": "^4.7.3"
25
+ "ethers": "^5.6.9",
26
+ "tslib": "^2.4.0"
32
27
  },
33
28
  "browser": "dist/esm/index.js",
34
29
  "docs": "dist/docs.json",
@@ -61,12 +56,8 @@
61
56
  "type": "git",
62
57
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
63
58
  },
64
- "scripts": {
65
- "lint-pkg": "npmPkgJsonLint .",
66
- "license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\""
67
- },
68
59
  "sideEffects": true,
69
60
  "types": "dist/esm/index.d.ts",
70
- "version": "2.20.44",
61
+ "version": "2.20.47",
71
62
  "packageManager": "yarn@3.1.1"
72
63
  }
@@ -1,5 +1,5 @@
1
+ import { Wallet } from '@ethersproject/wallet'
1
2
  import { XyoAccount } from '@xyo-network/core'
2
- import { Wallet } from 'ethers'
3
3
  import { v4 } from 'uuid'
4
4
 
5
5
  import { XyoArchivistApi } from './Api'
@@ -35,3 +35,9 @@ export const testSchemaPrefix = 'network.xyo.schema.test.'
35
35
  export const getSchemaName = (): string => {
36
36
  return `${testSchemaPrefix}${v4()}`
37
37
  }
38
+
39
+ export const getTimestampMinutesFromNow = (minutes = 0) => {
40
+ const t = new Date()
41
+ t.setMinutes(t.getMinutes() + minutes)
42
+ return +t
43
+ }
@@ -58,7 +58,7 @@ describe('XyoArchivistNodeApi', () => {
58
58
  beforeEach(async () => {
59
59
  id = await issueQuery()
60
60
  })
61
- it('returns the query result', async () => {
61
+ it.skip('returns the query result', async () => {
62
62
  const api = new XyoArchivistApi(config)
63
63
  await delay(1000)
64
64
  const [_, payload, response] = await api.node().result(id).get('tuple')
@@ -84,13 +84,21 @@ describe('XyoArchivistNodeApi', () => {
84
84
  })
85
85
  })
86
86
  })
87
- describe('perform', () => {
87
+ describe.skip('perform', () => {
88
+ it('creates and issues the query and returns the result', async () => {
89
+ const api = new XyoArchivistApi(config)
90
+ const response = await api.node().perform({ nonce: v4() }, schema)
91
+ expect(response).toBeDefined()
92
+ expect((response as unknown as XyoPayload).schema).toBe(schema)
93
+ })
94
+ })
95
+ describe.skip('performTransaction', () => {
88
96
  describe('with a single BoundWitness', () => {
89
97
  describe('with a single Payload', () => {
90
98
  it('issues the query and returns the result', async () => {
91
99
  const api = new XyoArchivistApi(config)
92
100
  const query = [getQuery()]
93
- const response = await api.node().perform(query)
101
+ const response = await api.node().performTransaction(query)
94
102
  expect(response).toBeDefined()
95
103
  expect(Array.isArray(response)).toBeTruthy()
96
104
  expect(validateAllResponseSchemas(response)).toBeTruthy()
@@ -100,7 +108,7 @@ describe('XyoArchivistNodeApi', () => {
100
108
  it('issues the query and returns the result', async () => {
101
109
  const api = new XyoArchivistApi(config)
102
110
  const query = [getQuery(2)]
103
- const response = await api.node().perform(query)
111
+ const response = await api.node().performTransaction(query)
104
112
  expect(response).toBeDefined()
105
113
  expect(Array.isArray(response)).toBeTruthy()
106
114
  expect(validateAllResponseSchemas(response)).toBeTruthy()
@@ -112,7 +120,7 @@ describe('XyoArchivistNodeApi', () => {
112
120
  it('issues the query and returns the result', async () => {
113
121
  const api = new XyoArchivistApi(config)
114
122
  const query = [getQuery(), getQuery()]
115
- const response = await api.node().perform(query)
123
+ const response = await api.node().performTransaction(query)
116
124
  expect(response).toBeDefined()
117
125
  expect(Array.isArray(response)).toBeTruthy()
118
126
  expect(validateAllResponseSchemas(response)).toBeTruthy()
@@ -122,7 +130,7 @@ describe('XyoArchivistNodeApi', () => {
122
130
  it('issues the query and returns the result', async () => {
123
131
  const api = new XyoArchivistApi(config)
124
132
  const query = [getQuery(2), getQuery(2)]
125
- const response = await api.node().perform(query)
133
+ const response = await api.node().performTransaction(query)
126
134
  expect(response).toBeDefined()
127
135
  expect(Array.isArray(response)).toBeTruthy()
128
136
  expect(validateAllResponseSchemas(response)).toBeTruthy()
@@ -1,5 +1,5 @@
1
1
  import { assertEx, delay } from '@xylabs/sdk-js'
2
- import { XyoBoundWitness, XyoPayload } from '@xyo-network/core'
2
+ import { XyoBoundWitness, XyoBoundWitnessBuilder, XyoPayload, XyoPayloadBuilder } from '@xyo-network/core'
3
3
 
4
4
  import { XyoApiConfig, XyoApiResponseTuple } from '../../models'
5
5
  import { XyoApiSimple, XyoApiSimpleQuery } from '../../Simple'
@@ -36,11 +36,11 @@ export class XyoArchivistNodeApi<
36
36
  /**
37
37
  * Issue the supplied queries and wait (non-blocking) for the results
38
38
  * @param data The queries to issue
39
- * @param timeout
40
- * @param retryInterval
39
+ * @param timeout The max time to wait for the query results
40
+ * @param retryInterval The interval to poll for query results
41
41
  * @returns The results for the issued queries
42
42
  */
43
- public async perform(data: D, timeout = 5000, retryInterval = 100) {
43
+ public async performTransaction(data: D, timeout = 5000, retryInterval = 100) {
44
44
  assertEx(timeout > 0, 'timeout must be positive')
45
45
  assertEx(retryInterval > 0, 'retryInterval must be positive')
46
46
  assertEx(timeout > retryInterval, 'timeout must be greater than retryInterval')
@@ -58,4 +58,18 @@ export class XyoArchivistNodeApi<
58
58
  // Unpack results
59
59
  return results.map((b) => b.map((p) => p[1]))
60
60
  }
61
+
62
+ /**
63
+ * Issue the supplied query and wait (non-blocking) for the result
64
+ * @param data The query to issue
65
+ * @param timeout The max time to wait for the query results
66
+ * @param retryInterval The interval to poll for query results
67
+ * @returns The result for the issued query
68
+ */
69
+ public async perform<T>(data: T, schema: string, timeout = 5000, retryInterval = 100) {
70
+ const payload = new XyoPayloadBuilder({ schema }).fields(data).build()
71
+ const query = new XyoBoundWitnessBuilder({ inlinePayloads: true }).payload(payload).build() as D
72
+ const result = await this.performTransaction(query, timeout, retryInterval)
73
+ return result?.[0]?.[0]
74
+ }
61
75
  }
@@ -3,7 +3,7 @@ import { config } from 'dotenv'
3
3
 
4
4
  import { XyoApiConfig, XyoApiError } from '../../models'
5
5
  import { XyoArchivistApi } from '../Api'
6
- import { getNewArchive } from '../ApiUtil.spec'
6
+ import { getNewArchive, getTimestampMinutesFromNow } from '../ApiUtil.spec'
7
7
 
8
8
  config()
9
9
 
@@ -20,13 +20,15 @@ describe('XyoArchivistPayloadApi', () => {
20
20
  let archive = ''
21
21
  beforeEach(async () => {
22
22
  archive = await getNewArchive(api)
23
+ expect(archive).toBeTruthy()
23
24
  })
24
25
  describe('when order is ascending', () => {
25
26
  it('returns payloads greater than or equal to timestamp', async () => {
26
27
  try {
27
- const timestamp = Date.now()
28
+ const timestamp = getTimestampMinutesFromNow(-1)
28
29
  const boundWitness = new XyoBoundWitnessBuilder().witness(XyoAccount.random()).build()
29
- await api.archive(archive).block.post([boundWitness])
30
+ const blockResult = await api.archive(archive).block.post([boundWitness])
31
+ expect(blockResult?.length).toBe(1)
30
32
  const response = await api.archive(archive).block.find({ order: 'asc', timestamp })
31
33
  expect(response?.length).toBe(1)
32
34
  const actual = response?.[0]
@@ -43,8 +45,9 @@ describe('XyoArchivistPayloadApi', () => {
43
45
  it('returns payloads less than or equal to timestamp', async () => {
44
46
  try {
45
47
  const boundWitness = new XyoBoundWitnessBuilder().witness(XyoAccount.random()).build()
46
- await api.archive(archive).block.post([boundWitness])
47
- const timestamp = Date.now()
48
+ const blockResult = await api.archive(archive).block.post([boundWitness])
49
+ expect(blockResult?.length).toBe(1)
50
+ const timestamp = getTimestampMinutesFromNow(1)
48
51
  const response = await api.archive(archive).block.find({ order: 'desc', timestamp })
49
52
  expect(response?.length).toBe(1)
50
53
  const actual = response?.[0]