biz9-logic 3.0.20 → 3.2.4

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/biz9_config CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='3.2.0'
1
+ VERSION='3.3.1'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -60,6 +60,17 @@ class DataItem {
60
60
  return get_biz_item_main(biz9_config,item,options);
61
61
  }
62
62
  }
63
+ class BiZ_Url {
64
+ static get_item = (biz9_config,item) => {
65
+ let action_url= "main/biz_item/get/"+item.data_type + "/" + item.id;
66
+ return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
67
+ };
68
+
69
+ static get_full_item = (biz9_config,item,parent_item,top_item) => {
70
+ let action_url= "main/biz_item/get_full/"+item.data_type + "/" + item.id + "/"+parent_item.data_type + "/" + parent_item.id + "/"+top_item.data_type + "/" + top_item.id;
71
+ return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
72
+ };
73
+ }
63
74
  class Url {
64
75
  static get = (biz9_config,action_url,params)=>{
65
76
  return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,params);
@@ -92,10 +103,6 @@ class Url {
92
103
  let action_url= "main/crud/delete_list/"+data_type;
93
104
  return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
94
105
  };
95
- static get_biz_item = (biz9_config,data_type,id) => {
96
- let action_url= "main/biz_item/get/"+data_type + "/" + id;
97
- return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
98
- };
99
106
  static delete_biz_item = (biz9_config,data_type,id) => {
100
107
  let action_url= "main/biz_item/delete/"+data_type + "/" + id;
101
108
  return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
@@ -118,5 +125,6 @@ module.exports = {
118
125
  DataType,
119
126
  DataItem,
120
127
  Url,
128
+ BiZ_Url,
121
129
  Obj
122
130
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "3.0.20",
3
+ "version": "3.2.4",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const path = require('path');
2
2
  const series = require('async-series');
3
- const { DataItem,DataType,Url,Obj } = require('./');
3
+ const { DataItem,DataType,Url,Obj,BiZ_Url } = require('./');
4
4
  const {Log,Test} = require('biz9-utility');
5
5
  const { Scriptz }= require('biz9-scriptz');
6
6
 
@@ -28,6 +28,33 @@ const biz9_config ={
28
28
  describe("connect", () => {
29
29
  it("_connect", () => {
30
30
  series([
31
+
32
+ function(call) {
33
+ console.log('GET-BiZ-Full-Url-Item-Get-Item-START');
34
+ let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
35
+ let item = DataItem.get_new(DataType.DT_BLANK,0);
36
+ let parent_item = DataItem.get_new(DataType.DT_BLANK,0);
37
+ let top_item = DataItem.get_new(DataType.DT_BLANK,0);
38
+ Log.w('item',item);
39
+ let cloud_url = BiZ_Url.get_full_item(biz9_config,item,parent_item,top_item);
40
+ Log.w('connect_url',cloud_url);
41
+ console.log('GET-BiZ-Full-Url-Item-Get-Item-SUCCESS');
42
+ //call()
43
+ },
44
+
45
+
46
+ /*
47
+ function(call) {
48
+ console.log('GET-BiZ-Url-Item-Get-Item-START');
49
+ let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
50
+ let item = DataItem.get_new(DataType.DT_BLANK,0);
51
+ Log.w('item',item);
52
+ let cloud_url = BiZ_Url.get_item(biz9_config,item);
53
+ Log.w('connect_url',cloud_url);
54
+ console.log('GET-BiZ-Url-Item-Get-Item-SUCCESS');
55
+ //call()
56
+ },
57
+
31
58
  function(call) {
32
59
  console.log('GET-BIZ9-GET-DATA-TYPE-START');
33
60
  console.log(DataType.get_data_type_title(DataType.DT_CART_ITEM));
@@ -36,7 +63,6 @@ describe("connect", () => {
36
63
  console.log('GET-BIZ9-GET-DATA-TYPE-END');
37
64
  call();
38
65
  },
39
- /*
40
66
  function(call) {
41
67
  console.log('GET-BIZ9-CONFIG-FILE-START');
42
68
  let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
@@ -160,7 +186,6 @@ describe("connect", () => {
160
186
  console.log('SET-ITEM-BIZ-SUCCESS');
161
187
  call();
162
188
  },
163
- */
164
189
  function(call) {
165
190
  console.log('GET_URL-BIZ-ITEM-START');
166
191
  let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
@@ -171,6 +196,7 @@ describe("connect", () => {
171
196
  console.log('GET_URL-BIZ-ITEM-SUCCESS');
172
197
  call()
173
198
  },
199
+ */
174
200
  function(call) {
175
201
  // never happens, because "second thing"
176
202
  // passed an error to the done() callback