biz9-logic 3.5.39 → 3.5.40

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 (4) hide show
  1. package/biz9_config +1 -1
  2. package/index.js +117 -53
  3. package/package.json +1 -1
  4. package/test.js +16 -11
package/biz9_config CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='3.8.9'
1
+ VERSION='3.9.0'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
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 DT_ADMIN='admin_biz';
29
- static DT_BLANK='blank_biz';
30
- static DT_BUSINESS='business_biz';
31
- static DT_BLOG_POST='blog_post_biz';
32
- static DT_CART_ITEM="cart_item_biz";
33
- static DT_CATEGORY='category_biz';
34
- static DT_CONTENT='content_biz';
35
- static DT_EVENT='event_biz';
36
- static DT_GALLERY='gallery_biz';
37
- static DT_ITEM_MAP='item_map_biz';
38
- static DT_ITEM='item_biz';
39
- static DT_ORDER="order_biz";
40
- static DT_ORDER_ITEM="order_item_biz";
41
- static DT_PROJECT='project_biz';
42
- static DT_PRODUCT='product_biz';
43
- static DT_PHOTO='photo_biz';
44
- static DT_PAGE='page_biz';
45
- static DT_REVIEW='review_biz';
46
- static DT_SERVICE='service_biz';
47
- static DT_TEMPLATE='template_biz';
48
- static DT_USER='user_biz';
49
- static DT_VIDEO='video_biz';
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,data_type,title_url)=>{
88
- let action_url= "main/biz_item/get_page/"+data_type+"/"+title_url;
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)=>{
@@ -157,6 +218,7 @@ class Url {
157
218
  };
158
219
 
159
220
  }
221
+
160
222
  class Obj {
161
223
 
162
224
  static get_filter = (biz9_config,data_type,filter,sort_by,page_current,page_size)=>{
@@ -164,6 +226,7 @@ class Obj {
164
226
  }
165
227
 
166
228
  };
229
+
167
230
  class Cat {
168
231
 
169
232
  static get_category_drop_down_list_by_list = (cat_list) => {
@@ -177,48 +240,48 @@ class Cat {
177
240
  static get_category_list = () => {
178
241
  return [
179
242
  { value: DataType.BLOG_POST, label: "Blog Posts" },
180
- { value: DataType.DT_CONTENT, label: "Content" },
181
- { value: DataType.DT_EVENT, label: "Events" },
182
- { value: DataType.DT_GALLERY, label: "Galleries" },
183
- { value: DataType.DT_SERVICE, label: "Services" },
184
- { value: DataType.DT_PRODUCT, label: "Products" },
185
- { value: DataType.DT_TEMPLATE, label: "Template" }
243
+ { value: DataType.CONTENT, label: "Content" },
244
+ { value: DataType.EVENT, label: "Events" },
245
+ { value: DataType.GALLERY, label: "Galleries" },
246
+ { value: DataType.SERVICE, label: "Services" },
247
+ { value: DataType.PRODUCT, label: "Products" },
248
+ { value: DataType.TEMPLATE, label: "Template" }
186
249
  ];
187
250
  };
188
251
 
189
252
  static get_title_by_type = (data_type) => {
190
253
  switch (data_type) {
191
- case DataType.DT_EVENT:
254
+ case DataType.EVENT:
192
255
  return "Event";
193
256
  break;
194
- case DataType.DT_GALLERY:
257
+ case DataType.GALLERY:
195
258
  return "Gallery";
196
259
  break;
197
- case DataType.DT_PRODUCT:
260
+ case DataType.PRODUCT:
198
261
  return "Product";
199
262
  break;
200
- case DataType.DT_SERVICE:
263
+ case DataType.SERVICE:
201
264
  return "Service";
202
265
  break;
203
- case DataType.DT_EVENT:
266
+ case DataType.EVENT:
204
267
  return "Event";
205
268
  break;
206
- case DataType.DT_PRODUCT:
269
+ case DataType.PRODUCT:
207
270
  return "Product";
208
271
  break;
209
- case DataType.DT_SERVICE:
272
+ case DataType.SERVICE:
210
273
  return "Service";
211
274
  break;
212
- case DataType.DT_CATEGORY:
275
+ case DataType.CATEGORY:
213
276
  return "Category";
214
277
  break;
215
- case DataType.DT_BLOG_POST:
278
+ case DataType.BLOG_POST:
216
279
  return "Blog Post";
217
280
  break;
218
- case DataType.DT_TEMPLATE:
281
+ case DataType.TEMPLATE:
219
282
  return "Template";
220
283
  break;
221
- case DataType.DT_CONTENT:
284
+ case DataType.CONTENT:
222
285
  return "Content";
223
286
  break;
224
287
  default:
@@ -241,25 +304,25 @@ class CMS {
241
304
 
242
305
  return {
243
306
  id: item.id ? item.id : 0,
244
- data_type:item.data_type ? item.data_type : DataType.DT_BLANK,
307
+ data_type:item.data_type ? item.data_type : DataType.BLANK,
245
308
 
246
309
  parent_id:item.parent_id ? item.parent_id : 0,
247
- parent_data_type:item.parent_data_type ? item.parent_data_type : DataType.DT_BLANK,
310
+ parent_data_type:item.parent_data_type ? item.parent_data_type : DataType.BLANK,
248
311
 
249
312
  top_id:item.top_id ? item.top_id : 0,
250
- top_data_type:item.top_data_type ? item.top_data_type : DataType.DT_BLANK
313
+ top_data_type:item.top_data_type ? item.top_data_type : DataType.BLANK
251
314
  }
252
315
  };
253
316
 
254
317
  static get_new_query_item = (item,parent_item,top_item) => {
255
318
  return {
256
319
  id: item.id ? item.id : 0,
257
- data_type:item.data_type ? item.data_type : DataType.DT_BLANK,
320
+ data_type:item.data_type ? item.data_type : DataType.BLANK,
258
321
  parent_id:parent_item.id ? parent_item.id : 0,
259
- parent_data_type:parent_item.data_type ? parent_item.data_type : DataType.DT_BLANK,
322
+ parent_data_type:parent_item.data_type ? parent_item.data_type : DataType.BLANK,
260
323
 
261
324
  top_id:top_item.id ? top_item.id : 0,
262
- top_data_type:top_item.data_type ? top_item.data_type : DataType.DT_BLANK
325
+ top_data_type:top_item.data_type ? top_item.data_type : DataType.BLANK
263
326
  }
264
327
  };
265
328
 
@@ -268,27 +331,27 @@ class CMS {
268
331
  };
269
332
 
270
333
  static get_query_item_by_page = (item) => {
271
- return { id:item.id ? item.id : 0, data_type:item.data_type ? item.data_type : DataType.DT_BLANK };
334
+ return { id:item.id ? item.id : 0, data_type:item.data_type ? item.data_type : DataType.BLANK };
272
335
  };
273
336
 
274
337
  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.DT_BLANK };
338
+ return { id:parent_item.id ? parent_item.id : 0, data_type:parent_item.data_type ? parent_item.data_type : DataType.BLANK };
276
339
  };
277
340
 
278
341
  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.DT_BLANK };
342
+ return { id:top_item.id ? top_item.id : 0, data_type:top_item.data_type ? top_item.data_type : DataType.BLANK };
280
343
  };
281
344
 
282
345
  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.DT_BLANK } ;
346
+ return { id:query.get('id') ? query.get('id') : 0, data_type:query.get('data_type') ? query.get('data_type') : DataType.BLANK } ;
284
347
  };
285
348
 
286
349
  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.DT_BLANK } ;
350
+ 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
351
 
289
352
  };
290
353
  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.DT_BLANK } ;
354
+ 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
355
  };
293
356
 
294
357
  static get_sub_page_title = (title) => {
@@ -490,6 +553,7 @@ module.exports = {
490
553
  CMS,
491
554
  DataItem,
492
555
  DataType,
556
+ PageType,
493
557
  Message,
494
558
  Obj,
495
559
  Storage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "3.5.39",
3
+ "version": "3.5.40",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
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) {