diff --git a/api/routes/v2-history/get_actions/definitions.ts b/api/routes/v2-history/get_actions/definitions.ts index a212f9d..e3ecae4 100644 --- a/api/routes/v2-history/get_actions/definitions.ts +++ b/api/routes/v2-history/get_actions/definitions.ts @@ -12,7 +12,14 @@ export const extendedActions = new Set([ "buyrambytes", "delegatebw", "undelegatebw", - "voteproducer" + "voteproducer", + 'statement', + 'decision', + 'batch' + 'act', + 'exec', + 'votefor', + 'voteagainst' ]); export const primaryTerms = [ diff --git a/definitions/index-templates.ts b/definitions/index-templates.ts index 66960d0..dad9327 100644 --- a/definitions/index-templates.ts +++ b/definitions/index-templates.ts @@ -186,71 +186,71 @@ export const action = { }, // eosio::undelegatebw - "@exec": { - "properties": { - "executer": {"type": "keyword"}, - "coopname": {"type": "keyword"}, - "decision_id": {"type": "long"}, - } - }, + // "@exec": { + // "properties": { + // "executer": {"type": "keyword"}, + // "coopname": {"type": "keyword"}, + // "decision_id": {"type": "long"}, + // } + // }, - "@statement": { - "properties": { - "coopname": {"type": "keyword"}, - "username": {"type": "keyword"}, - "action": {"type": "keyword"}, - "decision_id": {"type": "long"}, - "batch_id": {"type": "long"}, - "statement": {"enabled": false}, - } - }, + // "@statement": { + // "properties": { + // "coopname": {"type": "keyword"}, + // "username": {"type": "keyword"}, + // "action": {"type": "keyword"}, + // "decision_id": {"type": "long"}, + // "batch_id": {"type": "long"}, + // "statement": {"enabled": false}, + // } + // }, - "@act": { - "properties": { - "coopname": {"type": "keyword"}, - "username": {"type": "keyword"}, - "action": {"type": "keyword"}, - "decision_id": {"type": "long"}, - "batch_id": {"type": "long"}, - "act": {"enabled": false}, - } - }, + // "@act": { + // "properties": { + // "coopname": {"type": "keyword"}, + // "username": {"type": "keyword"}, + // "action": {"type": "keyword"}, + // "decision_id": {"type": "long"}, + // "batch_id": {"type": "long"}, + // "act": {"enabled": false}, + // } + // }, - "@decision": { - "properties": { - "coopname": {"type": "keyword"}, - "username": {"type": "keyword"}, - "action": {"type": "keyword"}, - "decision_id": {"type": "long"}, - "batch_id": {"type": "long"}, - "decision": {"enabled": false}, - } - }, - "@batch": { - "properties": { - "coopname": {"type": "keyword"}, - "action": {"type": "keyword"}, - "batch_id": {"type": "long"}, - } - }, + // "@decision": { + // "properties": { + // "coopname": {"type": "keyword"}, + // "username": {"type": "keyword"}, + // "action": {"type": "keyword"}, + // "decision_id": {"type": "long"}, + // "batch_id": {"type": "long"}, + // "decision": {"enabled": false}, + // } + // }, + // "@batch": { + // "properties": { + // "coopname": {"type": "keyword"}, + // "action": {"type": "keyword"}, + // "batch_id": {"type": "long"}, + // } + // }, - // eosio::votefor - "@votefor": { - "properties": { - "coopname": {"type": "keyword"}, - "member": {"type": "keyword"}, - "decision_id": {"type": "long"} - } - }, + // // eosio::votefor + // "@votefor": { + // "properties": { + // "coopname": {"type": "keyword"}, + // "member": {"type": "keyword"}, + // "decision_id": {"type": "long"} + // } + // }, - "@voteagainst": { - "properties": { - "coopname": {"type": "keyword"}, - "member": {"type": "keyword"}, - "decision_id": {"type": "long"} - } - } + // "@voteagainst": { + // "properties": { + // "coopname": {"type": "keyword"}, + // "member": {"type": "keyword"}, + // "decision_id": {"type": "long"} + // } + // } } } }; diff --git a/modules/action_data/act.js b/modules/action_data/act.js new file mode 100644 index 0000000..9e590d5 --- /dev/null +++ b/modules/action_data/act.js @@ -0,0 +1,39 @@ +const hyperionModule = { + chain: "*", + contract: '*', + action: 'act', + parser_version: ['3.2', '2.1','1.8','1.7'], + defineQueryPrefix: 'act', + + mappings: { + action: { + "@act": { + "properties": { + "coopname": {"type": "keyword"}, + "username": {"type": "keyword"}, + "action": {"type": "keyword"}, + "decision_id": {"type": "long"}, + "batch_id": {"type": "long"}, + "act": {"enabled": false} + } + } + } + }, + + handler: (action) => { + const data = action['act']['data']; + + action['@act'] = { + coopname: data.coopname, + username: data.username, + action: data.action, + decision_id: data.decision_id, + batch_id: data.batch_id, + act: data.act + }; + + + } +}; + +module.exports = {hyperionModule}; diff --git a/modules/action_data/batch.js b/modules/action_data/batch.js new file mode 100644 index 0000000..8e92fa5 --- /dev/null +++ b/modules/action_data/batch.js @@ -0,0 +1,33 @@ +const hyperionModule = { + chain: "*", + contract: '*', + action: 'batch', + parser_version: ['3.2', '2.1','1.8','1.7'], + defineQueryPrefix: 'batch', + + mappings: { + action: { + "@batch": { + "properties": { + "coopname": {"type": "keyword"}, + "action": {"type": "keyword"}, + "batch_id": {"type": "long"} + } + } + } + }, + + handler: (action) => { + const data = action['act']['data']; + + action['@batch'] = { + coopname: data.coopname, + action: data.action, + batch_id: data.batch_id, + }; + + + } +}; + +module.exports = {hyperionModule}; diff --git a/modules/action_data/decision.js b/modules/action_data/decision.js new file mode 100644 index 0000000..9ac36f2 --- /dev/null +++ b/modules/action_data/decision.js @@ -0,0 +1,39 @@ +const hyperionModule = { + chain: "*", + contract: '*', + action: 'decision', + parser_version: ['3.2', '2.1','1.8','1.7'], + defineQueryPrefix: 'decision', + + mappings: { + action: { + "@decision": { + "properties": { + "coopname": {"type": "keyword"}, + "username": {"type": "keyword"}, + "action": {"type": "keyword"}, + "decision_id": {"type": "long"}, + "batch_id": {"type": "long"}, + "decision": {"enabled": false} + } + } + } + }, + + handler: (action) => { + const data = action['act']['data']; + + action['@decision'] = { + coopname: data.coopname, + username: data.username, + action: data.action, + decision_id: data.decision_id, + batch_id: data.batch_id, + decision: data.decision + }; + + + } +}; + +module.exports = {hyperionModule}; diff --git a/modules/action_data/exec.js b/modules/action_data/exec.js new file mode 100644 index 0000000..ba83cca --- /dev/null +++ b/modules/action_data/exec.js @@ -0,0 +1,33 @@ +const hyperionModule = { + chain: "*", + contract: '*', + action: 'exec', + parser_version: ['3.2', '2.1','1.8','1.7'], + defineQueryPrefix: 'exec', + + mappings: { + action: { + "@exec": { + "properties": { + "executer": {"type": "keyword"}, + "coopname": {"type": "keyword"}, + "decision_id": {"type": "long"} + } + } + } + }, + + handler: (action) => { + const data = action['act']['data']; + + action['@exec'] = { + executer: data.executer, + coopname: data.coopname, + decision_id: data.decision_id, + }; + + + } +}; + +module.exports = {hyperionModule}; diff --git a/modules/action_data/statement.js b/modules/action_data/statement.js new file mode 100644 index 0000000..f17fad7 --- /dev/null +++ b/modules/action_data/statement.js @@ -0,0 +1,39 @@ +const hyperionModule = { + chain: "*", + contract: '*', + action: 'statement', + parser_version: ['3.2', '2.1','1.8','1.7'], + defineQueryPrefix: 'statement', + + mappings: { + action: { + "@statement": { + "properties": { + "coopname": {"type": "keyword"}, + "username": {"type": "keyword"}, + "action": {"type": "keyword"}, + "decision_id": {"type": "long"}, + "batch_id": {"type": "long"}, + "statement": {"enabled": false} + } + } + } + }, + + handler: (action) => { + const data = action['act']['data']; + + action['@statement'] = { + coopname: data.coopname, + username: data.username, + action: data.action, + decision_id: data.decision_id, + batch_id: data.batch_id, + statement: data.statement + }; + + + } +}; + +module.exports = {hyperionModule}; diff --git a/modules/action_data/voteagainst.js b/modules/action_data/voteagainst.js new file mode 100644 index 0000000..411864a --- /dev/null +++ b/modules/action_data/voteagainst.js @@ -0,0 +1,33 @@ +const hyperionModule = { + chain: "*", + contract: '*', + action: 'voteagainst', + parser_version: ['3.2', '2.1','1.8','1.7'], + defineQueryPrefix: 'voteagainst', + + mappings: { + action: { + "@voteagainst": { + "properties": { + "coopname": {"type": "keyword"}, + "member": {"type": "keyword"}, + "decision_id": {"type": "long"} + } + } + } + }, + + handler: (action) => { + const data = action['act']['data']; + + action['@voteagainst'] = { + coopname: data.coopname, + member: data.member, + decision_id: decision_id + }; + + + } +}; + +module.exports = {hyperionModule}; diff --git a/modules/action_data/votefor.js b/modules/action_data/votefor.js new file mode 100644 index 0000000..554a147 --- /dev/null +++ b/modules/action_data/votefor.js @@ -0,0 +1,33 @@ +const hyperionModule = { + chain: "*", + contract: '*', + action: 'votefor', + parser_version: ['3.2', '2.1','1.8','1.7'], + defineQueryPrefix: 'votefor', + + mappings: { + action: { + "@votefor": { + "properties": { + "coopname": {"type": "keyword"}, + "member": {"type": "keyword"}, + "decision_id": {"type": "long"} + } + } + } + }, + + handler: (action) => { + const data = action['act']['data']; + + action['@votefor'] = { + coopname: data.coopname, + member: data.member, + decision_id: decision_id + }; + + + } +}; + +module.exports = {hyperionModule};