@api-client/core 0.6.29 → 0.7.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 (325) hide show
  1. package/build/browser.d.ts +6 -14
  2. package/build/browser.js +11 -16
  3. package/build/browser.js.map +1 -1
  4. package/build/index.d.ts +8 -20
  5. package/build/index.js +13 -25
  6. package/build/index.js.map +1 -1
  7. package/build/src/amf/ApiSchemaValues.d.ts +2 -0
  8. package/build/src/amf/ApiSchemaValues.js +29 -23
  9. package/build/src/amf/ApiSchemaValues.js.map +1 -1
  10. package/build/src/authorization/lib/Utils.d.ts +1 -1
  11. package/build/src/cookies/CookieJar.d.ts +23 -0
  12. package/build/src/cookies/CookieJar.js +3 -0
  13. package/build/src/cookies/CookieJar.js.map +1 -0
  14. package/build/src/cookies/CookieParser.d.ts +67 -0
  15. package/build/src/cookies/CookieParser.js +316 -0
  16. package/build/src/cookies/CookieParser.js.map +1 -0
  17. package/build/src/cookies/InMemoryCookieJar.d.ts +12 -0
  18. package/build/src/cookies/InMemoryCookieJar.js +68 -0
  19. package/build/src/cookies/InMemoryCookieJar.js.map +1 -0
  20. package/build/src/cookies/Punycode.d.ts +12 -0
  21. package/build/src/cookies/Punycode.js +124 -0
  22. package/build/src/cookies/Punycode.js.map +1 -0
  23. package/build/src/data/RequestDataExtractor.d.ts +8 -7
  24. package/build/src/data/RequestDataExtractor.js +8 -10
  25. package/build/src/data/RequestDataExtractor.js.map +1 -1
  26. package/build/src/events/CustomEvent.js +5 -0
  27. package/build/src/events/CustomEvent.js.map +1 -1
  28. package/build/src/events/EventTypes.d.ts +43 -43
  29. package/build/src/events/amf/AmfEventTypes.d.ts +4 -4
  30. package/build/src/events/authorization/AuthorizationEventTypes.d.ts +4 -4
  31. package/build/src/events/cookies/CookieEventTypes.d.ts +9 -9
  32. package/build/src/events/encryption/EncryptionEventTypes.d.ts +2 -2
  33. package/build/src/events/environment/EnvironmentEventTypes.d.ts +1 -1
  34. package/build/src/events/models/ModelEventTypes.d.ts +7 -7
  35. package/build/src/events/process/ProcessEventTypes.d.ts +3 -3
  36. package/build/src/events/reporting/ReportingEventTypes.d.ts +1 -1
  37. package/build/src/events/telemetry/TelemetryEventTypes.d.ts +6 -6
  38. package/build/src/events/transport/TransportEventTypes.d.ts +6 -6
  39. package/build/src/events/transport/TransportEvents.d.ts +2 -2
  40. package/build/src/mocking/ProjectMock.d.ts +3 -2
  41. package/build/src/mocking/ProjectMock.js +3 -3
  42. package/build/src/mocking/ProjectMock.js.map +1 -1
  43. package/build/src/mocking/lib/App.d.ts +36 -0
  44. package/build/src/mocking/lib/App.js +70 -0
  45. package/build/src/mocking/lib/App.js.map +1 -0
  46. package/build/src/models/{arc/ArcProject.d.ts → AppProject.d.ts} +296 -134
  47. package/build/src/models/{arc/ArcProject.js → AppProject.js} +436 -79
  48. package/build/src/models/AppProject.js.map +1 -0
  49. package/build/src/models/AppRequest.d.ts +69 -0
  50. package/build/src/models/AppRequest.js +150 -0
  51. package/build/src/models/AppRequest.js.map +1 -0
  52. package/build/src/models/ClientCertificate.d.ts +2 -2
  53. package/build/src/models/Environment.d.ts +8 -1
  54. package/build/src/models/Environment.js +21 -0
  55. package/build/src/models/Environment.js.map +1 -1
  56. package/build/src/models/HostRule.d.ts +2 -2
  57. package/build/src/models/HttpCookie.d.ts +63 -12
  58. package/build/src/models/HttpCookie.js +178 -44
  59. package/build/src/models/HttpCookie.js.map +1 -1
  60. package/build/src/models/HttpHistory.d.ts +8 -3
  61. package/build/src/models/HttpHistory.js +3 -3
  62. package/build/src/models/HttpHistory.js.map +1 -1
  63. package/build/src/models/HttpProject.d.ts +34 -1
  64. package/build/src/models/HttpProject.js +104 -8
  65. package/build/src/models/HttpProject.js.map +1 -1
  66. package/build/src/models/ProjectFolder.d.ts +2 -0
  67. package/build/src/models/ProjectFolder.js +14 -0
  68. package/build/src/models/ProjectFolder.js.map +1 -1
  69. package/build/src/models/ProjectItem.d.ts +2 -0
  70. package/build/src/models/ProjectItem.js +20 -0
  71. package/build/src/models/ProjectItem.js.map +1 -1
  72. package/build/src/models/ProjectParent.js.map +1 -1
  73. package/build/src/models/ProjectRequest.d.ts +3 -2
  74. package/build/src/models/ProjectRequest.js.map +1 -1
  75. package/build/src/models/Property.d.ts +2 -2
  76. package/build/src/models/Property.js +2 -2
  77. package/build/src/models/Property.js.map +1 -1
  78. package/build/src/models/Request.d.ts +16 -8
  79. package/build/src/models/Request.js +20 -15
  80. package/build/src/models/Request.js.map +1 -1
  81. package/build/src/models/RequestAuthorization.js.map +1 -1
  82. package/build/src/models/RequestUiMeta.d.ts +0 -14
  83. package/build/src/models/RequestUiMeta.js +1 -10
  84. package/build/src/models/RequestUiMeta.js.map +1 -1
  85. package/build/src/models/Server.d.ts +1 -2
  86. package/build/src/models/Server.js.map +1 -1
  87. package/build/src/models/http-actions/HttpActions.d.ts +256 -0
  88. package/build/src/models/http-actions/HttpActions.js +46 -0
  89. package/build/src/models/http-actions/HttpActions.js.map +1 -0
  90. package/build/src/models/http-actions/LegacyTranslator.d.ts +17 -0
  91. package/build/src/models/http-actions/LegacyTranslator.js +222 -0
  92. package/build/src/models/http-actions/LegacyTranslator.js.map +1 -0
  93. package/build/src/models/store/Backend.d.ts +136 -1
  94. package/build/src/models/store/File.d.ts +1 -1
  95. package/build/src/models/store/File.js +2 -0
  96. package/build/src/models/store/File.js.map +1 -1
  97. package/build/src/models/store/User.d.ts +3 -3
  98. package/build/src/runtime/http-engine/CoreEngine.d.ts +2 -0
  99. package/build/src/runtime/http-engine/CoreEngine.js +1 -0
  100. package/build/src/runtime/http-engine/CoreEngine.js.map +1 -1
  101. package/build/src/runtime/http-engine/HttpEngine.d.ts +13 -0
  102. package/build/src/runtime/http-engine/HttpEngine.js +39 -31
  103. package/build/src/runtime/http-engine/HttpEngine.js.map +1 -1
  104. package/build/src/runtime/{actions/ConditionRunner.d.ts → http-runner/ConditionCheck.d.ts} +2 -2
  105. package/build/src/runtime/{actions/ConditionRunner.js → http-runner/ConditionCheck.js} +2 -2
  106. package/build/src/runtime/http-runner/ConditionCheck.js.map +1 -0
  107. package/build/src/runtime/http-runner/HttpFlowRunner.d.ts +62 -0
  108. package/build/src/runtime/http-runner/HttpFlowRunner.js +217 -0
  109. package/build/src/runtime/http-runner/HttpFlowRunner.js.map +1 -0
  110. package/build/src/runtime/{node/RequestFactory.d.ts → http-runner/HttpRequestRunner.d.ts} +40 -54
  111. package/build/src/runtime/http-runner/HttpRequestRunner.js +316 -0
  112. package/build/src/runtime/http-runner/HttpRequestRunner.js.map +1 -0
  113. package/build/src/runtime/http-runner/HttpRuntimeEnvironment.d.ts +25 -0
  114. package/build/src/runtime/http-runner/HttpRuntimeEnvironment.js +2 -0
  115. package/build/src/runtime/http-runner/HttpRuntimeEnvironment.js.map +1 -0
  116. package/build/src/runtime/http-runner/RequestAuthorizationProcessor.d.ts +56 -0
  117. package/build/src/runtime/http-runner/RequestAuthorizationProcessor.js +143 -0
  118. package/build/src/runtime/http-runner/RequestAuthorizationProcessor.js.map +1 -0
  119. package/build/src/runtime/http-runner/RequestCookiesProcessor.d.ts +24 -0
  120. package/build/src/runtime/http-runner/RequestCookiesProcessor.js +65 -0
  121. package/build/src/runtime/http-runner/RequestCookiesProcessor.js.map +1 -0
  122. package/build/src/runtime/node/InteropInterfaces.d.ts +21 -6
  123. package/build/src/runtime/node/ProjectParallelRunner.js +3 -1
  124. package/build/src/runtime/node/ProjectParallelRunner.js.map +1 -1
  125. package/build/src/runtime/node/ProjectRequestRunner.d.ts +24 -10
  126. package/build/src/runtime/node/ProjectRequestRunner.js +116 -45
  127. package/build/src/runtime/node/ProjectRequestRunner.js.map +1 -1
  128. package/build/src/runtime/node/ProjectRunner.d.ts +5 -7
  129. package/build/src/runtime/node/ProjectRunner.js +30 -14
  130. package/build/src/runtime/node/ProjectRunner.js.map +1 -1
  131. package/build/src/runtime/node/ProjectRunnerWorker.js +3 -0
  132. package/build/src/runtime/node/ProjectRunnerWorker.js.map +1 -1
  133. package/build/src/runtime/reporters/Reporter.d.ts +5 -0
  134. package/build/src/runtime/reporters/Reporter.js.map +1 -1
  135. package/build/src/runtime/store/FilesSdk.js +4 -4
  136. package/build/src/runtime/store/FilesSdk.js.map +1 -1
  137. package/build/src/runtime/store/HistorySdk.js +1 -1
  138. package/build/src/runtime/store/HistorySdk.js.map +1 -1
  139. package/build/src/runtime/store/HttpClientSdk.d.ts +167 -0
  140. package/build/src/runtime/store/HttpClientSdk.js +624 -0
  141. package/build/src/runtime/store/HttpClientSdk.js.map +1 -0
  142. package/build/src/runtime/store/RouteBuilder.d.ts +17 -2
  143. package/build/src/runtime/store/RouteBuilder.js +60 -3
  144. package/build/src/runtime/store/RouteBuilder.js.map +1 -1
  145. package/build/src/runtime/store/Sdk.d.ts +5 -0
  146. package/build/src/runtime/store/Sdk.js +5 -0
  147. package/build/src/runtime/store/Sdk.js.map +1 -1
  148. package/build/src/runtime/store/SharedSdk.js +1 -1
  149. package/build/src/runtime/store/SharedSdk.js.map +1 -1
  150. package/build/src/runtime/store/UsersSdk.js +1 -1
  151. package/build/src/runtime/store/UsersSdk.js.map +1 -1
  152. package/package.json +2 -2
  153. package/src/amf/ApiSchemaValues.ts +41 -33
  154. package/src/cookies/CookieJar.ts +26 -0
  155. package/src/cookies/CookieParser.ts +327 -0
  156. package/src/cookies/InMemoryCookieJar.ts +70 -0
  157. package/src/cookies/Punycode.ts +133 -0
  158. package/src/data/RequestDataExtractor.ts +14 -15
  159. package/src/events/CustomEvent.ts +4 -0
  160. package/src/mocking/ProjectMock.ts +4 -3
  161. package/src/mocking/lib/App.ts +101 -0
  162. package/src/models/{arc/ArcProject.ts → AppProject.ts} +671 -225
  163. package/src/models/AppRequest.ts +176 -0
  164. package/src/models/ClientCertificate.ts +2 -2
  165. package/src/models/Environment.ts +24 -2
  166. package/src/models/HostRule.ts +2 -2
  167. package/src/models/HttpCookie.ts +210 -48
  168. package/src/models/HttpHistory.ts +12 -5
  169. package/src/models/HttpProject.ts +113 -10
  170. package/src/models/ProjectFolder.ts +16 -0
  171. package/src/models/ProjectItem.ts +18 -0
  172. package/src/models/ProjectParent.ts +4 -1
  173. package/src/models/ProjectRequest.ts +4 -3
  174. package/src/models/Property.ts +4 -4
  175. package/src/models/Request.ts +29 -19
  176. package/src/models/RequestAuthorization.ts +4 -4
  177. package/src/models/RequestUiMeta.ts +1 -21
  178. package/src/models/Server.ts +1 -2
  179. package/src/models/http-actions/HttpActions.ts +270 -0
  180. package/src/models/http-actions/LegacyTranslator.ts +223 -0
  181. package/src/models/store/Backend.ts +148 -2
  182. package/src/models/store/File.ts +3 -1
  183. package/src/models/store/User.ts +3 -3
  184. package/src/runtime/http-engine/CoreEngine.ts +3 -2
  185. package/src/runtime/http-engine/HttpEngine.ts +48 -30
  186. package/src/runtime/{actions/ConditionRunner.ts → http-runner/ConditionCheck.ts} +3 -3
  187. package/src/runtime/http-runner/HttpFlowRunner.ts +232 -0
  188. package/src/runtime/http-runner/HttpRequestRunner.ts +353 -0
  189. package/src/runtime/http-runner/HttpRuntimeEnvironment.ts +27 -0
  190. package/src/runtime/http-runner/RequestAuthorizationProcessor.ts +144 -0
  191. package/src/runtime/http-runner/RequestCookiesProcessor.ts +74 -0
  192. package/src/runtime/node/InteropInterfaces.ts +24 -6
  193. package/src/runtime/node/ProjectParallelRunner.ts +4 -2
  194. package/src/runtime/node/ProjectRequestRunner.ts +130 -60
  195. package/src/runtime/node/ProjectRunner.ts +37 -22
  196. package/src/runtime/node/ProjectRunnerWorker.ts +3 -0
  197. package/src/runtime/reporters/Reporter.ts +5 -0
  198. package/src/runtime/store/FilesSdk.ts +4 -4
  199. package/src/runtime/store/HistorySdk.ts +1 -1
  200. package/src/runtime/store/HttpClientSdk.ts +629 -0
  201. package/src/runtime/store/RouteBuilder.ts +75 -3
  202. package/src/runtime/store/Sdk.ts +6 -0
  203. package/src/runtime/store/SharedSdk.ts +1 -1
  204. package/src/runtime/store/UsersSdk.ts +1 -1
  205. package/build/src/lib/cookies/Cookie.d.ts +0 -123
  206. package/build/src/lib/cookies/Cookie.js +0 -257
  207. package/build/src/lib/cookies/Cookie.js.map +0 -1
  208. package/build/src/lib/cookies/Cookies.d.ts +0 -90
  209. package/build/src/lib/cookies/Cookies.js +0 -310
  210. package/build/src/lib/cookies/Cookies.js.map +0 -1
  211. package/build/src/lib/cookies/Utils.d.ts +0 -47
  212. package/build/src/lib/cookies/Utils.js +0 -163
  213. package/build/src/lib/cookies/Utils.js.map +0 -1
  214. package/build/src/mocking/lib/Arc.d.ts +0 -10
  215. package/build/src/mocking/lib/Arc.js +0 -31
  216. package/build/src/mocking/lib/Arc.js.map +0 -1
  217. package/build/src/models/RequestActions.d.ts +0 -65
  218. package/build/src/models/RequestActions.js +0 -114
  219. package/build/src/models/RequestActions.js.map +0 -1
  220. package/build/src/models/actions/Action.d.ts +0 -75
  221. package/build/src/models/actions/Action.js +0 -188
  222. package/build/src/models/actions/Action.js.map +0 -1
  223. package/build/src/models/actions/ActionView.d.ts +0 -15
  224. package/build/src/models/actions/ActionView.js +0 -33
  225. package/build/src/models/actions/ActionView.js.map +0 -1
  226. package/build/src/models/actions/Condition.d.ts +0 -81
  227. package/build/src/models/actions/Condition.js +0 -185
  228. package/build/src/models/actions/Condition.js.map +0 -1
  229. package/build/src/models/actions/ConditionView.d.ts +0 -17
  230. package/build/src/models/actions/ConditionView.js +0 -34
  231. package/build/src/models/actions/ConditionView.js.map +0 -1
  232. package/build/src/models/actions/Enums.d.ts +0 -26
  233. package/build/src/models/actions/Enums.js +0 -31
  234. package/build/src/models/actions/Enums.js.map +0 -1
  235. package/build/src/models/actions/RunnableAction.d.ts +0 -59
  236. package/build/src/models/actions/RunnableAction.js +0 -106
  237. package/build/src/models/actions/RunnableAction.js.map +0 -1
  238. package/build/src/models/actions/runnable/DeleteCookieAction.d.ts +0 -44
  239. package/build/src/models/actions/runnable/DeleteCookieAction.js +0 -92
  240. package/build/src/models/actions/runnable/DeleteCookieAction.js.map +0 -1
  241. package/build/src/models/actions/runnable/Runnable.d.ts +0 -8
  242. package/build/src/models/actions/runnable/Runnable.js +0 -4
  243. package/build/src/models/actions/runnable/Runnable.js.map +0 -1
  244. package/build/src/models/actions/runnable/SetCookieAction.d.ts +0 -87
  245. package/build/src/models/actions/runnable/SetCookieAction.js +0 -176
  246. package/build/src/models/actions/runnable/SetCookieAction.js.map +0 -1
  247. package/build/src/models/actions/runnable/SetVariableAction.d.ts +0 -31
  248. package/build/src/models/actions/runnable/SetVariableAction.js +0 -63
  249. package/build/src/models/actions/runnable/SetVariableAction.js.map +0 -1
  250. package/build/src/models/actions/runnable/index.d.ts +0 -7
  251. package/build/src/models/actions/runnable/index.js +0 -2
  252. package/build/src/models/actions/runnable/index.js.map +0 -1
  253. package/build/src/models/arc/ArcHttpRequest.d.ts +0 -39
  254. package/build/src/models/arc/ArcHttpRequest.js +0 -106
  255. package/build/src/models/arc/ArcHttpRequest.js.map +0 -1
  256. package/build/src/models/arc/ArcProject.js.map +0 -1
  257. package/build/src/runtime/actions/ActionRunner.d.ts +0 -17
  258. package/build/src/runtime/actions/ActionRunner.js +0 -74
  259. package/build/src/runtime/actions/ActionRunner.js.map +0 -1
  260. package/build/src/runtime/actions/ConditionRunner.js.map +0 -1
  261. package/build/src/runtime/actions/RunnableCondition.d.ts +0 -27
  262. package/build/src/runtime/actions/RunnableCondition.js +0 -50
  263. package/build/src/runtime/actions/RunnableCondition.js.map +0 -1
  264. package/build/src/runtime/actions/runnable/ActionRunnable.d.ts +0 -13
  265. package/build/src/runtime/actions/runnable/ActionRunnable.js +0 -13
  266. package/build/src/runtime/actions/runnable/ActionRunnable.js.map +0 -1
  267. package/build/src/runtime/actions/runnable/DeleteCookieRunnable.d.ts +0 -7
  268. package/build/src/runtime/actions/runnable/DeleteCookieRunnable.js +0 -36
  269. package/build/src/runtime/actions/runnable/DeleteCookieRunnable.js.map +0 -1
  270. package/build/src/runtime/actions/runnable/SetCookieRunnable.d.ts +0 -10
  271. package/build/src/runtime/actions/runnable/SetCookieRunnable.js +0 -89
  272. package/build/src/runtime/actions/runnable/SetCookieRunnable.js.map +0 -1
  273. package/build/src/runtime/actions/runnable/SetVariableRunnable.d.ts +0 -10
  274. package/build/src/runtime/actions/runnable/SetVariableRunnable.js +0 -49
  275. package/build/src/runtime/actions/runnable/SetVariableRunnable.js.map +0 -1
  276. package/build/src/runtime/modules/BasicAuthCache.d.ts +0 -39
  277. package/build/src/runtime/modules/BasicAuthCache.js +0 -122
  278. package/build/src/runtime/modules/BasicAuthCache.js.map +0 -1
  279. package/build/src/runtime/modules/ExecutionResponse.d.ts +0 -4
  280. package/build/src/runtime/modules/ExecutionResponse.js +0 -6
  281. package/build/src/runtime/modules/ExecutionResponse.js.map +0 -1
  282. package/build/src/runtime/modules/ModulesRegistry.d.ts +0 -93
  283. package/build/src/runtime/modules/ModulesRegistry.js +0 -69
  284. package/build/src/runtime/modules/ModulesRegistry.js.map +0 -1
  285. package/build/src/runtime/modules/RequestAuthorization.d.ts +0 -6
  286. package/build/src/runtime/modules/RequestAuthorization.js +0 -110
  287. package/build/src/runtime/modules/RequestAuthorization.js.map +0 -1
  288. package/build/src/runtime/modules/RequestCookies.d.ts +0 -17
  289. package/build/src/runtime/modules/RequestCookies.js +0 -134
  290. package/build/src/runtime/modules/RequestCookies.js.map +0 -1
  291. package/build/src/runtime/node/RequestFactory.js +0 -406
  292. package/build/src/runtime/node/RequestFactory.js.map +0 -1
  293. package/build/src/runtime/node/VariablesStore.d.ts +0 -9
  294. package/build/src/runtime/node/VariablesStore.js +0 -19
  295. package/build/src/runtime/node/VariablesStore.js.map +0 -1
  296. package/src/lib/cookies/Cookie.ts +0 -312
  297. package/src/lib/cookies/Cookies.ts +0 -326
  298. package/src/lib/cookies/Utils.ts +0 -168
  299. package/src/mocking/lib/Arc.ts +0 -34
  300. package/src/models/RequestActions.ts +0 -161
  301. package/src/models/actions/Action.ts +0 -213
  302. package/src/models/actions/ActionView.ts +0 -40
  303. package/src/models/actions/Condition.ts +0 -207
  304. package/src/models/actions/ConditionView.ts +0 -42
  305. package/src/models/actions/Enums.ts +0 -29
  306. package/src/models/actions/RunnableAction.ts +0 -144
  307. package/src/models/actions/runnable/DeleteCookieAction.ts +0 -113
  308. package/src/models/actions/runnable/Runnable.ts +0 -9
  309. package/src/models/actions/runnable/SetCookieAction.ts +0 -216
  310. package/src/models/actions/runnable/SetVariableAction.ts +0 -81
  311. package/src/models/arc/ArcHttpRequest.ts +0 -121
  312. package/src/models/arc/readme.md +0 -3
  313. package/src/runtime/actions/ActionRunner.ts +0 -83
  314. package/src/runtime/actions/RunnableCondition.ts +0 -56
  315. package/src/runtime/actions/runnable/ActionRunnable.ts +0 -19
  316. package/src/runtime/actions/runnable/DeleteCookieRunnable.ts +0 -39
  317. package/src/runtime/actions/runnable/SetCookieRunnable.ts +0 -92
  318. package/src/runtime/actions/runnable/SetVariableRunnable.ts +0 -53
  319. package/src/runtime/modules/BasicAuthCache.ts +0 -129
  320. package/src/runtime/modules/ExecutionResponse.ts +0 -4
  321. package/src/runtime/modules/ModulesRegistry.ts +0 -136
  322. package/src/runtime/modules/RequestAuthorization.ts +0 -106
  323. package/src/runtime/modules/RequestCookies.ts +0 -146
  324. package/src/runtime/node/RequestFactory.ts +0 -432
  325. package/src/runtime/node/VariablesStore.ts +0 -25
@@ -10,10 +10,10 @@ export class RouteBuilder {
10
10
  }
11
11
 
12
12
  /**
13
- * @returns The path to the /files/bulk route.
13
+ * @returns The path to the /files/batch route.
14
14
  */
15
- static filesBulk(): string {
16
- return '/files/bulk';
15
+ static filesBatch(): string {
16
+ return '/files/batch';
17
17
  }
18
18
 
19
19
  /**
@@ -83,4 +83,76 @@ export class RouteBuilder {
83
83
  static shared(): string {
84
84
  return '/shared';
85
85
  }
86
+
87
+ static app(appId: string): string {
88
+ return `/app/${appId}`;
89
+ }
90
+
91
+ // GET, POST
92
+ static appRequests(appId: string): string {
93
+ return `${this.app(appId)}/requests`;
94
+ }
95
+
96
+ // GET, DELETE
97
+ static appRequestItem(appId: string, key: string): string {
98
+ return `${this.appRequests(appId)}${key}`;
99
+ }
100
+
101
+ static appRequestsBatch(appId: string): string {
102
+ return `${this.appRequests(appId)}/batch`;
103
+ }
104
+
105
+ // POST
106
+ static appRequestsBatchCreate(appId: string): string {
107
+ return `${this.appRequestsBatch(appId)}/create`;
108
+ }
109
+
110
+ // POST
111
+ static appRequestsBatchRead(appId: string): string {
112
+ return `${this.appRequestsBatch(appId)}/read`;
113
+ }
114
+
115
+ // POST
116
+ static appRequestsBatchDelete(appId: string): string {
117
+ return `${this.appRequestsBatch(appId)}/delete`;
118
+ }
119
+
120
+ // POST
121
+ static appRequestsBatchUndelete(appId: string): string {
122
+ return `${this.appRequestsBatch(appId)}/undelete`;
123
+ }
124
+
125
+ // POST, GET
126
+ static appProjects(appId: string): string {
127
+ return `${this.app(appId)}/projects`;
128
+ }
129
+
130
+ // GET, DELETE
131
+ static appProjectItem(appId: string, key: string): string {
132
+ return `${this.appProjects(appId)}${key}`;
133
+ }
134
+
135
+ static appProjectsBatch(appId: string): string {
136
+ return `${this.appProjects(appId)}/batch`;
137
+ }
138
+
139
+ // POST
140
+ static appProjectsBatchCreate(appId: string): string {
141
+ return `${this.appProjectsBatch(appId)}/create`;
142
+ }
143
+
144
+ // POST
145
+ static appProjectsBatchRead(appId: string): string {
146
+ return `${this.appProjectsBatch(appId)}/read`;
147
+ }
148
+
149
+ // POST
150
+ static appProjectsBatchDelete(appId: string): string {
151
+ return `${this.appProjectsBatch(appId)}/delete`;
152
+ }
153
+
154
+ // POST
155
+ static appProjectsBatchUndelete(appId: string): string {
156
+ return `${this.appProjectsBatch(appId)}/undelete`;
157
+ }
86
158
  }
@@ -7,6 +7,7 @@ import { FilesSdk } from './FilesSdk.js';
7
7
  import { UsersSdk } from './UsersSdk.js';
8
8
  import { HistorySdk } from './HistorySdk.js';
9
9
  import { SharedSdk } from './SharedSdk.js';
10
+ import { AppSdk } from './HttpClientSdk.js';
10
11
 
11
12
  const baseUriSymbol = Symbol('baseUri');
12
13
 
@@ -51,6 +52,11 @@ export abstract class Sdk {
51
52
  */
52
53
  shared = new SharedSdk(this);
53
54
 
55
+ /**
56
+ * HTTP Client app specific SDK.
57
+ */
58
+ app = new AppSdk(this);
59
+
54
60
  /**
55
61
  * When set it limits log output to minimum.
56
62
  */
@@ -43,7 +43,7 @@ export class SharedSdk extends SdkBase {
43
43
  err.response = result.body;
44
44
  throw err;
45
45
  }
46
- if (!Array.isArray(data.data)) {
46
+ if (!Array.isArray(data.items)) {
47
47
  const err = new SdkError(`${E_PREFIX}${E_RESPONSE_UNKNOWN}.`, 0);
48
48
  err.response = result.body;
49
49
  throw err;
@@ -59,7 +59,7 @@ export class UsersSdk extends SdkBase {
59
59
  } catch (e) {
60
60
  throw new Error(`${E_PREFIX}${E_INVALID_JSON}.`);
61
61
  }
62
- if (!Array.isArray(data.data)) {
62
+ if (!Array.isArray(data.items)) {
63
63
  throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}.`);
64
64
  }
65
65
  return data;
@@ -1,123 +0,0 @@
1
- import { CookieSameSiteType } from '../../models/HttpCookie.js';
2
- /**
3
- * Cookie creation options.
4
- */
5
- export interface CookieOptions {
6
- 'max-age'?: number;
7
- /**
8
- * When the cookie expires.
9
- * Note that this value is parsed to a timestamp in the Cookie class.
10
- */
11
- expires?: Date | number | string;
12
- /**
13
- * A string representing the domain the cookie belongs to
14
- * (e.g. "www.google.com", "example.com")
15
- */
16
- domain?: string;
17
- /**
18
- * Cookie path
19
- */
20
- path?: string;
21
- /**
22
- * A boolean, `true` if the cookie is marked as secure
23
- * (i.e. its scope is limited to secure channels, typically HTTPS),
24
- * or `false` otherwise.
25
- */
26
- secure?: boolean;
27
- /**
28
- * A boolean, `true` if the cookie is marked as HttpOnly
29
- * (i.e. the cookie is inaccessible to client-side scripts),
30
- * or `false` otherwise.
31
- */
32
- httpOnly?: boolean;
33
- /**
34
- * A boolean, `true` if the cookie is a `host-only` cookie
35
- * (i.e. the request's host must exactly match the domain of the cookie),
36
- * or `false` otherwise.
37
- */
38
- hostOnly?: boolean;
39
- /**
40
- * The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context.
41
- */
42
- sameSite?: CookieSameSiteType;
43
- }
44
- /**
45
- * A Cookie object.
46
- * It is based on https://github.com/pillarjs/cookies/blob/master/lib/cookies.js
47
- */
48
- export declare class Cookie {
49
- protected _maxAge?: number;
50
- protected _expires: number;
51
- protected _domain?: string;
52
- name: string;
53
- value: string;
54
- created: number;
55
- lastAccess: number;
56
- persistent?: boolean;
57
- hostOnly?: boolean;
58
- path?: string;
59
- secure?: boolean;
60
- httpOnly?: boolean;
61
- sameSite?: CookieSameSiteType;
62
- /**
63
- * Constructs a new cookie.
64
- *
65
- * @param name Cookie name
66
- * @param value Cookie value
67
- * @param opts Additional cookie attributes.
68
- */
69
- constructor(name: string, value?: string, opts?: CookieOptions);
70
- /**
71
- * @param max The max age value
72
- */
73
- set maxAge(max: number | undefined);
74
- /**
75
- * @return Returns a value of maxAge property
76
- */
77
- get maxAge(): number | undefined;
78
- get ['max-age'](): number | undefined;
79
- set ['max-age'](value: number | undefined);
80
- /**
81
- * @param expires The value for expires
82
- */
83
- set expires(expires: number | Date | string);
84
- /**
85
- * @return the current expires value
86
- */
87
- get expires(): number;
88
- /**
89
- * @param domain The cookie domain
90
- */
91
- set domain(domain: string | undefined);
92
- /**
93
- * @return The cookie domain
94
- */
95
- get domain(): string | undefined;
96
- get samesite(): CookieSameSiteType | undefined;
97
- set samesite(value: CookieSameSiteType | undefined);
98
- get httponly(): boolean | undefined;
99
- set httponly(value: boolean | undefined);
100
- get hostonly(): boolean | undefined;
101
- set hostonly(value: boolean | undefined);
102
- /**
103
- * @return Cookie's `name=value` string.
104
- */
105
- toString(): string;
106
- /**
107
- * Returns a Cookie as a HTTP header string.
108
- * @return Cookie string as a HTTP header value
109
- */
110
- toHeader(): string;
111
- /**
112
- * Override toJSON behaviour so it will eliminate
113
- * all _* properties and replace it with a proper ones.
114
- *
115
- * @return {object}
116
- */
117
- toJSON(): Record<string, string>;
118
- /**
119
- * Sets value for `expirers` propr from other types.
120
- * @param expires The value for `expires`
121
- */
122
- setExpires(expires: Date | string | number): void;
123
- }
@@ -1,257 +0,0 @@
1
- /* eslint-disable no-control-regex */
2
- const fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
3
- /**
4
- * A Cookie object.
5
- * It is based on https://github.com/pillarjs/cookies/blob/master/lib/cookies.js
6
- */
7
- export class Cookie {
8
- _maxAge;
9
- _expires;
10
- _domain;
11
- name;
12
- value;
13
- created;
14
- lastAccess;
15
- persistent;
16
- hostOnly;
17
- path;
18
- secure;
19
- httpOnly;
20
- sameSite;
21
- /**
22
- * Constructs a new cookie.
23
- *
24
- * @param name Cookie name
25
- * @param value Cookie value
26
- * @param opts Additional cookie attributes.
27
- */
28
- constructor(name, value = '', opts = {}) {
29
- if (!fieldContentRegExp.test(name)) {
30
- throw new TypeError('Argument `name` is invalid');
31
- }
32
- if (value && !fieldContentRegExp.test(value)) {
33
- throw new TypeError('Argument `value` is invalid');
34
- }
35
- if (opts.path && !fieldContentRegExp.test(opts.path)) {
36
- throw new TypeError('Option `path` is invalid');
37
- }
38
- if (opts.domain && !fieldContentRegExp.test(opts.domain)) {
39
- throw new TypeError('Option `domain` is invalid');
40
- }
41
- this._expires = 0;
42
- this._domain = undefined;
43
- this._maxAge = undefined;
44
- this.name = name;
45
- this.value = value;
46
- this.created = Date.now();
47
- this.lastAccess = this.created;
48
- if ('max-age' in opts) {
49
- this.maxAge = opts['max-age'];
50
- }
51
- else if (typeof opts.expires !== 'undefined') {
52
- this.setExpires(opts.expires);
53
- }
54
- else {
55
- this.persistent = false;
56
- // see http://stackoverflow.com/a/11526569/1127848
57
- this._expires = new Date(8640000000000000).getTime();
58
- }
59
- if ('hostOnly' in opts) {
60
- this.hostOnly = opts.hostOnly;
61
- }
62
- if ('domain' in opts) {
63
- this.domain = opts.domain;
64
- }
65
- else {
66
- this.hostOnly = false;
67
- }
68
- if ('path' in opts) {
69
- this.path = opts.path;
70
- }
71
- if ('secure' in opts) {
72
- this.secure = opts.secure;
73
- }
74
- if ('httpOnly' in opts) {
75
- this.httpOnly = opts.httpOnly;
76
- }
77
- if ('sameSite' in opts) {
78
- this.sameSite = opts.sameSite;
79
- }
80
- }
81
- /**
82
- * @param max The max age value
83
- */
84
- set maxAge(max) {
85
- const typedMax = Number(max);
86
- if (Number.isNaN(typedMax)) {
87
- return;
88
- }
89
- this._maxAge = typedMax;
90
- if (typedMax <= 0) {
91
- // see http://stackoverflow.com/a/11526569/1127848
92
- // and https://tools.ietf.org/html/rfc6265#section-5.2.2
93
- this._expires = new Date(-8640000000000000).getTime();
94
- }
95
- else {
96
- let now = Date.now();
97
- now += typedMax * 1000;
98
- this._expires = now;
99
- }
100
- this.persistent = true;
101
- }
102
- /**
103
- * @return Returns a value of maxAge property
104
- */
105
- get maxAge() {
106
- return this._maxAge;
107
- }
108
- get ['max-age']() {
109
- return this.maxAge;
110
- }
111
- set ['max-age'](value) {
112
- this.maxAge = value;
113
- }
114
- /**
115
- * @param expires The value for expires
116
- */
117
- set expires(expires) {
118
- const any = expires;
119
- if ((expires && typeof any === 'string') || any instanceof Date) {
120
- this.setExpires(any);
121
- return;
122
- }
123
- this._expires = expires;
124
- this.persistent = true;
125
- }
126
- /**
127
- * @return the current expires value
128
- */
129
- get expires() {
130
- return this._expires;
131
- }
132
- /**
133
- * @param domain The cookie domain
134
- */
135
- set domain(domain) {
136
- this._domain = domain;
137
- if (!domain) {
138
- this.hostOnly = false;
139
- }
140
- else {
141
- this.hostOnly = true;
142
- }
143
- }
144
- /**
145
- * @return The cookie domain
146
- */
147
- get domain() {
148
- return this._domain;
149
- }
150
- get samesite() {
151
- return this.sameSite;
152
- }
153
- set samesite(value) {
154
- this.sameSite = value;
155
- }
156
- get httponly() {
157
- return this.httpOnly;
158
- }
159
- set httponly(value) {
160
- this.httpOnly = value;
161
- }
162
- get hostonly() {
163
- return this.hostOnly;
164
- }
165
- set hostonly(value) {
166
- this.hostOnly = value;
167
- }
168
- /**
169
- * @return Cookie's `name=value` string.
170
- */
171
- toString() {
172
- const { name, value } = this;
173
- return `${name}=${value}`;
174
- }
175
- /**
176
- * Returns a Cookie as a HTTP header string.
177
- * @return Cookie string as a HTTP header value
178
- */
179
- toHeader() {
180
- let header = this.toString();
181
- let expires;
182
- if (this._expires) {
183
- expires = new Date(this._expires);
184
- if (expires.toString() === 'Invalid Date') {
185
- expires = new Date(0);
186
- }
187
- }
188
- if (expires) {
189
- header += `; expires=${expires.toUTCString()}`;
190
- }
191
- const { path, domain, httpOnly, sameSite, secure } = this;
192
- if (path) {
193
- header += `; path=${path}`;
194
- }
195
- if (domain) {
196
- header += `; domain=${domain}`;
197
- }
198
- if (httpOnly) {
199
- header += `; httpOnly=${httpOnly}`;
200
- }
201
- if (sameSite) {
202
- header += `; SameSite=${sameSite}`;
203
- }
204
- if (secure) {
205
- header += `; Secure`;
206
- }
207
- return header;
208
- }
209
- /**
210
- * Override toJSON behaviour so it will eliminate
211
- * all _* properties and replace it with a proper ones.
212
- *
213
- * @return {object}
214
- */
215
- toJSON() {
216
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
217
- const copy = {};
218
- const keys = Object.keys(this);
219
- keys.forEach((key) => {
220
- if (key.indexOf('_') === 0) {
221
- const realKey = key.substring(1);
222
- copy[realKey] = this[key];
223
- }
224
- else {
225
- copy[key] = this[key];
226
- }
227
- });
228
- return copy;
229
- }
230
- /**
231
- * Sets value for `expirers` propr from other types.
232
- * @param expires The value for `expires`
233
- */
234
- setExpires(expires) {
235
- let value;
236
- if (expires instanceof Date) {
237
- value = expires.getTime();
238
- }
239
- else if (typeof expires === 'string') {
240
- const tmp = new Date(expires);
241
- if (tmp.toString() === 'Invalid Date') {
242
- value = 0;
243
- }
244
- else {
245
- value = tmp.getTime();
246
- }
247
- }
248
- else if (typeof expires === 'number') {
249
- value = expires;
250
- }
251
- else {
252
- value = 0;
253
- }
254
- this.expires = value;
255
- }
256
- }
257
- //# sourceMappingURL=Cookie.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Cookie.js","sourceRoot":"","sources":["../../../../src/lib/cookies/Cookie.ts"],"names":[],"mappings":"AA6CA,qCAAqC;AACrC,MAAM,kBAAkB,GAAG,uCAAuC,CAAC;AAEnE;;;GAGG;AACH,MAAM,OAAO,MAAM;IACP,OAAO,CAAU;IACjB,QAAQ,CAAS;IACjB,OAAO,CAAU;IAC3B,IAAI,CAAS;IACb,KAAK,CAAS;IACd,OAAO,CAAS;IAChB,UAAU,CAAS;IACnB,UAAU,CAAW;IACrB,QAAQ,CAAW;IACnB,IAAI,CAAU;IACd,MAAM,CAAW;IACjB,QAAQ,CAAW;IACnB,QAAQ,CAAsB;IAE9B;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,KAAK,GAAG,EAAE,EAAE,OAAsB,EAAE;QAC5D,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAClC,MAAM,IAAI,SAAS,CAAC,4BAA4B,CAAC,CAAC;SACnD;QACD,IAAI,KAAK,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YAC5C,MAAM,IAAI,SAAS,CAAC,6BAA6B,CAAC,CAAC;SACpD;QACD,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACpD,MAAM,IAAI,SAAS,CAAC,0BAA0B,CAAC,CAAC;SACjD;QACD,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACxD,MAAM,IAAI,SAAS,CAAC,4BAA4B,CAAC,CAAC;SACnD;QACD,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,SAAS,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,KAAa,CAAC;QAClB,IAAI,OAAO,YAAY,IAAI,EAAE;YAC3B,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;SAC3B;aAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YACtC,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;YAC9B,IAAI,GAAG,CAAC,QAAQ,EAAE,KAAK,cAAc,EAAE;gBACrC,KAAK,GAAG,CAAC,CAAC;aACX;iBAAM;gBACL,KAAK,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;aACvB;SACF;aAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YACtC,KAAK,GAAG,OAAO,CAAC;SACjB;aAAM;YACL,KAAK,GAAG,CAAC,CAAC;SACX;QACD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;CACF"}
@@ -1,90 +0,0 @@
1
- import { Cookie, CookieOptions } from './Cookie.js';
2
- export declare const urlSymbol: unique symbol;
3
- /**
4
- * A library to handle Cookie parsing.
5
- */
6
- export declare class Cookies {
7
- cookies: Cookie[];
8
- uri: URL | undefined;
9
- [urlSymbol]: string | undefined;
10
- /**
11
- * Constructs an object.
12
- *
13
- * @param header A HTTP cookie string to parse.
14
- * @param url A request url for this cookie. If empty some cookie computations (like checking if cookies matches) will be omitted.
15
- */
16
- constructor(header?: string, url?: string);
17
- /**
18
- * Set's the URL and parses it setting `uri` property.
19
- * @param url Cookie URL
20
- */
21
- set url(url: string | undefined);
22
- /**
23
- * @returns {string} Cookie URL
24
- */
25
- get url(): string | undefined;
26
- /**
27
- * Parses a cookie string to a list of Cookie objects.
28
- *
29
- * @param cookies A HTTP cookie string
30
- * @returns List of parsed cookies.
31
- */
32
- static parse(cookies: string): Cookie[];
33
- /**
34
- * Get a cookie by name.
35
- *
36
- * @param name Cookie name
37
- * @returns A Cookie object or null.
38
- */
39
- get(name: string): Cookie | null;
40
- /**
41
- * Adds a cookie to the list of cookies.
42
- *
43
- * @param name Name of the cookie.
44
- * @param value Value of the cookie.
45
- * @param opts Other cookie options to set.
46
- */
47
- set(name: string, value?: string, opts?: CookieOptions): void;
48
- /**
49
- * Returns a string that can be used in a HTTP header value for Cookie.
50
- * The structure of the cookie string depends on if you want to send a
51
- * cookie from the server to client or other way around.
52
- * When you want to send the `Cookie` header to server set
53
- * `toServer` argument to true. Then it will produce only `name=value;`
54
- * string. Otherwise it will be the `Set-Cookie` header value
55
- * containing all other cookies properties.
56
- *
57
- * @param toServer True if produced string is to be used with the `Cookie` header
58
- * @returns HTTP header string value for all cookies.
59
- */
60
- toString(toServer?: boolean): string;
61
- /**
62
- * Removes cookies from `this.cookies` that has been set for different
63
- * domain and path.
64
- * This function has no effect if the URL is not set.
65
- *
66
- * This function follows an algorithm defined in https://tools.ietf.org/html/rfc6265 for
67
- * domain match.
68
- *
69
- * @returns A list of removed cookies.
70
- */
71
- filter(): Cookie[];
72
- /**
73
- * Merges this cookies with another Cookies object.
74
- * This cookies will be overwritten by passed cookies according to
75
- * the HTTP spec.
76
- * This function is useful when you need to override cookies with
77
- * the response from the server
78
- * as defined in the https://tools.ietf.org/html/rfc6265.
79
- *
80
- * @param cookies An Cookies object with newest cookies.
81
- * @param copyKeys When set, it copies values for given keys from old object to the new one.
82
- */
83
- merge(cookies: Cookies, copyKeys?: (keyof Cookie)[]): void;
84
- /**
85
- * Clears cookies from `this.cookies` that already expired.
86
- *
87
- * @returns List of removed (expired) cookies.
88
- */
89
- clearExpired(): Cookie[];
90
- }