godprotocol 2.3.25 → 2.3.27
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/package.json
CHANGED
|
@@ -144,7 +144,7 @@ class Headers extends Services {
|
|
|
144
144
|
{
|
|
145
145
|
api_key,
|
|
146
146
|
token: authorization,
|
|
147
|
-
api_version: "v3",
|
|
147
|
+
api_version: "identity:v3",
|
|
148
148
|
},
|
|
149
149
|
);
|
|
150
150
|
|
|
@@ -213,6 +213,7 @@ class Headers extends Services {
|
|
|
213
213
|
{
|
|
214
214
|
token: authorization,
|
|
215
215
|
xplatform,
|
|
216
|
+
api_version: "identity:v3",
|
|
216
217
|
},
|
|
217
218
|
);
|
|
218
219
|
|
|
@@ -81,9 +81,10 @@ class Services {
|
|
|
81
81
|
let headers = {
|
|
82
82
|
"Content-Type": "application/json",
|
|
83
83
|
Accept: "application/json",
|
|
84
|
-
"x-api-version":
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
"x-api-version":
|
|
85
|
+
servic.local && !header.api_version.startsWith(`${servic.local}:`)
|
|
86
|
+
? `${servic.local}:${header.api_version || servic.api_version}`
|
|
87
|
+
: header.api_version || servic.api_version || "v1",
|
|
87
88
|
};
|
|
88
89
|
|
|
89
90
|
if (header?.api_key) {
|
|
@@ -132,9 +133,18 @@ class Services {
|
|
|
132
133
|
},
|
|
133
134
|
);
|
|
134
135
|
|
|
136
|
+
let reply = await response.json();
|
|
137
|
+
|
|
135
138
|
this.get_version(prev_version);
|
|
136
139
|
|
|
137
|
-
|
|
140
|
+
if (!reply?.ok) {
|
|
141
|
+
return {
|
|
142
|
+
ok: false,
|
|
143
|
+
message: `Response calling ${service} service at path ${path}`,
|
|
144
|
+
data: reply,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
return reply;
|
|
138
148
|
} catch (e) {
|
|
139
149
|
return {
|
|
140
150
|
ok: false,
|