@api-client/core 0.3.10 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/browser.d.ts +7 -6
- package/build/browser.js +5 -8
- package/build/browser.js.map +1 -1
- package/build/index.d.ts +8 -7
- package/build/index.js +6 -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/Application.d.ts +19 -0
- package/build/src/models/Application.js +2 -0
- package/build/src/models/Application.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/HistoryIndex.d.ts +3 -1
- package/build/src/models/HistoryIndex.js +3 -0
- package/build/src/models/HistoryIndex.js.map +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 +113 -0
- package/build/src/models/HttpHistory.js +186 -0
- package/build/src/models/HttpHistory.js.map +1 -0
- 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 +6 -8
- package/build/src/models/RequestLog.js +4 -6
- 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/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/StoreSdk.js +4 -2
- package/build/src/runtime/store/StoreSdk.js.map +1 -1
- package/package.json +3 -3
- 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/Application.ts +19 -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/HistoryIndex.ts +6 -1
- package/src/models/HostRule.ts +5 -5
- package/src/models/HttpHistory.ts +229 -0
- 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 +8 -10
- 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/RequestFactory.ts +3 -3
- package/src/runtime/reporters/ProjectRunCliReporter.ts +2 -2
- package/src/runtime/reporters/Reporter.ts +4 -4
- package/src/runtime/store/StoreSdk.ts +4 -4
- package/build/src/models/ArcResponse.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/src/models/HistoryRequest.ts +0 -28
- package/src/runtime/http-engine/NodeEngine.ts +0 -792
- package/src/runtime/http-engine/NodeEngineDirect.ts +0 -482
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A definition if an application.
|
|
3
|
+
*/
|
|
4
|
+
export interface IApplication {
|
|
5
|
+
/**
|
|
6
|
+
* The unique code identifying the application in the ecosystem.
|
|
7
|
+
* For example, `api-client` application has its own code reported through this property.
|
|
8
|
+
* This is not generated per instance but per application.
|
|
9
|
+
*/
|
|
10
|
+
code: string;
|
|
11
|
+
/**
|
|
12
|
+
* Application display name.
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* The current version of the application.
|
|
17
|
+
*/
|
|
18
|
+
version: string;
|
|
19
|
+
}
|
|
@@ -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);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
export const Kind = 'Core#HistoryIndex';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
|
-
* An object that is stored in
|
|
4
|
+
* An object that is stored in API Client's internal store to build history navigation.
|
|
3
5
|
* It does not contain all the history data. Just the ones that are presented in the UI.
|
|
4
6
|
*/
|
|
5
7
|
export interface IHistoryIndex {
|
|
8
|
+
kind: typeof Kind;
|
|
6
9
|
/**
|
|
7
10
|
* Timestamp when the request was last updated.
|
|
8
11
|
*/
|
|
@@ -47,6 +50,7 @@ export class HistoryIndex {
|
|
|
47
50
|
init = input;
|
|
48
51
|
} else {
|
|
49
52
|
init = {
|
|
53
|
+
kind: Kind,
|
|
50
54
|
updated: 0,
|
|
51
55
|
midnight: 0,
|
|
52
56
|
url: '',
|
|
@@ -66,6 +70,7 @@ export class HistoryIndex {
|
|
|
66
70
|
|
|
67
71
|
toJSON(): IHistoryIndex {
|
|
68
72
|
const result: IHistoryIndex = {
|
|
73
|
+
kind: Kind,
|
|
69
74
|
updated: this.updated,
|
|
70
75
|
midnight: this.midnight,
|
|
71
76
|
url: this.url,
|
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 {
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { IRequestLog, RequestLog, Kind as RequestLogKind } from './RequestLog.js';
|
|
2
|
+
|
|
3
|
+
export const Kind = 'Core#HttpHistory';
|
|
4
|
+
export const createdSymbol = Symbol('created');
|
|
5
|
+
export const midnightSymbol = Symbol('midnight');
|
|
6
|
+
|
|
7
|
+
export interface IHttpHistory {
|
|
8
|
+
kind: typeof Kind;
|
|
9
|
+
/**
|
|
10
|
+
* The data store key. Only present when the object was already inserted into the data store.
|
|
11
|
+
* In majority of cases this value is set. It is not set when generating the history object before sending it to the store.
|
|
12
|
+
*
|
|
13
|
+
* Note for data store implementations. This must be a URL-safe value so the id should be encoded if needed.
|
|
14
|
+
*/
|
|
15
|
+
key?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional user space id. Must be set when the originating request belongs to a user space.
|
|
18
|
+
*/
|
|
19
|
+
space?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional project id. Must be set when the originating request belongs to a user space.
|
|
22
|
+
*/
|
|
23
|
+
project?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Optional application id. Must be set when the application that created this record does not use the concept of a user space.
|
|
26
|
+
*/
|
|
27
|
+
app?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The user id that made that request.
|
|
30
|
+
* Note, the default API Client's store automatically adds the user information to the record overriding any pre-set user id.
|
|
31
|
+
*/
|
|
32
|
+
user: string;
|
|
33
|
+
/**
|
|
34
|
+
* The optional request id in the project that generated this log.
|
|
35
|
+
*/
|
|
36
|
+
request?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The request log.
|
|
39
|
+
*/
|
|
40
|
+
log: IRequestLog;
|
|
41
|
+
/**
|
|
42
|
+
* The timestamp when this history request has been created.
|
|
43
|
+
*/
|
|
44
|
+
created: number;
|
|
45
|
+
/**
|
|
46
|
+
* A timestamp of the midnight when the object was created
|
|
47
|
+
*/
|
|
48
|
+
midnight?: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* An HTTP history is an object containing an information of a request and response
|
|
53
|
+
* made with the application.
|
|
54
|
+
*
|
|
55
|
+
* Note, history object are not mutable. Can only be created or deleted.
|
|
56
|
+
*/
|
|
57
|
+
export class HttpHistory {
|
|
58
|
+
[createdSymbol]: number;
|
|
59
|
+
[midnightSymbol]: number;
|
|
60
|
+
kind = Kind;
|
|
61
|
+
/**
|
|
62
|
+
* The data store key. Only present when the object was already inserted into the data store.
|
|
63
|
+
* In majority of cases this value is set. It is not set when generating the history object before sending it to the store.
|
|
64
|
+
*
|
|
65
|
+
* Note for data store implementations. This must be a URL-safe value so the id should be encoded if needed.
|
|
66
|
+
*/
|
|
67
|
+
key?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Optional user space id. Must be set when the originating request belongs to a user space.
|
|
70
|
+
*/
|
|
71
|
+
space?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Optional project id. Must be set when the originating request belongs to a user space.
|
|
74
|
+
*/
|
|
75
|
+
project?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Optional application id. Must be set when the application that created this record does not use the concept of a user space.
|
|
78
|
+
*/
|
|
79
|
+
app?: string;
|
|
80
|
+
/**
|
|
81
|
+
* The user id that made that request.
|
|
82
|
+
* Note, the default API Client's store automatically adds the user information to the record overriding any pre-set user id.
|
|
83
|
+
*/
|
|
84
|
+
user = '';
|
|
85
|
+
/**
|
|
86
|
+
* The optional request id in the project that generated this log.
|
|
87
|
+
*/
|
|
88
|
+
request?: string;
|
|
89
|
+
/**
|
|
90
|
+
* The execution log of the HTTP request with a response.
|
|
91
|
+
*/
|
|
92
|
+
log: RequestLog = new RequestLog();
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @param value The timestamp when the request was created.
|
|
96
|
+
*/
|
|
97
|
+
set created(value: number | undefined) {
|
|
98
|
+
if (!value) {
|
|
99
|
+
this[createdSymbol] = Date.now();
|
|
100
|
+
} else {
|
|
101
|
+
this[createdSymbol] = value;
|
|
102
|
+
}
|
|
103
|
+
const d = new Date(this[createdSymbol]);
|
|
104
|
+
d.setHours(0, 0, 0, 0);
|
|
105
|
+
this[midnightSymbol] = d.getTime();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @returns The timestamp when the request was created.
|
|
110
|
+
*/
|
|
111
|
+
get created(): number {
|
|
112
|
+
return this[createdSymbol] || Date.now();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @param value The timestamp of the midnight when the request object was updated
|
|
117
|
+
*/
|
|
118
|
+
set midnight(value: number | undefined) {
|
|
119
|
+
if (!value) {
|
|
120
|
+
this[midnightSymbol] = this.defaultMidnight();
|
|
121
|
+
} else {
|
|
122
|
+
this[midnightSymbol] = value;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @returns The timestamp of the midnight when the request object was updated
|
|
128
|
+
*/
|
|
129
|
+
get midnight(): number {
|
|
130
|
+
if (this[midnightSymbol]) {
|
|
131
|
+
return this[midnightSymbol];
|
|
132
|
+
}
|
|
133
|
+
return this.defaultMidnight();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
constructor(input?: string|IHttpHistory) {
|
|
137
|
+
let init: IHttpHistory;
|
|
138
|
+
if (typeof input === 'string') {
|
|
139
|
+
init = JSON.parse(input);
|
|
140
|
+
} else if (typeof input === 'object') {
|
|
141
|
+
init = input;
|
|
142
|
+
} else {
|
|
143
|
+
const now:number = Date.now();
|
|
144
|
+
init = {
|
|
145
|
+
kind: Kind,
|
|
146
|
+
created: now,
|
|
147
|
+
user: '',
|
|
148
|
+
log: {
|
|
149
|
+
kind: RequestLogKind,
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
this.new(init);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
new(init: IHttpHistory): void {
|
|
157
|
+
const { log, created = Date.now(), midnight, space, project, request, user, key, app } = init;
|
|
158
|
+
this.log = new RequestLog(log);
|
|
159
|
+
this.created = created;
|
|
160
|
+
if (key) {
|
|
161
|
+
this.key = key;
|
|
162
|
+
} else {
|
|
163
|
+
this.key = undefined;
|
|
164
|
+
}
|
|
165
|
+
if (app) {
|
|
166
|
+
this.app = app;
|
|
167
|
+
} else {
|
|
168
|
+
this.app = undefined;
|
|
169
|
+
}
|
|
170
|
+
if (midnight) {
|
|
171
|
+
this.midnight = midnight;
|
|
172
|
+
}
|
|
173
|
+
if (space) {
|
|
174
|
+
this.space = space;
|
|
175
|
+
} else {
|
|
176
|
+
this.space = undefined;
|
|
177
|
+
}
|
|
178
|
+
if (project) {
|
|
179
|
+
this.project = project;
|
|
180
|
+
} else {
|
|
181
|
+
this.project = undefined;
|
|
182
|
+
}
|
|
183
|
+
if (request) {
|
|
184
|
+
this.request = request;
|
|
185
|
+
} else {
|
|
186
|
+
this.request = undefined;
|
|
187
|
+
}
|
|
188
|
+
if (user) {
|
|
189
|
+
this.user = user;
|
|
190
|
+
} else {
|
|
191
|
+
this.user = '';
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
toJSON(): IHttpHistory {
|
|
196
|
+
const result: IHttpHistory = {
|
|
197
|
+
kind: Kind,
|
|
198
|
+
created: this.created,
|
|
199
|
+
midnight: this.midnight,
|
|
200
|
+
log: this.log.toJSON(),
|
|
201
|
+
user: this.user,
|
|
202
|
+
};
|
|
203
|
+
if (this.key) {
|
|
204
|
+
result.key = this.key;
|
|
205
|
+
}
|
|
206
|
+
if (this.space) {
|
|
207
|
+
result.space = this.space;
|
|
208
|
+
}
|
|
209
|
+
if (this.project) {
|
|
210
|
+
result.project = this.project;
|
|
211
|
+
}
|
|
212
|
+
if (this.request) {
|
|
213
|
+
result.request = this.request;
|
|
214
|
+
}
|
|
215
|
+
if (this.app) {
|
|
216
|
+
result.app = this.app;
|
|
217
|
+
}
|
|
218
|
+
return result;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @returns The default value for the midnight when the request was last updated.
|
|
223
|
+
*/
|
|
224
|
+
defaultMidnight(): number {
|
|
225
|
+
const d = new Date(this.created);
|
|
226
|
+
d.setHours(0, 0, 0, 0);
|
|
227
|
+
return d.getTime();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
@@ -14,8 +14,7 @@ import { ARCSavedRequest, ARCHistoryRequest } from './legacy/request/ArcRequest.
|
|
|
14
14
|
import { ArcLegacyProject, ARCProject } from './legacy/models/ArcLegacyProject.js';
|
|
15
15
|
import { PostmanDataTransformer } from './transformers/PostmanDataTransformer.js';
|
|
16
16
|
|
|
17
|
-
export
|
|
18
|
-
export const Kind = 'ARC#HttpProject';
|
|
17
|
+
export const Kind = 'Core#HttpProject';
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* A list of options to initialize a project in various situations.
|
|
@@ -167,12 +166,12 @@ export interface IProjectRequestIterator {
|
|
|
167
166
|
}
|
|
168
167
|
|
|
169
168
|
/**
|
|
170
|
-
* The new definition of a project in
|
|
169
|
+
* The new definition of a project in API Client.
|
|
171
170
|
* Note, this is not the same as future `ApiProject` which is reserved for building APIs
|
|
172
171
|
* using RAML or OAS.
|
|
173
172
|
*/
|
|
174
173
|
export interface IHttpProject extends IProjectDefinitionProperty {
|
|
175
|
-
kind:
|
|
174
|
+
kind: typeof Kind;
|
|
176
175
|
/**
|
|
177
176
|
* The license information for this HTTP project.
|
|
178
177
|
*/
|
|
@@ -340,11 +339,11 @@ export class HttpProject extends ProjectParent {
|
|
|
340
339
|
/**
|
|
341
340
|
* Creates a new project definition clearing anything that is so far defined.
|
|
342
341
|
*
|
|
343
|
-
* Note, this throws an error when the project is not an
|
|
342
|
+
* Note, this throws an error when the project is not an API Client project.
|
|
344
343
|
*/
|
|
345
344
|
new(init: IHttpProject): void {
|
|
346
345
|
if (!init || !init.definitions || !init.items) {
|
|
347
|
-
throw new Error(`Not
|
|
346
|
+
throw new Error(`Not a project.`);
|
|
348
347
|
}
|
|
349
348
|
const { key = v4(), definitions = {}, items, info, license, provider, environments } = init;
|
|
350
349
|
this.key = key;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SerializablePayload } from './SerializablePayload.js';
|
|
2
2
|
import { Payload } from '../lib/transformers/PayloadSerializer.js';
|
|
3
3
|
|
|
4
|
-
export const Kind = '
|
|
4
|
+
export const Kind = 'Core#HttpRequest';
|
|
5
5
|
|
|
6
6
|
export interface IBaseHttpRequest {
|
|
7
7
|
/**
|
|
@@ -85,7 +85,7 @@ export class HttpRequest extends SerializablePayload {
|
|
|
85
85
|
/**
|
|
86
86
|
* Creates a new request clearing anything that is so far defined.
|
|
87
87
|
*
|
|
88
|
-
* Note, this throws an error when the object is not
|
|
88
|
+
* Note, this throws an error when the object is not a request.
|
|
89
89
|
*/
|
|
90
90
|
new(init: IHttpRequest): void {
|
|
91
91
|
const { url, method='GET', headers, payload, kind = Kind } = init;
|