@api-client/core 0.3.2 → 0.3.5
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 +1 -0
- package/build/browser.js +1 -0
- package/build/browser.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/src/models/ErrorResponse.d.ts +5 -4
- package/build/src/models/ErrorResponse.js +18 -5
- package/build/src/models/ErrorResponse.js.map +1 -1
- package/build/src/models/SerializableError.d.ts +30 -0
- package/build/src/models/SerializableError.js +63 -0
- package/build/src/models/SerializableError.js.map +1 -0
- package/build/src/runtime/http-engine/ArcEngine.js +8 -4
- package/build/src/runtime/http-engine/ArcEngine.js.map +1 -1
- package/build/src/runtime/http-engine/HttpEngine.d.ts +3 -3
- package/build/src/runtime/http-engine/HttpEngine.js +3 -3
- package/build/src/runtime/http-engine/HttpEngine.js.map +1 -1
- package/build/src/runtime/http-engine/NodeEngine.js +9 -4
- package/build/src/runtime/http-engine/NodeEngine.js.map +1 -1
- package/build/src/runtime/http-engine/NodeEngineDirect.js +8 -2
- package/build/src/runtime/http-engine/NodeEngineDirect.js.map +1 -1
- package/build/src/runtime/node/ProjectRunner.d.ts +2 -2
- package/build/src/runtime/node/ProjectRunner.js +9 -2
- package/build/src/runtime/node/ProjectRunner.js.map +1 -1
- package/build/src/runtime/store/StoreSdk.js +10 -15
- package/build/src/runtime/store/StoreSdk.js.map +1 -1
- package/package.json +1 -1
- package/src/data/DataReader.ts +11 -0
- package/src/data/DataUtils.ts +108 -0
- package/src/data/JmesparthReader.ts +26 -0
- package/src/data/Json2Xml.ts +190 -0
- package/src/data/JsonReader.ts +41 -0
- package/src/data/PayloadPointer.ts +48 -0
- package/src/data/RequestDataExtractor.ts +133 -0
- package/src/data/UrlEncodedReader.ts +20 -0
- package/src/data/XmlReader.ts +103 -0
- package/src/events/BaseEvents.ts +259 -0
- package/src/events/CustomEvent.ts +27 -0
- package/src/events/EventTypes.ts +19 -0
- package/src/events/Events.ts +19 -0
- package/src/events/authorization/AuthorizationEventTypes.ts +22 -0
- package/src/events/authorization/AuthorizationEvents.ts +61 -0
- package/src/events/cookies/CookieEventTypes.ts +13 -0
- package/src/events/cookies/CookieEvents.ts +157 -0
- package/src/events/encryption/EncryptionEventTypes.ts +4 -0
- package/src/events/encryption/EncryptionEvents.ts +51 -0
- package/src/events/environment/EnvironmentEventTypes.ts +3 -0
- package/src/events/environment/EnvironmentEvents.ts +24 -0
- package/src/events/models/ClientCertificateEvents.ts +87 -0
- package/src/events/models/ModelEventTypes.ts +47 -0
- package/src/events/models/ModelEvents.ts +7 -0
- package/src/events/models/ProjectEvents.ts +331 -0
- package/src/events/process/ProcessEventTypes.ts +5 -0
- package/src/events/process/ProcessEvents.ts +76 -0
- package/src/events/readme.md +22 -0
- package/src/events/reporting/ReportingEventTypes.ts +3 -0
- package/src/events/reporting/ReportingEvents.ts +28 -0
- package/src/events/telemetry/TelemetryEventTypes.ts +10 -0
- package/src/events/telemetry/TelemetryEvents.ts +156 -0
- package/src/lib/cookies/Cookie.ts +312 -0
- package/src/lib/cookies/Cookies.ts +326 -0
- package/src/lib/cookies/Utils.ts +168 -0
- package/src/lib/headers/Headers.ts +219 -0
- package/src/lib/logging/DefaultLogger.ts +19 -0
- package/src/lib/logging/DummyLogger.ts +21 -0
- package/src/lib/logging/Logger.ts +16 -0
- package/src/lib/transformers/PayloadSerializer.ts +332 -0
- package/src/lib/transformers/Utils.ts +18 -0
- package/src/lib/uuid.ts +40 -0
- package/src/mocking/LegacyInterfaces.ts +52 -0
- package/src/mocking/LegacyMock.ts +37 -0
- package/src/mocking/legacy/Authorization.ts +39 -0
- package/src/mocking/legacy/Certificates.ts +145 -0
- package/src/mocking/legacy/Cookies.ts +51 -0
- package/src/mocking/legacy/HostRules.ts +43 -0
- package/src/mocking/legacy/Http.ts +236 -0
- package/src/mocking/legacy/HttpResponse.ts +106 -0
- package/src/mocking/legacy/RestApi.ts +68 -0
- package/src/mocking/legacy/Urls.ts +44 -0
- package/src/mocking/legacy/Variables.ts +53 -0
- package/src/models/ArcResponse.ts +166 -0
- package/src/models/Authorization.ts +481 -0
- package/src/models/AuthorizationData.ts +60 -0
- package/src/models/Backend.ts +107 -0
- package/src/models/ClientCertificate.ts +68 -0
- package/src/models/Environment.ts +279 -0
- package/src/models/ErrorResponse.ts +113 -0
- package/src/models/HistoryIndex.ts +76 -0
- package/src/models/HistoryRequest.ts +28 -0
- package/src/models/HostRule.ts +163 -0
- package/src/models/HttpCookie.ts +285 -0
- package/src/models/HttpProject.ts +1294 -0
- package/src/models/HttpProjectListItem.ts +23 -0
- package/src/models/HttpRequest.ts +124 -0
- package/src/models/HttpResponse.ts +143 -0
- package/src/models/License.ts +113 -0
- package/src/models/ProjectDefinitionProperty.ts +40 -0
- package/src/models/ProjectFolder.ts +439 -0
- package/src/models/ProjectItem.ts +135 -0
- package/src/models/ProjectParent.ts +113 -0
- package/src/models/ProjectRequest.ts +277 -0
- package/src/models/ProjectSchema.ts +202 -0
- package/src/models/Property.ts +423 -0
- package/src/models/Provider.ts +98 -0
- package/src/models/README.md +20 -0
- package/src/models/Request.ts +452 -0
- package/src/models/RequestActions.ts +163 -0
- package/src/models/RequestAuthorization.ts +115 -0
- package/src/models/RequestConfig.ts +317 -0
- package/src/models/RequestLog.ts +159 -0
- package/src/models/RequestTime.ts +108 -0
- package/src/models/RequestUiMeta.ts +258 -0
- package/src/models/RequestsSize.ts +65 -0
- package/src/models/ResponseAuthorization.ts +104 -0
- package/src/models/ResponseRedirect.ts +158 -0
- package/src/models/RevisionInfo.ts +37 -0
- package/src/models/SentRequest.ts +125 -0
- package/src/models/SerializableError.ts +80 -0
- package/src/models/SerializablePayload.ts +68 -0
- package/src/models/Server.ts +153 -0
- package/src/models/Thing.ts +110 -0
- package/src/models/Url.ts +90 -0
- package/src/models/User.ts +120 -0
- package/src/models/WebApi.ts +234 -0
- package/src/models/WebApiIndex.ts +122 -0
- package/src/models/Workspace.ts +182 -0
- package/src/models/actions/Action.ts +213 -0
- package/src/models/actions/ActionView.ts +40 -0
- package/src/models/actions/Condition.ts +207 -0
- package/src/models/actions/ConditionView.ts +42 -0
- package/src/models/actions/Enums.ts +29 -0
- package/src/models/actions/RunnableAction.ts +144 -0
- package/src/models/actions/runnable/DeleteCookieAction.ts +113 -0
- package/src/models/actions/runnable/Runnable.ts +9 -0
- package/src/models/actions/runnable/SetCookieAction.ts +216 -0
- package/src/models/actions/runnable/SetVariableAction.ts +81 -0
- package/src/models/legacy/DataExport.ts +172 -0
- package/src/models/legacy/Normalizer.ts +110 -0
- package/src/models/legacy/actions/Actions.ts +269 -0
- package/src/models/legacy/authorization/Authorization.ts +572 -0
- package/src/models/legacy/models/ApiTypes.ts +202 -0
- package/src/models/legacy/models/ArcLegacyProject.ts +39 -0
- package/src/models/legacy/models/AuthData.ts +17 -0
- package/src/models/legacy/models/ClientCertificate.ts +95 -0
- package/src/models/legacy/models/Cookies.ts +52 -0
- package/src/models/legacy/models/HostRule.ts +35 -0
- package/src/models/legacy/models/RestApi.ts +49 -0
- package/src/models/legacy/models/UrlHistory.ts +37 -0
- package/src/models/legacy/models/Variable.ts +43 -0
- package/src/models/legacy/models/base.d.ts +95 -0
- package/src/models/legacy/request/ArcRequest.ts +405 -0
- package/src/models/legacy/request/ArcResponse.ts +177 -0
- package/src/models/legacy/request/HistoryData.ts +47 -0
- package/src/models/legacy/request/Legacy.ts +45 -0
- package/src/models/legacy/request/RequestBody.ts +87 -0
- package/src/models/transformers/ArcDexieTransformer.ts +323 -0
- package/src/models/transformers/ArcLegacyNormalizer.ts +85 -0
- package/src/models/transformers/ArcLegacyTransformer.ts +200 -0
- package/src/models/transformers/ArcPouchTransformer.ts +184 -0
- package/src/models/transformers/BaseTransformer.ts +116 -0
- package/src/models/transformers/ImportUtils.ts +141 -0
- package/src/models/transformers/LegacyDataExportToApiProject.ts +76 -0
- package/src/models/transformers/LegacyExportProcessor.ts +252 -0
- package/src/models/transformers/PostmanBackupTransformer.ts +306 -0
- package/src/models/transformers/PostmanDataTransformer.ts +50 -0
- package/src/models/transformers/PostmanTransformer.ts +106 -0
- package/src/models/transformers/PostmanV21Transformer.ts +311 -0
- package/src/models/transformers/PostmanV2Transformer.ts +308 -0
- package/src/models/transformers/har.ts +865 -0
- package/src/runtime/actions/ActionRunner.ts +83 -0
- package/src/runtime/actions/ConditionRunner.ts +194 -0
- package/src/runtime/actions/RunnableCondition.ts +57 -0
- package/src/runtime/actions/runnable/ActionRunnable.ts +19 -0
- package/src/runtime/actions/runnable/DeleteCookieRunnable.ts +39 -0
- package/src/runtime/actions/runnable/SetCookieRunnable.ts +92 -0
- package/src/runtime/actions/runnable/SetVariableRunnable.ts +53 -0
- package/src/runtime/http-engine/ArcEngine.ts +1068 -0
- package/src/runtime/http-engine/FormData.ts +85 -0
- package/src/runtime/http-engine/HttpEngine.ts +874 -0
- package/src/runtime/http-engine/HttpErrorCodes.ts +270 -0
- package/src/runtime/http-engine/NodeEngine.ts +792 -0
- package/src/runtime/http-engine/NodeEngineDirect.ts +482 -0
- package/src/runtime/http-engine/PayloadSupport.ts +84 -0
- package/src/runtime/http-engine/RequestUtils.ts +164 -0
- package/src/runtime/http-engine/ntlm/Des.ts +345 -0
- package/src/runtime/http-engine/ntlm/MD4.ts +135 -0
- package/src/runtime/http-engine/ntlm/NtlmAuth.ts +186 -0
- package/src/runtime/http-engine/ntlm/NtlmMessage.ts +57 -0
- package/src/runtime/modules/BasicAuthCache.ts +133 -0
- package/src/runtime/modules/ExecutionResponse.ts +4 -0
- package/src/runtime/modules/ModulesRegistry.ts +136 -0
- package/src/runtime/modules/RequestAuthorization.ts +110 -0
- package/src/runtime/modules/RequestCookies.ts +145 -0
- package/src/runtime/node/ProjectRunner.ts +281 -0
- package/src/runtime/node/RequestFactory.ts +422 -0
- package/src/runtime/node/VariablesStore.ts +25 -0
- package/src/runtime/store/StoreSdk.ts +838 -0
- package/src/runtime/variables/Cache.ts +53 -0
- package/src/runtime/variables/EvalFunctions.ts +132 -0
- package/src/runtime/variables/ProjectVariables.ts +6 -0
- package/src/runtime/variables/VariablesProcessor.ts +543 -0
- package/src/runtime/variables/VariablesTokenizer.ts +55 -0
- package/build/src/runtime/http-engine/Errors.d.ts +0 -10
- package/build/src/runtime/http-engine/Errors.js +0 -14
- package/build/src/runtime/http-engine/Errors.js.map +0 -1
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-empty-interface */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated
|
|
5
|
+
*/
|
|
6
|
+
export interface NtlmAuthLegacy {
|
|
7
|
+
domain: string;
|
|
8
|
+
username: string;
|
|
9
|
+
password?: string;
|
|
10
|
+
url?: string;
|
|
11
|
+
method: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated
|
|
16
|
+
*/
|
|
17
|
+
export interface BasicAuthLegacy {
|
|
18
|
+
username: string;
|
|
19
|
+
password?: string;
|
|
20
|
+
method: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A configuration for the legacy ARC auth object on the request.
|
|
25
|
+
* This object has been repriced in Q1 2020 wit OAS3 support release.
|
|
26
|
+
* @deprecated
|
|
27
|
+
*/
|
|
28
|
+
export interface LegacyAuth extends NtlmAuthLegacy, BasicAuthLegacy {
|
|
29
|
+
type: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated
|
|
34
|
+
*/
|
|
35
|
+
export interface BasicAuthorization {
|
|
36
|
+
/**
|
|
37
|
+
* User name value.
|
|
38
|
+
*/
|
|
39
|
+
username?: string;
|
|
40
|
+
/**
|
|
41
|
+
* User password value.
|
|
42
|
+
*/
|
|
43
|
+
password?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated
|
|
48
|
+
*/
|
|
49
|
+
export interface BearerAuthorization {
|
|
50
|
+
/**
|
|
51
|
+
* Bearer token value
|
|
52
|
+
*/
|
|
53
|
+
token: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated
|
|
58
|
+
*/
|
|
59
|
+
export interface NtlmAuthorization {
|
|
60
|
+
/**
|
|
61
|
+
* User name value.
|
|
62
|
+
*/
|
|
63
|
+
username?: string;
|
|
64
|
+
/**
|
|
65
|
+
* User password value.
|
|
66
|
+
*/
|
|
67
|
+
password?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Authorization domain
|
|
70
|
+
*/
|
|
71
|
+
domain: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated
|
|
76
|
+
*/
|
|
77
|
+
export interface DigestAuthorization {
|
|
78
|
+
username?: string;
|
|
79
|
+
password?: string;
|
|
80
|
+
realm: string;
|
|
81
|
+
nonce: string;
|
|
82
|
+
uri: string;
|
|
83
|
+
qop: string;
|
|
84
|
+
opaque: string;
|
|
85
|
+
response: string;
|
|
86
|
+
nc: string | number;
|
|
87
|
+
cnonce: string;
|
|
88
|
+
algorithm: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated
|
|
93
|
+
*/
|
|
94
|
+
export interface OAuth1Authorization {
|
|
95
|
+
consumerKey: string;
|
|
96
|
+
consumerSecret: string;
|
|
97
|
+
token: string;
|
|
98
|
+
tokenSecret: string;
|
|
99
|
+
timestamp: string | number;
|
|
100
|
+
nonce: string;
|
|
101
|
+
realm: string;
|
|
102
|
+
signatureMethod: string;
|
|
103
|
+
requestTokenUri: string;
|
|
104
|
+
accessTokenUri: string;
|
|
105
|
+
redirectUri: string;
|
|
106
|
+
authParamsLocation: string;
|
|
107
|
+
authTokenMethod: string;
|
|
108
|
+
authorizationUri: string;
|
|
109
|
+
type: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Client Certificate Authorization
|
|
114
|
+
* @deprecated
|
|
115
|
+
*/
|
|
116
|
+
export interface CCAuthorization {
|
|
117
|
+
/**
|
|
118
|
+
* The ID of the certificate to use.
|
|
119
|
+
* Because the certificates are stored by the application
|
|
120
|
+
* this configuration only returns an ID of the certificate
|
|
121
|
+
* to use when making the request.
|
|
122
|
+
*/
|
|
123
|
+
id: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface OAuth2CustomParameter {
|
|
127
|
+
/**
|
|
128
|
+
* The name of the parameter
|
|
129
|
+
*/
|
|
130
|
+
name: string;
|
|
131
|
+
/**
|
|
132
|
+
* The value of the parameter. It is ALWAYS a string.
|
|
133
|
+
*/
|
|
134
|
+
value: string;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @deprecated
|
|
139
|
+
*/
|
|
140
|
+
export interface OAuth2TokenRequestCustomData {
|
|
141
|
+
/**
|
|
142
|
+
* The query parameters to use with the token request
|
|
143
|
+
*/
|
|
144
|
+
parameters?: OAuth2CustomParameter[];
|
|
145
|
+
/**
|
|
146
|
+
* The headers to use with the token request
|
|
147
|
+
*/
|
|
148
|
+
headers?: OAuth2CustomParameter[];
|
|
149
|
+
/**
|
|
150
|
+
* The body parameters to use with the token request.
|
|
151
|
+
* This is x-www-urlencoded parameters to be added to the message.
|
|
152
|
+
*/
|
|
153
|
+
body?: OAuth2CustomParameter[];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @deprecated
|
|
158
|
+
*/
|
|
159
|
+
export interface OAuth2AuthorizationRequestCustomData {
|
|
160
|
+
/**
|
|
161
|
+
* The query parameters to add to the authorization URI
|
|
162
|
+
*/
|
|
163
|
+
parameters?: OAuth2CustomParameter[];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @deprecated
|
|
168
|
+
*/
|
|
169
|
+
export interface OAuth2CustomData {
|
|
170
|
+
/**
|
|
171
|
+
* The custom data to set on the authorization URI when opening the auth popup.
|
|
172
|
+
*/
|
|
173
|
+
auth?: OAuth2AuthorizationRequestCustomData;
|
|
174
|
+
/**
|
|
175
|
+
* The custom data to be set on the token request.
|
|
176
|
+
*/
|
|
177
|
+
token?: OAuth2TokenRequestCustomData;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @deprecated
|
|
182
|
+
*/
|
|
183
|
+
interface BaseOAuth2Authorization {
|
|
184
|
+
/**
|
|
185
|
+
* OAuth flow with `interactive` option set to `false` allows to quietly request for the token from the cache or form the authorization server
|
|
186
|
+
* without notifying the user (without bringing the authorization pop-up).
|
|
187
|
+
*
|
|
188
|
+
* This is to be used to check if valid session exists for current user and update the UI accordingly.
|
|
189
|
+
*/
|
|
190
|
+
interactive?: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* List of scopes to be used with the token request.
|
|
193
|
+
* This parameter is not required per OAuth2 spec.
|
|
194
|
+
*/
|
|
195
|
+
scopes?: string[];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* OAuth 2 configuration object used in API Client and API Components.
|
|
200
|
+
* @deprecated
|
|
201
|
+
*/
|
|
202
|
+
export interface OAuth2Authorization extends BaseOAuth2Authorization {
|
|
203
|
+
/**
|
|
204
|
+
* The grant type of the OAuth 2 flow.
|
|
205
|
+
*
|
|
206
|
+
* Can be:
|
|
207
|
+
* - implicit - deprecated and legacy
|
|
208
|
+
* - authorization_code
|
|
209
|
+
* - password - deprecated and legacy
|
|
210
|
+
* - client_credentials
|
|
211
|
+
* - refresh_token
|
|
212
|
+
* - any custom grant supported by the authorization server
|
|
213
|
+
*/
|
|
214
|
+
grantType?: 'implicit' | 'authorization_code' | 'password' | 'client_credentials' | 'refresh_token' | string;
|
|
215
|
+
/**
|
|
216
|
+
* Optional value to set on the `response_type` parameter.
|
|
217
|
+
*/
|
|
218
|
+
responseType?: string;
|
|
219
|
+
/**
|
|
220
|
+
* The client ID registered in the OAuth2 provider.
|
|
221
|
+
*/
|
|
222
|
+
clientId?: string;
|
|
223
|
+
/**
|
|
224
|
+
* The client ID registered in the OAuth2 provider.
|
|
225
|
+
* This value is not required for select grant types.
|
|
226
|
+
*/
|
|
227
|
+
clientSecret?: string;
|
|
228
|
+
/**
|
|
229
|
+
* The user authorization URI as defined by the authorization server.
|
|
230
|
+
* This is required for the `implicit` and `authorization_code` grant types
|
|
231
|
+
*/
|
|
232
|
+
authorizationUri?: string;
|
|
233
|
+
/**
|
|
234
|
+
* The token request URI as defined by the authorization server.
|
|
235
|
+
* This is not required for the `implicit` grant type
|
|
236
|
+
*/
|
|
237
|
+
accessTokenUri?: string;
|
|
238
|
+
/**
|
|
239
|
+
* The user redirect URI as configured in the authorization server.
|
|
240
|
+
* This is required for the `implicit` and `authorization_code` grant types.
|
|
241
|
+
*/
|
|
242
|
+
redirectUri?: string;
|
|
243
|
+
/**
|
|
244
|
+
* Required for the `password` grant type
|
|
245
|
+
*/
|
|
246
|
+
username?: string;
|
|
247
|
+
/**
|
|
248
|
+
* Required for the `password` grant type
|
|
249
|
+
*/
|
|
250
|
+
password?: string;
|
|
251
|
+
/**
|
|
252
|
+
* The state parameter as defined in the OAuth2 spec.
|
|
253
|
+
* The state is returned back with the token response.
|
|
254
|
+
*/
|
|
255
|
+
state?: string;
|
|
256
|
+
/**
|
|
257
|
+
* Additional data defined outside the scope of the OAuth2 protocol to be set
|
|
258
|
+
* on both authorization and token requests.
|
|
259
|
+
*/
|
|
260
|
+
customData?: OAuth2CustomData;
|
|
261
|
+
/**
|
|
262
|
+
* This is not a standard OAuth 2 parameter.
|
|
263
|
+
* Used by Google's oauth 2 server to include already granted to this app
|
|
264
|
+
* scopes to the list of this scopes.
|
|
265
|
+
*/
|
|
266
|
+
includeGrantedScopes?: boolean;
|
|
267
|
+
/**
|
|
268
|
+
* This is not a standard OAuth 2 parameter.
|
|
269
|
+
* Used by Google's oauth 2 server. It's the user email, when known.
|
|
270
|
+
*/
|
|
271
|
+
loginHint?: string;
|
|
272
|
+
/**
|
|
273
|
+
* When set the `authorization_code` will use the PKCE extension of the OAuth2
|
|
274
|
+
* to perform the authorization. Default to `false`.
|
|
275
|
+
* This is only relevant when the `authorization_code` grant type is used.
|
|
276
|
+
*/
|
|
277
|
+
pkce?: boolean;
|
|
278
|
+
/**
|
|
279
|
+
* The access token type. Default to `Bearer`
|
|
280
|
+
*/
|
|
281
|
+
tokenType?: string;
|
|
282
|
+
/**
|
|
283
|
+
* The last access token received from the authorization server.
|
|
284
|
+
* This is optional and indicates that the token has been already received.
|
|
285
|
+
* This property should not be stored anywhere.
|
|
286
|
+
*/
|
|
287
|
+
accessToken?: string;
|
|
288
|
+
/**
|
|
289
|
+
* Informs about what filed of the authenticated request the token property should be set.
|
|
290
|
+
* By default the value is `header` which corresponds to the `authorization` by default,
|
|
291
|
+
* but it is configured by the `deliveryName` property.
|
|
292
|
+
*
|
|
293
|
+
* This can be used by the AMF model when the API spec defines where the access token should be
|
|
294
|
+
* put in the authenticated request.
|
|
295
|
+
*
|
|
296
|
+
* @default header
|
|
297
|
+
*/
|
|
298
|
+
deliveryMethod?: OAuth2DeliveryMethod;
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* The name of the authenticated request property that carries the token.
|
|
302
|
+
* By default it is `authorization` which corresponds to `header` value of the `deliveryMethod` property.
|
|
303
|
+
*
|
|
304
|
+
* By setting both `deliveryMethod` and `deliveryName` you instruct the application (assuming it reads this values)
|
|
305
|
+
* where to put the authorization token.
|
|
306
|
+
*
|
|
307
|
+
* @default authorization
|
|
308
|
+
*/
|
|
309
|
+
deliveryName?: string;
|
|
310
|
+
/**
|
|
311
|
+
* The assertion parameter for the JWT token authorization.
|
|
312
|
+
*
|
|
313
|
+
* @link https://datatracker.ietf.org/doc/html/rfc7523#section-2.1
|
|
314
|
+
*/
|
|
315
|
+
assertion?: string;
|
|
316
|
+
/**
|
|
317
|
+
* The device_code parameter for the device code authorization.
|
|
318
|
+
*
|
|
319
|
+
* @link https://datatracker.ietf.org/doc/html/rfc8628#section-3.4
|
|
320
|
+
*/
|
|
321
|
+
deviceCode?: string;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* @deprecated
|
|
326
|
+
*/
|
|
327
|
+
export type OAuth2DeliveryMethod = 'header' | 'query' | 'body';
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Options for removing the OAuth 2 token from the cache.
|
|
331
|
+
* @deprecated
|
|
332
|
+
*/
|
|
333
|
+
export interface TokenRemoveOptions {
|
|
334
|
+
/**
|
|
335
|
+
* The client id used to issue the token.
|
|
336
|
+
*/
|
|
337
|
+
clientId: string;
|
|
338
|
+
/**
|
|
339
|
+
* The authorization URI used to issue the token.
|
|
340
|
+
* For the request that do not have `authorizationUrl` a value for
|
|
341
|
+
* `accessTokenUri` should be used.
|
|
342
|
+
*/
|
|
343
|
+
authorizationUri: string;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* @deprecated
|
|
348
|
+
*/
|
|
349
|
+
interface TokenBase {
|
|
350
|
+
/**
|
|
351
|
+
* Whether the token request was marked as interactive.
|
|
352
|
+
*/
|
|
353
|
+
interactive?: boolean;
|
|
354
|
+
/**
|
|
355
|
+
* The request state parameter, if used with the request.
|
|
356
|
+
*/
|
|
357
|
+
state: string;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* OAuth 2 token response object.
|
|
362
|
+
* @deprecated
|
|
363
|
+
*/
|
|
364
|
+
export interface TokenInfo extends TokenBase {
|
|
365
|
+
/**
|
|
366
|
+
* The access token.
|
|
367
|
+
*/
|
|
368
|
+
accessToken: string;
|
|
369
|
+
/**
|
|
370
|
+
* The access token type.
|
|
371
|
+
*/
|
|
372
|
+
tokenType?: string;
|
|
373
|
+
/**
|
|
374
|
+
* Access token expiration timeout.
|
|
375
|
+
*/
|
|
376
|
+
expiresIn: number;
|
|
377
|
+
/**
|
|
378
|
+
* Access token expiration timestamp
|
|
379
|
+
*/
|
|
380
|
+
expiresAt: number;
|
|
381
|
+
/**
|
|
382
|
+
* When `true` the `expires_in` and `expires_at` are assumed values (1 hour).
|
|
383
|
+
*/
|
|
384
|
+
expiresAssumed?: boolean;
|
|
385
|
+
/**
|
|
386
|
+
* The list of scopes the token has been granted
|
|
387
|
+
*/
|
|
388
|
+
scope?: string[];
|
|
389
|
+
/**
|
|
390
|
+
* The refresh token, when requested
|
|
391
|
+
*/
|
|
392
|
+
refreshToken?: string;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* @deprecated
|
|
397
|
+
*/
|
|
398
|
+
interface OidcToken {
|
|
399
|
+
/**
|
|
400
|
+
* The response type of the token.
|
|
401
|
+
*/
|
|
402
|
+
responseType: string;
|
|
403
|
+
/**
|
|
404
|
+
* The state passed by the authorization server,
|
|
405
|
+
*/
|
|
406
|
+
state: string;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* @deprecated
|
|
411
|
+
*/
|
|
412
|
+
export interface OidcTokenInfo extends OidcToken {
|
|
413
|
+
/**
|
|
414
|
+
* The timestamp when the token response was read.
|
|
415
|
+
* With the combination with `expiresIn` this tells when the token
|
|
416
|
+
* expires +- few seconds (depending onm the network).
|
|
417
|
+
*/
|
|
418
|
+
time: number;
|
|
419
|
+
/**
|
|
420
|
+
* The received access token.
|
|
421
|
+
*/
|
|
422
|
+
accessToken?: string;
|
|
423
|
+
/**
|
|
424
|
+
* The received refresh token.
|
|
425
|
+
*/
|
|
426
|
+
refreshToken?: string;
|
|
427
|
+
/**
|
|
428
|
+
* The received ID token.
|
|
429
|
+
*/
|
|
430
|
+
idToken?: string;
|
|
431
|
+
/**
|
|
432
|
+
* The received from the authorization server code.
|
|
433
|
+
* The code has no use as it probably was exchanged for the token,
|
|
434
|
+
* which invalidates the code.
|
|
435
|
+
*/
|
|
436
|
+
code?: string;
|
|
437
|
+
/**
|
|
438
|
+
* The received from the authorization server token type
|
|
439
|
+
*/
|
|
440
|
+
tokenType?: string;
|
|
441
|
+
/**
|
|
442
|
+
* The received from the authorization server expires_in parameter.
|
|
443
|
+
*/
|
|
444
|
+
expiresIn?: number;
|
|
445
|
+
/**
|
|
446
|
+
* The received from the authorization server scope parameter processed to an array.
|
|
447
|
+
*/
|
|
448
|
+
scope?: string[];
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* @deprecated
|
|
453
|
+
*/
|
|
454
|
+
export interface OidcTokenError extends OidcToken {
|
|
455
|
+
/**
|
|
456
|
+
* Whether the token has error when processing it. This is the error message to render to the user.
|
|
457
|
+
*/
|
|
458
|
+
errorDescription?: string;
|
|
459
|
+
/**
|
|
460
|
+
* Whether the token has error when processing it. This is the error code received from the server.
|
|
461
|
+
*/
|
|
462
|
+
error?: string;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* @deprecated
|
|
467
|
+
*/
|
|
468
|
+
export interface Oauth2GrantType {
|
|
469
|
+
type: string;
|
|
470
|
+
label: string;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* @deprecated
|
|
475
|
+
*/
|
|
476
|
+
export interface Oauth2ResponseType {
|
|
477
|
+
type: string;
|
|
478
|
+
label: string;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* OpenID Connect configuration object used in API Client and API Components.
|
|
483
|
+
* @deprecated
|
|
484
|
+
*/
|
|
485
|
+
export interface OidcAuthorization extends OAuth2Authorization {
|
|
486
|
+
/**
|
|
487
|
+
* The URL of the issuer for discovery.
|
|
488
|
+
*/
|
|
489
|
+
issuerUri?: string;
|
|
490
|
+
/**
|
|
491
|
+
* The list of mist recent tokens requested from the auth server.
|
|
492
|
+
*/
|
|
493
|
+
tokens?: (OidcTokenInfo | OidcTokenError)[];
|
|
494
|
+
/**
|
|
495
|
+
* The array index of the token to be used with HTTP request.
|
|
496
|
+
*/
|
|
497
|
+
tokenInUse?: number;
|
|
498
|
+
/**
|
|
499
|
+
* The list of response types supported by the authorization server.
|
|
500
|
+
* Optional, used to restore state.
|
|
501
|
+
*/
|
|
502
|
+
supportedResponses?: Oauth2ResponseType[][];
|
|
503
|
+
/**
|
|
504
|
+
* The list of grant types supported by the authorization server.
|
|
505
|
+
* Optional, used to restore state.
|
|
506
|
+
*/
|
|
507
|
+
grantTypes?: Oauth2GrantType[];
|
|
508
|
+
/**
|
|
509
|
+
* The list of scopes supported by the authorization server.
|
|
510
|
+
* Optional, used to restore state.
|
|
511
|
+
*/
|
|
512
|
+
serverScopes?: string[];
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Token response object.
|
|
517
|
+
* @deprecated
|
|
518
|
+
*/
|
|
519
|
+
export interface TokenError {
|
|
520
|
+
/**
|
|
521
|
+
* The error message
|
|
522
|
+
*/
|
|
523
|
+
message: string;
|
|
524
|
+
/**
|
|
525
|
+
* One of the application error codes.
|
|
526
|
+
*/
|
|
527
|
+
code: string;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* @deprecated
|
|
532
|
+
*/
|
|
533
|
+
export interface AuthorizationParams {
|
|
534
|
+
header?: Record<string, string>;
|
|
535
|
+
query?: Record<string, string>;
|
|
536
|
+
path?: Record<string, string>;
|
|
537
|
+
cookie?: Record<string, string>;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Authorization configuration for OAS' APiKey
|
|
542
|
+
* @deprecated
|
|
543
|
+
*/
|
|
544
|
+
export interface ApiKeyAuthorization extends AuthorizationParams {
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Authorization configuration for the PassThrough authorization
|
|
549
|
+
* @deprecated
|
|
550
|
+
*/
|
|
551
|
+
export interface PassThroughAuthorization {
|
|
552
|
+
/**
|
|
553
|
+
* List of headers to apply to the request
|
|
554
|
+
*/
|
|
555
|
+
header?: Record<string, string>;
|
|
556
|
+
/**
|
|
557
|
+
* List of query parameters to apply to the request
|
|
558
|
+
*/
|
|
559
|
+
query?: Record<string, string>;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Authorization configuration for RAML's custom scheme
|
|
564
|
+
* @deprecated
|
|
565
|
+
*/
|
|
566
|
+
export interface RamlCustomAuthorization extends PassThroughAuthorization {
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* @deprecated
|
|
571
|
+
*/
|
|
572
|
+
export type AuthorizationSettingsUnion = LegacyAuth | BasicAuthorization | BearerAuthorization | NtlmAuthorization | DigestAuthorization | OAuth1Authorization | OAuth2Authorization | CCAuthorization | ApiKeyAuthorization | PassThroughAuthorization | RamlCustomAuthorization;
|