biz9-logic 4.9.132 → 4.9.135

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='10.0.4'
1
+ VERSION='10.0.7'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main'
package/index.js CHANGED
@@ -103,10 +103,6 @@ class Title {
103
103
  static ORDER_PAYMENT_METHOD_TEST="Test";
104
104
  //cart
105
105
  static CART_NUMBER="CA-";
106
- //data_type
107
- static DATA_TYPE_BLOG_POST="Blog Post";
108
- static DATA_TYPE_CATEGORY="Category";
109
- static DATA_TYPE_CONTENT="Content";
110
106
  //role
111
107
  static USER_ROLE_SUPER_ADMIN='Super Admin';
112
108
  static USER_ROLE_ADMIN='Admin';
@@ -529,6 +525,7 @@ class Type {
529
525
  case DataType.FAQ:
530
526
  case DataType.FAVORITE:
531
527
  case DataType.GALLERY:
528
+ case DataType.GROUP:
532
529
  case DataType.ITEM_MAP:
533
530
  case DataType.ITEM:
534
531
  case DataType.LINK:
@@ -1452,6 +1449,7 @@ class DataType {
1452
1449
  static CUSTOM_FIELD='custom_field_biz';
1453
1450
  static CONTENT='content_biz';
1454
1451
  static EVENT='event_biz';
1452
+ static GROUP='group_biz';
1455
1453
  static FAQ='faq_biz';
1456
1454
  static FAVORITE='favorite_biz';
1457
1455
  static GALLERY='gallery_biz';
@@ -1978,6 +1976,13 @@ class Image_Logic {
1978
1976
  param = param ? param : "";
1979
1977
  return host+"/"+size + "_"+image_filename+param;
1980
1978
  }
1979
+ static get_new_by_base64 = (item_data) =>{
1980
+ let item = DataItem.get_new(DataType.IMAGE,0);
1981
+ item.extension = !Str.check_is_null(Str.get_file_type_from_base64(item.base64)) ? Str.get_file_type_from_base64(item.base64).extension : 'jpeg';
1982
+ item.image_filename = !Str.check_is_null(Str.get_file_type_from_base64(item.base64)) ? Str.get_guid()+"."+Str.get_file_type_from_base64(item.base64).extension : 'not_found.jpeg';
1983
+ item.buffer = !Str.check_is_null(Str.get_file_type_from_base64(item_data.base64)) ? Buffer.from(item_data.base64.split(';base64,').pop(), 'base64') : null
1984
+ return item;
1985
+ }
1981
1986
  static get_process_list = (upload_dir,image_filename) =>{
1982
1987
  upload_dir = upload_dir ? upload_dir : "";
1983
1988
  image_filename = image_filename ? image_filename : "";
@@ -2053,7 +2058,8 @@ class Url {
2053
2058
  static LOGOUT="user/logout";
2054
2059
  static REGISTER="user/register";
2055
2060
  static PARENT_TOP="main/crud/parent_top";
2056
- static PING="ping";
2061
+ static PING_GET="ping_get";
2062
+ static PING_POST="ping_post";
2057
2063
  static POST="main/crud/post";
2058
2064
  static POST_LIST="main/crud/post_list";
2059
2065
  static SEARCH="main/crud/search";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.9.132",
3
+ "version": "4.9.135",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -10,7 +10,7 @@
10
10
  "dependencies": {
11
11
  "async-series": "^0.0.1",
12
12
  "biz9-scriptz": "^5.8.12",
13
- "biz9-utility": "^3.8.36",
13
+ "biz9-utility": "^3.8.68",
14
14
  "jest": "^29.7.0",
15
15
  "moment": "^2.30.1"
16
16
  },
package/test.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const series = require('async-series');
2
- const {DataItem,DataType,Item_Logic,User_Logic,Page_Logic,Product_Logic,Type,Title,Stat_Logic,Service_Logic,Blog_Post_Logic,Event_Logic,Demo_Logic,Cart_Logic,Order_Logic,App_Logic,Field_Logic} = require('./index');
2
+ const {DataItem,DataType,Item_Logic,User_Logic,Page_Logic,Product_Logic,Type,Title,Stat_Logic,Service_Logic,Blog_Post_Logic,Event_Logic,Demo_Logic,Cart_Logic,Order_Logic,App_Logic,Field_Logic,Image_Logic} = require('./index');
3
3
  const {Log,Num,Str} = require('biz9-utility');
4
4
  const {Scriptz}= require('biz9-scriptz');
5
5
 
@@ -36,13 +36,12 @@ describe("connect", () => {
36
36
  let parent_data_type = DataType.PRODUCT;
37
37
  let parent_id = 3334;
38
38
  let user_id = 0;
39
- let item_list = [];
40
- for(var a = 0; a < Type.get_page_list().length;a++){
41
- let my_type = Type.get_page_list()[a];
42
- //console.log('value='+my_type.value);
43
- //console.log('label='+my_type.label);
44
- console.log('url='+my_type.url);
45
- }
39
+
40
+ let image = DataItem.get_new(DataType.IMAGE,0);
41
+ image.base64 = 'fsadfsd';
42
+ image = Image_Logic.get_new_by_base64(image);
43
+ Log.w('99_result',image);
44
+
46
45
  //Log.w('Title',Type.get_title(Type.ORDER_STATUS_NEW));
47
46
  //Log.w('Title 2',Type.get_title(Type.ORDER_STATUS_COMPLETE));
48
47
  //Log.w('Title 2',Field_Logic.get_field_value_title(Type.FIELD_VALUE_LIST,3,4,'cool'));