biz9-logic 4.8.160 → 4.8.162
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 +33 -42
- package/package.json +2 -2
- package/test.js +11 -2
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -23,11 +23,7 @@ class Item_Logic {
|
|
|
23
23
|
data_type = data_type ? data_type : DataType.BLANK;
|
|
24
24
|
id = id ? id : 0;
|
|
25
25
|
option = Field_Logic.get_option(data_type,option?option:{});
|
|
26
|
-
let item = DataItem.
|
|
27
|
-
DataItem.get_new(data_type,0),
|
|
28
|
-
DataItem.get_new(data_type,0),
|
|
29
|
-
DataItem.get_new(data_type,0),
|
|
30
|
-
Field_Logic.get_test(title,option));
|
|
26
|
+
let item = DataItem.get_new(data_type,0,Field_Logic.get_test(title,option));
|
|
31
27
|
if(option.get_item){
|
|
32
28
|
item.items = Sub_Item_Logic.get_test_list(item,item,option);
|
|
33
29
|
item = Sub_Item_Logic.bind_parent_child_list(item,item.items);
|
|
@@ -133,11 +129,7 @@ class Template_Logic {
|
|
|
133
129
|
title = "Test " + Num.get_id();
|
|
134
130
|
}
|
|
135
131
|
option = Field_Logic.get_option(DataType.TEMPLATE,option?option:{});
|
|
136
|
-
let template = DataItem.
|
|
137
|
-
DataItem.get_new(DataType.TEMPLATE,0),
|
|
138
|
-
DataItem.get_new(DataType.TEMPLATE,0),
|
|
139
|
-
DataItem.get_new(DataType.TEMPLATE,0),
|
|
140
|
-
Field_Logic.get_test(title,option));
|
|
132
|
+
let template = DataItem.get_new(DataType.TEMPLATE,0,Field_Logic.get_test(title,option));
|
|
141
133
|
if(option.get_item){
|
|
142
134
|
let title_list = ['Header','Body','Footer','Navigation']
|
|
143
135
|
//template.items = Sub_Item_Logic.get_test_list(template,template,option);
|
|
@@ -160,11 +152,7 @@ class Team_Logic {
|
|
|
160
152
|
static get_test = (title,option) =>{
|
|
161
153
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
162
154
|
option = Field_Logic.get_option(DataType.TEAM,option?option:{});
|
|
163
|
-
let team = DataItem.
|
|
164
|
-
DataItem.get_new(DataType.TEAM,0),
|
|
165
|
-
DataItem.get_new(DataType.TEAM,0),
|
|
166
|
-
DataItem.get_new(DataType.TEAM,0),
|
|
167
|
-
Field_Logic.get_test(title,option));
|
|
155
|
+
let team = DataItem.get_new(DataType.TEAM,0,Field_Logic.get_test(title,option));
|
|
168
156
|
team.members = [];
|
|
169
157
|
if(option.get_member){
|
|
170
158
|
for(let a=0;a<option.member_count+1;a++){
|
|
@@ -176,11 +164,7 @@ class Team_Logic {
|
|
|
176
164
|
static get_test_member = (team,title,option) =>{
|
|
177
165
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
178
166
|
option = Field_Logic.get_option(DataType.TEAM,option?option:{});
|
|
179
|
-
let team_member = DataItem.
|
|
180
|
-
DataItem.get_new(DataType.ITEM,0),
|
|
181
|
-
DataItem.get_new(DataType.TEAM,team.id),
|
|
182
|
-
DataItem.get_new(DataType.TEAM,team.id),
|
|
183
|
-
Field_Logic.get_test(title,option));
|
|
167
|
+
let team_member = DataItem.get_new(DataType.TEAM,team.id,Field_Logic.get_test(title,option));
|
|
184
168
|
team_member.first_name = "First Name "+ Num.get_id();
|
|
185
169
|
team_member.last_name = "Last Name "+ Num.get_id();
|
|
186
170
|
team_member.position = "Position "+ Num.get_id();
|
|
@@ -209,11 +193,7 @@ class Page_Logic {
|
|
|
209
193
|
static get_test = (title,option) =>{
|
|
210
194
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
211
195
|
option = Field_Logic.get_option(DataType.PAGE,option?option:{});
|
|
212
|
-
let page = DataItem.
|
|
213
|
-
DataItem.get_new(DataType.PAGE,0),
|
|
214
|
-
DataItem.get_new(DataType.PAGE,0),
|
|
215
|
-
DataItem.get_new(DataType.PAGE,0),
|
|
216
|
-
Field_Logic.get_test(title,option));
|
|
196
|
+
let page = DataItem.get_new(DataType.PAGE,0,Field_Logic.get_test(title,option));
|
|
217
197
|
if(option.get_section){
|
|
218
198
|
page.items = Sub_Item_Logic.get_test_section_list(page,page,option);
|
|
219
199
|
page = Sub_Item_Logic.bind_parent_child_list(page,page.items);
|
|
@@ -414,11 +394,7 @@ class Content_Logic {
|
|
|
414
394
|
static get_test = (title,option) =>{
|
|
415
395
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
416
396
|
option = Field_Logic.get_option(DataType.CONTENT,option?option:{});
|
|
417
|
-
let content = DataItem.
|
|
418
|
-
DataItem.get_new(DataType.CONTENT,0),
|
|
419
|
-
DataItem.get_new(DataType.CONTENT,0),
|
|
420
|
-
DataItem.get_new(DataType.CONTENT,0),
|
|
421
|
-
Field_Logic.get_test(title,option));
|
|
397
|
+
let content = DataItem.get_new(DataType.CONTENT,0,Field_Logic.get_test(title,option));
|
|
422
398
|
if(option.get_item){
|
|
423
399
|
content.items = Sub_Item_Logic.get_test_section_list(content,content,option);
|
|
424
400
|
if(option.get_item_bind){
|
|
@@ -456,7 +432,6 @@ class Blog_Post_Logic {
|
|
|
456
432
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
457
433
|
option = Field_Logic.get_option(DataType.BLOG_POST,option?option:{});
|
|
458
434
|
let blog_post = DataItem.get_new(DataType.BLOG_POST,0,Field_Logic.get_test(title,option));
|
|
459
|
-
|
|
460
435
|
if(!option.get_blank){
|
|
461
436
|
blog_post.author="First Name "+ Num.get_id();
|
|
462
437
|
blog_post.tag = "Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id();
|
|
@@ -577,7 +552,6 @@ class Field_Logic {
|
|
|
577
552
|
title_url:Str.get_title_url(title),
|
|
578
553
|
sub_note:"Sub Note "+String(Num.get_id()),
|
|
579
554
|
note:Field_Logic.get_test_note(),
|
|
580
|
-
view_count:0,
|
|
581
555
|
id:0,
|
|
582
556
|
date_create:new moment().toISOString(),
|
|
583
557
|
date_save:new moment().toISOString()
|
|
@@ -832,6 +806,10 @@ class FieldType {
|
|
|
832
806
|
static ORDER_PAYMENT_TYPE_CASH="Cash";
|
|
833
807
|
static ORDER_PAYMENT_TYPE_OTHER="Other";
|
|
834
808
|
static ORDER_PAYMENT_TYPE_TEST="Test";
|
|
809
|
+
|
|
810
|
+
static APP_TYPE_MOBILE="Mobile";
|
|
811
|
+
static APP_TYPE_WEBSITE="Website";
|
|
812
|
+
static APP_TYPE_LANDING="Landing";
|
|
835
813
|
}
|
|
836
814
|
class Social {
|
|
837
815
|
static FACEBOOK_URL="https://facebook.com/";
|
|
@@ -987,16 +965,14 @@ class DataType {
|
|
|
987
965
|
static TEAM='team_biz';
|
|
988
966
|
static USER='user_biz';
|
|
989
967
|
static VIDEO='video_biz';
|
|
968
|
+
|
|
969
|
+
static APP='app_biz';
|
|
990
970
|
}
|
|
991
971
|
class Blank_Logic {
|
|
992
972
|
static get_test = (title,option) =>{
|
|
993
973
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
994
974
|
option = Field_Logic.get_option(DataType.BLANK,option?option:{});
|
|
995
|
-
let blank = DataItem.
|
|
996
|
-
DataItem.get_new(DataType.BLANK,0),
|
|
997
|
-
DataItem.get_new(DataType.BLANK,0),
|
|
998
|
-
DataItem.get_new(DataType.BLANK,0),
|
|
999
|
-
Field_Logic.get_test(title,option));
|
|
975
|
+
let blank = DataItem.get_new(DataType.BLANK,0,Field_Logic.get_test(title,option));
|
|
1000
976
|
if(option.get_item){
|
|
1001
977
|
blank.items = Sub_Item_Logic.get_test_list(blank,blank,option);
|
|
1002
978
|
blank = Sub_Item_Logic.bind_parent_child_list(blank,blank.items);
|
|
@@ -1401,6 +1377,10 @@ class Service_Url {
|
|
|
1401
1377
|
};
|
|
1402
1378
|
}
|
|
1403
1379
|
class Content_Url {
|
|
1380
|
+
static portfolio = (biz9_config,params) => {
|
|
1381
|
+
let action_url="content/portfolio";
|
|
1382
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1383
|
+
};
|
|
1404
1384
|
static get = (biz9_config,key,params) => {
|
|
1405
1385
|
let action_url="content/get/"+key;
|
|
1406
1386
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
@@ -1437,6 +1417,10 @@ class Gallery_Url {
|
|
|
1437
1417
|
};
|
|
1438
1418
|
}
|
|
1439
1419
|
class User_Url {
|
|
1420
|
+
static info = (biz9_config,user_id,params) => {
|
|
1421
|
+
let action_url="user/info/"+user_id;
|
|
1422
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1423
|
+
};
|
|
1440
1424
|
static register = (biz9_config,params) => {
|
|
1441
1425
|
let action_url="user/register";
|
|
1442
1426
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
@@ -1567,11 +1551,7 @@ class Category_Logic {
|
|
|
1567
1551
|
option = Field_Logic.get_option(DataType.CATEGORY,option);
|
|
1568
1552
|
let category_list = [];
|
|
1569
1553
|
for(let a=0;a<option.category_count;a++){
|
|
1570
|
-
let category = DataItem.
|
|
1571
|
-
DataItem.get_new(DataType.CATEGORY,0),
|
|
1572
|
-
DataItem.get_new(DataType.CATEGORY,0),
|
|
1573
|
-
DataItem.get_new(DataType.CATEGORY,0),
|
|
1574
|
-
Field_Logic.get_test("Category " +String(parseInt(a+1)),option));
|
|
1554
|
+
let category = DataItem.get_new(DataType.CATEGORY,0,Field_Logic.get_test("Category " +String(parseInt(a+1)),option));
|
|
1575
1555
|
category.type = type;
|
|
1576
1556
|
category_list.push(category);
|
|
1577
1557
|
}
|
|
@@ -2026,7 +2006,18 @@ class Sub_Item_Logic {
|
|
|
2026
2006
|
return item;
|
|
2027
2007
|
}
|
|
2028
2008
|
}
|
|
2009
|
+
class App_Logic {
|
|
2010
|
+
static get_new = (title,user_id,type,option) =>{
|
|
2011
|
+
option = Field_Logic.get_option(DataType.APP,option?option:{});
|
|
2012
|
+
let app = DataItem.get_new(DataType.APP,0);
|
|
2013
|
+
app.title = title;
|
|
2014
|
+
app.user_id = user_id;
|
|
2015
|
+
app.type = type;
|
|
2016
|
+
return app;
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2029
2019
|
module.exports = {
|
|
2020
|
+
App_Logic,
|
|
2030
2021
|
Admin_Logic,
|
|
2031
2022
|
Business_Logic,
|
|
2032
2023
|
Blank_Logic,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "biz9-logic",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.162",
|
|
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.1",
|
|
13
|
-
"biz9-utility": "^3.8.
|
|
13
|
+
"biz9-utility": "^3.8.36",
|
|
14
14
|
"jest": "^29.7.0",
|
|
15
15
|
"moment": "^2.30.1"
|
|
16
16
|
},
|
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} = 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} = require('./index');
|
|
4
4
|
const {Log,Num} = require('biz9-utility');
|
|
5
5
|
const {Scriptz}= require('biz9-scriptz');
|
|
6
6
|
|
|
@@ -47,6 +47,15 @@ describe("connect", () => {
|
|
|
47
47
|
},
|
|
48
48
|
|
|
49
49
|
function(call) {
|
|
50
|
+
|
|
51
|
+
/* --APP--START */
|
|
52
|
+
let title = "Food Truck " + Num.get_id();
|
|
53
|
+
let user_id = Num.get_id();
|
|
54
|
+
let type = FieldType.APP_TYPE_MOBILE;
|
|
55
|
+
let app = App_Logic.get_new(title,user_id,type);
|
|
56
|
+
Log.w('app',app);
|
|
57
|
+
/* --APP--ENDI */
|
|
58
|
+
|
|
50
59
|
//console.log('STORAGE-START');
|
|
51
60
|
//console.log(Storage.get({},'apples'));
|
|
52
61
|
//Log.w('storage-start',Storage.set(Num.get_id()));
|
|
@@ -345,7 +354,7 @@ describe("connect", () => {
|
|
|
345
354
|
|
|
346
355
|
|
|
347
356
|
/* --FAQ--START */
|
|
348
|
-
Log.w('faq',Faq_Url.get(biz9_config,'primary'));
|
|
357
|
+
//Log.w('faq',Faq_Url.get(biz9_config,'primary'));
|
|
349
358
|
//Log.w("FAQ",Faq_Logic.get_test());
|
|
350
359
|
//Log.w("FAQ List",Faq_Logic.get_test_list(Faq_Logic.get_test({question_count:3})));
|
|
351
360
|
//let faq = Faq_Logic.get_test('Cool Quest',{question_count:2});
|