@liberfi.io/react-predict 0.3.67 → 0.3.69
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/index.d.mts +40 -3
- package/dist/index.d.ts +40 -3
- package/dist/index.js +439 -110
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +412 -112
- package/dist/index.mjs.map +1 -1
- package/dist/{server-B6SSpkMN.d.mts → server-CCZfNoWO.d.mts} +244 -1
- package/dist/{server-B6SSpkMN.d.ts → server-CCZfNoWO.d.ts} +244 -1
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +204 -0
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +175 -1
- package/dist/server.mjs.map +1 -1
- package/package.json +11 -4
package/dist/server.js
CHANGED
|
@@ -86,6 +86,119 @@ function matchMarketsQueryKey(params) {
|
|
|
86
86
|
async function fetchMatchMarketsPage(client, params) {
|
|
87
87
|
return client.listMatchMarkets(params);
|
|
88
88
|
}
|
|
89
|
+
|
|
90
|
+
// src/hooks/predict/sports.params.ts
|
|
91
|
+
function sportsTaxonomyQueryKey(params) {
|
|
92
|
+
return ["predict", "sports", "taxonomy", params];
|
|
93
|
+
}
|
|
94
|
+
function sportsMatchesQueryKey(params) {
|
|
95
|
+
return ["predict", "sports", "matches", params];
|
|
96
|
+
}
|
|
97
|
+
function sportsPropsQueryKey(params) {
|
|
98
|
+
return ["predict", "sports", "props", params];
|
|
99
|
+
}
|
|
100
|
+
function resolveSportsTaxonomyParams(params = {}) {
|
|
101
|
+
return { ...params, section: "sports" };
|
|
102
|
+
}
|
|
103
|
+
function resolveSportsMatchesParams(params = {}) {
|
|
104
|
+
return params;
|
|
105
|
+
}
|
|
106
|
+
function resolveSportsPropsParams(params = {}) {
|
|
107
|
+
return params;
|
|
108
|
+
}
|
|
109
|
+
async function fetchSportsTaxonomy(client, params) {
|
|
110
|
+
return client.getSportsTaxonomy(resolveSportsTaxonomyParams(params));
|
|
111
|
+
}
|
|
112
|
+
async function fetchSportsMatches(client, params) {
|
|
113
|
+
return client.getSportsMatches(resolveSportsMatchesParams(params));
|
|
114
|
+
}
|
|
115
|
+
async function fetchSportsProps(client, params) {
|
|
116
|
+
return client.getSportsProps(resolveSportsPropsParams(params));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// src/hooks/predict/esports.params.ts
|
|
120
|
+
function esportsTaxonomyQueryKey(params) {
|
|
121
|
+
return ["predict", "esports", "taxonomy", params];
|
|
122
|
+
}
|
|
123
|
+
function esportsMatchesQueryKey(params) {
|
|
124
|
+
return ["predict", "esports", "matches", params];
|
|
125
|
+
}
|
|
126
|
+
function esportsPropsQueryKey(params) {
|
|
127
|
+
return ["predict", "esports", "props", params];
|
|
128
|
+
}
|
|
129
|
+
function resolveEsportsTaxonomyParams(params = {}) {
|
|
130
|
+
return params;
|
|
131
|
+
}
|
|
132
|
+
function resolveEsportsMatchesParams(params = {}) {
|
|
133
|
+
return params;
|
|
134
|
+
}
|
|
135
|
+
function resolveEsportsPropsParams(params = {}) {
|
|
136
|
+
return params;
|
|
137
|
+
}
|
|
138
|
+
async function fetchEsportsTaxonomy(client, params) {
|
|
139
|
+
return client.getEsportsTaxonomy(resolveEsportsTaxonomyParams(params));
|
|
140
|
+
}
|
|
141
|
+
async function fetchEsportsMatches(client, params) {
|
|
142
|
+
return client.getEsportsMatches(resolveEsportsMatchesParams(params));
|
|
143
|
+
}
|
|
144
|
+
async function fetchEsportsProps(client, params) {
|
|
145
|
+
return client.getEsportsProps(resolveEsportsPropsParams(params));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// src/hooks/predict/sports-routing.params.ts
|
|
149
|
+
function sportsRoutingQueryKey(slug, params) {
|
|
150
|
+
return ["predict", "sports", "routing", slug, params];
|
|
151
|
+
}
|
|
152
|
+
function resolveSportsRoutingParams(params = {}) {
|
|
153
|
+
return params;
|
|
154
|
+
}
|
|
155
|
+
async function fetchSportsRouting(client, slug, params) {
|
|
156
|
+
return client.getSportsRouting(slug, resolveSportsRoutingParams(params));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// src/hooks/predict/sports-match-detail.params.ts
|
|
160
|
+
function sportsMatchDetailQueryKey(section, matchGroupSlug, params) {
|
|
161
|
+
return ["predict", section, "match-detail", matchGroupSlug, params];
|
|
162
|
+
}
|
|
163
|
+
function esportsMatchDetailQueryKey(matchGroupSlug, params) {
|
|
164
|
+
return sportsMatchDetailQueryKey("esports", matchGroupSlug, params);
|
|
165
|
+
}
|
|
166
|
+
function resolveSportsMatchDetailParams(params = {}) {
|
|
167
|
+
return params;
|
|
168
|
+
}
|
|
169
|
+
function resolveEsportsMatchDetailParams(params = {}) {
|
|
170
|
+
return params;
|
|
171
|
+
}
|
|
172
|
+
async function fetchSportsMatchDetail(client, section, matchGroupSlug, params) {
|
|
173
|
+
return client.getSportsMatchDetail(
|
|
174
|
+
section,
|
|
175
|
+
matchGroupSlug,
|
|
176
|
+
resolveSportsMatchDetailParams(params)
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
async function fetchEsportsMatchDetail(client, matchGroupSlug, params) {
|
|
180
|
+
return client.getEsportsMatchDetail(
|
|
181
|
+
matchGroupSlug,
|
|
182
|
+
resolveEsportsMatchDetailParams(params)
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// src/hooks/predict/search.params.ts
|
|
187
|
+
function predictSearchQueryKey(params) {
|
|
188
|
+
return ["predict", "search-documents", params];
|
|
189
|
+
}
|
|
190
|
+
function resolvePredictSearchParams(params = {}) {
|
|
191
|
+
const q = params.q ?? "";
|
|
192
|
+
return {
|
|
193
|
+
...params,
|
|
194
|
+
q,
|
|
195
|
+
sort_by: params.sort_by ?? (q ? "relevance" : "volume"),
|
|
196
|
+
sort_asc: params.sort_asc ?? (q ? void 0 : false)
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
async function fetchPredictSearch(client, params) {
|
|
200
|
+
return client.search(resolvePredictSearchParams(params));
|
|
201
|
+
}
|
|
89
202
|
function buildQuery(params) {
|
|
90
203
|
const qs = new URLSearchParams();
|
|
91
204
|
for (const [key, value] of Object.entries(params)) {
|
|
@@ -163,6 +276,67 @@ var PredictClient = class {
|
|
|
163
276
|
const url = `${this.endpoint}/api/v1/events/${encodeURIComponent(slug)}/similar${query}`;
|
|
164
277
|
return await utils.httpGet(url);
|
|
165
278
|
}
|
|
279
|
+
// -------------------------------------------------------------------------
|
|
280
|
+
// Sports / esports
|
|
281
|
+
// -------------------------------------------------------------------------
|
|
282
|
+
/** Maps to `GET /api/v1/sports/taxonomy`. */
|
|
283
|
+
async getSportsTaxonomy(params) {
|
|
284
|
+
const query = buildQuery(params ?? {});
|
|
285
|
+
const url = `${this.endpoint}/api/v1/sports/taxonomy${query}`;
|
|
286
|
+
return await utils.httpGet(url, this.requestOptions());
|
|
287
|
+
}
|
|
288
|
+
/** Maps to `GET /api/v1/sports/matches`. */
|
|
289
|
+
async getSportsMatches(params) {
|
|
290
|
+
const query = buildQuery(params ?? {});
|
|
291
|
+
const url = `${this.endpoint}/api/v1/sports/matches${query}`;
|
|
292
|
+
return await utils.httpGet(url, this.requestOptions());
|
|
293
|
+
}
|
|
294
|
+
/** Maps to `GET /api/v1/sports/props`. */
|
|
295
|
+
async getSportsProps(params) {
|
|
296
|
+
const query = buildQuery(params ?? {});
|
|
297
|
+
const url = `${this.endpoint}/api/v1/sports/props${query}`;
|
|
298
|
+
return await utils.httpGet(url, this.requestOptions());
|
|
299
|
+
}
|
|
300
|
+
/** Maps to `GET /api/v1/esports/taxonomy`. */
|
|
301
|
+
async getEsportsTaxonomy(params) {
|
|
302
|
+
const query = buildQuery(params ?? {});
|
|
303
|
+
const url = `${this.endpoint}/api/v1/esports/taxonomy${query}`;
|
|
304
|
+
return await utils.httpGet(url, this.requestOptions());
|
|
305
|
+
}
|
|
306
|
+
/** Maps to `GET /api/v1/esports/matches`. */
|
|
307
|
+
async getEsportsMatches(params) {
|
|
308
|
+
const query = buildQuery(params ?? {});
|
|
309
|
+
const url = `${this.endpoint}/api/v1/esports/matches${query}`;
|
|
310
|
+
return await utils.httpGet(url, this.requestOptions());
|
|
311
|
+
}
|
|
312
|
+
/** Maps to `GET /api/v1/esports/props`. */
|
|
313
|
+
async getEsportsProps(params) {
|
|
314
|
+
const query = buildQuery(params ?? {});
|
|
315
|
+
const url = `${this.endpoint}/api/v1/esports/props${query}`;
|
|
316
|
+
return await utils.httpGet(url, this.requestOptions());
|
|
317
|
+
}
|
|
318
|
+
/** Maps to `GET /api/v1/sports/routing/:slug`. */
|
|
319
|
+
async getSportsRouting(slug, params) {
|
|
320
|
+
const query = buildQuery(params ?? {});
|
|
321
|
+
const url = `${this.endpoint}/api/v1/sports/routing/${encodeURIComponent(slug)}${query}`;
|
|
322
|
+
return await utils.httpGet(url, this.requestOptions());
|
|
323
|
+
}
|
|
324
|
+
/** Maps to `GET /api/v1/sports/matches/:match_group_slug`. */
|
|
325
|
+
async getSportsMatchDetail(section, matchGroupSlug, params) {
|
|
326
|
+
const query = buildQuery(params ?? {});
|
|
327
|
+
const url = `${this.endpoint}/api/v1/${encodeURIComponent(section)}/matches/${encodeURIComponent(matchGroupSlug)}${query}`;
|
|
328
|
+
return await utils.httpGet(url, this.requestOptions());
|
|
329
|
+
}
|
|
330
|
+
/** Convenience wrapper for `GET /api/v1/esports/matches/:match_group_slug`. */
|
|
331
|
+
async getEsportsMatchDetail(matchGroupSlug, params) {
|
|
332
|
+
return this.getSportsMatchDetail("esports", matchGroupSlug, params);
|
|
333
|
+
}
|
|
334
|
+
/** Maps to `GET /api/v1/search`. */
|
|
335
|
+
async search(params) {
|
|
336
|
+
const query = buildQuery(params ?? {});
|
|
337
|
+
const url = `${this.endpoint}/api/v1/search${query}`;
|
|
338
|
+
return await utils.httpGet(url, this.requestOptions());
|
|
339
|
+
}
|
|
166
340
|
/**
|
|
167
341
|
* List comments for a prediction event.
|
|
168
342
|
*
|
|
@@ -1301,19 +1475,49 @@ exports.buildSignedOrder = buildSignedOrder;
|
|
|
1301
1475
|
exports.createPredictClient = createPredictClient;
|
|
1302
1476
|
exports.createPredictWsClient = createPredictWsClient;
|
|
1303
1477
|
exports.derivePolymarketApiKey = derivePolymarketApiKey;
|
|
1478
|
+
exports.esportsMatchDetailQueryKey = esportsMatchDetailQueryKey;
|
|
1479
|
+
exports.esportsMatchesQueryKey = esportsMatchesQueryKey;
|
|
1480
|
+
exports.esportsPropsQueryKey = esportsPropsQueryKey;
|
|
1481
|
+
exports.esportsTaxonomyQueryKey = esportsTaxonomyQueryKey;
|
|
1304
1482
|
exports.eventQueryKey = eventQueryKey;
|
|
1483
|
+
exports.fetchEsportsMatchDetail = fetchEsportsMatchDetail;
|
|
1484
|
+
exports.fetchEsportsMatches = fetchEsportsMatches;
|
|
1485
|
+
exports.fetchEsportsProps = fetchEsportsProps;
|
|
1486
|
+
exports.fetchEsportsTaxonomy = fetchEsportsTaxonomy;
|
|
1305
1487
|
exports.fetchEvent = fetchEvent;
|
|
1306
1488
|
exports.fetchEventsPage = fetchEventsPage;
|
|
1307
1489
|
exports.fetchMarket = fetchMarket;
|
|
1308
1490
|
exports.fetchMatchMarketsPage = fetchMatchMarketsPage;
|
|
1309
1491
|
exports.fetchMatchesPage = fetchMatchesPage;
|
|
1492
|
+
exports.fetchPredictSearch = fetchPredictSearch;
|
|
1493
|
+
exports.fetchSportsMatchDetail = fetchSportsMatchDetail;
|
|
1494
|
+
exports.fetchSportsMatches = fetchSportsMatches;
|
|
1495
|
+
exports.fetchSportsProps = fetchSportsProps;
|
|
1496
|
+
exports.fetchSportsRouting = fetchSportsRouting;
|
|
1497
|
+
exports.fetchSportsTaxonomy = fetchSportsTaxonomy;
|
|
1310
1498
|
exports.hmacSha256Base64 = hmacSha256Base64;
|
|
1311
1499
|
exports.infiniteEventsQueryKey = infiniteEventsQueryKey;
|
|
1312
1500
|
exports.marketQueryKey = marketQueryKey;
|
|
1313
1501
|
exports.matchMarketsQueryKey = matchMarketsQueryKey;
|
|
1314
1502
|
exports.matchQueryKey = matchQueryKey;
|
|
1315
1503
|
exports.matchesQueryKey = matchesQueryKey;
|
|
1504
|
+
exports.predictSearchQueryKey = predictSearchQueryKey;
|
|
1505
|
+
exports.resolveEsportsMatchDetailParams = resolveEsportsMatchDetailParams;
|
|
1506
|
+
exports.resolveEsportsMatchesParams = resolveEsportsMatchesParams;
|
|
1507
|
+
exports.resolveEsportsPropsParams = resolveEsportsPropsParams;
|
|
1508
|
+
exports.resolveEsportsTaxonomyParams = resolveEsportsTaxonomyParams;
|
|
1316
1509
|
exports.resolveEventsParams = resolveEventsParams;
|
|
1510
|
+
exports.resolvePredictSearchParams = resolvePredictSearchParams;
|
|
1511
|
+
exports.resolveSportsMatchDetailParams = resolveSportsMatchDetailParams;
|
|
1512
|
+
exports.resolveSportsMatchesParams = resolveSportsMatchesParams;
|
|
1513
|
+
exports.resolveSportsPropsParams = resolveSportsPropsParams;
|
|
1514
|
+
exports.resolveSportsRoutingParams = resolveSportsRoutingParams;
|
|
1515
|
+
exports.resolveSportsTaxonomyParams = resolveSportsTaxonomyParams;
|
|
1317
1516
|
exports.resolveTagSlug = resolveTagSlug;
|
|
1517
|
+
exports.sportsMatchDetailQueryKey = sportsMatchDetailQueryKey;
|
|
1518
|
+
exports.sportsMatchesQueryKey = sportsMatchesQueryKey;
|
|
1519
|
+
exports.sportsPropsQueryKey = sportsPropsQueryKey;
|
|
1520
|
+
exports.sportsRoutingQueryKey = sportsRoutingQueryKey;
|
|
1521
|
+
exports.sportsTaxonomyQueryKey = sportsTaxonomyQueryKey;
|
|
1318
1522
|
//# sourceMappingURL=server.js.map
|
|
1319
1523
|
//# sourceMappingURL=server.js.map
|