biz9-logic 1.0.25 → 2.0.2

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/README.md CHANGED
@@ -1,6 +1,7 @@
1
- # BiZ9 Logic
1
+ # BiZ9 Logic-JS
2
2
 
3
- **The BiZ9-Logic Package**
3
+ **The BiZ9-Logic-JS Package**
4
+ Strict Javascript Required.
4
5
 
5
6
  ## Credits
6
7
  ### <a id="credit"></a>Credits
@@ -21,7 +22,7 @@
21
22
  #### The BiZ9 Framework 🦾
22
23
  ![BiZ9 Framework Logo](https://github.com/biz9framework/biz9-art/blob/main/biz9-framework/logo/logox250.png?raw=true)
23
24
 
24
- **The BiZ9 Framework** is a developer friendly platform for building premium, polished, fast, professional and scalable business applications using the lastest rapid application development tools and techniques. The framework consists of libraries, commands, scripts, and packages for creating, maintaining, testing, and deploying both **mobile** and **website applications**. The primary 3rd party framework used are [**React**](https://react.dev/), [**React Native**](https://reactnative.dev/), [**Node.js**](http://Node.js), [**ExpressJS**](https://expressjs.com/), [**MongoDB**](https://www.mongodb.com/), [**Nginx**](https://nginx.org/), [**Redis**](https://redis.io/), [**Git**](https://git-scm.com/), and [**Bash**](https://www.gnu.org/software/bash/). **The BiZ9 Framework** focus is to be precise, routine, rapid, and customizable. The primary target devices for **The BiZ9 Framework** are [**Apple iOS**](https://developer.apple.com/), [**Android**](https://www.android.com/), [**Chrome**](https://www.google.com/chrome/), [**Safari**](https://www.apple.com/safari/), [**Firefox**](https://www.mozilla.org/en-US/firefox/), and [**Edge**](https://www.microsoft.com/en-us/edge/?form=MA13FJ). Other 3rd party Application Programming Interfaces (API) that are pre included are [**Amazon Web Service**](https://aws.amazon.com/), [**Stripe**](https://stripe.com/) and [**Bravely**](https://workbravely.com/).
25
+ **The BiZ9 Framework** is a developer friendly platform for building premium, polished, fast, professional and scalable business applications using the lastest rapid application development tools and techniques. The framework consists of libraries, commands, scripts, and packages for creating, maintaining, testing, and deploying both **mobile** and **website applications**. The primary 3rd party framework used are [**React**](https://react.dev/), [**React Native**](https://reactnative.dev/), [**Node.js**](http://Node.js), [**ExpressJS**](https://expressjs.com/), [**MongoDB**](https://www.mongodb.com/), [**Nginx**](https://nginx.org/), [**Redis**](https://redis.io/), [**Git**](https://git-scm.com/), and [**Bash**](https://www.gnu.org/software/bash/). [The BiZ9 Framework] focus is to be precise, routine, rapid, and customizable. The primary target devices for **The BiZ9 Framework** are [**Apple iOS**](https://developer.apple.com/), [**Android**](https://www.android.com/), [**Chrome**](https://www.google.com/chrome/), [**Safari**](https://www.apple.com/safari/), [**Firefox**](https://www.mozilla.org/en-US/firefox/), and [**Edge**](https://www.microsoft.com/en-us/edge/?form=MA13FJ). Other 3rd party Application Programming Interfaces (API) that are pre included are [**Amazon Web Service**](https://aws.amazon.com/), [**Stripe**](https://stripe.com/) and [**Bravely**](https://workbravely.com/).
25
26
 
26
27
  - <a href="https://github.com/biz9framework" target="_blank">Biz9 Framework GitHub</a>
27
28
  - <a href="https://bossappz.medium.com/what-is-the-biz9-framework-29731c49ad79" target="_blank">Biz9 Framework Blog</a>
@@ -30,7 +31,7 @@
30
31
  #### TaNK9 Code 👽
31
32
  ![TaNK9 Code Head](https://github.com/biz9framework/biz9-art/blob/main/tank9code/head/tank9_headx250.png?raw=true)
32
33
 
33
- **Brandon Poole Sr** also known as **‘TaNK’** is a technical lead and full stack software engineer with over 19 years of professional experience. He was born and raised in **Atlanta, Ga** and graduated with a Computer Information Systems **Bachelor of Science Degree** from [**Fort Valley State University**](https://www.fvsu.edu/). He is proficient in [**ASP.NET C#**](http://ASP.NET), [**ASP.NET MVC**](https://dotnet.microsoft.com/en-us/apps/aspnet/mvc), [**.NET Core**](https://dotnet.microsoft.com/en-us/download), [**Microsoft SQL Server**](https://www.microsoft.com/en-us/sql-server), [**IIS Web Server**](https://learn.microsoft.com/en-us/iis/get-started/introduction-to-iis/iis-web-server-overview), [**Node.js**](http://Node.js), [**React**](https://react.dev/), [**React Native**](https://reactnative.dev/), [**Framework7**](https://framework7.io/), [**Redis**](https://redis.io/), [**Amazon Web Services**](https://aws.amazon.com/), [**Apple iOS**](https://developer.apple.com/ios/), [**Android SDK**](https://developer.android.com/studio), [**MongoDB**](https://www.mongodb.com/), [**Redis**](https://redis.io/), [**NGINX**](https://nginx.org/), and [**Git**](https://git-scm.com/). He has worked as a software developer for Fortune 500 companies such as [**The Boeing Company**](https://www.boeing.com/), [**Georgia Pacific**](https://www.gp.com/), [**Colonial Pipeline**](https://www.colpipe.com/), [**Home Depot**](https://corporate.homedepot.com/) and [**United Parcel Services**](https://www.ups.com/us/en/home).
34
+ **Brandon Poole Sr** also known as **‘TaNK’** is a technical lead and full stack software engineer with over 19 years of professional experience. He was born and raised in **Atlanta, Ga** and graduated with a **Computer Information Systems Bachelor of Science Degree** from [**Fort Valley State University**](https://www.fvsu.edu/). He is proficient in [**ASP.NET C#**](http://ASP.NET), [**ASP.NET MVC**](https://dotnet.microsoft.com/en-us/apps/aspnet/mvc), [**.NET Core**](https://dotnet.microsoft.com/en-us/download), [**Microsoft SQL Server**](https://www.microsoft.com/en-us/sql-server), [**IIS Web Server**](https://learn.microsoft.com/en-us/iis/get-started/introduction-to-iis/iis-web-server-overview), [**Node.js**](http://Node.js), [**React**](https://react.dev/), [**React Native**](https://reactnative.dev/), [**Framework7**](https://framework7.io/), [**Redis**](https://redis.io/), [**Amazon Web Services**](https://aws.amazon.com/), [**Apple iOS**](https://developer.apple.com/ios/), [**Android SDK**](https://developer.android.com/studio), [**MongoDB**](https://www.mongodb.com/), [**Redis**](https://redis.io/), [**NGINX**](https://nginx.org/), and [**Git**](https://git-scm.com/). He has worked as a software developer for Fortune 500 companies such as [**The Boeing Company**](https://www.boeing.com/), [**Georgia Pacific**](https://www.gp.com/), [**Colonial Pipeline**](https://www.colpipe.com/), [**Home Depot**] and [**United Parcel Services**].
34
35
 
35
36
  He is sometimes referred to as “the real Tank” from the movie [**The Matrix**](https://www.imdb.com/title/tt0133093/).
36
37
 
package/babel.config.json CHANGED
@@ -1,4 +1,3 @@
1
- babel.config.json
2
1
  {
3
2
  "presets": [
4
3
  [
package/biz9_config CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='1.1.5'
1
+ VERSION='2.0.2'
2
2
  TITLE='BiZ9-Logic'
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git'
4
4
  BRANCH='main'
package/index.js CHANGED
@@ -2,26 +2,69 @@
2
2
  Copyright 2023 Certified CoderZ
3
3
  Author: certifiedcoderz@gmail.com (Certified CoderZ)
4
4
  License GNU General Public License v3.0
5
- Description: BiZ9 Framework: Logic
5
+ Description: BiZ9 Framework: Logic-JS
6
6
  */
7
- const { get_new_item_main,get_data_config_main,get_cloud_url_main,get_biz_item_main } = require('./main.js');
7
+ const { get_new_item_main,get_data_config_main,get_cloud_url_main,get_biz_item_main,get_cloud_filter_obj_main,get_title_url_main } = require('./main');
8
8
 
9
- const get_new_item = (data_type,id) => {
10
- return get_new_item_main(data_type,id);
9
+ const global = {
10
+ APP_VERSION:'1.0.0',
11
+ PROJECT_ID:'19',
12
+ APP_TITLE:'DG-CMS',
13
+ APP_TITLE_ID:'dg-cms-feb-18b',
14
+ CLOUD_PORT_ID:"1902",
15
+ DT_BLANK:'blank_biz',
16
+ DT_PAGE:'page_biz',
17
+ CLOUD_URL:'http://localhost',
11
18
  };
12
- const get_data_config = (biz9_config,params) => {
13
- return get_data_config_main(biz9_config,params);
14
- };
15
- const get_cloud_url = (app_title_id,domain_url,action_url)=>{
16
- return get_cloud_url_main(app_title_id,domain_url,action_url);
19
+ class Item {
20
+ static get_new = (data_type,id) => {
21
+ return get_new_item_main(data_type,id);
22
+ };
23
+ static get_biz = (biz9_config,item,options)=>{
24
+ return get_biz_item_main(biz9_config,item,options);
25
+ }
26
+ static get_title_url = (title) => {
27
+ return get_title_url_main(title);
28
+ };
17
29
  }
18
- const get_biz_item = (biz9_config,item,options)=>{
19
- return get_biz_item_main(biz9_config,item,options);
30
+ class Cloud {
31
+ static get_url = (action_url)=>{
32
+ return get_cloud_url_main(global.APP_TITLE_ID,global.CLOUD_URL,global.CLOUD_PORT_ID,action_url);
33
+ }
34
+ static get_url_action_update_item = (data_type,id) => {
35
+ let action_url= "main/crud/update/"+data_type + "/" + id;
36
+ return get_cloud_url_main(global.APP_TITLE_ID,global.CLOUD_URL,global.CLOUD_PORT_ID,action_url);
37
+ };
38
+ static get_url_action_get_item = (data_type,id) => {
39
+ let action_url= "main/crud/get/"+data_type + "/" + id;
40
+ return get_cloud_url_main(global.APP_TITLE_ID,global.CLOUD_URL,global.CLOUD_PORT_ID,action_url);
41
+ };
42
+ static get_url_action_delete_item = (data_type,id) => {
43
+ let action_url= "main/crud/delete/"+data_type + "/" + id;
44
+ return get_cloud_url_main(global.APP_TITLE_ID,global.CLOUD_URL,global.CLOUD_PORT_ID,action_url);
45
+ };
46
+ static get_url_action_get_list = (data_type) => {
47
+ let action_url= "main/crud/get_list/"+data_type;
48
+ return get_cloud_url_main(global.APP_TITLE_ID,global.CLOUD_URL,global.CLOUD_PORT_ID,action_url);
49
+ };
50
+ static get_url_action_delete_list = (data_type) => {
51
+ let action_url= "main/crud/delete_list/"+data_type;
52
+ return get_cloud_url_main(global.APP_TITLE_ID,global.CLOUD_URL,global.CLOUD_PORT_ID,action_url);
53
+ };
54
+ static get_url_action_update_list = (data_type) => {
55
+ let action_url= "main/crud/update_list/"+data_type;
56
+ return get_cloud_url_main(global.APP_TITLE_ID,global.CLOUD_URL,global.CLOUD_PORT_ID,action_url);
57
+ };
58
+ static get_filter_obj = (data_type,filter,sort_by,page_current,page_size)=>{
59
+ return get_cloud_filter_obj_main(data_type,filter,sort_by,page_current,page_size);
60
+ }
20
61
  }
21
-
62
+ const get_data_config = (biz9_config,query) => {
63
+ return get_data_config_main(biz9_config,query);
64
+ };
22
65
  module.exports = {
66
+ global,
67
+ Cloud,
68
+ Item,
23
69
  get_data_config,
24
- get_cloud_url,
25
- get_new_item,
26
- get_biz_item
27
70
  };
package/main.js CHANGED
@@ -6,16 +6,21 @@ Description: BiZ9 Framework: Logic - Main
6
6
  */
7
7
 
8
8
  const moment = require('moment');
9
- const { get_date_time_pretty,get_date_str,get_date_time_str,get_month_title_short,get_date_time_obj,get_time_str } = require('biz9-utility');
9
+ const { DateTime } = require('biz9-utility');
10
+
11
+ const get_cloud_filter_obj_main = (data_type,filter,sort_by,page_current,page_size) => {
12
+ return {data_type:data_type,filter:filter,sort_by:sort_by,page_current:page_current,page_size:page_size};
13
+ }
14
+
10
15
  const get_new_item_main = (data_type,id) => {
11
16
  if(!id){
12
17
  id=0;
13
18
  }
14
19
  return {data_type:data_type,id:id};
15
20
  }
16
- const get_cloud_url_main = (app_title_id,domain_url,action_url) =>{
21
+ const get_cloud_url_main = (app_title_id,domain_url,port_id,action_url) =>{
17
22
  var app_title_id_url='?app_title_id='+app_title_id;
18
- return domain_url+action_url+app_title_id_url;
23
+ return domain_url+":"+port_id+"/"+action_url+app_title_id_url;
19
24
  }
20
25
  const get_data_config_main = (biz9_config,query) =>{
21
26
  if(biz9_config.SERVICE_HOST_TYPE == 'multiple'){
@@ -24,12 +29,12 @@ const get_data_config_main = (biz9_config,query) =>{
24
29
  return biz9_config;
25
30
  }
26
31
  const get_biz_item_main=(biz9_config,item,options) =>{
27
- /* option
28
- * get_photo = true
29
- * get_date = true
30
- * get_count = true
31
- * get_biz_map = true
32
- */
32
+ //option
33
+ //get_photo = true
34
+ //get_date = true
35
+ //get_count = true
36
+ //get_biz_map = true
37
+ //
33
38
  if(options.get_count){
34
39
  if(!item.view_count){
35
40
  item.view_count='0';
@@ -74,27 +79,27 @@ const get_biz_item_main=(biz9_config,item,options) =>{
74
79
  item.date_save= new moment().toISOString();
75
80
  }
76
81
  item.date_obj={
77
- pretty_create: (item.date_create) ? get_date_time_pretty(item.date_create) : no_date_str,
78
- pretty_update: (item.date_create) ? get_date_time_pretty(item.date_save): no_date_str,
79
- full_date_create: (item.date_create) ? get_date_str(item.date_create) : no_date_str,
80
- full_date_update: (item.date_create) ? get_date_str(item.date_save) : no_date_str,
81
- full_date_time_create: (item.date_create) ? get_date_time_str(item.date_create) : no_date_str,
82
- full_date_time_update: (item.date_create) ? get_date_time_str(item.date_save) : no_date_str,
83
- month_create: (item.date_create) ? get_month_title_short(1+get_date_time_obj(item.date_create).month()) : no_date_str,
84
- month_update: (item.date_create) ? get_month_title_short(1+get_date_time_obj(item.date_save).month()) : no_date_str,
85
- mo_create: (item.date_create) ? (1+get_date_time_obj(item.date_create).month()) : no_date_str,
86
- mo_update: (item.date_create) ? (1+get_date_time_obj(item.date_save).month()) : no_date_str,
87
- date_create: (item.date_create) ? get_date_time_obj(item.date_create).date() : no_date_str,
88
- year_create: (item.date_create) ? get_date_time_obj(item.date_create).year() : no_date_str,
89
- year_update: (item.date_create) ? get_date_time_obj(item.date_save).year() : no_date_str,
90
- time_create: (item.date_create) ? get_time_str(item.date_create) : no_date_str,
91
- time_update: (item.date_create) ? get_time_str(item.date_save) : no_date_str,
82
+ pretty_create: (item.date_create) ? DateTime.get_pretty(item.date_create) : no_date_str,
83
+ pretty_update: (item.date_create) ? DateTime.get_pretty(item.date_save): no_date_str,
84
+ full_date_create: (item.date_create) ? DateTime.get_date_str(item.date_create) : no_date_str,
85
+ full_date_update: (item.date_create) ? DateTime.get_date_str(item.date_save) : no_date_str,
86
+ full_date_time_create: (item.date_create) ? DateTime.get_str(item.date_create) : no_date_str,
87
+ full_date_time_update: (item.date_create) ? DateTime.get_str(item.date_save) : no_date_str,
88
+ month_create: (item.date_create) ? DateTime.get_month_title(1+DateTime.get_obj(item.date_create).month()) : no_date_str,
89
+ month_update: (item.date_create) ? DateTime.get_month_title(1+DateTime.get_obj(item.date_save).month()) : no_date_str,
90
+ mo_create: (item.date_create) ? (1+DateTime.get_obj(item.date_create).month()) : no_date_str,
91
+ mo_update: (item.date_create) ? (1+DateTime.get_obj(item.date_save).month()) : no_date_str,
92
+ date_create: (item.date_create) ? DateTime.get_obj(item.date_create).date() : no_date_str,
93
+ year_create: (item.date_create) ? DateTime.get_obj(item.date_create).year() : no_date_str,
94
+ year_update: (item.date_create) ? DateTime.get_obj(item.date_save).year() : no_date_str,
95
+ time_create: (item.date_create) ? DateTime.get_time_str(item.date_create) : no_date_str,
96
+ time_update: (item.date_create) ? DateTime.get_time_str(item.date_save) : no_date_str,
92
97
  }
93
98
  }
94
99
  //date setting - end
95
100
  //biz_map setting - start
96
101
  if(options.get_biz_map){
97
- for(a=0;a<20;a++){
102
+ for(let a=0;a<20;a++){
98
103
  if(item['field_'+a]){
99
104
  item[item['field_'+a]]=item['value_'+a];
100
105
  }
@@ -104,11 +109,18 @@ const get_biz_item_main=(biz9_config,item,options) =>{
104
109
 
105
110
  return item;
106
111
  }
107
-
112
+ const get_title_url_main = (title) => {
113
+ if(!title){
114
+ title='';
115
+ }
116
+ return title.replace(/[^a-z0-9]+/ig, "_").toLowerCase();
117
+ }
108
118
 
109
119
  module.exports = {
110
- get_data_config_main,
111
120
  get_new_item_main,
112
121
  get_cloud_url_main,
122
+ get_cloud_filter_obj_main,
123
+ get_data_config_main,
124
+ get_title_url_main,
113
125
  get_biz_item_main
114
126
  };
package/package.json CHANGED
@@ -1,16 +1,19 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "1.0.25",
3
+ "version": "2.0.2",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
7
7
  },
8
- "author": "Certified Coderz",
9
- "license": "ISC",
8
+ "author": "BiZ9 Framework LLC",
9
+ "license": "MIT",
10
10
  "dependencies": {
11
- "async": "^3.2.6",
11
+ "async-series": "^0.0.1",
12
12
  "biz9-scriptz": "^5.2.34",
13
- "biz9-utility": "^1.0.53"
13
+ "biz9-utility": "^2.0.14",
14
+ "i": "^0.3.7",
15
+ "jest": "^29.7.0",
16
+ "npm": "^11.1.0"
14
17
  },
15
18
  "repository": {
16
19
  "type": "git",
@@ -20,5 +23,13 @@
20
23
  "url": "https://github.com/biz9framework/biz9-logic/issues"
21
24
  },
22
25
  "homepage": "https://github.com/biz9framework/biz9-logic#readme",
23
- "description": ""
26
+ "description": "**The BiZ9-Logic Package** Strict Javascript Required.",
27
+ "keywords": [
28
+ "await",
29
+ "async",
30
+ "javascript",
31
+ "axios",
32
+ "fetch",
33
+ "random"
34
+ ]
24
35
  }
package/test.js CHANGED
@@ -1,6 +1,7 @@
1
- const async = require('async');
2
- const { get_data_config, get_new_item, get_cloud_url, get_biz_item } = require('./');
3
- const { get_test_item,w } = require('biz9-utility');
1
+ const series = require('async-series');
2
+ const {Log,Test} = require('biz9-utility');
3
+ const { get_data_config, Item, get_cloud_url,get_cloud_url_action_update_item,get_cloud_url_action_get_item, get_cloud_url_action_get_list,get_cloud_url_action_update_list,get_cloud_url_action_delete_item, get_cloud_url_action_delete_list, Cloud }= require('./');
4
+
4
5
  /* --- TEST CONFIG START --- */
5
6
  //const ID='0';
6
7
  const ID='f23c2372-df8e-4c09-a919-677fe32ba0bb';
@@ -8,8 +9,6 @@ const APP_TITLE_ID='cool_bean';
8
9
  const DATA_TYPE='dt_blank';
9
10
  const PORT_ID="1901";
10
11
  const CLOUD_URL="http://localhost:"+PORT_ID;
11
- /* --- TEST CONFIG END --- */
12
- /* --- TEST DATA CONFIG START --- */
13
12
  const biz9_config ={
14
13
  SERVICE_HOST_TYPE:'multiple',
15
14
  APP_TITLE_ID:APP_TITLE_ID,
@@ -25,37 +24,95 @@ const biz9_config ={
25
24
  };
26
25
  /* --- TEST DATA CONFIG END --- */
27
26
 
27
+
28
28
  describe("connect", () => {
29
29
  it("_connect", () => {
30
- async.series([
30
+ series([
31
31
  function(call) {
32
- console.log('TEST-BIZ9-LOGIC-CONNECT-START');
33
- call();
32
+ console.log('CONNECT-START');
33
+ let cloud_url = Cloud.get_url('aa');
34
+ Log.w('connect_url',cloud_url);
35
+ call()
34
36
  },
35
37
  function(call) {
36
- console.log('TEST-BIZ9-LOGIC-GET-NEW-ITEM-START');
37
- var _new_item = get_new_item(DATA_TYPE,0);
38
- console.log(_new_item);
39
- console.log('TEST-BIZ9-LOGIC-GET-NEW-ITEM-SUCCESS');
40
- call();
38
+ console.log('GET_URL-ACTION-UPDATE-ITEM-START');
39
+ let data_type = 'dt_blank';
40
+ let id = 0;
41
+ let cloud_url = Cloud.get_url_action_update_item(data_type,id);
42
+ Log.w('get_url_action_update_item',cloud_url);
43
+ console.log('GET_URL-ACTION-UPDATE-ITEM-SUCCESS');
44
+ call()
41
45
  },
46
+
42
47
  function(call) {
43
- console.log('TEST-BIZ9-LOGIC-GET-DATA-CONFIG-START');
44
- var _data_config = get_data_config(biz9_config,{app_title_id:'local_app_title_id'});
45
- console.log(_data_config);
46
- console.log('TEST-BIZ9-LOGIC-GET-DATA-CONFIG-SUCCESS');
47
- call();
48
+ console.log('GET_URL-ACTION-GET-ITEM-START');
49
+ let data_type = 'dt_blank';
50
+ let id = 0;
51
+ let cloud_url = Cloud.get_url_action_get_item(data_type,id);
52
+ Log.w('get_url_action_get_item',cloud_url);
53
+ console.log('GET_URL-ACTION-GET-ITEM-SUCCESS');
54
+ call()
48
55
  },
56
+
49
57
  function(call) {
50
- console.log('TEST-BIZ9-LOGIC-GET-CLOUD-URL-START');
51
- var _cloud_url = get_cloud_url(biz9_config.APP_TITLE_ID,CLOUD_URL,'/get/test/');
52
- console.log(_cloud_url);
53
- console.log('TEST-BIZ9-LOGIC-GET-CLOUD-URL-SUCCESS');
54
- call();
58
+ console.log('GET_URL-ACTION-DELETE-ITEM-START');
59
+ let data_type = 'dt_blank';
60
+ let id = 0;
61
+ let cloud_url = Cloud.get_url_action_delete_item(data_type,id);
62
+ Log.w('get_url_action_delete_item',cloud_url);
63
+ console.log('GET_URL-ACTION-DELETE-ITEM-SUCCESS');
64
+ call()
65
+ },
66
+
67
+ function(call) {
68
+ console.log('GET_URL-ACTION-GET-LIST-ITEM-START');
69
+ let data_type = 'dt_blank';
70
+ let cloud_url = Cloud.get_url_action_get_list(data_type);
71
+ Log.w('get_url_action_get_list_item',cloud_url);
72
+ console.log('GET_URL-ACTION-GET-LIST-ITEM-SUCCESS');
73
+ call()
55
74
  },
75
+
56
76
  function(call) {
57
- console.log('TEST-BIZ9-LOGIC-SET-ITEM-BIZ-START');
58
- let item_test = get_test_item();
77
+ console.log('GET_URL-ACTION-DELETE-LIST-ITEM-START');
78
+ let data_type = 'dt_blank';
79
+ let cloud_url = Cloud.get_url_action_delete_list(data_type);
80
+ Log.w('get_url_action_delete_list_item',cloud_url);
81
+ console.log('GET_URL-ACTION-DELETE-LIST-ITEM-SUCCESS');
82
+ call()
83
+ },
84
+
85
+ function(call) {
86
+ console.log('GET_URL-ACTION-UPDATE-LIST-ITEM-START');
87
+ let data_type = 'dt_blank';
88
+ let cloud_url = Cloud.get_url_action_delete_list(data_type);
89
+ Log.w('get_url_action_delete_list_item',cloud_url);
90
+ console.log('GET_URL-ACTION-UPDATE-LIST-ITEM-SUCCESS');
91
+ call()
92
+ },
93
+
94
+ function(call) {
95
+ console.log('GET_FILTER-OBJECT-START');
96
+ let data_type = 'dt_blank';
97
+ let filter = {data_type:'dt_blank'};
98
+ let sort_by = {title:-1};
99
+ let page_current = 0;
100
+ let page_size = 15;
101
+ let filter_obj = Cloud.get_filter_obj(data_type,filter,sort_by,page_current,page_size);
102
+ Log.w('get_url_action_filter_obj',filter_obj);
103
+ console.log('GET_FILTER-OBJECT-SUCCESS');
104
+ call()
105
+ },
106
+ function(call) {
107
+ console.log('GET-NEW-ITEM-START');
108
+ var new_item = Item.get_new(DATA_TYPE,0);
109
+ console.log(new_item);
110
+ console.log('GET-NEW-ITEM-SUCCESS');
111
+ call()
112
+ },
113
+ function(call) {
114
+ console.log('SET-ITEM-BIZ-START');
115
+ let item_test = Test.get_item('dt_blank',0);
59
116
  item_test.photofilename='abc.png';
60
117
  item_test.field_1 = 'my_field_1';
61
118
  item_test.value_1 = 'my_value_1';
@@ -63,20 +120,21 @@ describe("connect", () => {
63
120
  item_test.value_2 = 'my_value_2';
64
121
  item_test.field_3 = 'my_field_3';
65
122
  item_test.value_3 = 'my_value_3';
66
- let item_biz = get_biz_item(biz9_config,item_test,{get_photo:true,get_date:true,get_count:true,get_biz_map:true});
67
- //let item_biz = get_biz_item(biz9_config,item_test,{get_photo:false,get_date:false,get_count:false,get_biz_map:false});
123
+ let item_biz = Item.get_biz(biz9_config,item_test,{get_photo:true,get_date:true,get_count:true,get_biz_map:true});
68
124
  console.log(item_biz);
69
- console.log('TEST-BIZ9-LOGIC-SET-ITEM-BIZ-SUCCESS');
125
+ console.log('SET-ITEM-BIZ-SUCCESS');
70
126
  call();
71
127
  },
72
- ], function(err, results) {
73
- console.log('TEST-BIZ9-LOGIC-CONNECT-SUCCESS');
74
- console.log('TEST-BIZ9-LOGIC-GET-DATA-CONFIG-SUCCESS');
75
- console.log('TEST-BIZ9-LOGIC-GET-NEW-ITEM-SUCCESS');
76
- console.log('TEST-BIZ9-LOGIC-GET-CLOUD-URL-SUCCESS');
77
- console.log('TEST-BIZ9-LOGIC-CONNECT-DONE');
78
- });
79
- });
128
+
129
+ function(call) {
130
+ // never happens, because "second thing"
131
+ // passed an error to the done() callback
132
+ }
133
+ ], function(err) {
134
+ console.log(err.message) // "another thing"
135
+ })
136
+
137
+ });
80
138
  });
81
139
 
82
140
 
package/test_run CHANGED
@@ -1,4 +1,4 @@
1
- echo 'BiZ9-Adapter-Server Test'
1
+ echo 'BiZ9-Logic-Test'
2
2
  run_test=$1
3
3
  echo $run_test
4
4
  mocha -g $run_test test.js