biz9-logic 4.5.5 → 4.5.7

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.
Files changed (3) hide show
  1. package/biz9_config +1 -1
  2. package/index.js +43 -46
  3. package/package.json +1 -1
package/biz9_config CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='4.5.5'
1
+ VERSION='4.5.7'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -19,7 +19,7 @@ class TemplateType {
19
19
  static BODY='body';
20
20
  static FOOTER='footer';
21
21
  }
22
- class Template_Logic{
22
+ class Template_Logic {
23
23
  static get_test = () =>{
24
24
  let template = DataItem.get_new_full_item(
25
25
  DataItem.get_new(DataType.TEMPLATE,Number.get_id()),
@@ -34,7 +34,7 @@ class Template_Logic{
34
34
  return template;
35
35
  };
36
36
  }
37
- class Page_Logic{
37
+ class Page_Logic {
38
38
  static get_test = (option) =>{
39
39
  if(!option){
40
40
  option = {item_count:9,page_count:9,get_value:false,get_item:false,value_count:20};
@@ -56,7 +56,7 @@ class Page_Logic{
56
56
  return page;
57
57
  };
58
58
  }
59
- class Product_Logic{
59
+ class Product_Logic {
60
60
  static get_test = (option) =>{
61
61
  if(!option){
62
62
  option = {item_count:9,product_count:9,get_value:false,get_item:false,value_count:20};
@@ -86,7 +86,7 @@ class Product_Logic{
86
86
  }
87
87
  let item_list=[];
88
88
  for(let a=0;a<option.product_count;a++){
89
- item_list.push(Product.get_test(option));
89
+ item_list.push(Product_Logic.get_test(option));
90
90
  }
91
91
  return item_list;
92
92
  };
@@ -105,12 +105,12 @@ class Product_Logic{
105
105
  product_count = parseInt(option.product_count);
106
106
  }
107
107
  }
108
- let category_list = Category.get_type_category_list(DataType.PRODUCT,category_count);
108
+ let category_list = Category_Logic.get_type_category_list(DataType.PRODUCT,category_count);
109
109
  let item_count = 0;
110
110
  for(let a=0;a<category_list.length;a++){
111
111
  for(let b=0;b<product_count;b++){
112
112
  item_count++;
113
- let product = Product.get_test({item_count:0,product_count:product_count,get_value:false,get_item:false,value_count:20});
113
+ let product = Product_Logic.get_test({item_count:0,product_count:product_count,get_value:false,get_item:false,value_count:20});
114
114
  product.category = category_list[Number.get_id(category_list.length-1)].title;
115
115
  product_list.push(product);
116
116
  }
@@ -118,7 +118,7 @@ class Product_Logic{
118
118
  return [category_list,product_list]
119
119
  };
120
120
  }
121
- class Service_Logic{
121
+ class Service_Logic {
122
122
  static get_test = (option) =>{
123
123
  if(!option){
124
124
  option = {item_count:10,get_value:false,get_item:false,value_count:20};
@@ -171,7 +171,7 @@ class Service_Logic{
171
171
  service_count = parseInt(option.service_count);
172
172
  }
173
173
  }
174
- let category_list = Category.get_type_category_list(DataType.SERVICE,category_count);
174
+ let category_list = Category_Logic.get_type_category_list(DataType.SERVICE,category_count);
175
175
  let item_count = 0;
176
176
  for(let a=0;a<category_list.length;a++){
177
177
  for(let b=0;b<service_count;b++){
@@ -184,7 +184,7 @@ class Service_Logic{
184
184
  return [category_list,service_list]
185
185
  };
186
186
  }
187
- class Event_Logic{
187
+ class Event_Logic {
188
188
  static get_test = (option) =>{
189
189
  if(!option){
190
190
  option = {item_count:9,get_value:false,get_item:false,value_count:20};
@@ -221,7 +221,7 @@ class Event_Logic{
221
221
  }
222
222
  let item_list=[];
223
223
  for(let a=0;a<option.event_count;a++){
224
- item_list.push(Event.get_test(option));
224
+ item_list.push(Event_Logic.get_test(option));
225
225
  }
226
226
  return item_list;
227
227
  };
@@ -240,12 +240,12 @@ class Event_Logic{
240
240
  event_count = parseInt(option.event_count);
241
241
  }
242
242
  }
243
- let category_list = Category.get_type_category_list(DataType.EVENT,category_count);
243
+ let category_list = Category_Logic.get_type_category_list(DataType.EVENT,category_count);
244
244
  let item_count = 0;
245
245
  for(let a=0;a<category_list.length;a++){
246
246
  for(let b=0;b<event_count;b++){
247
247
  item_count++;
248
- let event = Event.get_test({item_count:0,event_count:event_count,get_value:false,get_item:false,value_count:20});
248
+ let event = Event_Logic.get_test({item_count:0,event_count:event_count,get_value:false,get_item:false,value_count:20});
249
249
  event.category = category_list[Number.get_id(category_list.length-1)].title;
250
250
  event_list.push(event);
251
251
  }
@@ -253,7 +253,7 @@ class Event_Logic{
253
253
  return [category_list,event_list]
254
254
  };
255
255
  }
256
- class Field{
256
+ class Field {
257
257
  static get_test = (title,option) =>{
258
258
  if(!title){
259
259
  title="";
@@ -407,7 +407,7 @@ class DataType {
407
407
  static USER='user_biz';
408
408
  static VIDEO='video_biz';
409
409
  }
410
- class Blog_Post_Logic{
410
+ class Blog_Post_Logic {
411
411
  static get_test = (option) =>{
412
412
  if(!option){
413
413
  option = {item_count:10,get_value:false,get_item:false,value_count:20};
@@ -437,7 +437,7 @@ class Blog_Post_Logic{
437
437
  }
438
438
  let item_list=[];
439
439
  for(let a=0;a<option.blog_post_count;a++){
440
- item_list.push(Blog_Post.get_test(option));
440
+ item_list.push(Blog_Post_Logic.get_test(option));
441
441
  }
442
442
  return item_list;
443
443
  };
@@ -456,12 +456,12 @@ class Blog_Post_Logic{
456
456
  blog_post_count = parseInt(option.blog_post_count);
457
457
  }
458
458
  }
459
- let category_list = Category.get_type_category_list(DataType.BLOG_POST,category_count);
459
+ let category_list = Category_Logic.get_type_category_list(DataType.BLOG_POST,category_count);
460
460
  let item_count = 0;
461
461
  for(let a=0;a<category_list.length;a++){
462
462
  for(let b=0;b<blog_post_count;b++){
463
463
  item_count++;
464
- let blog_post = Blog_Post.get_test({item_count:0,blog_post_count:blog_post_count,get_value:false,get_item:false,value_count:20});
464
+ let blog_post = Blog_Post_Logic.get_test({item_count:0,blog_post_count:blog_post_count,get_value:false,get_item:false,value_count:20});
465
465
  blog_post.category = category_list[Number.get_id(category_list.length-1)].title;
466
466
  blog_post_list.push(blog_post);
467
467
  }
@@ -469,7 +469,7 @@ class Blog_Post_Logic{
469
469
  return [category_list,blog_post_list]
470
470
  };
471
471
  }
472
- class Faq_Logic{
472
+ class Faq_Logic {
473
473
  static get_test = () =>{
474
474
  let faq = DataItem.get_new_full_item(
475
475
  DataItem.get_new(DataType.FAQ,Number.get_id()),
@@ -491,7 +491,7 @@ class Faq_Logic{
491
491
  return item_list;
492
492
  };
493
493
  }
494
- class Review_Logic{
494
+ class Review_Logic {
495
495
  static get_test = () =>{
496
496
  let city_list = ["Miami","Atlanta","Chicago","Seattle","New York City"];
497
497
  let state_list = ["Georgia","New York","Illinois","Washington","Flordia"];
@@ -515,7 +515,7 @@ class Review_Logic{
515
515
  }
516
516
  let item_list = [];
517
517
  for(let a=0;a<option.review_count;a++){
518
- item_list.push(Review.get_test());
518
+ item_list.push(Review_Logic.get_test());
519
519
  }
520
520
  return item_list;
521
521
  };
@@ -602,33 +602,33 @@ class DataItem {
602
602
  }
603
603
  }
604
604
  class BiZ_Url {
605
- static get_item=(biz9_config,data_type,id)=>{
606
- let action_url="main/biz_item/get/"+data_type+"/"+id ;
607
- return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,null);
605
+ static get_item = (biz9_config,data_type,id,params) => {
606
+ let action_url="main/biz_item/get/"+data_type+"/"+id;
607
+ return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
608
608
  };
609
- static delete_item=(biz9_config,data_type,id)=>{
610
- let action_url= "main/biz_item/delete/"+data_type+"/"+id ;
611
- return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,null);
609
+ static delete_item = (biz9_config,data_type,id,params) => {
610
+ let action_url= "main/biz_item/delete/"+data_type+"/"+id;
611
+ return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
612
612
  };
613
- static get_full_item=(biz9_config,data_type,id)=>{
613
+ static get_full_item = (biz9_config,data_type,id,params) => {
614
614
  let action_url= "main/biz_item/get_full/"+data_type+"/"+id;
615
- return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,null);
615
+ return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
616
616
  };
617
- static get_page=(biz9_config,title_url)=>{
617
+ static get_page = (biz9_config,title_url,params) => {
618
618
  let action_url= "main/biz_item/get_page/"+title_url;
619
- return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,null);
619
+ return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
620
620
  };
621
- static get_template=(biz9_config,title_url)=>{
621
+ static get_template = (biz9_config,title_url,params) => {
622
622
  let action_url= "main/biz_item/get_template/"+title_url;
623
- return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,null);
623
+ return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
624
624
  };
625
- static get_custom_field=(biz9_config,data_type,id)=>{
625
+ static get_custom_field = (biz9_config,data_type,id,params) => {
626
626
  let action_url="main/biz_item/get_custom_field/"+data_type+"/"+id;
627
- return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,null);
627
+ return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
628
628
  };
629
629
  }
630
630
  class Url{
631
- static get = (biz9_config,action_url,params)=>{
631
+ static get = (biz9_config,action_url,params) => {
632
632
  return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
633
633
  }
634
634
  static connect = (biz9_config) => {
@@ -685,7 +685,7 @@ class Url{
685
685
  };
686
686
  }
687
687
  class Obj {
688
- static get_filter = (biz9_config,data_type,filter,sort_by,page_current,page_size)=>{
688
+ static get_filter = (biz9_config,data_type,filter,sort_by,page_current,page_size) => {
689
689
  return get_cloud_filter_obj_main(data_type,filter,sort_by,page_current,page_size);
690
690
  }
691
691
  };
@@ -699,20 +699,20 @@ class Category_Logic {
699
699
  DataItem.get_new(DataType.CATEGORY,0),
700
700
  DataItem.get_new(DataType.CATEGORY,0),
701
701
  Field.get_test("Category " +Number.get_id()));
702
- category.type = Category.get_category_list()[Number.get_id(Category.get_category_list().length-1)].data_type;
702
+ category.type = Category_Logic.get_category_list()[Number.get_id(Category_Logic.get_category_list().length-1)].data_type;
703
703
  return category;
704
704
  }
705
- static get_test_list=(option)=>{
705
+ static get_test_list = (option) => {
706
706
  if(!option){
707
707
  option={category_count:10};
708
708
  }
709
709
  let item_list=[];
710
710
  for(let a=0;a<option.category_count;a++){
711
- item_list.push(Category.get_test(option));
711
+ item_list.push(Category_Logic.get_test(option));
712
712
  }
713
713
  return item_list;
714
714
  };
715
- static get_type_category_list(type,count){
715
+ static get_type_category_list(type,count) {
716
716
  let category_list = [];
717
717
  for(let a=0;a<count;a++){
718
718
  let category = DataItem.get_new_full_item(
@@ -745,9 +745,6 @@ class Category_Logic {
745
745
  };
746
746
  static get_title_by_type = (data_type) => {
747
747
  switch (data_type) {
748
- case DataType.EVENT:
749
- return "Event";
750
- break;
751
748
  case DataType.PAGE:
752
749
  return "Page";
753
750
  break;
@@ -970,7 +967,7 @@ class Stock {
970
967
  };
971
968
  }
972
969
  class Schedule {
973
- static get_start_date_time = (item) =>{
970
+ static get_start_date_time = (item) => {
974
971
  if(!item.date){
975
972
  item.date = new Date();
976
973
  }
@@ -982,7 +979,7 @@ class Schedule {
982
979
  item.start_date_time = DateTime.get_full_date_time_by_date_time(item.date,item.time);
983
980
  return item;
984
981
  }
985
- static get_start_date_time_by_list = (list) =>{
982
+ static get_start_date_time_by_list = (list) => {
986
983
  for(let a=0;a<list.length;a++){
987
984
  if(!list[a].date){
988
985
  list[a].date = new Date();
@@ -1016,7 +1013,7 @@ class Storage {
1016
1013
  window.localStorage.clear();
1017
1014
  }
1018
1015
  }
1019
- class Sub_Item{
1016
+ class Sub_Item {
1020
1017
  static get_bind_new_child = (id,title,item,parent_item,top_item,options) =>{
1021
1018
  let new_sub_item = DataItem.get_new_full_item(
1022
1019
  DataItem.get_new(DataType.ITEM,id),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.5.5",
3
+ "version": "4.5.7",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"