Skip to content

Commit bb8f46b

Browse files
authored
Merge pull request #474 from bitfinexcom/staging
Release version to master
2 parents 604ed9f + 2991585 commit bb8f46b

48 files changed

Lines changed: 1395 additions & 639 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bfx-reports-framework",
3-
"version": "4.22.4",
3+
"version": "4.22.5",
44
"description": "Bitfinex reports framework",
55
"main": "worker.js",
66
"license": "Apache-2.0",

workers/api.framework.report.wrk.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,21 @@ const {
4141

4242
const appDeps = require('./loc.api/di/app.deps')
4343
const TYPES = require('./loc.api/di/types')
44+
const fwDataValidator = require('./loc.api/data-validator')
4445

4546
class WrkReportFrameWorkApi extends WrkReportServiceApi {
47+
loadCoreDeps (...args) {
48+
super.loadCoreDeps(...args)
49+
50+
this.container
51+
.get(TYPES.DataValidator)
52+
.reinit({
53+
schemaNames: fwDataValidator.SCHEMA_NAMES,
54+
schemaIds: fwDataValidator.SCHEMA_IDS,
55+
schemas: fwDataValidator.schemas
56+
})
57+
}
58+
4659
loadAppDeps (...args) {
4760
super.loadAppDeps(...args)
4861

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict'
2+
3+
const SCHEMA_NAMES = require('./schema.names')
4+
const SCHEMA_IDS = require('./schema.ids')
5+
const schemas = require('./schemas')
6+
7+
module.exports = {
8+
SCHEMA_NAMES,
9+
SCHEMA_IDS,
10+
11+
schemas
12+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict'
2+
3+
const SCHEMA_NAMES = require('./schema.names')
4+
const {
5+
getSchemaIds
6+
} = require('bfx-report/workers/loc.api/data-validator/helpers')
7+
8+
module.exports = getSchemaIds(SCHEMA_NAMES)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
'use strict'
2+
3+
module.exports = {
4+
FW_DEFS: 'fwDefs',
5+
6+
CREATE_SUB_ACCOUNT_REQ: 'createSubAccountReq',
7+
UPDATE_SUB_ACCOUNT_REQ: 'updateSubAccountReq',
8+
INTERRUPT_OPERATIONS_REQ: 'interruptOperationsReq',
9+
EDIT_ALL_PUBLIC_COLLS_CONFS_REQ: 'editAllPublicCollsConfsReq',
10+
11+
FW_GET_CANDLES_REQ: 'fwGetCandlesReq',
12+
GET_BALANCE_HISTORY_REQ: 'getBalanceHistoryReq',
13+
GET_WIN_LOSS_REQ: 'getWinLossReq',
14+
GET_POSITIONS_SNAPSHOT_REQ: 'getPositionsSnapshotReq',
15+
GET_FULL_SNAPSHOT_REPORT_REQ: 'getFullSnapshotReportReq',
16+
GET_FULL_TAX_REPORT_REQ: 'getFullTaxReportReq',
17+
GET_TRANSACTION_TAX_REPORT_REQ: 'getTransactionTaxReportReq',
18+
GET_TRADED_VOLUME_REQ: 'getTradedVolumeReq',
19+
GET_TOTAL_FEES_REPORT_REQ: 'getTotalFeesReportReq',
20+
GET_PERFORMING_LOAN_REQ: 'getPerformingLoanReq',
21+
GET_WIN_LOSS_VS_ACCOUNT_BALANCE_REQ: 'getWinLossVSAccountBalanceReq',
22+
GET_SUMMARY_BY_ASSET_REQ: 'getSummaryByAssetReq',
23+
24+
FW_GET_CANDLES_FILE_REQ: 'fwGetCandlesFileReq',
25+
GET_BALANCE_HISTORY_FILE_REQ: 'getBalanceHistoryFileReq',
26+
GET_WIN_LOSS_FILE_REQ: 'getWinLossFileReq',
27+
GET_POSITIONS_SNAPSHOT_FILE_REQ: 'getPositionsSnapshotFileReq',
28+
GET_FULL_SNAPSHOT_REPORT_FILE_REQ: 'getFullSnapshotReportFileReq',
29+
GET_FULL_TAX_REPORT_FILE_REQ: 'getFullTaxReportFileReq',
30+
GET_TRANSACTION_TAX_REPORT_FILE_REQ: 'getTransactionTaxReportFileReq',
31+
GET_TRADED_VOLUME_FILE_REQ: 'getTradedVolumeFileReq',
32+
GET_TOTAL_FEES_REPORT_FILE_REQ: 'getTotalFeesReportFileReq',
33+
GET_PERFORMING_LOAN_FILE_REQ: 'getPerformingLoanFileReq',
34+
GET_WIN_LOSS_VS_ACCOUNT_BALANCE_FILE_REQ: 'getWinLossVSAccountBalanceFileReq'
35+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'use strict'
2+
3+
const SCHEMA_IDS = require('../schema.ids')
4+
5+
module.exports = {
6+
$id: SCHEMA_IDS.CREATE_SUB_ACCOUNT_REQ,
7+
type: 'object',
8+
additionalProperties: false,
9+
required: ['subAccountApiKeys'],
10+
properties: {
11+
subAccountApiKeys: {
12+
$ref: 'fwDefs#/definitions/subAccountApiKeys'
13+
},
14+
subAccountPassword: {
15+
$ref: 'fwDefs#/definitions/password'
16+
},
17+
localUsername: {
18+
type: 'string'
19+
}
20+
}
21+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
'use strict'
2+
3+
const SCHEMA_IDS = require('../schema.ids')
4+
5+
module.exports = {
6+
$id: SCHEMA_IDS.EDIT_ALL_PUBLIC_COLLS_CONFS_REQ,
7+
type: 'object',
8+
additionalProperties: false,
9+
properties: {
10+
candlesConf: {
11+
type: 'array',
12+
items: {
13+
type: 'object',
14+
additionalProperties: false,
15+
required: ['symbol', 'start', 'timeframe'],
16+
properties: {
17+
start: {
18+
$ref: 'defs#/definitions/start'
19+
},
20+
symbol: {
21+
$ref: 'defs#/definitions/strSymbol'
22+
},
23+
timeframe: {
24+
$ref: 'defs#/definitions/candleTimeframe'
25+
}
26+
}
27+
}
28+
},
29+
statusMessagesConf: {
30+
type: 'array',
31+
items: {
32+
type: 'object',
33+
additionalProperties: false,
34+
required: ['symbol', 'start'],
35+
properties: {
36+
start: {
37+
$ref: 'defs#/definitions/start'
38+
},
39+
symbol: {
40+
$ref: 'defs#/definitions/strSymbol'
41+
}
42+
}
43+
}
44+
},
45+
tickersHistoryConf: {
46+
type: 'array',
47+
items: {
48+
type: 'object',
49+
additionalProperties: false,
50+
required: ['symbol', 'start'],
51+
properties: {
52+
start: {
53+
$ref: 'defs#/definitions/start'
54+
},
55+
symbol: {
56+
$ref: 'defs#/definitions/strSymbol'
57+
}
58+
}
59+
}
60+
},
61+
publicTradesConf: {
62+
type: 'array',
63+
items: {
64+
type: 'object',
65+
additionalProperties: false,
66+
required: ['symbol', 'start'],
67+
properties: {
68+
start: {
69+
$ref: 'defs#/definitions/start'
70+
},
71+
symbol: {
72+
$ref: 'defs#/definitions/strSymbol'
73+
}
74+
}
75+
}
76+
}
77+
}
78+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
'use strict'
2+
3+
const SCHEMA_IDS = require('../schema.ids')
4+
5+
module.exports = {
6+
$id: SCHEMA_IDS.FW_DEFS,
7+
definitions: {
8+
timeframe: {
9+
type: 'string',
10+
enum: [
11+
'day',
12+
'week',
13+
'month',
14+
'year'
15+
]
16+
},
17+
isUnrealizedProfitExcluded: {
18+
type: 'boolean'
19+
},
20+
isVSPrevDayBalance: {
21+
type: 'boolean'
22+
},
23+
apiKey: {
24+
type: 'string'
25+
},
26+
apiSecret: {
27+
type: 'string'
28+
},
29+
token: {
30+
type: 'string'
31+
},
32+
password: {
33+
type: 'string'
34+
},
35+
subAccountApiKeys: {
36+
type: 'array',
37+
minItems: 1,
38+
maxItems: 20,
39+
items: {
40+
type: 'object',
41+
oneOf: [
42+
{
43+
additionalProperties: false,
44+
properties: {
45+
apiKey: {
46+
$ref: '#/definitions/apiKey'
47+
},
48+
apiSecret: {
49+
$ref: '#/definitions/apiSecret'
50+
}
51+
}
52+
},
53+
{
54+
additionalProperties: false,
55+
properties: {
56+
token: {
57+
$ref: '#/definitions/token'
58+
}
59+
}
60+
},
61+
{
62+
additionalProperties: false,
63+
properties: {
64+
email: {
65+
$ref: 'defs#/definitions/email'
66+
},
67+
password: {
68+
$ref: '#/definitions/password'
69+
}
70+
}
71+
}
72+
]
73+
}
74+
},
75+
strategy: {
76+
type: 'string',
77+
enum: [
78+
'FIFO',
79+
'LIFO'
80+
]
81+
},
82+
shouldFeesBeDeducted: {
83+
type: 'boolean'
84+
},
85+
isTradingFees: {
86+
type: 'boolean'
87+
},
88+
isFundingFees: {
89+
type: 'boolean'
90+
}
91+
}
92+
}

0 commit comments

Comments
 (0)