@winible/winible-typed 2.79.0 → 2.80.0
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/event-collector-models/config/config.js +30 -0
- package/dist/event-collector-models/config/config.js.map +1 -0
- package/dist/migration_numerical_id_to_external_id.js +59 -0
- package/dist/migration_numerical_id_to_external_id.js.map +1 -0
- package/dist/migrations/20241123184623-recurly-payment-monitoring-whitelist.js +33 -0
- package/dist/migrations/20241123184623-recurly-payment-monitoring-whitelist.js.map +1 -0
- package/dist/typed-model/{featured-capper.js → recurly-payment-monitoring-whitelist.js} +16 -22
- package/dist/typed-model/recurly-payment-monitoring-whitelist.js.map +1 -0
- package/event-collector-models/config/config.ts +29 -0
- package/opticodds/index.ts +424 -2
- package/opticodds/openapi.json +501 -2010
- package/opticodds/schemas.ts +5877 -85
- package/opticodds/sdk.ts +267 -93
- package/opticodds/types.ts +244 -84
- package/package.json +1 -1
- package/src/types.ts +0 -17
- package/typed-model/odd.ts +1 -7
- package/dist/opticodds/index.js +0 -24
- package/dist/opticodds/index.js.map +0 -1
- package/dist/opticodds/openapi.json +0 -24316
- package/dist/opticodds/schemas.js +0 -88
- package/dist/opticodds/schemas.js.map +0 -1
- package/dist/opticodds/sdk.js +0 -200
- package/dist/opticodds/sdk.js.map +0 -1
- package/dist/opticodds/types.js +0 -3
- package/dist/opticodds/types.js.map +0 -1
- package/dist/typed-model/featured-capper.js.map +0 -1
- package/dist/utils/lambdaUtils/logger.js +0 -90
- package/dist/utils/lambdaUtils/logger.js.map +0 -1
@@ -0,0 +1,30 @@
|
|
1
|
+
"use strict";
|
2
|
+
require("dotenv").config();
|
3
|
+
module.exports = {
|
4
|
+
development: {
|
5
|
+
dialect: "postgres",
|
6
|
+
host: process.env.TS_DB_HOST,
|
7
|
+
port: process.env.TS_DB_PORT,
|
8
|
+
database: process.env.TS_DB_NAME,
|
9
|
+
username: process.env.TS_DB_USER,
|
10
|
+
password: process.env.TS_DB_PASSWORD,
|
11
|
+
dialectOptions: {
|
12
|
+
ssl: false,
|
13
|
+
},
|
14
|
+
},
|
15
|
+
production: {
|
16
|
+
dialect: "postgres",
|
17
|
+
host: process.env.TS_DB_HOST,
|
18
|
+
port: process.env.TS_DB_PORT,
|
19
|
+
database: process.env.TS_DB_NAME,
|
20
|
+
username: process.env.TS_DB_USER,
|
21
|
+
password: process.env.TS_DB_PASSWORD,
|
22
|
+
dialectOptions: {
|
23
|
+
ssl: {
|
24
|
+
require: true,
|
25
|
+
rejectUnauthorized: false,
|
26
|
+
},
|
27
|
+
},
|
28
|
+
},
|
29
|
+
};
|
30
|
+
//# sourceMappingURL=config.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../event-collector-models/config/config.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;AAE3B,MAAM,CAAC,OAAO,GAAG;IACf,WAAW,EAAE;QACX,OAAO,EAAE,UAAU;QACnB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAC5B,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAC5B,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAChC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAChC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;QACpC,cAAc,EAAE;YACd,GAAG,EAAE,KAAK;SACX;KACF;IACD,UAAU,EAAE;QACV,OAAO,EAAE,UAAU;QACnB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAC5B,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAC5B,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAChC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAChC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;QACpC,cAAc,EAAE;YACd,GAAG,EAAE;gBACH,OAAO,EAAE,IAAI;gBACb,kBAAkB,EAAE,KAAK;aAC1B;SACF;KACF;CACF,CAAC"}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const sequelize_1 = require("sequelize");
|
4
|
+
/**
|
5
|
+
* Migration para alterar numerical_id para external_id
|
6
|
+
* Alterando o tipo de INTEGER para STRING e renomeando a coluna
|
7
|
+
*/
|
8
|
+
module.exports = {
|
9
|
+
async up(queryInterface) {
|
10
|
+
// 1. Alterar tipo de numerical_id para VARCHAR nas tabelas
|
11
|
+
await queryInterface.changeColumn("bet_sports", "numerical_id", {
|
12
|
+
type: sequelize_1.DataTypes.STRING,
|
13
|
+
allowNull: false,
|
14
|
+
});
|
15
|
+
await queryInterface.changeColumn("leagues", "numerical_id", {
|
16
|
+
type: sequelize_1.DataTypes.STRING,
|
17
|
+
allowNull: false,
|
18
|
+
});
|
19
|
+
await queryInterface.changeColumn("markets", "numerical_id", {
|
20
|
+
type: sequelize_1.DataTypes.STRING,
|
21
|
+
allowNull: false,
|
22
|
+
});
|
23
|
+
await queryInterface.changeColumn("sportsbooks", "numerical_id", {
|
24
|
+
type: sequelize_1.DataTypes.STRING,
|
25
|
+
allowNull: false,
|
26
|
+
});
|
27
|
+
// 2. Renomear colunas de numerical_id para external_id
|
28
|
+
await queryInterface.renameColumn("bet_sports", "numerical_id", "external_id");
|
29
|
+
await queryInterface.renameColumn("leagues", "numerical_id", "external_id");
|
30
|
+
await queryInterface.renameColumn("markets", "numerical_id", "external_id");
|
31
|
+
await queryInterface.renameColumn("sportsbooks", "numerical_id", "external_id");
|
32
|
+
},
|
33
|
+
async down(queryInterface) {
|
34
|
+
// Reverter as alterações
|
35
|
+
// 1. Renomear de volta para numerical_id
|
36
|
+
await queryInterface.renameColumn("bet_sports", "external_id", "numerical_id");
|
37
|
+
await queryInterface.renameColumn("leagues", "external_id", "numerical_id");
|
38
|
+
await queryInterface.renameColumn("markets", "external_id", "numerical_id");
|
39
|
+
await queryInterface.renameColumn("sportsbooks", "external_id", "numerical_id");
|
40
|
+
// 2. Alterar tipo de volta para INTEGER
|
41
|
+
await queryInterface.changeColumn("bet_sports", "numerical_id", {
|
42
|
+
type: sequelize_1.DataTypes.INTEGER,
|
43
|
+
allowNull: false,
|
44
|
+
});
|
45
|
+
await queryInterface.changeColumn("leagues", "numerical_id", {
|
46
|
+
type: sequelize_1.DataTypes.INTEGER,
|
47
|
+
allowNull: false,
|
48
|
+
});
|
49
|
+
await queryInterface.changeColumn("markets", "numerical_id", {
|
50
|
+
type: sequelize_1.DataTypes.INTEGER,
|
51
|
+
allowNull: false,
|
52
|
+
});
|
53
|
+
await queryInterface.changeColumn("sportsbooks", "numerical_id", {
|
54
|
+
type: sequelize_1.DataTypes.INTEGER,
|
55
|
+
allowNull: false,
|
56
|
+
});
|
57
|
+
},
|
58
|
+
};
|
59
|
+
//# sourceMappingURL=migration_numerical_id_to_external_id.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migration_numerical_id_to_external_id.js","sourceRoot":"","sources":["../migration_numerical_id_to_external_id.ts"],"names":[],"mappings":";;AAAA,yCAAsD;AAEtD;;;GAGG;AAEH,MAAM,CAAC,OAAO,GAAG;IACf,KAAK,CAAC,EAAE,CAAC,cAA8B;QACrC,2DAA2D;QAC3D,MAAM,cAAc,CAAC,YAAY,CAAC,YAAY,EAAE,cAAc,EAAE;YAC9D,IAAI,EAAE,qBAAS,CAAC,MAAM;YACtB,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QAEH,MAAM,cAAc,CAAC,YAAY,CAAC,SAAS,EAAE,cAAc,EAAE;YAC3D,IAAI,EAAE,qBAAS,CAAC,MAAM;YACtB,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QAEH,MAAM,cAAc,CAAC,YAAY,CAAC,SAAS,EAAE,cAAc,EAAE;YAC3D,IAAI,EAAE,qBAAS,CAAC,MAAM;YACtB,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QAEH,MAAM,cAAc,CAAC,YAAY,CAAC,aAAa,EAAE,cAAc,EAAE;YAC/D,IAAI,EAAE,qBAAS,CAAC,MAAM;YACtB,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QAEH,uDAAuD;QACvD,MAAM,cAAc,CAAC,YAAY,CAC/B,YAAY,EACZ,cAAc,EACd,aAAa,CACd,CAAC;QACF,MAAM,cAAc,CAAC,YAAY,CAAC,SAAS,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;QAC5E,MAAM,cAAc,CAAC,YAAY,CAAC,SAAS,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;QAC5E,MAAM,cAAc,CAAC,YAAY,CAC/B,aAAa,EACb,cAAc,EACd,aAAa,CACd,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,cAA8B;QACvC,yBAAyB;QAEzB,yCAAyC;QACzC,MAAM,cAAc,CAAC,YAAY,CAC/B,YAAY,EACZ,aAAa,EACb,cAAc,CACf,CAAC;QACF,MAAM,cAAc,CAAC,YAAY,CAAC,SAAS,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;QAC5E,MAAM,cAAc,CAAC,YAAY,CAAC,SAAS,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;QAC5E,MAAM,cAAc,CAAC,YAAY,CAC/B,aAAa,EACb,aAAa,EACb,cAAc,CACf,CAAC;QAEF,wCAAwC;QACxC,MAAM,cAAc,CAAC,YAAY,CAAC,YAAY,EAAE,cAAc,EAAE;YAC9D,IAAI,EAAE,qBAAS,CAAC,OAAO;YACvB,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QAEH,MAAM,cAAc,CAAC,YAAY,CAAC,SAAS,EAAE,cAAc,EAAE;YAC3D,IAAI,EAAE,qBAAS,CAAC,OAAO;YACvB,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QAEH,MAAM,cAAc,CAAC,YAAY,CAAC,SAAS,EAAE,cAAc,EAAE;YAC3D,IAAI,EAAE,qBAAS,CAAC,OAAO;YACvB,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QAEH,MAAM,cAAc,CAAC,YAAY,CAAC,aAAa,EAAE,cAAc,EAAE;YAC/D,IAAI,EAAE,qBAAS,CAAC,OAAO;YACvB,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const sequelize_1 = require("sequelize");
|
4
|
+
exports.default = {
|
5
|
+
async up(queryInterface, sequelize) {
|
6
|
+
await queryInterface.createTable("recurly_payment_monitoring_whitelist", {
|
7
|
+
id: {
|
8
|
+
type: sequelize_1.DataTypes.BIGINT,
|
9
|
+
primaryKey: true,
|
10
|
+
allowNull: false,
|
11
|
+
autoIncrement: true,
|
12
|
+
},
|
13
|
+
user_id: {
|
14
|
+
type: sequelize_1.DataTypes.BIGINT,
|
15
|
+
allowNull: false,
|
16
|
+
references: {
|
17
|
+
model: "users",
|
18
|
+
key: "id",
|
19
|
+
},
|
20
|
+
onDelete: "CASCADE",
|
21
|
+
},
|
22
|
+
createdAt: {
|
23
|
+
type: sequelize_1.DataTypes.DATE,
|
24
|
+
allowNull: false,
|
25
|
+
defaultValue: sequelize.literal("NOW()"),
|
26
|
+
},
|
27
|
+
});
|
28
|
+
},
|
29
|
+
async down(queryInterface, sequelize) {
|
30
|
+
await queryInterface.dropTable("recurly_payment_monitoring_whitelist");
|
31
|
+
},
|
32
|
+
};
|
33
|
+
//# sourceMappingURL=20241123184623-recurly-payment-monitoring-whitelist.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"20241123184623-recurly-payment-monitoring-whitelist.js","sourceRoot":"","sources":["../../migrations/20241123184623-recurly-payment-monitoring-whitelist.ts"],"names":[],"mappings":";;AAAA,yCAAiE;AAEjE,kBAAe;IACb,KAAK,CAAC,EAAE,CAAC,cAA8B,EAAE,SAAoB;QAC3D,MAAM,cAAc,CAAC,WAAW,CAAC,sCAAsC,EAAE;YACvE,EAAE,EAAE;gBACF,IAAI,EAAE,qBAAS,CAAC,MAAM;gBACtB,UAAU,EAAE,IAAI;gBAChB,SAAS,EAAE,KAAK;gBAChB,aAAa,EAAE,IAAI;aACpB;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,qBAAS,CAAC,MAAM;gBACtB,SAAS,EAAE,KAAK;gBAChB,UAAU,EAAE;oBACV,KAAK,EAAE,OAAO;oBACd,GAAG,EAAE,IAAI;iBACV;gBACD,QAAQ,EAAE,SAAS;aACpB;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,qBAAS,CAAC,IAAI;gBACpB,SAAS,EAAE,KAAK;gBAChB,YAAY,EAAE,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC;aACzC;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,cAA8B,EAAE,SAAoB;QAC7D,MAAM,cAAc,CAAC,SAAS,CAAC,sCAAsC,CAAC,CAAC;IACzE,CAAC;CACF,CAAC"}
|
@@ -4,17 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const sequelize_1 = require("sequelize");
|
7
|
-
const pb_sequelize_1 = __importDefault(require("./pb-sequelize"));
|
8
7
|
const user_1 = __importDefault(require("./user"));
|
9
|
-
|
10
|
-
class
|
8
|
+
const pb_sequelize_1 = __importDefault(require("./pb-sequelize"));
|
9
|
+
class RecurlyPaymentMonitoringWhitelist extends sequelize_1.Model {
|
11
10
|
}
|
12
|
-
|
11
|
+
RecurlyPaymentMonitoringWhitelist.init({
|
13
12
|
id: {
|
14
13
|
type: sequelize_1.DataTypes.BIGINT,
|
15
14
|
primaryKey: true,
|
16
15
|
allowNull: false,
|
17
|
-
|
16
|
+
autoIncrement: true,
|
18
17
|
},
|
19
18
|
userId: {
|
20
19
|
type: sequelize_1.DataTypes.BIGINT,
|
@@ -22,30 +21,25 @@ FeaturedCapper.init({
|
|
22
21
|
field: "user_id",
|
23
22
|
references: {
|
24
23
|
model: user_1.default,
|
24
|
+
key: "id",
|
25
25
|
},
|
26
|
-
|
27
|
-
priority: {
|
28
|
-
type: sequelize_1.DataTypes.SMALLINT,
|
29
|
-
field: "priority",
|
30
|
-
},
|
31
|
-
customLabel: {
|
32
|
-
type: sequelize_1.DataTypes.STRING,
|
33
|
-
field: "custom_label",
|
26
|
+
onDelete: "CASCADE",
|
34
27
|
},
|
35
28
|
createdAt: sequelize_1.DataTypes.DATE,
|
36
|
-
updatedAt: sequelize_1.DataTypes.DATE,
|
37
29
|
}, {
|
38
|
-
tableName: "featured_cappers",
|
39
30
|
sequelize: pb_sequelize_1.default,
|
31
|
+
tableName: "recurly_payment_monitoring_whitelist",
|
32
|
+
timestamps: false,
|
40
33
|
});
|
41
|
-
user_1.default.hasOne(
|
34
|
+
user_1.default.hasOne(RecurlyPaymentMonitoringWhitelist, {
|
42
35
|
foreignKey: "userId",
|
43
36
|
sourceKey: "id",
|
37
|
+
as: "paymentMonitoringWhitelist",
|
44
38
|
});
|
45
|
-
|
46
|
-
foreignKey: "
|
47
|
-
|
48
|
-
|
39
|
+
RecurlyPaymentMonitoringWhitelist.belongsTo(user_1.default, {
|
40
|
+
foreignKey: "userId",
|
41
|
+
targetKey: "id",
|
42
|
+
as: "user",
|
49
43
|
});
|
50
|
-
exports.default =
|
51
|
-
//# sourceMappingURL=
|
44
|
+
exports.default = RecurlyPaymentMonitoringWhitelist;
|
45
|
+
//# sourceMappingURL=recurly-payment-monitoring-whitelist.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"recurly-payment-monitoring-whitelist.js","sourceRoot":"","sources":["../../typed-model/recurly-payment-monitoring-whitelist.ts"],"names":[],"mappings":";;;;;AAAA,yCAMmB;AAEnB,kDAA0B;AAE1B,kEAAuC;AAEvC,MAAM,iCAAkC,SAAQ,iBAG/C;CAIA;AAED,iCAAiC,CAAC,IAAI,CACpC;IACE,EAAE,EAAE;QACF,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,IAAI;KACpB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE;YACV,KAAK,EAAE,cAAI;YACX,GAAG,EAAE,IAAI;SACV;QACD,QAAQ,EAAE,SAAS;KACpB;IACD,SAAS,EAAE,qBAAS,CAAC,IAAI;CAC1B,EACD;IACE,SAAS,EAAT,sBAAS;IACT,SAAS,EAAE,sCAAsC;IACjD,UAAU,EAAE,KAAK;CAClB,CACF,CAAC;AAGF,cAAI,CAAC,MAAM,CAAC,iCAAiC,EAAE;IAC7C,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE,IAAI;IACf,EAAE,EAAE,4BAA4B;CACjC,CAAC,CAAC;AAEH,iCAAiC,CAAC,SAAS,CAAC,cAAI,EAAE;IAChD,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE,IAAI;IACf,EAAE,EAAE,MAAM;CACX,CAAC,CAAC;AAEH,kBAAe,iCAAiC,CAAC"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require("dotenv").config();
|
2
|
+
|
3
|
+
module.exports = {
|
4
|
+
development: {
|
5
|
+
dialect: "postgres",
|
6
|
+
host: process.env.TS_DB_HOST,
|
7
|
+
port: process.env.TS_DB_PORT,
|
8
|
+
database: process.env.TS_DB_NAME,
|
9
|
+
username: process.env.TS_DB_USER,
|
10
|
+
password: process.env.TS_DB_PASSWORD,
|
11
|
+
dialectOptions: {
|
12
|
+
ssl: false,
|
13
|
+
},
|
14
|
+
},
|
15
|
+
production: {
|
16
|
+
dialect: "postgres",
|
17
|
+
host: process.env.TS_DB_HOST,
|
18
|
+
port: process.env.TS_DB_PORT,
|
19
|
+
database: process.env.TS_DB_NAME,
|
20
|
+
username: process.env.TS_DB_USER,
|
21
|
+
password: process.env.TS_DB_PASSWORD,
|
22
|
+
dialectOptions: {
|
23
|
+
ssl: {
|
24
|
+
require: true,
|
25
|
+
rejectUnauthorized: false,
|
26
|
+
},
|
27
|
+
},
|
28
|
+
},
|
29
|
+
};
|
package/opticodds/index.ts
CHANGED
@@ -1,2 +1,424 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import type * as types from "./types";
|
2
|
+
import type { ConfigOptions, FetchResponse } from "api/dist/core";
|
3
|
+
import Oas from "oas";
|
4
|
+
import APICore from "api/dist/core";
|
5
|
+
import definition from "./openapi.json";
|
6
|
+
|
7
|
+
class SDK {
|
8
|
+
spec: Oas;
|
9
|
+
core: APICore;
|
10
|
+
|
11
|
+
constructor() {
|
12
|
+
this.spec = Oas.init(definition);
|
13
|
+
this.core = new APICore(this.spec, "opticodds/3.0.0 (api/6.1.3)");
|
14
|
+
}
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Optionally configure various options that the SDK allows.
|
18
|
+
*
|
19
|
+
* @param config Object of supported SDK options and toggles.
|
20
|
+
* @param config.timeout Override the default `fetch` request timeout of 30 seconds. This number
|
21
|
+
* should be represented in milliseconds.
|
22
|
+
*/
|
23
|
+
config(config: ConfigOptions) {
|
24
|
+
this.core.setConfig(config);
|
25
|
+
}
|
26
|
+
|
27
|
+
/**
|
28
|
+
* If the API you're using requires authentication you can supply the required credentials
|
29
|
+
* through this method and the library will magically determine how they should be used
|
30
|
+
* within your API request.
|
31
|
+
*
|
32
|
+
* With the exception of OpenID and MutualTLS, it supports all forms of authentication
|
33
|
+
* supported by the OpenAPI specification.
|
34
|
+
*
|
35
|
+
* @example <caption>HTTP Basic auth</caption>
|
36
|
+
* sdk.auth('username', 'password');
|
37
|
+
*
|
38
|
+
* @example <caption>Bearer tokens (HTTP or OAuth 2)</caption>
|
39
|
+
* sdk.auth('myBearerToken');
|
40
|
+
*
|
41
|
+
* @example <caption>API Keys</caption>
|
42
|
+
* sdk.auth('myApiKey');
|
43
|
+
*
|
44
|
+
* @see {@link https://spec.openapis.org/oas/v3.0.3#fixed-fields-22}
|
45
|
+
* @see {@link https://spec.openapis.org/oas/v3.1.0#fixed-fields-22}
|
46
|
+
* @param values Your auth credentials for the API; can specify up to two strings or numbers.
|
47
|
+
*/
|
48
|
+
auth(...values: string[] | number[]) {
|
49
|
+
this.core.setAuth(...values);
|
50
|
+
return this;
|
51
|
+
}
|
52
|
+
|
53
|
+
/**
|
54
|
+
* If the API you're using offers alternate server URLs, and server variables, you can tell
|
55
|
+
* the SDK which one to use with this method. To use it you can supply either one of the
|
56
|
+
* server URLs that are contained within the OpenAPI definition (along with any server
|
57
|
+
* variables), or you can pass it a fully qualified URL to use (that may or may not exist
|
58
|
+
* within the OpenAPI definition).
|
59
|
+
*
|
60
|
+
* @example <caption>Server URL with server variables</caption>
|
61
|
+
* sdk.server('https://{region}.api.example.com/{basePath}', {
|
62
|
+
* name: 'eu',
|
63
|
+
* basePath: 'v14',
|
64
|
+
* });
|
65
|
+
*
|
66
|
+
* @example <caption>Fully qualified server URL</caption>
|
67
|
+
* sdk.server('https://eu.api.example.com/v14');
|
68
|
+
*
|
69
|
+
* @param url Server URL
|
70
|
+
* @param variables An object of variables to replace into the server URL.
|
71
|
+
*/
|
72
|
+
server(url: string, variables = {}) {
|
73
|
+
this.core.setServer(url, variables);
|
74
|
+
}
|
75
|
+
|
76
|
+
getSports(): Promise<FetchResponse<200, types.GetSportsResponse200>> {
|
77
|
+
return this.core.fetch("/sports", "get");
|
78
|
+
}
|
79
|
+
|
80
|
+
getSportsActive(): Promise<
|
81
|
+
FetchResponse<200, types.GetSportsActiveResponse200>
|
82
|
+
> {
|
83
|
+
return this.core.fetch("/sports/active", "get");
|
84
|
+
}
|
85
|
+
|
86
|
+
getLeagues(
|
87
|
+
metadata?: types.GetLeaguesMetadataParam
|
88
|
+
): Promise<FetchResponse<200, types.GetLeaguesResponse200>> {
|
89
|
+
return this.core.fetch("/leagues", "get", metadata);
|
90
|
+
}
|
91
|
+
|
92
|
+
getLeaguesActive(
|
93
|
+
metadata?: types.GetLeaguesActiveMetadataParam
|
94
|
+
): Promise<FetchResponse<200, types.GetLeaguesActiveResponse200>> {
|
95
|
+
return this.core.fetch("/leagues/active", "get", metadata);
|
96
|
+
}
|
97
|
+
|
98
|
+
getSportsbooks(): Promise<
|
99
|
+
FetchResponse<200, types.GetSportsbooksResponse200>
|
100
|
+
> {
|
101
|
+
return this.core.fetch("/sportsbooks", "get");
|
102
|
+
}
|
103
|
+
|
104
|
+
getSportsbooksActive(
|
105
|
+
metadata?: types.GetSportsbooksActiveMetadataParam
|
106
|
+
): Promise<FetchResponse<200, types.GetSportsbooksActiveResponse200>> {
|
107
|
+
return this.core.fetch("/sportsbooks/active", "get", metadata);
|
108
|
+
}
|
109
|
+
|
110
|
+
getSportsbooksLastPolled(
|
111
|
+
metadata?: types.GetSportsbooksLastPolledMetadataParam
|
112
|
+
): Promise<FetchResponse<200, types.GetSportsbooksLastPolledResponse200>> {
|
113
|
+
return this.core.fetch("/sportsbooks/last-polled", "get", metadata);
|
114
|
+
}
|
115
|
+
|
116
|
+
getMarkets(
|
117
|
+
metadata?: types.GetMarketsMetadataParam
|
118
|
+
): Promise<FetchResponse<200, types.GetMarketsResponse200>> {
|
119
|
+
return this.core.fetch("/markets", "get", metadata);
|
120
|
+
}
|
121
|
+
|
122
|
+
getMarketsActive(
|
123
|
+
metadata: types.GetMarketsActiveMetadataParam
|
124
|
+
): Promise<FetchResponse<200, types.GetMarketsActiveResponse200>> {
|
125
|
+
return this.core.fetch("/markets/active", "get", metadata);
|
126
|
+
}
|
127
|
+
|
128
|
+
getMarketsSettleable(
|
129
|
+
metadata: types.GetMarketsSettleableMetadataParam
|
130
|
+
): Promise<FetchResponse<200, types.GetMarketsSettleableResponse200>> {
|
131
|
+
return this.core.fetch("/markets/settleable", "get", metadata);
|
132
|
+
}
|
133
|
+
|
134
|
+
getTeams(
|
135
|
+
metadata?: types.GetTeamsMetadataParam
|
136
|
+
): Promise<FetchResponse<200, types.GetTeamsResponse200>> {
|
137
|
+
return this.core.fetch("/teams", "get", metadata);
|
138
|
+
}
|
139
|
+
|
140
|
+
getPlayers(
|
141
|
+
metadata?: types.GetPlayersMetadataParam
|
142
|
+
): Promise<FetchResponse<200, types.GetPlayersResponse200>> {
|
143
|
+
return this.core.fetch("/players", "get", metadata);
|
144
|
+
}
|
145
|
+
|
146
|
+
getFixtures(
|
147
|
+
metadata?: types.GetFixturesMetadataParam
|
148
|
+
): Promise<FetchResponse<200, types.GetFixturesResponse200>> {
|
149
|
+
return this.core.fetch("/fixtures", "get", metadata);
|
150
|
+
}
|
151
|
+
|
152
|
+
getFixturesActive(
|
153
|
+
metadata?: types.GetFixturesActiveMetadataParam
|
154
|
+
): Promise<FetchResponse<200, types.GetFixturesActiveResponse200>> {
|
155
|
+
return this.core.fetch("/fixtures/active", "get", metadata);
|
156
|
+
}
|
157
|
+
|
158
|
+
getTournaments(
|
159
|
+
metadata?: types.GetTournamentsMetadataParam
|
160
|
+
): Promise<FetchResponse<200, types.GetTournamentsResponse200>> {
|
161
|
+
return this.core.fetch("/tournaments", "get", metadata);
|
162
|
+
}
|
163
|
+
|
164
|
+
getConferences(
|
165
|
+
metadata?: types.GetConferencesMetadataParam
|
166
|
+
): Promise<FetchResponse<200, types.GetConferencesResponse200>> {
|
167
|
+
return this.core.fetch("/conferences", "get", metadata);
|
168
|
+
}
|
169
|
+
|
170
|
+
getDivisions(
|
171
|
+
metadata?: types.GetDivisionsMetadataParam
|
172
|
+
): Promise<FetchResponse<200, types.GetDivisionsResponse200>> {
|
173
|
+
return this.core.fetch("/divisions", "get", metadata);
|
174
|
+
}
|
175
|
+
|
176
|
+
getFixturesOdds(
|
177
|
+
metadata: types.GetFixturesOddsMetadataParam
|
178
|
+
): Promise<FetchResponse<200, types.GetFixturesOddsResponse200>> {
|
179
|
+
return this.core.fetch("/fixtures/odds", "get", metadata);
|
180
|
+
}
|
181
|
+
|
182
|
+
getFixturesOddsHistorical(
|
183
|
+
metadata: types.GetFixturesOddsHistoricalMetadataParam
|
184
|
+
): Promise<FetchResponse<200, types.GetFixturesOddsHistoricalResponse200>> {
|
185
|
+
return this.core.fetch("/fixtures/odds/historical", "get", metadata);
|
186
|
+
}
|
187
|
+
|
188
|
+
getFixturesResults(
|
189
|
+
metadata?: types.GetFixturesResultsMetadataParam
|
190
|
+
): Promise<FetchResponse<200, types.GetFixturesResultsResponse200>> {
|
191
|
+
return this.core.fetch("/fixtures/results", "get", metadata);
|
192
|
+
}
|
193
|
+
|
194
|
+
getFixturesPlayerResults(
|
195
|
+
metadata?: types.GetFixturesPlayerResultsMetadataParam
|
196
|
+
): Promise<FetchResponse<200, types.GetFixturesPlayerResultsResponse200>> {
|
197
|
+
return this.core.fetch("/fixtures/player-results", "get", metadata);
|
198
|
+
}
|
199
|
+
|
200
|
+
getTournamentsResults(
|
201
|
+
metadata: types.GetTournamentsResultsMetadataParam
|
202
|
+
): Promise<FetchResponse<200, types.GetTournamentsResultsResponse200>> {
|
203
|
+
return this.core.fetch("/tournaments/results", "get", metadata);
|
204
|
+
}
|
205
|
+
|
206
|
+
getFixturesPlayerResultsLastX(
|
207
|
+
metadata?: types.GetFixturesPlayerResultsLastXMetadataParam
|
208
|
+
): Promise<
|
209
|
+
FetchResponse<200, types.GetFixturesPlayerResultsLastXResponse200>
|
210
|
+
> {
|
211
|
+
return this.core.fetch("/fixtures/player-results/last-x", "get", metadata);
|
212
|
+
}
|
213
|
+
|
214
|
+
getFixturesResultsHeadToHead(
|
215
|
+
metadata: types.GetFixturesResultsHeadToHeadMetadataParam
|
216
|
+
): Promise<
|
217
|
+
FetchResponse<200, types.GetFixturesResultsHeadToHeadResponse200>
|
218
|
+
> {
|
219
|
+
return this.core.fetch("/fixtures/results/head-to-head", "get", metadata);
|
220
|
+
}
|
221
|
+
|
222
|
+
getFutures(
|
223
|
+
metadata?: types.GetFuturesMetadataParam
|
224
|
+
): Promise<FetchResponse<200, types.GetFuturesResponse200>> {
|
225
|
+
return this.core.fetch("/futures", "get", metadata);
|
226
|
+
}
|
227
|
+
|
228
|
+
getFuturesOdds(
|
229
|
+
metadata: types.GetFuturesOddsMetadataParam
|
230
|
+
): Promise<FetchResponse<200, types.GetFuturesOddsResponse200>> {
|
231
|
+
return this.core.fetch("/futures/odds", "get", metadata);
|
232
|
+
}
|
233
|
+
|
234
|
+
getGraderOdds(
|
235
|
+
metadata: types.GetGraderOddsMetadataParam
|
236
|
+
): Promise<FetchResponse<200, types.GetGraderOddsResponse200>> {
|
237
|
+
return this.core.fetch("/grader/odds", "get", metadata);
|
238
|
+
}
|
239
|
+
|
240
|
+
getGraderFutures(
|
241
|
+
metadata: types.GetGraderFuturesMetadataParam
|
242
|
+
): Promise<FetchResponse<200, types.GetGraderFuturesResponse200>> {
|
243
|
+
return this.core.fetch("/grader/futures", "get", metadata);
|
244
|
+
}
|
245
|
+
|
246
|
+
getInjuries(
|
247
|
+
metadata?: types.GetInjuriesMetadataParam
|
248
|
+
): Promise<FetchResponse<200, types.GetInjuriesResponse200>> {
|
249
|
+
return this.core.fetch("/injuries", "get", metadata);
|
250
|
+
}
|
251
|
+
|
252
|
+
postParlayOdds(
|
253
|
+
body: types.PostParlayOddsBodyParam,
|
254
|
+
metadata?: types.PostParlayOddsMetadataParam
|
255
|
+
): Promise<FetchResponse<200, types.PostParlayOddsResponse200>> {
|
256
|
+
return this.core.fetch("/parlay/odds", "post", body, metadata);
|
257
|
+
}
|
258
|
+
|
259
|
+
getStreamOddsSport(
|
260
|
+
metadata: types.GetStreamOddsSportMetadataParam
|
261
|
+
): Promise<FetchResponse<200, types.GetStreamOddsSportResponse200>> {
|
262
|
+
return this.core.fetch("/stream/odds/{sport}", "get", metadata);
|
263
|
+
}
|
264
|
+
|
265
|
+
getStreamResultsSport(
|
266
|
+
metadata: types.GetStreamResultsSportMetadataParam
|
267
|
+
): Promise<FetchResponse<200, types.GetStreamResultsSportResponse200>> {
|
268
|
+
return this.core.fetch("/stream/results/{sport}", "get", metadata);
|
269
|
+
}
|
270
|
+
|
271
|
+
getCopilotFixturesOdds(
|
272
|
+
metadata?: types.GetCopilotFixturesOddsMetadataParam
|
273
|
+
): Promise<FetchResponse<200, types.GetCopilotFixturesOddsResponse200>> {
|
274
|
+
return this.core.fetch("/copilot/fixtures/odds", "get", metadata);
|
275
|
+
}
|
276
|
+
|
277
|
+
getCopilotGraderOdds(
|
278
|
+
metadata: types.GetCopilotGraderOddsMetadataParam
|
279
|
+
): Promise<FetchResponse<200, types.GetCopilotGraderOddsResponse200>> {
|
280
|
+
return this.core.fetch("/copilot/grader/odds", "get", metadata);
|
281
|
+
}
|
282
|
+
|
283
|
+
getCopilotParlayOdds(
|
284
|
+
metadata: types.GetCopilotParlayOddsMetadataParam
|
285
|
+
): Promise<FetchResponse<200, types.GetCopilotParlayOddsResponse200>> {
|
286
|
+
return this.core.fetch("/copilot/parlay/odds", "get", metadata);
|
287
|
+
}
|
288
|
+
|
289
|
+
getStreamCopilotSportOdds(
|
290
|
+
metadata: types.GetStreamCopilotSportOddsMetadataParam
|
291
|
+
): Promise<FetchResponse<200, types.GetStreamCopilotSportOddsResponse200>> {
|
292
|
+
return this.core.fetch("/stream/copilot/{sport}/odds", "get", metadata);
|
293
|
+
}
|
294
|
+
|
295
|
+
postCopilotQueueStart(
|
296
|
+
body: types.PostCopilotQueueStartBodyParam
|
297
|
+
): Promise<FetchResponse<200, types.PostCopilotQueueStartResponse200>> {
|
298
|
+
return this.core.fetch("/copilot/queue/start", "post", body);
|
299
|
+
}
|
300
|
+
|
301
|
+
postCopilotQueueStop(
|
302
|
+
body: types.PostCopilotQueueStopBodyParam
|
303
|
+
): Promise<FetchResponse<200, types.PostCopilotQueueStopResponse200>> {
|
304
|
+
return this.core.fetch("/copilot/queue/stop", "post", body);
|
305
|
+
}
|
306
|
+
|
307
|
+
getCopilotQueueStatus(
|
308
|
+
metadata?: types.GetCopilotQueueStatusMetadataParam
|
309
|
+
): Promise<FetchResponse<200, types.GetCopilotQueueStatusResponse200>> {
|
310
|
+
return this.core.fetch("/copilot/queue/status", "get", metadata);
|
311
|
+
}
|
312
|
+
|
313
|
+
postFixtureResultsQueueStart(
|
314
|
+
body: types.PostFixtureResultsQueueStartBodyParam
|
315
|
+
): Promise<
|
316
|
+
FetchResponse<200, types.PostFixtureResultsQueueStartResponse200>
|
317
|
+
> {
|
318
|
+
return this.core.fetch("/fixture/results/queue/start", "post", body);
|
319
|
+
}
|
320
|
+
|
321
|
+
postFixtureResultsQueueStop(
|
322
|
+
body: types.PostFixtureResultsQueueStopBodyParam
|
323
|
+
): Promise<FetchResponse<200, types.PostFixtureResultsQueueStopResponse200>> {
|
324
|
+
return this.core.fetch("/fixture/results/queue/stop", "post", body);
|
325
|
+
}
|
326
|
+
|
327
|
+
getFixtureResultsQueueStatus(
|
328
|
+
metadata?: types.GetFixtureResultsQueueStatusMetadataParam
|
329
|
+
): Promise<
|
330
|
+
FetchResponse<200, types.GetFixtureResultsQueueStatusResponse200>
|
331
|
+
> {
|
332
|
+
return this.core.fetch("/fixture/results/queue/status", "get", metadata);
|
333
|
+
}
|
334
|
+
}
|
335
|
+
|
336
|
+
const createSDK = (() => {
|
337
|
+
return new SDK();
|
338
|
+
})();
|
339
|
+
export default createSDK;
|
340
|
+
|
341
|
+
export type {
|
342
|
+
GetConferencesMetadataParam,
|
343
|
+
GetConferencesResponse200,
|
344
|
+
GetCopilotFixturesOddsMetadataParam,
|
345
|
+
GetCopilotFixturesOddsResponse200,
|
346
|
+
GetCopilotGraderOddsMetadataParam,
|
347
|
+
GetCopilotGraderOddsResponse200,
|
348
|
+
GetCopilotParlayOddsMetadataParam,
|
349
|
+
GetCopilotParlayOddsResponse200,
|
350
|
+
GetCopilotQueueStatusMetadataParam,
|
351
|
+
GetCopilotQueueStatusResponse200,
|
352
|
+
GetDivisionsMetadataParam,
|
353
|
+
GetDivisionsResponse200,
|
354
|
+
GetFixtureResultsQueueStatusMetadataParam,
|
355
|
+
GetFixtureResultsQueueStatusResponse200,
|
356
|
+
GetFixturesActiveMetadataParam,
|
357
|
+
GetFixturesActiveResponse200,
|
358
|
+
GetFixturesMetadataParam,
|
359
|
+
GetFixturesOddsHistoricalMetadataParam,
|
360
|
+
GetFixturesOddsHistoricalResponse200,
|
361
|
+
GetFixturesOddsMetadataParam,
|
362
|
+
GetFixturesOddsResponse200,
|
363
|
+
GetFixturesPlayerResultsLastXMetadataParam,
|
364
|
+
GetFixturesPlayerResultsLastXResponse200,
|
365
|
+
GetFixturesPlayerResultsMetadataParam,
|
366
|
+
GetFixturesPlayerResultsResponse200,
|
367
|
+
GetFixturesResponse200,
|
368
|
+
GetFixturesResultsHeadToHeadMetadataParam,
|
369
|
+
GetFixturesResultsHeadToHeadResponse200,
|
370
|
+
GetFixturesResultsMetadataParam,
|
371
|
+
GetFixturesResultsResponse200,
|
372
|
+
GetFuturesMetadataParam,
|
373
|
+
GetFuturesOddsMetadataParam,
|
374
|
+
GetFuturesOddsResponse200,
|
375
|
+
GetFuturesResponse200,
|
376
|
+
GetGraderFuturesMetadataParam,
|
377
|
+
GetGraderFuturesResponse200,
|
378
|
+
GetGraderOddsMetadataParam,
|
379
|
+
GetGraderOddsResponse200,
|
380
|
+
GetInjuriesMetadataParam,
|
381
|
+
GetInjuriesResponse200,
|
382
|
+
GetLeaguesActiveMetadataParam,
|
383
|
+
GetLeaguesActiveResponse200,
|
384
|
+
GetLeaguesMetadataParam,
|
385
|
+
GetLeaguesResponse200,
|
386
|
+
GetMarketsActiveMetadataParam,
|
387
|
+
GetMarketsActiveResponse200,
|
388
|
+
GetMarketsMetadataParam,
|
389
|
+
GetMarketsResponse200,
|
390
|
+
GetMarketsSettleableMetadataParam,
|
391
|
+
GetMarketsSettleableResponse200,
|
392
|
+
GetPlayersMetadataParam,
|
393
|
+
GetPlayersResponse200,
|
394
|
+
GetSportsActiveResponse200,
|
395
|
+
GetSportsResponse200,
|
396
|
+
GetSportsbooksActiveMetadataParam,
|
397
|
+
GetSportsbooksActiveResponse200,
|
398
|
+
GetSportsbooksLastPolledMetadataParam,
|
399
|
+
GetSportsbooksLastPolledResponse200,
|
400
|
+
GetSportsbooksResponse200,
|
401
|
+
GetStreamCopilotSportOddsMetadataParam,
|
402
|
+
GetStreamCopilotSportOddsResponse200,
|
403
|
+
GetStreamOddsSportMetadataParam,
|
404
|
+
GetStreamOddsSportResponse200,
|
405
|
+
GetStreamResultsSportMetadataParam,
|
406
|
+
GetStreamResultsSportResponse200,
|
407
|
+
GetTeamsMetadataParam,
|
408
|
+
GetTeamsResponse200,
|
409
|
+
GetTournamentsMetadataParam,
|
410
|
+
GetTournamentsResponse200,
|
411
|
+
GetTournamentsResultsMetadataParam,
|
412
|
+
GetTournamentsResultsResponse200,
|
413
|
+
PostCopilotQueueStartBodyParam,
|
414
|
+
PostCopilotQueueStartResponse200,
|
415
|
+
PostCopilotQueueStopBodyParam,
|
416
|
+
PostCopilotQueueStopResponse200,
|
417
|
+
PostFixtureResultsQueueStartBodyParam,
|
418
|
+
PostFixtureResultsQueueStartResponse200,
|
419
|
+
PostFixtureResultsQueueStopBodyParam,
|
420
|
+
PostFixtureResultsQueueStopResponse200,
|
421
|
+
PostParlayOddsBodyParam,
|
422
|
+
PostParlayOddsMetadataParam,
|
423
|
+
PostParlayOddsResponse200,
|
424
|
+
} from "./types";
|