@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
@@ -1,6 +1,6 @@
1
1
  import { IRequestLog, RequestLog, Kind as RequestLogKind } from './RequestLog.js';
2
2
 
3
- export const Kind = 'ARC#HttpHistory';
3
+ export const Kind = 'Core#HttpHistory';
4
4
  export const createdSymbol = Symbol('created');
5
5
  export const midnightSymbol = Symbol('midnight');
6
6
 
@@ -14,8 +14,7 @@ import { ARCSavedRequest, ARCHistoryRequest } from './legacy/request/ArcRequest.
14
14
  import { ArcLegacyProject, ARCProject } from './legacy/models/ArcLegacyProject.js';
15
15
  import { PostmanDataTransformer } from './transformers/PostmanDataTransformer.js';
16
16
 
17
- export type HttpProjectKind = 'ARC#HttpProject';
18
- export const Kind = 'ARC#HttpProject';
17
+ export const Kind = 'Core#HttpProject';
19
18
 
20
19
  /**
21
20
  * A list of options to initialize a project in various situations.
@@ -167,12 +166,12 @@ export interface IProjectRequestIterator {
167
166
  }
168
167
 
169
168
  /**
170
- * The new definition of a project in ARC.
169
+ * The new definition of a project in API Client.
171
170
  * Note, this is not the same as future `ApiProject` which is reserved for building APIs
172
171
  * using RAML or OAS.
173
172
  */
174
173
  export interface IHttpProject extends IProjectDefinitionProperty {
175
- kind: HttpProjectKind;
174
+ kind: typeof Kind;
176
175
  /**
177
176
  * The license information for this HTTP project.
178
177
  */
@@ -340,11 +339,11 @@ export class HttpProject extends ProjectParent {
340
339
  /**
341
340
  * Creates a new project definition clearing anything that is so far defined.
342
341
  *
343
- * Note, this throws an error when the project is not an ARC project.
342
+ * Note, this throws an error when the project is not an API Client project.
344
343
  */
345
344
  new(init: IHttpProject): void {
346
345
  if (!init || !init.definitions || !init.items) {
347
- throw new Error(`Not an ARC project.`);
346
+ throw new Error(`Not a project.`);
348
347
  }
349
348
  const { key = v4(), definitions = {}, items, info, license, provider, environments } = init;
350
349
  this.key = key;
@@ -1,4 +1,4 @@
1
- export const Kind = 'ARC#HttpProjectListItem';
1
+ export const Kind = 'Core#HttpProjectListItem';
2
2
  /**
3
3
  * The HTTP Project definition to be used in lists.
4
4
  */
@@ -1,7 +1,7 @@
1
1
  import { SerializablePayload } from './SerializablePayload.js';
2
2
  import { Payload } from '../lib/transformers/PayloadSerializer.js';
3
3
 
4
- export const Kind = 'ARC#HttpRequest';
4
+ export const Kind = 'Core#HttpRequest';
5
5
 
6
6
  export interface IBaseHttpRequest {
7
7
  /**
@@ -85,7 +85,7 @@ export class HttpRequest extends SerializablePayload {
85
85
  /**
86
86
  * Creates a new request clearing anything that is so far defined.
87
87
  *
88
- * Note, this throws an error when the object is not an ARC request.
88
+ * Note, this throws an error when the object is not a request.
89
89
  */
90
90
  new(init: IHttpRequest): void {
91
91
  const { url, method='GET', headers, payload, kind = Kind } = init;
@@ -3,7 +3,7 @@ import { Payload, PayloadSerializer } from '../lib/transformers/PayloadSerialize
3
3
  import { HTTPResponse as LegacyHttpResponse } from './legacy/request/ArcResponse.js';
4
4
  import { Normalizer } from './legacy/Normalizer.js';
5
5
 
6
- export const Kind = 'ARC#HttpResponse';
6
+ export const Kind = 'Core#HttpResponse';
7
7
 
8
8
  export interface IHttpResponse {
9
9
  kind?: string;
@@ -91,11 +91,11 @@ export class HttpResponse extends SerializablePayload {
91
91
  /**
92
92
  * Creates a new response clearing anything that is so far defined.
93
93
  *
94
- * Note, this throws an error when the object is not an ARC response.
94
+ * Note, this throws an error when the object is not a response.
95
95
  */
96
96
  new(init: IHttpResponse): void {
97
97
  if (!HttpResponse.isHttpResponse(init)) {
98
- throw new Error(`Not an ARC response.`);
98
+ throw new Error(`Not a response.`);
99
99
  }
100
100
  const { status, statusText, headers, payload, kind=Kind } = init;
101
101
  this.kind = kind;
@@ -1,7 +1,7 @@
1
- export const Kind = 'ARC#License';
1
+ export const Kind = 'Core#License';
2
2
 
3
3
  export interface ILicense {
4
- kind: 'ARC#License'
4
+ kind: typeof Kind;
5
5
  /**
6
6
  * The URL to the license text.
7
7
  * Only `url` or `content` can be used at a time.
@@ -71,11 +71,11 @@ export class License {
71
71
  /**
72
72
  * Creates a new license clearing anything that is so far defined.
73
73
  *
74
- * Note, this throws an error when the license is not an ARC license object.
74
+ * Note, this throws an error when the license is not a license object.
75
75
  */
76
76
  new(init: ILicense): void {
77
77
  if (!License.isLicense(init)) {
78
- throw new Error(`Not an ARC license.`);
78
+ throw new Error(`Not a license.`);
79
79
  }
80
80
  const { url, content, name } = init;
81
81
  this.kind = Kind;
@@ -6,7 +6,7 @@ import { HttpProject } from './HttpProject.js';
6
6
  import { IThing, Thing, Kind as ThingKind } from './Thing.js';
7
7
  import v4 from '../lib/uuid.js';
8
8
 
9
- export const Kind = 'ARC#ProjectFolder';
9
+ export const Kind = 'Core#ProjectFolder';
10
10
  export const DefaultFolderName = 'New folder';
11
11
 
12
12
  export interface IFolderAddOptions {
@@ -126,11 +126,11 @@ export class ProjectFolder extends ProjectParent {
126
126
  /**
127
127
  * Creates a new project folder clearing anything that is so far defined.
128
128
  *
129
- * Note, this throws an error when the project folder is not an ARC project folder.
129
+ * Note, this throws an error when the project folder is not a project folder.
130
130
  */
131
131
  new(init: IProjectFolder): void {
132
132
  if (!ProjectFolder.isProjectFolder(init)) {
133
- throw new Error(`Not an ARC project folder.`);
133
+ throw new Error(`Not a project folder.`);
134
134
  }
135
135
  const { key = v4(), created = Date.now(), updated = Date.now(), items, environments, info } = init;
136
136
  this.kind = Kind;
@@ -92,11 +92,11 @@ export class ProjectItem {
92
92
  /**
93
93
  * Creates a new project item clearing anything that is so far defined.
94
94
  *
95
- * Note, this throws an error when the project item is not an ARC project item.
95
+ * Note, this throws an error when the project item is not a project item.
96
96
  */
97
97
  new(init: IProjectItem): void {
98
98
  if (!ProjectItem.isProjectItem(init)) {
99
- throw new Error(`Not an ARC project item.`);
99
+ throw new Error(`Not a project item.`);
100
100
  }
101
101
  const { kind, key } = init;
102
102
  this.kind = kind;
@@ -6,10 +6,10 @@ import { HttpProject } from './HttpProject.js';
6
6
  import v4 from '../lib/uuid.js';
7
7
  import { IRequest, Request } from './Request.js';
8
8
 
9
- export const Kind = 'ARC#ProjectRequest';
9
+ export const Kind = 'Core#ProjectRequest';
10
10
 
11
11
  export interface IProjectRequest extends IProjectDefinitionProperty, IRequest {
12
- kind: 'ARC#ProjectRequest';
12
+ kind: typeof Kind;
13
13
  /**
14
14
  * The identifier of the request.
15
15
  */
@@ -1,9 +1,9 @@
1
1
  import v4 from '../lib/uuid.js';
2
2
  import { Property, IProperty, PropertyType, Kind as PropertyKind } from './Property.js';
3
- export const Kind = 'ARC#ProjectSchema';
3
+ export const Kind = 'Core#ProjectSchema';
4
4
 
5
5
  export interface IProjectSchema {
6
- kind?: 'ARC#ProjectSchema';
6
+ kind?: typeof Kind;
7
7
  /**
8
8
  * The identifier of the environment.
9
9
  */
@@ -3,7 +3,7 @@ import { ApiType } from './legacy/models/ApiTypes.js';
3
3
  export type PropertyType = 'string' | 'integer' | 'float' | 'nil' | 'boolean' | 'date' | 'datetime' | 'time' | 'int32' | 'int64' | 'uint32' | 'uint64' | 'sint32' | 'sint64' | 'fixed32' | 'fixed64' | 'sfixed32' | 'sfixed64' | 'double' | 'bytes';
4
4
 
5
5
  export interface IProperty {
6
- kind: 'ARC#Property';
6
+ kind: typeof Kind;
7
7
  /**
8
8
  * Property name
9
9
  */
@@ -42,7 +42,7 @@ export interface IProperty {
42
42
  repeated?: boolean;
43
43
  }
44
44
 
45
- export const Kind = 'ARC#Property';
45
+ export const Kind = 'Core#Property';
46
46
 
47
47
  /**
48
48
  * A property of an HTTP request.
@@ -358,13 +358,13 @@ export class Property {
358
358
  }
359
359
 
360
360
  /**
361
- * Creates a new environment clearing anything that is so far defined.
361
+ * Creates a new property.
362
362
  *
363
- * Note, this throws an error when the property is not an ARC environment.
363
+ * Note, this throws an error when the property is not a property.
364
364
  */
365
365
  new(init: IProperty): void {
366
366
  if (!Property.isProperty(init)) {
367
- throw new Error(`Not an ARC property.`);
367
+ throw new Error(`Not a property.`);
368
368
  }
369
369
  const { name, value, default: defaultValue, description, enabled, enum: enumValue, required, type, repeated } = init;
370
370
  this.kind = Kind;
@@ -5,7 +5,7 @@ export declare interface IProvider {
5
5
  /**
6
6
  * The data kind. The application ignores the input with an unknown `kind`, unless it can be determined from the context.
7
7
  */
8
- kind: 'ARC#Provider';
8
+ kind: typeof Kind;
9
9
  /**
10
10
  * The URL to the provider
11
11
  */
@@ -20,7 +20,7 @@ export declare interface IProvider {
20
20
  email?: string;
21
21
  }
22
22
 
23
- export const Kind = 'ARC#Provider';
23
+ export const Kind = 'Core#Provider';
24
24
 
25
25
  export class Provider {
26
26
  kind = Kind;
@@ -56,11 +56,11 @@ export class Provider {
56
56
  /**
57
57
  * Creates a new provider clearing anything that is so far defined.
58
58
  *
59
- * Note, this throws an error when the provider is not an ARC provider object.
59
+ * Note, this throws an error when the provider is not a provider object.
60
60
  */
61
61
  new(init: IProvider): void {
62
62
  if (!Provider.isProvider(init)) {
63
- throw new Error(`Not an ARC provider.`);
63
+ throw new Error(`Not a provider.`);
64
64
  }
65
65
  const { url, email, name } = init;
66
66
  this.kind = Kind;
@@ -1,4 +1,4 @@
1
- # API Client/ARC models
1
+ # API Client models
2
2
 
3
3
  ## Principles for designing a data model
4
4
 
@@ -13,7 +13,7 @@ We aim to be interoperable with AMF so when designing a data model first design
13
13
 
14
14
  ### The "kind" as the object type identifier
15
15
 
16
- Each data object that can exist by itself or in multiple contexts' should contain the `kind` property that uniquely identifies the type. For example, the `HttpProject` class has the `ARC#HttpProject`. These kinds are used by other libraries to identify which data types they are given as the input.
16
+ Each data object that can exist by itself or in multiple contexts' should contain the `kind` property that uniquely identifies the type. For example, the `HttpProject` class has the `Core#HttpProject`. These kinds are used by other libraries to identify which data types they are given as the input.
17
17
 
18
18
  ### Validation
19
19
 
@@ -6,7 +6,7 @@ import { IRequestAuthorization, RequestAuthorization } from './RequestAuthorizat
6
6
  import { IRequestLog, RequestLog, Kind as LogKind } from './RequestLog.js';
7
7
  import { SentRequest } from './SentRequest.js';
8
8
  import { ErrorResponse } from './ErrorResponse.js';
9
- import { ArcResponse } from './ArcResponse.js';
9
+ import { Response } from './Response.js';
10
10
  import { RequestsSize } from './RequestsSize.js';
11
11
  import { IHttpRequest, HttpRequest, Kind as HttpRequestKind } from './HttpRequest.js';
12
12
  import { ARCSavedRequest, ARCHistoryRequest } from './legacy/request/ArcRequest.js';
@@ -14,13 +14,13 @@ import { ErrorResponse as LegacyErrorResponse, Response as LegacyResponse } from
14
14
  import { PayloadSerializer } from '../lib/transformers/PayloadSerializer.js';
15
15
  import { Normalizer } from './legacy/Normalizer.js';
16
16
 
17
- export const Kind = 'ARC#Request';
17
+ export const Kind = 'Core#Request';
18
18
  export const createdSymbol = Symbol('created');
19
19
  export const updatedSymbol = Symbol('updated');
20
20
  export const midnightSymbol = Symbol('midnight');
21
21
 
22
22
  /**
23
- * The definition of a request object that functions inside ARC
23
+ * The definition of a request object that functions inside API Client
24
24
  * with the full configuration.
25
25
  */
26
26
  export interface IRequest {
@@ -228,7 +228,7 @@ export class Request {
228
228
  log.response = await ErrorResponse.fromLegacy(typedError);
229
229
  } else {
230
230
  const typedResponse = normalized.response as LegacyResponse;
231
- log.response = await ArcResponse.fromLegacy(typedResponse);
231
+ log.response = await Response.fromLegacy(typedResponse);
232
232
  if (Array.isArray(typedResponse.redirects) && typedResponse.redirects.length) {
233
233
  const promises = typedResponse.redirects.map((redirect) => log.addLegacyRedirect(redirect));
234
234
  await Promise.allSettled(promises);
@@ -55,7 +55,7 @@ export class RequestActions {
55
55
  }
56
56
 
57
57
  /**
58
- * @param input The provider definition used to restore the state.
58
+ * @param input The request actions definition used to restore the state.
59
59
  */
60
60
  constructor(input?: string | IRequestActions) {
61
61
  let init: IRequestActions;
@@ -70,9 +70,7 @@ export class RequestActions {
70
70
  }
71
71
 
72
72
  /**
73
- * Creates a new provider clearing anything that is so far defined.
74
- *
75
- * Note, this throws an error when the provider is not an ARC provider object.
73
+ * Creates a new request actions clearing anything that is so far defined.
76
74
  */
77
75
  new(init: IRequestActions): void {
78
76
  const { request, response } = init;
@@ -1,13 +1,13 @@
1
1
  import { IAuthorizationSettingsUnion, AuthorizationType } from './Authorization.js';
2
2
  import { RequestAuthorization as LegacyAuthorization } from './legacy/request/ArcRequest.js';
3
3
 
4
- export const Kind = 'ARC#RequestAuthorization';
4
+ export const Kind = 'Core#RequestAuthorization';
5
5
 
6
6
  /**
7
7
  * Authorization configuration for the request.
8
8
  */
9
9
  export interface IRequestAuthorization {
10
- kind: string;
10
+ kind: typeof Kind;
11
11
  /**
12
12
  * Authorization configuration
13
13
  */
@@ -89,9 +89,7 @@ export class RequestAuthorization {
89
89
  }
90
90
 
91
91
  /**
92
- * Creates a new provider clearing anything that is so far defined.
93
- *
94
- * Note, this throws an error when the provider is not an ARC provider object.
92
+ * Creates a new request authorization clearing anything that is so far defined.
95
93
  */
96
94
  new(init: IRequestAuthorization): void {
97
95
  const { config, type, enabled, valid } = init;
@@ -2,7 +2,7 @@ import { IHostRule, HostRule } from './HostRule.js';
2
2
  import { IProperty, Property } from './Property.js';
3
3
  import { RequestConfig as LegacyConfig } from './legacy/request/ArcRequest.js';
4
4
 
5
- export const Kind = 'ARC#RequestConfig';
5
+ export const Kind = 'Core#RequestConfig';
6
6
 
7
7
  export interface IRequestBaseConfig {
8
8
  /**
@@ -62,10 +62,10 @@ export interface IRequestBaseConfig {
62
62
  }
63
63
 
64
64
  /**
65
- * ARC request `config` object.
65
+ * API Client request `config` object.
66
66
  */
67
67
  export interface IRequestConfig extends IRequestBaseConfig {
68
- kind: string;
68
+ kind: typeof Kind;
69
69
  /**
70
70
  * Whether the processor should use this configuration.
71
71
  */
@@ -205,8 +205,6 @@ export class RequestConfig {
205
205
 
206
206
  /**
207
207
  * Creates a new request configuration clearing anything that is so far defined.
208
- *
209
- * Note, this throws an error when the object is not an ARC request configuration.
210
208
  */
211
209
  new(init: IRequestConfig): void {
212
210
  const {
@@ -1,17 +1,17 @@
1
1
  import { IResponseRedirect, ResponseRedirect } from './ResponseRedirect.js';
2
2
  import { ISentRequest, SentRequest } from './SentRequest.js';
3
3
  import { IErrorResponse, ErrorResponse } from './ErrorResponse.js';
4
- import { IArcResponse, ArcResponse } from './ArcResponse.js';
4
+ import { IResponse, Response } from './Response.js';
5
5
  import { IRequestsSize, RequestsSize } from './RequestsSize.js';
6
6
  import { ResponseRedirect as LegacyRedirect } from './legacy/request/ArcResponse.js';
7
7
 
8
- export const Kind = 'ARC#ResponseLog';
8
+ export const Kind = 'Core#ResponseLog';
9
9
 
10
10
  /**
11
11
  * Describes a request / response pair associated with a request.
12
12
  */
13
13
  export interface IRequestLog {
14
- kind: 'ARC#ResponseLog';
14
+ kind: typeof Kind;
15
15
  /**
16
16
  * Describes an HTTP request sent by the transport.
17
17
  */
@@ -19,7 +19,7 @@ export interface IRequestLog {
19
19
  /**
20
20
  * The last response made with this request, if any.
21
21
  */
22
- response?: IArcResponse | IErrorResponse;
22
+ response?: IResponse | IErrorResponse;
23
23
  /**
24
24
  * The list of redirects, if any.
25
25
  */
@@ -42,7 +42,7 @@ export class RequestLog {
42
42
  /**
43
43
  * The last response made with this request, if any.
44
44
  */
45
- response?: ArcResponse | ErrorResponse;
45
+ response?: Response | ErrorResponse;
46
46
  /**
47
47
  * The list of redirects, if any.
48
48
  */
@@ -59,7 +59,7 @@ export class RequestLog {
59
59
  });
60
60
  }
61
61
 
62
- static fromRequestResponse(request: ISentRequest, response: IArcResponse | IErrorResponse): RequestLog {
62
+ static fromRequestResponse(request: ISentRequest, response: IResponse | IErrorResponse): RequestLog {
63
63
  return new RequestLog({
64
64
  kind: Kind,
65
65
  request,
@@ -86,8 +86,6 @@ export class RequestLog {
86
86
 
87
87
  /**
88
88
  * Creates a new response clearing anything that is so far defined.
89
- *
90
- * Note, this throws an error when the object is not an ARC response.
91
89
  */
92
90
  new(init: IRequestLog): void {
93
91
  const { request, response, redirects, size } = init;
@@ -96,10 +94,10 @@ export class RequestLog {
96
94
  this.request = new SentRequest(request);
97
95
  }
98
96
  if (response) {
99
- if (ArcResponse.isErrorResponse(response)) {
97
+ if (Response.isErrorResponse(response)) {
100
98
  this.response = new ErrorResponse(response as IErrorResponse);
101
99
  } else {
102
- this.response = new ArcResponse(response as IArcResponse);
100
+ this.response = new Response(response as IResponse);
103
101
  }
104
102
  } else {
105
103
  this.response = undefined;
@@ -1,10 +1,10 @@
1
- export const Kind = 'ARC#RequestTime';
1
+ export const Kind = 'Core#RequestTime';
2
2
 
3
3
  /**
4
- * Schema definition for ARC request timings. This is mostly consistent with HAR timings.
4
+ * Schema definition for API Client request timings. This is mostly consistent with HAR timings.
5
5
  */
6
6
  export interface IRequestTime {
7
- kind?: 'ARC#RequestTime';
7
+ kind?: typeof Kind;
8
8
  connect: number;
9
9
  receive: number;
10
10
  send: number;
@@ -48,9 +48,7 @@ export class RequestTime {
48
48
  }
49
49
 
50
50
  /**
51
- * Creates a new thing clearing anything that is so far defined.
52
- *
53
- * Note, this throws an error when the server is not an ARC thing.
51
+ * Creates a new timing clearing anything that is so far defined.
54
52
  */
55
53
  new(init: IRequestTime): void {
56
54
  const { connect=-1, receive=-1, send=-1, wait=-1, blocked=-1, dns=-1, ssl=-1 } = init;
@@ -2,7 +2,7 @@ import { IProperty, Property } from './Property.js';
2
2
  import { IMultipartBody } from '../lib/transformers/PayloadSerializer.js';
3
3
  import { RequestUiMeta as LegacyRequestUiMeta } from './legacy/request/ArcRequest.js';
4
4
 
5
- export const Kind = 'ARC#RequestUiMeta';
5
+ export const Kind = 'Core#RequestUiMeta';
6
6
 
7
7
  /**
8
8
  * URL editor meta data.
@@ -41,7 +41,7 @@ export interface IAuthMeta {
41
41
 
42
42
  export interface IActionsMeta {
43
43
  /**
44
- * The index of the selected arc actions view.
44
+ * The index of the selected API Client actions view.
45
45
  */
46
46
  selected?: number;
47
47
  }
@@ -64,7 +64,7 @@ export interface IResponseUiMeta {
64
64
  */
65
65
  export interface IBodyMetaModel {
66
66
  /**
67
- * The id of the editor. Each editor in ARC has own id.
67
+ * The id of the editor. Each editor in API Client has own id.
68
68
  */
69
69
  type: string;
70
70
  /**
@@ -124,7 +124,7 @@ export interface IRequestUiMeta {
124
124
  */
125
125
  authorization?: IAuthMeta;
126
126
  /**
127
- * ARC request actions editor UI config.
127
+ * API Client request actions editor UI config.
128
128
  */
129
129
  actions?: IActionsMeta;
130
130
  /**
@@ -156,7 +156,7 @@ export class RequestUiMeta {
156
156
  */
157
157
  authorization?: IAuthMeta;
158
158
  /**
159
- * ARC request actions editor UI config.
159
+ * API Client request actions editor UI config.
160
160
  */
161
161
  actions?: IActionsMeta;
162
162
  /**
@@ -1,4 +1,4 @@
1
- export const Kind = 'ARC#ResponseSize';
1
+ export const Kind = 'Core#ResponseSize';
2
2
 
3
3
  export interface IRequestsSize {
4
4
  kind?: typeof Kind;
@@ -44,8 +44,6 @@ export class RequestsSize {
44
44
 
45
45
  /**
46
46
  * Creates a new response size clearing anything that is so far defined.
47
- *
48
- * Note, this throws an error when the object is not an ARC response size.
49
47
  */
50
48
  new(init: IRequestsSize): void {
51
49
  const { request, response } = init;
@@ -11,7 +11,7 @@ export { Kind };
11
11
  /**
12
12
  * An HTTP response object.
13
13
  */
14
- export interface IArcResponse extends IHttpResponse {
14
+ export interface IResponse extends IHttpResponse {
15
15
  /**
16
16
  * The request timings.
17
17
  * Some HTTP clients may not give this information.
@@ -27,7 +27,7 @@ export interface IArcResponse extends IHttpResponse {
27
27
  auth?: IResponseAuthorization;
28
28
  }
29
29
 
30
- export class ArcResponse extends HttpResponse {
30
+ export class Response extends HttpResponse {
31
31
  /**
32
32
  * The request timings.
33
33
  * Some HTTP clients may not give this information.
@@ -42,8 +42,8 @@ export class ArcResponse extends HttpResponse {
42
42
  */
43
43
  auth?: ResponseAuthorization;
44
44
 
45
- static fromValues(status: number, statusText?: string, headers?: string): ArcResponse {
46
- return new ArcResponse({
45
+ static fromValues(status: number, statusText?: string, headers?: string): Response {
46
+ return new Response({
47
47
  kind: Kind,
48
48
  status,
49
49
  statusText,
@@ -52,8 +52,8 @@ export class ArcResponse extends HttpResponse {
52
52
  });
53
53
  }
54
54
 
55
- static async fromLegacy(input: LegacyResponse): Promise<ArcResponse> {
56
- const init: IArcResponse = {
55
+ static async fromLegacy(input: LegacyResponse): Promise<Response> {
56
+ const init: IResponse = {
57
57
  kind: Kind,
58
58
  status: input.status || 0,
59
59
  loadingTime: input.loadingTime || 0,
@@ -83,15 +83,15 @@ export class ArcResponse extends HttpResponse {
83
83
  if (input.timings) {
84
84
  init.timings = new RequestTime(input.timings).toJSON();
85
85
  }
86
- return new ArcResponse(init);
86
+ return new Response(init);
87
87
  }
88
88
 
89
89
  /**
90
90
  * @param input The response definition used to restore the state.
91
91
  */
92
- constructor(input?: string|IArcResponse) {
92
+ constructor(input?: string|IResponse) {
93
93
  super();
94
- let init: IArcResponse;
94
+ let init: IResponse;
95
95
  if (typeof input === 'string') {
96
96
  init = JSON.parse(input);
97
97
  } else if (typeof input === 'object') {
@@ -108,10 +108,8 @@ export class ArcResponse extends HttpResponse {
108
108
 
109
109
  /**
110
110
  * Creates a new response clearing anything that is so far defined.
111
- *
112
- * Note, this throws an error when the object is not an ARC response.
113
111
  */
114
- new(init: IArcResponse): void {
112
+ new(init: IResponse): void {
115
113
  super.new(init);
116
114
  const { loadingTime=0, timings, auth } = init;
117
115
  this.loadingTime = loadingTime;
@@ -127,8 +125,8 @@ export class ArcResponse extends HttpResponse {
127
125
  }
128
126
  }
129
127
 
130
- toJSON(): IArcResponse {
131
- const response = super.toJSON() as IArcResponse;
128
+ toJSON(): IResponse {
129
+ const response = super.toJSON() as IResponse;
132
130
  response.loadingTime = this.loadingTime;
133
131
  if (this.timings) {
134
132
  response.timings = this.timings.toJSON();
@@ -1,7 +1,7 @@
1
- export const Kind = 'ARC#ResponseAuthorization';
1
+ export const Kind = 'Core#ResponseAuthorization';
2
2
 
3
3
  export interface IResponseAuthorization {
4
- kind: 'ARC#ResponseAuthorization';
4
+ kind: typeof Kind;
5
5
  /**
6
6
  * The requested by the authorization server authentication method
7
7
  */
@@ -60,11 +60,11 @@ export class ResponseAuthorization {
60
60
  /**
61
61
  * Creates a new response authorization clearing anything that is so far defined.
62
62
  *
63
- * Note, this throws an error when the object is not an ARC response authorization.
63
+ * Note, this throws an error when the object is not a response authorization.
64
64
  */
65
65
  new(init: IResponseAuthorization): void {
66
66
  if (!ResponseAuthorization.isResponseAuthorization(init)) {
67
- throw new Error(`Not an ARC response authorization.`);
67
+ throw new Error(`Not a response authorization.`);
68
68
  }
69
69
  const { method, state, headers, challengeHeader } = init;
70
70
  this.kind = Kind;