@efffrida/gplayapi 0.0.9 → 0.0.10
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/dist/GooglePlayApi.d.ts +28 -29
- package/dist/GooglePlayApi.d.ts.map +1 -1
- package/dist/GooglePlayApi.js +77 -74
- package/dist/GooglePlayApi.js.map +1 -1
- package/dist/internal/auth.js +7 -8
- package/dist/internal/auth.js.map +1 -1
- package/dist/internal/device.js +52 -30
- package/dist/internal/device.js.map +1 -1
- package/dist/internal/http.js +36 -31
- package/dist/internal/http.js.map +1 -1
- package/package.json +6 -15
- package/src/GooglePlayApi.ts +177 -115
- package/src/internal/auth.ts +31 -47
- package/src/internal/device.ts +78 -37
- package/src/internal/http.ts +39 -33
package/src/internal/auth.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import type * as HttpClientError from "
|
|
2
|
-
import type * as ParseResult from "effect/ParseResult";
|
|
1
|
+
import type * as HttpClientError from "effect/unstable/http/HttpClientError";
|
|
3
2
|
|
|
4
|
-
import * as HttpClient from "@effect/platform/HttpClient";
|
|
5
|
-
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
6
|
-
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
7
3
|
import * as Effect from "effect/Effect";
|
|
8
4
|
import * as Function from "effect/Function";
|
|
9
|
-
import * as Layer from "effect/Layer";
|
|
10
5
|
import * as Schema from "effect/Schema";
|
|
6
|
+
import * as HttpClient from "effect/unstable/http/HttpClient";
|
|
7
|
+
import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest";
|
|
8
|
+
import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse";
|
|
11
9
|
|
|
12
|
-
import type {
|
|
10
|
+
import type { AndroidDevice } from "./device.ts";
|
|
13
11
|
|
|
14
12
|
import {
|
|
15
13
|
AndroidCheckinRequestSchema,
|
|
@@ -19,13 +17,13 @@ import {
|
|
|
19
17
|
import { decodeResponse, decodeResponseFromResponseWrapper, encodeRequest } from "./http.ts";
|
|
20
18
|
|
|
21
19
|
/** @internal */
|
|
22
|
-
export const
|
|
23
|
-
device:
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
HttpClientError.HttpClientError |
|
|
20
|
+
export const authHeaders = Effect.fn(function* (
|
|
21
|
+
device: AndroidDevice
|
|
22
|
+
): Effect.fn.Return<
|
|
23
|
+
Record<string, string>,
|
|
24
|
+
HttpClientError.HttpClientError | Schema.SchemaError,
|
|
27
25
|
HttpClient.HttpClient
|
|
28
|
-
>
|
|
26
|
+
> {
|
|
29
27
|
// curl \
|
|
30
28
|
// --request GET \
|
|
31
29
|
// --header "Accept: application/json" \
|
|
@@ -185,37 +183,23 @@ export const makeHttpClient: (
|
|
|
185
183
|
// Effect.flatMap((response) => response.text)
|
|
186
184
|
// );
|
|
187
185
|
|
|
188
|
-
return
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
"X-DFE-Client-Id": "am-android-google",
|
|
209
|
-
"X-DFE-Network-Type": "4",
|
|
210
|
-
"X-DFE-Content-Filters": "",
|
|
211
|
-
"X-Limit-Ad-Tracking-Enabled": "false",
|
|
212
|
-
"X-Ad-Id": "",
|
|
213
|
-
"X-DFE-UserLanguages": "en",
|
|
214
|
-
"X-DFE-Request-Params": "timeoutMs=4000",
|
|
215
|
-
"X-DFE-Device-Checkin-Consistency-Token": checkinResponse.deviceCheckinConsistencyToken,
|
|
216
|
-
"X-DFE-Device-Config-Token": uploadDeviceConfigResponse.uploadDeviceConfigToken,
|
|
217
|
-
})
|
|
218
|
-
)
|
|
219
|
-
)
|
|
220
|
-
);
|
|
221
|
-
}, Layer.unwrapEffect);
|
|
186
|
+
return {
|
|
187
|
+
Authorization: "Bearer " + account.auth,
|
|
188
|
+
"User-Agent": device.userAgent,
|
|
189
|
+
"X-DFE-Device-Id": checkinResponse.androidId.toString(16),
|
|
190
|
+
"Accept-Language": "en",
|
|
191
|
+
"X-DFE-Encoded-Targets":
|
|
192
|
+
"CAESN/qigQYC2AMBFfUbyA7SM5Ij/CvfBoIDgxHqGP8R3xzIBvoQtBKFDZ4HAY4FrwSVMasHBO0O2Q8akgYRAQECAQO7AQEpKZ0CnwECAwRrAQYBr9PPAoK7sQMBAQMCBAkIDAgBAwEDBAICBAUZEgMEBAMLAQEBBQEBAcYBARYED+cBfS8CHQEKkAEMMxcBIQoUDwYHIjd3DQ4MFk0JWGYZEREYAQOLAYEBFDMIEYMBAgICAgICOxkCD18LGQKEAcgDBIQBAgGLARkYCy8oBTJlBCUocxQn0QUBDkkGxgNZQq0BZSbeAmIDgAEBOgGtAaMCDAOQAZ4BBIEBKUtQUYYBQscDDxPSARA1oAEHAWmnAsMB2wFyywGLAxol+wImlwOOA80CtwN26A0WjwJVbQEJPAH+BRDeAfkHK/ABASEBCSAaHQemAzkaRiu2Ad8BdXeiAwEBGBUBBN4LEIABK4gB2AFLfwECAdoENq0CkQGMBsIBiQEtiwGgA1zyAUQ4uwS8AwhsvgPyAcEDF27vApsBHaICGhl3GSKxAR8MC6cBAgItmQYG9QIeywLvAeYBDArLAh8HASI4ELICDVmVBgsY/gHWARtcAsMBpALiAdsBA7QBpAJmIArpByn0AyAKBwHTARIHAX8D+AMBcRIBBbEDmwUBMacCHAciNp0BAQF0OgQLJDuSAh54kwFSP0eeAQQ4M5EBQgMEmwFXywFo0gFyWwMcapQBBugBPUW2AVgBKmy3AR6PAbMBGQxrUJECvQR+8gFoWDsYgQNwRSczBRXQAgtRswEW0ALMAREYAUEBIG6yATYCRE8OxgER8gMBvQEDRkwLc8MBTwHZAUOnAXiiBakDIbYBNNcCIUmuArIBSakBrgFHKs0EgwV/G3AD0wE6LgECtQJ4xQFwFbUCjQPkBS6vAQqEAUZF3QIM9wEhCoYCQhXsBCyZArQDugIziALWAdIBlQHwBdUErQE6qQaSA4EEIvYBHir9AQVLmgMCApsCKAwHuwgrENsBAjNYswEVmgIt7QJnN4wDEnta+wGfAcUBxgEtEFXQAQWdAUAeBcwBAQM7rAEJATJ0LENrdh73A6UBhAE+qwEeASxLZUMhDREuH0CGARbd7K0GlQo",
|
|
193
|
+
"X-DFE-Phenotype":
|
|
194
|
+
"H4sIAAAAAAAAAB3OO3KjMAAA0KRNuWXukBkBQkAJ2MhgAZb5u2GCwQZbCH_EJ77QHmgvtDtbv-Z9_H63zXXU0NVPB1odlyGy7751Q3CitlPDvFd8lxhz3tpNmz7P92CFw73zdHU2Ie0Ad2kmR8lxhiErTFLt3RPGfJQHSDy7Clw10bg8kqf2owLokN4SecJTLoSwBnzQSd652_MOf2d1vKBNVedzg4ciPoLz2mQ8efGAgYeLou-l-PXn_7Sna1MfhHuySxt-4esulEDp8Sbq54CPPKjpANW-lkU2IZ0F92LBI-ukCKSptqeq1eXU96LD9nZfhKHdtjSWwJqUm_2r6pMHOxk01saVanmNopjX3YxQafC4iC6T55aRbC8nTI98AF_kItIQAJb5EQxnKTO7TZDWnr01HVPxelb9A2OWX6poidMWl16K54kcu_jhXw-JSBQkVcD_fPsLSZu6joIBAAA",
|
|
195
|
+
"X-DFE-Client-Id": "am-android-google",
|
|
196
|
+
"X-DFE-Network-Type": "4",
|
|
197
|
+
"X-DFE-Content-Filters": "",
|
|
198
|
+
"X-Limit-Ad-Tracking-Enabled": "false",
|
|
199
|
+
"X-Ad-Id": "",
|
|
200
|
+
"X-DFE-UserLanguages": "en",
|
|
201
|
+
"X-DFE-Request-Params": "timeoutMs=4000",
|
|
202
|
+
"X-DFE-Device-Checkin-Consistency-Token": checkinResponse.deviceCheckinConsistencyToken,
|
|
203
|
+
"X-DFE-Device-Config-Token": uploadDeviceConfigResponse.uploadDeviceConfigToken,
|
|
204
|
+
};
|
|
205
|
+
});
|
package/src/internal/device.ts
CHANGED
|
@@ -1,13 +1,37 @@
|
|
|
1
|
-
import type * as PlatformError from "
|
|
2
|
-
import type * as
|
|
1
|
+
import type * as PlatformError from "effect/PlatformError";
|
|
2
|
+
import type * as HttpClient from "effect/unstable/http/HttpClient";
|
|
3
|
+
import type * as HttpClientError from "effect/unstable/http/HttpClientError";
|
|
3
4
|
|
|
4
|
-
import * as FileSystem from "@effect/platform/FileSystem";
|
|
5
5
|
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as FileSystem from "effect/FileSystem";
|
|
7
|
+
import * as Path from "effect/Path";
|
|
6
8
|
import * as Schema from "effect/Schema";
|
|
7
|
-
import * as
|
|
9
|
+
import * as SchemaGetter from "effect/SchemaGetter";
|
|
10
|
+
import * as SchemaTransformation from "effect/SchemaTransformation";
|
|
11
|
+
|
|
12
|
+
import * as internalAuth from "./auth.ts";
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const StringArrayFromString = Schema.suspend(() => {
|
|
16
|
+
const splitter = SchemaGetter.split({ separator: "," });
|
|
17
|
+
const joiner = SchemaGetter.transform((arr: ReadonlyArray<string>) => arr.join(","));
|
|
18
|
+
const transform = SchemaTransformation.make({ encode: joiner, decode: splitter });
|
|
19
|
+
return Schema.String.pipe(Schema.decodeTo(Schema.Array(Schema.String), transform));
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const BooleanFromString = Schema.Literals(["true", "false"]).pipe(
|
|
24
|
+
Schema.decodeTo(
|
|
25
|
+
Schema.Boolean,
|
|
26
|
+
SchemaTransformation.transform({
|
|
27
|
+
decode: (str) => str === "true",
|
|
28
|
+
encode: (bool) => (bool ? "true" : "false"),
|
|
29
|
+
})
|
|
30
|
+
)
|
|
31
|
+
);
|
|
8
32
|
|
|
9
33
|
/** @internal */
|
|
10
|
-
export class
|
|
34
|
+
export class AndroidDevice extends Schema.Class<AndroidDevice>("AndroidDevice")({
|
|
11
35
|
UserReadableName: Schema.String,
|
|
12
36
|
"Build.BOOTLOADER": Schema.String,
|
|
13
37
|
"Build.BRAND": Schema.String,
|
|
@@ -23,37 +47,22 @@ export class Device extends Schema.Class<Device>("Device")({
|
|
|
23
47
|
"Build.VERSION.SDK_INT": Schema.NumberFromString,
|
|
24
48
|
CellOperator: Schema.String,
|
|
25
49
|
Client: Schema.String,
|
|
26
|
-
Features:
|
|
27
|
-
|
|
28
|
-
decode: (str) => str.split(","),
|
|
29
|
-
}),
|
|
30
|
-
"GL.Extensions": Schema.transform(Schema.String, Schema.Array(Schema.String), {
|
|
31
|
-
encode: (extensions) => extensions.join(","),
|
|
32
|
-
decode: (str) => str.split(","),
|
|
33
|
-
}),
|
|
50
|
+
Features: StringArrayFromString,
|
|
51
|
+
"GL.Extensions": StringArrayFromString,
|
|
34
52
|
"GL.Version": Schema.NumberFromString,
|
|
35
53
|
"GSF.version": Schema.NumberFromString,
|
|
36
|
-
HasFiveWayNavigation:
|
|
37
|
-
HasHardKeyboard:
|
|
54
|
+
HasFiveWayNavigation: BooleanFromString,
|
|
55
|
+
HasHardKeyboard: BooleanFromString,
|
|
38
56
|
Keyboard: Schema.NumberFromString,
|
|
39
|
-
Locales:
|
|
40
|
-
encode: (locales) => locales.join(","),
|
|
41
|
-
decode: (str) => str.split(","),
|
|
42
|
-
}),
|
|
57
|
+
Locales: StringArrayFromString,
|
|
43
58
|
Navigation: Schema.NumberFromString,
|
|
44
|
-
Platforms:
|
|
45
|
-
encode: (libs) => libs.join(","),
|
|
46
|
-
decode: (str) => str.split(","),
|
|
47
|
-
}),
|
|
59
|
+
Platforms: StringArrayFromString,
|
|
48
60
|
Roaming: Schema.String,
|
|
49
61
|
"Screen.Density": Schema.NumberFromString,
|
|
50
62
|
"Screen.Height": Schema.NumberFromString,
|
|
51
63
|
"Screen.Width": Schema.NumberFromString,
|
|
52
64
|
ScreenLayout: Schema.NumberFromString,
|
|
53
|
-
SharedLibraries:
|
|
54
|
-
encode: (libs) => libs.join(","),
|
|
55
|
-
decode: (str) => str.split(","),
|
|
56
|
-
}),
|
|
65
|
+
SharedLibraries: StringArrayFromString,
|
|
57
66
|
SimCountry: Schema.String.pipe(Schema.optional),
|
|
58
67
|
SimOperator: Schema.String.pipe(Schema.optional),
|
|
59
68
|
TimeZone: Schema.String,
|
|
@@ -61,16 +70,34 @@ export class Device extends Schema.Class<Device>("Device")({
|
|
|
61
70
|
"Vending.version": Schema.NumberFromString,
|
|
62
71
|
"Vending.versionString": Schema.String,
|
|
63
72
|
}) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
private authHeadersCache?: Record<string, string> | undefined = undefined;
|
|
74
|
+
|
|
75
|
+
public static fromPropertiesFile = Effect.fnUntraced(function* (
|
|
76
|
+
file: string
|
|
77
|
+
): Effect.fn.Return<AndroidDevice, Schema.SchemaError | PlatformError.PlatformError, FileSystem.FileSystem> {
|
|
78
|
+
const decodeDevice = Schema.decodeUnknownEffect(AndroidDevice);
|
|
79
|
+
const decodePropertiesFile = Schema.decodeEffect(
|
|
80
|
+
Schema.String.pipe(
|
|
81
|
+
Schema.decodeTo(
|
|
82
|
+
Schema.Record(Schema.String, Schema.String),
|
|
83
|
+
SchemaTransformation.splitKeyValue({
|
|
84
|
+
keyValueSeparator: "=",
|
|
85
|
+
separator: "\n",
|
|
86
|
+
})
|
|
87
|
+
)
|
|
88
|
+
)
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
const fileSystem = yield* FileSystem.FileSystem;
|
|
92
|
+
const content = yield* fileSystem.readFileString(file);
|
|
93
|
+
const properties = yield* decodePropertiesFile(content);
|
|
94
|
+
return yield* decodeDevice(properties);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
public static EmbeddedPixel7a = Path.Path.pipe(
|
|
98
|
+
Effect.flatMap((path) => path.fromFileUrl(new URL("../../devices/arm64_xxhdpi.properties", import.meta.url))),
|
|
99
|
+
Effect.flatMap(AndroidDevice.fromPropertiesFile)
|
|
100
|
+
);
|
|
74
101
|
|
|
75
102
|
public get userAgent(): string {
|
|
76
103
|
const deviceProperties = {
|
|
@@ -93,4 +120,18 @@ export class Device extends Schema.Class<Device>("Device")({
|
|
|
93
120
|
|
|
94
121
|
return `Android-Finsky/${this["Vending.versionString"]} (${devicePropertiesString})`;
|
|
95
122
|
}
|
|
123
|
+
|
|
124
|
+
public readonly authHeaders: Effect.Effect<
|
|
125
|
+
Record<string, string>,
|
|
126
|
+
HttpClientError.HttpClientError | Schema.SchemaError,
|
|
127
|
+
HttpClient.HttpClient
|
|
128
|
+
> = Effect.gen({ self: this }, function* () {
|
|
129
|
+
if (this.authHeadersCache) {
|
|
130
|
+
return this.authHeadersCache;
|
|
131
|
+
} else {
|
|
132
|
+
const authHeaders = yield* internalAuth.authHeaders(this);
|
|
133
|
+
this.authHeadersCache = authHeaders;
|
|
134
|
+
return this.authHeadersCache;
|
|
135
|
+
}
|
|
136
|
+
});
|
|
96
137
|
}
|
package/src/internal/http.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import * as Protobuf from "@bufbuild/protobuf";
|
|
2
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
3
|
-
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
4
|
-
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
5
1
|
import * as Effect from "effect/Effect";
|
|
6
2
|
import * as Function from "effect/Function";
|
|
7
3
|
import * as Predicate from "effect/Predicate";
|
|
4
|
+
import * as HttpClientError from "effect/unstable/http/HttpClientError";
|
|
5
|
+
import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest";
|
|
6
|
+
import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse";
|
|
7
|
+
|
|
8
|
+
import * as Protobuf from "@bufbuild/protobuf";
|
|
8
9
|
|
|
9
10
|
import { type PayloadSchema, ResponseWrapperSchema } from "../generated/GooglePlay_pb.ts";
|
|
10
11
|
|
|
@@ -27,7 +28,7 @@ export const encodeRequest = Function.dual<
|
|
|
27
28
|
) => Effect.Effect<HttpClientRequest.HttpClientRequest, HttpClientError.HttpClientError, never>
|
|
28
29
|
>(
|
|
29
30
|
// Data first if the first argument is an http request
|
|
30
|
-
(arguments_) =>
|
|
31
|
+
(arguments_: IArguments) => HttpClientRequest.isHttpClientRequest(arguments_[0]),
|
|
31
32
|
|
|
32
33
|
// Body implementation
|
|
33
34
|
Effect.fn("encodeRequest")(function* <Description extends Protobuf.DescMessage>(
|
|
@@ -47,11 +48,12 @@ export const encodeRequest = Function.dual<
|
|
|
47
48
|
options ?? { writeUnknownFields: true }
|
|
48
49
|
),
|
|
49
50
|
catch: (cause) =>
|
|
50
|
-
new HttpClientError.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
new HttpClientError.HttpClientError({
|
|
52
|
+
reason: new HttpClientError.EncodeError({
|
|
53
|
+
description: `Could not encode message of type ${messageType}`,
|
|
54
|
+
request,
|
|
55
|
+
cause,
|
|
56
|
+
}),
|
|
55
57
|
}),
|
|
56
58
|
});
|
|
57
59
|
|
|
@@ -77,7 +79,7 @@ export const decodeResponse = Function.dual<
|
|
|
77
79
|
) => Effect.Effect<Exclude<Protobuf.MessageShape<Desc>, undefined>, HttpClientError.HttpClientError, never>
|
|
78
80
|
>(
|
|
79
81
|
// Data first if the first argument is an http response
|
|
80
|
-
(arguments_) => Predicate.hasProperty(arguments_[0], HttpClientResponse.TypeId),
|
|
82
|
+
(arguments_: IArguments) => Predicate.hasProperty(arguments_[0], HttpClientResponse.TypeId),
|
|
81
83
|
|
|
82
84
|
// Body implementation
|
|
83
85
|
Effect.fn("decodeResponse")(function* <Desc extends Protobuf.DescMessage>(
|
|
@@ -97,21 +99,23 @@ export const decodeResponse = Function.dual<
|
|
|
97
99
|
options ?? { readUnknownFields: true }
|
|
98
100
|
),
|
|
99
101
|
catch: (cause) =>
|
|
100
|
-
new HttpClientError.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
new HttpClientError.HttpClientError({
|
|
103
|
+
reason: new HttpClientError.DecodeError({
|
|
104
|
+
description: `Could not decode message of type ${messageType}`,
|
|
105
|
+
request: response.request,
|
|
106
|
+
response,
|
|
107
|
+
cause,
|
|
108
|
+
}),
|
|
106
109
|
}),
|
|
107
110
|
});
|
|
108
111
|
|
|
109
112
|
if (Predicate.isUndefined(message)) {
|
|
110
|
-
return yield* new HttpClientError.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
return yield* new HttpClientError.HttpClientError({
|
|
114
|
+
reason: new HttpClientError.DecodeError({
|
|
115
|
+
description: `Message of type ${messageType} is missing`,
|
|
116
|
+
request: response.request,
|
|
117
|
+
response,
|
|
118
|
+
}),
|
|
115
119
|
});
|
|
116
120
|
}
|
|
117
121
|
|
|
@@ -154,7 +158,7 @@ export const decodeResponseFromResponseWrapper = Function.dual<
|
|
|
154
158
|
>
|
|
155
159
|
>(
|
|
156
160
|
// Data first if the first argument is an http response
|
|
157
|
-
(arguments_) => Predicate.hasProperty(arguments_[0], HttpClientResponse.TypeId),
|
|
161
|
+
(arguments_: IArguments) => Predicate.hasProperty(arguments_[0], HttpClientResponse.TypeId),
|
|
158
162
|
|
|
159
163
|
// Body implementation
|
|
160
164
|
Effect.fn("decodeResponse")(function* <
|
|
@@ -171,21 +175,23 @@ export const decodeResponseFromResponseWrapper = Function.dual<
|
|
|
171
175
|
const responseWrapper = yield* decodeResponse(response, ResponseWrapperSchema, options);
|
|
172
176
|
|
|
173
177
|
if (Predicate.isNotUndefined(responseWrapper.commands?.displayErrorMessage)) {
|
|
174
|
-
return yield* new HttpClientError.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
return yield* new HttpClientError.HttpClientError({
|
|
179
|
+
reason: new HttpClientError.DecodeError({
|
|
180
|
+
description: responseWrapper.commands.displayErrorMessage,
|
|
181
|
+
request: response.request,
|
|
182
|
+
response,
|
|
183
|
+
}),
|
|
179
184
|
});
|
|
180
185
|
}
|
|
181
186
|
|
|
182
187
|
const extracted = responseWrapper.payload?.[extractPayload];
|
|
183
188
|
if (Predicate.isUndefined(extracted)) {
|
|
184
|
-
return yield* new HttpClientError.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
+
return yield* new HttpClientError.HttpClientError({
|
|
190
|
+
reason: new HttpClientError.DecodeError({
|
|
191
|
+
description: `ResponseWrapper has no payload of type ${extractPayload}`,
|
|
192
|
+
request: response.request,
|
|
193
|
+
response,
|
|
194
|
+
}),
|
|
189
195
|
});
|
|
190
196
|
}
|
|
191
197
|
|