@api-client/core 0.3.12 → 0.4.2
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.
- package/build/browser.d.ts +10 -8
- package/build/browser.js +11 -7
- package/build/browser.js.map +1 -1
- package/build/index.d.ts +12 -11
- package/build/index.js +9 -9
- package/build/index.js.map +1 -1
- package/build/src/data/JmesparthReader.d.ts +1 -1
- package/build/src/data/JmesparthReader.js +1 -1
- package/build/src/events/models/ProjectEvents.d.ts +1 -1
- package/build/src/events/models/ProjectEvents.js +1 -2
- package/build/src/events/models/ProjectEvents.js.map +1 -1
- package/build/src/lib/transformers/PayloadSerializer.d.ts +2 -2
- package/build/src/lib/transformers/PayloadSerializer.js +3 -3
- package/build/src/lib/transformers/PayloadSerializer.js.map +1 -1
- package/build/src/mocking/ProjectMock.d.ts +1 -1
- package/build/src/mocking/lib/Request.d.ts +2 -2
- package/build/src/mocking/lib/Request.js +3 -2
- package/build/src/mocking/lib/Request.js.map +1 -1
- package/build/src/mocking/lib/Response.d.ts +6 -6
- package/build/src/mocking/lib/Response.js +6 -6
- package/build/src/mocking/lib/Response.js.map +1 -1
- package/build/src/mocking/lib/User.js +3 -0
- package/build/src/mocking/lib/User.js.map +1 -1
- package/build/src/models/AuthorizationData.d.ts +2 -2
- package/build/src/models/AuthorizationData.js +2 -2
- package/build/src/models/ClientCertificate.d.ts +1 -1
- package/build/src/models/Environment.d.ts +3 -3
- package/build/src/models/Environment.js +3 -3
- package/build/src/models/Environment.js.map +1 -1
- package/build/src/models/ErrorResponse.d.ts +1 -1
- package/build/src/models/ErrorResponse.js +1 -1
- package/build/src/models/HostRule.d.ts +4 -4
- package/build/src/models/HostRule.js +4 -4
- package/build/src/models/HostRule.js.map +1 -1
- package/build/src/models/HttpHistory.d.ts +30 -1
- package/build/src/models/HttpHistory.js +1 -1
- package/build/src/models/HttpHistory.js.map +1 -1
- package/build/src/models/HttpProject.d.ts +41 -6
- package/build/src/models/HttpProject.js +52 -4
- package/build/src/models/HttpProject.js.map +1 -1
- package/build/src/models/HttpProjectListItem.d.ts +1 -1
- package/build/src/models/HttpProjectListItem.js +1 -1
- package/build/src/models/HttpProjectListItem.js.map +1 -1
- package/build/src/models/HttpRequest.d.ts +2 -2
- package/build/src/models/HttpRequest.js +2 -2
- package/build/src/models/HttpRequest.js.map +1 -1
- package/build/src/models/HttpResponse.d.ts +2 -2
- package/build/src/models/HttpResponse.js +3 -3
- package/build/src/models/HttpResponse.js.map +1 -1
- package/build/src/models/License.d.ts +3 -3
- package/build/src/models/License.js +3 -3
- package/build/src/models/License.js.map +1 -1
- package/build/src/models/ProjectFolder.d.ts +2 -2
- package/build/src/models/ProjectFolder.js +3 -3
- package/build/src/models/ProjectFolder.js.map +1 -1
- package/build/src/models/ProjectItem.d.ts +1 -1
- package/build/src/models/ProjectItem.js +2 -2
- package/build/src/models/ProjectItem.js.map +1 -1
- package/build/src/models/ProjectRequest.d.ts +2 -2
- package/build/src/models/ProjectRequest.js +1 -1
- package/build/src/models/ProjectRequest.js.map +1 -1
- package/build/src/models/ProjectSchema.d.ts +2 -2
- package/build/src/models/ProjectSchema.js +1 -1
- package/build/src/models/ProjectSchema.js.map +1 -1
- package/build/src/models/Property.d.ts +4 -4
- package/build/src/models/Property.js +4 -4
- package/build/src/models/Property.js.map +1 -1
- package/build/src/models/Provider.d.ts +3 -3
- package/build/src/models/Provider.js +3 -3
- package/build/src/models/Provider.js.map +1 -1
- package/build/src/models/Request.d.ts +2 -2
- package/build/src/models/Request.js +3 -3
- package/build/src/models/Request.js.map +1 -1
- package/build/src/models/RequestActions.d.ts +2 -4
- package/build/src/models/RequestActions.js +2 -4
- package/build/src/models/RequestActions.js.map +1 -1
- package/build/src/models/RequestAuthorization.d.ts +3 -5
- package/build/src/models/RequestAuthorization.js +2 -4
- package/build/src/models/RequestAuthorization.js.map +1 -1
- package/build/src/models/RequestConfig.d.ts +3 -5
- package/build/src/models/RequestConfig.js +1 -3
- package/build/src/models/RequestConfig.js.map +1 -1
- package/build/src/models/RequestLog.d.ts +14 -8
- package/build/src/models/RequestLog.js +18 -7
- package/build/src/models/RequestLog.js.map +1 -1
- package/build/src/models/RequestTime.d.ts +4 -6
- package/build/src/models/RequestTime.js +2 -4
- package/build/src/models/RequestTime.js.map +1 -1
- package/build/src/models/RequestUiMeta.d.ts +5 -5
- package/build/src/models/RequestUiMeta.js +2 -2
- package/build/src/models/RequestUiMeta.js.map +1 -1
- package/build/src/models/RequestsSize.d.ts +1 -3
- package/build/src/models/RequestsSize.js +1 -3
- package/build/src/models/RequestsSize.js.map +1 -1
- package/build/src/models/{ArcResponse.d.ts → Response.d.ts} +7 -9
- package/build/src/models/{ArcResponse.js → Response.js} +4 -6
- package/build/src/models/Response.js.map +1 -0
- package/build/src/models/ResponseAuthorization.d.ts +3 -3
- package/build/src/models/ResponseAuthorization.js +3 -3
- package/build/src/models/ResponseAuthorization.js.map +1 -1
- package/build/src/models/ResponseRedirect.d.ts +3 -5
- package/build/src/models/ResponseRedirect.js +1 -3
- package/build/src/models/ResponseRedirect.js.map +1 -1
- package/build/src/models/RevisionInfo.d.ts +1 -1
- package/build/src/models/RevisionInfo.js +1 -1
- package/build/src/models/RevisionInfo.js.map +1 -1
- package/build/src/models/SentRequest.d.ts +2 -4
- package/build/src/models/SentRequest.js +1 -3
- package/build/src/models/SentRequest.js.map +1 -1
- package/build/src/models/Server.d.ts +3 -3
- package/build/src/models/Server.js +3 -3
- package/build/src/models/Server.js.map +1 -1
- package/build/src/models/Thing.d.ts +3 -3
- package/build/src/models/Thing.js +3 -3
- package/build/src/models/Thing.js.map +1 -1
- package/build/src/models/Url.d.ts +2 -4
- package/build/src/models/Url.js +2 -4
- package/build/src/models/Url.js.map +1 -1
- package/build/src/models/User.d.ts +2 -1
- package/build/src/models/User.js +1 -1
- package/build/src/models/User.js.map +1 -1
- package/build/src/models/WebApi.d.ts +1 -1
- package/build/src/models/WebApi.js +1 -1
- package/build/src/models/WebApi.js.map +1 -1
- package/build/src/models/WebApiIndex.d.ts +1 -1
- package/build/src/models/WebApiIndex.js +1 -1
- package/build/src/models/WebApiIndex.js.map +1 -1
- package/build/src/models/Workspace.d.ts +4 -4
- package/build/src/models/Workspace.js +4 -4
- package/build/src/models/Workspace.js.map +1 -1
- package/build/src/models/actions/Action.d.ts +2 -2
- package/build/src/models/actions/Action.js +1 -1
- package/build/src/models/actions/Action.js.map +1 -1
- package/build/src/models/actions/Condition.d.ts +2 -2
- package/build/src/models/actions/Condition.js +1 -1
- package/build/src/models/actions/Condition.js.map +1 -1
- package/build/src/models/actions/RunnableAction.d.ts +1 -1
- package/build/src/models/actions/RunnableAction.js +1 -1
- package/build/src/models/actions/RunnableAction.js.map +1 -1
- package/build/src/models/actions/runnable/DeleteCookieAction.d.ts +2 -2
- package/build/src/models/actions/runnable/DeleteCookieAction.js +1 -1
- package/build/src/models/actions/runnable/DeleteCookieAction.js.map +1 -1
- package/build/src/models/actions/runnable/SetCookieAction.d.ts +2 -2
- package/build/src/models/actions/runnable/SetCookieAction.js +1 -1
- package/build/src/models/actions/runnable/SetCookieAction.js.map +1 -1
- package/build/src/models/actions/runnable/SetVariableAction.d.ts +2 -2
- package/build/src/models/actions/runnable/SetVariableAction.js +1 -1
- package/build/src/models/actions/runnable/SetVariableAction.js.map +1 -1
- package/build/src/models/transformers/ImportUtils.d.ts +1 -1
- package/build/src/models/transformers/ImportUtils.js +1 -1
- package/build/src/models/transformers/PostmanBackupTransformer.js +2 -1
- package/build/src/models/transformers/PostmanBackupTransformer.js.map +1 -1
- package/build/src/models/transformers/PostmanV21Transformer.js +2 -1
- package/build/src/models/transformers/PostmanV21Transformer.js.map +1 -1
- package/build/src/models/transformers/PostmanV2Transformer.js +2 -1
- package/build/src/models/transformers/PostmanV2Transformer.js.map +1 -1
- package/build/src/runtime/actions/RunnableCondition.d.ts +6 -7
- package/build/src/runtime/actions/RunnableCondition.js +4 -5
- package/build/src/runtime/actions/RunnableCondition.js.map +1 -1
- package/build/src/runtime/http-engine/{ArcEngine.d.ts → CoreEngine.d.ts} +3 -3
- package/build/src/runtime/http-engine/{ArcEngine.js → CoreEngine.js} +8 -8
- package/build/src/runtime/http-engine/CoreEngine.js.map +1 -0
- package/build/src/runtime/http-engine/HttpEngine.d.ts +3 -3
- package/build/src/runtime/http-engine/HttpEngine.js +3 -20
- package/build/src/runtime/http-engine/HttpEngine.js.map +1 -1
- package/build/src/runtime/modules/BasicAuthCache.js +2 -5
- package/build/src/runtime/modules/BasicAuthCache.js.map +1 -1
- package/build/src/runtime/modules/RequestCookies.d.ts +1 -1
- package/build/src/runtime/modules/RequestCookies.js +3 -2
- package/build/src/runtime/modules/RequestCookies.js.map +1 -1
- package/build/src/runtime/node/InteropInterfaces.d.ts +115 -0
- package/build/src/runtime/node/InteropInterfaces.js +2 -0
- package/build/src/runtime/node/InteropInterfaces.js.map +1 -0
- package/build/src/runtime/node/ProjectParallelRunner.d.ts +2 -7
- package/build/src/runtime/node/ProjectParallelRunner.js.map +1 -1
- package/build/src/runtime/node/ProjectRequestRunner.d.ts +17 -49
- package/build/src/runtime/node/ProjectRequestRunner.js +39 -10
- package/build/src/runtime/node/ProjectRequestRunner.js.map +1 -1
- package/build/src/runtime/node/ProjectRunner.d.ts +1 -59
- package/build/src/runtime/node/ProjectRunner.js.map +1 -1
- package/build/src/runtime/node/ProjectRunnerWorker.js.map +1 -1
- package/build/src/runtime/node/RequestFactory.d.ts +1 -1
- package/build/src/runtime/node/RequestFactory.js +3 -3
- package/build/src/runtime/node/RequestFactory.js.map +1 -1
- package/build/src/runtime/reporters/ProjectRunCliReporter.js.map +1 -1
- package/build/src/runtime/reporters/Reporter.js.map +1 -1
- package/build/src/runtime/store/AuthSdk.d.ts +28 -0
- package/build/src/runtime/store/AuthSdk.js +123 -0
- package/build/src/runtime/store/AuthSdk.js.map +1 -0
- package/build/src/runtime/store/BackendSdk.d.ts +8 -0
- package/build/src/runtime/store/BackendSdk.js +25 -0
- package/build/src/runtime/store/BackendSdk.js.map +1 -0
- package/build/src/runtime/store/HistorySdk.d.ts +48 -0
- package/build/src/runtime/store/HistorySdk.js +142 -0
- package/build/src/runtime/store/HistorySdk.js.map +1 -0
- package/build/src/runtime/store/Http.d.ts +14 -0
- package/build/src/runtime/store/Http.js +4 -0
- package/build/src/runtime/store/Http.js.map +1 -0
- package/build/src/runtime/store/HttpNode.d.ts +16 -0
- package/build/src/runtime/store/HttpNode.js +95 -0
- package/build/src/runtime/store/HttpNode.js.map +1 -0
- package/build/src/runtime/store/HttpWeb.d.ts +15 -0
- package/build/src/runtime/store/HttpWeb.js +83 -0
- package/build/src/runtime/store/HttpWeb.js.map +1 -0
- package/build/src/runtime/store/ProjectsSdk.d.ts +43 -0
- package/build/src/runtime/store/ProjectsSdk.js +144 -0
- package/build/src/runtime/store/ProjectsSdk.js.map +1 -0
- package/build/src/runtime/store/RouteBuilder.d.ts +42 -0
- package/build/src/runtime/store/RouteBuilder.js +75 -0
- package/build/src/runtime/store/RouteBuilder.js.map +1 -0
- package/build/src/runtime/store/Sdk.d.ts +79 -0
- package/build/src/runtime/store/Sdk.js +117 -0
- package/build/src/runtime/store/Sdk.js.map +1 -0
- package/build/src/runtime/store/SdkBase.d.ts +45 -0
- package/build/src/runtime/store/SdkBase.js +40 -0
- package/build/src/runtime/store/SdkBase.js.map +1 -0
- package/build/src/runtime/store/SpacesSdk.d.ts +50 -0
- package/build/src/runtime/store/SpacesSdk.js +185 -0
- package/build/src/runtime/store/SpacesSdk.js.map +1 -0
- package/build/src/runtime/store/StoreSdkNode.d.ts +10 -0
- package/build/src/runtime/store/StoreSdkNode.js +11 -0
- package/build/src/runtime/store/StoreSdkNode.js.map +1 -0
- package/build/src/runtime/store/StoreSdkWeb.d.ts +10 -0
- package/build/src/runtime/store/StoreSdkWeb.js +11 -0
- package/build/src/runtime/store/StoreSdkWeb.js.map +1 -0
- package/build/src/runtime/store/UsersSdk.d.ts +18 -0
- package/build/src/runtime/store/UsersSdk.js +88 -0
- package/build/src/runtime/store/UsersSdk.js.map +1 -0
- package/build/src/runtime/store/WsClient.d.ts +24 -0
- package/build/src/runtime/store/WsClient.js +4 -0
- package/build/src/runtime/store/WsClient.js.map +1 -0
- package/build/src/runtime/store/WsClientNode.d.ts +24 -0
- package/build/src/runtime/store/WsClientNode.js +66 -0
- package/build/src/runtime/store/WsClientNode.js.map +1 -0
- package/build/src/runtime/store/WsClientWeb.d.ts +23 -0
- package/build/src/runtime/store/WsClientWeb.js +73 -0
- package/build/src/runtime/store/WsClientWeb.js.map +1 -0
- package/package.json +6 -8
- package/readme.md +5 -5
- package/src/data/JmesparthReader.ts +1 -1
- package/src/events/models/ProjectEvents.ts +2 -2
- package/src/events/readme.md +1 -1
- package/src/lib/transformers/PayloadSerializer.ts +3 -3
- package/src/mocking/ProjectMock.ts +1 -1
- package/src/mocking/lib/Request.ts +5 -5
- package/src/mocking/lib/Response.ts +10 -10
- package/src/mocking/lib/User.ts +2 -1
- package/src/models/AuthorizationData.ts +2 -2
- package/src/models/ClientCertificate.ts +1 -1
- package/src/models/Environment.ts +4 -4
- package/src/models/ErrorResponse.ts +1 -1
- package/src/models/HostRule.ts +5 -5
- package/src/models/HttpHistory.ts +31 -1
- package/src/models/HttpProject.ts +87 -7
- package/src/models/HttpProjectListItem.ts +1 -1
- package/src/models/HttpRequest.ts +2 -2
- package/src/models/HttpResponse.ts +3 -3
- package/src/models/License.ts +4 -4
- package/src/models/ProjectFolder.ts +3 -3
- package/src/models/ProjectItem.ts +2 -2
- package/src/models/ProjectRequest.ts +2 -2
- package/src/models/ProjectSchema.ts +2 -2
- package/src/models/Property.ts +5 -5
- package/src/models/Provider.ts +4 -4
- package/src/models/README.md +2 -2
- package/src/models/Request.ts +4 -4
- package/src/models/RequestActions.ts +2 -4
- package/src/models/RequestAuthorization.ts +3 -5
- package/src/models/RequestConfig.ts +3 -5
- package/src/models/RequestLog.ts +25 -11
- package/src/models/RequestTime.ts +4 -6
- package/src/models/RequestUiMeta.ts +5 -5
- package/src/models/RequestsSize.ts +1 -3
- package/src/models/{ArcResponse.ts → Response.ts} +12 -14
- package/src/models/ResponseAuthorization.ts +4 -4
- package/src/models/ResponseRedirect.ts +3 -5
- package/src/models/RevisionInfo.ts +1 -1
- package/src/models/SentRequest.ts +2 -4
- package/src/models/Server.ts +4 -4
- package/src/models/Thing.ts +4 -4
- package/src/models/Url.ts +2 -4
- package/src/models/User.ts +2 -1
- package/src/models/WebApi.ts +1 -1
- package/src/models/WebApiIndex.ts +1 -1
- package/src/models/Workspace.ts +5 -5
- package/src/models/actions/Action.ts +2 -2
- package/src/models/actions/Condition.ts +2 -2
- package/src/models/actions/RunnableAction.ts +1 -1
- package/src/models/actions/runnable/DeleteCookieAction.ts +2 -2
- package/src/models/actions/runnable/SetCookieAction.ts +2 -2
- package/src/models/actions/runnable/SetVariableAction.ts +2 -2
- package/src/models/transformers/ImportUtils.ts +1 -1
- package/src/models/transformers/PostmanBackupTransformer.ts +2 -1
- package/src/models/transformers/PostmanV21Transformer.ts +2 -1
- package/src/models/transformers/PostmanV2Transformer.ts +2 -1
- package/src/runtime/actions/RunnableCondition.ts +6 -7
- package/src/runtime/http-engine/{ArcEngine.ts → CoreEngine.ts} +7 -7
- package/src/runtime/http-engine/HttpEngine.ts +5 -24
- package/src/runtime/modules/BasicAuthCache.ts +2 -6
- package/src/runtime/modules/RequestCookies.ts +6 -5
- package/src/runtime/node/InteropInterfaces.ts +121 -0
- package/src/runtime/node/ProjectParallelRunner.ts +2 -9
- package/src/runtime/node/ProjectRequestRunner.ts +42 -61
- package/src/runtime/node/ProjectRunner.ts +1 -60
- package/src/runtime/node/ProjectRunnerWorker.ts +2 -1
- package/src/runtime/node/RequestFactory.ts +3 -3
- package/src/runtime/reporters/ProjectRunCliReporter.ts +2 -2
- package/src/runtime/reporters/Reporter.ts +4 -4
- package/src/runtime/store/AuthSdk.ts +126 -0
- package/src/runtime/store/BackendSdk.ts +25 -0
- package/src/runtime/store/HistorySdk.ts +157 -0
- package/src/runtime/store/Http.ts +18 -0
- package/src/runtime/store/HttpNode.ts +100 -0
- package/src/runtime/store/HttpWeb.ts +89 -0
- package/src/runtime/store/ProjectsSdk.ts +147 -0
- package/src/runtime/store/RouteBuilder.ts +89 -0
- package/src/runtime/store/Sdk.ts +131 -0
- package/src/runtime/store/SdkBase.ts +72 -0
- package/src/runtime/store/SpacesSdk.ts +190 -0
- package/src/runtime/store/StoreSdkNode.ts +13 -0
- package/src/runtime/store/StoreSdkWeb.ts +13 -0
- package/src/runtime/store/UsersSdk.ts +89 -0
- package/src/runtime/store/WsClient.ts +28 -0
- package/src/runtime/store/WsClientNode.ts +68 -0
- package/src/runtime/store/WsClientWeb.ts +75 -0
- package/build/src/models/ArcResponse.js.map +0 -1
- package/build/src/models/HistoryIndex.d.ts +0 -43
- package/build/src/models/HistoryIndex.js +0 -53
- package/build/src/models/HistoryIndex.js.map +0 -1
- package/build/src/models/HistoryRequest.d.ts +0 -13
- package/build/src/models/HistoryRequest.js +0 -25
- package/build/src/models/HistoryRequest.js.map +0 -1
- package/build/src/runtime/http-engine/ArcEngine.js.map +0 -1
- package/build/src/runtime/http-engine/NodeEngine.d.ts +0 -154
- package/build/src/runtime/http-engine/NodeEngine.js +0 -766
- package/build/src/runtime/http-engine/NodeEngine.js.map +0 -1
- package/build/src/runtime/http-engine/NodeEngineDirect.d.ts +0 -113
- package/build/src/runtime/http-engine/NodeEngineDirect.js +0 -449
- package/build/src/runtime/http-engine/NodeEngineDirect.js.map +0 -1
- package/build/src/runtime/store/StoreSdk.d.ts +0 -279
- package/build/src/runtime/store/StoreSdk.js +0 -840
- package/build/src/runtime/store/StoreSdk.js.map +0 -1
- package/src/models/HistoryIndex.ts +0 -76
- package/src/models/HistoryRequest.ts +0 -28
- package/src/runtime/http-engine/NodeEngine.ts +0 -792
- package/src/runtime/http-engine/NodeEngineDirect.ts +0 -482
- package/src/runtime/store/StoreSdk.ts +0 -895
|
@@ -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
|
|
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.
|
|
@@ -166,13 +165,45 @@ export interface IProjectRequestIterator {
|
|
|
166
165
|
ignore?: string[];
|
|
167
166
|
}
|
|
168
167
|
|
|
168
|
+
export interface IProjectFolderIterator {
|
|
169
|
+
/**
|
|
170
|
+
* The parent folder key or name. Sets the starting point to iterate over the folder.
|
|
171
|
+
*/
|
|
172
|
+
parent?: string
|
|
173
|
+
/**
|
|
174
|
+
* When set it includes folders in the current folder and sub-folder according to the order
|
|
175
|
+
* defined in the folder.
|
|
176
|
+
*/
|
|
177
|
+
recursive?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* The list of names or keys to ignore.
|
|
180
|
+
*/
|
|
181
|
+
ignore?: string[];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface IProjectFolderIteratorResult {
|
|
185
|
+
/**
|
|
186
|
+
* The folder.
|
|
187
|
+
*/
|
|
188
|
+
folder: ProjectFolder;
|
|
189
|
+
/**
|
|
190
|
+
* Optional parent key.
|
|
191
|
+
*/
|
|
192
|
+
parent?: string;
|
|
193
|
+
/**
|
|
194
|
+
* How deep in the structure the folder is located.
|
|
195
|
+
* The indent is relative to the `parent`.
|
|
196
|
+
*/
|
|
197
|
+
indent: number;
|
|
198
|
+
}
|
|
199
|
+
|
|
169
200
|
/**
|
|
170
|
-
* The new definition of a project in
|
|
201
|
+
* The new definition of a project in API Client.
|
|
171
202
|
* Note, this is not the same as future `ApiProject` which is reserved for building APIs
|
|
172
203
|
* using RAML or OAS.
|
|
173
204
|
*/
|
|
174
205
|
export interface IHttpProject extends IProjectDefinitionProperty {
|
|
175
|
-
kind:
|
|
206
|
+
kind: typeof Kind;
|
|
176
207
|
/**
|
|
177
208
|
* The license information for this HTTP project.
|
|
178
209
|
*/
|
|
@@ -340,11 +371,11 @@ export class HttpProject extends ProjectParent {
|
|
|
340
371
|
/**
|
|
341
372
|
* Creates a new project definition clearing anything that is so far defined.
|
|
342
373
|
*
|
|
343
|
-
* Note, this throws an error when the project is not an
|
|
374
|
+
* Note, this throws an error when the project is not an API Client project.
|
|
344
375
|
*/
|
|
345
376
|
new(init: IHttpProject): void {
|
|
346
377
|
if (!init || !init.definitions || !init.items) {
|
|
347
|
-
throw new Error(`Not
|
|
378
|
+
throw new Error(`Not a project.`);
|
|
348
379
|
}
|
|
349
380
|
const { key = v4(), definitions = {}, items, info, license, provider, environments } = init;
|
|
350
381
|
this.key = key;
|
|
@@ -1234,7 +1265,7 @@ export class HttpProject extends ProjectParent {
|
|
|
1234
1265
|
}
|
|
1235
1266
|
|
|
1236
1267
|
/**
|
|
1237
|
-
* Iterates over requests in the project
|
|
1268
|
+
* Iterates over requests in the project.
|
|
1238
1269
|
*/
|
|
1239
1270
|
* requestIterator(opts: IProjectRequestIterator = {}): Generator<ProjectRequest> {
|
|
1240
1271
|
const { definitions } = this;
|
|
@@ -1286,6 +1317,55 @@ export class HttpProject extends ProjectParent {
|
|
|
1286
1317
|
}
|
|
1287
1318
|
}
|
|
1288
1319
|
|
|
1320
|
+
/**
|
|
1321
|
+
* Iterates over requests in the project.
|
|
1322
|
+
* @param opts Iterator configuration options
|
|
1323
|
+
* @param indent Used internally to add `indent` to the result
|
|
1324
|
+
*/
|
|
1325
|
+
* folderIterator(opts: IProjectFolderIterator={}, indent=0): Generator<IProjectFolderIteratorResult> {
|
|
1326
|
+
const { definitions } = this;
|
|
1327
|
+
const { ignore=[], parent, recursive } = opts;
|
|
1328
|
+
const root = parent ? this.findFolder(parent) : this;
|
|
1329
|
+
if (!root) {
|
|
1330
|
+
throw new Error(`The parent folder not found: ${parent}.`);
|
|
1331
|
+
}
|
|
1332
|
+
const items = root.items;
|
|
1333
|
+
if (!items || !items.length) {
|
|
1334
|
+
return;
|
|
1335
|
+
}
|
|
1336
|
+
for (const item of items) {
|
|
1337
|
+
if (item.kind !== ProjectFolderKind) {
|
|
1338
|
+
continue;
|
|
1339
|
+
}
|
|
1340
|
+
const folder = definitions.folders.find(i => i.key === item.key);
|
|
1341
|
+
if (!folder) {
|
|
1342
|
+
// missing definition.
|
|
1343
|
+
continue;
|
|
1344
|
+
}
|
|
1345
|
+
if (ignore.includes(folder.key) || (folder.info.name && ignore.includes(folder.info.name))) {
|
|
1346
|
+
continue;
|
|
1347
|
+
}
|
|
1348
|
+
const result: IProjectFolderIteratorResult = {
|
|
1349
|
+
folder,
|
|
1350
|
+
indent,
|
|
1351
|
+
}
|
|
1352
|
+
if (parent) {
|
|
1353
|
+
result.parent = parent;
|
|
1354
|
+
}
|
|
1355
|
+
yield result;
|
|
1356
|
+
if (recursive) {
|
|
1357
|
+
const it = this.folderIterator({
|
|
1358
|
+
parent: folder.key,
|
|
1359
|
+
recursive,
|
|
1360
|
+
ignore,
|
|
1361
|
+
}, indent += 1);
|
|
1362
|
+
for (const f of it) {
|
|
1363
|
+
yield f;
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1289
1369
|
[Symbol.iterator](): Generator<ProjectRequest> {
|
|
1290
1370
|
return this.requestIterator({
|
|
1291
1371
|
recursive: true,
|
|
@@ -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 = '
|
|
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
|
|
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 = '
|
|
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
|
|
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
|
|
98
|
+
throw new Error(`Not a response.`);
|
|
99
99
|
}
|
|
100
100
|
const { status, statusText, headers, payload, kind=Kind } = init;
|
|
101
101
|
this.kind = kind;
|
package/src/models/License.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export const Kind = '
|
|
1
|
+
export const Kind = 'Core#License';
|
|
2
2
|
|
|
3
3
|
export interface ILicense {
|
|
4
|
-
kind:
|
|
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
|
|
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
|
|
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 = '
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 = '
|
|
9
|
+
export const Kind = 'Core#ProjectRequest';
|
|
10
10
|
|
|
11
11
|
export interface IProjectRequest extends IProjectDefinitionProperty, IRequest {
|
|
12
|
-
kind:
|
|
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 = '
|
|
3
|
+
export const Kind = 'Core#ProjectSchema';
|
|
4
4
|
|
|
5
5
|
export interface IProjectSchema {
|
|
6
|
-
kind?:
|
|
6
|
+
kind?: typeof Kind;
|
|
7
7
|
/**
|
|
8
8
|
* The identifier of the environment.
|
|
9
9
|
*/
|
package/src/models/Property.ts
CHANGED
|
@@ -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:
|
|
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 = '
|
|
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
|
|
361
|
+
* Creates a new property.
|
|
362
362
|
*
|
|
363
|
-
* Note, this throws an error when the property is not
|
|
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
|
|
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;
|
package/src/models/Provider.ts
CHANGED
|
@@ -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:
|
|
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 = '
|
|
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
|
|
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
|
|
63
|
+
throw new Error(`Not a provider.`);
|
|
64
64
|
}
|
|
65
65
|
const { url, email, name } = init;
|
|
66
66
|
this.kind = Kind;
|
package/src/models/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# API Client
|
|
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 `
|
|
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
|
|
package/src/models/Request.ts
CHANGED
|
@@ -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 {
|
|
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 = '
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 = '
|
|
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:
|
|
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
|
|
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 = '
|
|
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
|
-
*
|
|
65
|
+
* API Client request `config` object.
|
|
66
66
|
*/
|
|
67
67
|
export interface IRequestConfig extends IRequestBaseConfig {
|
|
68
|
-
kind:
|
|
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 {
|
package/src/models/RequestLog.ts
CHANGED
|
@@ -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 {
|
|
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 = '
|
|
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:
|
|
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?:
|
|
22
|
+
response?: IResponse | IErrorResponse;
|
|
23
23
|
/**
|
|
24
24
|
* The list of redirects, if any.
|
|
25
25
|
*/
|
|
@@ -28,6 +28,10 @@ export interface IRequestLog {
|
|
|
28
28
|
* Request and response size. Some HTTP clients may not give this information.
|
|
29
29
|
*/
|
|
30
30
|
size?: IRequestsSize;
|
|
31
|
+
/**
|
|
32
|
+
* Optional request ID defined on an HTTP project that triggered this log.
|
|
33
|
+
*/
|
|
34
|
+
requestId?: string;
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
/**
|
|
@@ -42,7 +46,7 @@ export class RequestLog {
|
|
|
42
46
|
/**
|
|
43
47
|
* The last response made with this request, if any.
|
|
44
48
|
*/
|
|
45
|
-
response?:
|
|
49
|
+
response?: Response | ErrorResponse;
|
|
46
50
|
/**
|
|
47
51
|
* The list of redirects, if any.
|
|
48
52
|
*/
|
|
@@ -51,6 +55,10 @@ export class RequestLog {
|
|
|
51
55
|
* Request and response size. Some HTTP clients may not give this information.
|
|
52
56
|
*/
|
|
53
57
|
size?: RequestsSize;
|
|
58
|
+
/**
|
|
59
|
+
* Optional request ID defined on an HTTP project that triggered this log.
|
|
60
|
+
*/
|
|
61
|
+
requestId?: string;
|
|
54
62
|
|
|
55
63
|
static fromRequest(request: ISentRequest): RequestLog {
|
|
56
64
|
return new RequestLog({
|
|
@@ -59,7 +67,7 @@ export class RequestLog {
|
|
|
59
67
|
});
|
|
60
68
|
}
|
|
61
69
|
|
|
62
|
-
static fromRequestResponse(request: ISentRequest, response:
|
|
70
|
+
static fromRequestResponse(request: ISentRequest, response: IResponse | IErrorResponse): RequestLog {
|
|
63
71
|
return new RequestLog({
|
|
64
72
|
kind: Kind,
|
|
65
73
|
request,
|
|
@@ -86,20 +94,18 @@ export class RequestLog {
|
|
|
86
94
|
|
|
87
95
|
/**
|
|
88
96
|
* 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
97
|
*/
|
|
92
98
|
new(init: IRequestLog): void {
|
|
93
|
-
const { request, response, redirects, size } = init;
|
|
99
|
+
const { request, response, redirects, size, requestId } = init;
|
|
94
100
|
this.kind = Kind;
|
|
95
101
|
if (request) {
|
|
96
102
|
this.request = new SentRequest(request);
|
|
97
103
|
}
|
|
98
104
|
if (response) {
|
|
99
|
-
if (
|
|
105
|
+
if (Response.isErrorResponse(response)) {
|
|
100
106
|
this.response = new ErrorResponse(response as IErrorResponse);
|
|
101
107
|
} else {
|
|
102
|
-
this.response = new
|
|
108
|
+
this.response = new Response(response as IResponse);
|
|
103
109
|
}
|
|
104
110
|
} else {
|
|
105
111
|
this.response = undefined;
|
|
@@ -114,6 +120,11 @@ export class RequestLog {
|
|
|
114
120
|
} else {
|
|
115
121
|
this.size = undefined;
|
|
116
122
|
}
|
|
123
|
+
if (requestId) {
|
|
124
|
+
this.requestId = requestId;
|
|
125
|
+
} else {
|
|
126
|
+
this.requestId = undefined;
|
|
127
|
+
}
|
|
117
128
|
}
|
|
118
129
|
|
|
119
130
|
toJSON(): IRequestLog {
|
|
@@ -132,6 +143,9 @@ export class RequestLog {
|
|
|
132
143
|
if (this.response) {
|
|
133
144
|
result.response = this.response.toJSON();
|
|
134
145
|
}
|
|
146
|
+
if (this.requestId) {
|
|
147
|
+
result.requestId = this.requestId;
|
|
148
|
+
}
|
|
135
149
|
return result;
|
|
136
150
|
}
|
|
137
151
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export const Kind = '
|
|
1
|
+
export const Kind = 'Core#RequestTime';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Schema definition for
|
|
4
|
+
* Schema definition for API Client request timings. This is mostly consistent with HAR timings.
|
|
5
5
|
*/
|
|
6
6
|
export interface IRequestTime {
|
|
7
|
-
kind?:
|
|
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
|
|
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 = '
|
|
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
|
|
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
|
|
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
|
-
*
|
|
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
|
-
*
|
|
159
|
+
* API Client request actions editor UI config.
|
|
160
160
|
*/
|
|
161
161
|
actions?: IActionsMeta;
|
|
162
162
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const Kind = '
|
|
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;
|