Add chainquery dependencies for Spee.ch, does not include migrations #593
1
.gitignore
vendored
|
@ -5,6 +5,7 @@
|
||||||
node_modules
|
node_modules
|
||||||
|
|
||||||
client/build
|
client/build
|
||||||
|
server/chainquery/build
|
||||||
|
|
||||||
client_custom/build
|
client_custom/build
|
||||||
client_custom/scss
|
client_custom/scss
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { selectSiteHost } from '../selectors/site';
|
||||||
|
|
||||||
function * retrieveFile (action) {
|
function * retrieveFile (action) {
|
||||||
const name = action.data.name;
|
const name = action.data.name;
|
||||||
const claimId = action.data.claimId;
|
const claimId = action.data.claim_id || action.data.claimId;
|
||||||
const host = yield select(selectSiteHost);
|
const host = yield select(selectSiteHost);
|
||||||
// see if the file is available
|
// see if the file is available
|
||||||
let isAvailable;
|
let isAvailable;
|
||||||
|
|
19
package-lock.json
generated
|
@ -908,6 +908,12 @@
|
||||||
"integrity": "sha512-EIjmpvnHj+T4nMcKwHwxZKUfDmphIKJc2qnEMhSoOvr1lYEQpuRKRz8orWr//krYIIArS/KGGLfL2YGVUYXmIA==",
|
"integrity": "sha512-EIjmpvnHj+T4nMcKwHwxZKUfDmphIKJc2qnEMhSoOvr1lYEQpuRKRz8orWr//krYIIArS/KGGLfL2YGVUYXmIA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"@types/estree": {
|
||||||
|
"version": "0.0.39",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
|
||||||
|
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@types/geojson": {
|
"@types/geojson": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.6.tgz",
|
||||||
|
@ -12030,6 +12036,16 @@
|
||||||
"inherits": "2.0.3"
|
"inherits": "2.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rollup": {
|
||||||
|
"version": "0.66.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/rollup/-/rollup-0.66.2.tgz",
|
||||||
|
"integrity": "sha512-+rOLjWO170M3Y2jyyGU4ZJuTu1T1KuKNyH+RszHRzQdsuI5TulRbkSM4vlaMnwcxHm4XdgBNZ1mmNzhQIImbiQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/estree": "0.0.39",
|
||||||
|
"@types/node": "10.9.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"run-async": {
|
"run-async": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",
|
||||||
|
@ -14152,6 +14168,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"winston-slack-webhook": {
|
||||||
|
"version": "github:billbitt/winston-slack-webhook#ce99792bdf6473a9da69c91772eb4ecec4979b6c"
|
||||||
|
},
|
||||||
"wkx": {
|
"wkx": {
|
||||||
"version": "0.4.5",
|
"version": "0.4.5",
|
||||||
"resolved": "https://registry.npmjs.org/wkx/-/wkx-0.4.5.tgz",
|
"resolved": "https://registry.npmjs.org/wkx/-/wkx-0.4.5.tgz",
|
||||||
|
|
|
@ -15,8 +15,10 @@
|
||||||
"prestart": "builder run bundle",
|
"prestart": "builder run bundle",
|
||||||
"start": "node server.js",
|
"start": "node server.js",
|
||||||
"start:build": "builder run start",
|
"start:build": "builder run start",
|
||||||
|
"chainquery:build": "rollup ./server/chainquery/index.js --file ./server/chainquery/bundle.js --format cjs",
|
||||||
"devtools:server": "ndb server.js",
|
"devtools:server": "ndb server.js",
|
||||||
"devtools:chainquery": "ndb ./server/chainquery/index.debug.js",
|
"devtools:chainquery": "npm run devtools:chainquery:build && ndb ./server/chainquery/bundle.debug.js",
|
||||||
|
"devtools:chainquery:build": "rollup ./server/chainquery/index.debug.js --file ./server/chainquery/bundle.debug.js --format cjs",
|
||||||
"test": "mocha --recursive",
|
"test": "mocha --recursive",
|
||||||
"test:no-lbc": "npm test -- --grep @usesLbc --invert",
|
"test:no-lbc": "npm test -- --grep @usesLbc --invert",
|
||||||
"test:server": "mocha --recursive './server/**/*.test.js'",
|
"test:server": "mocha --recursive './server/**/*.test.js'",
|
||||||
|
@ -115,6 +117,7 @@
|
||||||
"nodemon": "^1.17.5",
|
"nodemon": "^1.17.5",
|
||||||
"redux-devtools": "^3.4.1",
|
"redux-devtools": "^3.4.1",
|
||||||
"regenerator-transform": "^0.13.0",
|
"regenerator-transform": "^0.13.0",
|
||||||
|
"rollup": "^0.66.2",
|
||||||
"sass-loader": "^7.1.0",
|
"sass-loader": "^7.1.0",
|
||||||
"sequelize-cli": "^4.0.0",
|
"sequelize-cli": "^4.0.0",
|
||||||
"style-loader": "^0.21.0",
|
"style-loader": "^0.21.0",
|
||||||
|
|
1079
server/chainquery/bundle.debug.js
Normal file
1075
server/chainquery/bundle.js
Normal file
|
@ -1,9 +1,6 @@
|
||||||
console.log('Loading `chainquery`, please wait...')
|
console.log('Loading `chainquery`, please wait...')
|
||||||
|
|
||||||
require('@babel/polyfill');
|
import chainquery from './index'
|
||||||
require('@babel/register');
|
|
||||||
|
|
||||||
const chainquery = require('./');
|
|
||||||
|
|
||||||
global.chainquery = chainquery.default ? chainquery.default : chainquery;
|
global.chainquery = chainquery.default ? chainquery.default : chainquery;
|
||||||
|
|
||||||
|
|
|
@ -3,17 +3,63 @@ const logger = require('winston');
|
||||||
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
|
||||||
import abnormalClaimTable from './tables/abnormalClaimTable';
|
import abnormalClaimTable from './tables/abnormalClaimTable';
|
||||||
Is this useful to you? This is for claims that were not made through the app. Claims that are not structured according to the lbry protocol. Is this useful to you? This is for claims that were not made through the app. Claims that are not structured according to the lbry protocol.
Not at the moment, retained for full functionality if this is to be split out into a separate lib Not at the moment, retained for full functionality if this is to be split out into a separate lib
|
|||||||
import addressTable from './tables/addressTable';
|
import addressTable from './tables/addressTable';
|
||||||
import applicationStatusTable from './tables/applicationStatusTable';
|
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
import blockTable from './tables/blockTable';
|
import blockTable from './tables/blockTable';
|
||||||
import claimTable from './tables/claimTable';
|
import claimTable from './tables/claimTable';
|
||||||
import gorpMigrationsTable from './tables/gorpMigrationsTable';
|
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
import inputTable from './tables/inputTable';
|
import inputTable from './tables/inputTable';
|
||||||
import jobStatusTable from './tables/jobStatusTable';
|
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
import outputTable from './tables/outputTable';
|
import outputTable from './tables/outputTable';
|
||||||
import supportTable from './tables/supportTable';
|
import supportTable from './tables/supportTable';
|
||||||
import transactionAddressTable from './tables/transactionAddressTable';
|
import transactionAddressTable from './tables/transactionAddressTable';
|
||||||
import transactionTable from './tables/transactionTable';
|
import transactionTable from './tables/transactionTable';
|
||||||
|
|
||||||
|
import abnormalClaimQueries from './queries/abnormalClaimQueries';
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
import addressQueries from './queries/addressQueries';
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
import blockQueries from './queries/blockQueries';
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
import claimQueries from './queries/claimQueries';
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
import inputQueries from './queries/inputQueries';
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
import outputQueries from './queries/outputQueries';
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
import supportQueries from './queries/supportQueries';
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
import transactionAddressQueries from './queries/transactionAddressQueries';
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
import transactionQueries from './queries/transactionQueries';
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
const DATABASE_STRUCTURE = {
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
'abnormal_claim': {
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
table: abnormalClaimTable,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
queries: abnormalClaimQueries,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
},
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
'address': {
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
table: addressTable,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
queries: addressQueries,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
},
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
'block': {
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
table: blockTable,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
queries: blockQueries,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
},
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
'claim': {
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
table: claimTable,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
queries: claimQueries,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
},
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
'input': {
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
table: inputTable,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
queries: inputQueries,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
},
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
'output': {
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
table: outputTable,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
queries: outputQueries,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
},
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
'support': {
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
table: supportTable,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
queries: supportQueries,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
},
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
'transaction_address': {
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
table: transactionAddressTable,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
queries: transactionAddressQueries,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
},
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
'transaction': {
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
table: transactionTable,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
queries: transactionQueries,
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
},
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
};
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
const {
|
const {
|
||||||
host,
|
host,
|
||||||
port,
|
port,
|
||||||
|
@ -45,22 +91,19 @@ const sequelize = new Sequelize(database, username, password, {
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
});
|
});
|
||||||
|
|
||||||
const db = {};
|
const db = {};
|
||||||
db.abnormal_claim = sequelize.import('abnormal_claim', abnormalClaimTable.createModel);
|
const DATABASE_STRUCTURE_KEYS = Object.keys(DATABASE_STRUCTURE);
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
db.application_status = sequelize.import('application_status', applicationStatusTable.createModel);
|
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
db.address = sequelize.import('address', addressTable.createModel);
|
for(let i = 0; i < DATABASE_STRUCTURE_KEYS.length; i++) {
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
db.block = sequelize.import('block', blockTable.createModel);
|
let dbKey = DATABASE_STRUCTURE_KEYS[i];
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
db.claim = sequelize.import('claim', claimTable.createModel);
|
let currentData = DATABASE_STRUCTURE[dbKey];
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
db.gorp_migrations = sequelize.import('gorp_migrations', gorpMigrationsTable.createModel);
|
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
db.input = sequelize.import('input', inputTable.createModel);
|
db[dbKey] = currentData.table.createModel(sequelize, Sequelize);
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
db.job_status = sequelize.import('job_status', jobStatusTable.createModel);
|
db[dbKey].queries = currentData.queries(db, db[dbKey]);
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
db.output = sequelize.import('output', outputTable.createModel);
|
}
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
db.support = sequelize.import('support', supportTable.createModel);
|
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
db.transaction_address = sequelize.import('transaction_address', transactionAddressTable.createModel);
|
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
db.transaction = sequelize.import('transaction', transactionTable.createModel);
|
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
|
|
||||||
// run model.association for each model in the db object that has an association
|
// run model.association for each model in the db object that has an association
|
||||||
logger.info('associating chainquery db models...');
|
logger.info('associating chainquery db models...');
|
||||||
Object.keys(db).forEach(modelName => {
|
DATABASE_STRUCTURE_KEYS.forEach(modelName => {
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|||||||
if (db[modelName].associate) {
|
if (db[modelName].associate) {
|
||||||
logger.info('Associating chainquery model:', modelName);
|
logger.info('Associating chainquery model:', modelName);
|
||||||
db[modelName].associate(db);
|
db[modelName].associate(db);
|
||||||
|
|
||||||
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
this is only used for database migrations. Not of use to speech. I would ignore this table. this is only used for database migrations. Not of use to speech. I would ignore this table.
This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech. This table is used for tracking background job statuses internal to chainquery. Most likely not useful for speech.
same thing. this is an internal table of no importance to speech. same thing. this is an internal table of no importance to speech.
|
|
@ -59,7 +59,7 @@ export default (sequelize, {
|
||||||
These are timestamps, is it ok to create it as an integer? These are timestamps, is it ok to create it as an integer?
This will work for now, I need to verify that This will work for now, I need to verify that `Sequelize.DATE(6)` is fully compatible first.
There's a few things like `INT(1)` that I'm using `INTEGER` for as well that could probably be switched to `Sequelize.BOOLEAN`. I know there's a number of `BIGINT` as well that I need to adjust.
These are timestamps, is it ok to create it as an integer? These are timestamps, is it ok to create it as an integer?
This will work for now, I need to verify that This will work for now, I need to verify that `Sequelize.DATE(6)` is fully compatible first.
There's a few things like `INT(1)` that I'm using `INTEGER` for as well that could probably be switched to `Sequelize.BOOLEAN`. I know there's a number of `BIGINT` as well that I need to adjust.
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
freezeTableName: true,
|
freezeTableName: true,
|
||||||
getterMethods,
|
//getterMethods,
|
||||||
These are timestamps, is it ok to create it as an integer? These are timestamps, is it ok to create it as an integer?
This will work for now, I need to verify that This will work for now, I need to verify that `Sequelize.DATE(6)` is fully compatible first.
There's a few things like `INT(1)` that I'm using `INTEGER` for as well that could probably be switched to `Sequelize.BOOLEAN`. I know there's a number of `BIGINT` as well that I need to adjust.
These are timestamps, is it ok to create it as an integer? These are timestamps, is it ok to create it as an integer?
This will work for now, I need to verify that This will work for now, I need to verify that `Sequelize.DATE(6)` is fully compatible first.
There's a few things like `INT(1)` that I'm using `INTEGER` for as well that could probably be switched to `Sequelize.BOOLEAN`. I know there's a number of `BIGINT` as well that I need to adjust.
|
|||||||
timestamps: false, // don't use default timestamps columns
|
timestamps: false, // don't use default timestamps columns
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
These are timestamps, is it ok to create it as an integer? These are timestamps, is it ok to create it as an integer?
This will work for now, I need to verify that This will work for now, I need to verify that `Sequelize.DATE(6)` is fully compatible first.
There's a few things like `INT(1)` that I'm using `INTEGER` for as well that could probably be switched to `Sequelize.BOOLEAN`. I know there's a number of `BIGINT` as well that I need to adjust.
These are timestamps, is it ok to create it as an integer? These are timestamps, is it ok to create it as an integer?
This will work for now, I need to verify that This will work for now, I need to verify that `Sequelize.DATE(6)` is fully compatible first.
There's a few things like `INT(1)` that I'm using `INTEGER` for as well that could probably be switched to `Sequelize.BOOLEAN`. I know there's a number of `BIGINT` as well that I need to adjust.
|
|
@ -31,7 +31,7 @@ export default (sequelize, {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
freezeTableName: true,
|
freezeTableName: true,
|
||||||
getterMethods,
|
//getterMethods,
|
||||||
timestamps: false, // don't use default timestamps columns
|
timestamps: false, // don't use default timestamps columns
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
const getterMethods = {
|
|
||||||
// Add as needed, prefix all methods with `generated`
|
|
||||||
}
|
|
||||||
|
|
||||||
export default (sequelize, {
|
|
||||||
STRING, BOOLEAN, INTEGER, TEXT, DECIMAL
|
|
||||||
}) => sequelize.define(
|
|
||||||
'application_status',
|
|
||||||
{
|
|
||||||
id: {
|
|
||||||
primaryKey: true,
|
|
||||||
type: INTEGER,
|
|
||||||
set() { },
|
|
||||||
},
|
|
||||||
app_version: {
|
|
||||||
type: INTEGER,
|
|
||||||
set() { },
|
|
||||||
},
|
|
||||||
data_version: {
|
|
||||||
type: INTEGER,
|
|
||||||
set() { },
|
|
||||||
},
|
|
||||||
api_version: {
|
|
||||||
type: INTEGER,
|
|
||||||
set() { },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
freezeTableName: true,
|
|
||||||
getterMethods,
|
|
||||||
timestamps: false, // don't use default timestamps columns
|
|
||||||
}
|
|
||||||
);
|
|
|
@ -91,7 +91,7 @@ export default (sequelize, {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
freezeTableName: true,
|
freezeTableName: true,
|
||||||
getterMethods,
|
//getterMethods,
|
||||||
timestamps: false, // don't use default timestamps columns
|
timestamps: false, // don't use default timestamps columns
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -3,7 +3,7 @@ const logger = require('winston');
|
||||||
This is a boolean that is a This is a boolean that is a `TINYINT(1)` in the database.
This is also an enumeration. I see that you set an enumeration above. Should this be listed as well? This is also an enumeration. I see that you set an enumeration above. Should this be listed as well? `Active,Expired,Controlling,Spent,Accepted` are the enumerations.
This is a boolean that is a This is a boolean that is a `TINYINT(1)` in the database.
This is also an enumeration. I see that you set an enumeration above. Should this be listed as well? This is also an enumeration. I see that you set an enumeration above. Should this be listed as well? `Active,Expired,Controlling,Spent,Accepted` are the enumerations.
|
|||||||
const {
|
const {
|
||||||
assetDefaults: { thumbnail: defaultThumbnail },
|
assetDefaults: { thumbnail: defaultThumbnail },
|
||||||
details: { host }
|
details: { host }
|
||||||
} = require('../../../config/siteConfig'); // TODO: Change back to '@config/siteConfig' when done testing
|
} = require('../../config/siteConfig'); // TODO: Fix paths for rollup
|
||||||
This is a boolean that is a This is a boolean that is a `TINYINT(1)` in the database.
This is also an enumeration. I see that you set an enumeration above. Should this be listed as well? This is also an enumeration. I see that you set an enumeration above. Should this be listed as well? `Active,Expired,Controlling,Spent,Accepted` are the enumerations.
This is a boolean that is a This is a boolean that is a `TINYINT(1)` in the database.
This is also an enumeration. I see that you set an enumeration above. Should this be listed as well? This is also an enumeration. I see that you set an enumeration above. Should this be listed as well? `Active,Expired,Controlling,Spent,Accepted` are the enumerations.
|
|||||||
|
|
||||||
const getterMethods = {
|
const getterMethods = {
|
||||||
generated_extension() {
|
generated_extension() {
|
||||||
|
|
||||||
This is a boolean that is a This is a boolean that is a `TINYINT(1)` in the database.
This is also an enumeration. I see that you set an enumeration above. Should this be listed as well? This is also an enumeration. I see that you set an enumeration above. Should this be listed as well? `Active,Expired,Controlling,Spent,Accepted` are the enumerations.
This is a boolean that is a This is a boolean that is a `TINYINT(1)` in the database.
This is also an enumeration. I see that you set an enumeration above. Should this be listed as well? This is also an enumeration. I see that you set an enumeration above. Should this be listed as well? `Active,Expired,Controlling,Spent,Accepted` are the enumerations.
|
|
@ -1,25 +0,0 @@
|
||||||
const getterMethods = {
|
|
||||||
// Add as needed, prefix all methods with `generated`
|
|
||||||
}
|
|
||||||
|
|
||||||
export default (sequelize, {
|
|
||||||
STRING, BOOLEAN, INTEGER, TEXT, DECIMAL
|
|
||||||
}) => sequelize.define(
|
|
||||||
'gorp_migrations',
|
|
||||||
{
|
|
||||||
id: {
|
|
||||||
primaryKey: true,
|
|
||||||
type: INTEGER,
|
|
||||||
set() { },
|
|
||||||
},
|
|
||||||
applied_at: {
|
|
||||||
type: INTEGER,
|
|
||||||
set() { },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
freezeTableName: true,
|
|
||||||
getterMethods,
|
|
||||||
timestamps: false, // don't use default timestamps columns
|
|
||||||
}
|
|
||||||
);
|
|
|
@ -71,7 +71,7 @@ export default (sequelize, {
|
||||||
boolean boolean
this is unsigned. Does it matter that you treat it as just an integer? this is unsigned. Does it matter that you treat it as just an integer?
Ha, alright! I didn't realize
Ha, alright! I didn't realize `TINYINT(1)` is exactly the same as `BOOL`
https://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html
> **BOOL, BOOLEAN**
> These types are synonyms for TINYINT(1). A value of zero is considered false. Nonzero values are considered true
boolean boolean
this is unsigned. Does it matter that you treat it as just an integer? this is unsigned. Does it matter that you treat it as just an integer?
Ha, alright! I didn't realize
Ha, alright! I didn't realize `TINYINT(1)` is exactly the same as `BOOL`
https://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html
> **BOOL, BOOLEAN**
> These types are synonyms for TINYINT(1). A value of zero is considered false. Nonzero values are considered true
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
freezeTableName: true,
|
freezeTableName: true,
|
||||||
getterMethods,
|
//getterMethods,
|
||||||
boolean boolean
this is unsigned. Does it matter that you treat it as just an integer? this is unsigned. Does it matter that you treat it as just an integer?
Ha, alright! I didn't realize
Ha, alright! I didn't realize `TINYINT(1)` is exactly the same as `BOOL`
https://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html
> **BOOL, BOOLEAN**
> These types are synonyms for TINYINT(1). A value of zero is considered false. Nonzero values are considered true
boolean boolean
this is unsigned. Does it matter that you treat it as just an integer? this is unsigned. Does it matter that you treat it as just an integer?
Ha, alright! I didn't realize
Ha, alright! I didn't realize `TINYINT(1)` is exactly the same as `BOOL`
https://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html
> **BOOL, BOOLEAN**
> These types are synonyms for TINYINT(1). A value of zero is considered false. Nonzero values are considered true
|
|||||||
timestamps: false, // don't use default timestamps columns
|
timestamps: false, // don't use default timestamps columns
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
boolean boolean
this is unsigned. Does it matter that you treat it as just an integer? this is unsigned. Does it matter that you treat it as just an integer?
Ha, alright! I didn't realize
Ha, alright! I didn't realize `TINYINT(1)` is exactly the same as `BOOL`
https://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html
> **BOOL, BOOLEAN**
> These types are synonyms for TINYINT(1). A value of zero is considered false. Nonzero values are considered true
boolean boolean
this is unsigned. Does it matter that you treat it as just an integer? this is unsigned. Does it matter that you treat it as just an integer?
Ha, alright! I didn't realize
Ha, alright! I didn't realize `TINYINT(1)` is exactly the same as `BOOL`
https://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html
> **BOOL, BOOLEAN**
> These types are synonyms for TINYINT(1). A value of zero is considered false. Nonzero values are considered true
|
|
@ -1,33 +0,0 @@
|
||||||
const getterMethods = {
|
|
||||||
// Add as needed, prefix all methods with `generated`
|
|
||||||
}
|
|
||||||
|
|
||||||
export default (sequelize, {
|
|
||||||
STRING, BOOLEAN, INTEGER, TEXT, DECIMAL
|
|
||||||
}) => sequelize.define(
|
|
||||||
'job_status',
|
|
||||||
{
|
|
||||||
job_name: {
|
|
||||||
primaryKey: true,
|
|
||||||
type: STRING,
|
|
||||||
set() { },
|
|
||||||
},
|
|
||||||
last_sync: {
|
|
||||||
type: INTEGER,
|
|
||||||
set() { },
|
|
||||||
},
|
|
||||||
is_success: {
|
|
||||||
type: INTEGER,
|
|
||||||
set() { },
|
|
||||||
},
|
|
||||||
error_message: {
|
|
||||||
type: TEXT,
|
|
||||||
set() { },
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
freezeTableName: true,
|
|
||||||
getterMethods,
|
|
||||||
timestamps: false, // don't use default timestamps columns
|
|
||||||
}
|
|
||||||
);
|
|
|
@ -71,7 +71,7 @@ export default (sequelize, {
|
||||||
boolean boolean
boolean boolean
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
freezeTableName: true,
|
freezeTableName: true,
|
||||||
getterMethods,
|
//getterMethods,
|
||||||
boolean boolean
boolean boolean
|
|||||||
timestamps: false, // don't use default timestamps columns
|
timestamps: false, // don't use default timestamps columns
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
boolean boolean
boolean boolean
|
|
@ -43,7 +43,7 @@ export default (sequelize, {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
freezeTableName: true,
|
freezeTableName: true,
|
||||||
getterMethods,
|
//getterMethods,
|
||||||
timestamps: false, // don't use default timestamps columns
|
timestamps: false, // don't use default timestamps columns
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -12,7 +12,7 @@ export default (sequelize, {
|
||||||
type: INTEGER,
|
type: INTEGER,
|
||||||
set() { },
|
set() { },
|
||||||
},
|
},
|
||||||
addess_id: {
|
address_id: {
|
||||||
primaryKey: true,
|
primaryKey: true,
|
||||||
type: INTEGER,
|
type: INTEGER,
|
||||||
set() { },
|
set() { },
|
||||||
|
@ -28,7 +28,7 @@ export default (sequelize, {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
freezeTableName: true,
|
freezeTableName: true,
|
||||||
getterMethods,
|
//getterMethods,
|
||||||
timestamps: false, // don't use default timestamps columns
|
timestamps: false, // don't use default timestamps columns
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -67,7 +67,7 @@ export default (sequelize, {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
freezeTableName: true,
|
freezeTableName: true,
|
||||||
getterMethods,
|
//getterMethods,
|
||||||
timestamps: false, // don't use default timestamps columns
|
timestamps: false, // don't use default timestamps columns
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
3
server/chainquery/queries/abnormalClaimQueries.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export default (db, table) => ({
|
||||||
|
example: () => table.findAll(),
|
||||||
|
})
|
3
server/chainquery/queries/addressQueries.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export default (db, table) => ({
|
||||||
|
example: () => table.findAll(),
|
||||||
|
})
|
3
server/chainquery/queries/blockQueries.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export default (db, table) => ({
|
||||||
|
example: () => table.findAll(),
|
||||||
|
})
|
184
server/chainquery/queries/claimQueries.js
Normal file
|
@ -0,0 +1,184 @@
|
||||||
|
const logger = require('winston');
|
||||||
|
|
||||||
|
const returnShortId = (claimsArray, longId) => {
|
||||||
Is this the canonical url? Is this the canonical url?
If so this doesn't seem right. You want the claim_name included here. Also the claim_id is a hash not based on the height. Ignore if this is not the case. @kauffj has a preference for how we do these shortened URLs. If so this doesn't seem right. You want the claim_name included here. Also the claim_id is a hash not based on the height. Ignore if this is not the case. @kauffj has a preference for how we do these shortened URLs.
This is the existing logic, I believe. I think there are some issues with it, but we're going to handle it through https://github.com/lbryio/spee.ch/issues/184 This is the existing logic, I believe. I think there are some issues with it, but we're going to handle it through https://github.com/lbryio/spee.ch/issues/184
|
|||||||
|
let claimIndex;
|
||||||
|
let shortId = longId.substring(0, 1); // default short id is the first letter
|
||||||
|
let shortIdLength = 0;
|
||||||
|
// find the index of this claim id
|
||||||
|
claimIndex = claimsArray.findIndex(element => {
|
||||||
|
return element.claim_id === longId;
|
||||||
|
});
|
||||||
|
if (claimIndex < 0) {
|
||||||
|
throw new Error('claim id not found in claims list');
|
||||||
|
}
|
||||||
|
// get an array of all claims with lower height
|
||||||
|
let possibleMatches = claimsArray.slice(0, claimIndex);
|
||||||
|
// remove certificates with the same prefixes until none are left.
|
||||||
|
while (possibleMatches.length > 0) {
|
||||||
|
shortIdLength += 1;
|
||||||
|
shortId = longId.substring(0, shortIdLength);
|
||||||
|
possibleMatches = possibleMatches.filter(element => {
|
||||||
|
return (element.claim_id && (element.claim_id.substring(0, shortIdLength) === shortId));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return shortId;
|
||||||
|
};
|
||||||
|
|
||||||
|
const isLongClaimId = (claimId) => {
|
||||||
|
return (claimId && (claimId.length === 40));
|
||||||
|
}
|
||||||
|
|
||||||
|
const isShortClaimId = (claimId) => {
|
||||||
|
return (claimId && (claimId.length < 40));
|
||||||
|
}
|
||||||
|
|
||||||
|
export default (db, table) => ({
|
||||||
|
|
||||||
|
getShortClaimIdFromLongClaimId: async (claimId, claimName) => {
|
||||||
|
logger.debug(`claim.getShortClaimIdFromLongClaimId for ${claimName}#${claimId}`);
|
||||||
|
return await table.findAll({
|
||||||
|
where: { name: claimName },
|
||||||
|
order: [['height', 'ASC']],
|
||||||
|
}).then(result => {
|
||||||
|
if(result.length === 0) {
|
||||||
|
throw new Error('No claim(s) found with that claim name');
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnShortId(result, claimId);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getAllChannelClaims: async (channelClaimId) => {
|
||||||
|
logger.debug(`claim.getAllChannelClaims for ${channelClaimId}`);
|
||||||
|
return await table.findAll({
|
||||||
|
where: { publisher_id: channelClaimId },
|
||||||
|
order: [['height', 'DESC']],
|
||||||
|
raw : true, // returns an array of only data, not an array of instances
|
||||||
|
})
|
||||||
|
.then(channelClaimsArray => {
|
||||||
|
if(channelClaimsArray.length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return channelClaimsArray;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getClaimIdByLongChannelId: async (channelClaimId, claimName) => {
|
||||||
|
logger.debug(`finding claim id for claim ${claimName} from channel ${channelClaimId}`);
|
||||||
you will want to select specific pieces of data. Otherwise you will get all of it no? The metadata is also in this table as columns, json, and as hex. You probably only want 1 of these versions for your query. you will want to select specific pieces of data. Otherwise you will get all of it no? The metadata is also in this table as columns, json, and as hex. You probably only want 1 of these versions for your query.
Good call Good call
|
|||||||
|
return await table.findAll({
|
||||||
|
where: { name: claimName, publisher_id: channelClaimId },
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
})
|
||||||
|
.then(result => {
|
||||||
|
switch (result.length) {
|
||||||
|
case 0:
|
||||||
|
return null;
|
||||||
|
case 1:
|
||||||
|
return result[0].claim_id;
|
||||||
|
default:
|
||||||
|
// Does this actually happen??? (from converted code)
|
||||||
|
logger.warn(`${result.length} records found for "${claimName}" in channel "${channelClaimId}"`);
|
||||||
|
return result[0].claim_id;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
any reason for ordering? any reason for ordering? `id` doesn't mean much so it may be wasteful to order the results, then again I think this is the default ordering for mysql anyway.
Retained from the old query, I'll remove. Retained from the old query, I'll remove.
|
|||||||
|
|
||||||
|
validateLongClaimId: async (name, claimId) => {
|
||||||
|
return await table.findOne({
|
||||||
|
where: {
|
||||||
|
name,
|
||||||
|
claim_id: claimId,
|
||||||
|
},
|
||||||
|
}).then(result => {
|
||||||
|
if (!result) {
|
||||||
This is a good question actually. Technically, I believe this can happen in the blockchain. In the end every claim has a bid state. So you can always have a claim for a name and you can have 100 of them. Only one can be in the This is a good question actually. Technically, I believe this can happen in the blockchain. In the end every claim has a bid state. So you can always have a claim for a name and you can have 100 of them. Only one can be in the `Controlling` state though.
|
|||||||
|
return false;
|
||||||
|
}
|
||||||
|
return claimId;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getLongClaimIdFromShortClaimId: async (name, shortId) => {
|
||||||
|
return await table.findAll({
|
||||||
|
where: {
|
||||||
|
name,
|
||||||
why is name here? why is name here?
The old code validates against the name as well as the claim ID. The old code validates against the name as well as the claim ID.
I kept the existing functionality - I might remove this.
|
|||||||
|
claim_id: {
|
||||||
|
[sequelize.Op.like]: `${shortId}%`,
|
||||||
|
}},
|
||||||
|
order: [['height', 'ASC']],
|
||||||
|
})
|
||||||
|
.then(result => {
|
||||||
|
if(result.length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result[0].claim_id;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getTopFreeClaimIdByClaimName: async (name) => {
|
||||||
|
return await table.findAll({
|
||||||
This is a very expensive call. Maybe if you really need to use this, I add this feature to Chainquery so it can simply be matched against. This is a very expensive call. Maybe if you really need to use this, I add this feature to Chainquery so it can simply be matched against.
It's an old query, these can be adjusted over time It's an old query, these can be adjusted over time
|
|||||||
|
// TODO: Limit 1
|
||||||
|
where: { name },
|
||||||
|
order: [['effective_amount', 'DESC'], ['height', 'ASC']],
|
||||||
|
}).then(result => {
|
||||||
|
if(result.length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return result[0].claim_id;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getLongClaimId: async (claimName, claimId) => {
|
||||||
|
// TODO: Add failure case
|
||||||
|
logger.debug(`getLongClaimId(${claimName}, ${claimId})`);
|
||||||
|
if (isLongClaimId(claimId)) {
|
||||||
|
return table.queries.validateLongClaimId(claimName, claimId);
|
||||||
|
} else if (isShortClaimId(claimId)) {
|
||||||
So not sure we should use this. The So not sure we should use this. The `bid_state` = `Controlling` is better. This information comes directly from the blockchain.
|
|||||||
|
return table.queries.getLongClaimIdFromShortClaimId(claimName, claimId);
|
||||||
|
} else {
|
||||||
|
return table.queries.getTopFreeClaimIdByClaimName(claimName);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
resolveClaim: async (name, claimId) => {
|
||||||
|
logger.debug(`Claim.resolveClaim: ${name} ${claimId}`);
|
||||||
|
return table.findAll({
|
||||||
|
where: { name, claim_id: claimId },
|
||||||
|
}).then(claimArray => {
|
||||||
|
if(claimArray.length === 0) {
|
||||||
|
return null;
|
||||||
|
} else if(claimArray.length !== 1) {
|
||||||
|
logger.warn(`more than one record matches ${name}#${claimId} in db.Claim`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return claimArray[0];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getOutpoint: async (name, claimId) => {
|
||||||
|
logger.debug(`finding outpoint for ${name}#${claimId}`);
|
||||||
|
|
||||||
not sure why name is here like this. not sure why name is here like this.
|
|||||||
|
return await table.findAll({
|
||||||
|
where : { name, claim_id: claimId },
|
||||||
|
attributes: ['transaction_hash_id'],
|
||||||
|
}).then(result => {
|
||||||
|
if(result.length === 0) {
|
||||||
|
throw new Error(`no record found for ${name}#${claimId}`);
|
||||||
|
} else if(result.length !== 1) {
|
||||||
|
logger.warn(`more than one record matches ${name}#${claimId} in db.Claim`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result[0].transaction_hash_id;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getCurrentHeight: async () => {
|
||||||
|
return await table
|
||||||
I think I get it. You are not specifying name because they are identical. However, the claim table is unique on I think I get it. You are not specifying name because they are identical. However, the claim table is unique on `claim_id`. So you do not need to ever you both. There is no benefit that I can think of. If there is let me know.
|
|||||||
|
.max('height')
|
||||||
|
.then(result => {
|
||||||
|
return (result || 100000);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
})
|
3
server/chainquery/queries/inputQueries.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export default (db, table) => ({
|
||||||
|
example: () => table.findAll(),
|
||||||
|
})
|
3
server/chainquery/queries/outputQueries.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export default (db, table) => ({
|
||||||
|
example: () => table.findAll(),
|
||||||
|
})
|
3
server/chainquery/queries/supportQueries.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export default (db, table) => ({
|
||||||
|
example: () => table.findAll(),
|
||||||
|
})
|
3
server/chainquery/queries/transactionAddressQueries.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export default (db, table) => ({
|
||||||
|
example: () => table.findAll(),
|
||||||
|
})
|
3
server/chainquery/queries/transactionQueries.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export default (db, table) => ({
|
||||||
|
example: () => table.findAll(),
|
||||||
|
})
|
|
@ -7,5 +7,5 @@ export default {
|
||||||
|
|
||||||
associate(db) {
|
associate(db) {
|
||||||
// associate
|
// associate
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,5 @@ export default {
|
||||||
|
|
||||||
associate(db) {
|
associate(db) {
|
||||||
// associate
|
// associate
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
import ApplicationStatusModel from '../models/ApplicationStatusModel';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
createModel(...args) {
|
|
||||||
return ApplicationStatusModel(...args);
|
|
||||||
},
|
|
||||||
|
|
||||||
associate(db) {
|
|
||||||
// associate
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -7,5 +7,5 @@ export default {
|
||||||
|
|
||||||
associate(db) {
|
associate(db) {
|
||||||
// associate
|
// associate
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,5 @@ export default {
|
||||||
|
|
||||||
associate(db) {
|
associate(db) {
|
||||||
// associate
|
// associate
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
import GorpMigrationsModel from '../models/GorpMigrationsModel';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
createModel(...args) {
|
|
||||||
return GorpMigrationsModel(...args);
|
|
||||||
},
|
|
||||||
|
|
||||||
associate(db) {
|
|
||||||
// associate
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -7,5 +7,5 @@ export default {
|
||||||
|
|
||||||
associate(db) {
|
associate(db) {
|
||||||
// associate
|
// associate
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
import JobStatusModel from '../models/JobStatusModel';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
createModel(...args) {
|
|
||||||
return JobStatusModel(...args);
|
|
||||||
},
|
|
||||||
|
|
||||||
associate(db) {
|
|
||||||
// associate
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -7,5 +7,5 @@ export default {
|
||||||
|
|
||||||
associate(db) {
|
associate(db) {
|
||||||
// associate
|
// associate
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,5 @@ export default {
|
||||||
|
|
||||||
associate(db) {
|
associate(db) {
|
||||||
// associate
|
// associate
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,5 @@ export default {
|
||||||
|
|
||||||
associate(db) {
|
associate(db) {
|
||||||
// associate
|
// associate
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,5 @@ export default {
|
||||||
|
|
||||||
associate(db) {
|
associate(db) {
|
||||||
// associate
|
// associate
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,15 @@
|
||||||
const db = require('../../../../models');
|
const db = require('../../../../models');
|
||||||
|
const chainquery = require('chainquery');
|
||||||
|
const getClaimData = require('server/utils/getClaimData');
|
||||||
const { returnPaginatedChannelClaims } = require('./channelPagination.js');
|
const { returnPaginatedChannelClaims } = require('./channelPagination.js');
|
||||||
|
|
||||||
const getChannelClaims = (channelName, channelClaimId, page) => {
|
const getChannelClaims = async (channelName, channelShortId, page) => {
|
||||||
return new Promise((resolve, reject) => {
|
const channelId = await chainquery.claim.queries.getLongClaimId(channelName, channelShortId);
|
||||||
let longChannelClaimId;
|
const channelClaims = await chainquery.claim.queries.getAllChannelClaims(channelId);
|
||||||
// 1. get the long channel Id (make sure channel exists)
|
|
||||||
db.Certificate
|
const processedChannelClaims = channelClaims.map((claim) => getClaimData(claim));
|
||||||
.getLongChannelId(channelName, channelClaimId)
|
|
||||||
.then(result => {
|
return returnPaginatedChannelClaims(channelName, channelId, processedChannelClaims, page);
|
||||||
longChannelClaimId = result;
|
|
||||||
return db
|
|
||||||
.Claim
|
|
||||||
.getAllChannelClaims(longChannelClaimId);
|
|
||||||
})
|
|
||||||
.then(channelClaimsArray => {
|
|
||||||
// 3. format the data for the view, including pagination
|
|
||||||
let paginatedChannelViewData = returnPaginatedChannelClaims(channelName, longChannelClaimId, channelClaimsArray, page);
|
|
||||||
// 4. return all the channel information and contents
|
|
||||||
resolve(paginatedChannelViewData);
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
reject(error);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = getChannelClaims;
|
module.exports = getChannelClaims;
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
const db = require('../../../../models');
|
const chainquery = require('chainquery');
|
||||||
const { publishing: { primaryClaimAddress, additionalClaimAddresses } } = require('@config/siteConfig');
|
const { publishing: { primaryClaimAddress, additionalClaimAddresses } } = require('@config/siteConfig');
|
||||||
const Sequelize = require('sequelize');
|
const Sequelize = require('sequelize');
|
||||||
const Op = Sequelize.Op;
|
const Op = Sequelize.Op;
|
||||||
|
|
||||||
const claimAvailability = (name) => {
|
const claimAvailability = async (name) => {
|
||||||
const claimAddresses = additionalClaimAddresses || [];
|
const claimAddresses = additionalClaimAddresses || [];
|
||||||
claimAddresses.push(primaryClaimAddress);
|
claimAddresses.push(primaryClaimAddress);
|
||||||
// find any records where the name is used
|
// find any records where the name is used
|
||||||
return db.Claim
|
return await chainquery.claim
|
||||||
.findAll({
|
.findAll({
|
||||||
attributes: ['address'],
|
attributes: ['claim_address'],
|
||||||
where : {
|
where : {
|
||||||
name,
|
name,
|
||||||
address: {
|
claim_address: {
|
||||||
[Op.or]: claimAddresses,
|
[Op.or]: claimAddresses,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
const { handleErrorResponse } = require('../../../utils/errorHandlers.js');
|
const { handleErrorResponse } = require('../../../utils/errorHandlers.js');
|
||||||
|
const getClaimData = require('server/utils/getClaimData');
|
||||||
|
const chainquery = require('chainquery');
|
||||||
const db = require('../../../../models');
|
const db = require('../../../../models');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -11,7 +13,14 @@ const claimData = ({ ip, originalUrl, body, params }, res) => {
|
||||||
const claimName = params.claimName;
|
const claimName = params.claimName;
|
||||||
let claimId = params.claimId;
|
let claimId = params.claimId;
|
||||||
if (claimId === 'none') claimId = null;
|
if (claimId === 'none') claimId = null;
|
||||||
db.Claim.resolveClaim(claimName, claimId)
|
chainquery.claim.queries.resolveClaim(claimName, claimId)
|
||||||
|
.then(claimInfo => {
|
||||||
|
if (!claimInfo) {
|
||||||
|
// Not found remote, try local
|
||||||
|
return db.Claim.resolveClaim(claimName, claimId)
|
||||||
|
}
|
||||||
|
return claimInfo
|
||||||
|
})
|
||||||
.then(claimInfo => {
|
.then(claimInfo => {
|
||||||
if (!claimInfo) {
|
if (!claimInfo) {
|
||||||
return res.status(404).json({
|
return res.status(404).json({
|
||||||
|
@ -21,7 +30,7 @@ const claimData = ({ ip, originalUrl, body, params }, res) => {
|
||||||
}
|
}
|
||||||
res.status(200).json({
|
res.status(200).json({
|
||||||
success: true,
|
success: true,
|
||||||
data : claimInfo,
|
data : getClaimData(claimInfo),
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
const { getClaim } = require('../../../../lbrynet');
|
const { getClaim } = require('../../../../lbrynet');
|
||||||
const { createFileRecordDataAfterGet } = require('../../../../models/utils/createFileRecordData.js');
|
const { createFileRecordDataAfterGet } = require('../../../../models/utils/createFileRecordData.js');
|
||||||
const { handleErrorResponse } = require('../../../utils/errorHandlers.js');
|
const { handleErrorResponse } = require('../../../utils/errorHandlers.js');
|
||||||
|
const getClaimData = require('server/utils/getClaimData');
|
||||||
|
const chainquery = require('chainquery');
|
||||||
const db = require('../../../../models');
|
const db = require('../../../../models');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -15,21 +17,37 @@ const claimGet = ({ ip, originalUrl, params }, res) => {
|
||||||
let resolveResult;
|
let resolveResult;
|
||||||
let getResult;
|
let getResult;
|
||||||
|
|
||||||
db.Claim.resolveClaim(name, claimId)
|
|
||||||
|
|
||||||
|
chainquery.claim.queries.resolveClaim(name, claimId)
|
||||||
|
.then(result => {
|
||||||
|
if (!result) {
|
||||||
|
// could not find remote, return false to try local
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return resolveResult = result;
|
||||||
|
})
|
||||||
|
.then(result => {
|
||||||
|
if (result === false) {
|
||||||
|
// Could not find remote, try local
|
||||||
|
return db.Claim.resolveClaim(name, claimId);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
})
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (!result) {
|
if (!result) {
|
||||||
throw new Error('No matching uri found in Claim table');
|
throw new Error('No matching uri found in Claim table');
|
||||||
}
|
}
|
||||||
resolveResult = result;
|
return resolveResult = result;
|
||||||
return getClaim(`${name}#${claimId}`);
|
|
||||||
})
|
})
|
||||||
|
.then(result => getClaim(`${name}#${claimId}`))
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (!result) {
|
if (!result) {
|
||||||
throw new Error(`Unable to Get ${name}#${claimId}`);
|
throw new Error(`Unable to Get ${name}#${claimId}`);
|
||||||
}
|
}
|
||||||
getResult = result;
|
getResult = result;
|
||||||
if (result.completed) {
|
if (result.completed) {
|
||||||
return createFileRecordDataAfterGet(resolveResult, getResult)
|
return createFileRecordDataAfterGet(getClaimData(resolveResult), getResult)
|
||||||
.then(fileData => {
|
.then(fileData => {
|
||||||
const upsertCriteria = {name, claimId};
|
const upsertCriteria = {name, claimId};
|
||||||
return db.upsert(db.File, fileData, upsertCriteria, 'File');
|
return db.upsert(db.File, fileData, upsertCriteria, 'File');
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
const db = require('../../../../models');
|
const db = require('../../../../models');
|
||||||
|
const chainquery = require('chainquery');
|
||||||
|
|
||||||
const { handleErrorResponse } = require('../../../utils/errorHandlers.js');
|
const { handleErrorResponse } = require('../../../utils/errorHandlers.js');
|
||||||
|
|
||||||
|
@ -22,7 +23,13 @@ const claimLongId = ({ ip, originalUrl, body, params }, res) => {
|
||||||
getClaimId(channelName, channelClaimId, claimName, claimId)
|
getClaimId(channelName, channelClaimId, claimName, claimId)
|
||||||
.then(fullClaimId => {
|
.then(fullClaimId => {
|
||||||
claimId = fullClaimId;
|
claimId = fullClaimId;
|
||||||
|
return chainquery.claim.queries.getOutpoint(claimName, fullClaimId);
|
||||||
|
})
|
||||||
|
.then(outpointResult => {
|
||||||
|
if (!outpointResult) {
|
||||||
return db.Claim.getOutpoint(claimName, fullClaimId);
|
return db.Claim.getOutpoint(claimName, fullClaimId);
|
||||||
|
}
|
||||||
|
return outpointResult;
|
||||||
})
|
})
|
||||||
.then(outpoint => {
|
.then(outpoint => {
|
||||||
return db.Blocked.isNotBlocked(outpoint);
|
return db.Blocked.isNotBlocked(outpoint);
|
||||||
|
|
13
server/utils/getClaimData.js
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
const { details: { host } } = require('@config/siteConfig');
|
||||||
|
|
||||||
|
module.exports = (data) => ({
|
||||||
|
name: data.name,
|
||||||
|
title: data.title,
|
||||||
|
contentType: data.content_type || data.contentType,
|
||||||
|
claimId: data.claim_id || data.claimId,
|
||||||
|
fileExt: data.generated_extension || data.fileExt,
|
||||||
|
description: data.description,
|
||||||
|
thumbnail: data.generated_thumbnail || data.thumbnail,
|
||||||
|
outpoint: data.transaction_hash_id || data.outpoint,
|
||||||
|
host,
|
||||||
|
})
|
|
@ -36,9 +36,13 @@ const addAlliasesForSCSS = (aliasObject) => { // scss
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
let moduleAliases = {};
|
let moduleAliases = {};
|
||||||
|
|
||||||
|
moduleAliases['chainquery'] = resolve('./server/chainquery/bundle');
|
||||||
|
moduleAliases['server'] = resolve('./server');
|
||||||
|
|
||||||
// aliases for configs
|
// aliases for configs
|
||||||
moduleAliases['@config'] = resolve(`config`);
|
moduleAliases['@config'] = resolve('config');
|
||||||
moduleAliases['@devConfig'] = resolve(`devConfig`);
|
moduleAliases['@devConfig'] = resolve('devConfig');
|
||||||
|
|
||||||
// create specific aliases for locally defined components in the following folders
|
// create specific aliases for locally defined components in the following folders
|
||||||
moduleAliases = addAliasesForCustomComponentFolder('containers', moduleAliases);
|
moduleAliases = addAliasesForCustomComponentFolder('containers', moduleAliases);
|
||||||
|
|
this is only used for database migrations. Not of use to speech. I would ignore this table.