bb-api-platforma 0.1.243 → 0.1.245
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/BetBoosterApi.d.ts +239 -9
- package/dist/BetBoosterApi.js +246 -9
- package/dist/BetBoosterApi.min.d.ts +330 -11
- package/dist/BetBoosterApi.min.js +1 -1
- package/dist/BetBoosterApi.min.js.map +1 -1
- package/dist/BetBoosterOfficeApi.d.ts +180 -0
- package/dist/BetBoosterOfficeApi.js +187 -0
- package/dist/Types.d.ts +99 -2
- package/package.json +2 -2
|
@@ -2152,5 +2152,192 @@ export class BetBoosterOfficeApi {
|
|
|
2152
2152
|
const { data, status, statusText } = await this.request(url).POST(payload).exec();
|
|
2153
2153
|
return this.responseHandlerDataData(data, status, statusText);
|
|
2154
2154
|
}
|
|
2155
|
+
/**
|
|
2156
|
+
* Copies (clones) an existing betslip with the given list of odds items
|
|
2157
|
+
* and returns updated betslip data from the server, including actual odds,
|
|
2158
|
+
* limitations, and betslip type.
|
|
2159
|
+
*
|
|
2160
|
+
* @param oddsList - Array of betslip odds items to clone.
|
|
2161
|
+
*
|
|
2162
|
+
* @remarks
|
|
2163
|
+
* Endpoint: `POST /betting/CopyBetslip` (API v2)
|
|
2164
|
+
*
|
|
2165
|
+
* @example
|
|
2166
|
+
* **Request payload:**
|
|
2167
|
+
* ```json
|
|
2168
|
+
* {
|
|
2169
|
+
* "Bets": [
|
|
2170
|
+
* {
|
|
2171
|
+
* "ErrorMessage": 0,
|
|
2172
|
+
* "Min": 0,
|
|
2173
|
+
* "Max": 0,
|
|
2174
|
+
* "MinCurrencyUnit": 0.01,
|
|
2175
|
+
* "IsRound": false,
|
|
2176
|
+
* "IsReinvested": false,
|
|
2177
|
+
* "MinAdd": 0,
|
|
2178
|
+
* "MaxAdd": 0,
|
|
2179
|
+
* "Odds": 3.07,
|
|
2180
|
+
* "IsLive": false,
|
|
2181
|
+
* "LinesID": 2970079,
|
|
2182
|
+
* "BetVarID": 1,
|
|
2183
|
+
* "HandSize": null,
|
|
2184
|
+
* "Add1": null,
|
|
2185
|
+
* "Add2": null,
|
|
2186
|
+
* "Score": "",
|
|
2187
|
+
* "NameSport": "Football",
|
|
2188
|
+
* "NameCountry": "Europe",
|
|
2189
|
+
* "NameTurnir": "UEFA Champions League",
|
|
2190
|
+
* "NameTeam1": "Real Madrid",
|
|
2191
|
+
* "NameTeam2": "Bayern Munich",
|
|
2192
|
+
* "DateEvent": "2026-04-07T22:00:00+03:00",
|
|
2193
|
+
* "NameBetShort": "1",
|
|
2194
|
+
* "NameBetLong": "Team 1 wins",
|
|
2195
|
+
* "SportId": 5
|
|
2196
|
+
* }
|
|
2197
|
+
* ],
|
|
2198
|
+
* "Culture": "en-US"
|
|
2199
|
+
* }
|
|
2200
|
+
* ```
|
|
2201
|
+
*
|
|
2202
|
+
* **Response:**
|
|
2203
|
+
* ```json
|
|
2204
|
+
* {
|
|
2205
|
+
* "Ok": true,
|
|
2206
|
+
* "Error": null,
|
|
2207
|
+
* "Data": {
|
|
2208
|
+
* "Bets": [
|
|
2209
|
+
* {
|
|
2210
|
+
* "LinesID": 2970079,
|
|
2211
|
+
* "Odds": 3.07,
|
|
2212
|
+
* "OddsOld": 3.05,
|
|
2213
|
+
* "ErrorMessage": 0,
|
|
2214
|
+
* "IsLive": false
|
|
2215
|
+
* }
|
|
2216
|
+
* ],
|
|
2217
|
+
* "Limitations": {
|
|
2218
|
+
* "Min": null,
|
|
2219
|
+
* "Max": null,
|
|
2220
|
+
* "MaxOddForMulty": 250
|
|
2221
|
+
* },
|
|
2222
|
+
* "BetslipType": 0
|
|
2223
|
+
* }
|
|
2224
|
+
* }
|
|
2225
|
+
* ```
|
|
2226
|
+
*/
|
|
2227
|
+
async cloneStoredBetslip(oddsList) {
|
|
2228
|
+
const url = this.url(`/betting/CopyBetslip`, api.V2);
|
|
2229
|
+
const payload = {
|
|
2230
|
+
Bets: oddsList,
|
|
2231
|
+
Culture: this.locale,
|
|
2232
|
+
};
|
|
2233
|
+
const { data, status, statusText } = await this.request(url).POST(payload).exec();
|
|
2234
|
+
return this.responseHandlerDataData(data, status, statusText);
|
|
2235
|
+
}
|
|
2236
|
+
/**
|
|
2237
|
+
* Получает сохранённый купон по его идентификатору.
|
|
2238
|
+
*
|
|
2239
|
+
* @param savedCouponId - Уникальный числовой идентификатор сохранённого купона.
|
|
2240
|
+
* @returns Данные сохранённого купона.
|
|
2241
|
+
*
|
|
2242
|
+
* @remarks
|
|
2243
|
+
* Endpoint: `GET /portfolio/getcoupon/:savedCouponId` (NV20)
|
|
2244
|
+
*
|
|
2245
|
+
* @example
|
|
2246
|
+
* ```ts
|
|
2247
|
+
* // Запрос
|
|
2248
|
+
* const coupon = await api.getSavedCoupon(12345);
|
|
2249
|
+
*
|
|
2250
|
+
* // Ответ (строка с данными купона)
|
|
2251
|
+
* // "{ ... serialized coupon data ... }"
|
|
2252
|
+
* ```
|
|
2253
|
+
*/
|
|
2254
|
+
async getSavedCoupon(savedCouponId) {
|
|
2255
|
+
const url = this.url(`/portfolio/getcoupon/:${savedCouponId}`, api.NV20);
|
|
2256
|
+
const { data, status, statusText } = await this.request(url).exec();
|
|
2257
|
+
return this.responseHandlerDataData(data, status, statusText);
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* Создаёт новый сохранённый купон на основе переданных данных и списка кодов.
|
|
2261
|
+
*
|
|
2262
|
+
* @param couponData - Объект {@link I.ICouponRequest} с данными купона (коэффициенты, домен, партнёр и т.д.).
|
|
2263
|
+
* @param savedCodesList - Массив строковых кодов, привязываемых к купону.
|
|
2264
|
+
* @returns Результат создания купона.
|
|
2265
|
+
*
|
|
2266
|
+
* @remarks
|
|
2267
|
+
* Endpoint: `POST /portfolio/createcoupon` (NV20)
|
|
2268
|
+
*
|
|
2269
|
+
* @example
|
|
2270
|
+
* ```ts
|
|
2271
|
+
* // Payload запроса
|
|
2272
|
+
* const payload = {
|
|
2273
|
+
* data: {
|
|
2274
|
+
* odds: [
|
|
2275
|
+
* {
|
|
2276
|
+
* ErrorMessage: 0,
|
|
2277
|
+
* Min: 10,
|
|
2278
|
+
* Max: 1000,
|
|
2279
|
+
* MinCurrencyUnit: 1,
|
|
2280
|
+
* IsRound: false,
|
|
2281
|
+
* IsReinvested: false,
|
|
2282
|
+
* MinAdd: 0,
|
|
2283
|
+
* MaxAdd: 0,
|
|
2284
|
+
* Odds: 1.85,
|
|
2285
|
+
* IsLive: false,
|
|
2286
|
+
* LinesID: 456789,
|
|
2287
|
+
* BetVarID: 1,
|
|
2288
|
+
* NameSport: "Football",
|
|
2289
|
+
* NameTeam1: "Team A",
|
|
2290
|
+
* NameTeam2: "Team B",
|
|
2291
|
+
* NameBetShort: "1"
|
|
2292
|
+
* }
|
|
2293
|
+
* ],
|
|
2294
|
+
* domain: "example.com",
|
|
2295
|
+
* partner: "partner1"
|
|
2296
|
+
* },
|
|
2297
|
+
* codes: ["ABC123", "DEF456"]
|
|
2298
|
+
* };
|
|
2299
|
+
*
|
|
2300
|
+
* const result = await api.createSavedCoupon(payload.data, payload.codes);
|
|
2301
|
+
* ```
|
|
2302
|
+
*/
|
|
2303
|
+
async createSavedCoupon(couponData, savedCodesList) {
|
|
2304
|
+
const url = this.url(`/portfolio/createcoupon`, api.NV20);
|
|
2305
|
+
const payload = {
|
|
2306
|
+
data: couponData,
|
|
2307
|
+
codes: savedCodesList,
|
|
2308
|
+
};
|
|
2309
|
+
const { data, status, statusText } = await this.request(url).POST(payload).exec();
|
|
2310
|
+
return this.responseHandlerDataData(data, status, statusText);
|
|
2311
|
+
}
|
|
2312
|
+
/**
|
|
2313
|
+
* Получает список сохранённых купонов по массиву кодов.
|
|
2314
|
+
*
|
|
2315
|
+
* @param savedCodesList - Массив строковых кодов для поиска соответствующих купонов.
|
|
2316
|
+
* @returns Массив найденных купонов.
|
|
2317
|
+
*
|
|
2318
|
+
* @remarks
|
|
2319
|
+
* Endpoint: `POST /portfolio/getcoupons` (NV20)
|
|
2320
|
+
*
|
|
2321
|
+
* @example
|
|
2322
|
+
* ```ts
|
|
2323
|
+
* // Payload запроса
|
|
2324
|
+
* const payload = {
|
|
2325
|
+
* codes: ["ABC123", "DEF456"]
|
|
2326
|
+
* };
|
|
2327
|
+
*
|
|
2328
|
+
* const coupons = await api.getCoupons(["ABC123", "DEF456"]);
|
|
2329
|
+
*
|
|
2330
|
+
* // Ответ — массив объектов купонов
|
|
2331
|
+
* // [{ id: 1, odds: [...], domain: "example.com", ... }, ...]
|
|
2332
|
+
* ```
|
|
2333
|
+
*/
|
|
2334
|
+
async getCoupons(savedCodesList) {
|
|
2335
|
+
const url = this.url(`/portfolio/getcoupons`, api.NV20);
|
|
2336
|
+
const payload = {
|
|
2337
|
+
codes: savedCodesList,
|
|
2338
|
+
};
|
|
2339
|
+
const { data, status, statusText } = await this.request(url).POST(payload).exec();
|
|
2340
|
+
return this.responseHandlerDataData(data, status, statusText);
|
|
2341
|
+
}
|
|
2155
2342
|
}
|
|
2156
2343
|
// @workspace /doc в комментарии приведи полный пример payload из I.IConfirmWithdrawalOrderPayload
|
package/dist/Types.d.ts
CHANGED
|
@@ -1640,8 +1640,8 @@ export interface RedisPrematchSearchParams {
|
|
|
1640
1640
|
locale?: string;
|
|
1641
1641
|
searchString?: string | null;
|
|
1642
1642
|
negativeString?: string | null;
|
|
1643
|
-
sportId?: number | null;
|
|
1644
|
-
tournamentId?: number | null;
|
|
1643
|
+
sportId?: number | number[] | null;
|
|
1644
|
+
tournamentId?: number | number[] | null;
|
|
1645
1645
|
LIMIT?: {
|
|
1646
1646
|
from: number;
|
|
1647
1647
|
size: number;
|
|
@@ -1818,6 +1818,103 @@ export type TSliderSetSlidePayload = {
|
|
|
1818
1818
|
/** Sets the movement of a slide in the list */
|
|
1819
1819
|
direction?: 'up' | 'down' | '1' | '-1';
|
|
1820
1820
|
};
|
|
1821
|
+
export type TBetslipOddsList = {
|
|
1822
|
+
ErrorMessage: number;
|
|
1823
|
+
Min: number;
|
|
1824
|
+
Max: number;
|
|
1825
|
+
MinCurrencyUnit: number;
|
|
1826
|
+
IsRound: boolean;
|
|
1827
|
+
IsReinvested: boolean;
|
|
1828
|
+
MinAdd: number;
|
|
1829
|
+
MaxAdd: number;
|
|
1830
|
+
Odds: number;
|
|
1831
|
+
IsLive: boolean;
|
|
1832
|
+
Amount?: number;
|
|
1833
|
+
LinesID?: number;
|
|
1834
|
+
HandSize?: string | number | null;
|
|
1835
|
+
BetVarID?: number;
|
|
1836
|
+
Add1?: number | null;
|
|
1837
|
+
Add2?: number | null;
|
|
1838
|
+
Score?: string;
|
|
1839
|
+
OddsOld?: number;
|
|
1840
|
+
HandSizeOld?: number;
|
|
1841
|
+
NameSport?: string;
|
|
1842
|
+
NameCountry?: string;
|
|
1843
|
+
NameTurnir?: string;
|
|
1844
|
+
NameTeam1?: string;
|
|
1845
|
+
NameTeam2?: string;
|
|
1846
|
+
PriceNum?: number;
|
|
1847
|
+
DateEvent?: string | null;
|
|
1848
|
+
NameBetShort?: string;
|
|
1849
|
+
NameBetLong?: string;
|
|
1850
|
+
Comment?: string;
|
|
1851
|
+
SportId?: number;
|
|
1852
|
+
DateEventLive?: string | null;
|
|
1853
|
+
BonusType?: number;
|
|
1854
|
+
BetIdentifier?: string | null;
|
|
1855
|
+
};
|
|
1856
|
+
export type TGetBetslipOddsListPayload = {
|
|
1857
|
+
Bets: TBetslipOddsList[];
|
|
1858
|
+
Culture: string;
|
|
1859
|
+
};
|
|
1860
|
+
export type TBetslipResponse = {
|
|
1861
|
+
Bets: TBetslipOddsList[];
|
|
1862
|
+
Limitations: {
|
|
1863
|
+
Min: number | null;
|
|
1864
|
+
Max: number | null;
|
|
1865
|
+
MaxOddForMulty: number;
|
|
1866
|
+
};
|
|
1867
|
+
BetslipType: EBetslipType;
|
|
1868
|
+
};
|
|
1869
|
+
/** Одна позиция ставки в купоне */
|
|
1870
|
+
export interface ICouponOdd {
|
|
1871
|
+
ErrorMessage: number;
|
|
1872
|
+
Min: number;
|
|
1873
|
+
Max: number;
|
|
1874
|
+
MinCurrencyUnit: number;
|
|
1875
|
+
IsRound: boolean;
|
|
1876
|
+
IsReinvested: boolean;
|
|
1877
|
+
MinAdd: number;
|
|
1878
|
+
MaxAdd: number;
|
|
1879
|
+
Odds: number;
|
|
1880
|
+
IsLive: boolean;
|
|
1881
|
+
Amount?: number;
|
|
1882
|
+
LinesID?: number;
|
|
1883
|
+
HandSize?: number | null;
|
|
1884
|
+
BetVarID?: number;
|
|
1885
|
+
Add1?: number | null;
|
|
1886
|
+
Add2?: number | null;
|
|
1887
|
+
Score?: string;
|
|
1888
|
+
OddsOld?: number;
|
|
1889
|
+
HandSizeOld?: number;
|
|
1890
|
+
NameSport?: string;
|
|
1891
|
+
NameCountry?: string;
|
|
1892
|
+
NameTurnir?: string;
|
|
1893
|
+
NameTeam1?: string;
|
|
1894
|
+
NameTeam2?: string;
|
|
1895
|
+
PriceNum?: number;
|
|
1896
|
+
/** Дата события в формате ISO 8601 с часовым поясом, например "2026-04-07T22:00:00+03:00" */
|
|
1897
|
+
DateEvent?: string;
|
|
1898
|
+
NameBetShort?: string;
|
|
1899
|
+
NameBetLong?: string;
|
|
1900
|
+
Comment?: string;
|
|
1901
|
+
SportId?: number;
|
|
1902
|
+
DateEventLive?: string | null;
|
|
1903
|
+
BonusType?: number;
|
|
1904
|
+
BetIdentifier?: string | null;
|
|
1905
|
+
}
|
|
1906
|
+
/** Входящий запрос на сохранение купона */
|
|
1907
|
+
export interface ICouponRequest {
|
|
1908
|
+
odds: ICouponOdd[];
|
|
1909
|
+
domain: string;
|
|
1910
|
+
partner: string;
|
|
1911
|
+
id?: number;
|
|
1912
|
+
code?: string;
|
|
1913
|
+
}
|
|
1914
|
+
export type ICreateCouponRequest = {
|
|
1915
|
+
data: ICouponRequest;
|
|
1916
|
+
codes?: string[] | null | undefined;
|
|
1917
|
+
};
|
|
1821
1918
|
export {};
|
|
1822
1919
|
/**
|
|
1823
1920
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bb-api-platforma",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.245",
|
|
4
4
|
"description": "API module for BetBooster Platform",
|
|
5
5
|
"productName": "BetBooster Platform API",
|
|
6
6
|
"author": "Tomy Bet <tomybet.com@gmail.com>",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"types": "dist/BetBoosterApi.min.d.ts",
|
|
10
10
|
"type": "module",
|
|
11
11
|
"scripts": {
|
|
12
|
+
"release": ".\\release.ps1",
|
|
12
13
|
"build": "rimraf ./dist && tsc --project tsconfig.build.json",
|
|
13
14
|
"build:compress": "npm run build && terser --compress --mangle --source-map \"url='BetBoosterApi.min.js.map'\" --output dist/BetBoosterApi.min.js dist/BetBoosterApi.js",
|
|
14
15
|
"build:types": "dts-bundle-generator -o dist/BetBoosterApi.min.d.ts src/BetBoosterApi.ts",
|
|
@@ -17,7 +18,6 @@
|
|
|
17
18
|
"git-commit": "git add . && git commit -m \"Release v%npm_package_version%\"",
|
|
18
19
|
"git-tag": "git tag v%npm_package_version%",
|
|
19
20
|
"git-push": "git push --set-upstream origin main && git push --tags",
|
|
20
|
-
"release": "echo 'Run ./release.ps1 (Tomy1...5)'",
|
|
21
21
|
"release:pwsh": "echo 'Run ./release.ps1 (Tomy1...5)'",
|
|
22
22
|
"release:cmd": "cross-env-shell \"VERSION=$(node -p \\\"require('./package.json').version\\\") && echo 'Release is running...' && npm run version:patch && npm run build:all && git add . && git commit -m \\\"Release v$VERSION\\\" && git tag v$VERSION && git push --set-upstream origin main && git push --tags\"",
|
|
23
23
|
"release_OLD": "echo 'Release is running...' && npm run version:patch && npm run build:all && git add . && git commit -m \"Release v$(node -p \"require('./package.json').version\")\" && git tag v$(node -p \"require('./package.json').version\") && git push --set-upstream origin main && git push --tags",
|