@0xsequence/userdata 3.0.0-beta.18 → 3.0.0-beta.19
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +4 -0
- package/.turbo/turbo-typecheck.log +4 -0
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -21
- package/dist/userdata.gen.js +99 -132
- package/eslint.config.js +4 -0
- package/package.json +7 -4
- package/src/index.ts +3 -3
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './userdata.gen';
|
|
2
|
-
import { UserData as UserdataRpc } from './userdata.gen';
|
|
1
|
+
export * from './userdata.gen.js';
|
|
2
|
+
import { UserData as UserdataRpc } from './userdata.gen.js';
|
|
3
3
|
export declare class SequenceUserdataClient extends UserdataRpc {
|
|
4
4
|
projectAccessKey?: string | undefined;
|
|
5
5
|
jwtAuth?: string | undefined;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AAEjC,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE3D,qBAAa,sBAAuB,SAAQ,WAAW;IAG5C,gBAAgB,CAAC,EAAE,MAAM;IACzB,OAAO,CAAC,EAAE,MAAM;gBAFvB,QAAQ,EAAE,MAAM,EACT,gBAAgB,CAAC,EAAE,MAAM,YAAA,EACzB,OAAO,CAAC,EAAE,MAAM,YAAA;IAMzB,MAAM,GAAI,OAAO,WAAW,EAAE,OAAO,WAAW,KAAG,OAAO,CAAC,QAAQ,CAAC,CAoBnE;CACF"}
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.SequenceUserdataClient = void 0;
|
|
18
|
-
__exportStar(require("./userdata.gen"), exports);
|
|
19
|
-
const userdata_gen_1 = require("./userdata.gen");
|
|
20
|
-
class SequenceUserdataClient extends userdata_gen_1.UserData {
|
|
1
|
+
export * from './userdata.gen.js';
|
|
2
|
+
import { UserData as UserdataRpc } from './userdata.gen.js';
|
|
3
|
+
export class SequenceUserdataClient extends UserdataRpc {
|
|
21
4
|
projectAccessKey;
|
|
22
5
|
jwtAuth;
|
|
23
6
|
constructor(hostname, projectAccessKey, jwtAuth) {
|
|
@@ -43,4 +26,3 @@ class SequenceUserdataClient extends userdata_gen_1.UserData {
|
|
|
43
26
|
return fetch(input, init);
|
|
44
27
|
};
|
|
45
28
|
}
|
|
46
|
-
exports.SequenceUserdataClient = SequenceUserdataClient;
|
package/dist/userdata.gen.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint-disable */
|
|
3
2
|
// userdata v0.1.0 88764bb5f99353e11d849a1aa8f8a998501ffedb
|
|
4
3
|
// --
|
|
5
4
|
// Code generated by Webrpc-gen@v0.30.2 with typescript generator. DO NOT EDIT.
|
|
6
5
|
//
|
|
7
6
|
// webrpc-gen -schema=userdata.ridl -target=typescript -client -out=./clients/userdata.gen.ts
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.WebrpcHeaderValue = exports.WebrpcHeader = exports.webrpcErrorByCode = exports.WebrpcErrorCodes = exports.errors = exports.UnsupportedNetworkError = exports.NotFoundError = exports.QueryFailedError = exports.UnavailableError = exports.InvalidArgumentError = exports.ProjectNotFoundError = exports.RateLimitedError = exports.GeoblockedError = exports.AbortedError = exports.RequestConflictError = exports.MethodNotFoundError = exports.SessionExpiredError = exports.PermissionDeniedError = exports.UnauthorizedError = exports.WebrpcStreamFinishedError = exports.WebrpcStreamLostError = exports.WebrpcClientAbortedError = exports.WebrpcInternalErrorError = exports.WebrpcServerPanicError = exports.WebrpcBadResponseError = exports.WebrpcBadRequestError = exports.WebrpcBadMethodError = exports.WebrpcBadRouteError = exports.WebrpcRequestFailedError = exports.WebrpcEndpointError = exports.WebrpcError = exports.JsonDecode = exports.JsonEncode = exports.UserData = exports.WebrpcSchemaHash = exports.WebrpcSchemaVersion = exports.WebrpcVersion = void 0;
|
|
10
|
-
exports.VersionFromHeader = VersionFromHeader;
|
|
11
7
|
// Webrpc description and code-gen version
|
|
12
|
-
|
|
8
|
+
export const WebrpcVersion = 'v1';
|
|
13
9
|
// Schema version of your RIDL schema
|
|
14
|
-
|
|
10
|
+
export const WebrpcSchemaVersion = 'v0.1.0';
|
|
15
11
|
// Schema hash generated from your RIDL schema
|
|
16
|
-
|
|
12
|
+
export const WebrpcSchemaHash = '88764bb5f99353e11d849a1aa8f8a998501ffedb';
|
|
17
13
|
//
|
|
18
14
|
// Client
|
|
19
15
|
//
|
|
20
|
-
class UserData {
|
|
16
|
+
export class UserData {
|
|
21
17
|
hostname;
|
|
22
18
|
fetch;
|
|
23
19
|
path = '/rpc/UserData/';
|
|
@@ -62,7 +58,7 @@ class UserData {
|
|
|
62
58
|
getCapabilities = (headers, signal) => {
|
|
63
59
|
return this.fetch(this.url('GetCapabilities'), createHttpRequest('{}', headers, signal)).then((res) => {
|
|
64
60
|
return buildResponse(res).then((_data) => {
|
|
65
|
-
return
|
|
61
|
+
return JsonDecode(_data, 'GetCapabilitiesResponse');
|
|
66
62
|
});
|
|
67
63
|
}, (error) => {
|
|
68
64
|
throw WebrpcRequestFailedError.new({
|
|
@@ -71,9 +67,9 @@ class UserData {
|
|
|
71
67
|
});
|
|
72
68
|
};
|
|
73
69
|
getAccessToken = (req, headers, signal) => {
|
|
74
|
-
return this.fetch(this.url('GetAccessToken'), createHttpRequest(
|
|
70
|
+
return this.fetch(this.url('GetAccessToken'), createHttpRequest(JsonEncode(req, 'GetAccessTokenRequest'), headers, signal)).then((res) => {
|
|
75
71
|
return buildResponse(res).then((_data) => {
|
|
76
|
-
return
|
|
72
|
+
return JsonDecode(_data, 'GetAccessTokenResponse');
|
|
77
73
|
});
|
|
78
74
|
}, (error) => {
|
|
79
75
|
throw WebrpcRequestFailedError.new({
|
|
@@ -82,9 +78,9 @@ class UserData {
|
|
|
82
78
|
});
|
|
83
79
|
};
|
|
84
80
|
getIdentityToken = (req, headers, signal) => {
|
|
85
|
-
return this.fetch(this.url('GetIdentityToken'), createHttpRequest(
|
|
81
|
+
return this.fetch(this.url('GetIdentityToken'), createHttpRequest(JsonEncode(req, 'GetIdentityTokenRequest'), headers, signal)).then((res) => {
|
|
86
82
|
return buildResponse(res).then((_data) => {
|
|
87
|
-
return
|
|
83
|
+
return JsonDecode(_data, 'GetIdentityTokenResponse');
|
|
88
84
|
});
|
|
89
85
|
}, (error) => {
|
|
90
86
|
throw WebrpcRequestFailedError.new({
|
|
@@ -93,9 +89,9 @@ class UserData {
|
|
|
93
89
|
});
|
|
94
90
|
};
|
|
95
91
|
getWalletPreferences = (req, headers, signal) => {
|
|
96
|
-
return this.fetch(this.url('GetWalletPreferences'), createHttpRequest(
|
|
92
|
+
return this.fetch(this.url('GetWalletPreferences'), createHttpRequest(JsonEncode(req, 'GetWalletPreferencesRequest'), headers, signal)).then((res) => {
|
|
97
93
|
return buildResponse(res).then((_data) => {
|
|
98
|
-
return
|
|
94
|
+
return JsonDecode(_data, 'GetWalletPreferencesResponse');
|
|
99
95
|
});
|
|
100
96
|
}, (error) => {
|
|
101
97
|
throw WebrpcRequestFailedError.new({
|
|
@@ -104,9 +100,9 @@ class UserData {
|
|
|
104
100
|
});
|
|
105
101
|
};
|
|
106
102
|
putWalletPreferences = (req, headers, signal) => {
|
|
107
|
-
return this.fetch(this.url('PutWalletPreferences'), createHttpRequest(
|
|
103
|
+
return this.fetch(this.url('PutWalletPreferences'), createHttpRequest(JsonEncode(req, 'PutWalletPreferencesRequest'), headers, signal)).then((res) => {
|
|
108
104
|
return buildResponse(res).then((_data) => {
|
|
109
|
-
return
|
|
105
|
+
return JsonDecode(_data, 'PutWalletPreferencesResponse');
|
|
110
106
|
});
|
|
111
107
|
}, (error) => {
|
|
112
108
|
throw WebrpcRequestFailedError.new({
|
|
@@ -115,9 +111,9 @@ class UserData {
|
|
|
115
111
|
});
|
|
116
112
|
};
|
|
117
113
|
listWalletSigners = (req, headers, signal) => {
|
|
118
|
-
return this.fetch(this.url('ListWalletSigners'), createHttpRequest(
|
|
114
|
+
return this.fetch(this.url('ListWalletSigners'), createHttpRequest(JsonEncode(req, 'ListWalletSignersRequest'), headers, signal)).then((res) => {
|
|
119
115
|
return buildResponse(res).then((_data) => {
|
|
120
|
-
return
|
|
116
|
+
return JsonDecode(_data, 'ListWalletSignersResponse');
|
|
121
117
|
});
|
|
122
118
|
}, (error) => {
|
|
123
119
|
throw WebrpcRequestFailedError.new({
|
|
@@ -126,9 +122,9 @@ class UserData {
|
|
|
126
122
|
});
|
|
127
123
|
};
|
|
128
124
|
putWalletSigner = (req, headers, signal) => {
|
|
129
|
-
return this.fetch(this.url('PutWalletSigner'), createHttpRequest(
|
|
125
|
+
return this.fetch(this.url('PutWalletSigner'), createHttpRequest(JsonEncode(req, 'PutWalletSignerRequest'), headers, signal)).then((res) => {
|
|
130
126
|
return buildResponse(res).then((_data) => {
|
|
131
|
-
return
|
|
127
|
+
return JsonDecode(_data, 'PutWalletSignerResponse');
|
|
132
128
|
});
|
|
133
129
|
}, (error) => {
|
|
134
130
|
throw WebrpcRequestFailedError.new({
|
|
@@ -137,9 +133,9 @@ class UserData {
|
|
|
137
133
|
});
|
|
138
134
|
};
|
|
139
135
|
deleteWalletSigner = (req, headers, signal) => {
|
|
140
|
-
return this.fetch(this.url('DeleteWalletSigner'), createHttpRequest(
|
|
136
|
+
return this.fetch(this.url('DeleteWalletSigner'), createHttpRequest(JsonEncode(req, 'DeleteWalletSignerRequest'), headers, signal)).then((res) => {
|
|
141
137
|
return buildResponse(res).then((_data) => {
|
|
142
|
-
return
|
|
138
|
+
return JsonDecode(_data, 'DeleteWalletSignerResponse');
|
|
143
139
|
});
|
|
144
140
|
}, (error) => {
|
|
145
141
|
throw WebrpcRequestFailedError.new({
|
|
@@ -148,9 +144,9 @@ class UserData {
|
|
|
148
144
|
});
|
|
149
145
|
};
|
|
150
146
|
listSessions = (req, headers, signal) => {
|
|
151
|
-
return this.fetch(this.url('ListSessions'), createHttpRequest(
|
|
147
|
+
return this.fetch(this.url('ListSessions'), createHttpRequest(JsonEncode(req, 'ListSessionsRequest'), headers, signal)).then((res) => {
|
|
152
148
|
return buildResponse(res).then((_data) => {
|
|
153
|
-
return
|
|
149
|
+
return JsonDecode(_data, 'ListSessionsResponse');
|
|
154
150
|
});
|
|
155
151
|
}, (error) => {
|
|
156
152
|
throw WebrpcRequestFailedError.new({
|
|
@@ -159,9 +155,9 @@ class UserData {
|
|
|
159
155
|
});
|
|
160
156
|
};
|
|
161
157
|
putSession = (req, headers, signal) => {
|
|
162
|
-
return this.fetch(this.url('PutSession'), createHttpRequest(
|
|
158
|
+
return this.fetch(this.url('PutSession'), createHttpRequest(JsonEncode(req, 'PutSessionRequest'), headers, signal)).then((res) => {
|
|
163
159
|
return buildResponse(res).then((_data) => {
|
|
164
|
-
return
|
|
160
|
+
return JsonDecode(_data, 'PutSessionResponse');
|
|
165
161
|
});
|
|
166
162
|
}, (error) => {
|
|
167
163
|
throw WebrpcRequestFailedError.new({
|
|
@@ -170,9 +166,9 @@ class UserData {
|
|
|
170
166
|
});
|
|
171
167
|
};
|
|
172
168
|
deleteSession = (req, headers, signal) => {
|
|
173
|
-
return this.fetch(this.url('DeleteSession'), createHttpRequest(
|
|
169
|
+
return this.fetch(this.url('DeleteSession'), createHttpRequest(JsonEncode(req, 'DeleteSessionRequest'), headers, signal)).then((res) => {
|
|
174
170
|
return buildResponse(res).then((_data) => {
|
|
175
|
-
return
|
|
171
|
+
return JsonDecode(_data, 'DeleteSessionResponse');
|
|
176
172
|
});
|
|
177
173
|
}, (error) => {
|
|
178
174
|
throw WebrpcRequestFailedError.new({
|
|
@@ -181,9 +177,9 @@ class UserData {
|
|
|
181
177
|
});
|
|
182
178
|
};
|
|
183
179
|
listContacts = (req, headers, signal) => {
|
|
184
|
-
return this.fetch(this.url('ListContacts'), createHttpRequest(
|
|
180
|
+
return this.fetch(this.url('ListContacts'), createHttpRequest(JsonEncode(req, 'ListContactsRequest'), headers, signal)).then((res) => {
|
|
185
181
|
return buildResponse(res).then((_data) => {
|
|
186
|
-
return
|
|
182
|
+
return JsonDecode(_data, 'ListContactsResponse');
|
|
187
183
|
});
|
|
188
184
|
}, (error) => {
|
|
189
185
|
throw WebrpcRequestFailedError.new({
|
|
@@ -192,9 +188,9 @@ class UserData {
|
|
|
192
188
|
});
|
|
193
189
|
};
|
|
194
190
|
putContact = (req, headers, signal) => {
|
|
195
|
-
return this.fetch(this.url('PutContact'), createHttpRequest(
|
|
191
|
+
return this.fetch(this.url('PutContact'), createHttpRequest(JsonEncode(req, 'PutContactRequest'), headers, signal)).then((res) => {
|
|
196
192
|
return buildResponse(res).then((_data) => {
|
|
197
|
-
return
|
|
193
|
+
return JsonDecode(_data, 'PutContactResponse');
|
|
198
194
|
});
|
|
199
195
|
}, (error) => {
|
|
200
196
|
throw WebrpcRequestFailedError.new({
|
|
@@ -203,9 +199,9 @@ class UserData {
|
|
|
203
199
|
});
|
|
204
200
|
};
|
|
205
201
|
deleteContact = (req, headers, signal) => {
|
|
206
|
-
return this.fetch(this.url('DeleteContact'), createHttpRequest(
|
|
202
|
+
return this.fetch(this.url('DeleteContact'), createHttpRequest(JsonEncode(req, 'DeleteContactRequest'), headers, signal)).then((res) => {
|
|
207
203
|
return buildResponse(res).then((_data) => {
|
|
208
|
-
return
|
|
204
|
+
return JsonDecode(_data, 'DeleteContactResponse');
|
|
209
205
|
});
|
|
210
206
|
}, (error) => {
|
|
211
207
|
throw WebrpcRequestFailedError.new({
|
|
@@ -214,9 +210,9 @@ class UserData {
|
|
|
214
210
|
});
|
|
215
211
|
};
|
|
216
212
|
listWatchedWallets = (req, headers, signal) => {
|
|
217
|
-
return this.fetch(this.url('ListWatchedWallets'), createHttpRequest(
|
|
213
|
+
return this.fetch(this.url('ListWatchedWallets'), createHttpRequest(JsonEncode(req, 'ListWatchedWalletsRequest'), headers, signal)).then((res) => {
|
|
218
214
|
return buildResponse(res).then((_data) => {
|
|
219
|
-
return
|
|
215
|
+
return JsonDecode(_data, 'ListWatchedWalletsResponse');
|
|
220
216
|
});
|
|
221
217
|
}, (error) => {
|
|
222
218
|
throw WebrpcRequestFailedError.new({
|
|
@@ -225,9 +221,9 @@ class UserData {
|
|
|
225
221
|
});
|
|
226
222
|
};
|
|
227
223
|
putWatchedWallet = (req, headers, signal) => {
|
|
228
|
-
return this.fetch(this.url('PutWatchedWallet'), createHttpRequest(
|
|
224
|
+
return this.fetch(this.url('PutWatchedWallet'), createHttpRequest(JsonEncode(req, 'PutWatchedWalletRequest'), headers, signal)).then((res) => {
|
|
229
225
|
return buildResponse(res).then((_data) => {
|
|
230
|
-
return
|
|
226
|
+
return JsonDecode(_data, 'PutWatchedWalletResponse');
|
|
231
227
|
});
|
|
232
228
|
}, (error) => {
|
|
233
229
|
throw WebrpcRequestFailedError.new({
|
|
@@ -236,9 +232,9 @@ class UserData {
|
|
|
236
232
|
});
|
|
237
233
|
};
|
|
238
234
|
deleteWatchedWallet = (req, headers, signal) => {
|
|
239
|
-
return this.fetch(this.url('DeleteWatchedWallet'), createHttpRequest(
|
|
235
|
+
return this.fetch(this.url('DeleteWatchedWallet'), createHttpRequest(JsonEncode(req, 'DeleteWatchedWalletRequest'), headers, signal)).then((res) => {
|
|
240
236
|
return buildResponse(res).then((_data) => {
|
|
241
|
-
return
|
|
237
|
+
return JsonDecode(_data, 'DeleteWatchedWalletResponse');
|
|
242
238
|
});
|
|
243
239
|
}, (error) => {
|
|
244
240
|
throw WebrpcRequestFailedError.new({
|
|
@@ -247,9 +243,9 @@ class UserData {
|
|
|
247
243
|
});
|
|
248
244
|
};
|
|
249
245
|
listDiscoverFavorites = (req, headers, signal) => {
|
|
250
|
-
return this.fetch(this.url('ListDiscoverFavorites'), createHttpRequest(
|
|
246
|
+
return this.fetch(this.url('ListDiscoverFavorites'), createHttpRequest(JsonEncode(req, 'ListDiscoverFavoritesRequest'), headers, signal)).then((res) => {
|
|
251
247
|
return buildResponse(res).then((_data) => {
|
|
252
|
-
return
|
|
248
|
+
return JsonDecode(_data, 'ListDiscoverFavoritesResponse');
|
|
253
249
|
});
|
|
254
250
|
}, (error) => {
|
|
255
251
|
throw WebrpcRequestFailedError.new({
|
|
@@ -258,9 +254,9 @@ class UserData {
|
|
|
258
254
|
});
|
|
259
255
|
};
|
|
260
256
|
putDiscoverFavorite = (req, headers, signal) => {
|
|
261
|
-
return this.fetch(this.url('PutDiscoverFavorite'), createHttpRequest(
|
|
257
|
+
return this.fetch(this.url('PutDiscoverFavorite'), createHttpRequest(JsonEncode(req, 'PutDiscoverFavoriteRequest'), headers, signal)).then((res) => {
|
|
262
258
|
return buildResponse(res).then((_data) => {
|
|
263
|
-
return
|
|
259
|
+
return JsonDecode(_data, 'PutDiscoverFavoriteResponse');
|
|
264
260
|
});
|
|
265
261
|
}, (error) => {
|
|
266
262
|
throw WebrpcRequestFailedError.new({
|
|
@@ -269,9 +265,9 @@ class UserData {
|
|
|
269
265
|
});
|
|
270
266
|
};
|
|
271
267
|
deleteDiscoverFavorite = (req, headers, signal) => {
|
|
272
|
-
return this.fetch(this.url('DeleteDiscoverFavorite'), createHttpRequest(
|
|
268
|
+
return this.fetch(this.url('DeleteDiscoverFavorite'), createHttpRequest(JsonEncode(req, 'DeleteDiscoverFavoriteRequest'), headers, signal)).then((res) => {
|
|
273
269
|
return buildResponse(res).then((_data) => {
|
|
274
|
-
return
|
|
270
|
+
return JsonDecode(_data, 'DeleteDiscoverFavoriteResponse');
|
|
275
271
|
});
|
|
276
272
|
}, (error) => {
|
|
277
273
|
throw WebrpcRequestFailedError.new({
|
|
@@ -280,9 +276,9 @@ class UserData {
|
|
|
280
276
|
});
|
|
281
277
|
};
|
|
282
278
|
listDiscoverHistory = (req, headers, signal) => {
|
|
283
|
-
return this.fetch(this.url('ListDiscoverHistory'), createHttpRequest(
|
|
279
|
+
return this.fetch(this.url('ListDiscoverHistory'), createHttpRequest(JsonEncode(req, 'ListDiscoverHistoryRequest'), headers, signal)).then((res) => {
|
|
284
280
|
return buildResponse(res).then((_data) => {
|
|
285
|
-
return
|
|
281
|
+
return JsonDecode(_data, 'ListDiscoverHistoryResponse');
|
|
286
282
|
});
|
|
287
283
|
}, (error) => {
|
|
288
284
|
throw WebrpcRequestFailedError.new({
|
|
@@ -291,9 +287,9 @@ class UserData {
|
|
|
291
287
|
});
|
|
292
288
|
};
|
|
293
289
|
putDiscoverHistory = (req, headers, signal) => {
|
|
294
|
-
return this.fetch(this.url('PutDiscoverHistory'), createHttpRequest(
|
|
290
|
+
return this.fetch(this.url('PutDiscoverHistory'), createHttpRequest(JsonEncode(req, 'PutDiscoverHistoryRequest'), headers, signal)).then((res) => {
|
|
295
291
|
return buildResponse(res).then((_data) => {
|
|
296
|
-
return
|
|
292
|
+
return JsonDecode(_data, 'PutDiscoverHistoryResponse');
|
|
297
293
|
});
|
|
298
294
|
}, (error) => {
|
|
299
295
|
throw WebrpcRequestFailedError.new({
|
|
@@ -302,9 +298,9 @@ class UserData {
|
|
|
302
298
|
});
|
|
303
299
|
};
|
|
304
300
|
deleteDiscoverHistory = (req, headers, signal) => {
|
|
305
|
-
return this.fetch(this.url('DeleteDiscoverHistory'), createHttpRequest(
|
|
301
|
+
return this.fetch(this.url('DeleteDiscoverHistory'), createHttpRequest(JsonEncode(req, 'DeleteDiscoverHistoryRequest'), headers, signal)).then((res) => {
|
|
306
302
|
return buildResponse(res).then((_data) => {
|
|
307
|
-
return
|
|
303
|
+
return JsonDecode(_data, 'DeleteDiscoverHistoryResponse');
|
|
308
304
|
});
|
|
309
305
|
}, (error) => {
|
|
310
306
|
throw WebrpcRequestFailedError.new({
|
|
@@ -313,9 +309,9 @@ class UserData {
|
|
|
313
309
|
});
|
|
314
310
|
};
|
|
315
311
|
listTokenFavorites = (req, headers, signal) => {
|
|
316
|
-
return this.fetch(this.url('ListTokenFavorites'), createHttpRequest(
|
|
312
|
+
return this.fetch(this.url('ListTokenFavorites'), createHttpRequest(JsonEncode(req, 'ListTokenFavoritesRequest'), headers, signal)).then((res) => {
|
|
317
313
|
return buildResponse(res).then((_data) => {
|
|
318
|
-
return
|
|
314
|
+
return JsonDecode(_data, 'ListTokenFavoritesResponse');
|
|
319
315
|
});
|
|
320
316
|
}, (error) => {
|
|
321
317
|
throw WebrpcRequestFailedError.new({
|
|
@@ -324,9 +320,9 @@ class UserData {
|
|
|
324
320
|
});
|
|
325
321
|
};
|
|
326
322
|
putTokenFavorite = (req, headers, signal) => {
|
|
327
|
-
return this.fetch(this.url('PutTokenFavorite'), createHttpRequest(
|
|
323
|
+
return this.fetch(this.url('PutTokenFavorite'), createHttpRequest(JsonEncode(req, 'PutTokenFavoriteRequest'), headers, signal)).then((res) => {
|
|
328
324
|
return buildResponse(res).then((_data) => {
|
|
329
|
-
return
|
|
325
|
+
return JsonDecode(_data, 'PutTokenFavoriteResponse');
|
|
330
326
|
});
|
|
331
327
|
}, (error) => {
|
|
332
328
|
throw WebrpcRequestFailedError.new({
|
|
@@ -335,9 +331,9 @@ class UserData {
|
|
|
335
331
|
});
|
|
336
332
|
};
|
|
337
333
|
deleteTokenFavorite = (req, headers, signal) => {
|
|
338
|
-
return this.fetch(this.url('DeleteTokenFavorite'), createHttpRequest(
|
|
334
|
+
return this.fetch(this.url('DeleteTokenFavorite'), createHttpRequest(JsonEncode(req, 'DeleteTokenFavoriteRequest'), headers, signal)).then((res) => {
|
|
339
335
|
return buildResponse(res).then((_data) => {
|
|
340
|
-
return
|
|
336
|
+
return JsonDecode(_data, 'DeleteTokenFavoriteResponse');
|
|
341
337
|
});
|
|
342
338
|
}, (error) => {
|
|
343
339
|
throw WebrpcRequestFailedError.new({
|
|
@@ -346,9 +342,9 @@ class UserData {
|
|
|
346
342
|
});
|
|
347
343
|
};
|
|
348
344
|
listHiddenTokens = (req, headers, signal) => {
|
|
349
|
-
return this.fetch(this.url('ListHiddenTokens'), createHttpRequest(
|
|
345
|
+
return this.fetch(this.url('ListHiddenTokens'), createHttpRequest(JsonEncode(req, 'ListHiddenTokensRequest'), headers, signal)).then((res) => {
|
|
350
346
|
return buildResponse(res).then((_data) => {
|
|
351
|
-
return
|
|
347
|
+
return JsonDecode(_data, 'ListHiddenTokensResponse');
|
|
352
348
|
});
|
|
353
349
|
}, (error) => {
|
|
354
350
|
throw WebrpcRequestFailedError.new({
|
|
@@ -357,9 +353,9 @@ class UserData {
|
|
|
357
353
|
});
|
|
358
354
|
};
|
|
359
355
|
putHiddenToken = (req, headers, signal) => {
|
|
360
|
-
return this.fetch(this.url('PutHiddenToken'), createHttpRequest(
|
|
356
|
+
return this.fetch(this.url('PutHiddenToken'), createHttpRequest(JsonEncode(req, 'PutHiddenTokenRequest'), headers, signal)).then((res) => {
|
|
361
357
|
return buildResponse(res).then((_data) => {
|
|
362
|
-
return
|
|
358
|
+
return JsonDecode(_data, 'PutHiddenTokenResponse');
|
|
363
359
|
});
|
|
364
360
|
}, (error) => {
|
|
365
361
|
throw WebrpcRequestFailedError.new({
|
|
@@ -368,9 +364,9 @@ class UserData {
|
|
|
368
364
|
});
|
|
369
365
|
};
|
|
370
366
|
deleteHiddenToken = (req, headers, signal) => {
|
|
371
|
-
return this.fetch(this.url('DeleteHiddenToken'), createHttpRequest(
|
|
367
|
+
return this.fetch(this.url('DeleteHiddenToken'), createHttpRequest(JsonEncode(req, 'DeleteHiddenTokenRequest'), headers, signal)).then((res) => {
|
|
372
368
|
return buildResponse(res).then((_data) => {
|
|
373
|
-
return
|
|
369
|
+
return JsonDecode(_data, 'DeleteHiddenTokenResponse');
|
|
374
370
|
});
|
|
375
371
|
}, (error) => {
|
|
376
372
|
throw WebrpcRequestFailedError.new({
|
|
@@ -379,7 +375,6 @@ class UserData {
|
|
|
379
375
|
});
|
|
380
376
|
};
|
|
381
377
|
}
|
|
382
|
-
exports.UserData = UserData;
|
|
383
378
|
const createHttpRequest = (body = '{}', headers = {}, signal = null) => {
|
|
384
379
|
const reqHeaders = { ...headers, 'Content-Type': 'application/json' };
|
|
385
380
|
return { method: 'POST', headers: reqHeaders, body, signal };
|
|
@@ -398,16 +393,15 @@ const buildResponse = (res) => {
|
|
|
398
393
|
}
|
|
399
394
|
if (!res.ok) {
|
|
400
395
|
const code = typeof data.code === 'number' ? data.code : 0;
|
|
401
|
-
throw (
|
|
396
|
+
throw (webrpcErrorByCode[code] || WebrpcError).new(data);
|
|
402
397
|
}
|
|
403
398
|
return data;
|
|
404
399
|
});
|
|
405
400
|
};
|
|
406
|
-
const JsonEncode = (obj, _typ = '') => {
|
|
401
|
+
export const JsonEncode = (obj, _typ = '') => {
|
|
407
402
|
return JSON.stringify(obj);
|
|
408
403
|
};
|
|
409
|
-
|
|
410
|
-
const JsonDecode = (data, _typ = '') => {
|
|
404
|
+
export const JsonDecode = (data, _typ = '') => {
|
|
411
405
|
let parsed = data;
|
|
412
406
|
if (typeof data === 'string') {
|
|
413
407
|
try {
|
|
@@ -419,8 +413,7 @@ const JsonDecode = (data, _typ = '') => {
|
|
|
419
413
|
}
|
|
420
414
|
return parsed;
|
|
421
415
|
};
|
|
422
|
-
|
|
423
|
-
class WebrpcError extends Error {
|
|
416
|
+
export class WebrpcError extends Error {
|
|
424
417
|
code;
|
|
425
418
|
status;
|
|
426
419
|
constructor(error = {}) {
|
|
@@ -437,8 +430,7 @@ class WebrpcError extends Error {
|
|
|
437
430
|
return new this({ message: payload.message, code: payload.code, status: payload.status, cause: payload.cause });
|
|
438
431
|
}
|
|
439
432
|
}
|
|
440
|
-
|
|
441
|
-
class WebrpcEndpointError extends WebrpcError {
|
|
433
|
+
export class WebrpcEndpointError extends WebrpcError {
|
|
442
434
|
constructor(error = {}) {
|
|
443
435
|
super(error);
|
|
444
436
|
this.name = error.name || 'WebrpcEndpoint';
|
|
@@ -450,8 +442,7 @@ class WebrpcEndpointError extends WebrpcError {
|
|
|
450
442
|
Object.setPrototypeOf(this, WebrpcEndpointError.prototype);
|
|
451
443
|
}
|
|
452
444
|
}
|
|
453
|
-
|
|
454
|
-
class WebrpcRequestFailedError extends WebrpcError {
|
|
445
|
+
export class WebrpcRequestFailedError extends WebrpcError {
|
|
455
446
|
constructor(error = {}) {
|
|
456
447
|
super(error);
|
|
457
448
|
this.name = error.name || 'WebrpcRequestFailed';
|
|
@@ -463,8 +454,7 @@ class WebrpcRequestFailedError extends WebrpcError {
|
|
|
463
454
|
Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype);
|
|
464
455
|
}
|
|
465
456
|
}
|
|
466
|
-
|
|
467
|
-
class WebrpcBadRouteError extends WebrpcError {
|
|
457
|
+
export class WebrpcBadRouteError extends WebrpcError {
|
|
468
458
|
constructor(error = {}) {
|
|
469
459
|
super(error);
|
|
470
460
|
this.name = error.name || 'WebrpcBadRoute';
|
|
@@ -476,8 +466,7 @@ class WebrpcBadRouteError extends WebrpcError {
|
|
|
476
466
|
Object.setPrototypeOf(this, WebrpcBadRouteError.prototype);
|
|
477
467
|
}
|
|
478
468
|
}
|
|
479
|
-
|
|
480
|
-
class WebrpcBadMethodError extends WebrpcError {
|
|
469
|
+
export class WebrpcBadMethodError extends WebrpcError {
|
|
481
470
|
constructor(error = {}) {
|
|
482
471
|
super(error);
|
|
483
472
|
this.name = error.name || 'WebrpcBadMethod';
|
|
@@ -489,8 +478,7 @@ class WebrpcBadMethodError extends WebrpcError {
|
|
|
489
478
|
Object.setPrototypeOf(this, WebrpcBadMethodError.prototype);
|
|
490
479
|
}
|
|
491
480
|
}
|
|
492
|
-
|
|
493
|
-
class WebrpcBadRequestError extends WebrpcError {
|
|
481
|
+
export class WebrpcBadRequestError extends WebrpcError {
|
|
494
482
|
constructor(error = {}) {
|
|
495
483
|
super(error);
|
|
496
484
|
this.name = error.name || 'WebrpcBadRequest';
|
|
@@ -502,8 +490,7 @@ class WebrpcBadRequestError extends WebrpcError {
|
|
|
502
490
|
Object.setPrototypeOf(this, WebrpcBadRequestError.prototype);
|
|
503
491
|
}
|
|
504
492
|
}
|
|
505
|
-
|
|
506
|
-
class WebrpcBadResponseError extends WebrpcError {
|
|
493
|
+
export class WebrpcBadResponseError extends WebrpcError {
|
|
507
494
|
constructor(error = {}) {
|
|
508
495
|
super(error);
|
|
509
496
|
this.name = error.name || 'WebrpcBadResponse';
|
|
@@ -515,8 +502,7 @@ class WebrpcBadResponseError extends WebrpcError {
|
|
|
515
502
|
Object.setPrototypeOf(this, WebrpcBadResponseError.prototype);
|
|
516
503
|
}
|
|
517
504
|
}
|
|
518
|
-
|
|
519
|
-
class WebrpcServerPanicError extends WebrpcError {
|
|
505
|
+
export class WebrpcServerPanicError extends WebrpcError {
|
|
520
506
|
constructor(error = {}) {
|
|
521
507
|
super(error);
|
|
522
508
|
this.name = error.name || 'WebrpcServerPanic';
|
|
@@ -528,8 +514,7 @@ class WebrpcServerPanicError extends WebrpcError {
|
|
|
528
514
|
Object.setPrototypeOf(this, WebrpcServerPanicError.prototype);
|
|
529
515
|
}
|
|
530
516
|
}
|
|
531
|
-
|
|
532
|
-
class WebrpcInternalErrorError extends WebrpcError {
|
|
517
|
+
export class WebrpcInternalErrorError extends WebrpcError {
|
|
533
518
|
constructor(error = {}) {
|
|
534
519
|
super(error);
|
|
535
520
|
this.name = error.name || 'WebrpcInternalError';
|
|
@@ -541,8 +526,7 @@ class WebrpcInternalErrorError extends WebrpcError {
|
|
|
541
526
|
Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype);
|
|
542
527
|
}
|
|
543
528
|
}
|
|
544
|
-
|
|
545
|
-
class WebrpcClientAbortedError extends WebrpcError {
|
|
529
|
+
export class WebrpcClientAbortedError extends WebrpcError {
|
|
546
530
|
constructor(error = {}) {
|
|
547
531
|
super(error);
|
|
548
532
|
this.name = error.name || 'WebrpcClientAborted';
|
|
@@ -554,8 +538,7 @@ class WebrpcClientAbortedError extends WebrpcError {
|
|
|
554
538
|
Object.setPrototypeOf(this, WebrpcClientAbortedError.prototype);
|
|
555
539
|
}
|
|
556
540
|
}
|
|
557
|
-
|
|
558
|
-
class WebrpcStreamLostError extends WebrpcError {
|
|
541
|
+
export class WebrpcStreamLostError extends WebrpcError {
|
|
559
542
|
constructor(error = {}) {
|
|
560
543
|
super(error);
|
|
561
544
|
this.name = error.name || 'WebrpcStreamLost';
|
|
@@ -567,8 +550,7 @@ class WebrpcStreamLostError extends WebrpcError {
|
|
|
567
550
|
Object.setPrototypeOf(this, WebrpcStreamLostError.prototype);
|
|
568
551
|
}
|
|
569
552
|
}
|
|
570
|
-
|
|
571
|
-
class WebrpcStreamFinishedError extends WebrpcError {
|
|
553
|
+
export class WebrpcStreamFinishedError extends WebrpcError {
|
|
572
554
|
constructor(error = {}) {
|
|
573
555
|
super(error);
|
|
574
556
|
this.name = error.name || 'WebrpcStreamFinished';
|
|
@@ -580,11 +562,10 @@ class WebrpcStreamFinishedError extends WebrpcError {
|
|
|
580
562
|
Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype);
|
|
581
563
|
}
|
|
582
564
|
}
|
|
583
|
-
exports.WebrpcStreamFinishedError = WebrpcStreamFinishedError;
|
|
584
565
|
//
|
|
585
566
|
// Schema errors
|
|
586
567
|
//
|
|
587
|
-
class UnauthorizedError extends WebrpcError {
|
|
568
|
+
export class UnauthorizedError extends WebrpcError {
|
|
588
569
|
constructor(error = {}) {
|
|
589
570
|
super(error);
|
|
590
571
|
this.name = error.name || 'Unauthorized';
|
|
@@ -596,8 +577,7 @@ class UnauthorizedError extends WebrpcError {
|
|
|
596
577
|
Object.setPrototypeOf(this, UnauthorizedError.prototype);
|
|
597
578
|
}
|
|
598
579
|
}
|
|
599
|
-
|
|
600
|
-
class PermissionDeniedError extends WebrpcError {
|
|
580
|
+
export class PermissionDeniedError extends WebrpcError {
|
|
601
581
|
constructor(error = {}) {
|
|
602
582
|
super(error);
|
|
603
583
|
this.name = error.name || 'PermissionDenied';
|
|
@@ -609,8 +589,7 @@ class PermissionDeniedError extends WebrpcError {
|
|
|
609
589
|
Object.setPrototypeOf(this, PermissionDeniedError.prototype);
|
|
610
590
|
}
|
|
611
591
|
}
|
|
612
|
-
|
|
613
|
-
class SessionExpiredError extends WebrpcError {
|
|
592
|
+
export class SessionExpiredError extends WebrpcError {
|
|
614
593
|
constructor(error = {}) {
|
|
615
594
|
super(error);
|
|
616
595
|
this.name = error.name || 'SessionExpired';
|
|
@@ -622,8 +601,7 @@ class SessionExpiredError extends WebrpcError {
|
|
|
622
601
|
Object.setPrototypeOf(this, SessionExpiredError.prototype);
|
|
623
602
|
}
|
|
624
603
|
}
|
|
625
|
-
|
|
626
|
-
class MethodNotFoundError extends WebrpcError {
|
|
604
|
+
export class MethodNotFoundError extends WebrpcError {
|
|
627
605
|
constructor(error = {}) {
|
|
628
606
|
super(error);
|
|
629
607
|
this.name = error.name || 'MethodNotFound';
|
|
@@ -635,8 +613,7 @@ class MethodNotFoundError extends WebrpcError {
|
|
|
635
613
|
Object.setPrototypeOf(this, MethodNotFoundError.prototype);
|
|
636
614
|
}
|
|
637
615
|
}
|
|
638
|
-
|
|
639
|
-
class RequestConflictError extends WebrpcError {
|
|
616
|
+
export class RequestConflictError extends WebrpcError {
|
|
640
617
|
constructor(error = {}) {
|
|
641
618
|
super(error);
|
|
642
619
|
this.name = error.name || 'RequestConflict';
|
|
@@ -648,8 +625,7 @@ class RequestConflictError extends WebrpcError {
|
|
|
648
625
|
Object.setPrototypeOf(this, RequestConflictError.prototype);
|
|
649
626
|
}
|
|
650
627
|
}
|
|
651
|
-
|
|
652
|
-
class AbortedError extends WebrpcError {
|
|
628
|
+
export class AbortedError extends WebrpcError {
|
|
653
629
|
constructor(error = {}) {
|
|
654
630
|
super(error);
|
|
655
631
|
this.name = error.name || 'Aborted';
|
|
@@ -661,8 +637,7 @@ class AbortedError extends WebrpcError {
|
|
|
661
637
|
Object.setPrototypeOf(this, AbortedError.prototype);
|
|
662
638
|
}
|
|
663
639
|
}
|
|
664
|
-
|
|
665
|
-
class GeoblockedError extends WebrpcError {
|
|
640
|
+
export class GeoblockedError extends WebrpcError {
|
|
666
641
|
constructor(error = {}) {
|
|
667
642
|
super(error);
|
|
668
643
|
this.name = error.name || 'Geoblocked';
|
|
@@ -674,8 +649,7 @@ class GeoblockedError extends WebrpcError {
|
|
|
674
649
|
Object.setPrototypeOf(this, GeoblockedError.prototype);
|
|
675
650
|
}
|
|
676
651
|
}
|
|
677
|
-
|
|
678
|
-
class RateLimitedError extends WebrpcError {
|
|
652
|
+
export class RateLimitedError extends WebrpcError {
|
|
679
653
|
constructor(error = {}) {
|
|
680
654
|
super(error);
|
|
681
655
|
this.name = error.name || 'RateLimited';
|
|
@@ -687,8 +661,7 @@ class RateLimitedError extends WebrpcError {
|
|
|
687
661
|
Object.setPrototypeOf(this, RateLimitedError.prototype);
|
|
688
662
|
}
|
|
689
663
|
}
|
|
690
|
-
|
|
691
|
-
class ProjectNotFoundError extends WebrpcError {
|
|
664
|
+
export class ProjectNotFoundError extends WebrpcError {
|
|
692
665
|
constructor(error = {}) {
|
|
693
666
|
super(error);
|
|
694
667
|
this.name = error.name || 'ProjectNotFound';
|
|
@@ -700,8 +673,7 @@ class ProjectNotFoundError extends WebrpcError {
|
|
|
700
673
|
Object.setPrototypeOf(this, ProjectNotFoundError.prototype);
|
|
701
674
|
}
|
|
702
675
|
}
|
|
703
|
-
|
|
704
|
-
class InvalidArgumentError extends WebrpcError {
|
|
676
|
+
export class InvalidArgumentError extends WebrpcError {
|
|
705
677
|
constructor(error = {}) {
|
|
706
678
|
super(error);
|
|
707
679
|
this.name = error.name || 'InvalidArgument';
|
|
@@ -713,8 +685,7 @@ class InvalidArgumentError extends WebrpcError {
|
|
|
713
685
|
Object.setPrototypeOf(this, InvalidArgumentError.prototype);
|
|
714
686
|
}
|
|
715
687
|
}
|
|
716
|
-
|
|
717
|
-
class UnavailableError extends WebrpcError {
|
|
688
|
+
export class UnavailableError extends WebrpcError {
|
|
718
689
|
constructor(error = {}) {
|
|
719
690
|
super(error);
|
|
720
691
|
this.name = error.name || 'Unavailable';
|
|
@@ -726,8 +697,7 @@ class UnavailableError extends WebrpcError {
|
|
|
726
697
|
Object.setPrototypeOf(this, UnavailableError.prototype);
|
|
727
698
|
}
|
|
728
699
|
}
|
|
729
|
-
|
|
730
|
-
class QueryFailedError extends WebrpcError {
|
|
700
|
+
export class QueryFailedError extends WebrpcError {
|
|
731
701
|
constructor(error = {}) {
|
|
732
702
|
super(error);
|
|
733
703
|
this.name = error.name || 'QueryFailed';
|
|
@@ -739,8 +709,7 @@ class QueryFailedError extends WebrpcError {
|
|
|
739
709
|
Object.setPrototypeOf(this, QueryFailedError.prototype);
|
|
740
710
|
}
|
|
741
711
|
}
|
|
742
|
-
|
|
743
|
-
class NotFoundError extends WebrpcError {
|
|
712
|
+
export class NotFoundError extends WebrpcError {
|
|
744
713
|
constructor(error = {}) {
|
|
745
714
|
super(error);
|
|
746
715
|
this.name = error.name || 'NotFound';
|
|
@@ -752,8 +721,7 @@ class NotFoundError extends WebrpcError {
|
|
|
752
721
|
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
753
722
|
}
|
|
754
723
|
}
|
|
755
|
-
|
|
756
|
-
class UnsupportedNetworkError extends WebrpcError {
|
|
724
|
+
export class UnsupportedNetworkError extends WebrpcError {
|
|
757
725
|
constructor(error = {}) {
|
|
758
726
|
super(error);
|
|
759
727
|
this.name = error.name || 'UnsupportedNetwork';
|
|
@@ -765,8 +733,7 @@ class UnsupportedNetworkError extends WebrpcError {
|
|
|
765
733
|
Object.setPrototypeOf(this, UnsupportedNetworkError.prototype);
|
|
766
734
|
}
|
|
767
735
|
}
|
|
768
|
-
|
|
769
|
-
var errors;
|
|
736
|
+
export var errors;
|
|
770
737
|
(function (errors) {
|
|
771
738
|
errors["WebrpcEndpoint"] = "WebrpcEndpoint";
|
|
772
739
|
errors["WebrpcRequestFailed"] = "WebrpcRequestFailed";
|
|
@@ -793,8 +760,8 @@ var errors;
|
|
|
793
760
|
errors["QueryFailed"] = "QueryFailed";
|
|
794
761
|
errors["NotFound"] = "NotFound";
|
|
795
762
|
errors["UnsupportedNetwork"] = "UnsupportedNetwork";
|
|
796
|
-
})(errors || (
|
|
797
|
-
var WebrpcErrorCodes;
|
|
763
|
+
})(errors || (errors = {}));
|
|
764
|
+
export var WebrpcErrorCodes;
|
|
798
765
|
(function (WebrpcErrorCodes) {
|
|
799
766
|
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcEndpoint"] = 0] = "WebrpcEndpoint";
|
|
800
767
|
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcRequestFailed"] = -1] = "WebrpcRequestFailed";
|
|
@@ -821,8 +788,8 @@ var WebrpcErrorCodes;
|
|
|
821
788
|
WebrpcErrorCodes[WebrpcErrorCodes["QueryFailed"] = 2003] = "QueryFailed";
|
|
822
789
|
WebrpcErrorCodes[WebrpcErrorCodes["NotFound"] = 3000] = "NotFound";
|
|
823
790
|
WebrpcErrorCodes[WebrpcErrorCodes["UnsupportedNetwork"] = 3008] = "UnsupportedNetwork";
|
|
824
|
-
})(WebrpcErrorCodes || (
|
|
825
|
-
|
|
791
|
+
})(WebrpcErrorCodes || (WebrpcErrorCodes = {}));
|
|
792
|
+
export const webrpcErrorByCode = {
|
|
826
793
|
[0]: WebrpcEndpointError,
|
|
827
794
|
[-1]: WebrpcRequestFailedError,
|
|
828
795
|
[-2]: WebrpcBadRouteError,
|
|
@@ -852,10 +819,10 @@ exports.webrpcErrorByCode = {
|
|
|
852
819
|
//
|
|
853
820
|
// Webrpc
|
|
854
821
|
//
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
function VersionFromHeader(headers) {
|
|
858
|
-
const headerValue = headers.get(
|
|
822
|
+
export const WebrpcHeader = 'Webrpc';
|
|
823
|
+
export const WebrpcHeaderValue = 'webrpc@v0.30.2;gen-typescript@v0.22.2;userdata@v0.1.0';
|
|
824
|
+
export function VersionFromHeader(headers) {
|
|
825
|
+
const headerValue = headers.get(WebrpcHeader);
|
|
859
826
|
if (!headerValue) {
|
|
860
827
|
return {
|
|
861
828
|
WebrpcGenVersion: '',
|
package/eslint.config.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/userdata",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.19",
|
|
4
4
|
"description": "userdata sub-package for Sequence",
|
|
5
5
|
"repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/services/userdata",
|
|
6
6
|
"author": "Sequence Platforms ULC",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
11
|
+
"type": "module",
|
|
11
12
|
"exports": {
|
|
12
13
|
".": {
|
|
13
14
|
"types": "./dist/index.d.ts",
|
|
@@ -15,14 +16,16 @@
|
|
|
15
16
|
}
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
18
|
-
"@types/node": "^25.0
|
|
19
|
+
"@types/node": "^25.3.0",
|
|
19
20
|
"typescript": "^5.9.3",
|
|
20
|
-
"@repo/typescript-config": "^0.0.1-beta.1"
|
|
21
|
+
"@repo/typescript-config": "^0.0.1-beta.1",
|
|
22
|
+
"@repo/eslint-config": "^0.0.1-beta.1"
|
|
21
23
|
},
|
|
22
24
|
"scripts": {
|
|
23
25
|
"build": "tsc",
|
|
24
26
|
"dev": "tsc --watch",
|
|
25
27
|
"test": "echo",
|
|
26
|
-
"typecheck": "tsc --noEmit"
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"lint": "eslint . --max-warnings 0"
|
|
27
30
|
}
|
|
28
31
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './userdata.gen'
|
|
1
|
+
export * from './userdata.gen.js'
|
|
2
2
|
|
|
3
|
-
import { UserData as UserdataRpc } from './userdata.gen'
|
|
3
|
+
import { UserData as UserdataRpc } from './userdata.gen.js'
|
|
4
4
|
|
|
5
5
|
export class SequenceUserdataClient extends UserdataRpc {
|
|
6
6
|
constructor(
|
|
@@ -15,7 +15,7 @@ export class SequenceUserdataClient extends UserdataRpc {
|
|
|
15
15
|
_fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {
|
|
16
16
|
// automatically include jwt and access key auth header to requests
|
|
17
17
|
// if its been set on the api client
|
|
18
|
-
const headers:
|
|
18
|
+
const headers: Record<string, string> = {}
|
|
19
19
|
|
|
20
20
|
const jwtAuth = this.jwtAuth
|
|
21
21
|
const projectAccessKey = this.projectAccessKey
|