biz-a-cli 2.3.38 → 2.3.40
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/package.json +1 -1
- package/scheduler/datalib.js +2 -2
- package/tests/data.test.js +6 -6
- package/tests/mockData/mockApp/a.js +0 -1
- package/tests/mockData/mockApp/b.js +0 -2
- package/tests/mockData/mockApp/c.js +0 -4
- package/tests/mockData/mockApp/d.js +0 -2
- package/tests/mockData/mockApp/menu.json +0 -49
package/package.json
CHANGED
package/scheduler/datalib.js
CHANGED
|
@@ -47,7 +47,7 @@ export function mapData2Key(res, cols) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
export function getUrlApi(config, methodName, isPost = true) {
|
|
50
|
-
return `${config.url}/fina/rest
|
|
50
|
+
return `${config.url}/fina/rest/${config.methodClass ?? 'TOrmMethod'}/` +
|
|
51
51
|
`${isPost ? '%22' : ''}${methodName}${isPost ? '%22' : ''}`
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -156,7 +156,7 @@ export async function setLibrary(config, libraries, defaultLib) {
|
|
|
156
156
|
for (const lib of libraries) {
|
|
157
157
|
const data = await loadCliScript(config, 'SCRIPT_NAME', lib);
|
|
158
158
|
const libFn = runScriptInThisContext(data[0].script);
|
|
159
|
-
Object.assign(libs, { lib: libFn(defaultLib).functions });
|
|
159
|
+
Object.assign(libs, { [`${lib}`]: libFn(defaultLib).functions });
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
return libs;
|
package/tests/data.test.js
CHANGED
|
@@ -237,11 +237,11 @@ describe('data test', () => {
|
|
|
237
237
|
expect(getUrlApi(config, methodName, isPost)).toBe(expectedUrl);
|
|
238
238
|
});
|
|
239
239
|
|
|
240
|
-
test('should return the correct URL for GET requests', () => {
|
|
241
|
-
const config = { url: 'http://example.com' };
|
|
240
|
+
test('should return the correct URL for GET requests with custom class', () => {
|
|
241
|
+
const config = { url: 'http://example.com', methodClass: 'TFinaMethod' };
|
|
242
242
|
const methodName = 'testMethod';
|
|
243
243
|
const isPost = false;
|
|
244
|
-
const expectedUrl = 'http://example.com/fina/rest/
|
|
244
|
+
const expectedUrl = 'http://example.com/fina/rest/TFinaMethod/testMethod';
|
|
245
245
|
|
|
246
246
|
expect(getUrlApi(config, methodName, isPost)).toBe(expectedUrl);
|
|
247
247
|
});
|
|
@@ -337,13 +337,13 @@ describe('data test', () => {
|
|
|
337
337
|
}))
|
|
338
338
|
|
|
339
339
|
const config = {};
|
|
340
|
-
const libraries = ['
|
|
340
|
+
const libraries = ['libCb'];
|
|
341
341
|
const defaultLib = { defA: 'A', defB: 'B' }
|
|
342
342
|
|
|
343
343
|
const result = await setLibrary(config, libraries, defaultLib);
|
|
344
344
|
|
|
345
|
-
expect(result.
|
|
346
|
-
expect(result.
|
|
345
|
+
expect(result.libCb.yyy().abc()).toStrictEqual('abc');
|
|
346
|
+
expect(result.libCb.zzz()).toStrictEqual({ "defA": "A", "defB": "B" });
|
|
347
347
|
});
|
|
348
348
|
|
|
349
349
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
get = function () {return {modelA: {}}}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{"menuName": "", "caption": "Home", "link": ["./main"],"subMenu": []},
|
|
3
|
-
{"menuName": "", "caption": "Personalia","link": [], "subMenu": [
|
|
4
|
-
{"menuName": "","caption": "Data Master","link": [], "subMenu": []},
|
|
5
|
-
{
|
|
6
|
-
"menuName": "",
|
|
7
|
-
"caption": "Gaji",
|
|
8
|
-
"link": [],
|
|
9
|
-
"subMenu": [
|
|
10
|
-
{
|
|
11
|
-
"menuName": "",
|
|
12
|
-
"caption": "Parameter",
|
|
13
|
-
"link": [
|
|
14
|
-
"./form",
|
|
15
|
-
"gajiparam",
|
|
16
|
-
null
|
|
17
|
-
],
|
|
18
|
-
"subMenu": []
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"menuName": "",
|
|
22
|
-
"caption": "Perubahan",
|
|
23
|
-
"link": [],
|
|
24
|
-
"subMenu": [
|
|
25
|
-
{
|
|
26
|
-
"menuName": "",
|
|
27
|
-
"caption": "Form Perubahan Gaji",
|
|
28
|
-
"link": [
|
|
29
|
-
"./form",
|
|
30
|
-
"gajiubah",
|
|
31
|
-
null
|
|
32
|
-
],
|
|
33
|
-
"subMenu": []
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"menuName": "",
|
|
37
|
-
"caption": "Daftar Perubahan Gaji",
|
|
38
|
-
"link": [
|
|
39
|
-
"./list",
|
|
40
|
-
"gajiubahdaftar"
|
|
41
|
-
],
|
|
42
|
-
"subMenu": []
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
]}
|
|
49
|
-
]
|