11'use strict' ;
22
3- const scriptTypeMap = {
4- BankConnectivityPlugin : {
3+ const scriptTypes = [
4+ {
5+ name : 'BankConnectivityPlugin' ,
56 entryPoints : [
67 'getRequiredConfigurationFields' ,
78 'downloadPreviousDayBankStatementFile' ,
89 ] ,
910 } ,
10- BundleInstallationScript : {
11+ {
12+ name : 'BundleInstallationScript' ,
1113 entryPoints : [
1214 'afterInstall' ,
1315 'afterUpdate' ,
@@ -16,7 +18,8 @@ const scriptTypeMap = {
1618 'beforeUpdate' ,
1719 ] ,
1820 } ,
19- ClientScript : {
21+ {
22+ name : 'ClientScript' ,
2023 entryPoints : [
2124 'fieldChanged' ,
2225 'lineInit' ,
@@ -32,63 +35,57 @@ const scriptTypeMap = {
3235 'localizationContextExit' ,
3336 ] ,
3437 } ,
35- CustomGLPlugin : {
36- entryPoitns : [ 'customizeGlImpact' ] ,
37- } ,
38- DatasetBuilderPlugin : {
39- entryPoints : [ 'createDataset' ] ,
40- } ,
41- FiConnectivityPlugin : {
38+ { name : 'CustomGLPlugin' , entryPoints : [ 'customizeGlImpact' ] } ,
39+ { name : 'DatasetBuilderPlugin' , entryPoints : [ 'createDataset' ] } ,
40+ {
41+ name : 'FiConnectivityPlugin' ,
4242 entryPoints : [ 'getConfigurationIFrameUrl' , 'getAccounts' , 'getTransactionData' ] ,
4343 } ,
44- FiParserPlugin : {
44+ {
45+ name : 'FiParserPlugin' ,
4546 entryPoints : [
4647 'parseData' ,
4748 'getStandardTransactionCodes' ,
4849 'getExpenseCodes' ,
4950 'getConfigurationPageUrl' ,
5051 ] ,
5152 } ,
52- MapReduceScript : {
53+ {
54+ name : 'MapReduceScript' ,
5355 entryPoints : [ 'getInputData' , 'map' , 'reduce' , 'summarize' ] ,
5456 } ,
55- MassUpdateScript : {
56- entryPoints : [ 'each' ] ,
57- } ,
58- PluginTypeImpl : {
59- entryPoints : [ ] ,
60- } ,
61- Portlet : {
62- entryPoints : [ 'render' ] ,
63- } ,
64- Restlet : {
65- entryPoints : [ 'delete' , 'get' , 'post' , 'put' ] ,
66- } ,
67- ScheduledScript : {
68- entryPoints : [ 'execute' ] ,
69- } ,
70- SDFInstallationScript : {
71- entryPoints : [ 'run' ] ,
72- } ,
73- Suitelet : {
57+ { name : 'MassUpdateScript' , entryPoints : [ 'each' ] } ,
58+ { name : 'PluginTypeImpl' , entryPoints : [ ] } ,
59+ { name : 'Portlet' , entryPoints : [ 'render' ] } ,
60+ { name : 'Restlet' , entryPoints : [ 'delete' , 'get' , 'post' , 'put' ] } ,
61+ { name : 'ScheduledScript' , entryPoints : [ 'execute' ] } ,
62+ { name : 'SDFInstallationScript' , entryPoints : [ 'run' ] } ,
63+ {
64+ name : 'Suitelet' ,
7465 entryPoints : [ 'onRequest' ] ,
7566 } ,
76- UserEventScript : {
67+ {
68+ name : 'UserEventScript' ,
7769 entryPoints : [ 'afterSubmit' , 'beforeLoad' , 'beforeSubmit' ] ,
7870 } ,
79- WorkbookBbuilderPlugin : {
71+ {
72+ name : 'WorkbookBbuilderPlugin' ,
8073 entryPoints : [ 'createWorkbook' ] ,
8174 } ,
82- WorkflowActionScript : {
75+ {
76+ name : 'WorkflowActionScript' ,
8377 entryPoints : [ 'onAction' ] ,
8478 } ,
85- } ;
79+ ] ;
8680
87- const scriptTypes = Object . keys ( scriptTypeMap ) . map ( function ( x ) {
88- return x . toLowerCase ( ) ;
89- } ) ;
81+ function getScriptTypeDef ( scriptType ) {
82+ return (
83+ ! ! scriptType &&
84+ scriptTypes . find ( ( x ) => x . name . toLowerCase ( ) === scriptType . toLowerCase ( ) )
85+ ) ;
86+ }
9087
9188module . exports = {
92- scriptTypeMap,
9389 scriptTypes,
90+ getScriptTypeDef,
9491} ;
0 commit comments