@api-client/core 0.3.11 → 0.4.1
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 +7 -1
- package/build/src/mocking/ProjectMock.js +6 -0
- package/build/src/mocking/ProjectMock.js.map +1 -1
- package/build/src/mocking/lib/History.d.ts +70 -0
- package/build/src/mocking/lib/History.js +120 -0
- package/build/src/mocking/lib/History.js.map +1 -0
- 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.d.ts +20 -0
- package/build/src/mocking/lib/User.js +54 -0
- package/build/src/mocking/lib/User.js.map +1 -0
- package/build/src/models/AuthorizationData.d.ts +2 -2
- package/build/src/models/AuthorizationData.js +2 -2
- package/build/src/models/Backend.d.ts +85 -0
- 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 +64 -18
- package/build/src/models/HttpHistory.js +43 -19
- package/build/src/models/HttpHistory.js.map +1 -1
- package/build/src/models/HttpProject.d.ts +4 -5
- package/build/src/models/HttpProject.js +3 -3
- 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 +9 -1
- package/src/mocking/lib/History.ts +179 -0
- package/src/mocking/lib/Request.ts +5 -5
- package/src/mocking/lib/Response.ts +10 -10
- package/src/mocking/lib/User.ts +68 -0
- package/src/models/AuthorizationData.ts +2 -2
- package/src/models/Backend.ts +93 -0
- 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 +89 -27
- package/src/models/HttpProject.ts +5 -6
- 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
package/readme.md
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
The core library of the API Client application. This build on top of the experience of Advanced REST Client.
|
|
4
4
|
|
|
5
|
-
Contains the core models, events, and logic related to
|
|
5
|
+
Contains the core models, events, and logic related to API Client.
|
|
6
6
|
|
|
7
7
|
## Purpose
|
|
8
8
|
|
|
9
|
-
The core library provides the libraries that
|
|
9
|
+
The core library provides the libraries that API Client and related projects are re-using under the hood.
|
|
10
10
|
|
|
11
11
|
The library is structured as follows:
|
|
12
12
|
|
|
13
|
-
- models - the data model libraries providing the data schema definition for
|
|
13
|
+
- models - the data model libraries providing the data schema definition for API Client and related projects and the common logic to manipulate the data
|
|
14
14
|
- runtime - the executable part of the library; contains classes that executes an HTTP request, runs a series of requests defined in a project, etc
|
|
15
|
-
- utilities - helper libraries that can be shared across the
|
|
15
|
+
- utilities - helper libraries that can be shared across the API Client ecosystem
|
|
16
16
|
|
|
17
17
|
## What it isn't
|
|
18
18
|
|
|
@@ -36,7 +36,7 @@ These libraries can be used, among others, to:
|
|
|
36
36
|
|
|
37
37
|
## Community driven
|
|
38
38
|
|
|
39
|
-
The entire
|
|
39
|
+
The entire API Client project is community driven. We build tools for API developers to make them successful without investing into very expensive enterprise solutions. We are happy to hear from you. If your ideas can benefit the community we will implement them. That's on us. But you are welcome to clone the project, build your idea, and send us a PR. We will accept it if it won't influence the stability of the project and it's safe to marge with the main branch.
|
|
40
40
|
|
|
41
41
|
## Documentation
|
|
42
42
|
|
|
@@ -5,7 +5,7 @@ import { DataReader } from './DataReader.js';
|
|
|
5
5
|
* Reads the value from a JSON document using the the JmesPath notation.
|
|
6
6
|
* See https://jmespath.org/
|
|
7
7
|
*
|
|
8
|
-
* Note, after consideration this implementation is not used with
|
|
8
|
+
* Note, after consideration this implementation is not used with API Client projects to extract
|
|
9
9
|
* request data. Instead, we use `JsonReader` that converts the JSON to XML so the same
|
|
10
10
|
* XPath can be used for both JSON and XML.
|
|
11
11
|
*/
|
|
@@ -198,7 +198,7 @@ class ProjectEnvironmentEvents {
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
|
-
*
|
|
201
|
+
* API Client's HTTP project events.
|
|
202
202
|
*
|
|
203
203
|
* Note, `id`s refers to datastore ids but `key`s are internal identifiers inside the project.
|
|
204
204
|
* Whenever id is used it refers to the store's ids. When `key` is used it is the id of the project or any of its components.
|
|
@@ -328,4 +328,4 @@ export class ProjectEvents {
|
|
|
328
328
|
static get Environment(): typeof ProjectEnvironmentEvents {
|
|
329
329
|
return ProjectEnvironmentEvents;
|
|
330
330
|
}
|
|
331
|
-
}
|
|
331
|
+
}
|
package/src/events/readme.md
CHANGED
|
@@ -188,7 +188,7 @@ export class PayloadSerializer {
|
|
|
188
188
|
enabled: true,
|
|
189
189
|
};
|
|
190
190
|
if (file.name === 'blob') {
|
|
191
|
-
//
|
|
191
|
+
// API Client adds the "blob" filename when the content type is set on the editor.
|
|
192
192
|
// otherwise it wouldn't be possible to set the content type value.
|
|
193
193
|
part.type = file.type;
|
|
194
194
|
} else {
|
|
@@ -297,9 +297,9 @@ export class PayloadSerializer {
|
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
/**
|
|
300
|
-
* Deserializes FormData from
|
|
300
|
+
* Deserializes FormData from API Client data model.
|
|
301
301
|
*
|
|
302
|
-
* @param
|
|
302
|
+
* @param parts API Client model for multipart.
|
|
303
303
|
* @return {FormData} Restored form data
|
|
304
304
|
*/
|
|
305
305
|
static deserializeFormData(parts: IMultipartBody[]): FormData {
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { DataMock, DataMockInit } from '@pawel-up/data-mock';
|
|
2
2
|
import { Request } from './lib/Request.js';
|
|
3
3
|
import { Response } from './lib/Response.js';
|
|
4
|
+
import { User } from './lib/User.js';
|
|
5
|
+
import { History } from './lib/History.js';
|
|
4
6
|
|
|
5
7
|
export { IRequestLogInit } from './lib/Request.js';
|
|
6
|
-
export {
|
|
8
|
+
export { IResponseInit } from './lib/Response.js';
|
|
9
|
+
export { ISpaceUserInit, IUserInit } from './lib/User.js';
|
|
10
|
+
export { IHttpHistoryInit, IHttpHistoryListInit } from './lib/History.js';
|
|
7
11
|
|
|
8
12
|
export class ProjectMock extends DataMock {
|
|
9
13
|
projectRequest: Request;
|
|
10
14
|
response: Response;
|
|
15
|
+
user: User;
|
|
16
|
+
history: History;
|
|
11
17
|
|
|
12
18
|
/**
|
|
13
19
|
* @param init The library init options.
|
|
@@ -16,5 +22,7 @@ export class ProjectMock extends DataMock {
|
|
|
16
22
|
super(init);
|
|
17
23
|
this.projectRequest = new Request(init);
|
|
18
24
|
this.response = new Response(init);
|
|
25
|
+
this.user = new User(init);
|
|
26
|
+
this.history = new History(init);
|
|
19
27
|
}
|
|
20
28
|
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { Internet, Types, DataMockInit, Person, Random, TypeDateTimeInit } from '@pawel-up/data-mock';
|
|
2
|
+
// import { randomValue } from '@pawel-up/data-mock/src/lib/Http.js';
|
|
3
|
+
import { IHttpHistory, Kind as HttpHistoryKind } from '../../models/HttpHistory.js';
|
|
4
|
+
import { Request, IRequestLogInit } from './Request.js';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export interface IHttpHistoryInit {
|
|
8
|
+
/**
|
|
9
|
+
* Either space id, list of spaces to pick one or whether to generate a space.
|
|
10
|
+
*/
|
|
11
|
+
space?: boolean | string | string[];
|
|
12
|
+
/**
|
|
13
|
+
* User is always generated per store requirements.
|
|
14
|
+
*/
|
|
15
|
+
user?: string | string[];
|
|
16
|
+
/**
|
|
17
|
+
* Either project id, list of projects to pick one or whether to generate a project.
|
|
18
|
+
*/
|
|
19
|
+
project?: boolean | string | string[];
|
|
20
|
+
/**
|
|
21
|
+
* Either request id, list of requests to pick one or whether to generate a request.
|
|
22
|
+
*/
|
|
23
|
+
request?: boolean | string | string[];
|
|
24
|
+
/**
|
|
25
|
+
* Either app id, list of apps to pick one or whether to generate an app.
|
|
26
|
+
*/
|
|
27
|
+
app?: boolean | string | string[];
|
|
28
|
+
/**
|
|
29
|
+
* The log init options
|
|
30
|
+
*/
|
|
31
|
+
log?: IRequestLogInit;
|
|
32
|
+
/**
|
|
33
|
+
* The created time init options.
|
|
34
|
+
*/
|
|
35
|
+
created?: TypeDateTimeInit;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface IHttpHistoryListInit extends IHttpHistoryInit {
|
|
39
|
+
/**
|
|
40
|
+
* When set it generates as many user IDs.
|
|
41
|
+
* Ignored when the `user` is set.
|
|
42
|
+
*/
|
|
43
|
+
usersSize?: number;
|
|
44
|
+
/**
|
|
45
|
+
* When set it generates as many space ids.
|
|
46
|
+
* Ignored when the `space` is set.
|
|
47
|
+
*/
|
|
48
|
+
spacesSize?: number;
|
|
49
|
+
/**
|
|
50
|
+
* When set it generates as many project ids.
|
|
51
|
+
* Ignored when the `project` is set.
|
|
52
|
+
*/
|
|
53
|
+
projectsSize?: number;
|
|
54
|
+
/**
|
|
55
|
+
* When set it generates as many request ids.
|
|
56
|
+
* Ignored when the `request` is set.
|
|
57
|
+
*/
|
|
58
|
+
requestsSize?: number;
|
|
59
|
+
/**
|
|
60
|
+
* When set it generates as many app ids.
|
|
61
|
+
* Ignored when the `app` is set.
|
|
62
|
+
*/
|
|
63
|
+
appsSize?: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export class History {
|
|
67
|
+
person: Person;
|
|
68
|
+
types: Types;
|
|
69
|
+
internet: Internet;
|
|
70
|
+
random: Random;
|
|
71
|
+
request: Request;
|
|
72
|
+
|
|
73
|
+
constructor(init: DataMockInit={}) {
|
|
74
|
+
this.person = new Person(init);
|
|
75
|
+
this.types = new Types(init.seed);
|
|
76
|
+
this.internet = new Internet(init);
|
|
77
|
+
this.random = new Random(init.seed);
|
|
78
|
+
this.request = new Request(init);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
httpHistory(init: IHttpHistoryInit = {}): IHttpHistory {
|
|
82
|
+
const date = this.types.datetime(init.created);
|
|
83
|
+
const result: IHttpHistory = {
|
|
84
|
+
kind: HttpHistoryKind,
|
|
85
|
+
created: date.getTime(),
|
|
86
|
+
log: this.request.log(init.log),
|
|
87
|
+
user: '',
|
|
88
|
+
}
|
|
89
|
+
date.setHours(0, 0, 0, 0);
|
|
90
|
+
result.midnight = date.getTime();
|
|
91
|
+
|
|
92
|
+
if (typeof init.space === 'string') {
|
|
93
|
+
result.space = init.space;
|
|
94
|
+
} else if (Array.isArray(init.space)) {
|
|
95
|
+
result.space = this.random.pickOne(init.space);
|
|
96
|
+
} else if (init.space) {
|
|
97
|
+
result.space = this.types.string(10);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (typeof init.user === 'string') {
|
|
101
|
+
result.user = init.user;
|
|
102
|
+
} else if (Array.isArray(init.user)) {
|
|
103
|
+
result.user = this.random.pickOne(init.user);
|
|
104
|
+
} else {
|
|
105
|
+
result.user = this.types.uuid();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (typeof init.project === 'string') {
|
|
109
|
+
result.project = init.project;
|
|
110
|
+
} else if (Array.isArray(init.project)) {
|
|
111
|
+
result.project = this.random.pickOne(init.project);
|
|
112
|
+
} else if (init.project) {
|
|
113
|
+
result.project = this.types.uuid();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (typeof init.request === 'string') {
|
|
117
|
+
result.request = init.request;
|
|
118
|
+
} else if (Array.isArray(init.request)) {
|
|
119
|
+
result.request = this.random.pickOne(init.request);
|
|
120
|
+
} else if (init.request) {
|
|
121
|
+
result.request = this.types.uuid();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (typeof init.app === 'string') {
|
|
125
|
+
result.app = init.app;
|
|
126
|
+
} else if (Array.isArray(init.app)) {
|
|
127
|
+
result.app = this.random.pickOne(init.app);
|
|
128
|
+
} else if (init.app) {
|
|
129
|
+
result.app = this.types.uuid();
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
httpHistoryList(size=25, init: IHttpHistoryListInit = {}): IHttpHistory[] {
|
|
135
|
+
const { usersSize, spacesSize, projectsSize, requestsSize, appsSize } = init;
|
|
136
|
+
const copy = { ...init };
|
|
137
|
+
if (usersSize && typeof init.user === 'undefined') {
|
|
138
|
+
const users: string[] = [];
|
|
139
|
+
for (let i = 0; i < usersSize; i++) {
|
|
140
|
+
users.push(this.types.uuid());
|
|
141
|
+
}
|
|
142
|
+
copy.user = users;
|
|
143
|
+
}
|
|
144
|
+
if (spacesSize && typeof init.space === 'undefined') {
|
|
145
|
+
const space: string[] = [];
|
|
146
|
+
for (let i = 0; i < spacesSize; i++) {
|
|
147
|
+
space.push(this.types.string(10));
|
|
148
|
+
}
|
|
149
|
+
copy.space = space;
|
|
150
|
+
}
|
|
151
|
+
if (projectsSize && typeof init.project === 'undefined') {
|
|
152
|
+
const project: string[] = [];
|
|
153
|
+
for (let i = 0; i < projectsSize; i++) {
|
|
154
|
+
project.push(this.types.uuid());
|
|
155
|
+
}
|
|
156
|
+
copy.project = project;
|
|
157
|
+
}
|
|
158
|
+
if (requestsSize && typeof init.request === 'undefined') {
|
|
159
|
+
const requests: string[] = [];
|
|
160
|
+
for (let i = 0; i < requestsSize; i++) {
|
|
161
|
+
requests.push(this.types.uuid());
|
|
162
|
+
}
|
|
163
|
+
copy.request = requests;
|
|
164
|
+
}
|
|
165
|
+
if (appsSize && typeof init.app === 'undefined') {
|
|
166
|
+
const apps: string[] = [];
|
|
167
|
+
for (let i = 0; i < appsSize; i++) {
|
|
168
|
+
apps.push(this.types.uuid());
|
|
169
|
+
}
|
|
170
|
+
copy.app = apps;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const result: IHttpHistory[] = [];
|
|
174
|
+
for (let i = 0; i < size; i++) {
|
|
175
|
+
result.push(this.httpHistory(copy));
|
|
176
|
+
}
|
|
177
|
+
return result;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -3,12 +3,12 @@ import { Http, Types, Lorem, Time, DataMockInit, HttpRequestInit } from '@pawel-
|
|
|
3
3
|
import { IHttpRequest, Kind as HttpRequestKind } from '../../models/HttpRequest.js';
|
|
4
4
|
import { IRequest, Kind as RequestKind } from '../../models/Request.js';
|
|
5
5
|
import { ISentRequest } from '../../models/SentRequest.js';
|
|
6
|
-
import { IRequestLog } from '../../models/RequestLog.js';
|
|
7
|
-
import {
|
|
6
|
+
import { IRequestLog, Kind as RequestLogKind } from '../../models/RequestLog.js';
|
|
7
|
+
import { IResponseInit, Response } from './Response.js';
|
|
8
8
|
|
|
9
9
|
export interface IRequestLogInit {
|
|
10
10
|
request?: HttpRequestInit;
|
|
11
|
-
response?:
|
|
11
|
+
response?: IResponseInit;
|
|
12
12
|
/**
|
|
13
13
|
* When set it ignores size information
|
|
14
14
|
*/
|
|
@@ -66,13 +66,13 @@ export class Request {
|
|
|
66
66
|
|
|
67
67
|
log(init: IRequestLogInit = {}): IRequestLog {
|
|
68
68
|
const result: IRequestLog = {
|
|
69
|
-
kind:
|
|
69
|
+
kind: RequestLogKind,
|
|
70
70
|
};
|
|
71
71
|
if (!init.noRequest) {
|
|
72
72
|
result.request = this.sentRequest(init.request);
|
|
73
73
|
}
|
|
74
74
|
if (!init.noResponse) {
|
|
75
|
-
result.response = this.response.
|
|
75
|
+
result.response = this.response.response(init.response);
|
|
76
76
|
}
|
|
77
77
|
if (init.redirects) {
|
|
78
78
|
result.redirects = this.response.redirects();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Http, Har, Types, Lorem, Time, DataMockInit, HttpResponseInit, HarTimingInit, Internet } from '@pawel-up/data-mock';
|
|
2
2
|
import { IHttpResponse, Kind as HttpResponseKind } from '../../models/HttpResponse.js';
|
|
3
|
-
import {
|
|
3
|
+
import { IResponse, Kind as ResponseKind } from '../../models/Response.js';
|
|
4
4
|
import { IRequestsSize } from '../../models/RequestsSize.js';
|
|
5
5
|
import { IResponseRedirect, Kind as ResponseRedirectKind } from '../../models/ResponseRedirect.js';
|
|
6
6
|
|
|
7
|
-
export interface
|
|
7
|
+
export interface IResponseInit extends HttpResponseInit, HarTimingInit {
|
|
8
8
|
/**
|
|
9
9
|
* When set it does not generate a response payload.
|
|
10
10
|
*/
|
|
@@ -36,7 +36,7 @@ export class Response {
|
|
|
36
36
|
this.internet = new Internet(init);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
httpResponse(init: IResponseInit = {}): IHttpResponse {
|
|
40
40
|
const ct = init.noBody ? undefined : this.http.headers.contentType();
|
|
41
41
|
const body = init.noBody ? undefined : this.http.payload.payload(ct);
|
|
42
42
|
const headers = this.http.headers.headers('response', { mime: ct });
|
|
@@ -56,12 +56,12 @@ export class Response {
|
|
|
56
56
|
return result;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
const base = this.
|
|
59
|
+
response(init: IResponseInit={}): IResponse {
|
|
60
|
+
const base = this.httpResponse(init);
|
|
61
61
|
const length = this.types.number({ min: 10, max: 4000 });
|
|
62
|
-
const result:
|
|
62
|
+
const result: IResponse = {
|
|
63
63
|
...base,
|
|
64
|
-
kind:
|
|
64
|
+
kind: ResponseKind,
|
|
65
65
|
loadingTime: length,
|
|
66
66
|
};
|
|
67
67
|
if (init.timings) {
|
|
@@ -78,7 +78,7 @@ export class Response {
|
|
|
78
78
|
return result;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
redirect(init?:
|
|
81
|
+
redirect(init?: IResponseInit): IResponseRedirect {
|
|
82
82
|
const start = this.time.timestamp();
|
|
83
83
|
const end = this.time.timestamp({ min: start + 1 })
|
|
84
84
|
const info: IResponseRedirect = {
|
|
@@ -86,12 +86,12 @@ export class Response {
|
|
|
86
86
|
startTime: start,
|
|
87
87
|
endTime: end,
|
|
88
88
|
url: this.internet.uri(),
|
|
89
|
-
response: this.
|
|
89
|
+
response: this.httpResponse({ ...init, statusGroup: 3}),
|
|
90
90
|
};
|
|
91
91
|
return info;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
redirects(size=1, init?:
|
|
94
|
+
redirects(size=1, init?: IResponseInit): IResponseRedirect[] {
|
|
95
95
|
const result: IResponseRedirect[] = [];
|
|
96
96
|
for (let i = 0; i < size; i++) {
|
|
97
97
|
result.push(this.redirect(init));
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Internet, Types, DataMockInit, Person, Random } from '@pawel-up/data-mock';
|
|
2
|
+
// import { randomValue } from '@pawel-up/data-mock/src/lib/Http.js';
|
|
3
|
+
import { IUser, ISpaceUser, AccessControlLevel, Kind as UserKind } from '../../models/User.js';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export interface IUserInit {
|
|
7
|
+
noEmail?: boolean;
|
|
8
|
+
noPicture?: boolean;
|
|
9
|
+
noProvider?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ISpaceUserInit extends IUserInit {
|
|
13
|
+
level?: AccessControlLevel;
|
|
14
|
+
levelPool?: AccessControlLevel[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const accessPool: AccessControlLevel[] = ['read', 'comment', 'write', 'admin', 'owner'];
|
|
18
|
+
|
|
19
|
+
export class User {
|
|
20
|
+
person: Person;
|
|
21
|
+
types: Types;
|
|
22
|
+
internet: Internet;
|
|
23
|
+
random: Random;
|
|
24
|
+
|
|
25
|
+
constructor(init: DataMockInit={}) {
|
|
26
|
+
this.person = new Person(init);
|
|
27
|
+
this.types = new Types(init.seed);
|
|
28
|
+
this.internet = new Internet(init);
|
|
29
|
+
this.random = new Random(init.seed);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
user(init: IUserInit = {}): IUser {
|
|
33
|
+
const result: IUser = {
|
|
34
|
+
kind: UserKind,
|
|
35
|
+
key: this.types.uuid(),
|
|
36
|
+
name: this.person.name(),
|
|
37
|
+
}
|
|
38
|
+
if (!init.noEmail) {
|
|
39
|
+
result.email = [{
|
|
40
|
+
email: this.internet.email(),
|
|
41
|
+
verified: this.types.boolean(),
|
|
42
|
+
}];
|
|
43
|
+
}
|
|
44
|
+
if (!init.noPicture) {
|
|
45
|
+
result.picture = {
|
|
46
|
+
url: this.internet.avatar(),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (!init.noProvider) {
|
|
50
|
+
result.provider = {
|
|
51
|
+
refreshToken: this.types.uuid(),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
spaceUser(init: ISpaceUserInit = {}): ISpaceUser {
|
|
58
|
+
const user = this.user(init) as ISpaceUser;
|
|
59
|
+
if (init.level) {
|
|
60
|
+
user.level = init.level;
|
|
61
|
+
} else if (Array.isArray(init.levelPool)) {
|
|
62
|
+
user.level = this.random.pickOne(init.levelPool);
|
|
63
|
+
} else {
|
|
64
|
+
user.level = this.random.pickOne(accessPool);
|
|
65
|
+
}
|
|
66
|
+
return user;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -6,7 +6,7 @@ export interface IAuthorizationData {
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Represents an auth data stored in
|
|
9
|
+
* Represents an auth data stored in API Client's data store to be retrieved
|
|
10
10
|
* when the response status is 401.
|
|
11
11
|
*
|
|
12
12
|
* Each entry represent a Basic or NTLM authorization.
|
|
@@ -34,7 +34,7 @@ export class AuthorizationData {
|
|
|
34
34
|
/**
|
|
35
35
|
* Creates a new provider clearing anything that is so far defined.
|
|
36
36
|
*
|
|
37
|
-
* Note, this throws an error when the provider is not an
|
|
37
|
+
* Note, this throws an error when the provider is not an API Client provider object.
|
|
38
38
|
*/
|
|
39
39
|
new(init: IAuthorizationData): void {
|
|
40
40
|
const { username, password, domain } = init;
|
package/src/models/Backend.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable import/export */
|
|
1
2
|
export type BackendMode = 'single-user' | 'multi-user';
|
|
2
3
|
|
|
3
4
|
export interface IBackendInfo {
|
|
@@ -104,4 +105,96 @@ export interface IListOptions {
|
|
|
104
105
|
* Only with the `query` property. Tells the system in which fields to search for the query term.
|
|
105
106
|
*/
|
|
106
107
|
queryField?: string[];
|
|
108
|
+
type?: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface ICursorOptions {
|
|
112
|
+
/**
|
|
113
|
+
* Page cursor to use with the query.
|
|
114
|
+
*/
|
|
115
|
+
cursor?: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Listing options for the HTTP history.
|
|
120
|
+
*/
|
|
121
|
+
export type HistoryListOptions = IHistorySpaceListOptions | IHistoryProjectListOptions | IHistoryRequestListOptions | IHistoryUserListOptions | IHistoryAppListOptions;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Query options to list history for a user space.
|
|
125
|
+
* The user has to have access to the user space to read / create / delete the history.
|
|
126
|
+
*/
|
|
127
|
+
export interface IHistorySpaceListOptions extends IListOptions {
|
|
128
|
+
type: 'space';
|
|
129
|
+
/**
|
|
130
|
+
* The id of the space.
|
|
131
|
+
*/
|
|
132
|
+
id: string;
|
|
133
|
+
/**
|
|
134
|
+
* Whether to limit the list of results to the history that belongs to the current user.
|
|
135
|
+
*/
|
|
136
|
+
user?: boolean;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Query options to list history for an HTTP project.
|
|
141
|
+
* The user has to have access to the parent user space to read / create / delete the history.
|
|
142
|
+
*/
|
|
143
|
+
export interface IHistoryProjectListOptions extends IListOptions {
|
|
144
|
+
type: 'project';
|
|
145
|
+
/**
|
|
146
|
+
* The id of the space containing the project.
|
|
147
|
+
* The access to the history records for the project is tested against the user space.
|
|
148
|
+
*/
|
|
149
|
+
space: string;
|
|
150
|
+
/**
|
|
151
|
+
* The id of the project.
|
|
152
|
+
*/
|
|
153
|
+
id: string;
|
|
154
|
+
/**
|
|
155
|
+
* Whether to limit the list of results to the history that belongs to the current user.
|
|
156
|
+
*/
|
|
157
|
+
user?: boolean;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Query options to list history for a request in a project.
|
|
162
|
+
* The user has to have access to the parent user space to read / create / delete the history.
|
|
163
|
+
*/
|
|
164
|
+
export interface IHistoryRequestListOptions extends IListOptions {
|
|
165
|
+
type: 'request';
|
|
166
|
+
/**
|
|
167
|
+
* The id of the space containing the project that contains the request.
|
|
168
|
+
* The access to the history records for the request is tested against the user space.
|
|
169
|
+
*/
|
|
170
|
+
space: string;
|
|
171
|
+
/**
|
|
172
|
+
* The id of the request.
|
|
173
|
+
*/
|
|
174
|
+
id: string;
|
|
175
|
+
/**
|
|
176
|
+
* Whether to limit the list of results to the history that belongs to the current user.
|
|
177
|
+
*/
|
|
178
|
+
user?: boolean;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Query options to list history for a user. This targets lists all user history. If you need to
|
|
183
|
+
* filter the user history use other interfaces with the `user` flag set.
|
|
184
|
+
*/
|
|
185
|
+
export interface IHistoryUserListOptions extends IListOptions {
|
|
186
|
+
type: 'user';
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Query options to list history for a history object that was created by an application that has no concept
|
|
191
|
+
* of user spaces. In this case the queries are always made against the current user.
|
|
192
|
+
*/
|
|
193
|
+
export interface IHistoryAppListOptions extends IListOptions {
|
|
194
|
+
type: 'app';
|
|
195
|
+
/**
|
|
196
|
+
* The id of the application.
|
|
197
|
+
* These queries are always made for a user.
|
|
198
|
+
*/
|
|
199
|
+
id: string;
|
|
107
200
|
}
|
|
@@ -61,7 +61,7 @@ export interface ICertificateIndex {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
* A base client certificate object used in
|
|
64
|
+
* A base client certificate object used in API Client to create / list objects.
|
|
65
65
|
* This is not a data entity but rather something used to outside of a context of a data store.
|
|
66
66
|
*/
|
|
67
67
|
export interface IClientCertificate extends IRequestCertificate, ICertificateIndex {
|
|
@@ -16,7 +16,7 @@ export interface IEnvironmentCloneOptions {
|
|
|
16
16
|
* A project environment definition.
|
|
17
17
|
*/
|
|
18
18
|
export interface IEnvironment {
|
|
19
|
-
kind:
|
|
19
|
+
kind: typeof Kind;
|
|
20
20
|
/**
|
|
21
21
|
* The identifier of the environment.
|
|
22
22
|
*/
|
|
@@ -47,7 +47,7 @@ export interface IEnvironment {
|
|
|
47
47
|
security?: unknown;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export const Kind = '
|
|
50
|
+
export const Kind = 'Core#Environment';
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* An environment is applied to a project or a folder.
|
|
@@ -145,11 +145,11 @@ export class Environment {
|
|
|
145
145
|
/**
|
|
146
146
|
* Creates a new environment clearing anything that is so far defined.
|
|
147
147
|
*
|
|
148
|
-
* Note, this throws an error when the environment is not an
|
|
148
|
+
* Note, this throws an error when the environment is not an environment.
|
|
149
149
|
*/
|
|
150
150
|
new(init: IEnvironment): void {
|
|
151
151
|
if (!Environment.isEnvironment(init)) {
|
|
152
|
-
throw new Error(`Not an
|
|
152
|
+
throw new Error(`Not an environment.`);
|
|
153
153
|
}
|
|
154
154
|
const { key=v4(), variables, info, server, encapsulated=false, security } = init;
|
|
155
155
|
this.kind = Kind;
|
|
@@ -86,7 +86,7 @@ export class ErrorResponse extends HttpResponse {
|
|
|
86
86
|
/**
|
|
87
87
|
* Creates a new request clearing anything that is so far defined.
|
|
88
88
|
*
|
|
89
|
-
* Note, this throws an error when the object is not an
|
|
89
|
+
* Note, this throws an error when the object is not an API Client request.
|
|
90
90
|
*/
|
|
91
91
|
new(init: IErrorResponse): void {
|
|
92
92
|
super.new(init);
|
package/src/models/HostRule.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export const Kind = '
|
|
1
|
+
export const Kind = 'Core#HostRule';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* API Client host rule definition.
|
|
5
5
|
*/
|
|
6
6
|
export interface IHostRule {
|
|
7
7
|
kind?: typeof Kind;
|
|
@@ -74,11 +74,11 @@ export class HostRule {
|
|
|
74
74
|
/**
|
|
75
75
|
* Creates a new thing clearing anything that is so far defined.
|
|
76
76
|
*
|
|
77
|
-
* Note, this throws an error when the server is not an
|
|
77
|
+
* Note, this throws an error when the server is not an API Client thing.
|
|
78
78
|
*/
|
|
79
79
|
new(init: IHostRule): void {
|
|
80
80
|
if (!HostRule.isHostRule(init)) {
|
|
81
|
-
throw new Error(`Not
|
|
81
|
+
throw new Error(`Not a HostRule.`);
|
|
82
82
|
}
|
|
83
83
|
const { from='', to='', enabled, comment } = init;
|
|
84
84
|
this.kind = Kind;
|
|
@@ -138,7 +138,7 @@ export class HostRule {
|
|
|
138
138
|
/**
|
|
139
139
|
* Evaluates hosts rule and applies it to the `url`.
|
|
140
140
|
* @param {string} url The URL to evaluate
|
|
141
|
-
* @param {HostRule} rule
|
|
141
|
+
* @param {HostRule} rule The host rule definition
|
|
142
142
|
* @return {string} Processed url.
|
|
143
143
|
*/
|
|
144
144
|
static evaluateRule(url: string, rule: HostRule): string | undefined {
|