base-queue 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/actions.yml +18 -0
- package/.github/workflows/node.js.yml +80 -0
- package/README.md +22 -0
- package/app.js +109 -0
- package/appenders/all.js +69 -0
- package/appenders/base.js +149 -0
- package/appenders/bottom_one.js +68 -0
- package/appenders/common_code.js +56 -0
- package/appenders/func_all.js +83 -0
- package/appenders/json_all.js +79 -0
- package/appenders/json_bottom_one.js +79 -0
- package/appenders/json_func_all.js +79 -0
- package/appenders/json_name.js +84 -0
- package/appenders/json_status.js +86 -0
- package/appenders/json_top_one.js +79 -0
- package/appenders/json_version.js +86 -0
- package/appenders/log/console_basic.js +73 -0
- package/appenders/name.js +77 -0
- package/appenders/status.js +77 -0
- package/appenders/top_one.js +67 -0
- package/appenders/version.js +85 -0
- package/package.json +44 -0
- package/test/app.js +29 -0
- package/test/package.js +60 -0
- package/tests/base.js +101 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @author Jim Manton: jrman@risebroadband.net
|
|
3
|
+
* @since 2023-2-5
|
|
4
|
+
* json_all.js
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var base = require('./base.js')
|
|
8
|
+
|
|
9
|
+
exports = module.exports = class json_all extends base {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props)
|
|
12
|
+
var t = this, fname = 'json_all.constructor'
|
|
13
|
+
try {
|
|
14
|
+
t.aname = 'json_all'
|
|
15
|
+
t.main_process_objects = []
|
|
16
|
+
|
|
17
|
+
if (typeof props.data_to_process_array == 'undefined')
|
|
18
|
+
throw new Error(`props.data_to_process_array not defined`)
|
|
19
|
+
|
|
20
|
+
if (t.appender != t.aname)
|
|
21
|
+
throw new Error(`(${t.appender}) does not equal the appender name (${t.aname}))`)
|
|
22
|
+
|
|
23
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
24
|
+
|
|
25
|
+
t.init = t.init.bind(t)
|
|
26
|
+
t.process = t.process.bind(t)
|
|
27
|
+
|
|
28
|
+
return t
|
|
29
|
+
} catch (e) {
|
|
30
|
+
e.message = `${fname} error: ${e.message})`
|
|
31
|
+
throw e
|
|
32
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
init(props = {}) {
|
|
37
|
+
var t = this, fname = `json_all.init`, gotp, gdtpa, obj
|
|
38
|
+
try {``
|
|
39
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
40
|
+
|
|
41
|
+
if (typeof t.get_objects_to_process()[0] == "undefined")
|
|
42
|
+
throw new Error(`get_objects_to_process[0] has no data`)
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
obj = t.get_objects_to_process()[0]
|
|
46
|
+
t.get_data_to_process_array().map((dat, i) => {
|
|
47
|
+
dat.props.log = t.parent.logMsg
|
|
48
|
+
dat.props.relative_path = t.relative_path
|
|
49
|
+
t.main_process_objects.push(new obj(dat.props))
|
|
50
|
+
})
|
|
51
|
+
} catch (e) {
|
|
52
|
+
e.message = `${fname} error: ${e.message}`
|
|
53
|
+
t.parent.logMsg({msg: e.message.error, type: "error"})
|
|
54
|
+
throw e
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
super.init(props)
|
|
58
|
+
return t
|
|
59
|
+
} catch (e) {
|
|
60
|
+
e.message = `${fname} error: ${e.message})`
|
|
61
|
+
throw e
|
|
62
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
process(props = {}) {
|
|
67
|
+
var t = this, fname = `json_all.process`
|
|
68
|
+
try {
|
|
69
|
+
t.parent.logMsg({msg: `${fname} length(${t.main_process_objects.length})`.debug, type: "debug"})
|
|
70
|
+
|
|
71
|
+
super.process(props)
|
|
72
|
+
return t
|
|
73
|
+
} catch (e) {
|
|
74
|
+
e.message = `${fname} error: ${e.message})`
|
|
75
|
+
throw e
|
|
76
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @author Jim Manton: jrman@risebroadband.net
|
|
3
|
+
* @since 2023-2-5
|
|
4
|
+
* json_bottom_one.js
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var base = require('./base.js')
|
|
8
|
+
|
|
9
|
+
exports = module.exports = class json_bottom_one extends base {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props)
|
|
12
|
+
var t = this, fname = 'json_bottom_one.constructor'
|
|
13
|
+
try {
|
|
14
|
+
t.aname = 'json_bottom_one'
|
|
15
|
+
t.main_process_objects = []
|
|
16
|
+
|
|
17
|
+
if (typeof props.data_to_process_array == 'undefined')
|
|
18
|
+
throw new Error(`props.data_to_process_array not defined`)
|
|
19
|
+
|
|
20
|
+
if (t.appender != t.aname)
|
|
21
|
+
throw new Error(`(${t.appender}) does not equal the appender name (${t.aname}))`)
|
|
22
|
+
|
|
23
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
24
|
+
|
|
25
|
+
t.init = t.init.bind(t)
|
|
26
|
+
t.process = t.process.bind(t)
|
|
27
|
+
|
|
28
|
+
return t
|
|
29
|
+
} catch (e) {
|
|
30
|
+
e.message = `${fname} error: ${e.message})`
|
|
31
|
+
throw e
|
|
32
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
init(props = {}) {
|
|
37
|
+
var t = this, fname = `json_bottom_one.init`, obj, dat, len
|
|
38
|
+
try {``
|
|
39
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
40
|
+
|
|
41
|
+
if (typeof t.get_objects_to_process()[0] == "undefined")
|
|
42
|
+
throw new Error(`get_objects_to_process[0] has no data`)
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
obj = t.get_objects_to_process()[0]
|
|
46
|
+
len = t.get_data_to_process_array().length - 1
|
|
47
|
+
dat = t.get_data_to_process_array()[len]
|
|
48
|
+
dat.props.log = t.parent.logMsg
|
|
49
|
+
dat.props.relative_path = t.relative_path
|
|
50
|
+
t.main_process_objects.push(new obj(dat.props))
|
|
51
|
+
} catch (e) {
|
|
52
|
+
e.message = `${fname} error: ${e.message}`
|
|
53
|
+
t.parent.logMsg({msg: e.message.error, type: "error"})
|
|
54
|
+
throw e
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
super.init(props)
|
|
58
|
+
return t
|
|
59
|
+
} catch (e) {
|
|
60
|
+
e.message = `${fname} error: ${e.message})`
|
|
61
|
+
throw e
|
|
62
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
process(props = {}) {
|
|
67
|
+
var t = this, fname = `json_bottom_one.process`
|
|
68
|
+
try {
|
|
69
|
+
t.parent.logMsg({msg: `${fname} length(${t.main_process_objects.length})`.debug, type: "debug"})
|
|
70
|
+
|
|
71
|
+
super.process(props)
|
|
72
|
+
return t
|
|
73
|
+
} catch (e) {
|
|
74
|
+
e.message = `${fname} error: ${e.message})`
|
|
75
|
+
throw e
|
|
76
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @author Jim Manton: jrman@risebroadband.net
|
|
3
|
+
* @since 2023-2-5
|
|
4
|
+
* json_func_all.js
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var base = require('./base.js')
|
|
8
|
+
|
|
9
|
+
exports = module.exports = class json_func_all extends base {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props)
|
|
12
|
+
var t = this, fname = 'json_func_all.constructor'
|
|
13
|
+
try {
|
|
14
|
+
t.aname = 'json_func_all'
|
|
15
|
+
t.main_process_objects = []
|
|
16
|
+
|
|
17
|
+
if (typeof props.data_to_process_array == 'undefined')
|
|
18
|
+
throw new Error(`props.data_to_process_array not defined`)
|
|
19
|
+
|
|
20
|
+
if (t.appender != t.aname)
|
|
21
|
+
throw new Error(`(${t.appender}) does not equal the appender name (${t.aname}))`)
|
|
22
|
+
|
|
23
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
24
|
+
|
|
25
|
+
t.init = t.init.bind(t)
|
|
26
|
+
t.process = t.process.bind(t)
|
|
27
|
+
|
|
28
|
+
return t
|
|
29
|
+
} catch (e) {
|
|
30
|
+
e.message = `${fname} error: ${e.message})`
|
|
31
|
+
throw e
|
|
32
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
init(props = {}) {
|
|
37
|
+
var t = this, fname = `json_func_all.init`, gotp, gdtpa, obj
|
|
38
|
+
try {``
|
|
39
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
40
|
+
|
|
41
|
+
if (typeof t.get_objects_to_process()[0] == "undefined")
|
|
42
|
+
throw new Error(`get_objects_to_process[0] has no data`)
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
obj = t.get_objects_to_process()[0]
|
|
46
|
+
t.get_data_to_process_array().map((dat, i) => {
|
|
47
|
+
dat.props.log = t.parent.logMsg
|
|
48
|
+
dat.props.relative_path = t.relative_path
|
|
49
|
+
t.main_process_objects.push(new obj(dat.props))
|
|
50
|
+
})
|
|
51
|
+
} catch (e) {
|
|
52
|
+
e.message = `${fname} error: ${e.message}`
|
|
53
|
+
t.parent.logMsg({msg: e.message.error, type: "error"})
|
|
54
|
+
throw e
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
super.init(props)
|
|
58
|
+
return t
|
|
59
|
+
} catch (e) {
|
|
60
|
+
e.message = `${fname} error: ${e.message})`
|
|
61
|
+
throw e
|
|
62
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
process(props = {}) {
|
|
67
|
+
var t = this, fname = `json_func_all.process`
|
|
68
|
+
try {
|
|
69
|
+
t.parent.logMsg({msg: `${fname} length(${t.main_process_objects.length})`.debug, type: "debug"})
|
|
70
|
+
|
|
71
|
+
super.process(props)
|
|
72
|
+
return t
|
|
73
|
+
} catch (e) {
|
|
74
|
+
e.message = `${fname} error: ${e.message})`
|
|
75
|
+
throw e
|
|
76
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @author Jim Manton: jrman@risebroadband.net
|
|
3
|
+
* @since 2023-2-5
|
|
4
|
+
* json_name.js
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var base = require('./base.js'),
|
|
8
|
+
common_code = require('./common_code.js')
|
|
9
|
+
|
|
10
|
+
exports = module.exports = class json_name extends base {
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super(props)
|
|
13
|
+
var t = this, fname = 'json_name.constructor'
|
|
14
|
+
try {
|
|
15
|
+
t.aname = 'json_name'
|
|
16
|
+
t.main_process_objects = []
|
|
17
|
+
t.common_code = new common_code({ parent: t, log: t.parent.logMsg })
|
|
18
|
+
|
|
19
|
+
if (typeof props.data_to_process_array == 'undefined')
|
|
20
|
+
throw new Error(`props.data_to_process_array not defined`)
|
|
21
|
+
|
|
22
|
+
if (t.appender != t.aname)
|
|
23
|
+
throw new Error(`(${t.appender}) does not equal the appender name (${t.aname}))`)
|
|
24
|
+
|
|
25
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
26
|
+
|
|
27
|
+
t.init = t.init.bind(t)
|
|
28
|
+
t.process = t.process.bind(t)
|
|
29
|
+
|
|
30
|
+
return t
|
|
31
|
+
} catch (e) {
|
|
32
|
+
e.message = `${fname} error: ${e.message})`
|
|
33
|
+
t.parent.logMsg({msg: e.message.error, type: "error"})
|
|
34
|
+
throw e
|
|
35
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
init(props = {}) {
|
|
40
|
+
var t = this, fname = `json_name.init`, obj, is, obj_a
|
|
41
|
+
try {
|
|
42
|
+
``
|
|
43
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
44
|
+
|
|
45
|
+
if (typeof t.get_objects_to_process()[0] == "undefined")
|
|
46
|
+
throw new Error(`get_objects_to_process[0] has no data`)
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
// obj = t.get_objects_to_process()[0]
|
|
50
|
+
t.get_data_to_process_array().map((dat, i) => {
|
|
51
|
+
dat.props.log = t.parent.logMsg
|
|
52
|
+
dat.props.relative_path = t.relative_path
|
|
53
|
+
obj = t.get_objects_to_process()[0]
|
|
54
|
+
t.common_code.init({ obj: obj, dat: dat })
|
|
55
|
+
})
|
|
56
|
+
} catch (e) {
|
|
57
|
+
e.message = `${fname} error: ${e.message}`
|
|
58
|
+
t.parent.logMsg({ msg: e.message.error, type: "error" })
|
|
59
|
+
throw e
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
super.init(props)
|
|
63
|
+
return t
|
|
64
|
+
} catch (e) {
|
|
65
|
+
e.message = `${fname} error: ${e.message})`
|
|
66
|
+
throw e
|
|
67
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
process(props = {}) {
|
|
72
|
+
var t = this, fname = `json_name.process`
|
|
73
|
+
try {
|
|
74
|
+
t.parent.logMsg({ msg: `${fname} length(${t.main_process_objects.length})`.debug, type: "debug" })
|
|
75
|
+
|
|
76
|
+
super.process(props)
|
|
77
|
+
return t
|
|
78
|
+
} catch (e) {
|
|
79
|
+
e.message = `${fname} error: ${e.message})`
|
|
80
|
+
throw e
|
|
81
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @author Jim Manton: jrman@risebroadband.net
|
|
3
|
+
* @since 2023-2-5
|
|
4
|
+
* json_status.js
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var base = require('./base.js')
|
|
8
|
+
|
|
9
|
+
exports = module.exports = class json_status extends base {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props)
|
|
12
|
+
var t = this, fname = 'json_status.constructor'
|
|
13
|
+
try {
|
|
14
|
+
t.aname = 'json_status'
|
|
15
|
+
t.main_process_objects = []
|
|
16
|
+
|
|
17
|
+
if (typeof props.data_to_process_array == 'undefined')
|
|
18
|
+
throw new Error(`props.data_to_process_array not defined`)
|
|
19
|
+
|
|
20
|
+
if (t.appender != t.aname)
|
|
21
|
+
throw new Error(`(${t.appender}) does not equal the appender name (${t.aname}))`)
|
|
22
|
+
|
|
23
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
24
|
+
|
|
25
|
+
t.init = t.init.bind(t)
|
|
26
|
+
t.process = t.process.bind(t)
|
|
27
|
+
|
|
28
|
+
return t
|
|
29
|
+
} catch (e) {
|
|
30
|
+
e.message = `${fname} error: ${e.message})`
|
|
31
|
+
throw e
|
|
32
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
init(props = {}) {
|
|
37
|
+
var t = this, fname = `json_status.init`, obj, is, obj_a
|
|
38
|
+
try {``
|
|
39
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
40
|
+
|
|
41
|
+
if (typeof t.get_objects_to_process()[0] == "undefined")
|
|
42
|
+
throw new Error(`get_objects_to_process[0] has no data`)
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
// obj = t.get_objects_to_process()[0]
|
|
46
|
+
t.get_data_to_process_array().map((dat, i) => {
|
|
47
|
+
dat.props.log = t.parent.logMsg
|
|
48
|
+
dat.props.relative_path = t.relative_path
|
|
49
|
+
obj = t.get_objects_to_process()[0]
|
|
50
|
+
is = t.get_include_status()
|
|
51
|
+
obj_a = new obj(dat.props)
|
|
52
|
+
if (typeof obj_a != "undefined" &&
|
|
53
|
+
typeof obj_a.status != "undefined" &&
|
|
54
|
+
is.indexOf(obj_a.status) > -1) {
|
|
55
|
+
t.main_process_objects.push(new obj(dat.props))
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
} catch (e) {
|
|
59
|
+
e.message = `${fname} error: ${e.message}`
|
|
60
|
+
t.parent.logMsg({msg: e.message.error, type: "error"})
|
|
61
|
+
throw e
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
super.init(props)
|
|
65
|
+
return t
|
|
66
|
+
} catch (e) {
|
|
67
|
+
e.message = `${fname} error: ${e.message})`
|
|
68
|
+
throw e
|
|
69
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
process(props = {}) {
|
|
74
|
+
var t = this, fname = `json_status.process`
|
|
75
|
+
try {
|
|
76
|
+
t.parent.logMsg({msg: `${fname} length(${t.main_process_objects.length})`.debug, type: "debug"})
|
|
77
|
+
|
|
78
|
+
super.process(props)
|
|
79
|
+
return t
|
|
80
|
+
} catch (e) {
|
|
81
|
+
e.message = `${fname} error: ${e.message})`
|
|
82
|
+
throw e
|
|
83
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @author Jim Manton: jrman@risebroadband.net
|
|
3
|
+
* @since 2023-2-5
|
|
4
|
+
* json_top_one.js
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var base = require('./base.js')
|
|
8
|
+
|
|
9
|
+
exports = module.exports = class json_top_one extends base {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props)
|
|
12
|
+
var t = this, fname = 'json_top_one.constructor'
|
|
13
|
+
try {
|
|
14
|
+
t.aname = 'json_top_one'
|
|
15
|
+
t.main_process_objects = []
|
|
16
|
+
|
|
17
|
+
if (typeof props.data_to_process_array == 'undefined')
|
|
18
|
+
throw new Error(`props.data_to_process_array not defined`)
|
|
19
|
+
|
|
20
|
+
if (t.appender != t.aname)
|
|
21
|
+
throw new Error(`(${t.appender}) does not equal the appender name (${t.aname}))`)
|
|
22
|
+
|
|
23
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
24
|
+
|
|
25
|
+
t.init = t.init.bind(t)
|
|
26
|
+
t.process = t.process.bind(t)
|
|
27
|
+
|
|
28
|
+
return t
|
|
29
|
+
} catch (e) {
|
|
30
|
+
e.message = `${fname} error: ${e.message})`
|
|
31
|
+
throw e
|
|
32
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
init(props = {}) {
|
|
37
|
+
var t = this, fname = `json_top_one.init`, obj, dat
|
|
38
|
+
try {``
|
|
39
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
40
|
+
|
|
41
|
+
if (typeof t.get_objects_to_process()[0] == "undefined")
|
|
42
|
+
throw new Error(`get_objects_to_process[0] has no data`)
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
obj = t.get_objects_to_process()[0]
|
|
46
|
+
dat = t.get_data_to_process_array()[0]
|
|
47
|
+
dat.props.log = t.parent.logMsg
|
|
48
|
+
dat.props.relative_path = t.relative_path
|
|
49
|
+
t.main_process_objects.push(new obj(dat.props))
|
|
50
|
+
|
|
51
|
+
} catch (e) {
|
|
52
|
+
e.message = `${fname} error: ${e.message}`
|
|
53
|
+
t.parent.logMsg({msg: e.message.error, type: "error"})
|
|
54
|
+
throw e
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
super.init(props)
|
|
58
|
+
return t
|
|
59
|
+
} catch (e) {
|
|
60
|
+
e.message = `${fname} error: ${e.message})`
|
|
61
|
+
throw e
|
|
62
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
process(props = {}) {
|
|
67
|
+
var t = this, fname = `json_top_one.process`
|
|
68
|
+
try {
|
|
69
|
+
t.parent.logMsg({msg: `${fname} length(${t.main_process_objects.length})`.debug, type: "debug"})
|
|
70
|
+
|
|
71
|
+
super.process(props)
|
|
72
|
+
return t
|
|
73
|
+
} catch (e) {
|
|
74
|
+
e.message = `${fname} error: ${e.message})`
|
|
75
|
+
throw e
|
|
76
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @author Jim Manton: jrman@risebroadband.net
|
|
3
|
+
* @since 2023-2-5
|
|
4
|
+
* json_version.js
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var base = require('./base.js')
|
|
8
|
+
|
|
9
|
+
exports = module.exports = class json_version extends base {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props)
|
|
12
|
+
var t = this, fname = 'json_version.constructor'
|
|
13
|
+
try {
|
|
14
|
+
t.aname = 'json_version'
|
|
15
|
+
t.main_process_objects = []
|
|
16
|
+
|
|
17
|
+
if (typeof props.data_to_process_array == 'undefined')
|
|
18
|
+
throw new Error(`props.data_to_process_array not defined`)
|
|
19
|
+
|
|
20
|
+
if (t.appender != t.aname)
|
|
21
|
+
throw new Error(`(${t.appender}) does not equal the appender name (${t.aname}))`)
|
|
22
|
+
|
|
23
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
24
|
+
|
|
25
|
+
t.init = t.init.bind(t)
|
|
26
|
+
t.process = t.process.bind(t)
|
|
27
|
+
|
|
28
|
+
return t
|
|
29
|
+
} catch (e) {
|
|
30
|
+
e.message = `${fname} error: ${e.message})`
|
|
31
|
+
throw e
|
|
32
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
init(props = {}) {
|
|
37
|
+
var t = this, fname = `json_version.init`, obj, is, obj_a
|
|
38
|
+
try {``
|
|
39
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
40
|
+
|
|
41
|
+
if (typeof t.get_objects_to_process()[0] == "undefined")
|
|
42
|
+
throw new Error(`get_objects_to_process[0] has no data`)
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
// obj = t.get_objects_to_process()[0]
|
|
46
|
+
t.get_data_to_process_array().map((dat, i) => {
|
|
47
|
+
dat.props.log = t.parent.logMsg
|
|
48
|
+
dat.props.relative_path = t.relative_path
|
|
49
|
+
obj = t.get_objects_to_process()[0]
|
|
50
|
+
is = t.get_include_version()
|
|
51
|
+
obj_a = new obj(dat.props)
|
|
52
|
+
if (typeof obj_a != "undefined" &&
|
|
53
|
+
typeof obj_a.version != "undefined" &&
|
|
54
|
+
is.indexOf(obj_a.version) > -1) {
|
|
55
|
+
t.main_process_objects.push(new obj(dat.props))
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
} catch (e) {
|
|
59
|
+
e.message = `${fname} error: ${e.message}`
|
|
60
|
+
t.parent.logMsg({msg: e.message.error, type: "error"})
|
|
61
|
+
throw e
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
super.init(props)
|
|
65
|
+
return t
|
|
66
|
+
} catch (e) {
|
|
67
|
+
e.message = `${fname} error: ${e.message})`
|
|
68
|
+
throw e
|
|
69
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
process(props = {}) {
|
|
74
|
+
var t = this, fname = `json_version.process`
|
|
75
|
+
try {
|
|
76
|
+
t.parent.logMsg({msg: `${fname} length(${t.main_process_objects.length})`.debug, type: "debug"})
|
|
77
|
+
|
|
78
|
+
super.process(props)
|
|
79
|
+
return t
|
|
80
|
+
} catch (e) {
|
|
81
|
+
e.message = `${fname} error: ${e.message})`
|
|
82
|
+
throw e
|
|
83
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @author Jim Manton: jrman@risebroadband.net
|
|
3
|
+
* @since 2023-2-5
|
|
4
|
+
* console_basic.js
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var base = require('../base.js')
|
|
8
|
+
|
|
9
|
+
exports = module.exports = class console_basic extends base {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props)
|
|
12
|
+
var t = this, fname = 'console_basic.constructor'
|
|
13
|
+
try {
|
|
14
|
+
t.aname = 'console_basic'
|
|
15
|
+
t.main_process_objects = []
|
|
16
|
+
|
|
17
|
+
if (t.appender != t.aname)
|
|
18
|
+
throw new Error(`(${t.appender}) does not equal the appender name (${t.aname}))`)
|
|
19
|
+
|
|
20
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
21
|
+
|
|
22
|
+
t.init = t.init.bind(t)
|
|
23
|
+
t.process = t.process.bind(t)
|
|
24
|
+
|
|
25
|
+
return t
|
|
26
|
+
} catch (e) {
|
|
27
|
+
e.message = `${fname} error: ${e.message})`
|
|
28
|
+
throw e
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
init(props = {}) {
|
|
33
|
+
var t = this, fname = `console_basic.init`, gotp, gdtpa, obj
|
|
34
|
+
try {
|
|
35
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
36
|
+
|
|
37
|
+
if (typeof t.get_objects_to_process()[0] == "undefined")
|
|
38
|
+
throw new Error(`get_objects_to_process[0] has no data`)
|
|
39
|
+
|
|
40
|
+
t.get_objects_to_process().map((dat, i) => {
|
|
41
|
+
obj = t.get_objects_to_process()[i]
|
|
42
|
+
try {
|
|
43
|
+
t.get_data_to_process_array().map((dat_pro, y)=>{
|
|
44
|
+
dat_pro.props.relative_path = t.relative_path
|
|
45
|
+
t.main_process_objects.push(new obj(dat_pro.props))
|
|
46
|
+
})
|
|
47
|
+
} catch (e) {
|
|
48
|
+
throw new Error(`cannot create new obj error: (${e.message})`)
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
super.init(props)
|
|
52
|
+
return t
|
|
53
|
+
} catch (e) {
|
|
54
|
+
e.message = `${fname} error: ${e.message})`
|
|
55
|
+
throw e
|
|
56
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
process() {
|
|
61
|
+
var t = this, fname = `console_basic.process`
|
|
62
|
+
try {
|
|
63
|
+
t.parent.logMsg({ msg: `${fname}`.debug, type: "debug" })
|
|
64
|
+
|
|
65
|
+
super.process()
|
|
66
|
+
return t
|
|
67
|
+
} catch (e) {
|
|
68
|
+
e.message = `${fname} error: ${e.message})`
|
|
69
|
+
throw e
|
|
70
|
+
// t.parent.app_reject(`${fname} error: ${e.message})`)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|