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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "biz-a-cli",
3
3
  "nameDev": "biz-a-cli-dev",
4
- "version": "2.3.38",
4
+ "version": "2.3.40",
5
5
  "versionDev": "0.0.30",
6
6
  "description": "",
7
7
  "main": "bin/index.js",
@@ -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/TOrmMethod/` +
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;
@@ -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/TOrmMethod/testMethod';
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 = ['lib'];
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.lib.yyy().abc()).toStrictEqual('abc');
346
- expect(result.lib.zzz()).toStrictEqual({ "defA": "A", "defB": "B" });
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,2 +0,0 @@
1
- const get = function () {
2
- return {"modelB": {id: null}}};
@@ -1,4 +0,0 @@
1
- let get = function () {return {modelC: {}, function: {func: () => {
2
- return ["lib"];
3
- }
4
- }}};
@@ -1,2 +0,0 @@
1
- var get = function () {return {model: {}, tableName: "", fields: [], function: {}}};
2
- module.exports = get;
@@ -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
- ]