biz9-logic 3.0.16 → 3.0.20

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.1.6'
1
+ VERSION='3.2.0'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -8,7 +8,7 @@ const { get_new_item_main,get_data_config_main,get_cloud_url_main,get_biz_item_m
8
8
  const {Log,Test,Str} = require('biz9-utility');
9
9
 
10
10
  class DataType {
11
- static get_data_type_title = (data_type) => {
11
+ static get_title = (data_type) => {
12
12
  if(!data_type){
13
13
  return "";
14
14
  }else{
@@ -52,7 +52,7 @@ class DataType {
52
52
  static DT_USER='user_biz';
53
53
  static DT_VIDEO='video_biz';
54
54
  }
55
- class Item {
55
+ class DataItem {
56
56
  static get_new = (data_type,id) => {
57
57
  return get_new_item_main(data_type,id);
58
58
  };
@@ -84,12 +84,28 @@ class Url {
84
84
  let action_url= "main/crud/get_list/"+data_type;
85
85
  return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
86
86
  };
87
+ static update_list = (biz9_config,data_type) => {
88
+ let action_url= "main/crud/update_list/"+data_type;
89
+ return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
90
+ };
87
91
  static delete_list = (biz9_config,data_type) => {
88
92
  let action_url= "main/crud/delete_list/"+data_type;
89
93
  return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
90
94
  };
91
- static update_list = (biz9_config,data_type) => {
92
- let action_url= "main/crud/update_list/"+data_type;
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
+ static delete_biz_item = (biz9_config,data_type,id) => {
100
+ let action_url= "main/biz_item/delete/"+data_type + "/" + id;
101
+ return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
102
+ };
103
+ static get_biz_list = (biz9_config,data_type) => {
104
+ let action_url= "main/biz_item/get_list/"+data_type;
105
+ return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
106
+ };
107
+ static delete_biz_list = (biz9_config,data_type) => {
108
+ let action_url= "main/biz_item/delete_list/"+data_type;
93
109
  return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
94
110
  };
95
111
  }
@@ -100,7 +116,7 @@ class Obj {
100
116
  };
101
117
  module.exports = {
102
118
  DataType,
103
- Item,
119
+ DataItem,
104
120
  Url,
105
121
  Obj
106
122
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "3.0.16",
3
+ "version": "3.0.20",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -1,8 +1,8 @@
1
1
  const path = require('path');
2
2
  const series = require('async-series');
3
- const {Item,DataType,Url,Obj} = require('./');
3
+ const { DataItem,DataType,Url,Obj } = require('./');
4
4
  const {Log,Test} = require('biz9-utility');
5
- const { Scriptz }= require('biz9-scriptz');
5
+ const { Scriptz }= require('biz9-scriptz');
6
6
 
7
7
  /* --- TEST CONFIG START --- */
8
8
  //const ID='0';
@@ -36,6 +36,7 @@ describe("connect", () => {
36
36
  console.log('GET-BIZ9-GET-DATA-TYPE-END');
37
37
  call();
38
38
  },
39
+ /*
39
40
  function(call) {
40
41
  console.log('GET-BIZ9-CONFIG-FILE-START');
41
42
  let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
@@ -139,7 +140,7 @@ describe("connect", () => {
139
140
  },
140
141
  function(call) {
141
142
  console.log('GET-NEW-ITEM-START');
142
- var new_item = Item.get_new(DATA_TYPE,0);
143
+ var new_item = DataItem.get_new(DATA_TYPE,0);
143
144
  console.log(new_item);
144
145
  console.log('GET-NEW-ITEM-SUCCESS');
145
146
  call()
@@ -154,11 +155,22 @@ describe("connect", () => {
154
155
  item_test.value_2 = 'my_value_2';
155
156
  item_test.field_3 = 'my_field_3';
156
157
  item_test.value_3 = 'my_value_3';
157
- let item_biz = Item.get_biz(biz9_config,item_test,{get_date:true,get_count:true,get_biz_map:true});
158
+ let item_biz = DataItem.get_biz(biz9_config,item_test,{get_date:true,get_count:true,get_biz_map:true});
158
159
  console.log(item_biz);
159
160
  console.log('SET-ITEM-BIZ-SUCCESS');
160
161
  call();
161
162
  },
163
+ */
164
+ function(call) {
165
+ console.log('GET_URL-BIZ-ITEM-START');
166
+ let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
167
+ let data_type = 'dt_blank';
168
+ //let cloud_url = Url.get_biz_item(biz9_config,data_type,ID);
169
+ let cloud_url = Url.delete_biz_item(biz9_config,data_type,ID);
170
+ Log.w('get_url_biz_item',cloud_url);
171
+ console.log('GET_URL-BIZ-ITEM-SUCCESS');
172
+ call()
173
+ },
162
174
  function(call) {
163
175
  // never happens, because "second thing"
164
176
  // passed an error to the done() callback