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.
Files changed (4) hide show
  1. package/biz9_config +1 -1
  2. package/index.js +122 -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.3'
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)=>{
@@ -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.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" }
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.DT_EVENT:
259
+ case DataType.EVENT:
192
260
  return "Event";
193
261
  break;
194
- case DataType.DT_GALLERY:
262
+ case DataType.GALLERY:
195
263
  return "Gallery";
196
264
  break;
197
- case DataType.DT_PRODUCT:
265
+ case DataType.PRODUCT:
198
266
  return "Product";
199
267
  break;
200
- case DataType.DT_SERVICE:
268
+ case DataType.SERVICE:
201
269
  return "Service";
202
270
  break;
203
- case DataType.DT_EVENT:
271
+ case DataType.EVENT:
204
272
  return "Event";
205
273
  break;
206
- case DataType.DT_PRODUCT:
274
+ case DataType.PRODUCT:
207
275
  return "Product";
208
276
  break;
209
- case DataType.DT_SERVICE:
277
+ case DataType.SERVICE:
210
278
  return "Service";
211
279
  break;
212
- case DataType.DT_CATEGORY:
280
+ case DataType.CATEGORY:
213
281
  return "Category";
214
282
  break;
215
- case DataType.DT_BLOG_POST:
283
+ case DataType.BLOG_POST:
216
284
  return "Blog Post";
217
285
  break;
218
- case DataType.DT_TEMPLATE:
286
+ case DataType.TEMPLATE:
219
287
  return "Template";
220
288
  break;
221
- case DataType.DT_CONTENT:
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.DT_BLANK,
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.DT_BLANK,
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.DT_BLANK
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.DT_BLANK,
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.DT_BLANK,
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.DT_BLANK
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.DT_BLANK };
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.DT_BLANK };
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.DT_BLANK };
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.DT_BLANK } ;
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.DT_BLANK } ;
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.DT_BLANK } ;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "3.5.39",
3
+ "version": "3.5.43",
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) {