@api-client/core 0.3.11 → 0.4.1

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 (356) hide show
  1. package/build/browser.d.ts +10 -8
  2. package/build/browser.js +11 -7
  3. package/build/browser.js.map +1 -1
  4. package/build/index.d.ts +12 -11
  5. package/build/index.js +9 -9
  6. package/build/index.js.map +1 -1
  7. package/build/src/data/JmesparthReader.d.ts +1 -1
  8. package/build/src/data/JmesparthReader.js +1 -1
  9. package/build/src/events/models/ProjectEvents.d.ts +1 -1
  10. package/build/src/events/models/ProjectEvents.js +1 -2
  11. package/build/src/events/models/ProjectEvents.js.map +1 -1
  12. package/build/src/lib/transformers/PayloadSerializer.d.ts +2 -2
  13. package/build/src/lib/transformers/PayloadSerializer.js +3 -3
  14. package/build/src/lib/transformers/PayloadSerializer.js.map +1 -1
  15. package/build/src/mocking/ProjectMock.d.ts +7 -1
  16. package/build/src/mocking/ProjectMock.js +6 -0
  17. package/build/src/mocking/ProjectMock.js.map +1 -1
  18. package/build/src/mocking/lib/History.d.ts +70 -0
  19. package/build/src/mocking/lib/History.js +120 -0
  20. package/build/src/mocking/lib/History.js.map +1 -0
  21. package/build/src/mocking/lib/Request.d.ts +2 -2
  22. package/build/src/mocking/lib/Request.js +3 -2
  23. package/build/src/mocking/lib/Request.js.map +1 -1
  24. package/build/src/mocking/lib/Response.d.ts +6 -6
  25. package/build/src/mocking/lib/Response.js +6 -6
  26. package/build/src/mocking/lib/Response.js.map +1 -1
  27. package/build/src/mocking/lib/User.d.ts +20 -0
  28. package/build/src/mocking/lib/User.js +54 -0
  29. package/build/src/mocking/lib/User.js.map +1 -0
  30. package/build/src/models/AuthorizationData.d.ts +2 -2
  31. package/build/src/models/AuthorizationData.js +2 -2
  32. package/build/src/models/Backend.d.ts +85 -0
  33. package/build/src/models/ClientCertificate.d.ts +1 -1
  34. package/build/src/models/Environment.d.ts +3 -3
  35. package/build/src/models/Environment.js +3 -3
  36. package/build/src/models/Environment.js.map +1 -1
  37. package/build/src/models/ErrorResponse.d.ts +1 -1
  38. package/build/src/models/ErrorResponse.js +1 -1
  39. package/build/src/models/HostRule.d.ts +4 -4
  40. package/build/src/models/HostRule.js +4 -4
  41. package/build/src/models/HostRule.js.map +1 -1
  42. package/build/src/models/HttpHistory.d.ts +64 -18
  43. package/build/src/models/HttpHistory.js +43 -19
  44. package/build/src/models/HttpHistory.js.map +1 -1
  45. package/build/src/models/HttpProject.d.ts +4 -5
  46. package/build/src/models/HttpProject.js +3 -3
  47. package/build/src/models/HttpProject.js.map +1 -1
  48. package/build/src/models/HttpProjectListItem.d.ts +1 -1
  49. package/build/src/models/HttpProjectListItem.js +1 -1
  50. package/build/src/models/HttpProjectListItem.js.map +1 -1
  51. package/build/src/models/HttpRequest.d.ts +2 -2
  52. package/build/src/models/HttpRequest.js +2 -2
  53. package/build/src/models/HttpRequest.js.map +1 -1
  54. package/build/src/models/HttpResponse.d.ts +2 -2
  55. package/build/src/models/HttpResponse.js +3 -3
  56. package/build/src/models/HttpResponse.js.map +1 -1
  57. package/build/src/models/License.d.ts +3 -3
  58. package/build/src/models/License.js +3 -3
  59. package/build/src/models/License.js.map +1 -1
  60. package/build/src/models/ProjectFolder.d.ts +2 -2
  61. package/build/src/models/ProjectFolder.js +3 -3
  62. package/build/src/models/ProjectFolder.js.map +1 -1
  63. package/build/src/models/ProjectItem.d.ts +1 -1
  64. package/build/src/models/ProjectItem.js +2 -2
  65. package/build/src/models/ProjectItem.js.map +1 -1
  66. package/build/src/models/ProjectRequest.d.ts +2 -2
  67. package/build/src/models/ProjectRequest.js +1 -1
  68. package/build/src/models/ProjectRequest.js.map +1 -1
  69. package/build/src/models/ProjectSchema.d.ts +2 -2
  70. package/build/src/models/ProjectSchema.js +1 -1
  71. package/build/src/models/ProjectSchema.js.map +1 -1
  72. package/build/src/models/Property.d.ts +4 -4
  73. package/build/src/models/Property.js +4 -4
  74. package/build/src/models/Property.js.map +1 -1
  75. package/build/src/models/Provider.d.ts +3 -3
  76. package/build/src/models/Provider.js +3 -3
  77. package/build/src/models/Provider.js.map +1 -1
  78. package/build/src/models/Request.d.ts +2 -2
  79. package/build/src/models/Request.js +3 -3
  80. package/build/src/models/Request.js.map +1 -1
  81. package/build/src/models/RequestActions.d.ts +2 -4
  82. package/build/src/models/RequestActions.js +2 -4
  83. package/build/src/models/RequestActions.js.map +1 -1
  84. package/build/src/models/RequestAuthorization.d.ts +3 -5
  85. package/build/src/models/RequestAuthorization.js +2 -4
  86. package/build/src/models/RequestAuthorization.js.map +1 -1
  87. package/build/src/models/RequestConfig.d.ts +3 -5
  88. package/build/src/models/RequestConfig.js +1 -3
  89. package/build/src/models/RequestConfig.js.map +1 -1
  90. package/build/src/models/RequestLog.d.ts +14 -8
  91. package/build/src/models/RequestLog.js +18 -7
  92. package/build/src/models/RequestLog.js.map +1 -1
  93. package/build/src/models/RequestTime.d.ts +4 -6
  94. package/build/src/models/RequestTime.js +2 -4
  95. package/build/src/models/RequestTime.js.map +1 -1
  96. package/build/src/models/RequestUiMeta.d.ts +5 -5
  97. package/build/src/models/RequestUiMeta.js +2 -2
  98. package/build/src/models/RequestUiMeta.js.map +1 -1
  99. package/build/src/models/RequestsSize.d.ts +1 -3
  100. package/build/src/models/RequestsSize.js +1 -3
  101. package/build/src/models/RequestsSize.js.map +1 -1
  102. package/build/src/models/{ArcResponse.d.ts → Response.d.ts} +7 -9
  103. package/build/src/models/{ArcResponse.js → Response.js} +4 -6
  104. package/build/src/models/Response.js.map +1 -0
  105. package/build/src/models/ResponseAuthorization.d.ts +3 -3
  106. package/build/src/models/ResponseAuthorization.js +3 -3
  107. package/build/src/models/ResponseAuthorization.js.map +1 -1
  108. package/build/src/models/ResponseRedirect.d.ts +3 -5
  109. package/build/src/models/ResponseRedirect.js +1 -3
  110. package/build/src/models/ResponseRedirect.js.map +1 -1
  111. package/build/src/models/RevisionInfo.d.ts +1 -1
  112. package/build/src/models/RevisionInfo.js +1 -1
  113. package/build/src/models/RevisionInfo.js.map +1 -1
  114. package/build/src/models/SentRequest.d.ts +2 -4
  115. package/build/src/models/SentRequest.js +1 -3
  116. package/build/src/models/SentRequest.js.map +1 -1
  117. package/build/src/models/Server.d.ts +3 -3
  118. package/build/src/models/Server.js +3 -3
  119. package/build/src/models/Server.js.map +1 -1
  120. package/build/src/models/Thing.d.ts +3 -3
  121. package/build/src/models/Thing.js +3 -3
  122. package/build/src/models/Thing.js.map +1 -1
  123. package/build/src/models/Url.d.ts +2 -4
  124. package/build/src/models/Url.js +2 -4
  125. package/build/src/models/Url.js.map +1 -1
  126. package/build/src/models/User.d.ts +2 -1
  127. package/build/src/models/User.js +1 -1
  128. package/build/src/models/User.js.map +1 -1
  129. package/build/src/models/WebApi.d.ts +1 -1
  130. package/build/src/models/WebApi.js +1 -1
  131. package/build/src/models/WebApi.js.map +1 -1
  132. package/build/src/models/WebApiIndex.d.ts +1 -1
  133. package/build/src/models/WebApiIndex.js +1 -1
  134. package/build/src/models/WebApiIndex.js.map +1 -1
  135. package/build/src/models/Workspace.d.ts +4 -4
  136. package/build/src/models/Workspace.js +4 -4
  137. package/build/src/models/Workspace.js.map +1 -1
  138. package/build/src/models/actions/Action.d.ts +2 -2
  139. package/build/src/models/actions/Action.js +1 -1
  140. package/build/src/models/actions/Action.js.map +1 -1
  141. package/build/src/models/actions/Condition.d.ts +2 -2
  142. package/build/src/models/actions/Condition.js +1 -1
  143. package/build/src/models/actions/Condition.js.map +1 -1
  144. package/build/src/models/actions/RunnableAction.d.ts +1 -1
  145. package/build/src/models/actions/RunnableAction.js +1 -1
  146. package/build/src/models/actions/RunnableAction.js.map +1 -1
  147. package/build/src/models/actions/runnable/DeleteCookieAction.d.ts +2 -2
  148. package/build/src/models/actions/runnable/DeleteCookieAction.js +1 -1
  149. package/build/src/models/actions/runnable/DeleteCookieAction.js.map +1 -1
  150. package/build/src/models/actions/runnable/SetCookieAction.d.ts +2 -2
  151. package/build/src/models/actions/runnable/SetCookieAction.js +1 -1
  152. package/build/src/models/actions/runnable/SetCookieAction.js.map +1 -1
  153. package/build/src/models/actions/runnable/SetVariableAction.d.ts +2 -2
  154. package/build/src/models/actions/runnable/SetVariableAction.js +1 -1
  155. package/build/src/models/actions/runnable/SetVariableAction.js.map +1 -1
  156. package/build/src/models/transformers/ImportUtils.d.ts +1 -1
  157. package/build/src/models/transformers/ImportUtils.js +1 -1
  158. package/build/src/models/transformers/PostmanBackupTransformer.js +2 -1
  159. package/build/src/models/transformers/PostmanBackupTransformer.js.map +1 -1
  160. package/build/src/models/transformers/PostmanV21Transformer.js +2 -1
  161. package/build/src/models/transformers/PostmanV21Transformer.js.map +1 -1
  162. package/build/src/models/transformers/PostmanV2Transformer.js +2 -1
  163. package/build/src/models/transformers/PostmanV2Transformer.js.map +1 -1
  164. package/build/src/runtime/actions/RunnableCondition.d.ts +6 -7
  165. package/build/src/runtime/actions/RunnableCondition.js +4 -5
  166. package/build/src/runtime/actions/RunnableCondition.js.map +1 -1
  167. package/build/src/runtime/http-engine/{ArcEngine.d.ts → CoreEngine.d.ts} +3 -3
  168. package/build/src/runtime/http-engine/{ArcEngine.js → CoreEngine.js} +8 -8
  169. package/build/src/runtime/http-engine/CoreEngine.js.map +1 -0
  170. package/build/src/runtime/http-engine/HttpEngine.d.ts +3 -3
  171. package/build/src/runtime/http-engine/HttpEngine.js +3 -20
  172. package/build/src/runtime/http-engine/HttpEngine.js.map +1 -1
  173. package/build/src/runtime/modules/BasicAuthCache.js +2 -5
  174. package/build/src/runtime/modules/BasicAuthCache.js.map +1 -1
  175. package/build/src/runtime/modules/RequestCookies.d.ts +1 -1
  176. package/build/src/runtime/modules/RequestCookies.js +3 -2
  177. package/build/src/runtime/modules/RequestCookies.js.map +1 -1
  178. package/build/src/runtime/node/InteropInterfaces.d.ts +115 -0
  179. package/build/src/runtime/node/InteropInterfaces.js +2 -0
  180. package/build/src/runtime/node/InteropInterfaces.js.map +1 -0
  181. package/build/src/runtime/node/ProjectParallelRunner.d.ts +2 -7
  182. package/build/src/runtime/node/ProjectParallelRunner.js.map +1 -1
  183. package/build/src/runtime/node/ProjectRequestRunner.d.ts +17 -49
  184. package/build/src/runtime/node/ProjectRequestRunner.js +39 -10
  185. package/build/src/runtime/node/ProjectRequestRunner.js.map +1 -1
  186. package/build/src/runtime/node/ProjectRunner.d.ts +1 -59
  187. package/build/src/runtime/node/ProjectRunner.js.map +1 -1
  188. package/build/src/runtime/node/ProjectRunnerWorker.js.map +1 -1
  189. package/build/src/runtime/node/RequestFactory.d.ts +1 -1
  190. package/build/src/runtime/node/RequestFactory.js +3 -3
  191. package/build/src/runtime/node/RequestFactory.js.map +1 -1
  192. package/build/src/runtime/reporters/ProjectRunCliReporter.js.map +1 -1
  193. package/build/src/runtime/reporters/Reporter.js.map +1 -1
  194. package/build/src/runtime/store/AuthSdk.d.ts +28 -0
  195. package/build/src/runtime/store/AuthSdk.js +123 -0
  196. package/build/src/runtime/store/AuthSdk.js.map +1 -0
  197. package/build/src/runtime/store/BackendSdk.d.ts +8 -0
  198. package/build/src/runtime/store/BackendSdk.js +25 -0
  199. package/build/src/runtime/store/BackendSdk.js.map +1 -0
  200. package/build/src/runtime/store/HistorySdk.d.ts +48 -0
  201. package/build/src/runtime/store/HistorySdk.js +142 -0
  202. package/build/src/runtime/store/HistorySdk.js.map +1 -0
  203. package/build/src/runtime/store/Http.d.ts +14 -0
  204. package/build/src/runtime/store/Http.js +4 -0
  205. package/build/src/runtime/store/Http.js.map +1 -0
  206. package/build/src/runtime/store/HttpNode.d.ts +16 -0
  207. package/build/src/runtime/store/HttpNode.js +95 -0
  208. package/build/src/runtime/store/HttpNode.js.map +1 -0
  209. package/build/src/runtime/store/HttpWeb.d.ts +15 -0
  210. package/build/src/runtime/store/HttpWeb.js +83 -0
  211. package/build/src/runtime/store/HttpWeb.js.map +1 -0
  212. package/build/src/runtime/store/ProjectsSdk.d.ts +43 -0
  213. package/build/src/runtime/store/ProjectsSdk.js +144 -0
  214. package/build/src/runtime/store/ProjectsSdk.js.map +1 -0
  215. package/build/src/runtime/store/RouteBuilder.d.ts +42 -0
  216. package/build/src/runtime/store/RouteBuilder.js +75 -0
  217. package/build/src/runtime/store/RouteBuilder.js.map +1 -0
  218. package/build/src/runtime/store/Sdk.d.ts +79 -0
  219. package/build/src/runtime/store/Sdk.js +117 -0
  220. package/build/src/runtime/store/Sdk.js.map +1 -0
  221. package/build/src/runtime/store/SdkBase.d.ts +45 -0
  222. package/build/src/runtime/store/SdkBase.js +40 -0
  223. package/build/src/runtime/store/SdkBase.js.map +1 -0
  224. package/build/src/runtime/store/SpacesSdk.d.ts +50 -0
  225. package/build/src/runtime/store/SpacesSdk.js +185 -0
  226. package/build/src/runtime/store/SpacesSdk.js.map +1 -0
  227. package/build/src/runtime/store/StoreSdkNode.d.ts +10 -0
  228. package/build/src/runtime/store/StoreSdkNode.js +11 -0
  229. package/build/src/runtime/store/StoreSdkNode.js.map +1 -0
  230. package/build/src/runtime/store/StoreSdkWeb.d.ts +10 -0
  231. package/build/src/runtime/store/StoreSdkWeb.js +11 -0
  232. package/build/src/runtime/store/StoreSdkWeb.js.map +1 -0
  233. package/build/src/runtime/store/UsersSdk.d.ts +18 -0
  234. package/build/src/runtime/store/UsersSdk.js +88 -0
  235. package/build/src/runtime/store/UsersSdk.js.map +1 -0
  236. package/build/src/runtime/store/WsClient.d.ts +24 -0
  237. package/build/src/runtime/store/WsClient.js +4 -0
  238. package/build/src/runtime/store/WsClient.js.map +1 -0
  239. package/build/src/runtime/store/WsClientNode.d.ts +24 -0
  240. package/build/src/runtime/store/WsClientNode.js +66 -0
  241. package/build/src/runtime/store/WsClientNode.js.map +1 -0
  242. package/build/src/runtime/store/WsClientWeb.d.ts +23 -0
  243. package/build/src/runtime/store/WsClientWeb.js +73 -0
  244. package/build/src/runtime/store/WsClientWeb.js.map +1 -0
  245. package/package.json +6 -8
  246. package/readme.md +5 -5
  247. package/src/data/JmesparthReader.ts +1 -1
  248. package/src/events/models/ProjectEvents.ts +2 -2
  249. package/src/events/readme.md +1 -1
  250. package/src/lib/transformers/PayloadSerializer.ts +3 -3
  251. package/src/mocking/ProjectMock.ts +9 -1
  252. package/src/mocking/lib/History.ts +179 -0
  253. package/src/mocking/lib/Request.ts +5 -5
  254. package/src/mocking/lib/Response.ts +10 -10
  255. package/src/mocking/lib/User.ts +68 -0
  256. package/src/models/AuthorizationData.ts +2 -2
  257. package/src/models/Backend.ts +93 -0
  258. package/src/models/ClientCertificate.ts +1 -1
  259. package/src/models/Environment.ts +4 -4
  260. package/src/models/ErrorResponse.ts +1 -1
  261. package/src/models/HostRule.ts +5 -5
  262. package/src/models/HttpHistory.ts +89 -27
  263. package/src/models/HttpProject.ts +5 -6
  264. package/src/models/HttpProjectListItem.ts +1 -1
  265. package/src/models/HttpRequest.ts +2 -2
  266. package/src/models/HttpResponse.ts +3 -3
  267. package/src/models/License.ts +4 -4
  268. package/src/models/ProjectFolder.ts +3 -3
  269. package/src/models/ProjectItem.ts +2 -2
  270. package/src/models/ProjectRequest.ts +2 -2
  271. package/src/models/ProjectSchema.ts +2 -2
  272. package/src/models/Property.ts +5 -5
  273. package/src/models/Provider.ts +4 -4
  274. package/src/models/README.md +2 -2
  275. package/src/models/Request.ts +4 -4
  276. package/src/models/RequestActions.ts +2 -4
  277. package/src/models/RequestAuthorization.ts +3 -5
  278. package/src/models/RequestConfig.ts +3 -5
  279. package/src/models/RequestLog.ts +25 -11
  280. package/src/models/RequestTime.ts +4 -6
  281. package/src/models/RequestUiMeta.ts +5 -5
  282. package/src/models/RequestsSize.ts +1 -3
  283. package/src/models/{ArcResponse.ts → Response.ts} +12 -14
  284. package/src/models/ResponseAuthorization.ts +4 -4
  285. package/src/models/ResponseRedirect.ts +3 -5
  286. package/src/models/RevisionInfo.ts +1 -1
  287. package/src/models/SentRequest.ts +2 -4
  288. package/src/models/Server.ts +4 -4
  289. package/src/models/Thing.ts +4 -4
  290. package/src/models/Url.ts +2 -4
  291. package/src/models/User.ts +2 -1
  292. package/src/models/WebApi.ts +1 -1
  293. package/src/models/WebApiIndex.ts +1 -1
  294. package/src/models/Workspace.ts +5 -5
  295. package/src/models/actions/Action.ts +2 -2
  296. package/src/models/actions/Condition.ts +2 -2
  297. package/src/models/actions/RunnableAction.ts +1 -1
  298. package/src/models/actions/runnable/DeleteCookieAction.ts +2 -2
  299. package/src/models/actions/runnable/SetCookieAction.ts +2 -2
  300. package/src/models/actions/runnable/SetVariableAction.ts +2 -2
  301. package/src/models/transformers/ImportUtils.ts +1 -1
  302. package/src/models/transformers/PostmanBackupTransformer.ts +2 -1
  303. package/src/models/transformers/PostmanV21Transformer.ts +2 -1
  304. package/src/models/transformers/PostmanV2Transformer.ts +2 -1
  305. package/src/runtime/actions/RunnableCondition.ts +6 -7
  306. package/src/runtime/http-engine/{ArcEngine.ts → CoreEngine.ts} +7 -7
  307. package/src/runtime/http-engine/HttpEngine.ts +5 -24
  308. package/src/runtime/modules/BasicAuthCache.ts +2 -6
  309. package/src/runtime/modules/RequestCookies.ts +6 -5
  310. package/src/runtime/node/InteropInterfaces.ts +121 -0
  311. package/src/runtime/node/ProjectParallelRunner.ts +2 -9
  312. package/src/runtime/node/ProjectRequestRunner.ts +42 -61
  313. package/src/runtime/node/ProjectRunner.ts +1 -60
  314. package/src/runtime/node/ProjectRunnerWorker.ts +2 -1
  315. package/src/runtime/node/RequestFactory.ts +3 -3
  316. package/src/runtime/reporters/ProjectRunCliReporter.ts +2 -2
  317. package/src/runtime/reporters/Reporter.ts +4 -4
  318. package/src/runtime/store/AuthSdk.ts +126 -0
  319. package/src/runtime/store/BackendSdk.ts +25 -0
  320. package/src/runtime/store/HistorySdk.ts +157 -0
  321. package/src/runtime/store/Http.ts +18 -0
  322. package/src/runtime/store/HttpNode.ts +100 -0
  323. package/src/runtime/store/HttpWeb.ts +89 -0
  324. package/src/runtime/store/ProjectsSdk.ts +147 -0
  325. package/src/runtime/store/RouteBuilder.ts +89 -0
  326. package/src/runtime/store/Sdk.ts +131 -0
  327. package/src/runtime/store/SdkBase.ts +72 -0
  328. package/src/runtime/store/SpacesSdk.ts +190 -0
  329. package/src/runtime/store/StoreSdkNode.ts +13 -0
  330. package/src/runtime/store/StoreSdkWeb.ts +13 -0
  331. package/src/runtime/store/UsersSdk.ts +89 -0
  332. package/src/runtime/store/WsClient.ts +28 -0
  333. package/src/runtime/store/WsClientNode.ts +68 -0
  334. package/src/runtime/store/WsClientWeb.ts +75 -0
  335. package/build/src/models/ArcResponse.js.map +0 -1
  336. package/build/src/models/HistoryIndex.d.ts +0 -43
  337. package/build/src/models/HistoryIndex.js +0 -53
  338. package/build/src/models/HistoryIndex.js.map +0 -1
  339. package/build/src/models/HistoryRequest.d.ts +0 -13
  340. package/build/src/models/HistoryRequest.js +0 -25
  341. package/build/src/models/HistoryRequest.js.map +0 -1
  342. package/build/src/runtime/http-engine/ArcEngine.js.map +0 -1
  343. package/build/src/runtime/http-engine/NodeEngine.d.ts +0 -154
  344. package/build/src/runtime/http-engine/NodeEngine.js +0 -766
  345. package/build/src/runtime/http-engine/NodeEngine.js.map +0 -1
  346. package/build/src/runtime/http-engine/NodeEngineDirect.d.ts +0 -113
  347. package/build/src/runtime/http-engine/NodeEngineDirect.js +0 -449
  348. package/build/src/runtime/http-engine/NodeEngineDirect.js.map +0 -1
  349. package/build/src/runtime/store/StoreSdk.d.ts +0 -279
  350. package/build/src/runtime/store/StoreSdk.js +0 -840
  351. package/build/src/runtime/store/StoreSdk.js.map +0 -1
  352. package/src/models/HistoryIndex.ts +0 -76
  353. package/src/models/HistoryRequest.ts +0 -28
  354. package/src/runtime/http-engine/NodeEngine.ts +0 -792
  355. package/src/runtime/http-engine/NodeEngineDirect.ts +0 -482
  356. package/src/runtime/store/StoreSdk.ts +0 -895
package/readme.md CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
  The core library of the API Client application. This build on top of the experience of Advanced REST Client.
4
4
 
5
- Contains the core models, events, and logic related to ARC. This replaces the `events`, `lib`, and parts of `base` libraries.
5
+ Contains the core models, events, and logic related to API Client.
6
6
 
7
7
  ## Purpose
8
8
 
9
- The core library provides the libraries that ARC and related projects are re-using under the hood.
9
+ The core library provides the libraries that API Client and related projects are re-using under the hood.
10
10
 
11
11
  The library is structured as follows:
12
12
 
13
- - models - the data model libraries providing the data schema definition for ARC and related projects and the common logic to manipulate the data
13
+ - models - the data model libraries providing the data schema definition for API Client and related projects and the common logic to manipulate the data
14
14
  - runtime - the executable part of the library; contains classes that executes an HTTP request, runs a series of requests defined in a project, etc
15
- - utilities - helper libraries that can be shared across the ARC ecosystem
15
+ - utilities - helper libraries that can be shared across the API Client ecosystem
16
16
 
17
17
  ## What it isn't
18
18
 
@@ -36,7 +36,7 @@ These libraries can be used, among others, to:
36
36
 
37
37
  ## Community driven
38
38
 
39
- The entire ARC project is community driven. We build tools for API developers to make them successful without investing into very expensive enterprise solutions. We are happy to hear from you. If your ideas can benefit the community we will implement them. That's on us. But you are welcome to clone the project, build your idea, and send us a PR. We will accept it if it won't influence the stability of the project and it's safe to marge with the main branch.
39
+ The entire API Client project is community driven. We build tools for API developers to make them successful without investing into very expensive enterprise solutions. We are happy to hear from you. If your ideas can benefit the community we will implement them. That's on us. But you are welcome to clone the project, build your idea, and send us a PR. We will accept it if it won't influence the stability of the project and it's safe to marge with the main branch.
40
40
 
41
41
  ## Documentation
42
42
 
@@ -5,7 +5,7 @@ import { DataReader } from './DataReader.js';
5
5
  * Reads the value from a JSON document using the the JmesPath notation.
6
6
  * See https://jmespath.org/
7
7
  *
8
- * Note, after consideration this implementation is not used with ARC projects to extract
8
+ * Note, after consideration this implementation is not used with API Client projects to extract
9
9
  * request data. Instead, we use `JsonReader` that converts the JSON to XML so the same
10
10
  * XPath can be used for both JSON and XML.
11
11
  */
@@ -198,7 +198,7 @@ class ProjectEnvironmentEvents {
198
198
  }
199
199
 
200
200
  /**
201
- * ARC's HTTP project events.
201
+ * API Client's HTTP project events.
202
202
  *
203
203
  * Note, `id`s refers to datastore ids but `key`s are internal identifiers inside the project.
204
204
  * Whenever id is used it refers to the store's ids. When `key` is used it is the id of the project or any of its components.
@@ -328,4 +328,4 @@ export class ProjectEvents {
328
328
  static get Environment(): typeof ProjectEnvironmentEvents {
329
329
  return ProjectEnvironmentEvents;
330
330
  }
331
- };
331
+ }
@@ -1,6 +1,6 @@
1
1
  # Events
2
2
 
3
- This package contains a definition of events used by the ARC ecosystem to communicate with context providers.
3
+ This package contains a definition of events used by the API Client ecosystem to communicate with context providers.
4
4
 
5
5
  ## Context provider
6
6
 
@@ -188,7 +188,7 @@ export class PayloadSerializer {
188
188
  enabled: true,
189
189
  };
190
190
  if (file.name === 'blob') {
191
- // ARC adds the "blob" filename when the content type is set on the editor.
191
+ // API Client adds the "blob" filename when the content type is set on the editor.
192
192
  // otherwise it wouldn't be possible to set the content type value.
193
193
  part.type = file.type;
194
194
  } else {
@@ -297,9 +297,9 @@ export class PayloadSerializer {
297
297
  }
298
298
 
299
299
  /**
300
- * Deserializes FormData from ARC data model.
300
+ * Deserializes FormData from API Client data model.
301
301
  *
302
- * @param {IMultipartBody[]} model ARC model for multipart.
302
+ * @param parts API Client model for multipart.
303
303
  * @return {FormData} Restored form data
304
304
  */
305
305
  static deserializeFormData(parts: IMultipartBody[]): FormData {
@@ -1,13 +1,19 @@
1
1
  import { DataMock, DataMockInit } from '@pawel-up/data-mock';
2
2
  import { Request } from './lib/Request.js';
3
3
  import { Response } from './lib/Response.js';
4
+ import { User } from './lib/User.js';
5
+ import { History } from './lib/History.js';
4
6
 
5
7
  export { IRequestLogInit } from './lib/Request.js';
6
- export { IArcResponseInit } from './lib/Response.js';
8
+ export { IResponseInit } from './lib/Response.js';
9
+ export { ISpaceUserInit, IUserInit } from './lib/User.js';
10
+ export { IHttpHistoryInit, IHttpHistoryListInit } from './lib/History.js';
7
11
 
8
12
  export class ProjectMock extends DataMock {
9
13
  projectRequest: Request;
10
14
  response: Response;
15
+ user: User;
16
+ history: History;
11
17
 
12
18
  /**
13
19
  * @param init The library init options.
@@ -16,5 +22,7 @@ export class ProjectMock extends DataMock {
16
22
  super(init);
17
23
  this.projectRequest = new Request(init);
18
24
  this.response = new Response(init);
25
+ this.user = new User(init);
26
+ this.history = new History(init);
19
27
  }
20
28
  }
@@ -0,0 +1,179 @@
1
+ import { Internet, Types, DataMockInit, Person, Random, TypeDateTimeInit } from '@pawel-up/data-mock';
2
+ // import { randomValue } from '@pawel-up/data-mock/src/lib/Http.js';
3
+ import { IHttpHistory, Kind as HttpHistoryKind } from '../../models/HttpHistory.js';
4
+ import { Request, IRequestLogInit } from './Request.js';
5
+
6
+
7
+ export interface IHttpHistoryInit {
8
+ /**
9
+ * Either space id, list of spaces to pick one or whether to generate a space.
10
+ */
11
+ space?: boolean | string | string[];
12
+ /**
13
+ * User is always generated per store requirements.
14
+ */
15
+ user?: string | string[];
16
+ /**
17
+ * Either project id, list of projects to pick one or whether to generate a project.
18
+ */
19
+ project?: boolean | string | string[];
20
+ /**
21
+ * Either request id, list of requests to pick one or whether to generate a request.
22
+ */
23
+ request?: boolean | string | string[];
24
+ /**
25
+ * Either app id, list of apps to pick one or whether to generate an app.
26
+ */
27
+ app?: boolean | string | string[];
28
+ /**
29
+ * The log init options
30
+ */
31
+ log?: IRequestLogInit;
32
+ /**
33
+ * The created time init options.
34
+ */
35
+ created?: TypeDateTimeInit;
36
+ }
37
+
38
+ export interface IHttpHistoryListInit extends IHttpHistoryInit {
39
+ /**
40
+ * When set it generates as many user IDs.
41
+ * Ignored when the `user` is set.
42
+ */
43
+ usersSize?: number;
44
+ /**
45
+ * When set it generates as many space ids.
46
+ * Ignored when the `space` is set.
47
+ */
48
+ spacesSize?: number;
49
+ /**
50
+ * When set it generates as many project ids.
51
+ * Ignored when the `project` is set.
52
+ */
53
+ projectsSize?: number;
54
+ /**
55
+ * When set it generates as many request ids.
56
+ * Ignored when the `request` is set.
57
+ */
58
+ requestsSize?: number;
59
+ /**
60
+ * When set it generates as many app ids.
61
+ * Ignored when the `app` is set.
62
+ */
63
+ appsSize?: number;
64
+ }
65
+
66
+ export class History {
67
+ person: Person;
68
+ types: Types;
69
+ internet: Internet;
70
+ random: Random;
71
+ request: Request;
72
+
73
+ constructor(init: DataMockInit={}) {
74
+ this.person = new Person(init);
75
+ this.types = new Types(init.seed);
76
+ this.internet = new Internet(init);
77
+ this.random = new Random(init.seed);
78
+ this.request = new Request(init);
79
+ }
80
+
81
+ httpHistory(init: IHttpHistoryInit = {}): IHttpHistory {
82
+ const date = this.types.datetime(init.created);
83
+ const result: IHttpHistory = {
84
+ kind: HttpHistoryKind,
85
+ created: date.getTime(),
86
+ log: this.request.log(init.log),
87
+ user: '',
88
+ }
89
+ date.setHours(0, 0, 0, 0);
90
+ result.midnight = date.getTime();
91
+
92
+ if (typeof init.space === 'string') {
93
+ result.space = init.space;
94
+ } else if (Array.isArray(init.space)) {
95
+ result.space = this.random.pickOne(init.space);
96
+ } else if (init.space) {
97
+ result.space = this.types.string(10);
98
+ }
99
+
100
+ if (typeof init.user === 'string') {
101
+ result.user = init.user;
102
+ } else if (Array.isArray(init.user)) {
103
+ result.user = this.random.pickOne(init.user);
104
+ } else {
105
+ result.user = this.types.uuid();
106
+ }
107
+
108
+ if (typeof init.project === 'string') {
109
+ result.project = init.project;
110
+ } else if (Array.isArray(init.project)) {
111
+ result.project = this.random.pickOne(init.project);
112
+ } else if (init.project) {
113
+ result.project = this.types.uuid();
114
+ }
115
+
116
+ if (typeof init.request === 'string') {
117
+ result.request = init.request;
118
+ } else if (Array.isArray(init.request)) {
119
+ result.request = this.random.pickOne(init.request);
120
+ } else if (init.request) {
121
+ result.request = this.types.uuid();
122
+ }
123
+
124
+ if (typeof init.app === 'string') {
125
+ result.app = init.app;
126
+ } else if (Array.isArray(init.app)) {
127
+ result.app = this.random.pickOne(init.app);
128
+ } else if (init.app) {
129
+ result.app = this.types.uuid();
130
+ }
131
+ return result;
132
+ }
133
+
134
+ httpHistoryList(size=25, init: IHttpHistoryListInit = {}): IHttpHistory[] {
135
+ const { usersSize, spacesSize, projectsSize, requestsSize, appsSize } = init;
136
+ const copy = { ...init };
137
+ if (usersSize && typeof init.user === 'undefined') {
138
+ const users: string[] = [];
139
+ for (let i = 0; i < usersSize; i++) {
140
+ users.push(this.types.uuid());
141
+ }
142
+ copy.user = users;
143
+ }
144
+ if (spacesSize && typeof init.space === 'undefined') {
145
+ const space: string[] = [];
146
+ for (let i = 0; i < spacesSize; i++) {
147
+ space.push(this.types.string(10));
148
+ }
149
+ copy.space = space;
150
+ }
151
+ if (projectsSize && typeof init.project === 'undefined') {
152
+ const project: string[] = [];
153
+ for (let i = 0; i < projectsSize; i++) {
154
+ project.push(this.types.uuid());
155
+ }
156
+ copy.project = project;
157
+ }
158
+ if (requestsSize && typeof init.request === 'undefined') {
159
+ const requests: string[] = [];
160
+ for (let i = 0; i < requestsSize; i++) {
161
+ requests.push(this.types.uuid());
162
+ }
163
+ copy.request = requests;
164
+ }
165
+ if (appsSize && typeof init.app === 'undefined') {
166
+ const apps: string[] = [];
167
+ for (let i = 0; i < appsSize; i++) {
168
+ apps.push(this.types.uuid());
169
+ }
170
+ copy.app = apps;
171
+ }
172
+
173
+ const result: IHttpHistory[] = [];
174
+ for (let i = 0; i < size; i++) {
175
+ result.push(this.httpHistory(copy));
176
+ }
177
+ return result;
178
+ }
179
+ }
@@ -3,12 +3,12 @@ import { Http, Types, Lorem, Time, DataMockInit, HttpRequestInit } from '@pawel-
3
3
  import { IHttpRequest, Kind as HttpRequestKind } from '../../models/HttpRequest.js';
4
4
  import { IRequest, Kind as RequestKind } from '../../models/Request.js';
5
5
  import { ISentRequest } from '../../models/SentRequest.js';
6
- import { IRequestLog } from '../../models/RequestLog.js';
7
- import { IArcResponseInit, Response } from './Response.js';
6
+ import { IRequestLog, Kind as RequestLogKind } from '../../models/RequestLog.js';
7
+ import { IResponseInit, Response } from './Response.js';
8
8
 
9
9
  export interface IRequestLogInit {
10
10
  request?: HttpRequestInit;
11
- response?: IArcResponseInit;
11
+ response?: IResponseInit;
12
12
  /**
13
13
  * When set it ignores size information
14
14
  */
@@ -66,13 +66,13 @@ export class Request {
66
66
 
67
67
  log(init: IRequestLogInit = {}): IRequestLog {
68
68
  const result: IRequestLog = {
69
- kind: 'ARC#ResponseLog',
69
+ kind: RequestLogKind,
70
70
  };
71
71
  if (!init.noRequest) {
72
72
  result.request = this.sentRequest(init.request);
73
73
  }
74
74
  if (!init.noResponse) {
75
- result.response = this.response.arcResponse(init.response);
75
+ result.response = this.response.response(init.response);
76
76
  }
77
77
  if (init.redirects) {
78
78
  result.redirects = this.response.redirects();
@@ -1,10 +1,10 @@
1
1
  import { Http, Har, Types, Lorem, Time, DataMockInit, HttpResponseInit, HarTimingInit, Internet } from '@pawel-up/data-mock';
2
2
  import { IHttpResponse, Kind as HttpResponseKind } from '../../models/HttpResponse.js';
3
- import { IArcResponse, Kind as ArcResponseKind } from '../../models/ArcResponse.js';
3
+ import { IResponse, Kind as ResponseKind } from '../../models/Response.js';
4
4
  import { IRequestsSize } from '../../models/RequestsSize.js';
5
5
  import { IResponseRedirect, Kind as ResponseRedirectKind } from '../../models/ResponseRedirect.js';
6
6
 
7
- export interface IArcResponseInit extends HttpResponseInit, HarTimingInit {
7
+ export interface IResponseInit extends HttpResponseInit, HarTimingInit {
8
8
  /**
9
9
  * When set it does not generate a response payload.
10
10
  */
@@ -36,7 +36,7 @@ export class Response {
36
36
  this.internet = new Internet(init);
37
37
  }
38
38
 
39
- response(init: IArcResponseInit = {}): IHttpResponse {
39
+ httpResponse(init: IResponseInit = {}): IHttpResponse {
40
40
  const ct = init.noBody ? undefined : this.http.headers.contentType();
41
41
  const body = init.noBody ? undefined : this.http.payload.payload(ct);
42
42
  const headers = this.http.headers.headers('response', { mime: ct });
@@ -56,12 +56,12 @@ export class Response {
56
56
  return result;
57
57
  }
58
58
 
59
- arcResponse(init: IArcResponseInit={}): IArcResponse {
60
- const base = this.response(init);
59
+ response(init: IResponseInit={}): IResponse {
60
+ const base = this.httpResponse(init);
61
61
  const length = this.types.number({ min: 10, max: 4000 });
62
- const result: IArcResponse = {
62
+ const result: IResponse = {
63
63
  ...base,
64
- kind: ArcResponseKind,
64
+ kind: ResponseKind,
65
65
  loadingTime: length,
66
66
  };
67
67
  if (init.timings) {
@@ -78,7 +78,7 @@ export class Response {
78
78
  return result;
79
79
  }
80
80
 
81
- redirect(init?: IArcResponseInit): IResponseRedirect {
81
+ redirect(init?: IResponseInit): IResponseRedirect {
82
82
  const start = this.time.timestamp();
83
83
  const end = this.time.timestamp({ min: start + 1 })
84
84
  const info: IResponseRedirect = {
@@ -86,12 +86,12 @@ export class Response {
86
86
  startTime: start,
87
87
  endTime: end,
88
88
  url: this.internet.uri(),
89
- response: this.response({ ...init, statusGroup: 3}),
89
+ response: this.httpResponse({ ...init, statusGroup: 3}),
90
90
  };
91
91
  return info;
92
92
  }
93
93
 
94
- redirects(size=1, init?: IArcResponseInit): IResponseRedirect[] {
94
+ redirects(size=1, init?: IResponseInit): IResponseRedirect[] {
95
95
  const result: IResponseRedirect[] = [];
96
96
  for (let i = 0; i < size; i++) {
97
97
  result.push(this.redirect(init));
@@ -0,0 +1,68 @@
1
+ import { Internet, Types, DataMockInit, Person, Random } from '@pawel-up/data-mock';
2
+ // import { randomValue } from '@pawel-up/data-mock/src/lib/Http.js';
3
+ import { IUser, ISpaceUser, AccessControlLevel, Kind as UserKind } from '../../models/User.js';
4
+
5
+
6
+ export interface IUserInit {
7
+ noEmail?: boolean;
8
+ noPicture?: boolean;
9
+ noProvider?: boolean;
10
+ }
11
+
12
+ export interface ISpaceUserInit extends IUserInit {
13
+ level?: AccessControlLevel;
14
+ levelPool?: AccessControlLevel[];
15
+ }
16
+
17
+ const accessPool: AccessControlLevel[] = ['read', 'comment', 'write', 'admin', 'owner'];
18
+
19
+ export class User {
20
+ person: Person;
21
+ types: Types;
22
+ internet: Internet;
23
+ random: Random;
24
+
25
+ constructor(init: DataMockInit={}) {
26
+ this.person = new Person(init);
27
+ this.types = new Types(init.seed);
28
+ this.internet = new Internet(init);
29
+ this.random = new Random(init.seed);
30
+ }
31
+
32
+ user(init: IUserInit = {}): IUser {
33
+ const result: IUser = {
34
+ kind: UserKind,
35
+ key: this.types.uuid(),
36
+ name: this.person.name(),
37
+ }
38
+ if (!init.noEmail) {
39
+ result.email = [{
40
+ email: this.internet.email(),
41
+ verified: this.types.boolean(),
42
+ }];
43
+ }
44
+ if (!init.noPicture) {
45
+ result.picture = {
46
+ url: this.internet.avatar(),
47
+ };
48
+ }
49
+ if (!init.noProvider) {
50
+ result.provider = {
51
+ refreshToken: this.types.uuid(),
52
+ };
53
+ }
54
+ return result;
55
+ }
56
+
57
+ spaceUser(init: ISpaceUserInit = {}): ISpaceUser {
58
+ const user = this.user(init) as ISpaceUser;
59
+ if (init.level) {
60
+ user.level = init.level;
61
+ } else if (Array.isArray(init.levelPool)) {
62
+ user.level = this.random.pickOne(init.levelPool);
63
+ } else {
64
+ user.level = this.random.pickOne(accessPool);
65
+ }
66
+ return user;
67
+ }
68
+ }
@@ -6,7 +6,7 @@ export interface IAuthorizationData {
6
6
 
7
7
 
8
8
  /**
9
- * Represents an auth data stored in ARC's data store to be retrieved
9
+ * Represents an auth data stored in API Client's data store to be retrieved
10
10
  * when the response status is 401.
11
11
  *
12
12
  * Each entry represent a Basic or NTLM authorization.
@@ -34,7 +34,7 @@ export class AuthorizationData {
34
34
  /**
35
35
  * Creates a new provider clearing anything that is so far defined.
36
36
  *
37
- * Note, this throws an error when the provider is not an ARC provider object.
37
+ * Note, this throws an error when the provider is not an API Client provider object.
38
38
  */
39
39
  new(init: IAuthorizationData): void {
40
40
  const { username, password, domain } = init;
@@ -1,3 +1,4 @@
1
+ /* eslint-disable import/export */
1
2
  export type BackendMode = 'single-user' | 'multi-user';
2
3
 
3
4
  export interface IBackendInfo {
@@ -104,4 +105,96 @@ export interface IListOptions {
104
105
  * Only with the `query` property. Tells the system in which fields to search for the query term.
105
106
  */
106
107
  queryField?: string[];
108
+ type?: string;
109
+ }
110
+
111
+ export interface ICursorOptions {
112
+ /**
113
+ * Page cursor to use with the query.
114
+ */
115
+ cursor?: string;
116
+ }
117
+
118
+ /**
119
+ * Listing options for the HTTP history.
120
+ */
121
+ export type HistoryListOptions = IHistorySpaceListOptions | IHistoryProjectListOptions | IHistoryRequestListOptions | IHistoryUserListOptions | IHistoryAppListOptions;
122
+
123
+ /**
124
+ * Query options to list history for a user space.
125
+ * The user has to have access to the user space to read / create / delete the history.
126
+ */
127
+ export interface IHistorySpaceListOptions extends IListOptions {
128
+ type: 'space';
129
+ /**
130
+ * The id of the space.
131
+ */
132
+ id: string;
133
+ /**
134
+ * Whether to limit the list of results to the history that belongs to the current user.
135
+ */
136
+ user?: boolean;
137
+ }
138
+
139
+ /**
140
+ * Query options to list history for an HTTP project.
141
+ * The user has to have access to the parent user space to read / create / delete the history.
142
+ */
143
+ export interface IHistoryProjectListOptions extends IListOptions {
144
+ type: 'project';
145
+ /**
146
+ * The id of the space containing the project.
147
+ * The access to the history records for the project is tested against the user space.
148
+ */
149
+ space: string;
150
+ /**
151
+ * The id of the project.
152
+ */
153
+ id: string;
154
+ /**
155
+ * Whether to limit the list of results to the history that belongs to the current user.
156
+ */
157
+ user?: boolean;
158
+ }
159
+
160
+ /**
161
+ * Query options to list history for a request in a project.
162
+ * The user has to have access to the parent user space to read / create / delete the history.
163
+ */
164
+ export interface IHistoryRequestListOptions extends IListOptions {
165
+ type: 'request';
166
+ /**
167
+ * The id of the space containing the project that contains the request.
168
+ * The access to the history records for the request is tested against the user space.
169
+ */
170
+ space: string;
171
+ /**
172
+ * The id of the request.
173
+ */
174
+ id: string;
175
+ /**
176
+ * Whether to limit the list of results to the history that belongs to the current user.
177
+ */
178
+ user?: boolean;
179
+ }
180
+
181
+ /**
182
+ * Query options to list history for a user. This targets lists all user history. If you need to
183
+ * filter the user history use other interfaces with the `user` flag set.
184
+ */
185
+ export interface IHistoryUserListOptions extends IListOptions {
186
+ type: 'user';
187
+ }
188
+
189
+ /**
190
+ * Query options to list history for a history object that was created by an application that has no concept
191
+ * of user spaces. In this case the queries are always made against the current user.
192
+ */
193
+ export interface IHistoryAppListOptions extends IListOptions {
194
+ type: 'app';
195
+ /**
196
+ * The id of the application.
197
+ * These queries are always made for a user.
198
+ */
199
+ id: string;
107
200
  }
@@ -61,7 +61,7 @@ export interface ICertificateIndex {
61
61
  }
62
62
 
63
63
  /**
64
- * A base client certificate object used in ARC to create / list objects.
64
+ * A base client certificate object used in API Client to create / list objects.
65
65
  * This is not a data entity but rather something used to outside of a context of a data store.
66
66
  */
67
67
  export interface IClientCertificate extends IRequestCertificate, ICertificateIndex {
@@ -16,7 +16,7 @@ export interface IEnvironmentCloneOptions {
16
16
  * A project environment definition.
17
17
  */
18
18
  export interface IEnvironment {
19
- kind: 'ARC#Environment';
19
+ kind: typeof Kind;
20
20
  /**
21
21
  * The identifier of the environment.
22
22
  */
@@ -47,7 +47,7 @@ export interface IEnvironment {
47
47
  security?: unknown;
48
48
  }
49
49
 
50
- export const Kind = 'ARC#Environment';
50
+ export const Kind = 'Core#Environment';
51
51
 
52
52
  /**
53
53
  * An environment is applied to a project or a folder.
@@ -145,11 +145,11 @@ export class Environment {
145
145
  /**
146
146
  * Creates a new environment clearing anything that is so far defined.
147
147
  *
148
- * Note, this throws an error when the environment is not an ARC environment.
148
+ * Note, this throws an error when the environment is not an environment.
149
149
  */
150
150
  new(init: IEnvironment): void {
151
151
  if (!Environment.isEnvironment(init)) {
152
- throw new Error(`Not an ARC environment.`);
152
+ throw new Error(`Not an environment.`);
153
153
  }
154
154
  const { key=v4(), variables, info, server, encapsulated=false, security } = init;
155
155
  this.kind = Kind;
@@ -86,7 +86,7 @@ export class ErrorResponse extends HttpResponse {
86
86
  /**
87
87
  * Creates a new request clearing anything that is so far defined.
88
88
  *
89
- * Note, this throws an error when the object is not an ARC request.
89
+ * Note, this throws an error when the object is not an API Client request.
90
90
  */
91
91
  new(init: IErrorResponse): void {
92
92
  super.new(init);
@@ -1,7 +1,7 @@
1
- export const Kind = 'ARC#HostRule';
1
+ export const Kind = 'Core#HostRule';
2
2
 
3
3
  /**
4
- * ARC host rule definition.
4
+ * API Client host rule definition.
5
5
  */
6
6
  export interface IHostRule {
7
7
  kind?: typeof Kind;
@@ -74,11 +74,11 @@ export class HostRule {
74
74
  /**
75
75
  * Creates a new thing clearing anything that is so far defined.
76
76
  *
77
- * Note, this throws an error when the server is not an ARC thing.
77
+ * Note, this throws an error when the server is not an API Client thing.
78
78
  */
79
79
  new(init: IHostRule): void {
80
80
  if (!HostRule.isHostRule(init)) {
81
- throw new Error(`Not an ARC HostRule.`);
81
+ throw new Error(`Not a HostRule.`);
82
82
  }
83
83
  const { from='', to='', enabled, comment } = init;
84
84
  this.kind = Kind;
@@ -138,7 +138,7 @@ export class HostRule {
138
138
  /**
139
139
  * Evaluates hosts rule and applies it to the `url`.
140
140
  * @param {string} url The URL to evaluate
141
- * @param {HostRule} rule ARC rule definition
141
+ * @param {HostRule} rule The host rule definition
142
142
  * @return {string} Processed url.
143
143
  */
144
144
  static evaluateRule(url: string, rule: HostRule): string | undefined {