biz9-logic 3.5.39 → 3.5.43
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 +122 -53
- package/package.json +1 -1
- package/test.js +16 -11
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -15,6 +15,65 @@ class Message {
|
|
|
15
15
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
class TemplateType {
|
|
19
|
+
|
|
20
|
+
static Primary='primary';
|
|
21
|
+
static Header='header';
|
|
22
|
+
static Navigation='navigation';
|
|
23
|
+
static BODY='body';
|
|
24
|
+
static FOOTER='footer';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
class PageType {
|
|
28
|
+
|
|
29
|
+
static HOME='home';
|
|
30
|
+
static ABOUT='about';
|
|
31
|
+
static CONTACT='contact';
|
|
32
|
+
static SERVICE='service';
|
|
33
|
+
static PRODUCT='product';
|
|
34
|
+
static TEAM='team';
|
|
35
|
+
|
|
36
|
+
static SECTION_1='section_1';
|
|
37
|
+
static SECTION_2='section_2';
|
|
38
|
+
static SECTION_3='section_2';
|
|
39
|
+
static SECTION_4='section_4';
|
|
40
|
+
static SECTION_5='section_5';
|
|
41
|
+
static SECTION_6='section_6';
|
|
42
|
+
static SECTION_7='section_7';
|
|
43
|
+
static SECTION_8='section_8';
|
|
44
|
+
static SECTION_9='section_9';
|
|
45
|
+
static SECTION_10='section_10';
|
|
46
|
+
static SECTION_11='section_11';
|
|
47
|
+
static SECTION_12='section_12';
|
|
48
|
+
static SECTION_13='section_13';
|
|
49
|
+
static SECTION_14='section_14';
|
|
50
|
+
static SECTION_15='section_15';
|
|
51
|
+
static SECTION_16='section_16';
|
|
52
|
+
static SECTION_17='section_17';
|
|
53
|
+
static SECTION_18='section_18';
|
|
54
|
+
static SECTION_19='section_19';
|
|
55
|
+
|
|
56
|
+
static VALUE_1='value_1';
|
|
57
|
+
static VALUE_2='value_2';
|
|
58
|
+
static VALUE_3='value_2';
|
|
59
|
+
static VALUE_4='value_4';
|
|
60
|
+
static VALUE_5='value_5';
|
|
61
|
+
static VALUE_6='value_6';
|
|
62
|
+
static VALUE_7='value_7';
|
|
63
|
+
static VALUE_8='value_8';
|
|
64
|
+
static VALUE_9='value_9';
|
|
65
|
+
static VALUE_10='value_10';
|
|
66
|
+
static VALUE_11='value_11';
|
|
67
|
+
static VALUE_12='value_12';
|
|
68
|
+
static VALUE_13='value_13';
|
|
69
|
+
static VALUE_14='value_14';
|
|
70
|
+
static VALUE_15='value_15';
|
|
71
|
+
static VALUE_16='value_16';
|
|
72
|
+
static VALUE_17='value_17';
|
|
73
|
+
static VALUE_18='value_18';
|
|
74
|
+
static VALUE_19='value_19';
|
|
75
|
+
}
|
|
76
|
+
|
|
18
77
|
class DataType {
|
|
19
78
|
|
|
20
79
|
static get_title = (data_type) => {
|
|
@@ -25,29 +84,30 @@ class DataType {
|
|
|
25
84
|
}
|
|
26
85
|
}
|
|
27
86
|
|
|
28
|
-
static
|
|
29
|
-
static
|
|
30
|
-
static
|
|
31
|
-
static
|
|
32
|
-
static
|
|
33
|
-
static
|
|
34
|
-
static
|
|
35
|
-
static
|
|
36
|
-
static
|
|
37
|
-
static
|
|
38
|
-
static
|
|
39
|
-
static
|
|
40
|
-
static
|
|
41
|
-
static
|
|
42
|
-
static
|
|
43
|
-
static
|
|
44
|
-
static
|
|
45
|
-
static
|
|
46
|
-
static
|
|
47
|
-
static
|
|
48
|
-
static
|
|
49
|
-
static
|
|
87
|
+
static ADMIN='admin_biz';
|
|
88
|
+
static BLANK='blank_biz';
|
|
89
|
+
static BUSINESS='business_biz';
|
|
90
|
+
static BLOG_POST='blog_post_biz';
|
|
91
|
+
static CART_ITEM="cart_item_biz";
|
|
92
|
+
static CATEGORY='category_biz';
|
|
93
|
+
static CONTENT='content_biz';
|
|
94
|
+
static EVENT='event_biz';
|
|
95
|
+
static GALLERY='gallery_biz';
|
|
96
|
+
static ITEM_MAP='item_map_biz';
|
|
97
|
+
static ITEM='item_biz';
|
|
98
|
+
static ORDER="order_biz";
|
|
99
|
+
static ORDER_ITEM="order_item_biz";
|
|
100
|
+
static PROJECT='project_biz';
|
|
101
|
+
static PRODUCT='product_biz';
|
|
102
|
+
static PHOTO='photo_biz';
|
|
103
|
+
static PAGE='page_biz';
|
|
104
|
+
static REVIEW='review_biz';
|
|
105
|
+
static SERVICE='service_biz';
|
|
106
|
+
static TEMPLATE='template_biz';
|
|
107
|
+
static USER='user_biz';
|
|
108
|
+
static VIDEO='video_biz';
|
|
50
109
|
}
|
|
110
|
+
|
|
51
111
|
class DataItem {
|
|
52
112
|
|
|
53
113
|
static get_new = (data_type,id) => {
|
|
@@ -84,8 +144,8 @@ class BiZ_Url {
|
|
|
84
144
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
85
145
|
};
|
|
86
146
|
|
|
87
|
-
static get_page=(biz9_config,
|
|
88
|
-
let action_url= "main/biz_item/get_page/"+
|
|
147
|
+
static get_page=(biz9_config,title_url)=>{
|
|
148
|
+
let action_url= "main/biz_item/get_page/"+title_url;
|
|
89
149
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
90
150
|
};
|
|
91
151
|
|
|
@@ -95,6 +155,7 @@ class BiZ_Url {
|
|
|
95
155
|
};
|
|
96
156
|
|
|
97
157
|
}
|
|
158
|
+
|
|
98
159
|
class Url {
|
|
99
160
|
|
|
100
161
|
static get = (biz9_config,action_url,params)=>{
|
|
@@ -116,6 +177,11 @@ class Url {
|
|
|
116
177
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
117
178
|
};
|
|
118
179
|
|
|
180
|
+
static update_delete_cache_item = (biz9_config,data_type,id) => {
|
|
181
|
+
let action_url= "main/crud/update_delete_cache/"+data_type + "/" + id;
|
|
182
|
+
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
183
|
+
};
|
|
184
|
+
|
|
119
185
|
static get_item = (biz9_config,data_type,id) => {
|
|
120
186
|
let action_url= "main/crud/get/"+data_type + "/" + id;
|
|
121
187
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
@@ -157,6 +223,7 @@ class Url {
|
|
|
157
223
|
};
|
|
158
224
|
|
|
159
225
|
}
|
|
226
|
+
|
|
160
227
|
class Obj {
|
|
161
228
|
|
|
162
229
|
static get_filter = (biz9_config,data_type,filter,sort_by,page_current,page_size)=>{
|
|
@@ -164,6 +231,7 @@ class Obj {
|
|
|
164
231
|
}
|
|
165
232
|
|
|
166
233
|
};
|
|
234
|
+
|
|
167
235
|
class Cat {
|
|
168
236
|
|
|
169
237
|
static get_category_drop_down_list_by_list = (cat_list) => {
|
|
@@ -177,48 +245,48 @@ class Cat {
|
|
|
177
245
|
static get_category_list = () => {
|
|
178
246
|
return [
|
|
179
247
|
{ value: DataType.BLOG_POST, label: "Blog Posts" },
|
|
180
|
-
{ value: DataType.
|
|
181
|
-
{ value: DataType.
|
|
182
|
-
{ value: DataType.
|
|
183
|
-
{ value: DataType.
|
|
184
|
-
{ value: DataType.
|
|
185
|
-
{ value: DataType.
|
|
248
|
+
{ value: DataType.CONTENT, label: "Content" },
|
|
249
|
+
{ value: DataType.EVENT, label: "Events" },
|
|
250
|
+
{ value: DataType.GALLERY, label: "Galleries" },
|
|
251
|
+
{ value: DataType.SERVICE, label: "Services" },
|
|
252
|
+
{ value: DataType.PRODUCT, label: "Products" },
|
|
253
|
+
{ value: DataType.TEMPLATE, label: "Template" }
|
|
186
254
|
];
|
|
187
255
|
};
|
|
188
256
|
|
|
189
257
|
static get_title_by_type = (data_type) => {
|
|
190
258
|
switch (data_type) {
|
|
191
|
-
case DataType.
|
|
259
|
+
case DataType.EVENT:
|
|
192
260
|
return "Event";
|
|
193
261
|
break;
|
|
194
|
-
case DataType.
|
|
262
|
+
case DataType.GALLERY:
|
|
195
263
|
return "Gallery";
|
|
196
264
|
break;
|
|
197
|
-
case DataType.
|
|
265
|
+
case DataType.PRODUCT:
|
|
198
266
|
return "Product";
|
|
199
267
|
break;
|
|
200
|
-
case DataType.
|
|
268
|
+
case DataType.SERVICE:
|
|
201
269
|
return "Service";
|
|
202
270
|
break;
|
|
203
|
-
case DataType.
|
|
271
|
+
case DataType.EVENT:
|
|
204
272
|
return "Event";
|
|
205
273
|
break;
|
|
206
|
-
case DataType.
|
|
274
|
+
case DataType.PRODUCT:
|
|
207
275
|
return "Product";
|
|
208
276
|
break;
|
|
209
|
-
case DataType.
|
|
277
|
+
case DataType.SERVICE:
|
|
210
278
|
return "Service";
|
|
211
279
|
break;
|
|
212
|
-
case DataType.
|
|
280
|
+
case DataType.CATEGORY:
|
|
213
281
|
return "Category";
|
|
214
282
|
break;
|
|
215
|
-
case DataType.
|
|
283
|
+
case DataType.BLOG_POST:
|
|
216
284
|
return "Blog Post";
|
|
217
285
|
break;
|
|
218
|
-
case DataType.
|
|
286
|
+
case DataType.TEMPLATE:
|
|
219
287
|
return "Template";
|
|
220
288
|
break;
|
|
221
|
-
case DataType.
|
|
289
|
+
case DataType.CONTENT:
|
|
222
290
|
return "Content";
|
|
223
291
|
break;
|
|
224
292
|
default:
|
|
@@ -241,25 +309,25 @@ class CMS {
|
|
|
241
309
|
|
|
242
310
|
return {
|
|
243
311
|
id: item.id ? item.id : 0,
|
|
244
|
-
data_type:item.data_type ? item.data_type : DataType.
|
|
312
|
+
data_type:item.data_type ? item.data_type : DataType.BLANK,
|
|
245
313
|
|
|
246
314
|
parent_id:item.parent_id ? item.parent_id : 0,
|
|
247
|
-
parent_data_type:item.parent_data_type ? item.parent_data_type : DataType.
|
|
315
|
+
parent_data_type:item.parent_data_type ? item.parent_data_type : DataType.BLANK,
|
|
248
316
|
|
|
249
317
|
top_id:item.top_id ? item.top_id : 0,
|
|
250
|
-
top_data_type:item.top_data_type ? item.top_data_type : DataType.
|
|
318
|
+
top_data_type:item.top_data_type ? item.top_data_type : DataType.BLANK
|
|
251
319
|
}
|
|
252
320
|
};
|
|
253
321
|
|
|
254
322
|
static get_new_query_item = (item,parent_item,top_item) => {
|
|
255
323
|
return {
|
|
256
324
|
id: item.id ? item.id : 0,
|
|
257
|
-
data_type:item.data_type ? item.data_type : DataType.
|
|
325
|
+
data_type:item.data_type ? item.data_type : DataType.BLANK,
|
|
258
326
|
parent_id:parent_item.id ? parent_item.id : 0,
|
|
259
|
-
parent_data_type:parent_item.data_type ? parent_item.data_type : DataType.
|
|
327
|
+
parent_data_type:parent_item.data_type ? parent_item.data_type : DataType.BLANK,
|
|
260
328
|
|
|
261
329
|
top_id:top_item.id ? top_item.id : 0,
|
|
262
|
-
top_data_type:top_item.data_type ? top_item.data_type : DataType.
|
|
330
|
+
top_data_type:top_item.data_type ? top_item.data_type : DataType.BLANK
|
|
263
331
|
}
|
|
264
332
|
};
|
|
265
333
|
|
|
@@ -268,27 +336,27 @@ class CMS {
|
|
|
268
336
|
};
|
|
269
337
|
|
|
270
338
|
static get_query_item_by_page = (item) => {
|
|
271
|
-
return { id:item.id ? item.id : 0, data_type:item.data_type ? item.data_type : DataType.
|
|
339
|
+
return { id:item.id ? item.id : 0, data_type:item.data_type ? item.data_type : DataType.BLANK };
|
|
272
340
|
};
|
|
273
341
|
|
|
274
342
|
static get_query_parent_item_by_page = (parent_item) => {
|
|
275
|
-
return { id:parent_item.id ? parent_item.id : 0, data_type:parent_item.data_type ? parent_item.data_type : DataType.
|
|
343
|
+
return { id:parent_item.id ? parent_item.id : 0, data_type:parent_item.data_type ? parent_item.data_type : DataType.BLANK };
|
|
276
344
|
};
|
|
277
345
|
|
|
278
346
|
static get_query_top_item_by_page = (top_item) => {
|
|
279
|
-
return { id:top_item.id ? top_item.id : 0, data_type:top_item.data_type ? top_item.data_type : DataType.
|
|
347
|
+
return { id:top_item.id ? top_item.id : 0, data_type:top_item.data_type ? top_item.data_type : DataType.BLANK };
|
|
280
348
|
};
|
|
281
349
|
|
|
282
350
|
static get_query_item_by_query = (query) => {
|
|
283
|
-
return { id:query.get('id') ? query.get('id') : 0, data_type:query.get('data_type') ? query.get('data_type') : DataType.
|
|
351
|
+
return { id:query.get('id') ? query.get('id') : 0, data_type:query.get('data_type') ? query.get('data_type') : DataType.BLANK } ;
|
|
284
352
|
};
|
|
285
353
|
|
|
286
354
|
static get_query_parent_item_by_query = (query) => {
|
|
287
|
-
return { id:query.get('parent_id') ? query.get('parent_id') : 0, data_type:query.get('parent_data_type') ? query.get('parent_data_type') : DataType.
|
|
355
|
+
return { id:query.get('parent_id') ? query.get('parent_id') : 0, data_type:query.get('parent_data_type') ? query.get('parent_data_type') : DataType.BLANK } ;
|
|
288
356
|
|
|
289
357
|
};
|
|
290
358
|
static get_query_top_item_by_query = (query) => {
|
|
291
|
-
return { id:query.get('top_id') ? query.get('top_id') : 0, data_type:query.get('top_data_type') ? query.get('top_data_type') : DataType.
|
|
359
|
+
return { id:query.get('top_id') ? query.get('top_id') : 0, data_type:query.get('top_data_type') ? query.get('top_data_type') : DataType.BLANK } ;
|
|
292
360
|
};
|
|
293
361
|
|
|
294
362
|
static get_sub_page_title = (title) => {
|
|
@@ -490,6 +558,7 @@ module.exports = {
|
|
|
490
558
|
CMS,
|
|
491
559
|
DataItem,
|
|
492
560
|
DataType,
|
|
561
|
+
PageType,
|
|
493
562
|
Message,
|
|
494
563
|
Obj,
|
|
495
564
|
Storage,
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -28,6 +28,22 @@ const biz9_config ={
|
|
|
28
28
|
describe("connect", () => {
|
|
29
29
|
it("_connect", () => {
|
|
30
30
|
series([
|
|
31
|
+
|
|
32
|
+
function(call) {
|
|
33
|
+
console.log('GET-BiZ-Url-Item-Get-Item-START');
|
|
34
|
+
let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
|
|
35
|
+
let item = DataItem.get_new(DataType.DT_BLANK,0);
|
|
36
|
+
Log.w('item',item);
|
|
37
|
+
//let cloud_url = BiZ_Url.get_item(biz9_config,item.data_type,item.id);
|
|
38
|
+
let title_url = 'primary';
|
|
39
|
+
//let cloud_url = BiZ_Url.get_template(biz9_config,title_url);
|
|
40
|
+
let cloud_url = BiZ_Url.get_page(biz9_config,title_url);
|
|
41
|
+
Log.w('connect_url',cloud_url);
|
|
42
|
+
console.log('GET-BiZ-Url-Item-Get-Item-SUCCESS');
|
|
43
|
+
//call()
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
|
|
31
47
|
function(call) {
|
|
32
48
|
console.log('GET_START_STORAGE-START');
|
|
33
49
|
Log.w('storage-start',Storage.set(Number.get_id()));
|
|
@@ -118,17 +134,6 @@ describe("connect", () => {
|
|
|
118
134
|
},
|
|
119
135
|
|
|
120
136
|
|
|
121
|
-
function(call) {
|
|
122
|
-
console.log('GET-BiZ-Url-Item-Get-Item-START');
|
|
123
|
-
let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
|
|
124
|
-
let item = DataItem.get_new(DataType.DT_BLANK,0);
|
|
125
|
-
Log.w('item',item);
|
|
126
|
-
let cloud_url = BiZ_Url.get_item(biz9_config,item.data_type,item.id);
|
|
127
|
-
Log.w('connect_url',cloud_url);
|
|
128
|
-
console.log('GET-BiZ-Url-Item-Get-Item-SUCCESS');
|
|
129
|
-
//call()
|
|
130
|
-
},
|
|
131
|
-
|
|
132
137
|
|
|
133
138
|
|
|
134
139
|
function(call) {
|