@wrcb/cb-common 1.0.72 → 1.0.74
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/build/helpers/createObjects.d.ts +27 -0
- package/build/helpers/createObjects.js +42 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { MarketStatus } from '../events/types/marketStatus';
|
|
2
|
+
import { OddConfiguration } from '../events/types/oddConfiguration';
|
|
3
|
+
import { PredictionStatus } from '../events/types/predictionStatus';
|
|
4
|
+
export declare function BuildMarketObject(): {
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
status: MarketStatus;
|
|
8
|
+
priority: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function BuildPredictionObject(market: any, predictionOptions: any): {
|
|
11
|
+
title: string;
|
|
12
|
+
details: string;
|
|
13
|
+
status: PredictionStatus;
|
|
14
|
+
deadLine: Date;
|
|
15
|
+
oddConfiguration: OddConfiguration;
|
|
16
|
+
image: string;
|
|
17
|
+
rules: string;
|
|
18
|
+
slug: string;
|
|
19
|
+
market: any;
|
|
20
|
+
predictionOptions: any;
|
|
21
|
+
};
|
|
22
|
+
export declare function BuildBetObject(prediction: any): {
|
|
23
|
+
prediction: any;
|
|
24
|
+
userId: string;
|
|
25
|
+
odd: number;
|
|
26
|
+
value: number;
|
|
27
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BuildMarketObject = BuildMarketObject;
|
|
7
|
+
exports.BuildPredictionObject = BuildPredictionObject;
|
|
8
|
+
exports.BuildBetObject = BuildBetObject;
|
|
9
|
+
const marketStatus_1 = require("../events/types/marketStatus");
|
|
10
|
+
const oddConfiguration_1 = require("../events/types/oddConfiguration");
|
|
11
|
+
const predictionStatus_1 = require("../events/types/predictionStatus");
|
|
12
|
+
const createIdMongoose_1 = __importDefault(require("./createIdMongoose"));
|
|
13
|
+
function BuildMarketObject() {
|
|
14
|
+
return {
|
|
15
|
+
title: 'Politics',
|
|
16
|
+
description: 'Politics predictions',
|
|
17
|
+
status: marketStatus_1.MarketStatus.Active,
|
|
18
|
+
priority: 1,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function BuildPredictionObject(market, predictionOptions) {
|
|
22
|
+
return {
|
|
23
|
+
title: 'Will Donald Trump win?',
|
|
24
|
+
details: 'prediction about elections',
|
|
25
|
+
status: predictionStatus_1.PredictionStatus.Created,
|
|
26
|
+
deadLine: new Date(),
|
|
27
|
+
oddConfiguration: oddConfiguration_1.OddConfiguration.Automatic05,
|
|
28
|
+
image: 'image',
|
|
29
|
+
rules: 'rules',
|
|
30
|
+
slug: 'slug',
|
|
31
|
+
market,
|
|
32
|
+
predictionOptions,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function BuildBetObject(prediction) {
|
|
36
|
+
return {
|
|
37
|
+
prediction,
|
|
38
|
+
userId: (0, createIdMongoose_1.default)(),
|
|
39
|
+
odd: 1,
|
|
40
|
+
value: 23,
|
|
41
|
+
};
|
|
42
|
+
}
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -15,6 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./helpers/authHelper"), exports);
|
|
18
|
+
__exportStar(require("./helpers/createIdMongoose"), exports);
|
|
19
|
+
__exportStar(require("./helpers/createObjects"), exports);
|
|
18
20
|
__exportStar(require("./types"), exports);
|
|
19
21
|
__exportStar(require("./errors/badRequestError"), exports);
|
|
20
22
|
__exportStar(require("./errors/customError"), exports);
|