@api-client/core 0.3.12 → 0.4.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 (262) hide show
  1. package/build/browser.d.ts +4 -5
  2. package/build/browser.js +4 -5
  3. package/build/browser.js.map +1 -1
  4. package/build/index.d.ts +5 -6
  5. package/build/index.js +5 -6
  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 +1 -1
  16. package/build/src/mocking/lib/Request.d.ts +2 -2
  17. package/build/src/mocking/lib/Request.js +3 -2
  18. package/build/src/mocking/lib/Request.js.map +1 -1
  19. package/build/src/mocking/lib/Response.d.ts +6 -6
  20. package/build/src/mocking/lib/Response.js +6 -6
  21. package/build/src/mocking/lib/Response.js.map +1 -1
  22. package/build/src/mocking/lib/User.js +3 -0
  23. package/build/src/mocking/lib/User.js.map +1 -1
  24. package/build/src/models/AuthorizationData.d.ts +2 -2
  25. package/build/src/models/AuthorizationData.js +2 -2
  26. package/build/src/models/ClientCertificate.d.ts +1 -1
  27. package/build/src/models/Environment.d.ts +3 -3
  28. package/build/src/models/Environment.js +3 -3
  29. package/build/src/models/Environment.js.map +1 -1
  30. package/build/src/models/ErrorResponse.d.ts +1 -1
  31. package/build/src/models/ErrorResponse.js +1 -1
  32. package/build/src/models/HistoryIndex.d.ts +3 -1
  33. package/build/src/models/HistoryIndex.js +3 -0
  34. package/build/src/models/HistoryIndex.js.map +1 -1
  35. package/build/src/models/HostRule.d.ts +4 -4
  36. package/build/src/models/HostRule.js +4 -4
  37. package/build/src/models/HostRule.js.map +1 -1
  38. package/build/src/models/HttpHistory.d.ts +1 -1
  39. package/build/src/models/HttpHistory.js +1 -1
  40. package/build/src/models/HttpHistory.js.map +1 -1
  41. package/build/src/models/HttpProject.d.ts +4 -5
  42. package/build/src/models/HttpProject.js +3 -3
  43. package/build/src/models/HttpProject.js.map +1 -1
  44. package/build/src/models/HttpProjectListItem.d.ts +1 -1
  45. package/build/src/models/HttpProjectListItem.js +1 -1
  46. package/build/src/models/HttpProjectListItem.js.map +1 -1
  47. package/build/src/models/HttpRequest.d.ts +2 -2
  48. package/build/src/models/HttpRequest.js +2 -2
  49. package/build/src/models/HttpRequest.js.map +1 -1
  50. package/build/src/models/HttpResponse.d.ts +2 -2
  51. package/build/src/models/HttpResponse.js +3 -3
  52. package/build/src/models/HttpResponse.js.map +1 -1
  53. package/build/src/models/License.d.ts +3 -3
  54. package/build/src/models/License.js +3 -3
  55. package/build/src/models/License.js.map +1 -1
  56. package/build/src/models/ProjectFolder.d.ts +2 -2
  57. package/build/src/models/ProjectFolder.js +3 -3
  58. package/build/src/models/ProjectFolder.js.map +1 -1
  59. package/build/src/models/ProjectItem.d.ts +1 -1
  60. package/build/src/models/ProjectItem.js +2 -2
  61. package/build/src/models/ProjectItem.js.map +1 -1
  62. package/build/src/models/ProjectRequest.d.ts +2 -2
  63. package/build/src/models/ProjectRequest.js +1 -1
  64. package/build/src/models/ProjectRequest.js.map +1 -1
  65. package/build/src/models/ProjectSchema.d.ts +2 -2
  66. package/build/src/models/ProjectSchema.js +1 -1
  67. package/build/src/models/ProjectSchema.js.map +1 -1
  68. package/build/src/models/Property.d.ts +4 -4
  69. package/build/src/models/Property.js +4 -4
  70. package/build/src/models/Property.js.map +1 -1
  71. package/build/src/models/Provider.d.ts +3 -3
  72. package/build/src/models/Provider.js +3 -3
  73. package/build/src/models/Provider.js.map +1 -1
  74. package/build/src/models/Request.d.ts +2 -2
  75. package/build/src/models/Request.js +3 -3
  76. package/build/src/models/Request.js.map +1 -1
  77. package/build/src/models/RequestActions.d.ts +2 -4
  78. package/build/src/models/RequestActions.js +2 -4
  79. package/build/src/models/RequestActions.js.map +1 -1
  80. package/build/src/models/RequestAuthorization.d.ts +3 -5
  81. package/build/src/models/RequestAuthorization.js +2 -4
  82. package/build/src/models/RequestAuthorization.js.map +1 -1
  83. package/build/src/models/RequestConfig.d.ts +3 -5
  84. package/build/src/models/RequestConfig.js +1 -3
  85. package/build/src/models/RequestConfig.js.map +1 -1
  86. package/build/src/models/RequestLog.d.ts +6 -8
  87. package/build/src/models/RequestLog.js +4 -6
  88. package/build/src/models/RequestLog.js.map +1 -1
  89. package/build/src/models/RequestTime.d.ts +4 -6
  90. package/build/src/models/RequestTime.js +2 -4
  91. package/build/src/models/RequestTime.js.map +1 -1
  92. package/build/src/models/RequestUiMeta.d.ts +5 -5
  93. package/build/src/models/RequestUiMeta.js +2 -2
  94. package/build/src/models/RequestUiMeta.js.map +1 -1
  95. package/build/src/models/RequestsSize.d.ts +1 -3
  96. package/build/src/models/RequestsSize.js +1 -3
  97. package/build/src/models/RequestsSize.js.map +1 -1
  98. package/build/src/models/{ArcResponse.d.ts → Response.d.ts} +7 -9
  99. package/build/src/models/{ArcResponse.js → Response.js} +4 -6
  100. package/build/src/models/Response.js.map +1 -0
  101. package/build/src/models/ResponseAuthorization.d.ts +3 -3
  102. package/build/src/models/ResponseAuthorization.js +3 -3
  103. package/build/src/models/ResponseAuthorization.js.map +1 -1
  104. package/build/src/models/ResponseRedirect.d.ts +3 -5
  105. package/build/src/models/ResponseRedirect.js +1 -3
  106. package/build/src/models/ResponseRedirect.js.map +1 -1
  107. package/build/src/models/RevisionInfo.d.ts +1 -1
  108. package/build/src/models/RevisionInfo.js +1 -1
  109. package/build/src/models/RevisionInfo.js.map +1 -1
  110. package/build/src/models/SentRequest.d.ts +2 -4
  111. package/build/src/models/SentRequest.js +1 -3
  112. package/build/src/models/SentRequest.js.map +1 -1
  113. package/build/src/models/Server.d.ts +3 -3
  114. package/build/src/models/Server.js +3 -3
  115. package/build/src/models/Server.js.map +1 -1
  116. package/build/src/models/Thing.d.ts +3 -3
  117. package/build/src/models/Thing.js +3 -3
  118. package/build/src/models/Thing.js.map +1 -1
  119. package/build/src/models/Url.d.ts +2 -4
  120. package/build/src/models/Url.js +2 -4
  121. package/build/src/models/Url.js.map +1 -1
  122. package/build/src/models/User.d.ts +2 -1
  123. package/build/src/models/User.js +1 -1
  124. package/build/src/models/User.js.map +1 -1
  125. package/build/src/models/WebApi.d.ts +1 -1
  126. package/build/src/models/WebApi.js +1 -1
  127. package/build/src/models/WebApi.js.map +1 -1
  128. package/build/src/models/WebApiIndex.d.ts +1 -1
  129. package/build/src/models/WebApiIndex.js +1 -1
  130. package/build/src/models/WebApiIndex.js.map +1 -1
  131. package/build/src/models/Workspace.d.ts +4 -4
  132. package/build/src/models/Workspace.js +4 -4
  133. package/build/src/models/Workspace.js.map +1 -1
  134. package/build/src/models/actions/Action.d.ts +2 -2
  135. package/build/src/models/actions/Action.js +1 -1
  136. package/build/src/models/actions/Action.js.map +1 -1
  137. package/build/src/models/actions/Condition.d.ts +2 -2
  138. package/build/src/models/actions/Condition.js +1 -1
  139. package/build/src/models/actions/Condition.js.map +1 -1
  140. package/build/src/models/actions/RunnableAction.d.ts +1 -1
  141. package/build/src/models/actions/RunnableAction.js +1 -1
  142. package/build/src/models/actions/RunnableAction.js.map +1 -1
  143. package/build/src/models/actions/runnable/DeleteCookieAction.d.ts +2 -2
  144. package/build/src/models/actions/runnable/DeleteCookieAction.js +1 -1
  145. package/build/src/models/actions/runnable/DeleteCookieAction.js.map +1 -1
  146. package/build/src/models/actions/runnable/SetCookieAction.d.ts +2 -2
  147. package/build/src/models/actions/runnable/SetCookieAction.js +1 -1
  148. package/build/src/models/actions/runnable/SetCookieAction.js.map +1 -1
  149. package/build/src/models/actions/runnable/SetVariableAction.d.ts +2 -2
  150. package/build/src/models/actions/runnable/SetVariableAction.js +1 -1
  151. package/build/src/models/actions/runnable/SetVariableAction.js.map +1 -1
  152. package/build/src/models/transformers/ImportUtils.d.ts +1 -1
  153. package/build/src/models/transformers/ImportUtils.js +1 -1
  154. package/build/src/models/transformers/PostmanBackupTransformer.js +2 -1
  155. package/build/src/models/transformers/PostmanBackupTransformer.js.map +1 -1
  156. package/build/src/models/transformers/PostmanV21Transformer.js +2 -1
  157. package/build/src/models/transformers/PostmanV21Transformer.js.map +1 -1
  158. package/build/src/models/transformers/PostmanV2Transformer.js +2 -1
  159. package/build/src/models/transformers/PostmanV2Transformer.js.map +1 -1
  160. package/build/src/runtime/actions/RunnableCondition.d.ts +6 -7
  161. package/build/src/runtime/actions/RunnableCondition.js +4 -5
  162. package/build/src/runtime/actions/RunnableCondition.js.map +1 -1
  163. package/build/src/runtime/http-engine/{ArcEngine.d.ts → CoreEngine.d.ts} +3 -3
  164. package/build/src/runtime/http-engine/{ArcEngine.js → CoreEngine.js} +8 -8
  165. package/build/src/runtime/http-engine/CoreEngine.js.map +1 -0
  166. package/build/src/runtime/http-engine/HttpEngine.d.ts +3 -3
  167. package/build/src/runtime/http-engine/HttpEngine.js +3 -20
  168. package/build/src/runtime/http-engine/HttpEngine.js.map +1 -1
  169. package/build/src/runtime/modules/BasicAuthCache.js +2 -5
  170. package/build/src/runtime/modules/BasicAuthCache.js.map +1 -1
  171. package/build/src/runtime/modules/RequestCookies.d.ts +1 -1
  172. package/build/src/runtime/modules/RequestCookies.js +3 -2
  173. package/build/src/runtime/modules/RequestCookies.js.map +1 -1
  174. package/build/src/runtime/node/RequestFactory.d.ts +1 -1
  175. package/build/src/runtime/node/RequestFactory.js +3 -3
  176. package/build/src/runtime/node/RequestFactory.js.map +1 -1
  177. package/build/src/runtime/reporters/ProjectRunCliReporter.js.map +1 -1
  178. package/build/src/runtime/reporters/Reporter.js.map +1 -1
  179. package/build/src/runtime/store/StoreSdk.js +4 -2
  180. package/build/src/runtime/store/StoreSdk.js.map +1 -1
  181. package/package.json +3 -3
  182. package/readme.md +5 -5
  183. package/src/data/JmesparthReader.ts +1 -1
  184. package/src/events/models/ProjectEvents.ts +2 -2
  185. package/src/events/readme.md +1 -1
  186. package/src/lib/transformers/PayloadSerializer.ts +3 -3
  187. package/src/mocking/ProjectMock.ts +1 -1
  188. package/src/mocking/lib/Request.ts +5 -5
  189. package/src/mocking/lib/Response.ts +10 -10
  190. package/src/mocking/lib/User.ts +2 -1
  191. package/src/models/AuthorizationData.ts +2 -2
  192. package/src/models/ClientCertificate.ts +1 -1
  193. package/src/models/Environment.ts +4 -4
  194. package/src/models/ErrorResponse.ts +1 -1
  195. package/src/models/HistoryIndex.ts +6 -1
  196. package/src/models/HostRule.ts +5 -5
  197. package/src/models/HttpHistory.ts +1 -1
  198. package/src/models/HttpProject.ts +5 -6
  199. package/src/models/HttpProjectListItem.ts +1 -1
  200. package/src/models/HttpRequest.ts +2 -2
  201. package/src/models/HttpResponse.ts +3 -3
  202. package/src/models/License.ts +4 -4
  203. package/src/models/ProjectFolder.ts +3 -3
  204. package/src/models/ProjectItem.ts +2 -2
  205. package/src/models/ProjectRequest.ts +2 -2
  206. package/src/models/ProjectSchema.ts +2 -2
  207. package/src/models/Property.ts +5 -5
  208. package/src/models/Provider.ts +4 -4
  209. package/src/models/README.md +2 -2
  210. package/src/models/Request.ts +4 -4
  211. package/src/models/RequestActions.ts +2 -4
  212. package/src/models/RequestAuthorization.ts +3 -5
  213. package/src/models/RequestConfig.ts +3 -5
  214. package/src/models/RequestLog.ts +8 -10
  215. package/src/models/RequestTime.ts +4 -6
  216. package/src/models/RequestUiMeta.ts +5 -5
  217. package/src/models/RequestsSize.ts +1 -3
  218. package/src/models/{ArcResponse.ts → Response.ts} +12 -14
  219. package/src/models/ResponseAuthorization.ts +4 -4
  220. package/src/models/ResponseRedirect.ts +3 -5
  221. package/src/models/RevisionInfo.ts +1 -1
  222. package/src/models/SentRequest.ts +2 -4
  223. package/src/models/Server.ts +4 -4
  224. package/src/models/Thing.ts +4 -4
  225. package/src/models/Url.ts +2 -4
  226. package/src/models/User.ts +2 -1
  227. package/src/models/WebApi.ts +1 -1
  228. package/src/models/WebApiIndex.ts +1 -1
  229. package/src/models/Workspace.ts +5 -5
  230. package/src/models/actions/Action.ts +2 -2
  231. package/src/models/actions/Condition.ts +2 -2
  232. package/src/models/actions/RunnableAction.ts +1 -1
  233. package/src/models/actions/runnable/DeleteCookieAction.ts +2 -2
  234. package/src/models/actions/runnable/SetCookieAction.ts +2 -2
  235. package/src/models/actions/runnable/SetVariableAction.ts +2 -2
  236. package/src/models/transformers/ImportUtils.ts +1 -1
  237. package/src/models/transformers/PostmanBackupTransformer.ts +2 -1
  238. package/src/models/transformers/PostmanV21Transformer.ts +2 -1
  239. package/src/models/transformers/PostmanV2Transformer.ts +2 -1
  240. package/src/runtime/actions/RunnableCondition.ts +6 -7
  241. package/src/runtime/http-engine/{ArcEngine.ts → CoreEngine.ts} +7 -7
  242. package/src/runtime/http-engine/HttpEngine.ts +5 -24
  243. package/src/runtime/modules/BasicAuthCache.ts +2 -6
  244. package/src/runtime/modules/RequestCookies.ts +6 -5
  245. package/src/runtime/node/RequestFactory.ts +3 -3
  246. package/src/runtime/reporters/ProjectRunCliReporter.ts +2 -2
  247. package/src/runtime/reporters/Reporter.ts +4 -4
  248. package/src/runtime/store/StoreSdk.ts +4 -4
  249. package/build/src/models/ArcResponse.js.map +0 -1
  250. package/build/src/models/HistoryRequest.d.ts +0 -13
  251. package/build/src/models/HistoryRequest.js +0 -25
  252. package/build/src/models/HistoryRequest.js.map +0 -1
  253. package/build/src/runtime/http-engine/ArcEngine.js.map +0 -1
  254. package/build/src/runtime/http-engine/NodeEngine.d.ts +0 -154
  255. package/build/src/runtime/http-engine/NodeEngine.js +0 -766
  256. package/build/src/runtime/http-engine/NodeEngine.js.map +0 -1
  257. package/build/src/runtime/http-engine/NodeEngineDirect.d.ts +0 -113
  258. package/build/src/runtime/http-engine/NodeEngineDirect.js +0 -449
  259. package/build/src/runtime/http-engine/NodeEngineDirect.js.map +0 -1
  260. package/src/models/HistoryRequest.ts +0 -28
  261. package/src/runtime/http-engine/NodeEngine.ts +0 -792
  262. package/src/runtime/http-engine/NodeEngineDirect.ts +0 -482
@@ -2,13 +2,13 @@ import { IHttpResponse, HttpResponse, Kind as ResponseKind } from './HttpRespons
2
2
  import { IRequestTime, RequestTime } from './RequestTime.js';
3
3
  import { ResponseRedirect as LegacyRedirect } from './legacy/request/ArcResponse.js';
4
4
 
5
- export const Kind = 'ARC#HttpResponseRedirect';
5
+ export const Kind = 'Core#HttpResponseRedirect';
6
6
 
7
7
  /**
8
8
  * An information about a redirect
9
9
  */
10
10
  export interface IResponseRedirect {
11
- kind: string;
11
+ kind: typeof Kind;
12
12
  /**
13
13
  * Redirection response
14
14
  */
@@ -33,7 +33,7 @@ export interface IResponseRedirect {
33
33
 
34
34
 
35
35
  export class ResponseRedirect {
36
- kind = Kind;
36
+ kind: typeof Kind = Kind;
37
37
  /**
38
38
  * Redirection response
39
39
  */
@@ -119,8 +119,6 @@ export class ResponseRedirect {
119
119
 
120
120
  /**
121
121
  * Creates a new redirect clearing anything that is so far defined.
122
- *
123
- * Note, this throws an error when the object is not an ARC redirect.
124
122
  */
125
123
  new(init: IResponseRedirect): void {
126
124
  const { response, timings, startTime=0, endTime=0, url='', kind=Kind } = init;
@@ -1,4 +1,4 @@
1
- export const Kind = 'ARC#Revision';
1
+ export const Kind = 'Core#Revision';
2
2
 
3
3
  /**
4
4
  * The definition of a patch revision.
@@ -21,7 +21,7 @@ export interface IBaseSentRequest extends IBaseHttpRequest {
21
21
 
22
22
  /**
23
23
  * An interface describing a request made by the HTTP transport.
24
- * Each transport used by ARC must return this structure in the response event.
24
+ * Each transport used by API Client must return this structure in the response event.
25
25
  * This is not a replacement for the editor request that also has to be returned.
26
26
  *
27
27
  * Another difference is that this headers contains a final list of headers sent to the
@@ -103,9 +103,7 @@ export class SentRequest extends HttpRequest {
103
103
  }
104
104
 
105
105
  /**
106
- * Creates a new request clearing anything that is so far defined.
107
- *
108
- * Note, this throws an error when the object is not an ARC request.
106
+ * Creates a new sent request clearing anything that is so far defined.
109
107
  */
110
108
  new(init: ISentRequest): void {
111
109
  super.new(init);
@@ -1,7 +1,7 @@
1
- export const Kind = 'ARC#Server';
1
+ export const Kind = 'Core#Server';
2
2
 
3
3
  export interface IServer {
4
- kind: 'ARC#Server';
4
+ kind: typeof Kind;
5
5
  /**
6
6
  * The base URI of the server.
7
7
  *
@@ -85,11 +85,11 @@ export class Server {
85
85
  /**
86
86
  * Creates a new server clearing anything that is so far defined.
87
87
  *
88
- * Note, this throws an error when the server is not an ARC server.
88
+ * Note, this throws an error when the server is not a server.
89
89
  */
90
90
  new(init: IServer): void {
91
91
  if (!Server.isServer(init)) {
92
- throw new Error(`Not an ARC server.`);
92
+ throw new Error(`Not a server.`);
93
93
  }
94
94
  const { uri, description, protocol, basePath } = init;
95
95
  this.kind = Kind;
@@ -1,4 +1,4 @@
1
- export const Kind = 'ARC#Thing';
1
+ export const Kind = 'Core#Thing';
2
2
 
3
3
  /**
4
4
  * An interface describing a base metadata of a thing.
@@ -7,7 +7,7 @@ export declare interface IThing {
7
7
  /**
8
8
  * The data kind. The application ignores the input with an unknown `kind`, unless it can be determined from the context.
9
9
  */
10
- kind?: 'ARC#Thing';
10
+ kind?: typeof Kind;
11
11
  /**
12
12
  * The name of the thing.
13
13
  */
@@ -68,11 +68,11 @@ export class Thing {
68
68
  /**
69
69
  * Creates a new thing clearing anything that is so far defined.
70
70
  *
71
- * Note, this throws an error when the server is not an ARC thing.
71
+ * Note, this throws an error when the server is not a thing.
72
72
  */
73
73
  new(init: IThing): void {
74
74
  if (!Thing.isThing(init)) {
75
- throw new Error(`Not an ARC thing.`);
75
+ throw new Error(`Not a thing.`);
76
76
  }
77
77
  const { description, name, version } = init;
78
78
  this.kind = Kind;
package/src/models/Url.ts CHANGED
@@ -41,7 +41,7 @@ export class Url {
41
41
  midnight?: number;
42
42
 
43
43
  /**
44
- * @param input The environment definition used to restore the state.
44
+ * @param input The URL definition used to restore the state.
45
45
  */
46
46
  constructor(input: string|IUrl) {
47
47
  let init: IUrl;
@@ -60,9 +60,7 @@ export class Url {
60
60
  }
61
61
 
62
62
  /**
63
- * Creates a new environment clearing anything that is so far defined.
64
- *
65
- * Note, this throws an error when the environment is not an ARC environment.
63
+ * Creates a new URL clearing anything that is so far defined.
66
64
  */
67
65
  new(init: IUrl): void {
68
66
  const { url='', cnt=0, time = Date.now(), midnight } = init;
@@ -62,9 +62,10 @@ export interface IUserPicture {
62
62
  data?: string;
63
63
  }
64
64
 
65
- export const Kind = 'ARC#User';
65
+ export const Kind = 'Core#User';
66
66
 
67
67
  interface BaseUser {
68
+ kind: typeof Kind;
68
69
  /**
69
70
  * Data store key of the user.
70
71
  */
@@ -1,4 +1,4 @@
1
- export const Kind = 'ARC#WebApi';
1
+ export const Kind = 'Core#WebApi';
2
2
 
3
3
  /**
4
4
  * @deprecated This was used in the old version of ARC.
@@ -1,4 +1,4 @@
1
- export const Kind = 'ARC#WebApiIndex';
1
+ export const Kind = 'Core#WebApiIndex';
2
2
 
3
3
  /**
4
4
  * @deprecated This was used in the old version of ARC.
@@ -2,7 +2,7 @@ import { AccessControlLevel } from "./User.js";
2
2
  import { IThing, Thing, Kind as ThingKind } from './Thing.js';
3
3
  import v4 from '../lib/uuid.js';
4
4
 
5
- export const Kind = 'ARC#Space';
5
+ export const Kind = 'Core#Space';
6
6
  /**
7
7
  * A definition of the working space for users.
8
8
  *
@@ -10,7 +10,7 @@ export const Kind = 'ARC#Space';
10
10
  * created by the system users, where they can store their projects and other data.
11
11
  */
12
12
  export interface IWorkspace {
13
- kind: 'ARC#Space';
13
+ kind: typeof Kind;
14
14
  /**
15
15
  * The space identifier.
16
16
  */
@@ -75,7 +75,7 @@ export class Workspace {
75
75
  */
76
76
  projects: string[] = [];
77
77
  /**
78
- * Only set when the object was created from the data received by the ARC backend.
78
+ * Only set when the object was created from the data received by the API Client backend.
79
79
  * Level access of the current user to the space.
80
80
  * Note, this information is never serialized with the object.
81
81
  */
@@ -127,11 +127,11 @@ export class Workspace {
127
127
  /**
128
128
  * Creates a new environment clearing anything that is so far defined.
129
129
  *
130
- * Note, this throws an error when the environment is not an ARC environment.
130
+ * Note, this throws an error when the environment is not a space.
131
131
  */
132
132
  new(init: IWorkspace | IUserWorkspace): void {
133
133
  if (!Workspace.isWorkspace(init)) {
134
- throw new Error(`Not an ARC space.`);
134
+ throw new Error(`Not a space.`);
135
135
  }
136
136
  const { key = v4(), projects = [], info, owner = DefaultOwner, users } = init;
137
137
  this.kind = Kind;
@@ -5,13 +5,13 @@ import { Kind as SetCookieKind, SetCookieAction, ISetCookieAction } from './runn
5
5
  import { Kind as SetVariableKind, SetVariableAction, ISetVariableAction } from './runnable/SetVariableAction.js';
6
6
  import { Action as LegacyAction, SetCookieConfig, SetVariableConfig, DeleteCookieConfig } from '../legacy/actions/Actions.js';
7
7
 
8
- export const Kind = 'ARC#Action';
8
+ export const Kind = 'Core#Action';
9
9
 
10
10
  /**
11
11
  * An interface representing a single action.
12
12
  */
13
13
  export interface IAction {
14
- kind?: 'ARC#Action';
14
+ kind?: typeof Kind;
15
15
  /**
16
16
  * Action name.
17
17
  */
@@ -1,7 +1,7 @@
1
1
  import { ActionTypeEnum, RequestDataSourceEnum, ResponseDataSourceEnum, OperatorEnum } from './Enums.js';
2
2
  import { Condition as LegacyCondition } from '../legacy/actions/Actions.js';
3
3
 
4
- export const Kind = 'ARC#Condition';
4
+ export const Kind = 'Core#Condition';
5
5
 
6
6
  /**
7
7
  * A base interface describing a configuration to extract data from a request or a response.
@@ -33,7 +33,7 @@ export interface IDataSource {
33
33
  * Describes action's condition configuration.
34
34
  */
35
35
  export interface ICondition extends IDataSource {
36
- kind: 'ARC#Condition',
36
+ kind: typeof Kind,
37
37
  /**
38
38
  * The comparison operator.
39
39
  */
@@ -2,7 +2,7 @@ import { ICondition, Condition } from './Condition.js';
2
2
  import { IAction, Action } from './Action.js';
3
3
  import { RunnableAction as LegacyRunnable } from '../legacy/actions/Actions.js';
4
4
 
5
- export const Kind = 'ARC#RunnableAction';
5
+ export const Kind = 'Core#RunnableAction';
6
6
 
7
7
  /**
8
8
  * An interface representing a runnable set of action in a condition.
@@ -1,10 +1,10 @@
1
1
  import { DeleteCookieConfig } from '../../legacy/actions/Actions.js';
2
2
  import { Runnable, IRunnable } from './Runnable.js';
3
3
 
4
- export const Kind = 'ARC#DeleteCookieAction';
4
+ export const Kind = 'Core#DeleteCookieAction';
5
5
 
6
6
  export interface IDeleteCookieAction extends IRunnable {
7
- kind?: 'ARC#DeleteCookieAction';
7
+ kind?: typeof Kind;
8
8
  /**
9
9
  * When set it uses request URL instead of defined URL in the action.
10
10
  */
@@ -3,10 +3,10 @@ import { Runnable, IRunnable } from './Runnable.js';
3
3
  import { IDataSource } from '../Condition.js';
4
4
  import { RequestDataSourceEnum } from '../Enums.js';
5
5
 
6
- export const Kind = 'ARC#SetCookieAction';
6
+ export const Kind = 'Core#SetCookieAction';
7
7
 
8
8
  export interface ISetCookieAction extends IRunnable {
9
- kind?: 'ARC#SetCookieAction';
9
+ kind?: typeof Kind;
10
10
  /**
11
11
  * Name of the cookie
12
12
  */
@@ -3,10 +3,10 @@ import { Runnable, IRunnable } from './Runnable.js';
3
3
  import { IDataSource } from '../Condition.js';
4
4
  import { RequestDataSourceEnum } from '../Enums.js';
5
5
 
6
- export const Kind = 'ARC#SetVariableAction';
6
+ export const Kind = 'Core#SetVariableAction';
7
7
 
8
8
  export interface ISetVariableAction extends IRunnable {
9
- kind?: 'ARC#SetVariableAction';
9
+ kind?: typeof Kind;
10
10
  /**
11
11
  * Name of the variable to set
12
12
  */
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-param-reassign */
2
2
  /* eslint-disable no-plusplus */
3
3
  /**
4
- * User can export single request in ARC. In this case ARC opens new tab
4
+ * User can export single request in ARC. In this case the app opens new tab
5
5
  * rather actually imports the data. This function tests if this is the case.
6
6
  * @param data Normalized import data
7
7
  */
@@ -5,6 +5,7 @@ import { ProjectFolder } from '../ProjectFolder.js';
5
5
  import { ProjectRequest } from '../ProjectRequest.js';
6
6
  import { IMultipartBody } from '../../lib/transformers/PayloadSerializer.js';
7
7
  import { Environment } from '../Environment.js';
8
+ import { Kind as ThingKind } from '../Thing.js';
8
9
 
9
10
  interface PostmanBackupV1 {
10
11
  version: number;
@@ -147,7 +148,7 @@ export class PostmanBackupTransformer extends PostmanTransformer {
147
148
  definitions: {},
148
149
  environments: [],
149
150
  info: {
150
- kind: 'ARC#Thing',
151
+ kind: ThingKind,
151
152
  name,
152
153
  },
153
154
  items: [],
@@ -6,6 +6,7 @@ import { ProjectRequest } from '../ProjectRequest.js';
6
6
  import { IMultipartBody } from '../../lib/transformers/PayloadSerializer.js';
7
7
  import v4 from '../../lib/uuid.js';
8
8
  import { Environment } from '../Environment.js';
9
+ import { Kind as ThingKind } from '../Thing.js';
9
10
 
10
11
  export const currentItemValue = Symbol('currentItemValue');
11
12
 
@@ -134,7 +135,7 @@ export class PostmanV21Transformer extends PostmanTransformer {
134
135
  definitions: {},
135
136
  environments: [],
136
137
  info: {
137
- kind: 'ARC#Thing',
138
+ kind: ThingKind,
138
139
  name: info.name || 'Unnamed Postman project',
139
140
  },
140
141
  items: [],
@@ -6,6 +6,7 @@ import { ProjectRequest } from '../ProjectRequest.js';
6
6
  import { IMultipartBody } from '../../lib/transformers/PayloadSerializer.js';
7
7
  import v4 from '../../lib/uuid.js';
8
8
  import { Environment } from '../Environment.js';
9
+ import { Kind as ThingKind } from '../Thing.js';
9
10
 
10
11
  export const currentItemValue = Symbol('currentItemValue');
11
12
 
@@ -131,7 +132,7 @@ export class PostmanV2Transformer extends PostmanTransformer {
131
132
  definitions: {},
132
133
  environments: [],
133
134
  info: {
134
- kind: 'ARC#Thing',
135
+ kind: ThingKind,
135
136
  name: info.name || 'Unnamed Postman project',
136
137
  },
137
138
  items: [],
@@ -1,24 +1,23 @@
1
1
  import { IRunnableAction, RunnableAction } from '../../models/actions/RunnableAction.js';
2
2
  import { IHttpRequest } from '../../models/HttpRequest.js';
3
- import { IArcResponse } from '../../models/ArcResponse.js';
3
+ import { IResponse } from '../../models/Response.js';
4
4
  import { ISentRequest } from '../../models/SentRequest.js';
5
5
  import { IErrorResponse } from '../../models/ErrorResponse.js';
6
6
  import { RequestDataExtractor } from '../../data/RequestDataExtractor.js';
7
7
  import { checkCondition } from './ConditionRunner.js';
8
8
 
9
9
  /**
10
- * A class that represents ARC condition that runs actions when the condition is met.
10
+ * A class that represents API Client condition that runs actions when the condition is met.
11
11
  */
12
12
  export class RunnableCondition extends RunnableAction {
13
13
  /**
14
14
  * Tests whether the condition is satisfied for request and/or response.
15
15
  *
16
- * @param request The ARC request object.
17
- * @param executed The request object representing the actual request that has been executed by the transport library.
18
- * @param response The ARC response object, if available.
16
+ * @param request The API Client request object.
17
+ * @param response The API Client response object, if available.
19
18
  * @return True when the condition is satisfied.
20
19
  */
21
- async satisfied(request: IHttpRequest | ISentRequest, response?: IArcResponse | IErrorResponse): Promise<boolean> {
20
+ async satisfied(request: IHttpRequest | ISentRequest, response?: IResponse | IErrorResponse): Promise<boolean> {
22
21
  if (this.enabled === false) {
23
22
  return false;
24
23
  }
@@ -38,7 +37,7 @@ export class RunnableCondition extends RunnableAction {
38
37
 
39
38
  /**
40
39
  * Maps runnables interface to
41
- * If an item is not an instance of `ArcAction` then it creates an instance of it
40
+ * If an item is not an instance of `RunnableCondition` then it creates an instance of it
42
41
  * by passing the map as an argument.
43
42
  *
44
43
  * @param value Passed list of actions.
@@ -5,7 +5,7 @@ import https from 'https';
5
5
  import { HttpEngine, HttpEngineOptions, HeadersReceivedDetail } from './HttpEngine.js';
6
6
  import { IRequestLog } from 'src/models/RequestLog.js';
7
7
  import { IHttpRequest } from '../../models/HttpRequest.js';
8
- import { ArcResponse } from '../../models/ArcResponse.js';
8
+ import { Response } from '../../models/Response.js';
9
9
  import { SerializableError } from '../../models/SerializableError.js';
10
10
  import { Headers } from '../../lib/headers/Headers.js';
11
11
  import { PayloadSupport } from './PayloadSupport.js';
@@ -34,11 +34,11 @@ interface ResponseInfo {
34
34
  }
35
35
 
36
36
  /**
37
- * ARC's HTTP engine.
37
+ * API Client's HTTP engine.
38
38
  * An HTTP 1.1 engine working directly on the socket. It communicates with the remote machine and
39
39
  * collects stats about the request and response.
40
40
  */
41
- export class ArcEngine extends HttpEngine {
41
+ export class CoreEngine extends HttpEngine {
42
42
  state = RequestState.Status;
43
43
  rawHeaders?: Buffer;
44
44
  _hostTestReg = /^\s*host\s*:/im;
@@ -119,7 +119,7 @@ export class ArcEngine extends HttpEngine {
119
119
  }
120
120
 
121
121
  /**
122
- * Prepares an HTTP message from ARC's request object.
122
+ * Prepares an HTTP message from API Client's request object.
123
123
  *
124
124
  * @returns Resolved promise to an `ArrayBuffer`.
125
125
  */
@@ -539,7 +539,7 @@ export class ArcEngine extends HttpEngine {
539
539
  * @return Redirect response object
540
540
  */
541
541
  async _createRedirectResponse(location: string): Promise<ResponseRedirect> {
542
- const { currentResponse = new ArcResponse() } = this;
542
+ const { currentResponse = new Response() } = this;
543
543
  this.currentResponse = currentResponse;
544
544
  if (!this.currentResponse.payload) {
545
545
  if (this._rawBody) {
@@ -626,7 +626,7 @@ export class ArcEngine extends HttpEngine {
626
626
  if (this.aborted) {
627
627
  return;
628
628
  }
629
- const response = ArcResponse.fromValues(0);
629
+ const response = Response.fromValues(0);
630
630
  response.loadingTime = 0;
631
631
  this.currentResponse = response;
632
632
  if (!data) {
@@ -1000,7 +1000,7 @@ export class ArcEngine extends HttpEngine {
1000
1000
  }
1001
1001
  if (res.statusCode === 401) {
1002
1002
  this.currentHeaders = new Headers(res.headers);
1003
- const currentResponse = ArcResponse.fromValues(res.statusCode, res.statusMessage, this.currentHeaders.toString());
1003
+ const currentResponse = Response.fromValues(res.statusCode, res.statusMessage, this.currentHeaders.toString());
1004
1004
  currentResponse.loadingTime = 0;
1005
1005
  this.currentResponse = currentResponse;
1006
1006
  if (head.length) {
@@ -12,7 +12,7 @@ import { IRequestAuthorization } from '../../models/RequestAuthorization.js';
12
12
  import { HostRule } from '../../models/HostRule.js';
13
13
  import { IRequestCertificate } from '../../models/ClientCertificate.js';
14
14
  import { SentRequest } from '../../models/SentRequest.js';
15
- import { ArcResponse } from '../../models/ArcResponse.js';
15
+ import { Response } from '../../models/Response.js';
16
16
  import { ErrorResponse } from '../../models/ErrorResponse.js';
17
17
  import { RequestsSize } from '../../models/RequestsSize.js';
18
18
  import { HttpResponse } from '../../models/HttpResponse.js';
@@ -154,7 +154,7 @@ export abstract class HttpEngine extends EventEmitter {
154
154
  /**
155
155
  * The response object build during the execution.
156
156
  */
157
- currentResponse?: ArcResponse;
157
+ currentResponse?: Response;
158
158
 
159
159
  /**
160
160
  * @return True if following redirects is allowed.
@@ -470,7 +470,7 @@ export abstract class HttpEngine extends EventEmitter {
470
470
  * @return Redirect response object
471
471
  */
472
472
  async _createRedirectResponse(location: string): Promise<ResponseRedirect> {
473
- const { currentResponse = new ArcResponse() } = this;
473
+ const { currentResponse = new Response() } = this;
474
474
 
475
475
  const response = HttpResponse.fromValues(
476
476
  currentResponse.status,
@@ -498,7 +498,7 @@ export abstract class HttpEngine extends EventEmitter {
498
498
  *
499
499
  * @return A response object.
500
500
  */
501
- async _createResponse(): Promise<ArcResponse | undefined> {
501
+ async _createResponse(): Promise<Response | undefined> {
502
502
  if (this.aborted) {
503
503
  return;
504
504
  }
@@ -513,36 +513,17 @@ It means that the successful connection wasn't made.
513
513
  Check your request parameters.`);
514
514
  }
515
515
  const body = await this.decompress(this._rawBody);
516
- const response = ArcResponse.fromValues(
516
+ const response = Response.fromValues(
517
517
  status,
518
518
  currentResponse.statusText,
519
519
  currentResponse.headers,
520
520
  );
521
521
  response.timings = this._computeStats(this.stats);
522
522
  response.loadingTime = response.timings.total();
523
-
524
- // const response = /** @type ArcResponse */ ({
525
- // size: {
526
- // request: 0,
527
- // response: 0,
528
- // },
529
- // });
530
-
531
523
  if (body) {
532
524
  await response.writePayload(body);
533
525
  currentResponse.payload = response.payload;
534
526
  }
535
- // if (body) {
536
- // response.payload = body;
537
- // currentResponse.payload = body;
538
- // response.size.response = body.length;
539
- // }
540
- // if (this.sentRequest.httpMessage) {
541
- // response.size.request = Buffer.from(this.sentRequest.httpMessage).length;
542
- // }
543
- // if (opts.includeRedirects && this.redirects.length) {
544
- // response.redirects = Array.from(this.redirects);
545
- // }
546
527
  if (status === 401) {
547
528
  response.auth = this._getAuth();
548
529
  }
@@ -2,7 +2,7 @@ import { Headers } from '../../lib/headers/Headers.js';
2
2
  import { IHttpRequest } from '../../models/HttpRequest.js';
3
3
  import { INtlmAuthorization, IBasicAuthorization } from '../../models/Authorization.js';
4
4
  import { ExecutionContext } from './ModulesRegistry.js';
5
- import { IRequestAuthorization } from '../../models/RequestAuthorization.js';
5
+ import { IRequestAuthorization, Kind as RequestAuthorizationKind } from '../../models/RequestAuthorization.js';
6
6
 
7
7
  const cache: any = {};
8
8
 
@@ -89,16 +89,12 @@ export function applyRequestBasicAuthData(request: IHttpRequest, data: IBasicAut
89
89
  * but whole NTLM configuration object.
90
90
  *
91
91
  * Applied the `auth` object to the event's `detail.auth` object.
92
- *
93
- * @param {ArcBaseRequest} request The event's detail object. Changes made here will be propagated to
94
- * the event.
95
- * @param {NtlmAuthorization} values The authorization data to apply.
96
92
  */
97
93
  function applyRequestNtlmAuthData(authorization: IRequestAuthorization[], values: INtlmAuthorization): void {
98
94
  let ntlm: IRequestAuthorization | undefined = authorization.find(((method) => method.type === 'ntlm'));
99
95
  if (!ntlm) {
100
96
  ntlm = {
101
- kind: '',
97
+ kind: RequestAuthorizationKind,
102
98
  enabled: true,
103
99
  type: 'ntlm',
104
100
  config: {},
@@ -4,10 +4,11 @@ import { Headers } from '../../lib/headers/Headers.js';
4
4
  import { IHttpRequest } from '../../models/HttpRequest.js';
5
5
  import { ExecutionContext } from './ModulesRegistry.js';
6
6
  import { IResponseRedirect } from '../../models/ResponseRedirect.js';
7
- import { IArcResponse } from '../../models/ArcResponse.js';
7
+ import { IResponse } from '../../models/Response.js';
8
8
  import { IErrorResponse } from '../../models/ErrorResponse.js';
9
9
  import { IRequestLog } from '../../models/RequestLog.js';
10
10
  import { HttpCookie } from '../../models/HttpCookie.js';
11
+ import { Kind as RequestConfigKind } from '../../models/RequestConfig.js';
11
12
  import { Cookie } from '../../lib/cookies/Cookie.js';
12
13
 
13
14
  /**
@@ -51,7 +52,7 @@ function applyCookieHeader(header: string, request: IHttpRequest): void {
51
52
  * @param redirects List of redirect responses
52
53
  * @returns An object with `cookies` and `expired` arrays of cookies.
53
54
  */
54
- function extract(response: IArcResponse, url: string, redirects?: IResponseRedirect[]): Record<'expired'|'cookies', Cookie[]> {
55
+ function extract(response: IResponse, url: string, redirects?: IResponseRedirect[]): Record<'expired'|'cookies', Cookie[]> {
55
56
  let expired: Cookie[] = [];
56
57
  let parser;
57
58
  let exp;
@@ -100,7 +101,7 @@ function extract(response: IArcResponse, url: string, redirects?: IResponseRedir
100
101
  *
101
102
  * Unregister this module when the application settings change to not to use session storage.
102
103
  *
103
- * In ARC electron the session storage is a chrome persistent partition with a session shared with the "log in to a web service".
104
+ * In electron the session storage is a chrome persistent partition with a session shared with the "log in to a web service".
104
105
  * This way cookies can be acquired in through the browser login and store in the application to use them with the request.
105
106
  */
106
107
  export async function processRequestCookies(request: IHttpRequest, context: ExecutionContext): Promise<void> {
@@ -126,7 +127,7 @@ export async function processResponseCookies(log: IRequestLog, context: Executio
126
127
  return;
127
128
  }
128
129
  const config = context.config || {
129
- kind: 'ARC#RequestConfig',
130
+ kind: RequestConfigKind,
130
131
  enabled: false,
131
132
  };
132
133
  let ignore = false;
@@ -137,7 +138,7 @@ export async function processResponseCookies(log: IRequestLog, context: Executio
137
138
  if (ignore) {
138
139
  return;
139
140
  }
140
- const typedResponse = log.response as IArcResponse;
141
+ const typedResponse = log.response as IResponse;
141
142
  const result = extract(typedResponse, log.request.url, log.redirects);
142
143
  if (result.cookies.length) {
143
144
  await CookieEvents.updateBulk(context.eventsTarget, result.cookies.map(c => HttpCookie.fromCookieParser(c).toJSON()));
@@ -11,14 +11,14 @@ import { Action } from '../../models/actions/Action.js';
11
11
  import { RunnableCondition } from '../actions/RunnableCondition.js';
12
12
  import { ActionRunner } from '../actions/ActionRunner.js';
13
13
  import { HttpEngineOptions } from '../http-engine/HttpEngine.js';
14
- import { ArcEngine } from '../http-engine/ArcEngine.js';
14
+ import { CoreEngine } from '../http-engine/CoreEngine.js';
15
15
  import { ModulesRegistry, RegisteredRequestModule, RegisteredResponseModule, ExecutionContext, RegistryPermission } from '../modules/ModulesRegistry.js';
16
16
  import { ExecutionResponse } from '../modules/ExecutionResponse.js';
17
17
  import { Events } from '../../events/Events.js';
18
18
  import { Logger } from '../../lib/logging/Logger.js';
19
19
 
20
20
  /**
21
- * The main class to make HTTP requests in the API Client / ARC.
21
+ * The main class to make HTTP requests in the API Client.
22
22
  * This factory includes all logic components to perform the entire HTTP request lifecycle. This includes:
23
23
  *
24
24
  * - variables evaluation on the request object
@@ -294,7 +294,7 @@ export class RequestFactory {
294
294
  */
295
295
  async executeRequest(request: IHttpRequest): Promise<IRequestLog> {
296
296
  const opts = await this.prepareEngineConfig();
297
- const engine = new ArcEngine(request, opts);
297
+ const engine = new CoreEngine(request, opts);
298
298
  return engine.send();
299
299
  }
300
300
 
@@ -1,7 +1,7 @@
1
1
  import { Table } from 'console-table-printer';
2
2
  import chalk from 'chalk';
3
3
  import { ErrorResponse, IErrorResponse } from '../../models/ErrorResponse.js';
4
- import { IArcResponse } from '../../models/ArcResponse.js';
4
+ import { IResponse } from '../../models/Response.js';
5
5
  import { ISerializedError } from '../../models/SerializableError.js';
6
6
  import { Reporter } from './Reporter.js';
7
7
 
@@ -70,7 +70,7 @@ export class ProjectRunCliReporter extends Reporter {
70
70
  process.stdout.write('Request not executed.\n');
71
71
  return;
72
72
  }
73
- const response = log.response as IArcResponse;
73
+ const response = log.response as IResponse;
74
74
  process.stdout.write(`${prefix} Status code is: ${response.status}\n`);
75
75
  });
76
76
  process.stdout.write('\n\n');