@api-client/core 0.6.29 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/browser.d.ts +6 -14
- package/build/browser.js +11 -16
- package/build/browser.js.map +1 -1
- package/build/index.d.ts +8 -20
- package/build/index.js +13 -25
- package/build/index.js.map +1 -1
- package/build/src/amf/ApiSchemaValues.d.ts +2 -0
- package/build/src/amf/ApiSchemaValues.js +29 -23
- package/build/src/amf/ApiSchemaValues.js.map +1 -1
- package/build/src/authorization/lib/Utils.d.ts +1 -1
- package/build/src/cookies/CookieJar.d.ts +23 -0
- package/build/src/cookies/CookieJar.js +3 -0
- package/build/src/cookies/CookieJar.js.map +1 -0
- package/build/src/cookies/CookieParser.d.ts +67 -0
- package/build/src/cookies/CookieParser.js +316 -0
- package/build/src/cookies/CookieParser.js.map +1 -0
- package/build/src/cookies/InMemoryCookieJar.d.ts +12 -0
- package/build/src/cookies/InMemoryCookieJar.js +68 -0
- package/build/src/cookies/InMemoryCookieJar.js.map +1 -0
- package/build/src/cookies/Punycode.d.ts +12 -0
- package/build/src/cookies/Punycode.js +124 -0
- package/build/src/cookies/Punycode.js.map +1 -0
- package/build/src/data/RequestDataExtractor.d.ts +8 -7
- package/build/src/data/RequestDataExtractor.js +8 -10
- package/build/src/data/RequestDataExtractor.js.map +1 -1
- package/build/src/events/CustomEvent.js +5 -0
- package/build/src/events/CustomEvent.js.map +1 -1
- package/build/src/events/EventTypes.d.ts +43 -43
- package/build/src/events/amf/AmfEventTypes.d.ts +4 -4
- package/build/src/events/authorization/AuthorizationEventTypes.d.ts +4 -4
- package/build/src/events/cookies/CookieEventTypes.d.ts +9 -9
- package/build/src/events/encryption/EncryptionEventTypes.d.ts +2 -2
- package/build/src/events/environment/EnvironmentEventTypes.d.ts +1 -1
- package/build/src/events/models/ModelEventTypes.d.ts +7 -7
- package/build/src/events/process/ProcessEventTypes.d.ts +3 -3
- package/build/src/events/reporting/ReportingEventTypes.d.ts +1 -1
- package/build/src/events/telemetry/TelemetryEventTypes.d.ts +6 -6
- package/build/src/events/transport/TransportEventTypes.d.ts +6 -6
- package/build/src/events/transport/TransportEvents.d.ts +2 -2
- package/build/src/mocking/ProjectMock.d.ts +3 -2
- package/build/src/mocking/ProjectMock.js +3 -3
- package/build/src/mocking/ProjectMock.js.map +1 -1
- package/build/src/mocking/lib/App.d.ts +36 -0
- package/build/src/mocking/lib/App.js +70 -0
- package/build/src/mocking/lib/App.js.map +1 -0
- package/build/src/models/{arc/ArcProject.d.ts → AppProject.d.ts} +296 -134
- package/build/src/models/{arc/ArcProject.js → AppProject.js} +436 -79
- package/build/src/models/AppProject.js.map +1 -0
- package/build/src/models/AppRequest.d.ts +69 -0
- package/build/src/models/AppRequest.js +150 -0
- package/build/src/models/AppRequest.js.map +1 -0
- package/build/src/models/ClientCertificate.d.ts +2 -2
- package/build/src/models/Environment.d.ts +8 -1
- package/build/src/models/Environment.js +21 -0
- package/build/src/models/Environment.js.map +1 -1
- package/build/src/models/HostRule.d.ts +2 -2
- package/build/src/models/HttpCookie.d.ts +63 -12
- package/build/src/models/HttpCookie.js +178 -44
- package/build/src/models/HttpCookie.js.map +1 -1
- package/build/src/models/HttpHistory.d.ts +8 -3
- package/build/src/models/HttpHistory.js +3 -3
- package/build/src/models/HttpHistory.js.map +1 -1
- package/build/src/models/HttpProject.d.ts +34 -1
- package/build/src/models/HttpProject.js +104 -8
- package/build/src/models/HttpProject.js.map +1 -1
- package/build/src/models/ProjectFolder.d.ts +2 -0
- package/build/src/models/ProjectFolder.js +14 -0
- package/build/src/models/ProjectFolder.js.map +1 -1
- package/build/src/models/ProjectItem.d.ts +2 -0
- package/build/src/models/ProjectItem.js +20 -0
- package/build/src/models/ProjectItem.js.map +1 -1
- package/build/src/models/ProjectParent.js.map +1 -1
- package/build/src/models/ProjectRequest.d.ts +3 -2
- package/build/src/models/ProjectRequest.js.map +1 -1
- package/build/src/models/Property.d.ts +2 -2
- package/build/src/models/Property.js +2 -2
- package/build/src/models/Property.js.map +1 -1
- package/build/src/models/Request.d.ts +16 -8
- package/build/src/models/Request.js +20 -15
- package/build/src/models/Request.js.map +1 -1
- package/build/src/models/RequestAuthorization.js.map +1 -1
- package/build/src/models/RequestUiMeta.d.ts +0 -14
- package/build/src/models/RequestUiMeta.js +1 -10
- package/build/src/models/RequestUiMeta.js.map +1 -1
- package/build/src/models/Server.d.ts +1 -2
- package/build/src/models/Server.js.map +1 -1
- package/build/src/models/http-actions/HttpActions.d.ts +256 -0
- package/build/src/models/http-actions/HttpActions.js +46 -0
- package/build/src/models/http-actions/HttpActions.js.map +1 -0
- package/build/src/models/http-actions/LegacyTranslator.d.ts +17 -0
- package/build/src/models/http-actions/LegacyTranslator.js +222 -0
- package/build/src/models/http-actions/LegacyTranslator.js.map +1 -0
- package/build/src/models/store/Backend.d.ts +136 -1
- package/build/src/models/store/File.d.ts +1 -1
- package/build/src/models/store/File.js +2 -0
- package/build/src/models/store/File.js.map +1 -1
- package/build/src/models/store/User.d.ts +3 -3
- package/build/src/runtime/http-engine/CoreEngine.d.ts +2 -0
- package/build/src/runtime/http-engine/CoreEngine.js +1 -0
- package/build/src/runtime/http-engine/CoreEngine.js.map +1 -1
- package/build/src/runtime/http-engine/HttpEngine.d.ts +13 -0
- package/build/src/runtime/http-engine/HttpEngine.js +39 -31
- package/build/src/runtime/http-engine/HttpEngine.js.map +1 -1
- package/build/src/runtime/{actions/ConditionRunner.d.ts → http-runner/ConditionCheck.d.ts} +2 -2
- package/build/src/runtime/{actions/ConditionRunner.js → http-runner/ConditionCheck.js} +2 -2
- package/build/src/runtime/http-runner/ConditionCheck.js.map +1 -0
- package/build/src/runtime/http-runner/HttpFlowRunner.d.ts +62 -0
- package/build/src/runtime/http-runner/HttpFlowRunner.js +217 -0
- package/build/src/runtime/http-runner/HttpFlowRunner.js.map +1 -0
- package/build/src/runtime/{node/RequestFactory.d.ts → http-runner/HttpRequestRunner.d.ts} +40 -54
- package/build/src/runtime/http-runner/HttpRequestRunner.js +316 -0
- package/build/src/runtime/http-runner/HttpRequestRunner.js.map +1 -0
- package/build/src/runtime/http-runner/HttpRuntimeEnvironment.d.ts +25 -0
- package/build/src/runtime/http-runner/HttpRuntimeEnvironment.js +2 -0
- package/build/src/runtime/http-runner/HttpRuntimeEnvironment.js.map +1 -0
- package/build/src/runtime/http-runner/RequestAuthorizationProcessor.d.ts +56 -0
- package/build/src/runtime/http-runner/RequestAuthorizationProcessor.js +143 -0
- package/build/src/runtime/http-runner/RequestAuthorizationProcessor.js.map +1 -0
- package/build/src/runtime/http-runner/RequestCookiesProcessor.d.ts +24 -0
- package/build/src/runtime/http-runner/RequestCookiesProcessor.js +65 -0
- package/build/src/runtime/http-runner/RequestCookiesProcessor.js.map +1 -0
- package/build/src/runtime/node/InteropInterfaces.d.ts +21 -6
- package/build/src/runtime/node/ProjectParallelRunner.js +3 -1
- package/build/src/runtime/node/ProjectParallelRunner.js.map +1 -1
- package/build/src/runtime/node/ProjectRequestRunner.d.ts +24 -10
- package/build/src/runtime/node/ProjectRequestRunner.js +116 -45
- package/build/src/runtime/node/ProjectRequestRunner.js.map +1 -1
- package/build/src/runtime/node/ProjectRunner.d.ts +5 -7
- package/build/src/runtime/node/ProjectRunner.js +30 -14
- package/build/src/runtime/node/ProjectRunner.js.map +1 -1
- package/build/src/runtime/node/ProjectRunnerWorker.js +3 -0
- package/build/src/runtime/node/ProjectRunnerWorker.js.map +1 -1
- package/build/src/runtime/reporters/Reporter.d.ts +5 -0
- package/build/src/runtime/reporters/Reporter.js.map +1 -1
- package/build/src/runtime/store/FilesSdk.js +4 -4
- package/build/src/runtime/store/FilesSdk.js.map +1 -1
- package/build/src/runtime/store/HistorySdk.js +1 -1
- package/build/src/runtime/store/HistorySdk.js.map +1 -1
- package/build/src/runtime/store/HttpClientSdk.d.ts +167 -0
- package/build/src/runtime/store/HttpClientSdk.js +624 -0
- package/build/src/runtime/store/HttpClientSdk.js.map +1 -0
- package/build/src/runtime/store/RouteBuilder.d.ts +17 -2
- package/build/src/runtime/store/RouteBuilder.js +60 -3
- package/build/src/runtime/store/RouteBuilder.js.map +1 -1
- package/build/src/runtime/store/Sdk.d.ts +5 -0
- package/build/src/runtime/store/Sdk.js +5 -0
- package/build/src/runtime/store/Sdk.js.map +1 -1
- package/build/src/runtime/store/SharedSdk.js +1 -1
- package/build/src/runtime/store/SharedSdk.js.map +1 -1
- package/build/src/runtime/store/UsersSdk.js +1 -1
- package/build/src/runtime/store/UsersSdk.js.map +1 -1
- package/package.json +2 -2
- package/src/amf/ApiSchemaValues.ts +41 -33
- package/src/cookies/CookieJar.ts +26 -0
- package/src/cookies/CookieParser.ts +327 -0
- package/src/cookies/InMemoryCookieJar.ts +70 -0
- package/src/cookies/Punycode.ts +133 -0
- package/src/data/RequestDataExtractor.ts +14 -15
- package/src/events/CustomEvent.ts +4 -0
- package/src/mocking/ProjectMock.ts +4 -3
- package/src/mocking/lib/App.ts +101 -0
- package/src/models/{arc/ArcProject.ts → AppProject.ts} +671 -225
- package/src/models/AppRequest.ts +176 -0
- package/src/models/ClientCertificate.ts +2 -2
- package/src/models/Environment.ts +24 -2
- package/src/models/HostRule.ts +2 -2
- package/src/models/HttpCookie.ts +210 -48
- package/src/models/HttpHistory.ts +12 -5
- package/src/models/HttpProject.ts +113 -10
- package/src/models/ProjectFolder.ts +16 -0
- package/src/models/ProjectItem.ts +18 -0
- package/src/models/ProjectParent.ts +4 -1
- package/src/models/ProjectRequest.ts +4 -3
- package/src/models/Property.ts +4 -4
- package/src/models/Request.ts +29 -19
- package/src/models/RequestAuthorization.ts +4 -4
- package/src/models/RequestUiMeta.ts +1 -21
- package/src/models/Server.ts +1 -2
- package/src/models/http-actions/HttpActions.ts +270 -0
- package/src/models/http-actions/LegacyTranslator.ts +223 -0
- package/src/models/store/Backend.ts +148 -2
- package/src/models/store/File.ts +3 -1
- package/src/models/store/User.ts +3 -3
- package/src/runtime/http-engine/CoreEngine.ts +3 -2
- package/src/runtime/http-engine/HttpEngine.ts +48 -30
- package/src/runtime/{actions/ConditionRunner.ts → http-runner/ConditionCheck.ts} +3 -3
- package/src/runtime/http-runner/HttpFlowRunner.ts +232 -0
- package/src/runtime/http-runner/HttpRequestRunner.ts +353 -0
- package/src/runtime/http-runner/HttpRuntimeEnvironment.ts +27 -0
- package/src/runtime/http-runner/RequestAuthorizationProcessor.ts +144 -0
- package/src/runtime/http-runner/RequestCookiesProcessor.ts +74 -0
- package/src/runtime/node/InteropInterfaces.ts +24 -6
- package/src/runtime/node/ProjectParallelRunner.ts +4 -2
- package/src/runtime/node/ProjectRequestRunner.ts +130 -60
- package/src/runtime/node/ProjectRunner.ts +37 -22
- package/src/runtime/node/ProjectRunnerWorker.ts +3 -0
- package/src/runtime/reporters/Reporter.ts +5 -0
- package/src/runtime/store/FilesSdk.ts +4 -4
- package/src/runtime/store/HistorySdk.ts +1 -1
- package/src/runtime/store/HttpClientSdk.ts +629 -0
- package/src/runtime/store/RouteBuilder.ts +75 -3
- package/src/runtime/store/Sdk.ts +6 -0
- package/src/runtime/store/SharedSdk.ts +1 -1
- package/src/runtime/store/UsersSdk.ts +1 -1
- package/build/src/lib/cookies/Cookie.d.ts +0 -123
- package/build/src/lib/cookies/Cookie.js +0 -257
- package/build/src/lib/cookies/Cookie.js.map +0 -1
- package/build/src/lib/cookies/Cookies.d.ts +0 -90
- package/build/src/lib/cookies/Cookies.js +0 -310
- package/build/src/lib/cookies/Cookies.js.map +0 -1
- package/build/src/lib/cookies/Utils.d.ts +0 -47
- package/build/src/lib/cookies/Utils.js +0 -163
- package/build/src/lib/cookies/Utils.js.map +0 -1
- package/build/src/mocking/lib/Arc.d.ts +0 -10
- package/build/src/mocking/lib/Arc.js +0 -31
- package/build/src/mocking/lib/Arc.js.map +0 -1
- package/build/src/models/RequestActions.d.ts +0 -65
- package/build/src/models/RequestActions.js +0 -114
- package/build/src/models/RequestActions.js.map +0 -1
- package/build/src/models/actions/Action.d.ts +0 -75
- package/build/src/models/actions/Action.js +0 -188
- package/build/src/models/actions/Action.js.map +0 -1
- package/build/src/models/actions/ActionView.d.ts +0 -15
- package/build/src/models/actions/ActionView.js +0 -33
- package/build/src/models/actions/ActionView.js.map +0 -1
- package/build/src/models/actions/Condition.d.ts +0 -81
- package/build/src/models/actions/Condition.js +0 -185
- package/build/src/models/actions/Condition.js.map +0 -1
- package/build/src/models/actions/ConditionView.d.ts +0 -17
- package/build/src/models/actions/ConditionView.js +0 -34
- package/build/src/models/actions/ConditionView.js.map +0 -1
- package/build/src/models/actions/Enums.d.ts +0 -26
- package/build/src/models/actions/Enums.js +0 -31
- package/build/src/models/actions/Enums.js.map +0 -1
- package/build/src/models/actions/RunnableAction.d.ts +0 -59
- package/build/src/models/actions/RunnableAction.js +0 -106
- package/build/src/models/actions/RunnableAction.js.map +0 -1
- package/build/src/models/actions/runnable/DeleteCookieAction.d.ts +0 -44
- package/build/src/models/actions/runnable/DeleteCookieAction.js +0 -92
- package/build/src/models/actions/runnable/DeleteCookieAction.js.map +0 -1
- package/build/src/models/actions/runnable/Runnable.d.ts +0 -8
- package/build/src/models/actions/runnable/Runnable.js +0 -4
- package/build/src/models/actions/runnable/Runnable.js.map +0 -1
- package/build/src/models/actions/runnable/SetCookieAction.d.ts +0 -87
- package/build/src/models/actions/runnable/SetCookieAction.js +0 -176
- package/build/src/models/actions/runnable/SetCookieAction.js.map +0 -1
- package/build/src/models/actions/runnable/SetVariableAction.d.ts +0 -31
- package/build/src/models/actions/runnable/SetVariableAction.js +0 -63
- package/build/src/models/actions/runnable/SetVariableAction.js.map +0 -1
- package/build/src/models/actions/runnable/index.d.ts +0 -7
- package/build/src/models/actions/runnable/index.js +0 -2
- package/build/src/models/actions/runnable/index.js.map +0 -1
- package/build/src/models/arc/ArcHttpRequest.d.ts +0 -39
- package/build/src/models/arc/ArcHttpRequest.js +0 -106
- package/build/src/models/arc/ArcHttpRequest.js.map +0 -1
- package/build/src/models/arc/ArcProject.js.map +0 -1
- package/build/src/runtime/actions/ActionRunner.d.ts +0 -17
- package/build/src/runtime/actions/ActionRunner.js +0 -74
- package/build/src/runtime/actions/ActionRunner.js.map +0 -1
- package/build/src/runtime/actions/ConditionRunner.js.map +0 -1
- package/build/src/runtime/actions/RunnableCondition.d.ts +0 -27
- package/build/src/runtime/actions/RunnableCondition.js +0 -50
- package/build/src/runtime/actions/RunnableCondition.js.map +0 -1
- package/build/src/runtime/actions/runnable/ActionRunnable.d.ts +0 -13
- package/build/src/runtime/actions/runnable/ActionRunnable.js +0 -13
- package/build/src/runtime/actions/runnable/ActionRunnable.js.map +0 -1
- package/build/src/runtime/actions/runnable/DeleteCookieRunnable.d.ts +0 -7
- package/build/src/runtime/actions/runnable/DeleteCookieRunnable.js +0 -36
- package/build/src/runtime/actions/runnable/DeleteCookieRunnable.js.map +0 -1
- package/build/src/runtime/actions/runnable/SetCookieRunnable.d.ts +0 -10
- package/build/src/runtime/actions/runnable/SetCookieRunnable.js +0 -89
- package/build/src/runtime/actions/runnable/SetCookieRunnable.js.map +0 -1
- package/build/src/runtime/actions/runnable/SetVariableRunnable.d.ts +0 -10
- package/build/src/runtime/actions/runnable/SetVariableRunnable.js +0 -49
- package/build/src/runtime/actions/runnable/SetVariableRunnable.js.map +0 -1
- package/build/src/runtime/modules/BasicAuthCache.d.ts +0 -39
- package/build/src/runtime/modules/BasicAuthCache.js +0 -122
- package/build/src/runtime/modules/BasicAuthCache.js.map +0 -1
- package/build/src/runtime/modules/ExecutionResponse.d.ts +0 -4
- package/build/src/runtime/modules/ExecutionResponse.js +0 -6
- package/build/src/runtime/modules/ExecutionResponse.js.map +0 -1
- package/build/src/runtime/modules/ModulesRegistry.d.ts +0 -93
- package/build/src/runtime/modules/ModulesRegistry.js +0 -69
- package/build/src/runtime/modules/ModulesRegistry.js.map +0 -1
- package/build/src/runtime/modules/RequestAuthorization.d.ts +0 -6
- package/build/src/runtime/modules/RequestAuthorization.js +0 -110
- package/build/src/runtime/modules/RequestAuthorization.js.map +0 -1
- package/build/src/runtime/modules/RequestCookies.d.ts +0 -17
- package/build/src/runtime/modules/RequestCookies.js +0 -134
- package/build/src/runtime/modules/RequestCookies.js.map +0 -1
- package/build/src/runtime/node/RequestFactory.js +0 -406
- package/build/src/runtime/node/RequestFactory.js.map +0 -1
- package/build/src/runtime/node/VariablesStore.d.ts +0 -9
- package/build/src/runtime/node/VariablesStore.js +0 -19
- package/build/src/runtime/node/VariablesStore.js.map +0 -1
- package/src/lib/cookies/Cookie.ts +0 -312
- package/src/lib/cookies/Cookies.ts +0 -326
- package/src/lib/cookies/Utils.ts +0 -168
- package/src/mocking/lib/Arc.ts +0 -34
- package/src/models/RequestActions.ts +0 -161
- package/src/models/actions/Action.ts +0 -213
- package/src/models/actions/ActionView.ts +0 -40
- package/src/models/actions/Condition.ts +0 -207
- package/src/models/actions/ConditionView.ts +0 -42
- package/src/models/actions/Enums.ts +0 -29
- package/src/models/actions/RunnableAction.ts +0 -144
- package/src/models/actions/runnable/DeleteCookieAction.ts +0 -113
- package/src/models/actions/runnable/Runnable.ts +0 -9
- package/src/models/actions/runnable/SetCookieAction.ts +0 -216
- package/src/models/actions/runnable/SetVariableAction.ts +0 -81
- package/src/models/arc/ArcHttpRequest.ts +0 -121
- package/src/models/arc/readme.md +0 -3
- package/src/runtime/actions/ActionRunner.ts +0 -83
- package/src/runtime/actions/RunnableCondition.ts +0 -56
- package/src/runtime/actions/runnable/ActionRunnable.ts +0 -19
- package/src/runtime/actions/runnable/DeleteCookieRunnable.ts +0 -39
- package/src/runtime/actions/runnable/SetCookieRunnable.ts +0 -92
- package/src/runtime/actions/runnable/SetVariableRunnable.ts +0 -53
- package/src/runtime/modules/BasicAuthCache.ts +0 -129
- package/src/runtime/modules/ExecutionResponse.ts +0 -4
- package/src/runtime/modules/ModulesRegistry.ts +0 -136
- package/src/runtime/modules/RequestAuthorization.ts +0 -106
- package/src/runtime/modules/RequestCookies.ts +0 -146
- package/src/runtime/node/RequestFactory.ts +0 -432
- package/src/runtime/node/VariablesStore.ts +0 -25
|
@@ -16,6 +16,9 @@ import v4 from '../lib/uuid.js';
|
|
|
16
16
|
import { ARCSavedRequest, ARCHistoryRequest } from './legacy/request/ArcRequest.js';
|
|
17
17
|
import { ArcLegacyProject, ARCProject } from './legacy/models/ArcLegacyProject.js';
|
|
18
18
|
import { PostmanDataTransformer } from './transformers/PostmanDataTransformer.js';
|
|
19
|
+
import { IAppProject } from './AppProject.js';
|
|
20
|
+
import { Certificate, HttpCertificate } from './ClientCertificate.js';
|
|
21
|
+
import { ICCAuthorization } from './Authorization.js';
|
|
19
22
|
|
|
20
23
|
export const Kind = 'Core#HttpProject';
|
|
21
24
|
|
|
@@ -27,7 +30,6 @@ export interface IItemOptions {
|
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
export interface IItemCreateOptions extends IItemOptions{
|
|
30
|
-
|
|
31
33
|
/**
|
|
32
34
|
* The position at which to add the item.
|
|
33
35
|
*/
|
|
@@ -250,6 +252,7 @@ export interface IHttpProjectDefinitions {
|
|
|
250
252
|
folders?: IProjectFolder[];
|
|
251
253
|
schemas?: IProjectSchema[];
|
|
252
254
|
environments?: IEnvironment[];
|
|
255
|
+
certificates?: HttpCertificate[];
|
|
253
256
|
}
|
|
254
257
|
|
|
255
258
|
interface HttpProjectDefinitions {
|
|
@@ -257,6 +260,7 @@ interface HttpProjectDefinitions {
|
|
|
257
260
|
folders: ProjectFolder[];
|
|
258
261
|
schemas: ProjectSchema[];
|
|
259
262
|
environments: Environment[];
|
|
263
|
+
certificates: Certificate[];
|
|
260
264
|
}
|
|
261
265
|
|
|
262
266
|
/**
|
|
@@ -282,7 +286,7 @@ export class HttpProject extends ProjectParent {
|
|
|
282
286
|
definitions: HttpProjectDefinitions = HttpProject.defaultDefinitions();
|
|
283
287
|
|
|
284
288
|
static defaultDefinitions(): HttpProjectDefinitions {
|
|
285
|
-
return { environments: [], folders: [], requests: [], schemas: [] };
|
|
289
|
+
return { environments: [], folders: [], requests: [], schemas: [], certificates: [] };
|
|
286
290
|
}
|
|
287
291
|
|
|
288
292
|
/**
|
|
@@ -348,6 +352,34 @@ export class HttpProject extends ProjectParent {
|
|
|
348
352
|
return HttpProject.fromName(name);
|
|
349
353
|
}
|
|
350
354
|
|
|
355
|
+
static fromAppProject(init: IAppProject): HttpProject {
|
|
356
|
+
const result = new HttpProject();
|
|
357
|
+
const { definitions = {}, items, info, key = v4() } = init;
|
|
358
|
+
result.key = key;
|
|
359
|
+
result.info = new Thing(info);
|
|
360
|
+
if (Array.isArray(items)) {
|
|
361
|
+
result.items = items.map(i => ProjectItem.fromAppProject(result, i));
|
|
362
|
+
}
|
|
363
|
+
if (Array.isArray(definitions.environments)) {
|
|
364
|
+
result.definitions.environments = definitions.environments.map(i => new Environment(i));
|
|
365
|
+
}
|
|
366
|
+
if (Array.isArray(definitions.requests)) {
|
|
367
|
+
result.definitions.requests = definitions.requests.map(i => {
|
|
368
|
+
const instance = new ProjectRequest(result, i);
|
|
369
|
+
instance.attachedCallback();
|
|
370
|
+
return instance;
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
if (Array.isArray(definitions.folders)) {
|
|
374
|
+
result.definitions.folders = definitions.folders.map(i => {
|
|
375
|
+
const instance = ProjectFolder.fromAppProject(result, i);
|
|
376
|
+
instance.attachedCallback();
|
|
377
|
+
return instance;
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
return result;
|
|
381
|
+
}
|
|
382
|
+
|
|
351
383
|
/**
|
|
352
384
|
* @param input The project definition used to restore the state.
|
|
353
385
|
* @param environments Optional list of environments to use with this project. It overrides environments stored in the project definition.
|
|
@@ -431,6 +463,9 @@ export class HttpProject extends ProjectParent {
|
|
|
431
463
|
if (Array.isArray(definitions.schemas)) {
|
|
432
464
|
this.definitions.schemas = definitions.schemas.map(i => new ProjectSchema(i));
|
|
433
465
|
}
|
|
466
|
+
if (Array.isArray(definitions.certificates)) {
|
|
467
|
+
this.definitions.certificates = definitions.certificates.map(i => new Certificate(i));
|
|
468
|
+
}
|
|
434
469
|
}
|
|
435
470
|
|
|
436
471
|
toJSON(): IHttpProject {
|
|
@@ -453,6 +488,9 @@ export class HttpProject extends ProjectParent {
|
|
|
453
488
|
if (Array.isArray(this.definitions.schemas) && this.definitions.schemas.length) {
|
|
454
489
|
result.definitions.schemas = this.definitions.schemas.map(i => i.toJSON());
|
|
455
490
|
}
|
|
491
|
+
if (Array.isArray(this.definitions.certificates) && this.definitions.certificates.length) {
|
|
492
|
+
result.definitions.certificates = this.definitions.certificates.map(i => i.toJSON());
|
|
493
|
+
}
|
|
456
494
|
if (Array.isArray(this.items) && this.items.length) {
|
|
457
495
|
result.items = this.items.map(i => i.toJSON());
|
|
458
496
|
}
|
|
@@ -1103,14 +1141,7 @@ export class HttpProject extends ProjectParent {
|
|
|
1103
1141
|
flatItems = flatItems.concat(folder.items);
|
|
1104
1142
|
}
|
|
1105
1143
|
});
|
|
1106
|
-
// const withEnvironments: (HttpProject | ProjectFolder)[] = [];
|
|
1107
|
-
// if (Array.isArray(src.environments) && src.environments.length) {
|
|
1108
|
-
// withEnvironments.push(src);
|
|
1109
|
-
// }
|
|
1110
1144
|
(definitions.folders || []).forEach((folder) => {
|
|
1111
|
-
// if (Array.isArray(folder.environments) && folder.environments.length) {
|
|
1112
|
-
// withEnvironments.push(folder);
|
|
1113
|
-
// }
|
|
1114
1145
|
const oldKey = folder.key;
|
|
1115
1146
|
const indexObject = flatItems.find(i => i.key === oldKey);
|
|
1116
1147
|
if (!indexObject) {
|
|
@@ -1133,6 +1164,9 @@ export class HttpProject extends ProjectParent {
|
|
|
1133
1164
|
(definitions.schemas || []).forEach((schema) => {
|
|
1134
1165
|
schema.key = v4();
|
|
1135
1166
|
});
|
|
1167
|
+
(definitions.certificates || []).forEach((cert) => {
|
|
1168
|
+
cert.key = v4();
|
|
1169
|
+
});
|
|
1136
1170
|
(definitions.environments || []).forEach((environment) => {
|
|
1137
1171
|
const oldKey = environment.key;
|
|
1138
1172
|
const indexObject = flatItems.find(i => i.key === oldKey);
|
|
@@ -1152,7 +1186,7 @@ export class HttpProject extends ProjectParent {
|
|
|
1152
1186
|
* @param opts The schema add options.
|
|
1153
1187
|
* @returns The inserted into the schemas schema.
|
|
1154
1188
|
*/
|
|
1155
|
-
addSchema(
|
|
1189
|
+
addSchema(name: string, opts?: ISchemaAddOptions): ProjectSchema;
|
|
1156
1190
|
|
|
1157
1191
|
/**
|
|
1158
1192
|
* Adds a schema to the project.
|
|
@@ -1524,4 +1558,73 @@ export class HttpProject extends ProjectParent {
|
|
|
1524
1558
|
findEnvironment(key: string): Environment | undefined {
|
|
1525
1559
|
return this.definitions.environments.find(i => i.key === key);
|
|
1526
1560
|
}
|
|
1561
|
+
|
|
1562
|
+
/**
|
|
1563
|
+
* Finds a definition for a certificate.
|
|
1564
|
+
*
|
|
1565
|
+
* @param key The key of the certificate to find.
|
|
1566
|
+
* @returns The certificate definition or undefined if not found.
|
|
1567
|
+
*/
|
|
1568
|
+
findCertificate(key: string): Certificate | undefined {
|
|
1569
|
+
return this.definitions.certificates.find(i => i.key === key);
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
/**
|
|
1573
|
+
* Adds a certificate to the project.
|
|
1574
|
+
*
|
|
1575
|
+
* @param init Either an instance of a certificate or its definition.
|
|
1576
|
+
* @returns The inserted certificate.
|
|
1577
|
+
*/
|
|
1578
|
+
addCertificate(init: Certificate | HttpCertificate): Certificate {
|
|
1579
|
+
let finalCert: Certificate;
|
|
1580
|
+
if (init instanceof Certificate) {
|
|
1581
|
+
finalCert = init;
|
|
1582
|
+
} else {
|
|
1583
|
+
finalCert = new Certificate(init);
|
|
1584
|
+
}
|
|
1585
|
+
if (!this.definitions.certificates) {
|
|
1586
|
+
this.definitions.certificates = [];
|
|
1587
|
+
}
|
|
1588
|
+
this.definitions.certificates.push(finalCert);
|
|
1589
|
+
return finalCert;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
/**
|
|
1593
|
+
* Removes a certificate from the project.
|
|
1594
|
+
*
|
|
1595
|
+
* @param key the key of the certificate to remove
|
|
1596
|
+
* @returns The removed certificate, if any.
|
|
1597
|
+
*/
|
|
1598
|
+
removeCertificate(key: string): Certificate | undefined {
|
|
1599
|
+
if (!Array.isArray(this.definitions.certificates)) {
|
|
1600
|
+
return undefined
|
|
1601
|
+
}
|
|
1602
|
+
const defIndex = this.definitions.certificates.findIndex(i => i.key === key);
|
|
1603
|
+
if (defIndex < 0) {
|
|
1604
|
+
return undefined;
|
|
1605
|
+
}
|
|
1606
|
+
const cert = this.definitions.certificates[defIndex];
|
|
1607
|
+
this.definitions.certificates.splice(defIndex, 1);
|
|
1608
|
+
return cert;
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
/**
|
|
1612
|
+
* Finds the requests that are using the certificate identified by the key.
|
|
1613
|
+
*
|
|
1614
|
+
* @param key The key of the certificate to find the usage for.
|
|
1615
|
+
* @returns The list of requests that use this certificate.
|
|
1616
|
+
*/
|
|
1617
|
+
findCertificateRequests(key: string): ProjectRequest[] {
|
|
1618
|
+
return this.definitions.requests.filter((request) => {
|
|
1619
|
+
if (!Array.isArray(request.authorization)) {
|
|
1620
|
+
return false;
|
|
1621
|
+
}
|
|
1622
|
+
const ccAuth = request.authorization.find(auth => auth.type === 'client certificate');
|
|
1623
|
+
if (!ccAuth) {
|
|
1624
|
+
return false;
|
|
1625
|
+
}
|
|
1626
|
+
const cnf = ccAuth.config as ICCAuthorization;
|
|
1627
|
+
return !!cnf && !!cnf.certificate && cnf.certificate.key === key;
|
|
1628
|
+
});
|
|
1629
|
+
}
|
|
1527
1630
|
}
|
|
@@ -6,6 +6,7 @@ import { HttpProject, IEnvironmentCreateOptions } from './HttpProject.js';
|
|
|
6
6
|
import { IThing, Thing, Kind as ThingKind } from './Thing.js';
|
|
7
7
|
import { Environment, IEnvironment } from './Environment.js';
|
|
8
8
|
import v4 from '../lib/uuid.js';
|
|
9
|
+
import { IAppProjectParent } from './AppProject.js';
|
|
9
10
|
|
|
10
11
|
export const Kind = 'Core#ProjectFolder';
|
|
11
12
|
export const DefaultFolderName = 'New folder';
|
|
@@ -94,6 +95,21 @@ export class ProjectFolder extends ProjectParent {
|
|
|
94
95
|
*/
|
|
95
96
|
created = 0;
|
|
96
97
|
|
|
98
|
+
static fromAppProject(project: HttpProject, init: IAppProjectParent): ProjectFolder {
|
|
99
|
+
const result = new ProjectFolder(project);
|
|
100
|
+
const { key = v4(), created = Date.now(), updated = Date.now(), items, info } = init;
|
|
101
|
+
result.key = key;
|
|
102
|
+
result.created = created;
|
|
103
|
+
result.updated = updated;
|
|
104
|
+
if (info) {
|
|
105
|
+
result.info = new Thing(info);
|
|
106
|
+
}
|
|
107
|
+
if (Array.isArray(items)) {
|
|
108
|
+
result.items = items.map(i => ProjectItem.fromAppProject(project, i));
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
|
|
97
113
|
constructor(project: HttpProject, input?: string | IProjectFolder) {
|
|
98
114
|
super();
|
|
99
115
|
this.project = project;
|
|
@@ -2,6 +2,7 @@ import { Kind as ProjectFolderKind, ProjectFolder } from './ProjectFolder.js';
|
|
|
2
2
|
import { Kind as ProjectRequestKind, ProjectRequest } from './ProjectRequest.js';
|
|
3
3
|
import { Kind as EnvironmentKind, Environment } from './Environment.js';
|
|
4
4
|
import { HttpProject } from './HttpProject.js';
|
|
5
|
+
import { AppProjectFolderKind, AppProjectRequestKind, IAppProjectItem } from './AppProject.js';
|
|
5
6
|
|
|
6
7
|
type Kind = typeof ProjectFolderKind | typeof ProjectRequestKind | typeof EnvironmentKind;
|
|
7
8
|
|
|
@@ -74,6 +75,23 @@ export class ProjectItem {
|
|
|
74
75
|
return item;
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
static fromAppProject(project: HttpProject, item: IAppProjectItem): ProjectItem {
|
|
79
|
+
let kind: Kind;
|
|
80
|
+
if (item.kind === AppProjectFolderKind) {
|
|
81
|
+
kind = ProjectFolderKind
|
|
82
|
+
} else if (item.kind === AppProjectRequestKind) {
|
|
83
|
+
kind = ProjectRequestKind
|
|
84
|
+
} else if (item.kind === EnvironmentKind) {
|
|
85
|
+
kind = EnvironmentKind
|
|
86
|
+
} else {
|
|
87
|
+
throw new Error(`Invalid item kind: ${item.kind}`);
|
|
88
|
+
}
|
|
89
|
+
return new ProjectItem(project, {
|
|
90
|
+
kind,
|
|
91
|
+
key: item.key,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
77
95
|
/**
|
|
78
96
|
* @param project The top-most project.
|
|
79
97
|
* @param input The project item definition used to restore the state.
|
|
@@ -10,12 +10,15 @@ import { ProjectDefinitionProperty } from "./ProjectDefinitionProperty.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export abstract class ProjectParent implements ProjectDefinitionProperty {
|
|
12
12
|
kind: unknown;
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
key = '';
|
|
15
|
+
|
|
14
16
|
/**
|
|
15
17
|
* The ordered list of HTTP requests, folders, or environments in the projects.
|
|
16
18
|
* The UI uses this to manipulate the view without changing the definitions.
|
|
17
19
|
*/
|
|
18
20
|
items: ProjectItem[] = [];
|
|
21
|
+
|
|
19
22
|
/**
|
|
20
23
|
* The basic information about the project / folder.
|
|
21
24
|
*/
|
|
@@ -5,6 +5,7 @@ import { IHttpRequest, Kind as HttpRequestKind } from './HttpRequest.js';
|
|
|
5
5
|
import { HttpProject } from './HttpProject.js';
|
|
6
6
|
import v4 from '../lib/uuid.js';
|
|
7
7
|
import { IRequest, Request } from './Request.js';
|
|
8
|
+
import { IAppProjectRequest } from './AppProject.js';
|
|
8
9
|
|
|
9
10
|
export const Kind = 'Core#ProjectRequest';
|
|
10
11
|
|
|
@@ -160,10 +161,10 @@ export class ProjectRequest extends Request implements ProjectDefinitionProperty
|
|
|
160
161
|
return result;
|
|
161
162
|
}
|
|
162
163
|
|
|
163
|
-
constructor(project: HttpProject, input?: string|IProjectRequest) {
|
|
164
|
+
constructor(project: HttpProject, input?: string|IProjectRequest | IAppProjectRequest) {
|
|
164
165
|
super(input);
|
|
165
166
|
this.project = project;
|
|
166
|
-
let init: IProjectRequest;
|
|
167
|
+
let init: IProjectRequest | IAppProjectRequest;
|
|
167
168
|
if (typeof input === 'string') {
|
|
168
169
|
init = JSON.parse(input);
|
|
169
170
|
} else if (typeof input === 'object') {
|
|
@@ -189,7 +190,7 @@ export class ProjectRequest extends Request implements ProjectDefinitionProperty
|
|
|
189
190
|
this.new(init);
|
|
190
191
|
}
|
|
191
192
|
|
|
192
|
-
new(init: IProjectRequest): void {
|
|
193
|
+
new(init: IProjectRequest | IAppProjectRequest): void {
|
|
193
194
|
super.new(init);
|
|
194
195
|
|
|
195
196
|
const { key } = init;
|
package/src/models/Property.ts
CHANGED
|
@@ -27,7 +27,7 @@ export interface IProperty {
|
|
|
27
27
|
/**
|
|
28
28
|
* Enum values for the property.
|
|
29
29
|
*/
|
|
30
|
-
enum?: unknown;
|
|
30
|
+
enum?: unknown[];
|
|
31
31
|
/**
|
|
32
32
|
* The description of the property
|
|
33
33
|
*/
|
|
@@ -76,7 +76,7 @@ export class Property {
|
|
|
76
76
|
/**
|
|
77
77
|
* Enum values for the property.
|
|
78
78
|
*/
|
|
79
|
-
enum?: unknown;
|
|
79
|
+
enum?: unknown[];
|
|
80
80
|
/**
|
|
81
81
|
* Whether the value id required to be provided. This is used with validation.
|
|
82
82
|
*/
|
|
@@ -406,8 +406,8 @@ export class Property {
|
|
|
406
406
|
if (typeof this.default !== 'undefined') {
|
|
407
407
|
result.default = this.default;
|
|
408
408
|
}
|
|
409
|
-
if (this.enum) {
|
|
410
|
-
result.enum = this.enum;
|
|
409
|
+
if (Array.isArray(this.enum) && this.enum.length) {
|
|
410
|
+
result.enum = [...this.enum];
|
|
411
411
|
}
|
|
412
412
|
if (typeof this.enabled === 'boolean') {
|
|
413
413
|
result.enabled = this.enabled;
|
package/src/models/Request.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Core as JsonCore } from '@api-client/json'
|
|
1
2
|
import { IRequestConfig, RequestConfig } from './RequestConfig.js';
|
|
2
3
|
import { Thing, IThing, Kind as ThingKind } from './Thing.js';
|
|
3
|
-
import { IRequestActions, RequestActions } from './RequestActions.js';
|
|
4
4
|
import { HttpCertificate, Certificate } from './ClientCertificate.js';
|
|
5
5
|
import { IRequestAuthorization, RequestAuthorization } from './RequestAuthorization.js';
|
|
6
6
|
import { IRequestLog, RequestLog, Kind as LogKind } from './RequestLog.js';
|
|
@@ -13,6 +13,8 @@ import { ARCSavedRequest, ARCHistoryRequest } from './legacy/request/ArcRequest.
|
|
|
13
13
|
import { ErrorResponse as LegacyErrorResponse, Response as LegacyResponse } from './legacy/request/ArcResponse.js';
|
|
14
14
|
import { PayloadSerializer } from '../lib/transformers/PayloadSerializer.js';
|
|
15
15
|
import { Normalizer } from './legacy/Normalizer.js';
|
|
16
|
+
import { IHttpActionFlow } from './http-actions/HttpActions.js';
|
|
17
|
+
import { LegacyTranslator } from './http-actions/LegacyTranslator.js';
|
|
16
18
|
|
|
17
19
|
export const Kind = 'Core#Request';
|
|
18
20
|
export const createdSymbol = Symbol('created');
|
|
@@ -26,7 +28,7 @@ export const midnightSymbol = Symbol('midnight');
|
|
|
26
28
|
export interface IRequest {
|
|
27
29
|
kind: string;
|
|
28
30
|
/**
|
|
29
|
-
* The basic information about the
|
|
31
|
+
* The basic information about the request.
|
|
30
32
|
*/
|
|
31
33
|
info: IThing;
|
|
32
34
|
/**
|
|
@@ -58,19 +60,23 @@ export interface IRequest {
|
|
|
58
60
|
*/
|
|
59
61
|
authorization?: IRequestAuthorization[];
|
|
60
62
|
/**
|
|
61
|
-
*
|
|
63
|
+
* Http action flows.
|
|
64
|
+
* In ARC this was "actions",
|
|
62
65
|
*/
|
|
63
|
-
|
|
66
|
+
flows?: IHttpActionFlow[];
|
|
64
67
|
/**
|
|
65
|
-
* The
|
|
68
|
+
* The certificate to use with the request.
|
|
69
|
+
* Note, the certificate defined on the certificate authorization
|
|
70
|
+
* should not be included here by default. The HTTP transport should recognize
|
|
71
|
+
* this certificate and update the configuration.
|
|
66
72
|
*/
|
|
67
73
|
clientCertificate?: HttpCertificate;
|
|
68
74
|
}
|
|
69
75
|
|
|
70
76
|
export class Request {
|
|
71
|
-
[createdSymbol]
|
|
72
|
-
[updatedSymbol]
|
|
73
|
-
[midnightSymbol]
|
|
77
|
+
[createdSymbol] = 0;
|
|
78
|
+
[updatedSymbol] = 0;
|
|
79
|
+
[midnightSymbol] = 0;
|
|
74
80
|
kind = Kind;
|
|
75
81
|
/**
|
|
76
82
|
* The basic information about the project.
|
|
@@ -93,11 +99,15 @@ export class Request {
|
|
|
93
99
|
*/
|
|
94
100
|
authorization?: RequestAuthorization[];
|
|
95
101
|
/**
|
|
96
|
-
*
|
|
102
|
+
* Http action flows.
|
|
103
|
+
* In ARC this was "actions",
|
|
97
104
|
*/
|
|
98
|
-
|
|
105
|
+
flows?: IHttpActionFlow[];
|
|
99
106
|
/**
|
|
100
|
-
* The
|
|
107
|
+
* The certificate to use with the request.
|
|
108
|
+
* Note, the certificate defined on the certificate authorization
|
|
109
|
+
* should not be included here by default. The HTTP transport should recognize
|
|
110
|
+
* this certificate and update the configuration.
|
|
101
111
|
*/
|
|
102
112
|
clientCertificate?: Certificate;
|
|
103
113
|
|
|
@@ -196,7 +206,7 @@ export class Request {
|
|
|
196
206
|
init.created = normalized.created;
|
|
197
207
|
init.updated = normalized.updated;
|
|
198
208
|
if (normalized.actions) {
|
|
199
|
-
init.
|
|
209
|
+
init.flows = LegacyTranslator.translate(normalized.actions);
|
|
200
210
|
}
|
|
201
211
|
if (Array.isArray(normalized.authorization) && normalized.authorization.length) {
|
|
202
212
|
init.authorization = normalized.authorization.map((i) => RequestAuthorization.fromLegacy(i).toJSON());
|
|
@@ -329,7 +339,7 @@ export class Request {
|
|
|
329
339
|
}
|
|
330
340
|
|
|
331
341
|
new(init: IRequest): void {
|
|
332
|
-
const { expects, log, updated, created = Date.now(), midnight, config, authorization,
|
|
342
|
+
const { expects, log, updated, created = Date.now(), midnight, config, authorization, flows, clientCertificate, info } = init;
|
|
333
343
|
if (expects) {
|
|
334
344
|
this.expects = new HttpRequest(expects);
|
|
335
345
|
} else {
|
|
@@ -341,7 +351,7 @@ export class Request {
|
|
|
341
351
|
}
|
|
342
352
|
this.info = new Thing(info);
|
|
343
353
|
} else {
|
|
344
|
-
this.info =
|
|
354
|
+
this.info = Thing.fromName('')
|
|
345
355
|
}
|
|
346
356
|
if (log) {
|
|
347
357
|
this.log = new RequestLog(log);
|
|
@@ -367,10 +377,10 @@ export class Request {
|
|
|
367
377
|
if (midnight) {
|
|
368
378
|
this.midnight = midnight;
|
|
369
379
|
}
|
|
370
|
-
if (
|
|
371
|
-
this.
|
|
380
|
+
if (Array.isArray(flows)) {
|
|
381
|
+
this.flows = flows.map(i => JsonCore.clone(i));
|
|
372
382
|
} else {
|
|
373
|
-
this.
|
|
383
|
+
this.flows = undefined;
|
|
374
384
|
}
|
|
375
385
|
if (clientCertificate) {
|
|
376
386
|
this.clientCertificate = new Certificate(clientCertificate);
|
|
@@ -397,8 +407,8 @@ export class Request {
|
|
|
397
407
|
if (Array.isArray(this.authorization)) {
|
|
398
408
|
result.authorization = this.authorization.map(i => i.toJSON());
|
|
399
409
|
}
|
|
400
|
-
if (this.
|
|
401
|
-
result.
|
|
410
|
+
if (Array.isArray(this.flows)) {
|
|
411
|
+
result.flows = this.flows.map(i => JsonCore.clone(i))
|
|
402
412
|
}
|
|
403
413
|
if (this.clientCertificate) {
|
|
404
414
|
result.clientCertificate = this.clientCertificate.toJSON();
|
|
@@ -47,7 +47,7 @@ export class RequestAuthorization {
|
|
|
47
47
|
*/
|
|
48
48
|
valid?: boolean;
|
|
49
49
|
|
|
50
|
-
static fromTypedConfig(type: AuthorizationType, config: IAuthorizationSettingsUnion, valid=true): RequestAuthorization {
|
|
50
|
+
static fromTypedConfig(type: AuthorizationType, config: IAuthorizationSettingsUnion, valid = true): RequestAuthorization {
|
|
51
51
|
return new RequestAuthorization({
|
|
52
52
|
kind: Kind,
|
|
53
53
|
config,
|
|
@@ -74,7 +74,7 @@ export class RequestAuthorization {
|
|
|
74
74
|
/**
|
|
75
75
|
* @param input The provider definition used to restore the state.
|
|
76
76
|
*/
|
|
77
|
-
constructor(input?: string|IRequestAuthorization) {
|
|
77
|
+
constructor(input?: string | IRequestAuthorization) {
|
|
78
78
|
let init: IRequestAuthorization;
|
|
79
79
|
if (typeof input === 'string') {
|
|
80
80
|
init = JSON.parse(input);
|
|
@@ -105,8 +105,8 @@ export class RequestAuthorization {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
toJSON(): IRequestAuthorization {
|
|
108
|
-
const { config={} } = this;
|
|
109
|
-
const result:IRequestAuthorization = {
|
|
108
|
+
const { config = {} } = this;
|
|
109
|
+
const result: IRequestAuthorization = {
|
|
110
110
|
kind: Kind,
|
|
111
111
|
config: { ...config },
|
|
112
112
|
enabled: this.enabled || false,
|
|
@@ -39,13 +39,6 @@ export interface IAuthMeta {
|
|
|
39
39
|
selected?: number;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export interface IActionsMeta {
|
|
43
|
-
/**
|
|
44
|
-
* The index of the selected API Client actions view.
|
|
45
|
-
*/
|
|
46
|
-
selected?: number;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
42
|
export interface IResponseUiMeta {
|
|
50
43
|
/**
|
|
51
44
|
* The list of activated panels in the response view.
|
|
@@ -123,10 +116,6 @@ export interface IRequestUiMeta {
|
|
|
123
116
|
* Authorization editor meta.
|
|
124
117
|
*/
|
|
125
118
|
authorization?: IAuthMeta;
|
|
126
|
-
/**
|
|
127
|
-
* API Client request actions editor UI config.
|
|
128
|
-
*/
|
|
129
|
-
actions?: IActionsMeta;
|
|
130
119
|
/**
|
|
131
120
|
* The currently selected editor in the request editor UI.
|
|
132
121
|
*/
|
|
@@ -155,10 +144,6 @@ export class RequestUiMeta {
|
|
|
155
144
|
* Authorization editor meta.
|
|
156
145
|
*/
|
|
157
146
|
authorization?: IAuthMeta;
|
|
158
|
-
/**
|
|
159
|
-
* API Client request actions editor UI config.
|
|
160
|
-
*/
|
|
161
|
-
actions?: IActionsMeta;
|
|
162
147
|
/**
|
|
163
148
|
* The currently selected editor in the request editor UI.
|
|
164
149
|
*/
|
|
@@ -169,9 +154,8 @@ export class RequestUiMeta {
|
|
|
169
154
|
response?: IResponseUiMeta;
|
|
170
155
|
|
|
171
156
|
static fromLegacy(old: LegacyRequestUiMeta): RequestUiMeta {
|
|
172
|
-
const {
|
|
157
|
+
const { authorization, body, headers, response, selectedEditor, url } = old;
|
|
173
158
|
const init: IRequestUiMeta = {
|
|
174
|
-
actions,
|
|
175
159
|
authorization,
|
|
176
160
|
body,
|
|
177
161
|
response,
|
|
@@ -223,7 +207,6 @@ export class RequestUiMeta {
|
|
|
223
207
|
this.url = init.url;
|
|
224
208
|
this.headers = init.headers;
|
|
225
209
|
this.authorization = init.authorization;
|
|
226
|
-
this.actions = init.actions;
|
|
227
210
|
this.selectedEditor = init.selectedEditor;
|
|
228
211
|
this.response = init.response;
|
|
229
212
|
}
|
|
@@ -244,9 +227,6 @@ export class RequestUiMeta {
|
|
|
244
227
|
if (this.authorization) {
|
|
245
228
|
result.authorization = this.authorization;
|
|
246
229
|
}
|
|
247
|
-
if (this.actions) {
|
|
248
|
-
result.actions = this.actions;
|
|
249
|
-
}
|
|
250
230
|
if (this.response) {
|
|
251
231
|
result.response = this.response;
|
|
252
232
|
}
|
package/src/models/Server.ts
CHANGED
|
@@ -15,8 +15,7 @@ export interface IServer {
|
|
|
15
15
|
*/
|
|
16
16
|
uri: string;
|
|
17
17
|
/**
|
|
18
|
-
* Usually included in the `uri`. When the `uri` is missing a protocol
|
|
19
|
-
* this is then used.
|
|
18
|
+
* Usually included in the `uri`. When the `uri` is missing a protocol this is then used.
|
|
20
19
|
*/
|
|
21
20
|
protocol?: string;
|
|
22
21
|
/**
|