@resolveio/server-lib 4.4.14 → 4.4.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "4.4.14",
3
+ "version": "4.4.16",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {
@@ -12,5 +12,6 @@ $1$2,$3,\n
12
12
  export declare function buildRbLookups(rbLookups: LookupTables[], defaultSchema: Schema<any>, default_checked_array?: string[]): any;
13
13
  export declare function throwErr(err: any, lkp: any, lookupNode: any, newPropertyName?: string): void;
14
14
  export declare function buildTree(current_root: any, schemaTree: any, lookup?: any): any[];
15
- export declare function getLeafTypes(schemaTree: any, fieldPath: any): any[];
15
+ export declare function getLeafValueTypes(schemaTree: any, fieldPath: any): any[];
16
+ export declare function getLeafFormatTypes(schemaTree: any, fieldPath: any): any[];
16
17
  export declare function mongoCommand(commandstr: string, collection: string, field?: any): Promise<any>;
@@ -188,8 +188,10 @@ function buildTree(current_root, schemaTree, lookup) {
188
188
  isActive: false,
189
189
  isSelected: false,
190
190
  depth: 0,
191
- leafType: '',
192
- leafTypes: getLeafTypes(schemaTree[key], key)
191
+ leafValueType: '',
192
+ leafValueTypes: getLeafValueTypes(schemaTree[key], key),
193
+ leafFormatType: '',
194
+ leafFormatTypes: getLeafFormatTypes(schemaTree[key], key)
193
195
  });
194
196
  }
195
197
  else {
@@ -212,7 +214,8 @@ function buildTree(current_root, schemaTree, lookup) {
212
214
  isActive: false,
213
215
  isSelected: false,
214
216
  depth: 0,
215
- leafTypeValue: '',
217
+ leafValueType: '',
218
+ leafFormatType: '',
216
219
  children: []
217
220
  });
218
221
  }
@@ -249,8 +252,10 @@ function buildTree(current_root, schemaTree, lookup) {
249
252
  isActive: false,
250
253
  isSelected: false,
251
254
  depth: index,
252
- leafType: '',
253
- leafTypes: getLeafTypes(schemaTree[key], key)
255
+ leafValueType: '',
256
+ leafValueTypes: getLeafValueTypes(schemaTree[key], key),
257
+ leafFormatType: '',
258
+ leafFormatTypes: getLeafFormatTypes(schemaTree[key], key)
254
259
  });
255
260
  }
256
261
  else {
@@ -273,7 +278,8 @@ function buildTree(current_root, schemaTree, lookup) {
273
278
  isActive: false,
274
279
  isSelected: false,
275
280
  depth: index,
276
- leafTypeValue: '',
281
+ leafValueType: '',
282
+ leafFormatType: '',
277
283
  children: []
278
284
  });
279
285
  }
@@ -287,13 +293,13 @@ function buildTree(current_root, schemaTree, lookup) {
287
293
  return res;
288
294
  }
289
295
  exports.buildTree = buildTree;
290
- function getLeafTypes(schemaTree, fieldPath) {
296
+ function getLeafValueTypes(schemaTree, fieldPath) {
291
297
  var leafTypes = [];
292
298
  if (schemaTree.rbType === 'String') {
293
299
  leafTypes = [
294
300
  {
295
- text: 'As Text',
296
- value: 'String'
301
+ text: 'As Value',
302
+ value: 'Value'
297
303
  },
298
304
  {
299
305
  text: 'As Count',
@@ -312,16 +318,8 @@ function getLeafTypes(schemaTree, fieldPath) {
312
318
  else if (schemaTree.rbType === 'Number') {
313
319
  leafTypes = [
314
320
  {
315
- text: 'As Number',
316
- value: 'Number'
317
- },
318
- {
319
- text: 'As Currency',
320
- value: 'Currency'
321
- },
322
- {
323
- text: 'As Text',
324
- value: 'String'
321
+ text: 'As Value',
322
+ value: 'Value'
325
323
  },
326
324
  {
327
325
  text: 'As Average',
@@ -356,21 +354,41 @@ function getLeafTypes(schemaTree, fieldPath) {
356
354
  else if (schemaTree.rbType === 'Boolean') {
357
355
  leafTypes = [
358
356
  {
359
- text: 'As Boolean (True/False)',
360
- value: 'Boolean'
357
+ text: 'As Value',
358
+ value: 'Value'
361
359
  },
362
360
  {
363
- text: 'As Text (Yes/No)',
364
- value: 'String'
361
+ text: 'As Count',
362
+ value: 'Count'
365
363
  },
366
364
  {
367
- text: 'As Number (1/0)',
368
- value: 'Number'
365
+ text: 'First',
366
+ value: 'First'
367
+ },
368
+ {
369
+ text: 'Last',
370
+ value: 'Last'
371
+ }
372
+ ];
373
+ }
374
+ else if (schemaTree.rbType === 'Date') {
375
+ leafTypes = [
376
+ {
377
+ text: 'As Value',
378
+ value: 'Value'
369
379
  },
370
380
  {
371
381
  text: 'As Count',
372
382
  value: 'Count'
373
383
  },
384
+ {
385
+ text: 'Minimum',
386
+ value: 'Minimum'
387
+ },
388
+ {
389
+ text: 'Maximum',
390
+ value: 'Maximum'
391
+ },
374
392
  {
375
393
  text: 'First',
376
394
  value: 'First'
@@ -381,6 +399,51 @@ function getLeafTypes(schemaTree, fieldPath) {
381
399
  }
382
400
  ];
383
401
  }
402
+ return leafTypes;
403
+ }
404
+ exports.getLeafValueTypes = getLeafValueTypes;
405
+ function getLeafFormatTypes(schemaTree, fieldPath) {
406
+ var leafTypes = [];
407
+ if (schemaTree.rbType === 'String') {
408
+ leafTypes = [
409
+ {
410
+ text: 'As Text',
411
+ value: 'String'
412
+ }
413
+ ];
414
+ }
415
+ else if (schemaTree.rbType === 'Number') {
416
+ leafTypes = [
417
+ {
418
+ text: 'As Number',
419
+ value: 'Number'
420
+ },
421
+ {
422
+ text: 'As Currency',
423
+ value: 'Currency'
424
+ },
425
+ {
426
+ text: 'As Text',
427
+ value: 'String'
428
+ }
429
+ ];
430
+ }
431
+ else if (schemaTree.rbType === 'Boolean') {
432
+ leafTypes = [
433
+ {
434
+ text: 'As Boolean (True/False)',
435
+ value: 'Boolean'
436
+ },
437
+ {
438
+ text: 'As Text (Yes/No)',
439
+ value: 'String'
440
+ },
441
+ {
442
+ text: 'As Number (1/0)',
443
+ value: 'Number'
444
+ }
445
+ ];
446
+ }
384
447
  else if (schemaTree.rbType === 'Date') {
385
448
  leafTypes = [
386
449
  {
@@ -406,32 +469,12 @@ function getLeafTypes(schemaTree, fieldPath) {
406
469
  {
407
470
  text: 'As Timestamp (MS since 1970)',
408
471
  value: 'Number'
409
- },
410
- {
411
- text: 'As Count',
412
- value: 'Count'
413
- },
414
- {
415
- text: 'Minimum',
416
- value: 'Minimum'
417
- },
418
- {
419
- text: 'Maximum',
420
- value: 'Maximum'
421
- },
422
- {
423
- text: 'First',
424
- value: 'First'
425
- },
426
- {
427
- text: 'Last',
428
- value: 'Last'
429
472
  }
430
473
  ];
431
474
  }
432
475
  return leafTypes;
433
476
  }
434
- exports.getLeafTypes = getLeafTypes;
477
+ exports.getLeafFormatTypes = getLeafFormatTypes;
435
478
  function mongoCommand(commandstr, collection, field) {
436
479
  return __awaiter(this, void 0, void 0, function () {
437
480
  var tmpObj, obj, obj, err_1;