@api-client/core 0.6.31 → 0.7.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 +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/{arc/ArcHttpRequest.js → AppRequest.js} +53 -17
- 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/AppSdk.d.ts +185 -0
- package/build/src/runtime/store/AppSdk.js +704 -0
- package/build/src/runtime/store/AppSdk.js.map +1 -0
- 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 +2 -2
- package/build/src/runtime/store/HistorySdk.js.map +1 -1
- 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/AppSdk.ts +709 -0
- package/src/runtime/store/FilesSdk.ts +4 -4
- package/src/runtime/store/HistorySdk.ts +2 -2
- 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 -9
- package/build/src/mocking/lib/Arc.js +0 -24
- 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 -40
- 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 -28
- 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 -129
- 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
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { SameSiteValue } from '../../cookies/CookieParser.js';
|
|
2
|
+
|
|
3
|
+
export const ReadDataStepKind = 'HttpAction#ReadData';
|
|
4
|
+
export const SetDataStepKind = 'HttpAction#SetData';
|
|
5
|
+
export const SetVariableStepKind = 'HttpAction#SetVariable';
|
|
6
|
+
export const SetCookieStepKind = 'HttpAction#SetCookie';
|
|
7
|
+
export const DeleteCookieStepKind = 'HttpAction#DeleteCookie';
|
|
8
|
+
|
|
9
|
+
export enum ActionSourceEnum {
|
|
10
|
+
/**
|
|
11
|
+
* The request object.
|
|
12
|
+
*/
|
|
13
|
+
request = 'request',
|
|
14
|
+
/**
|
|
15
|
+
* The response object.
|
|
16
|
+
*/
|
|
17
|
+
response = 'response',
|
|
18
|
+
/**
|
|
19
|
+
* A variable from the current environment.
|
|
20
|
+
*/
|
|
21
|
+
variable = 'variable',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export enum ActionOperatorEnum {
|
|
25
|
+
equal = "equal",
|
|
26
|
+
notEqual = "not-equal",
|
|
27
|
+
greaterThan = "greater-than",
|
|
28
|
+
greaterThanEqual = "greater-than-equal",
|
|
29
|
+
lessThan = "less-than",
|
|
30
|
+
lessThanEqual = "less-than-equal",
|
|
31
|
+
contains = "contains",
|
|
32
|
+
regex = "regex",
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export enum ActionRequestDataEnum {
|
|
36
|
+
url = "url",
|
|
37
|
+
method = "method",
|
|
38
|
+
headers = "headers",
|
|
39
|
+
body = "body"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export enum ActionResponseDataEnum {
|
|
43
|
+
url = "url",
|
|
44
|
+
status = "status",
|
|
45
|
+
headers = "headers",
|
|
46
|
+
body = "body"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* A flow represents a series of actions to be performed one-by-one after the HTTP request is sent or when the response
|
|
51
|
+
* is ready.
|
|
52
|
+
*/
|
|
53
|
+
export interface IHttpActionFlow {
|
|
54
|
+
/**
|
|
55
|
+
* The description of the flow
|
|
56
|
+
*/
|
|
57
|
+
description?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Describes when the flow is executed.
|
|
60
|
+
* The `request` means the flow is executed before the request is sent to the HTTP engine.
|
|
61
|
+
* The `response` means the flow is executed after the response has been received in full, but before reporting
|
|
62
|
+
* the response to the UI.
|
|
63
|
+
*/
|
|
64
|
+
trigger: 'request' | 'response';
|
|
65
|
+
/**
|
|
66
|
+
* The ordered list of actions to execute.
|
|
67
|
+
*/
|
|
68
|
+
actions: IHttpAction[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Describes a single action in a flow.
|
|
73
|
+
* An action can have a condition that is checked against the current context.
|
|
74
|
+
* Action is not executed when the condition is not meet.
|
|
75
|
+
*
|
|
76
|
+
* Each action has one or more steps (when 0 items then the action is ignored). Each step performs a task.
|
|
77
|
+
* The result of a task is passed to the next step as an input. The result of a task may be `void`, `null`, or `undefined` which is treated as `void`.
|
|
78
|
+
*/
|
|
79
|
+
export interface IHttpAction {
|
|
80
|
+
/**
|
|
81
|
+
* The description of the action
|
|
82
|
+
*/
|
|
83
|
+
description?: string;
|
|
84
|
+
/**
|
|
85
|
+
* A condition to check before performing the action.
|
|
86
|
+
*/
|
|
87
|
+
condition?: IHttpCondition;
|
|
88
|
+
/**
|
|
89
|
+
* The list of steps to perform. This is an ordered list of action tasks.
|
|
90
|
+
* Each step is described by the `kind` property which tells the runner what action to perform.
|
|
91
|
+
*/
|
|
92
|
+
steps: IActionStep[];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* A condition to execute for an action.
|
|
97
|
+
*/
|
|
98
|
+
export interface IHttpCondition {
|
|
99
|
+
/**
|
|
100
|
+
* The main data source.
|
|
101
|
+
* In the legacy actions this was `type`.
|
|
102
|
+
*/
|
|
103
|
+
source?: ActionSourceEnum;
|
|
104
|
+
/**
|
|
105
|
+
* Source of the data.
|
|
106
|
+
* In the legacy actions this was `source`.
|
|
107
|
+
* This is not required when the source is not `request` or `response`.
|
|
108
|
+
*/
|
|
109
|
+
data?: ActionRequestDataEnum | ActionResponseDataEnum;
|
|
110
|
+
/**
|
|
111
|
+
* The path to the data.
|
|
112
|
+
* For JSON value use https://jmespath.org/ syntax.
|
|
113
|
+
* For XML use xpath.
|
|
114
|
+
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
115
|
+
*/
|
|
116
|
+
path?: string;
|
|
117
|
+
/**
|
|
118
|
+
* The comparison operator.
|
|
119
|
+
*/
|
|
120
|
+
operator?: ActionOperatorEnum;
|
|
121
|
+
/**
|
|
122
|
+
* The value to compare the read result.
|
|
123
|
+
* In runtime, the type is casted to the same type as read value.
|
|
124
|
+
*
|
|
125
|
+
* When this is not set it compares to an empty string value or `0`.
|
|
126
|
+
*
|
|
127
|
+
* In ARC actions this was the `predictedValue`.
|
|
128
|
+
*/
|
|
129
|
+
value?: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface IActionStep {
|
|
133
|
+
/**
|
|
134
|
+
* The kind of the action to perform.
|
|
135
|
+
*/
|
|
136
|
+
kind: string;
|
|
137
|
+
/**
|
|
138
|
+
* Whether the step is disabled in the flow.
|
|
139
|
+
*/
|
|
140
|
+
enabled?: boolean;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Reads the data from various sources.
|
|
145
|
+
*/
|
|
146
|
+
export interface IReadDataStep extends IActionStep {
|
|
147
|
+
kind: typeof ReadDataStepKind;
|
|
148
|
+
/**
|
|
149
|
+
* The main data source.
|
|
150
|
+
* In the legacy actions this was `type`.
|
|
151
|
+
*/
|
|
152
|
+
source?: ActionSourceEnum;
|
|
153
|
+
/**
|
|
154
|
+
* Source of the data.
|
|
155
|
+
* In the legacy actions this was `source`.
|
|
156
|
+
* This is not required when the source is not `request` or `response`.
|
|
157
|
+
*/
|
|
158
|
+
data?: ActionRequestDataEnum | ActionResponseDataEnum;
|
|
159
|
+
/**
|
|
160
|
+
* The path to the data.
|
|
161
|
+
* For JSON value use https://jmespath.org/ syntax.
|
|
162
|
+
* For XML use xpath.
|
|
163
|
+
* For any other use a simple path to the data separated by dot (e.g. headers.content-type)
|
|
164
|
+
*/
|
|
165
|
+
path?: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Sets a manually defined value that can be passed to the next step.
|
|
170
|
+
*/
|
|
171
|
+
export interface ISetDataStep extends IActionStep {
|
|
172
|
+
kind: typeof SetDataStepKind;
|
|
173
|
+
/**
|
|
174
|
+
* The value to return to the next step.
|
|
175
|
+
* This is always a string. Use the `dataType` to determine the correct data type.
|
|
176
|
+
*/
|
|
177
|
+
value: string;
|
|
178
|
+
/**
|
|
179
|
+
* The data type of the value. This is a value prefixed with
|
|
180
|
+
* `http://www.w3.org/2001/XMLSchema#` or `http://a.ml/vocabularies/shapes#`.
|
|
181
|
+
*
|
|
182
|
+
* Examples:
|
|
183
|
+
*
|
|
184
|
+
* - `http://www.w3.org/2001/XMLSchema#boolean`
|
|
185
|
+
* - `http://www.w3.org/2001/XMLSchema#string`
|
|
186
|
+
* - `http://www.w3.org/2001/XMLSchema#number`
|
|
187
|
+
* - `http://www.w3.org/2001/XMLSchema#integer`
|
|
188
|
+
* - `http://www.w3.org/2001/XMLSchema#long`
|
|
189
|
+
* - `http://a.ml/vocabularies/shapes#number`
|
|
190
|
+
* - `http://a.ml/vocabularies/shapes#integer`
|
|
191
|
+
* - `http://a.ml/vocabularies/shapes#double`
|
|
192
|
+
* - ...
|
|
193
|
+
*
|
|
194
|
+
* @default `http://www.w3.org/2001/XMLSchema#string`
|
|
195
|
+
*/
|
|
196
|
+
dataType?: string;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* A step that accepts an input from the previous step and sets a variable in the current environment
|
|
201
|
+
* with this value. If the value is `void`, `null`, or `undefined` then the variable is removed from the
|
|
202
|
+
* environment.
|
|
203
|
+
*
|
|
204
|
+
* All variables are strings.
|
|
205
|
+
*/
|
|
206
|
+
export interface ISetVariableStep extends IActionStep {
|
|
207
|
+
kind: typeof SetVariableStepKind;
|
|
208
|
+
/**
|
|
209
|
+
* The name of the variable to set
|
|
210
|
+
*/
|
|
211
|
+
name: string;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* A step that allows to set a cookie with the value returned by a previous step.
|
|
216
|
+
*/
|
|
217
|
+
export interface ISetCookieStep extends IActionStep {
|
|
218
|
+
kind: typeof SetCookieStepKind;
|
|
219
|
+
/**
|
|
220
|
+
* Name of the cookie
|
|
221
|
+
*/
|
|
222
|
+
name: string;
|
|
223
|
+
/**
|
|
224
|
+
* The URL associated with the cookie. When not set it uses the request URL or the request URL of the last redirect.
|
|
225
|
+
*/
|
|
226
|
+
url?: string;
|
|
227
|
+
/**
|
|
228
|
+
* The cookie expiration time. It can be a valid cookie date or a string representing a relative time to "now"
|
|
229
|
+
* like `4d`, `600s`, etc.
|
|
230
|
+
*/
|
|
231
|
+
expires?: string;
|
|
232
|
+
/**
|
|
233
|
+
* Whether the cookie is host only
|
|
234
|
+
*/
|
|
235
|
+
hostOnly?: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* Whether the cookie is HTTP only
|
|
238
|
+
*/
|
|
239
|
+
httpOnly?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Whether the cookie is HTTPS only
|
|
242
|
+
*/
|
|
243
|
+
secure?: boolean;
|
|
244
|
+
/**
|
|
245
|
+
* Whether the cookie is a session cookie
|
|
246
|
+
*/
|
|
247
|
+
session?: boolean;
|
|
248
|
+
/**
|
|
249
|
+
* The SameSite parameter of the cookie.
|
|
250
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#creating_cookies
|
|
251
|
+
*/
|
|
252
|
+
sameSite?: SameSiteValue;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* A step allowing to delete a cookie for the given configuration.
|
|
257
|
+
* This step does not require an input.
|
|
258
|
+
*/
|
|
259
|
+
export interface IDeleteCookieStep extends IActionStep {
|
|
260
|
+
kind: typeof DeleteCookieStepKind;
|
|
261
|
+
/**
|
|
262
|
+
* The URL associated with the cookie. When not set it uses the request URL or the request URL of the last redirect.
|
|
263
|
+
*/
|
|
264
|
+
url?: string;
|
|
265
|
+
/**
|
|
266
|
+
* Name of the cookie to remove.
|
|
267
|
+
* When not set it removes all cookies for the URL.
|
|
268
|
+
*/
|
|
269
|
+
name?: string;
|
|
270
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { RequestActions as LegacyRequestActions } from '../../models/legacy/request/ArcRequest.js';
|
|
2
|
+
import { RunnableAction as LegacyRunnable, Condition as LegacyCondition, Action as LegacyAction, SetCookieConfig, SetVariableConfig, DeleteCookieConfig, DataSourceConfiguration } from '../../models/legacy/actions/Actions.js';
|
|
3
|
+
import { IHttpActionFlow, IHttpAction, IHttpCondition, ActionSourceEnum, ActionRequestDataEnum, ActionResponseDataEnum, ActionOperatorEnum, IActionStep, ISetDataStep, SetDataStepKind, IReadDataStep, ReadDataStepKind, ISetCookieStep, SetCookieStepKind, IDeleteCookieStep, DeleteCookieStepKind } from './HttpActions.js';
|
|
4
|
+
import { AmfNamespace } from '../../amf/definitions/Namespace.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Allows to translate the old ARC actions into Action flows.
|
|
8
|
+
*/
|
|
9
|
+
export class LegacyTranslator {
|
|
10
|
+
static translate(action: LegacyRequestActions): IHttpActionFlow[] {
|
|
11
|
+
const { request, response } = action;
|
|
12
|
+
const result: IHttpActionFlow[] = [];
|
|
13
|
+
|
|
14
|
+
if (Array.isArray(request) && request.length) {
|
|
15
|
+
const flow: IHttpActionFlow = {
|
|
16
|
+
trigger: 'request',
|
|
17
|
+
actions: this._translateRunnables(request),
|
|
18
|
+
};
|
|
19
|
+
result.push(flow);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (Array.isArray(response) && response.length) {
|
|
23
|
+
const flow: IHttpActionFlow = {
|
|
24
|
+
trigger: 'response',
|
|
25
|
+
actions: this._translateRunnables(response),
|
|
26
|
+
};
|
|
27
|
+
result.push(flow);
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
protected static _translateRunnables(runnables: LegacyRunnable[]): IHttpAction[] {
|
|
33
|
+
const result: IHttpAction[] = [];
|
|
34
|
+
runnables.forEach((runnable) => {
|
|
35
|
+
const actions = this._translateRunnable(runnable);
|
|
36
|
+
actions.forEach(item => result.push(item));
|
|
37
|
+
});
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
protected static _translateRunnable(runnable: LegacyRunnable): IHttpAction[] {
|
|
42
|
+
const result: IHttpAction[] = [];
|
|
43
|
+
const { actions, condition } = runnable;
|
|
44
|
+
actions.forEach((action) => {
|
|
45
|
+
const current: IHttpAction = {
|
|
46
|
+
steps: this._translateAction(action),
|
|
47
|
+
};
|
|
48
|
+
if (condition) {
|
|
49
|
+
current.condition = this._translateCondition(condition);
|
|
50
|
+
}
|
|
51
|
+
result.push(current);
|
|
52
|
+
});
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
protected static _translateCondition(runnable: LegacyCondition): IHttpCondition | undefined {
|
|
57
|
+
const { source, alwaysPass, operator, path, predictedValue, type } = runnable;
|
|
58
|
+
if (alwaysPass) {
|
|
59
|
+
// in the flow, if there's no condition the steps are always executed.
|
|
60
|
+
return undefined
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const result: IHttpCondition = {};
|
|
64
|
+
if (typeof path === 'string') {
|
|
65
|
+
result.path = path;
|
|
66
|
+
}
|
|
67
|
+
if (type) {
|
|
68
|
+
switch (type) {
|
|
69
|
+
case 'request': result.source = ActionSourceEnum.request; break;
|
|
70
|
+
case 'response': result.source = ActionSourceEnum.response; break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (type && source) {
|
|
74
|
+
if (type === 'request') {
|
|
75
|
+
result.data = source as ActionRequestDataEnum;
|
|
76
|
+
}
|
|
77
|
+
if (type === 'response') {
|
|
78
|
+
result.data = source as ActionResponseDataEnum;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (predictedValue) {
|
|
82
|
+
result.value = String(predictedValue);
|
|
83
|
+
}
|
|
84
|
+
if (operator) {
|
|
85
|
+
switch (operator) {
|
|
86
|
+
case 'contains': result.operator = ActionOperatorEnum.contains; break;
|
|
87
|
+
case 'equal': result.operator = ActionOperatorEnum.equal; break;
|
|
88
|
+
case 'greater-than': result.operator = ActionOperatorEnum.greaterThan; break;
|
|
89
|
+
case 'greater-than-equal': result.operator = ActionOperatorEnum.greaterThanEqual; break;
|
|
90
|
+
case 'less-than': result.operator = ActionOperatorEnum.lessThan; break;
|
|
91
|
+
case 'less-than-equal': result.operator = ActionOperatorEnum.lessThanEqual; break;
|
|
92
|
+
case 'not-equal': result.operator = ActionOperatorEnum.notEqual; break;
|
|
93
|
+
case 'regex': result.operator = ActionOperatorEnum.regex; break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
protected static _translateAction(item: LegacyAction): IActionStep[] {
|
|
100
|
+
switch (item.name) {
|
|
101
|
+
case 'set-cookie': return this._translateSetCookieAction(item);
|
|
102
|
+
case 'set-variable': return this._translateSetVariableAction(item);
|
|
103
|
+
case 'delete-cookie': return this._translateDeleteCookieAction(item);
|
|
104
|
+
default: return [];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
protected static _translateSetCookieAction(item: LegacyAction): IActionStep[] {
|
|
109
|
+
const legacy = item.config as SetCookieConfig;
|
|
110
|
+
|
|
111
|
+
const steps: IActionStep[] = [];
|
|
112
|
+
const ds = this._translateDataSource(legacy.source);
|
|
113
|
+
steps.push(ds);
|
|
114
|
+
|
|
115
|
+
const action: ISetCookieStep = {
|
|
116
|
+
kind: SetCookieStepKind,
|
|
117
|
+
name: legacy.name,
|
|
118
|
+
};
|
|
119
|
+
if (item.enabled === false) {
|
|
120
|
+
action.enabled = item.enabled;
|
|
121
|
+
}
|
|
122
|
+
if (legacy.url) {
|
|
123
|
+
action.url = legacy.url;
|
|
124
|
+
}
|
|
125
|
+
if (legacy.expires) {
|
|
126
|
+
action.expires = legacy.expires;
|
|
127
|
+
}
|
|
128
|
+
if (typeof legacy.hostOnly === 'boolean') {
|
|
129
|
+
action.hostOnly = legacy.hostOnly;
|
|
130
|
+
}
|
|
131
|
+
if (typeof legacy.httpOnly === 'boolean') {
|
|
132
|
+
action.httpOnly = legacy.httpOnly;
|
|
133
|
+
}
|
|
134
|
+
if (typeof legacy.secure === 'boolean') {
|
|
135
|
+
action.secure = legacy.secure;
|
|
136
|
+
}
|
|
137
|
+
if (typeof legacy.session === 'boolean') {
|
|
138
|
+
action.session = legacy.session;
|
|
139
|
+
}
|
|
140
|
+
steps.push(action);
|
|
141
|
+
|
|
142
|
+
return steps;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
protected static _translateSetVariableAction(item: LegacyAction): IActionStep[] {
|
|
146
|
+
const legacy = item.config as SetVariableConfig;
|
|
147
|
+
|
|
148
|
+
const steps: IActionStep[] = [];
|
|
149
|
+
const ds = this._translateDataSource(legacy.source);
|
|
150
|
+
steps.push(ds);
|
|
151
|
+
|
|
152
|
+
const action: ISetCookieStep = {
|
|
153
|
+
kind: SetCookieStepKind,
|
|
154
|
+
name: legacy.name,
|
|
155
|
+
};
|
|
156
|
+
if (item.enabled === false) {
|
|
157
|
+
action.enabled = item.enabled;
|
|
158
|
+
}
|
|
159
|
+
steps.push(action);
|
|
160
|
+
|
|
161
|
+
return steps;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
protected static _translateDeleteCookieAction(item: LegacyAction): IActionStep[] {
|
|
165
|
+
const legacy = item.config as DeleteCookieConfig;
|
|
166
|
+
|
|
167
|
+
const steps: IActionStep[] = [];
|
|
168
|
+
|
|
169
|
+
const action: IDeleteCookieStep = {
|
|
170
|
+
kind: DeleteCookieStepKind,
|
|
171
|
+
};
|
|
172
|
+
if (item.enabled === false) {
|
|
173
|
+
action.enabled = item.enabled;
|
|
174
|
+
}
|
|
175
|
+
if (legacy.name && !legacy.removeAll) {
|
|
176
|
+
action.name = legacy.name;
|
|
177
|
+
}
|
|
178
|
+
if (legacy.url && !legacy.useRequestUrl) {
|
|
179
|
+
action.url = legacy.url;
|
|
180
|
+
}
|
|
181
|
+
steps.push(action);
|
|
182
|
+
|
|
183
|
+
return steps;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
protected static _translateDataSource(source: DataSourceConfiguration): IActionStep {
|
|
187
|
+
if (source.value) {
|
|
188
|
+
const dataSet: ISetDataStep = {
|
|
189
|
+
kind: SetDataStepKind,
|
|
190
|
+
value: source.value,
|
|
191
|
+
dataType: AmfNamespace.w3.xmlSchema.string,
|
|
192
|
+
};
|
|
193
|
+
return dataSet;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// Note, there's no way for us to translate the old "iterator" configuration
|
|
197
|
+
// to the current syntax. We just drop it.
|
|
198
|
+
|
|
199
|
+
const { path, type, source: legacySource } = source;
|
|
200
|
+
const result: IReadDataStep = {
|
|
201
|
+
kind: ReadDataStepKind,
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
if (typeof path === 'string') {
|
|
205
|
+
result.path = path;
|
|
206
|
+
}
|
|
207
|
+
if (type) {
|
|
208
|
+
switch (type) {
|
|
209
|
+
case 'request': result.source = ActionSourceEnum.request; break;
|
|
210
|
+
case 'response': result.source = ActionSourceEnum.response; break;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (type && legacySource) {
|
|
214
|
+
if (type === 'request') {
|
|
215
|
+
result.data = legacySource as ActionRequestDataEnum;
|
|
216
|
+
}
|
|
217
|
+
if (type === 'response') {
|
|
218
|
+
result.data = legacySource as ActionResponseDataEnum;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return result;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
@@ -20,7 +20,25 @@ export interface IBackendInfo {
|
|
|
20
20
|
* @default single-user
|
|
21
21
|
*/
|
|
22
22
|
mode: BackendMode;
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The list of capabilities this store has.
|
|
26
|
+
* This is defined by the store and clients should use values defined there to detect supported capabilities.
|
|
27
|
+
*
|
|
28
|
+
* Example capabilities include:
|
|
29
|
+
* - authorization
|
|
30
|
+
* - authentication
|
|
31
|
+
* - files
|
|
32
|
+
* - history
|
|
33
|
+
* - certificates
|
|
34
|
+
* - etc.
|
|
35
|
+
*
|
|
36
|
+
* This could be potentially replaced by the version number of the store library but this
|
|
37
|
+
* is more future-proof in case we go into a distributed architecture with the store.
|
|
38
|
+
* Clients should look for a capability rather the version of the store.
|
|
39
|
+
*/
|
|
40
|
+
capabilities: string[];
|
|
41
|
+
|
|
24
42
|
/**
|
|
25
43
|
* Client authentication configuration
|
|
26
44
|
*/
|
|
@@ -124,7 +142,7 @@ export interface IListResponse<T = unknown> {
|
|
|
124
142
|
/**
|
|
125
143
|
* The list of objects returned from the store.
|
|
126
144
|
*/
|
|
127
|
-
|
|
145
|
+
items: T[];
|
|
128
146
|
}
|
|
129
147
|
|
|
130
148
|
export interface IListOptions {
|
|
@@ -300,3 +318,131 @@ export interface IPatchRevision extends IPatchInfo {
|
|
|
300
318
|
*/
|
|
301
319
|
revert: JsonPatch;
|
|
302
320
|
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Describes a batch read operation body.
|
|
324
|
+
*/
|
|
325
|
+
export interface IBatchRead {
|
|
326
|
+
/**
|
|
327
|
+
* The keys of the items to read. The response has the ordered list of results.
|
|
328
|
+
*/
|
|
329
|
+
items: string[];
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Describes a result of the batch read operation body.
|
|
334
|
+
*/
|
|
335
|
+
export interface IBatchReadResult<T = unknown> {
|
|
336
|
+
/**
|
|
337
|
+
* The ordered list of read entities.
|
|
338
|
+
* Each element can be null/undefined when the item cannot be read.
|
|
339
|
+
*
|
|
340
|
+
* The batch operation does not return specific errors. Use the direct read operation
|
|
341
|
+
* for the detailed error.
|
|
342
|
+
*/
|
|
343
|
+
items: (T | null | undefined)[];
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Describes a batch update/create operation body.
|
|
348
|
+
*/
|
|
349
|
+
export interface IBatchUpdate<T = unknown> {
|
|
350
|
+
/**
|
|
351
|
+
* The items to add or update in a batch operation.
|
|
352
|
+
*/
|
|
353
|
+
items: T[];
|
|
354
|
+
/**
|
|
355
|
+
* The optional key of the parent object of the created/updated items.
|
|
356
|
+
*/
|
|
357
|
+
parent?: string;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Describes a result of the batch update/create operation body.
|
|
362
|
+
*/
|
|
363
|
+
export interface IBatchUpdateResult<T = unknown> {
|
|
364
|
+
/**
|
|
365
|
+
* The ordered list of create/update result for each item.
|
|
366
|
+
*/
|
|
367
|
+
items: T[];
|
|
368
|
+
/**
|
|
369
|
+
* The optional key of the parent object of the created/updated items.
|
|
370
|
+
*/
|
|
371
|
+
parent?: string;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Describes a batch delete operation body.
|
|
376
|
+
*/
|
|
377
|
+
export interface IBatchDelete {
|
|
378
|
+
/**
|
|
379
|
+
* The list of keys of items to delete.
|
|
380
|
+
*/
|
|
381
|
+
items: string[];
|
|
382
|
+
/**
|
|
383
|
+
* The optional key of the parent object of the deleted items.
|
|
384
|
+
* Not used by the store but reported back through the events.
|
|
385
|
+
*/
|
|
386
|
+
parent?: string;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Describes a result of the batch delete operation.
|
|
391
|
+
*/
|
|
392
|
+
export interface IBatchDeleteResult {
|
|
393
|
+
/**
|
|
394
|
+
* The ordered list of delete result for each item.
|
|
395
|
+
*
|
|
396
|
+
* The batch operation does not return specific errors. Use the direct delete operation
|
|
397
|
+
* for the detailed error.
|
|
398
|
+
*/
|
|
399
|
+
items: (IDeleteRecord | undefined | null)[];
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export interface IDeleteRecord {
|
|
403
|
+
/**
|
|
404
|
+
* The key of the removed object.
|
|
405
|
+
*/
|
|
406
|
+
key: string;
|
|
407
|
+
/**
|
|
408
|
+
* The key of the parent object, if applicable.
|
|
409
|
+
*/
|
|
410
|
+
parent?: string;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Describes a batch undelete operation body.
|
|
415
|
+
*/
|
|
416
|
+
export interface IBatchUndelete {
|
|
417
|
+
/**
|
|
418
|
+
* The list of keys of the items to undelete.
|
|
419
|
+
*/
|
|
420
|
+
items: string[];
|
|
421
|
+
/**
|
|
422
|
+
* The optional key of the parent object of the deleted items.
|
|
423
|
+
*/
|
|
424
|
+
parent?: string;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
export interface IRevertResult<T = unknown> {
|
|
428
|
+
/**
|
|
429
|
+
* The data kind of the changed item.
|
|
430
|
+
*/
|
|
431
|
+
kind?: string;
|
|
432
|
+
/**
|
|
433
|
+
* The key of the changed object.
|
|
434
|
+
*/
|
|
435
|
+
key: string;
|
|
436
|
+
/**
|
|
437
|
+
* The updated object.
|
|
438
|
+
*/
|
|
439
|
+
item?: T;
|
|
440
|
+
/**
|
|
441
|
+
* Optionally, when relevant, the key of the parent of the changed object.
|
|
442
|
+
*/
|
|
443
|
+
parent?: string;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export interface IRevertResponse<T = unknown> {
|
|
447
|
+
items: (IRevertResult<T> | undefined)[];
|
|
448
|
+
}
|
package/src/models/store/File.ts
CHANGED
|
@@ -5,6 +5,8 @@ import { IUser, Kind as UserKind } from './User.js';
|
|
|
5
5
|
import { IThing, Thing } from '../Thing.js';
|
|
6
6
|
import v4 from '../../lib/uuid.js';
|
|
7
7
|
import { ICapabilities } from './Capabilities.js';
|
|
8
|
+
// this causes error
|
|
9
|
+
// import { Kind as WorkspaceKind } from '../Workspace.js';
|
|
8
10
|
|
|
9
11
|
export const DefaultOwner = 'default';
|
|
10
12
|
|
|
@@ -18,7 +20,7 @@ export interface IStoredFile {
|
|
|
18
20
|
*/
|
|
19
21
|
key: string;
|
|
20
22
|
/**
|
|
21
|
-
* The
|
|
23
|
+
* The file's meta info.
|
|
22
24
|
*/
|
|
23
25
|
info: IThing;
|
|
24
26
|
/**
|
package/src/models/store/User.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface IUserPicture {
|
|
|
16
16
|
*/
|
|
17
17
|
url?: string;
|
|
18
18
|
/**
|
|
19
|
-
* Alternative to the `
|
|
19
|
+
* Alternative to the `url`. When set it is a data URL value of the image.
|
|
20
20
|
*/
|
|
21
21
|
data?: string;
|
|
22
22
|
}
|
|
@@ -26,7 +26,7 @@ export const Kind = 'Core#User';
|
|
|
26
26
|
interface BaseUser {
|
|
27
27
|
kind: typeof Kind;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* The data store key of the user.
|
|
30
30
|
*/
|
|
31
31
|
key: string;
|
|
32
32
|
/**
|
|
@@ -42,7 +42,7 @@ interface BaseUser {
|
|
|
42
42
|
*/
|
|
43
43
|
picture?: IUserPicture;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* A general purpose tags field.
|
|
46
46
|
*/
|
|
47
47
|
tags?: string[];
|
|
48
48
|
/**
|