@opra/client 0.27.0 → 0.28.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/browser.js +400 -295
- package/cjs/constants.js +2 -1
- package/cjs/core/backend.js +9 -0
- package/cjs/core/client-base.js +18 -0
- package/cjs/http/fetch-backend.js +210 -0
- package/cjs/http/http-backend.js +15 -0
- package/cjs/http/http-client-base.js +64 -0
- package/cjs/http/http-client.js +19 -0
- package/cjs/{impl/collection-node.js → http/http-collection-node.js} +9 -9
- package/cjs/http/http-fetch-client.js +19 -0
- package/cjs/http/http-interceptor-handler.js +18 -0
- package/cjs/http/http-request-observable.js +135 -0
- package/cjs/{impl → http}/http-response.js +1 -0
- package/cjs/{impl → http}/http-service-base.js +1 -1
- package/cjs/{impl/singleton-node.js → http/http-singleton-node.js} +6 -6
- package/cjs/{interfaces/http-event.interface.js → http/interfaces/http-event.js} +9 -10
- package/cjs/index.js +19 -12
- package/cjs/types.js +1 -0
- package/esm/constants.js +1 -0
- package/esm/core/backend.js +5 -0
- package/esm/core/client-base.js +14 -0
- package/esm/http/fetch-backend.js +205 -0
- package/esm/http/http-backend.js +11 -0
- package/esm/http/http-client-base.js +60 -0
- package/esm/http/http-client.js +15 -0
- package/esm/{impl/collection-node.js → http/http-collection-node.js} +9 -9
- package/esm/http/http-fetch-client.js +15 -0
- package/esm/http/http-interceptor-handler.js +14 -0
- package/esm/http/http-request-observable.js +130 -0
- package/esm/{impl → http}/http-response.js +1 -0
- package/esm/{impl → http}/http-service-base.js +1 -1
- package/esm/{impl/singleton-node.js → http/http-singleton-node.js} +6 -6
- package/esm/{interfaces/http-event.interface.js → http/interfaces/http-event.js} +9 -10
- package/esm/index.js +17 -11
- package/esm/types.js +1 -0
- package/package.json +7 -7
- package/types/constants.d.ts +1 -0
- package/types/core/backend.d.ts +18 -0
- package/types/core/client-base.d.ts +21 -0
- package/types/http/fetch-backend.d.ts +42 -0
- package/types/http/http-backend.d.ts +27 -0
- package/types/http/http-client-base.d.ts +31 -0
- package/types/http/http-client.d.ts +12 -0
- package/types/{impl/collection-node.d.ts → http/http-collection-node.d.ts} +11 -11
- package/types/http/http-fetch-client.d.ts +12 -0
- package/types/http/http-interceptor-handler.d.ts +11 -0
- package/types/http/http-request-observable.d.ts +35 -0
- package/types/{impl → http}/http-response.d.ts +0 -1
- package/types/{impl → http}/http-service-base.d.ts +1 -1
- package/types/{impl/singleton-node.d.ts → http/http-singleton-node.d.ts} +8 -8
- package/types/http/interfaces/http-event.d.ts +108 -0
- package/types/http/interfaces/http-handler.d.ts +7 -0
- package/types/http/interfaces/http-interceptor.d.ts +8 -0
- package/types/index.d.ts +17 -11
- package/types/types.d.ts +0 -4
- package/cjs/client.js +0 -83
- package/cjs/enums/index.js +0 -4
- package/cjs/impl/http-request-observable.js +0 -248
- package/cjs/impl/http-request.js +0 -28
- package/cjs/interfaces/index.js +0 -5
- package/esm/client.js +0 -79
- package/esm/enums/index.js +0 -1
- package/esm/impl/http-request-observable.js +0 -243
- package/esm/impl/http-request.js +0 -24
- package/esm/interfaces/index.js +0 -2
- package/types/client.d.ts +0 -33
- package/types/enums/index.d.ts +0 -1
- package/types/impl/http-request-observable.d.ts +0 -46
- package/types/impl/http-request.d.ts +0 -71
- package/types/interfaces/client-context.interface.d.ts +0 -13
- package/types/interfaces/http-event.interface.d.ts +0 -88
- package/types/interfaces/http-request-defaults.interface.d.ts +0 -6
- package/types/interfaces/index.d.ts +0 -2
- /package/cjs/{client-error.js → core/client-error.js} +0 -0
- /package/cjs/{enums → http/enums}/http-observable-type.enum.js +0 -0
- /package/cjs/{interfaces/client-context.interface.js → http/interfaces/http-handler.js} +0 -0
- /package/cjs/{interfaces/http-request-defaults.interface.js → http/interfaces/http-interceptor.js} +0 -0
- /package/esm/{client-error.js → core/client-error.js} +0 -0
- /package/esm/{enums → http/enums}/http-observable-type.enum.js +0 -0
- /package/esm/{interfaces/client-context.interface.js → http/interfaces/http-handler.js} +0 -0
- /package/esm/{interfaces/http-request-defaults.interface.js → http/interfaces/http-interceptor.js} +0 -0
- /package/types/{client-error.d.ts → core/client-error.d.ts} +0 -0
- /package/types/{enums → http/enums}/http-observable-type.enum.d.ts +0 -0
package/browser.js
CHANGED
|
@@ -6,24 +6,35 @@
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
7
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
8
|
|
|
9
|
-
// ../../build/client/esm/
|
|
10
|
-
|
|
9
|
+
// ../../build/client/esm/core/backend.js
|
|
10
|
+
var Backend = class {
|
|
11
|
+
static {
|
|
12
|
+
__name(this, "Backend");
|
|
13
|
+
}
|
|
14
|
+
constructor(options) {
|
|
15
|
+
this.api = options?.api;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
11
18
|
|
|
12
19
|
// ../../build/client/esm/constants.js
|
|
13
20
|
var kClient = Symbol.for("kClient");
|
|
21
|
+
var kBackend = Symbol.for("kBackend");
|
|
14
22
|
var kContext = Symbol.for("kContext");
|
|
15
23
|
|
|
16
|
-
// ../../build/client/esm/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
// ../../build/client/esm/core/client-base.js
|
|
25
|
+
var ClientBase = class {
|
|
26
|
+
static {
|
|
27
|
+
__name(this, "ClientBase");
|
|
28
|
+
}
|
|
29
|
+
constructor(backend) {
|
|
30
|
+
Object.defineProperty(this, kBackend, {
|
|
31
|
+
enumerable: false,
|
|
32
|
+
value: backend
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
25
36
|
|
|
26
|
-
// ../../build/client/esm/client-error.js
|
|
37
|
+
// ../../build/client/esm/core/client-error.js
|
|
27
38
|
var ClientError = class extends Error {
|
|
28
39
|
static {
|
|
29
40
|
__name(this, "ClientError");
|
|
@@ -41,257 +52,218 @@ var ClientError = class extends Error {
|
|
|
41
52
|
}
|
|
42
53
|
};
|
|
43
54
|
|
|
44
|
-
// ../../build/client/esm/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
HttpObserveType2["Body"] = "body";
|
|
50
|
-
HttpObserveType2["Events"] = "events";
|
|
51
|
-
})(HttpObserveType || (HttpObserveType = {}));
|
|
52
|
-
|
|
53
|
-
// ../../build/client/esm/interfaces/http-event.interface.js
|
|
54
|
-
var HttpEventType;
|
|
55
|
-
(function(HttpEventType2) {
|
|
56
|
-
HttpEventType2["Sent"] = "sent";
|
|
57
|
-
HttpEventType2["UploadProgress"] = "upload-progress";
|
|
58
|
-
HttpEventType2["ResponseHeader"] = "response-header";
|
|
59
|
-
HttpEventType2["DownloadProgress"] = "download-progress";
|
|
60
|
-
HttpEventType2["Response"] = "response";
|
|
61
|
-
HttpEventType2["Custom"] = "custom";
|
|
62
|
-
})(HttpEventType || (HttpEventType = {}));
|
|
55
|
+
// ../../build/client/esm/http/fetch-backend.js
|
|
56
|
+
import { Observable } from "rxjs";
|
|
57
|
+
import { isReadableStreamLike } from "rxjs/internal/util/isReadableStreamLike";
|
|
58
|
+
import typeIs from "@browsery/type-is";
|
|
59
|
+
import { isBlob } from "@opra/common";
|
|
63
60
|
|
|
64
|
-
// ../../build/client/esm/
|
|
65
|
-
|
|
66
|
-
var HttpRequest = class {
|
|
61
|
+
// ../../build/client/esm/http/http-backend.js
|
|
62
|
+
var HttpBackend = class extends Backend {
|
|
67
63
|
static {
|
|
68
|
-
__name(this, "
|
|
64
|
+
__name(this, "HttpBackend");
|
|
69
65
|
}
|
|
70
|
-
constructor(
|
|
71
|
-
|
|
72
|
-
this.
|
|
73
|
-
this.destination = init?.destination || "";
|
|
74
|
-
this.integrity = init?.integrity || "";
|
|
75
|
-
this.keepalive = init?.keepalive ?? false;
|
|
76
|
-
this.method = (init?.method || "GET").toUpperCase();
|
|
77
|
-
this.mode = init?.mode || "cors";
|
|
78
|
-
this.redirect = init?.redirect || "follow";
|
|
79
|
-
this.mode = init?.mode || "cors";
|
|
80
|
-
this.referrer = init?.referrer || "";
|
|
81
|
-
this.referrerPolicy = init?.referrerPolicy || "";
|
|
82
|
-
this.signal = init?.signal || new AbortController().signal;
|
|
83
|
-
this.body = init?.body;
|
|
84
|
-
this.url = init?.url instanceof OpraURL ? init.url : new OpraURL(init?.url);
|
|
85
|
-
this.headers = init?.headers instanceof Headers ? init.headers : new Headers(init?.headers);
|
|
66
|
+
constructor(serviceUrl, options) {
|
|
67
|
+
super(options);
|
|
68
|
+
this.serviceUrl = serviceUrl;
|
|
86
69
|
}
|
|
87
70
|
};
|
|
88
71
|
|
|
89
|
-
// ../../build/client/esm/
|
|
90
|
-
var
|
|
91
|
-
"cache",
|
|
92
|
-
"credentials",
|
|
93
|
-
"destination",
|
|
94
|
-
"headers",
|
|
95
|
-
"integrity",
|
|
96
|
-
"keepalive",
|
|
97
|
-
"mode",
|
|
98
|
-
"redirect",
|
|
99
|
-
"referrer",
|
|
100
|
-
"referrerPolicy"
|
|
101
|
-
];
|
|
102
|
-
var kIntlObservable = Symbol.for("kIntlObservable");
|
|
103
|
-
var HttpRequestObservable = class extends Observable {
|
|
72
|
+
// ../../build/client/esm/http/http-response.js
|
|
73
|
+
var HttpResponse = class _HttpResponse {
|
|
104
74
|
static {
|
|
105
|
-
__name(this, "
|
|
106
|
-
}
|
|
107
|
-
constructor(client, init) {
|
|
108
|
-
super((subscriber) => {
|
|
109
|
-
this[kIntlObservable].subscribe((event) => {
|
|
110
|
-
if (event.event === HttpEventType.Response) {
|
|
111
|
-
subscriber.next(event.response.body);
|
|
112
|
-
subscriber.complete();
|
|
113
|
-
}
|
|
114
|
-
}, (error) => subscriber.error(error), () => subscriber.complete());
|
|
115
|
-
});
|
|
116
|
-
Object.defineProperty(this, kClient, {
|
|
117
|
-
enumerable: false,
|
|
118
|
-
value: client
|
|
119
|
-
});
|
|
120
|
-
this.request = new HttpRequest(init);
|
|
121
|
-
if (init?.headers)
|
|
122
|
-
this.header(init.headers);
|
|
123
|
-
this[kIntlObservable] = this._send();
|
|
124
|
-
}
|
|
125
|
-
httpOptions(options) {
|
|
126
|
-
directCopyProperties.forEach((k) => {
|
|
127
|
-
if (options[k] !== void 0)
|
|
128
|
-
this.request[k] = options[k];
|
|
129
|
-
});
|
|
130
|
-
return this;
|
|
131
|
-
}
|
|
132
|
-
header(arg0, value) {
|
|
133
|
-
const headers = this.request.headers;
|
|
134
|
-
if (typeof arg0 === "object") {
|
|
135
|
-
const h = arg0 instanceof Headers ? arg0 : new Headers(arg0);
|
|
136
|
-
h.forEach((v, k) => {
|
|
137
|
-
if (k.toLowerCase() === "set-cookie") {
|
|
138
|
-
headers.append(k, v);
|
|
139
|
-
} else
|
|
140
|
-
headers.set(k, v);
|
|
141
|
-
});
|
|
142
|
-
return this;
|
|
143
|
-
}
|
|
144
|
-
if (value == null)
|
|
145
|
-
headers.delete(arg0);
|
|
146
|
-
else
|
|
147
|
-
headers.append(arg0, String(value));
|
|
148
|
-
return this;
|
|
149
|
-
}
|
|
150
|
-
param(arg0, value) {
|
|
151
|
-
const params = this.request.url.searchParams;
|
|
152
|
-
if (typeof arg0 === "object") {
|
|
153
|
-
const h = arg0 instanceof URLSearchParams ? arg0 : new URLSearchParams(arg0);
|
|
154
|
-
h.forEach((v, k) => params.set(k, v));
|
|
155
|
-
return this;
|
|
156
|
-
}
|
|
157
|
-
if (value == null)
|
|
158
|
-
params.delete(arg0);
|
|
159
|
-
else
|
|
160
|
-
params.set(arg0, String(value));
|
|
161
|
-
return this;
|
|
75
|
+
__name(this, "HttpResponse");
|
|
162
76
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
subscriber.complete();
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
if (event.event === HttpEventType.Response) {
|
|
177
|
-
const { response } = event;
|
|
178
|
-
const isOpraResponse = typeIs.is(event.response.contentType || "", ["application/opra+json"]);
|
|
179
|
-
if (observe === HttpObserveType.Response) {
|
|
180
|
-
subscriber.next(response);
|
|
181
|
-
subscriber.complete();
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
if (response.status >= 400 && response.status < 600) {
|
|
185
|
-
subscriber.error(new ClientError({
|
|
186
|
-
message: response.status + " " + response.statusText,
|
|
187
|
-
status: response.status,
|
|
188
|
-
issues: isOpraResponse ? response.body.errors : void 0
|
|
189
|
-
}));
|
|
190
|
-
subscriber.complete();
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
subscriber.next(event.response.body);
|
|
194
|
-
subscriber.complete();
|
|
195
|
-
}
|
|
196
|
-
}, (error) => subscriber.error(error), () => subscriber.complete());
|
|
197
|
-
});
|
|
77
|
+
constructor(init) {
|
|
78
|
+
this.hasBody = false;
|
|
79
|
+
this.headers = init?.headers instanceof Headers ? init?.headers : new Headers(init?.headers);
|
|
80
|
+
this.status = init?.status || 200;
|
|
81
|
+
this.statusText = init?.statusText || "OK";
|
|
82
|
+
this.url = init?.url || null;
|
|
83
|
+
this.ok = this.status >= 200 && this.status < 300;
|
|
84
|
+
this.body = init?.body;
|
|
85
|
+
this.hasBody = init?.body != null || !!init?.hasBody;
|
|
86
|
+
this.contentType = (this.headers.get("content-type") || "").split(";")[0];
|
|
198
87
|
}
|
|
199
|
-
|
|
200
|
-
return this
|
|
88
|
+
clone(update) {
|
|
89
|
+
return new _HttpResponse({ ...this, ...update });
|
|
201
90
|
}
|
|
202
|
-
|
|
203
|
-
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// ../../build/client/esm/http/interfaces/http-event.js
|
|
94
|
+
var HttpEventType;
|
|
95
|
+
(function(HttpEventType2) {
|
|
96
|
+
HttpEventType2["Sent"] = "Sent";
|
|
97
|
+
HttpEventType2["UploadProgress"] = "UploadProgress";
|
|
98
|
+
HttpEventType2["ResponseHeader"] = "ResponseHeader";
|
|
99
|
+
HttpEventType2["DownloadProgress"] = "DownloadProgress";
|
|
100
|
+
HttpEventType2["Response"] = "Response";
|
|
101
|
+
HttpEventType2["User"] = "User";
|
|
102
|
+
})(HttpEventType || (HttpEventType = {}));
|
|
103
|
+
|
|
104
|
+
// ../../build/client/esm/http/fetch-backend.js
|
|
105
|
+
var FetchBackend = class extends HttpBackend {
|
|
106
|
+
static {
|
|
107
|
+
__name(this, "FetchBackend");
|
|
204
108
|
}
|
|
205
|
-
|
|
206
|
-
|
|
109
|
+
constructor(serviceUrl, options) {
|
|
110
|
+
super(serviceUrl, options);
|
|
111
|
+
this.interceptors = Array.from(/* @__PURE__ */ new Set([...options?.interceptors || []]));
|
|
112
|
+
this.defaults = {
|
|
113
|
+
...options?.defaults,
|
|
114
|
+
headers: options?.defaults?.headers instanceof Headers ? options?.defaults?.headers : new Headers(options?.defaults?.headers),
|
|
115
|
+
params: options?.defaults?.params instanceof URLSearchParams ? options?.defaults?.params : new URLSearchParams(options?.defaults?.params)
|
|
116
|
+
};
|
|
207
117
|
}
|
|
208
|
-
|
|
209
|
-
const request = this.request;
|
|
210
|
-
const clientContext = this[kClient][kContext];
|
|
118
|
+
handle(init) {
|
|
211
119
|
return new Observable((subscriber) => {
|
|
212
120
|
(async () => {
|
|
213
|
-
this.
|
|
214
|
-
|
|
215
|
-
|
|
121
|
+
let request = this.prepareRequest(init);
|
|
122
|
+
if (request.body && init.reportProgress) {
|
|
123
|
+
const stream = request.body;
|
|
124
|
+
const contentLength = request.headers.get("content-length") || "0";
|
|
125
|
+
const total = parseInt(contentLength, 10) || 0;
|
|
126
|
+
let loaded = 0;
|
|
127
|
+
const progressTrackingStream = new TransformStream({
|
|
128
|
+
transform(chunk, controller) {
|
|
129
|
+
controller.enqueue(chunk);
|
|
130
|
+
loaded += chunk.byteLength;
|
|
131
|
+
subscriber.next({
|
|
132
|
+
type: HttpEventType.UploadProgress,
|
|
133
|
+
request,
|
|
134
|
+
total,
|
|
135
|
+
loaded
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
request = new Request(request.url, {
|
|
140
|
+
cache: request.cache,
|
|
141
|
+
credentials: request.credentials,
|
|
142
|
+
headers: request.headers,
|
|
143
|
+
integrity: request.integrity,
|
|
144
|
+
keepalive: request.keepalive,
|
|
145
|
+
method: request.method,
|
|
146
|
+
mode: request.mode,
|
|
147
|
+
redirect: request.redirect,
|
|
148
|
+
referrer: request.referrer,
|
|
149
|
+
referrerPolicy: request.referrerPolicy,
|
|
150
|
+
signal: request.signal,
|
|
151
|
+
body: stream.pipeThrough(progressTrackingStream),
|
|
152
|
+
window: init.window,
|
|
153
|
+
...{
|
|
154
|
+
// undici library requires
|
|
155
|
+
duplex: "half"
|
|
156
|
+
}
|
|
157
|
+
});
|
|
216
158
|
}
|
|
159
|
+
const fetchPromise = this.send(request);
|
|
217
160
|
subscriber.next({
|
|
218
161
|
request,
|
|
219
|
-
|
|
162
|
+
type: HttpEventType.Sent
|
|
220
163
|
});
|
|
221
|
-
const
|
|
222
|
-
const
|
|
223
|
-
const contentType = (fetchResponse.headers.get("content-type") || "").split(";")[0];
|
|
224
|
-
const headersResponse = clientContext.createResponse({
|
|
164
|
+
const fetchResponse = await fetchPromise;
|
|
165
|
+
const headersResponse = this.createResponse({
|
|
225
166
|
url: fetchResponse.url,
|
|
226
167
|
headers: fetchResponse.headers,
|
|
227
168
|
status: fetchResponse.status,
|
|
228
169
|
statusText: fetchResponse.statusText,
|
|
229
|
-
hasBody: !!fetchResponse.body
|
|
230
|
-
contentType
|
|
170
|
+
hasBody: !!fetchResponse.body
|
|
231
171
|
});
|
|
232
172
|
subscriber.next({
|
|
233
173
|
request,
|
|
234
|
-
|
|
174
|
+
type: HttpEventType.ResponseHeader,
|
|
235
175
|
response: headersResponse
|
|
236
176
|
});
|
|
237
|
-
|
|
238
|
-
|
|
177
|
+
let body;
|
|
178
|
+
if (fetchResponse.body) {
|
|
179
|
+
if (init.reportProgress) {
|
|
180
|
+
const fetchBody = fetchResponse.body;
|
|
181
|
+
const contentLength = fetchResponse.headers.get("content-length") || "0";
|
|
182
|
+
const total = parseInt(contentLength, 10) || 0;
|
|
183
|
+
let loaded = 0;
|
|
184
|
+
const res = new Response(new ReadableStream({
|
|
185
|
+
async start(controller) {
|
|
186
|
+
const reader = fetchBody.getReader();
|
|
187
|
+
for (; ; ) {
|
|
188
|
+
const { done, value } = await reader.read();
|
|
189
|
+
if (done)
|
|
190
|
+
break;
|
|
191
|
+
loaded += value.byteLength;
|
|
192
|
+
controller.enqueue(value);
|
|
193
|
+
subscriber.next({
|
|
194
|
+
type: HttpEventType.DownloadProgress,
|
|
195
|
+
request,
|
|
196
|
+
total,
|
|
197
|
+
loaded
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
controller.close();
|
|
201
|
+
}
|
|
202
|
+
}));
|
|
203
|
+
body = await this.parseBody(res);
|
|
204
|
+
} else {
|
|
205
|
+
body = await this.parseBody(fetchResponse);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const response = this.createResponse({
|
|
239
209
|
url: fetchResponse.url,
|
|
240
210
|
headers: fetchResponse.headers,
|
|
241
211
|
status: fetchResponse.status,
|
|
242
212
|
statusText: fetchResponse.statusText,
|
|
243
|
-
contentType,
|
|
244
213
|
body
|
|
245
|
-
};
|
|
246
|
-
const response = clientContext.createResponse(responseInit);
|
|
247
|
-
for (const interceptor of clientContext.responseInterceptors) {
|
|
248
|
-
await interceptor(response, request);
|
|
249
|
-
}
|
|
214
|
+
});
|
|
250
215
|
subscriber.next({
|
|
251
216
|
request,
|
|
252
|
-
|
|
217
|
+
type: HttpEventType.Response,
|
|
253
218
|
response
|
|
254
219
|
});
|
|
255
220
|
subscriber.complete();
|
|
256
221
|
})().catch((error) => subscriber.error(error));
|
|
257
222
|
});
|
|
258
223
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
224
|
+
send(request) {
|
|
225
|
+
return fetch(request);
|
|
226
|
+
}
|
|
227
|
+
prepareRequest(init) {
|
|
228
|
+
const headers = init.headers || new Headers();
|
|
229
|
+
const requestInit = {
|
|
230
|
+
...init,
|
|
231
|
+
headers
|
|
232
|
+
};
|
|
233
|
+
const body = requestInit.body;
|
|
234
|
+
if (body) {
|
|
263
235
|
let contentType;
|
|
264
|
-
if (typeof
|
|
265
|
-
contentType = 'text/plain;charset=UTF-8"';
|
|
266
|
-
body = String(
|
|
267
|
-
|
|
268
|
-
delete
|
|
269
|
-
} else if (isReadableStreamLike(
|
|
236
|
+
if (typeof body === "string" || typeof body === "number" || typeof body === "boolean") {
|
|
237
|
+
contentType = 'text/plain; charset="UTF-8"';
|
|
238
|
+
requestInit.body = new Blob([String(body)], { type: contentType });
|
|
239
|
+
headers.set("Content-Length", String(requestInit.body.size));
|
|
240
|
+
delete requestInit.duplex;
|
|
241
|
+
} else if (isReadableStreamLike(body)) {
|
|
270
242
|
contentType = "application/octet-stream";
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
} else if (Buffer.isBuffer(request.body)) {
|
|
243
|
+
requestInit.duplex = "half";
|
|
244
|
+
} else if (Buffer.isBuffer(body)) {
|
|
274
245
|
contentType = "application/octet-stream";
|
|
275
|
-
body
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
request.headers.set("Content-Size", String(request.body.length));
|
|
282
|
-
delete request.duplex;
|
|
246
|
+
headers.set("Content-Length", String(body.length));
|
|
247
|
+
delete requestInit.duplex;
|
|
248
|
+
} else if (isBlob(body)) {
|
|
249
|
+
contentType = body.type || "application/octet-stream";
|
|
250
|
+
headers.set("Content-Length", String(body.size));
|
|
251
|
+
delete requestInit.duplex;
|
|
283
252
|
} else {
|
|
284
|
-
contentType =
|
|
285
|
-
body = JSON.stringify(
|
|
286
|
-
|
|
287
|
-
delete
|
|
253
|
+
contentType = 'application/json;charset="UTF-8"';
|
|
254
|
+
requestInit.body = new Blob([JSON.stringify(body)], { type: contentType });
|
|
255
|
+
headers.set("Content-Length", String(requestInit.body.size));
|
|
256
|
+
delete requestInit.duplex;
|
|
288
257
|
}
|
|
289
|
-
if (!
|
|
290
|
-
|
|
291
|
-
request.body = body;
|
|
258
|
+
if (contentType && !headers.has("Content-Type"))
|
|
259
|
+
headers.set("Content-Type", contentType);
|
|
292
260
|
}
|
|
261
|
+
return new Request(requestInit.url.toString(), requestInit);
|
|
293
262
|
}
|
|
294
|
-
|
|
263
|
+
createResponse(init) {
|
|
264
|
+
return new HttpResponse(init);
|
|
265
|
+
}
|
|
266
|
+
async parseBody(fetchResponse) {
|
|
295
267
|
let body;
|
|
296
268
|
const contentType = fetchResponse.headers.get("Content-Type") || "";
|
|
297
269
|
if (typeIs.is(contentType, ["json", "application/*+json"])) {
|
|
@@ -311,17 +283,174 @@ var HttpRequestObservable = class extends Observable {
|
|
|
311
283
|
}
|
|
312
284
|
};
|
|
313
285
|
|
|
314
|
-
// ../../build/client/esm/
|
|
286
|
+
// ../../build/client/esm/http/http-client-base.js
|
|
287
|
+
import { ApiDocumentFactory } from "@opra/common";
|
|
288
|
+
|
|
289
|
+
// ../../build/client/esm/http/http-collection-node.js
|
|
290
|
+
import { toArrayDef } from "putil-varhelpers";
|
|
291
|
+
import { OpraURL as OpraURL2 } from "@opra/common";
|
|
292
|
+
|
|
293
|
+
// ../../build/client/esm/http/http-request-observable.js
|
|
294
|
+
import { lastValueFrom, Observable as Observable2 } from "rxjs";
|
|
295
|
+
import typeIs2 from "@browsery/type-is";
|
|
296
|
+
import { OpraURL } from "@opra/common";
|
|
297
|
+
|
|
298
|
+
// ../../build/client/esm/http/enums/http-observable-type.enum.js
|
|
299
|
+
var HttpObserveType;
|
|
300
|
+
(function(HttpObserveType2) {
|
|
301
|
+
HttpObserveType2["ResponseHeader"] = "response-header";
|
|
302
|
+
HttpObserveType2["Response"] = "response";
|
|
303
|
+
HttpObserveType2["Body"] = "body";
|
|
304
|
+
HttpObserveType2["Events"] = "events";
|
|
305
|
+
})(HttpObserveType || (HttpObserveType = {}));
|
|
306
|
+
|
|
307
|
+
// ../../build/client/esm/http/http-interceptor-handler.js
|
|
308
|
+
var HttpInterceptorHandler = class {
|
|
309
|
+
static {
|
|
310
|
+
__name(this, "HttpInterceptorHandler");
|
|
311
|
+
}
|
|
312
|
+
constructor(interceptors, finalHandler) {
|
|
313
|
+
this.chain = interceptors.reduceRight((chainTailFn, interceptor) => (initialRequest, handler) => interceptor.intercept(initialRequest, {
|
|
314
|
+
handle: (downstreamRequest) => chainTailFn(downstreamRequest, handler)
|
|
315
|
+
}), chainEnd);
|
|
316
|
+
this.finalHandler = finalHandler;
|
|
317
|
+
}
|
|
318
|
+
handle(initialRequest) {
|
|
319
|
+
return this.chain(initialRequest, (req) => this.finalHandler.handle(req));
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
function chainEnd(req, handler) {
|
|
323
|
+
return handler(req);
|
|
324
|
+
}
|
|
325
|
+
__name(chainEnd, "chainEnd");
|
|
326
|
+
|
|
327
|
+
// ../../build/client/esm/http/http-request-observable.js
|
|
328
|
+
var HttpRequestObservable = class _HttpRequestObservable extends Observable2 {
|
|
329
|
+
static {
|
|
330
|
+
__name(this, "HttpRequestObservable");
|
|
331
|
+
}
|
|
332
|
+
constructor(backend, init) {
|
|
333
|
+
super((subscriber) => {
|
|
334
|
+
const observe = this[kContext].observe;
|
|
335
|
+
new HttpInterceptorHandler(backend.interceptors || [], this[kBackend]).handle(this[kContext]).subscribe({
|
|
336
|
+
next(event) {
|
|
337
|
+
if (observe === HttpObserveType.Events) {
|
|
338
|
+
subscriber.next(event);
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
if (observe === HttpObserveType.ResponseHeader && event.type === HttpEventType.ResponseHeader) {
|
|
342
|
+
subscriber.next(event.response);
|
|
343
|
+
subscriber.complete();
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
if (event.type === HttpEventType.Response) {
|
|
347
|
+
const { response } = event;
|
|
348
|
+
if (observe === HttpObserveType.Response) {
|
|
349
|
+
subscriber.next(response);
|
|
350
|
+
subscriber.complete();
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
const isOpraResponse = typeIs2.is(event.response.contentType || "", ["application/opra+json"]);
|
|
354
|
+
if (response.status >= 400 && response.status < 600) {
|
|
355
|
+
subscriber.error(new ClientError({
|
|
356
|
+
message: response.status + " " + response.statusText,
|
|
357
|
+
status: response.status,
|
|
358
|
+
issues: isOpraResponse ? response.body.errors : void 0
|
|
359
|
+
}));
|
|
360
|
+
subscriber.complete();
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
subscriber.next(event.response.body);
|
|
364
|
+
subscriber.complete();
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
error(error) {
|
|
368
|
+
subscriber.error(error);
|
|
369
|
+
},
|
|
370
|
+
complete() {
|
|
371
|
+
subscriber.complete();
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
});
|
|
375
|
+
Object.defineProperty(this, kBackend, {
|
|
376
|
+
enumerable: false,
|
|
377
|
+
value: backend
|
|
378
|
+
});
|
|
379
|
+
const url = new OpraURL(init?.url, backend.serviceUrl.toString());
|
|
380
|
+
Object.defineProperty(this, kContext, {
|
|
381
|
+
enumerable: false,
|
|
382
|
+
value: {
|
|
383
|
+
...init,
|
|
384
|
+
observe: HttpObserveType.Body,
|
|
385
|
+
headers: new Headers(init?.headers),
|
|
386
|
+
url
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
clone() {
|
|
391
|
+
return new _HttpRequestObservable(this[kBackend], this[kContext]);
|
|
392
|
+
}
|
|
393
|
+
options(options) {
|
|
394
|
+
Object.assign(this[kContext], options);
|
|
395
|
+
return this;
|
|
396
|
+
}
|
|
397
|
+
header(arg0, value) {
|
|
398
|
+
const target = this[kContext].headers;
|
|
399
|
+
if (typeof arg0 === "object") {
|
|
400
|
+
const h = arg0 instanceof Headers ? arg0 : new Headers(arg0);
|
|
401
|
+
h.forEach((v, k) => {
|
|
402
|
+
if (k.toLowerCase() === "set-cookie") {
|
|
403
|
+
target.append(k, v);
|
|
404
|
+
} else
|
|
405
|
+
target.set(k, v);
|
|
406
|
+
});
|
|
407
|
+
return this;
|
|
408
|
+
}
|
|
409
|
+
if (value == null || value === "")
|
|
410
|
+
target.delete(arg0);
|
|
411
|
+
else
|
|
412
|
+
target.append(arg0, String(value));
|
|
413
|
+
return this;
|
|
414
|
+
}
|
|
415
|
+
param(arg0, value) {
|
|
416
|
+
const target = this[kContext].url.searchParams;
|
|
417
|
+
if (typeof arg0 === "object") {
|
|
418
|
+
const h = arg0 instanceof URLSearchParams ? arg0 : new URLSearchParams(arg0);
|
|
419
|
+
h.forEach((v, k) => target.set(k, v));
|
|
420
|
+
return this;
|
|
421
|
+
}
|
|
422
|
+
if (value == null)
|
|
423
|
+
target.delete(arg0);
|
|
424
|
+
else
|
|
425
|
+
target.set(arg0, String(value));
|
|
426
|
+
return this;
|
|
427
|
+
}
|
|
428
|
+
observe(observe) {
|
|
429
|
+
if (observe === this[kContext].observe)
|
|
430
|
+
return this;
|
|
431
|
+
const cloned = this.clone();
|
|
432
|
+
cloned[kContext].observe = observe || HttpObserveType.Body;
|
|
433
|
+
return cloned;
|
|
434
|
+
}
|
|
435
|
+
getBody() {
|
|
436
|
+
return lastValueFrom(this.observe(HttpObserveType.Body));
|
|
437
|
+
}
|
|
438
|
+
getResponse() {
|
|
439
|
+
return lastValueFrom(this.observe(HttpObserveType.Response));
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
// ../../build/client/esm/http/http-collection-node.js
|
|
315
444
|
var HttpCollectionNode = class {
|
|
316
445
|
static {
|
|
317
446
|
__name(this, "HttpCollectionNode");
|
|
318
447
|
}
|
|
319
|
-
constructor(
|
|
320
|
-
this.
|
|
448
|
+
constructor(backend, path) {
|
|
449
|
+
this._backend = backend;
|
|
321
450
|
this._path = path;
|
|
322
451
|
}
|
|
323
452
|
create(data, options) {
|
|
324
|
-
const observable = new HttpRequestObservable(this.
|
|
453
|
+
const observable = new HttpRequestObservable(this._backend, {
|
|
325
454
|
method: "POST",
|
|
326
455
|
url: this._path,
|
|
327
456
|
body: data
|
|
@@ -337,15 +466,15 @@ var HttpCollectionNode = class {
|
|
|
337
466
|
delete(id) {
|
|
338
467
|
if (id == null || id === "")
|
|
339
468
|
throw new TypeError(`'id' argument must have a value`);
|
|
340
|
-
const url = new
|
|
469
|
+
const url = new OpraURL2();
|
|
341
470
|
url.join({ resource: this._path, key: id });
|
|
342
|
-
return new HttpRequestObservable(this.
|
|
471
|
+
return new HttpRequestObservable(this._backend, {
|
|
343
472
|
method: "DELETE",
|
|
344
473
|
url
|
|
345
474
|
});
|
|
346
475
|
}
|
|
347
476
|
deleteMany(options) {
|
|
348
|
-
const observable = new HttpRequestObservable(this.
|
|
477
|
+
const observable = new HttpRequestObservable(this._backend, {
|
|
349
478
|
method: "DELETE",
|
|
350
479
|
url: this._path
|
|
351
480
|
});
|
|
@@ -356,9 +485,9 @@ var HttpCollectionNode = class {
|
|
|
356
485
|
get(id, options) {
|
|
357
486
|
if (id == null || id === "")
|
|
358
487
|
throw new TypeError(`'id' argument must have a value`);
|
|
359
|
-
const url = new
|
|
488
|
+
const url = new OpraURL2();
|
|
360
489
|
url.join({ resource: this._path, key: id });
|
|
361
|
-
const observable = new HttpRequestObservable(this.
|
|
490
|
+
const observable = new HttpRequestObservable(this._backend, {
|
|
362
491
|
method: "GET",
|
|
363
492
|
url
|
|
364
493
|
});
|
|
@@ -371,7 +500,7 @@ var HttpCollectionNode = class {
|
|
|
371
500
|
return observable;
|
|
372
501
|
}
|
|
373
502
|
findMany(options) {
|
|
374
|
-
const observable = new HttpRequestObservable(this.
|
|
503
|
+
const observable = new HttpRequestObservable(this._backend, {
|
|
375
504
|
method: "GET",
|
|
376
505
|
url: this._path
|
|
377
506
|
});
|
|
@@ -398,9 +527,9 @@ var HttpCollectionNode = class {
|
|
|
398
527
|
update(id, data, options) {
|
|
399
528
|
if (id == null)
|
|
400
529
|
throw new TypeError(`'id' argument must have a value`);
|
|
401
|
-
const url = new
|
|
530
|
+
const url = new OpraURL2();
|
|
402
531
|
url.join({ resource: this._path, key: id });
|
|
403
|
-
const observable = new HttpRequestObservable(this.
|
|
532
|
+
const observable = new HttpRequestObservable(this._backend, {
|
|
404
533
|
method: "PATCH",
|
|
405
534
|
url,
|
|
406
535
|
body: data
|
|
@@ -414,7 +543,7 @@ var HttpCollectionNode = class {
|
|
|
414
543
|
return observable;
|
|
415
544
|
}
|
|
416
545
|
updateMany(data, options) {
|
|
417
|
-
const observable = new HttpRequestObservable(this.
|
|
546
|
+
const observable = new HttpRequestObservable(this._backend, {
|
|
418
547
|
method: "PATCH",
|
|
419
548
|
url: this._path,
|
|
420
549
|
body: data
|
|
@@ -425,38 +554,18 @@ var HttpCollectionNode = class {
|
|
|
425
554
|
}
|
|
426
555
|
};
|
|
427
556
|
|
|
428
|
-
// ../../build/client/esm/
|
|
429
|
-
var HttpResponse = class _HttpResponse {
|
|
430
|
-
static {
|
|
431
|
-
__name(this, "HttpResponse");
|
|
432
|
-
}
|
|
433
|
-
constructor(init) {
|
|
434
|
-
this.hasBody = false;
|
|
435
|
-
this.headers = init?.headers instanceof Headers ? init?.headers : new Headers(init?.headers);
|
|
436
|
-
this.status = init?.status || 200;
|
|
437
|
-
this.statusText = init?.statusText || "OK";
|
|
438
|
-
this.url = init?.url || null;
|
|
439
|
-
this.ok = this.status >= 200 && this.status < 300;
|
|
440
|
-
this.body = init?.body;
|
|
441
|
-
this.hasBody = init?.body != null || !!init?.hasBody;
|
|
442
|
-
}
|
|
443
|
-
clone(update) {
|
|
444
|
-
return new _HttpResponse({ ...this, ...update });
|
|
445
|
-
}
|
|
446
|
-
};
|
|
447
|
-
|
|
448
|
-
// ../../build/client/esm/impl/singleton-node.js
|
|
557
|
+
// ../../build/client/esm/http/http-singleton-node.js
|
|
449
558
|
import { toArrayDef as toArrayDef2 } from "putil-varhelpers";
|
|
450
559
|
var HttpSingletonNode = class {
|
|
451
560
|
static {
|
|
452
561
|
__name(this, "HttpSingletonNode");
|
|
453
562
|
}
|
|
454
|
-
constructor(
|
|
455
|
-
this.
|
|
563
|
+
constructor(backend, path) {
|
|
564
|
+
this._backend = backend;
|
|
456
565
|
this._path = path;
|
|
457
566
|
}
|
|
458
567
|
create(data, options) {
|
|
459
|
-
const observable = new HttpRequestObservable(this.
|
|
568
|
+
const observable = new HttpRequestObservable(this._backend, {
|
|
460
569
|
method: "POST",
|
|
461
570
|
url: this._path,
|
|
462
571
|
body: data
|
|
@@ -470,13 +579,13 @@ var HttpSingletonNode = class {
|
|
|
470
579
|
return observable;
|
|
471
580
|
}
|
|
472
581
|
delete() {
|
|
473
|
-
return new HttpRequestObservable(this.
|
|
582
|
+
return new HttpRequestObservable(this._backend, {
|
|
474
583
|
method: "DELETE",
|
|
475
584
|
url: this._path
|
|
476
585
|
});
|
|
477
586
|
}
|
|
478
587
|
get(options) {
|
|
479
|
-
const observable = new HttpRequestObservable(this.
|
|
588
|
+
const observable = new HttpRequestObservable(this._backend, {
|
|
480
589
|
method: "GET",
|
|
481
590
|
url: this._path
|
|
482
591
|
});
|
|
@@ -489,7 +598,7 @@ var HttpSingletonNode = class {
|
|
|
489
598
|
return observable;
|
|
490
599
|
}
|
|
491
600
|
update(data, options) {
|
|
492
|
-
const observable = new HttpRequestObservable(this.
|
|
601
|
+
const observable = new HttpRequestObservable(this._backend, {
|
|
493
602
|
method: "PATCH",
|
|
494
603
|
url: this._path,
|
|
495
604
|
body: data
|
|
@@ -504,54 +613,32 @@ var HttpSingletonNode = class {
|
|
|
504
613
|
}
|
|
505
614
|
};
|
|
506
615
|
|
|
507
|
-
// ../../build/client/esm/client.js
|
|
508
|
-
var
|
|
616
|
+
// ../../build/client/esm/http/http-client-base.js
|
|
617
|
+
var HttpClientBase = class extends ClientBase {
|
|
509
618
|
static {
|
|
510
|
-
__name(this, "
|
|
619
|
+
__name(this, "HttpClientBase");
|
|
511
620
|
}
|
|
512
|
-
constructor(
|
|
513
|
-
|
|
514
|
-
serviceUrl,
|
|
515
|
-
requestInterceptors: [...options?.requestInterceptors || []],
|
|
516
|
-
responseInterceptors: [...options?.responseInterceptors || []],
|
|
517
|
-
api: options?.api,
|
|
518
|
-
defaults: {
|
|
519
|
-
...options?.defaults,
|
|
520
|
-
headers: options?.defaults?.headers instanceof Headers ? options?.defaults?.headers : new Headers(options?.defaults?.headers),
|
|
521
|
-
params: options?.defaults?.params instanceof URLSearchParams ? options?.defaults?.params : new URLSearchParams(options?.defaults?.params)
|
|
522
|
-
},
|
|
523
|
-
fetch,
|
|
524
|
-
createResponse: (init) => new HttpResponse(init)
|
|
525
|
-
};
|
|
526
|
-
Object.defineProperty(this, kContext, {
|
|
527
|
-
enumerable: false,
|
|
528
|
-
value: context
|
|
529
|
-
});
|
|
621
|
+
constructor(backend) {
|
|
622
|
+
super(backend);
|
|
530
623
|
}
|
|
531
624
|
get serviceUrl() {
|
|
532
|
-
return this[
|
|
533
|
-
}
|
|
534
|
-
get api() {
|
|
535
|
-
return this[kContext].api;
|
|
536
|
-
}
|
|
537
|
-
get defaults() {
|
|
538
|
-
return this[kContext].defaults;
|
|
625
|
+
return this[kBackend].serviceUrl;
|
|
539
626
|
}
|
|
540
627
|
async getMetadata() {
|
|
541
628
|
let promise = this._metadataPromise;
|
|
542
629
|
if (promise)
|
|
543
630
|
return promise;
|
|
544
|
-
const
|
|
631
|
+
const request = new HttpRequestObservable(this[kBackend], {
|
|
545
632
|
method: "GET",
|
|
546
|
-
url: "",
|
|
547
|
-
headers: { "accept": "application/json" }
|
|
633
|
+
url: "/",
|
|
634
|
+
headers: new Headers({ "accept": "application/json" })
|
|
548
635
|
});
|
|
549
|
-
this._metadataPromise = promise =
|
|
636
|
+
this._metadataPromise = promise = request.getBody();
|
|
550
637
|
return await promise.then(async (body) => {
|
|
551
638
|
if (!body)
|
|
552
639
|
throw new Error(`No response returned.`);
|
|
553
640
|
const api = await ApiDocumentFactory.createDocument(body);
|
|
554
|
-
this[
|
|
641
|
+
this[kBackend].api = api;
|
|
555
642
|
return api;
|
|
556
643
|
}).catch((e) => {
|
|
557
644
|
e.message = "Unable to fetch metadata from service url (" + this.serviceUrl + "). " + e.message;
|
|
@@ -559,13 +646,13 @@ var OpraHttpClient = class {
|
|
|
559
646
|
}).finally(() => delete this._metadataPromise);
|
|
560
647
|
}
|
|
561
648
|
collection(path) {
|
|
562
|
-
return new HttpCollectionNode(this, path);
|
|
649
|
+
return new HttpCollectionNode(this[kBackend], path);
|
|
563
650
|
}
|
|
564
651
|
singleton(path) {
|
|
565
|
-
return new HttpSingletonNode(this, path);
|
|
652
|
+
return new HttpSingletonNode(this[kBackend], path);
|
|
566
653
|
}
|
|
567
654
|
action(path, params) {
|
|
568
|
-
const observable = new HttpRequestObservable(this, {
|
|
655
|
+
const observable = new HttpRequestObservable(this[kBackend], {
|
|
569
656
|
method: "GET",
|
|
570
657
|
url: path
|
|
571
658
|
});
|
|
@@ -577,7 +664,20 @@ var OpraHttpClient = class {
|
|
|
577
664
|
}
|
|
578
665
|
};
|
|
579
666
|
|
|
580
|
-
// ../../build/client/esm/
|
|
667
|
+
// ../../build/client/esm/http/http-client.js
|
|
668
|
+
var OpraHttpClient = class extends HttpClientBase {
|
|
669
|
+
static {
|
|
670
|
+
__name(this, "OpraHttpClient");
|
|
671
|
+
}
|
|
672
|
+
constructor(serviceUrl, options) {
|
|
673
|
+
super(new FetchBackend(serviceUrl, options));
|
|
674
|
+
}
|
|
675
|
+
get defaults() {
|
|
676
|
+
return this[kBackend].defaults;
|
|
677
|
+
}
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
// ../../build/client/esm/http/http-service-base.js
|
|
581
681
|
var _a;
|
|
582
682
|
var HttpServiceBase = class {
|
|
583
683
|
static {
|
|
@@ -585,7 +685,7 @@ var HttpServiceBase = class {
|
|
|
585
685
|
}
|
|
586
686
|
constructor(client) {
|
|
587
687
|
this[_a] = {
|
|
588
|
-
|
|
688
|
+
resources: {},
|
|
589
689
|
node: null
|
|
590
690
|
};
|
|
591
691
|
this[kClient] = client;
|
|
@@ -593,16 +693,21 @@ var HttpServiceBase = class {
|
|
|
593
693
|
};
|
|
594
694
|
_a = kContext;
|
|
595
695
|
export {
|
|
696
|
+
Backend,
|
|
697
|
+
ClientBase,
|
|
596
698
|
ClientError,
|
|
699
|
+
FetchBackend,
|
|
700
|
+
HttpBackend,
|
|
701
|
+
HttpClientBase,
|
|
597
702
|
HttpCollectionNode,
|
|
598
703
|
HttpEventType,
|
|
599
704
|
HttpObserveType,
|
|
600
|
-
HttpRequest,
|
|
601
705
|
HttpRequestObservable,
|
|
602
706
|
HttpResponse,
|
|
603
707
|
HttpServiceBase,
|
|
604
708
|
HttpSingletonNode,
|
|
605
709
|
OpraHttpClient,
|
|
710
|
+
kBackend,
|
|
606
711
|
kClient,
|
|
607
712
|
kContext
|
|
608
713
|
};
|