@utiliread/http 1.10.0 → 1.12.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.
Files changed (49) hide show
  1. package/.vscode/settings.json +2 -2
  2. package/dist/cjs/http-builder.js.map +1 -1
  3. package/dist/cjs/http.js +2 -1
  4. package/dist/cjs/http.js.map +1 -1
  5. package/dist/cjs/msgpack.js +12 -0
  6. package/dist/cjs/msgpack.js.map +1 -1
  7. package/dist/esm/http-builder.d.ts +3 -0
  8. package/dist/esm/http-builder.js.map +1 -1
  9. package/dist/esm/http.d.ts +1 -1
  10. package/dist/esm/http.js +2 -1
  11. package/dist/esm/http.js.map +1 -1
  12. package/dist/esm/msgpack.d.ts +1 -0
  13. package/dist/esm/msgpack.js +13 -1
  14. package/dist/esm/msgpack.js.map +1 -1
  15. package/karma.config.js +30 -30
  16. package/package.json +1 -1
  17. package/src/event-aggregator.ts +31 -31
  18. package/src/helpers.ts +13 -13
  19. package/src/http-builder.ts +254 -253
  20. package/src/http-error.ts +25 -25
  21. package/src/http-response.ts +55 -55
  22. package/src/http.spec.ts +104 -104
  23. package/src/http.ts +121 -120
  24. package/src/index.ts +16 -16
  25. package/src/json.ts +138 -138
  26. package/src/mapping.ts +42 -42
  27. package/src/msgpack.ts +63 -48
  28. package/src/pagination.ts +25 -25
  29. package/src/problem-details.ts +7 -7
  30. package/src/query-string.spec.ts +62 -62
  31. package/src/query-string.ts +69 -69
  32. package/src/timeout-error.ts +10 -10
  33. package/tsconfig.cjs.json +8 -8
  34. package/tsconfig.json +13 -13
  35. package/dist/cjs/events.js +0 -89
  36. package/dist/cjs/events.js.map +0 -1
  37. package/dist/cjs/settings.js +0 -3
  38. package/dist/cjs/settings.js.map +0 -1
  39. package/dist/cjs/utils.js +0 -8
  40. package/dist/cjs/utils.js.map +0 -1
  41. package/dist/esm/events.d.ts +0 -25
  42. package/dist/esm/events.js +0 -86
  43. package/dist/esm/events.js.map +0 -1
  44. package/dist/esm/settings.d.ts +0 -6
  45. package/dist/esm/settings.js +0 -2
  46. package/dist/esm/settings.js.map +0 -1
  47. package/dist/esm/utils.d.ts +0 -3
  48. package/dist/esm/utils.js +0 -4
  49. package/dist/esm/utils.js.map +0 -1
@@ -1,254 +1,255 @@
1
- import { Fetch } from './http';
2
- import { HttpResponse, HttpResponseOfT } from './http-response';
3
- import { TimeoutError } from './timeout-error';
4
- import { EventAggregator } from './event-aggregator';
5
- import { Http } from '.';
6
-
7
- export class HttpBuilder {
8
- private _ensureSuccessStatusCode = true;
9
- private _onSend = new EventAggregator<[Message]>();
10
- private _onSent = new EventAggregator<[HttpResponse, Message]>();
11
-
12
- constructor(public message: Message, public options: RequestOptions, /** @internal */ public http: Http) {
13
- }
14
-
15
- onSend(callback: (request: Message) => void | Promise<void>) {
16
- this._onSend.subscribe(callback);
17
- return this;
18
- }
19
-
20
- onSent(callback: (response: HttpResponse, request: Message) => void | Promise<void>) {
21
- this._onSent.subscribe(callback);
22
- return this;
23
- }
24
-
25
- protected useHandler<T>(handler: (response: Response) => Promise<T>) {
26
- return new HttpBuilderOfT<T>(this, handler);
27
- }
28
-
29
- async send(abortSignal?: AbortSignal) {
30
- if (this.message.contentType) {
31
- this.message.headers.set('Content-Type', this.message.contentType);
32
- }
33
-
34
- // Resolve the final url and assign it to the message
35
- // This makes the final url apper in onSend, onSent, and on Received handlers
36
- this.message.url = this.getUrl();
37
-
38
- await this._onSend.publish(this.message);
39
- await this.http._onSend.publish(this.message);
40
-
41
- const init: RequestInit = {
42
- method: this.message.method,
43
- body: this.message.content,
44
- headers: this.message.headers,
45
- mode: this.message.mode
46
- };
47
-
48
- if (abortSignal || this.options.timeout) {
49
- var outerController = new AbortController();
50
- if (abortSignal) {
51
- abortSignal.addEventListener("abort", () => {
52
- outerController.abort();
53
- });
54
- }
55
-
56
- init.signal = outerController.signal;
57
- }
58
-
59
- const fetchResponsePromise = this.options.fetch(this.message.url, init);
60
- let fetchResponse: Response;
61
-
62
- if (this.options.timeout) {
63
- fetchResponse = await Promise.race([
64
- fetchResponsePromise,
65
- new Promise<Response>((_, reject) => setTimeout(() => {
66
- outerController.abort();
67
- reject(new TimeoutError());
68
- }, this.options.timeout))
69
- ]);
70
- }
71
- else {
72
- fetchResponse = await fetchResponsePromise;
73
- }
74
-
75
- const httpResponse = new HttpResponse(fetchResponse);
76
-
77
- if (this._ensureSuccessStatusCode) {
78
- httpResponse.ensureSuccessfulStatusCode();
79
- }
80
-
81
- await this._onSent.publish(httpResponse, this.message);
82
- await this.http._onSent.publish(httpResponse, this.message);
83
-
84
- return httpResponse;
85
- }
86
-
87
- getUrl() {
88
- let baseUrl = this.options.baseUrl;
89
- if (!baseUrl) {
90
- return this.message.url;
91
- }
92
-
93
- if (baseUrl.endsWith('/')) {
94
- baseUrl = baseUrl.substr(0, baseUrl.length - 1);
95
- }
96
-
97
- if (this.message.url.startsWith('/')) {
98
- return baseUrl + this.message.url;
99
- }
100
- else {
101
- return baseUrl + '/' + this.message.url;
102
- }
103
- }
104
-
105
- ensureSuccessStatusCode(ensureSuccessStatusCode?: boolean) {
106
- this._ensureSuccessStatusCode = ensureSuccessStatusCode === false ? false : true;
107
-
108
- return this;
109
- }
110
-
111
- useCors(mode: RequestMode) {
112
- this.message.mode = mode;
113
- return this;
114
- }
115
-
116
- useTimeout(timeout: number | null) {
117
- this.options.timeout = timeout || undefined;
118
- return this;
119
- }
120
-
121
- // Content Extensions
122
-
123
- with(content: any, contentType?: string) {
124
- this.message.content = content;
125
- this.message.contentType = contentType;
126
- return this;
127
- }
128
-
129
- withForm(content: FormData) {
130
- this.message.content = content;
131
- this.message.contentType = undefined;
132
- return this;
133
- }
134
-
135
- // Modifier Extensions
136
-
137
- addHeader(name: string, value: string) {
138
- this.message.headers.append(name, value);
139
- return this;
140
- }
141
-
142
- // Expect Extensions
143
-
144
- expectString() {
145
- return this.useHandler(response => {
146
- return response.text();
147
- });
148
- }
149
-
150
- expectBinary() {
151
- return this.useHandler(response => {
152
- return response.arrayBuffer();
153
- });
154
- }
155
- }
156
-
157
- export class HttpBuilderOfT<T> extends HttpBuilder {
158
- private _onReceived = new EventAggregator<[HttpResponseOfT<T>, Message, T]>();
159
-
160
- constructor(private inner: HttpBuilder, private handler: (response: Response) => Promise<T>) {
161
- super(inner.message, inner.options, inner.http);
162
- }
163
-
164
- onSend(callback: (request: Message) => void | Promise<void>) {
165
- this.inner.onSend(callback);
166
- return this;
167
- }
168
-
169
- onSent(callback: (response: HttpResponse, request: Message) => void | Promise<void>) {
170
- this.inner.onSent(callback);
171
- return this;
172
- }
173
-
174
- ensureSuccessStatusCode(ensureSuccessStatusCode?: boolean) {
175
- this.inner.ensureSuccessStatusCode(ensureSuccessStatusCode);
176
- return this;
177
- }
178
-
179
- useCors(mode: RequestMode) {
180
- this.inner.useCors(mode);
181
- return this;
182
- }
183
-
184
- useTimeout(timeout: number) {
185
- this.inner.useTimeout(timeout);
186
- return this;
187
- }
188
-
189
- allowEmptyResponse() {
190
- if (this._onReceived.any) {
191
- throw new Error("onReceived() must be called after allowEmptyResponse() because the callback type changes");
192
- }
193
-
194
- return new HttpBuilderOfT<T | null>(this.inner, response => {
195
- if (response.status === 204) {
196
- return Promise.resolve(null);
197
- }
198
-
199
- return this.handler(response);
200
- });
201
- }
202
-
203
- onReceived(callback: (response: HttpResponseOfT<T>, request: Message, value: T) => void | Promise<void>) {
204
- this._onReceived.subscribe(callback);
205
- return this;
206
- }
207
-
208
- send(abortSignal?: AbortSignal) {
209
- const responsePromise = this.inner.send(abortSignal).then(x => new HttpResponseOfT<T>(x.rawResponse, this.handler));
210
-
211
- return asSendPromise(responsePromise, () => responsePromise.then(response => this.handleReceive(response)));
212
- }
213
-
214
- transfer(abortSignal?: AbortSignal) {
215
- return this.send(abortSignal).then(response => this.handleReceive(response));
216
- }
217
-
218
- private async handleReceive(response: HttpResponseOfT<T>) {
219
- const request = this.message;
220
- const value = await response.receive();
221
-
222
- await this._onReceived.publish(response, request, value);
223
- await this.http._onReceived.publish(response, request, value);
224
-
225
- return value;
226
- }
227
- }
228
-
229
- export type HttpMethod = "HEAD" | "POST" | "GET" | "PUT" | "PATCH" | "DELETE";
230
-
231
- export interface Message {
232
- method: HttpMethod;
233
- url: string;
234
- headers: Headers;
235
- content?: any;
236
- contentType?: string;
237
- mode?: RequestMode;
238
- }
239
-
240
- export interface RequestOptions {
241
- fetch: Fetch,
242
- timeout?: number,
243
- baseUrl?: string,
244
- }
245
-
246
- export interface SendPromise<T> extends Promise<HttpResponseOfT<T>> {
247
- thenReceive(): Promise<T>;
248
- }
249
-
250
- function asSendPromise<T>(responsePromise: Promise<HttpResponse>, thenReceive: () => Promise<T>): SendPromise<T> {
251
- const sendPromise = responsePromise as SendPromise<T>;
252
- sendPromise.thenReceive = thenReceive;
253
- return sendPromise;
1
+ import { Fetch } from './http';
2
+ import { HttpResponse, HttpResponseOfT } from './http-response';
3
+ import { TimeoutError } from './timeout-error';
4
+ import { EventAggregator } from './event-aggregator';
5
+ import { Http } from '.';
6
+
7
+ export class HttpBuilder {
8
+ private _ensureSuccessStatusCode = true;
9
+ private _onSend = new EventAggregator<[Message]>();
10
+ private _onSent = new EventAggregator<[HttpResponse, Message]>();
11
+
12
+ constructor(public message: Message, public options: RequestOptions, /** @internal */ public http: Http) {
13
+ }
14
+
15
+ onSend(callback: (request: Message) => void | Promise<void>) {
16
+ this._onSend.subscribe(callback);
17
+ return this;
18
+ }
19
+
20
+ onSent(callback: (response: HttpResponse, request: Message) => void | Promise<void>) {
21
+ this._onSent.subscribe(callback);
22
+ return this;
23
+ }
24
+
25
+ protected useHandler<T>(handler: (response: Response) => Promise<T>) {
26
+ return new HttpBuilderOfT<T>(this, handler);
27
+ }
28
+
29
+ async send(abortSignal?: AbortSignal) {
30
+ if (this.message.contentType) {
31
+ this.message.headers.set('Content-Type', this.message.contentType);
32
+ }
33
+
34
+ // Resolve the final url and assign it to the message
35
+ // This makes the final url apper in onSend, onSent, and on Received handlers
36
+ this.message.url = this.getUrl();
37
+
38
+ await this._onSend.publish(this.message);
39
+ await this.http._onSend.publish(this.message);
40
+
41
+ const init: RequestInit = {
42
+ method: this.message.method,
43
+ body: this.message.content,
44
+ headers: this.message.headers,
45
+ mode: this.message.mode
46
+ };
47
+
48
+ if (abortSignal || this.options.timeout) {
49
+ var outerController = new AbortController();
50
+ if (abortSignal) {
51
+ abortSignal.addEventListener("abort", () => {
52
+ outerController.abort();
53
+ });
54
+ }
55
+
56
+ init.signal = outerController.signal;
57
+ }
58
+
59
+ const fetchResponsePromise = this.options.fetch(this.message.url, init);
60
+ let fetchResponse: Response;
61
+
62
+ if (this.options.timeout) {
63
+ fetchResponse = await Promise.race([
64
+ fetchResponsePromise,
65
+ new Promise<Response>((_, reject) => setTimeout(() => {
66
+ outerController.abort();
67
+ reject(new TimeoutError());
68
+ }, this.options.timeout))
69
+ ]);
70
+ }
71
+ else {
72
+ fetchResponse = await fetchResponsePromise;
73
+ }
74
+
75
+ const httpResponse = new HttpResponse(fetchResponse);
76
+
77
+ if (this._ensureSuccessStatusCode) {
78
+ httpResponse.ensureSuccessfulStatusCode();
79
+ }
80
+
81
+ await this._onSent.publish(httpResponse, this.message);
82
+ await this.http._onSent.publish(httpResponse, this.message);
83
+
84
+ return httpResponse;
85
+ }
86
+
87
+ getUrl() {
88
+ let baseUrl = this.options.baseUrl;
89
+ if (!baseUrl) {
90
+ return this.message.url;
91
+ }
92
+
93
+ if (baseUrl.endsWith('/')) {
94
+ baseUrl = baseUrl.substr(0, baseUrl.length - 1);
95
+ }
96
+
97
+ if (this.message.url.startsWith('/')) {
98
+ return baseUrl + this.message.url;
99
+ }
100
+ else {
101
+ return baseUrl + '/' + this.message.url;
102
+ }
103
+ }
104
+
105
+ ensureSuccessStatusCode(ensureSuccessStatusCode?: boolean) {
106
+ this._ensureSuccessStatusCode = ensureSuccessStatusCode === false ? false : true;
107
+
108
+ return this;
109
+ }
110
+
111
+ useCors(mode: RequestMode) {
112
+ this.message.mode = mode;
113
+ return this;
114
+ }
115
+
116
+ useTimeout(timeout: number | null) {
117
+ this.options.timeout = timeout || undefined;
118
+ return this;
119
+ }
120
+
121
+ // Content Extensions
122
+
123
+ with(content: any, contentType?: string) {
124
+ this.message.content = content;
125
+ this.message.contentType = contentType;
126
+ return this;
127
+ }
128
+
129
+ withForm(content: FormData) {
130
+ this.message.content = content;
131
+ this.message.contentType = undefined;
132
+ return this;
133
+ }
134
+
135
+ // Modifier Extensions
136
+
137
+ addHeader(name: string, value: string) {
138
+ this.message.headers.append(name, value);
139
+ return this;
140
+ }
141
+
142
+ // Expect Extensions
143
+
144
+ expectString() {
145
+ return this.useHandler(response => {
146
+ return response.text();
147
+ });
148
+ }
149
+
150
+ expectBinary() {
151
+ return this.useHandler(response => {
152
+ return response.arrayBuffer();
153
+ });
154
+ }
155
+ }
156
+
157
+ export class HttpBuilderOfT<T> extends HttpBuilder {
158
+ private _onReceived = new EventAggregator<[HttpResponseOfT<T>, Message, T]>();
159
+
160
+ constructor(private inner: HttpBuilder, private handler: (response: Response) => Promise<T>) {
161
+ super(inner.message, inner.options, inner.http);
162
+ }
163
+
164
+ onSend(callback: (request: Message) => void | Promise<void>) {
165
+ this.inner.onSend(callback);
166
+ return this;
167
+ }
168
+
169
+ onSent(callback: (response: HttpResponse, request: Message) => void | Promise<void>) {
170
+ this.inner.onSent(callback);
171
+ return this;
172
+ }
173
+
174
+ ensureSuccessStatusCode(ensureSuccessStatusCode?: boolean) {
175
+ this.inner.ensureSuccessStatusCode(ensureSuccessStatusCode);
176
+ return this;
177
+ }
178
+
179
+ useCors(mode: RequestMode) {
180
+ this.inner.useCors(mode);
181
+ return this;
182
+ }
183
+
184
+ useTimeout(timeout: number) {
185
+ this.inner.useTimeout(timeout);
186
+ return this;
187
+ }
188
+
189
+ allowEmptyResponse() {
190
+ if (this._onReceived.any) {
191
+ throw new Error("onReceived() must be called after allowEmptyResponse() because the callback type changes");
192
+ }
193
+
194
+ return new HttpBuilderOfT<T | null>(this.inner, response => {
195
+ if (response.status === 204) {
196
+ return Promise.resolve(null);
197
+ }
198
+
199
+ return this.handler(response);
200
+ });
201
+ }
202
+
203
+ onReceived(callback: (response: HttpResponseOfT<T>, request: Message, value: T) => void | Promise<void>) {
204
+ this._onReceived.subscribe(callback);
205
+ return this;
206
+ }
207
+
208
+ send(abortSignal?: AbortSignal) {
209
+ const responsePromise = this.inner.send(abortSignal).then(x => new HttpResponseOfT<T>(x.rawResponse, this.handler));
210
+
211
+ return asSendPromise(responsePromise, () => responsePromise.then(response => this.handleReceive(response)));
212
+ }
213
+
214
+ transfer(abortSignal?: AbortSignal) {
215
+ return this.send(abortSignal).then(response => this.handleReceive(response));
216
+ }
217
+
218
+ private async handleReceive(response: HttpResponseOfT<T>) {
219
+ const request = this.message;
220
+ const value = await response.receive();
221
+
222
+ await this._onReceived.publish(response, request, value);
223
+ await this.http._onReceived.publish(response, request, value);
224
+
225
+ return value;
226
+ }
227
+ }
228
+
229
+ export type HttpMethod = "HEAD" | "POST" | "GET" | "PUT" | "PATCH" | "DELETE";
230
+
231
+ export interface Message {
232
+ method: HttpMethod;
233
+ url: string;
234
+ headers: Headers;
235
+ content?: any;
236
+ contentType?: string;
237
+ mode?: RequestMode;
238
+ properties: {[key: string]: any};
239
+ }
240
+
241
+ export interface RequestOptions {
242
+ fetch: Fetch,
243
+ timeout?: number,
244
+ baseUrl?: string,
245
+ }
246
+
247
+ export interface SendPromise<T> extends Promise<HttpResponseOfT<T>> {
248
+ thenReceive(): Promise<T>;
249
+ }
250
+
251
+ function asSendPromise<T>(responsePromise: Promise<HttpResponse>, thenReceive: () => Promise<T>): SendPromise<T> {
252
+ const sendPromise = responsePromise as SendPromise<T>;
253
+ sendPromise.thenReceive = thenReceive;
254
+ return sendPromise;
254
255
  }
package/src/http-error.ts CHANGED
@@ -1,26 +1,26 @@
1
- import { HttpResponse } from './http-response';
2
- import { ProblemDetails } from './problem-details';
3
-
4
- export class HttpError extends Error {
5
- constructor(public statusCode: number, private response: HttpResponse | undefined = undefined) {
6
- super(`The response was not successful: ${statusCode}`);
7
- this.name = 'HttpError';
8
-
9
- // Set the prototype explicitly to allow for "... instanceof HttpError",
10
- // see https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
11
- Object.setPrototypeOf(this, HttpError.prototype);
12
- }
13
-
14
- details<TDetails = ProblemDetails>() {
15
- const rawResponse = this.response?.rawResponse;
16
-
17
- if (rawResponse) {
18
- const contentType = rawResponse.headers.get("Content-Type");
19
- if (contentType && contentType.includes("application/problem+json")) {
20
- return rawResponse.json().then(details => <TDetails>details);
21
- }
22
- }
23
-
24
- return Promise.reject(new Error("There are no problem details in the response"));
25
- }
1
+ import { HttpResponse } from './http-response';
2
+ import { ProblemDetails } from './problem-details';
3
+
4
+ export class HttpError extends Error {
5
+ constructor(public statusCode: number, private response: HttpResponse | undefined = undefined) {
6
+ super(`The response was not successful: ${statusCode}`);
7
+ this.name = 'HttpError';
8
+
9
+ // Set the prototype explicitly to allow for "... instanceof HttpError",
10
+ // see https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
11
+ Object.setPrototypeOf(this, HttpError.prototype);
12
+ }
13
+
14
+ details<TDetails = ProblemDetails>() {
15
+ const rawResponse = this.response?.rawResponse;
16
+
17
+ if (rawResponse) {
18
+ const contentType = rawResponse.headers.get("Content-Type");
19
+ if (contentType && contentType.includes("application/problem+json")) {
20
+ return rawResponse.json().then(details => <TDetails>details);
21
+ }
22
+ }
23
+
24
+ return Promise.reject(new Error("There are no problem details in the response"));
25
+ }
26
26
  }
@@ -1,56 +1,56 @@
1
- import { HttpError } from "./http-error";
2
-
3
- export class HttpResponse {
4
- get url() {
5
- return this.rawResponse.url;
6
- }
7
-
8
- get statusCode() {
9
- return this.rawResponse.status;
10
- }
11
-
12
- get headers() {
13
- return this.rawResponse.headers;
14
- }
15
-
16
- get isInformational() {
17
- return this.statusCode >= 100 && this.statusCode < 200;
18
- }
19
-
20
- get isSuccessful() {
21
- return this.statusCode >= 200 && this.statusCode < 300;
22
- }
23
-
24
- get isRedirection() {
25
- return this.statusCode >= 300 && this.statusCode < 400;
26
- }
27
-
28
- get isClientError() {
29
- return this.statusCode >= 400 && this.statusCode < 500;
30
- }
31
-
32
- get isServerError() {
33
- return this.statusCode >= 500 && this.statusCode < 600;
34
- }
35
-
36
- constructor(public rawResponse: Response) {
37
- }
38
-
39
- ensureSuccessfulStatusCode() {
40
- if (!this.isSuccessful) {
41
- throw new HttpError(this.statusCode, this);
42
- }
43
-
44
- return this;
45
- }
46
- }
47
-
48
- export class HttpResponseOfT<T> extends HttpResponse {
49
- constructor(rawResponse: Response, private handler: (response: Response) => Promise<T>) {
50
- super(rawResponse);
51
- }
52
-
53
- receive() {
54
- return this.handler(this.rawResponse);
55
- }
1
+ import { HttpError } from "./http-error";
2
+
3
+ export class HttpResponse {
4
+ get url() {
5
+ return this.rawResponse.url;
6
+ }
7
+
8
+ get statusCode() {
9
+ return this.rawResponse.status;
10
+ }
11
+
12
+ get headers() {
13
+ return this.rawResponse.headers;
14
+ }
15
+
16
+ get isInformational() {
17
+ return this.statusCode >= 100 && this.statusCode < 200;
18
+ }
19
+
20
+ get isSuccessful() {
21
+ return this.statusCode >= 200 && this.statusCode < 300;
22
+ }
23
+
24
+ get isRedirection() {
25
+ return this.statusCode >= 300 && this.statusCode < 400;
26
+ }
27
+
28
+ get isClientError() {
29
+ return this.statusCode >= 400 && this.statusCode < 500;
30
+ }
31
+
32
+ get isServerError() {
33
+ return this.statusCode >= 500 && this.statusCode < 600;
34
+ }
35
+
36
+ constructor(public rawResponse: Response) {
37
+ }
38
+
39
+ ensureSuccessfulStatusCode() {
40
+ if (!this.isSuccessful) {
41
+ throw new HttpError(this.statusCode, this);
42
+ }
43
+
44
+ return this;
45
+ }
46
+ }
47
+
48
+ export class HttpResponseOfT<T> extends HttpResponse {
49
+ constructor(rawResponse: Response, private handler: (response: Response) => Promise<T>) {
50
+ super(rawResponse);
51
+ }
52
+
53
+ receive() {
54
+ return this.handler(this.rawResponse);
55
+ }
56
56
  }