biz9-logic 4.8.243 → 4.8.247
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 +1 -1
- package/index.js +52 -118
- package/package.json +1 -1
- package/test.js +5 -5
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -451,7 +451,7 @@ class Content_Logic {
|
|
|
451
451
|
class Template_Logic {
|
|
452
452
|
static get_test = (title,option) =>{
|
|
453
453
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
454
|
-
option = Field_Logic.get_option(DataType.
|
|
454
|
+
option = Field_Logic.get_option(DataType.TEMPLATE,option?option:{});
|
|
455
455
|
let template = DataItem.get_new(DataType.TEMPLATE,0,Field_Logic.get_test(title,option));
|
|
456
456
|
return template;
|
|
457
457
|
};
|
|
@@ -497,6 +497,25 @@ class Blog_Post_Logic {
|
|
|
497
497
|
return [category_list,blog_post_list]
|
|
498
498
|
};
|
|
499
499
|
}
|
|
500
|
+
class Gallery_Logic {
|
|
501
|
+
static get_test = (title,option) =>{
|
|
502
|
+
[title,option] = Field_Logic.get_option_title(title,option);
|
|
503
|
+
option = Field_Logic.get_option(DataType.GALLERY,option?option:{});
|
|
504
|
+
let gallery = DataItem.get_new(DataType.GALLERY,0,Field_Logic.get_test(title,option));
|
|
505
|
+
if(!option.get_blank){
|
|
506
|
+
gallery.date = String(String(Num.get_id(2030)) + "-" + String(Num.get_id(13)) + "-" + String(Num.get_id(30))).trim();
|
|
507
|
+
gallery.time = String(Num.get_id(24)) + ":" + String(Num.get_id(59));
|
|
508
|
+
gallery.website = "Website "+String(Num.get_id());
|
|
509
|
+
}else{
|
|
510
|
+
gallery.website = "";
|
|
511
|
+
}
|
|
512
|
+
if(option.get_item){
|
|
513
|
+
gallery.items = Sub_Item_Logic.get_test_list(gallery,gallery,option);
|
|
514
|
+
}
|
|
515
|
+
return gallery;
|
|
516
|
+
};
|
|
517
|
+
};
|
|
518
|
+
|
|
500
519
|
class Event_Logic {
|
|
501
520
|
static get_test = (title,option) =>{
|
|
502
521
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
@@ -759,7 +778,6 @@ class Field_Logic {
|
|
|
759
778
|
|
|
760
779
|
option.user_count = req.query.user_count ? req.query.user_count : 9;
|
|
761
780
|
option.get_admin = req.query.get_admin ? req.query.get_admin : false;
|
|
762
|
-
option.get_business = req.query.get_business ? req.query.get_business : false;
|
|
763
781
|
option.get_template = req.query.get_template ? req.query.get_template : false;
|
|
764
782
|
option.get_page = req.query.get_page ? req.query.get_page : false;
|
|
765
783
|
|
|
@@ -807,7 +825,6 @@ class FieldType {
|
|
|
807
825
|
/*
|
|
808
826
|
static KEY_ADMIN="key_admin";
|
|
809
827
|
static KEY_APP_ID="key_app_id";
|
|
810
|
-
static KEY_BUSINESS="key_business";
|
|
811
828
|
static KEY_TEMPLATE="key_template";
|
|
812
829
|
static KEY_CART="key_cart";
|
|
813
830
|
static KEY_ORDER="key_order";
|
|
@@ -867,66 +884,30 @@ class PageType {
|
|
|
867
884
|
static HOME='home';
|
|
868
885
|
static ABOUT='about';
|
|
869
886
|
static CONTACT='contact';
|
|
887
|
+
static FAQ='faq';
|
|
870
888
|
|
|
871
889
|
static BLOG_POST='blog_post';
|
|
872
890
|
static BLOG_POST_DETAIL='blog_post_detail';
|
|
873
|
-
|
|
874
|
-
static CATEGORY='category';
|
|
875
|
-
static CATEGORY_DETAIL='category_detail';
|
|
891
|
+
static BLOG_POST_SEARCH='blog_post_search';
|
|
876
892
|
|
|
877
893
|
static EVENT='event';
|
|
878
894
|
static EVENT_DETAIL='event_detail';
|
|
895
|
+
static EVENT_SEARCH='event_search';
|
|
879
896
|
|
|
880
897
|
static GALLERY='gallery';
|
|
881
898
|
static GALLERY_DETAIL='gallery_detail';
|
|
899
|
+
static GALLERY_SEARCH='gallery_search';
|
|
882
900
|
|
|
883
901
|
static SERVICE='service';
|
|
884
902
|
static SERVICE_DETAIL='service_detail';
|
|
903
|
+
static SERVICE_SEARCH='service_search';
|
|
885
904
|
|
|
886
905
|
static PRODUCT='product';
|
|
887
906
|
static PRODUCT_DETAIL='product_detail';
|
|
907
|
+
static PRODUCT_SEARCH='product_search';
|
|
888
908
|
|
|
889
|
-
static
|
|
890
|
-
static PROJECT_DETAIL='project_detail';
|
|
909
|
+
static PAGE_LIST = [PageType.HOME,PageType.ABOUT,PageType.CONTACT,PageType.FAQ,PageType.BLOG_POST,PageType.EVENT,PageType.GALLERY,PageType.SERVICE,PageType.PRODUCT];
|
|
891
910
|
|
|
892
|
-
static SECTION_1='section_1';
|
|
893
|
-
static SECTION_2='section_2';
|
|
894
|
-
static SECTION_3='section_2';
|
|
895
|
-
static SECTION_4='section_4';
|
|
896
|
-
static SECTION_5='section_5';
|
|
897
|
-
static SECTION_6='section_6';
|
|
898
|
-
static SECTION_7='section_7';
|
|
899
|
-
static SECTION_8='section_8';
|
|
900
|
-
static SECTION_9='section_9';
|
|
901
|
-
static SECTION_10='section_10';
|
|
902
|
-
static SECTION_11='section_11';
|
|
903
|
-
static SECTION_12='section_12';
|
|
904
|
-
static SECTION_13='section_13';
|
|
905
|
-
static SECTION_14='section_14';
|
|
906
|
-
static SECTION_15='section_15';
|
|
907
|
-
static SECTION_16='section_16';
|
|
908
|
-
static SECTION_17='section_17';
|
|
909
|
-
static SECTION_18='section_18';
|
|
910
|
-
static SECTION_19='section_19';
|
|
911
|
-
static VALUE_1='value_1';
|
|
912
|
-
static VALUE_2='value_2';
|
|
913
|
-
static VALUE_3='value_2';
|
|
914
|
-
static VALUE_4='value_4';
|
|
915
|
-
static VALUE_5='value_5';
|
|
916
|
-
static VALUE_6='value_6';
|
|
917
|
-
static VALUE_7='value_7';
|
|
918
|
-
static VALUE_8='value_8';
|
|
919
|
-
static VALUE_9='value_9';
|
|
920
|
-
static VALUE_10='value_10';
|
|
921
|
-
static VALUE_11='value_11';
|
|
922
|
-
static VALUE_12='value_12';
|
|
923
|
-
static VALUE_13='value_13';
|
|
924
|
-
static VALUE_14='value_14';
|
|
925
|
-
static VALUE_15='value_15';
|
|
926
|
-
static VALUE_16='value_16';
|
|
927
|
-
static VALUE_17='value_17';
|
|
928
|
-
static VALUE_18='value_18';
|
|
929
|
-
static VALUE_19='value_19';
|
|
930
911
|
static get_title = (data_type) => {
|
|
931
912
|
if(!data_type){
|
|
932
913
|
return "";
|
|
@@ -944,7 +925,6 @@ class DataType {
|
|
|
944
925
|
static ACTIVITY='activity_biz';
|
|
945
926
|
static APP='app_biz';
|
|
946
927
|
static BLANK='blank_biz';
|
|
947
|
-
static BUSINESS='business_biz';
|
|
948
928
|
static BLOG_POST='blog_post_biz';
|
|
949
929
|
static CART_ITEM="cart_item_biz";
|
|
950
930
|
static CATEGORY='category_biz';
|
|
@@ -966,7 +946,6 @@ class DataType {
|
|
|
966
946
|
static ORDER_SUB_ITEM="order_sub_item_biz";
|
|
967
947
|
static ORDER_PAYMENT="order_payment_biz";
|
|
968
948
|
|
|
969
|
-
static PROJECT='project_biz';
|
|
970
949
|
static PRODUCT='product_biz';
|
|
971
950
|
static PHOTO='photo_biz';
|
|
972
951
|
static PAGE='page_biz';
|
|
@@ -1028,8 +1007,6 @@ class DataType {
|
|
|
1028
1007
|
return 'content';
|
|
1029
1008
|
case DataType.ITEM:
|
|
1030
1009
|
return 'item';
|
|
1031
|
-
case DataType.BUSINESS:
|
|
1032
|
-
return 'business';
|
|
1033
1010
|
case DataType.CUSTOM_FIELD:
|
|
1034
1011
|
return 'custom_field';
|
|
1035
1012
|
}
|
|
@@ -1244,73 +1221,6 @@ class Admin_Logic {
|
|
|
1244
1221
|
return admin.address_1 + " "+ admin.address_2 + " " + admin.city + " " + admin.state + " " + admin.zip;
|
|
1245
1222
|
}
|
|
1246
1223
|
}
|
|
1247
|
-
class Business_Logic {
|
|
1248
|
-
static get_new = (title,option) =>{
|
|
1249
|
-
[title,option] = Field_Logic.get_option_title(title,option);
|
|
1250
|
-
return DataItem.get_new_full_item(
|
|
1251
|
-
DataItem.get_new(DataType.BUSINESS,0),
|
|
1252
|
-
DataItem.get_new(DataType.BUSINESS,0),
|
|
1253
|
-
DataItem.get_new(DataType.BUSINESS,0),{
|
|
1254
|
-
title:title,
|
|
1255
|
-
email:"",
|
|
1256
|
-
phone:"",
|
|
1257
|
-
address_1:"",
|
|
1258
|
-
address_2:"",
|
|
1259
|
-
city:"",
|
|
1260
|
-
state:"",
|
|
1261
|
-
zip:"",
|
|
1262
|
-
website:"",
|
|
1263
|
-
youtube:"",
|
|
1264
|
-
instagram:"",
|
|
1265
|
-
facebook:"",
|
|
1266
|
-
twitter:""
|
|
1267
|
-
});
|
|
1268
|
-
};
|
|
1269
|
-
static get_test = (title,option) =>{
|
|
1270
|
-
[title,option] = Field_Logic.get_option_title(title,option);
|
|
1271
|
-
option = Field_Logic.get_option(DataType.BUSINESS,option?option:{});
|
|
1272
|
-
let item = DataItem.get_new(DataType.BUSINESS,0);
|
|
1273
|
-
let city_list = ["Miami","Atlanta","Chicago","Seattle","New York City"];
|
|
1274
|
-
let state_list = ["Georgia","New York","Illinois","Washington","Flordia"];
|
|
1275
|
-
let business = DataItem.get_new(DataType.BUSINESS,0,Field_Logic.get_test(title,option));
|
|
1276
|
-
if(!option.get_blank){
|
|
1277
|
-
business.email="ceo@business"+Num.get_id()+".com";
|
|
1278
|
-
business.phone=Num.get_id(parseInt(777+100)) + "-" + Num.get_id(parseInt(777+100)) + "-"+Num.get_id(parseInt(7777+1000));
|
|
1279
|
-
business.address_1=Num.get_id(99)+" Main St.";
|
|
1280
|
-
business.address_2="PO "+Num.get_id(99);
|
|
1281
|
-
business.city=city_list[Num.get_id(city_list.length-1)];
|
|
1282
|
-
business.state=state_list[Num.get_id(state_list.length-1)];
|
|
1283
|
-
business.zip=Num.get_id(parseInt(77777+1000));
|
|
1284
|
-
business.website="website_" + Num.get_id(9999);
|
|
1285
|
-
business.youtube="youtube_"+Num.get_id(9999);
|
|
1286
|
-
business.instagram="instagram_"+Num.get_id(9999);
|
|
1287
|
-
business.facebook="facebook_"+Num.get_id(9999);
|
|
1288
|
-
business.twitter="twitter_"+Num.get_id(9999);
|
|
1289
|
-
}else{
|
|
1290
|
-
business.email="";
|
|
1291
|
-
business.phone="";
|
|
1292
|
-
business.address_1="";
|
|
1293
|
-
business.address_2="";
|
|
1294
|
-
business.city="";
|
|
1295
|
-
business.state="";
|
|
1296
|
-
business.zip="";
|
|
1297
|
-
business.website="";
|
|
1298
|
-
business.youtube="";
|
|
1299
|
-
business.instagram="";
|
|
1300
|
-
business.facebook="";
|
|
1301
|
-
business.twitter="";
|
|
1302
|
-
}
|
|
1303
|
-
return business;
|
|
1304
|
-
};
|
|
1305
|
-
static get_full_address(business){
|
|
1306
|
-
business.address_1 = (business.address_1) ? business.address_1 : "";
|
|
1307
|
-
business.address_2 = (business.address_2) ? business.address_2 : "";
|
|
1308
|
-
business.city = (business.city) ? business.city : "";
|
|
1309
|
-
business.state = (business.state) ? business.state : "";
|
|
1310
|
-
business.zip = (business.zip) ? business.zip : "";
|
|
1311
|
-
return business.address_1 + " "+ business.address_2 + " " + business.city + " " + business.state + " " + business.zip;
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
1224
|
class DataItem {
|
|
1315
1225
|
static get_new = (data_type,id,option) => {
|
|
1316
1226
|
return get_new_item_main(data_type,id,option?option:{});
|
|
@@ -1334,6 +1244,10 @@ class Blog_Post_Url {
|
|
|
1334
1244
|
let action_url="blog_post/get/"+key;
|
|
1335
1245
|
return get_cloud_url_main(app_id,url,action_url,params);
|
|
1336
1246
|
};
|
|
1247
|
+
static home = (app_id,url,params) => {
|
|
1248
|
+
let action_url="blog_post";
|
|
1249
|
+
return get_cloud_url_main(app_id,url,action_url,params);
|
|
1250
|
+
};
|
|
1337
1251
|
static search = (app_id,url,params) => {
|
|
1338
1252
|
let action_url="blog_post/search";
|
|
1339
1253
|
return get_cloud_url_main(app_id,url,action_url,params);
|
|
@@ -1372,6 +1286,10 @@ class Product_Url {
|
|
|
1372
1286
|
let action_url="product/get/"+key;
|
|
1373
1287
|
return get_cloud_url_main(app_id,url,action_url,params);
|
|
1374
1288
|
};
|
|
1289
|
+
static home = (app_id,url,params) => {
|
|
1290
|
+
let action_url="product";
|
|
1291
|
+
return get_cloud_url_main(app_id,url,action_url,params);
|
|
1292
|
+
};
|
|
1375
1293
|
static search = (app_id,url,params) => {
|
|
1376
1294
|
let action_url="product/search";
|
|
1377
1295
|
return get_cloud_url_main(app_id,url,action_url,params);
|
|
@@ -1382,6 +1300,10 @@ class Event_Url {
|
|
|
1382
1300
|
let action_url="event/get/"+key;
|
|
1383
1301
|
return get_cloud_url_main(app_id,url,action_url,params);
|
|
1384
1302
|
};
|
|
1303
|
+
static home = (app_id,url,params) => {
|
|
1304
|
+
let action_url="event";
|
|
1305
|
+
return get_cloud_url_main(app_id,url,action_url,params);
|
|
1306
|
+
};
|
|
1385
1307
|
static search = (app_id,url,params) => {
|
|
1386
1308
|
let action_url="event/search";
|
|
1387
1309
|
return get_cloud_url_main(app_id,url,action_url,params);
|
|
@@ -1392,6 +1314,10 @@ class Service_Url {
|
|
|
1392
1314
|
let action_url="service/get/"+key;
|
|
1393
1315
|
return get_cloud_url_main(app_id,url,action_url,params);
|
|
1394
1316
|
};
|
|
1317
|
+
static home = (app_id,url,params) => {
|
|
1318
|
+
let action_url="service/search";
|
|
1319
|
+
return get_cloud_url_main(app_id,url,action_url,params);
|
|
1320
|
+
};
|
|
1395
1321
|
static search = (app_id,url,params) => {
|
|
1396
1322
|
let action_url="service/search";
|
|
1397
1323
|
return get_cloud_url_main(app_id,url,action_url,params);
|
|
@@ -1402,6 +1328,10 @@ class Gallery_Url {
|
|
|
1402
1328
|
let action_url="gallery/get/"+key;
|
|
1403
1329
|
return get_cloud_url_main(app_id,url,action_url,params);
|
|
1404
1330
|
};
|
|
1331
|
+
static home = (app_id,url,params) => {
|
|
1332
|
+
let action_url="gallery";
|
|
1333
|
+
return get_cloud_url_main(app_id,url,action_url,params);
|
|
1334
|
+
};
|
|
1405
1335
|
static search = (app_id,url,params) => {
|
|
1406
1336
|
let action_url="gallery/search";
|
|
1407
1337
|
return get_cloud_url_main(app_id,url,action_url,params);
|
|
@@ -1460,6 +1390,10 @@ class Category_Url {
|
|
|
1460
1390
|
let action_url="category/get/"+key;
|
|
1461
1391
|
return get_cloud_url_main(app_id,url,action_url,params);
|
|
1462
1392
|
};
|
|
1393
|
+
static home = (app_id,url,params) => {
|
|
1394
|
+
let action_url="category";
|
|
1395
|
+
return get_cloud_url_main(app_id,url,action_url,params);
|
|
1396
|
+
};
|
|
1463
1397
|
static search = (app_id,url,params) => {
|
|
1464
1398
|
let action_url="category/search";
|
|
1465
1399
|
return get_cloud_url_main(app_id,url,action_url,params);
|
|
@@ -2036,7 +1970,6 @@ class App_Logic {
|
|
|
2036
1970
|
module.exports = {
|
|
2037
1971
|
App_Logic,
|
|
2038
1972
|
Admin_Logic,
|
|
2039
|
-
Business_Logic,
|
|
2040
1973
|
Blank_Logic,
|
|
2041
1974
|
Blog_Post_Logic,
|
|
2042
1975
|
Blog_Post_Url,
|
|
@@ -2054,6 +1987,7 @@ module.exports = {
|
|
|
2054
1987
|
FieldType,
|
|
2055
1988
|
Faq_Logic,
|
|
2056
1989
|
Favorite_Logic,
|
|
1990
|
+
Gallery_Logic,
|
|
2057
1991
|
Gallery_Url,
|
|
2058
1992
|
Item_Logic,
|
|
2059
1993
|
Item_Url,
|
package/package.json
CHANGED
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,BiZ_Url,Cat,Stock,Schedule,Storage,Business,Product,Service,Event,Template,Page,Category,Review,Blog_Post,Faq_Logic,Category_Url,Blank_Url,Blank_Logic,Item_Logic,Service_Logic,Template_Logic,Page_Logic,Product_Logic,Event_Logic,Blog_Post_Logic,Content_Logic,Category_Logic,Team_Logic,Business_Logic,PageType,Sub_Item_Logic,Page_Url,Review_Logic,User_Logic,Field_Logic,Order_Logic,Cart_Logic,Faq_Url,App_Logic,FieldType,Product_Url} = require('./index');
|
|
3
|
+
const {DataItem,DataType,Url,Obj,BiZ_Url,Cat,Stock,Schedule,Storage,Business,Product,Service,Event,Template,Page,Category,Review,Blog_Post,Faq_Logic,Category_Url,Blank_Url,Blank_Logic,Item_Logic,Service_Logic,Template_Logic,Page_Logic,Product_Logic,Event_Logic,Blog_Post_Logic,Content_Logic,Category_Logic,Team_Logic,Business_Logic,PageType,Sub_Item_Logic,Page_Url,Review_Logic,User_Logic,Field_Logic,Order_Logic,Cart_Logic,Faq_Url,App_Logic,FieldType,Product_Url,Gallery_Logic} = require('./index');
|
|
4
4
|
const {Log,Num} = require('biz9-utility');
|
|
5
5
|
const {Scriptz}= require('biz9-scriptz');
|
|
6
6
|
|
|
@@ -31,10 +31,10 @@ describe("connect", () => {
|
|
|
31
31
|
series([
|
|
32
32
|
|
|
33
33
|
function(call) {
|
|
34
|
-
console.log('
|
|
35
|
-
let
|
|
36
|
-
console.log(
|
|
37
|
-
console.log('
|
|
34
|
+
console.log('ITEM-START');
|
|
35
|
+
let gallery = Gallery_Logic.get_test('Gallery 1',{get_blank:true});
|
|
36
|
+
console.log(gallery);
|
|
37
|
+
console.log('ITEM-END');
|
|
38
38
|
//let page = Page_Logic.get_test();
|
|
39
39
|
//page[Page_Logic.get_page_value_field_title(FieldType.PAGE_VALUE_FIELD_TYPE_TEXT,1)] = 'apple';
|
|
40
40
|
//page[Page_Logic.get_page_value_field_title('list',1,1)] = 'cool';
|