3xpr 1.7.10 → 1.9.0

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 (144) hide show
  1. package/{expression → application}/expressions.d.ts +6 -11
  2. package/{expression → application}/expressions.js +20 -44
  3. package/application/expressions.js.map +1 -0
  4. package/application/graphql/parser.d.ts +0 -0
  5. package/application/graphql/parser.js +89 -0
  6. package/application/graphql/parser.js.map +1 -0
  7. package/{expression → application/helper}/helper.d.ts +1 -1
  8. package/{expression → application/helper}/helper.js +2 -2
  9. package/application/helper/helper.js.map +1 -0
  10. package/application/helper/index.d.ts +2 -0
  11. package/application/helper/index.js +19 -0
  12. package/application/helper/index.js.map +1 -0
  13. package/{expression/operand/helper.d.ts → application/helper/operandHelper.d.ts} +1 -1
  14. package/{expression/operand/helper.js → application/helper/operandHelper.js} +17 -17
  15. package/application/helper/operandHelper.js.map +1 -0
  16. package/{expression → application}/index.d.ts +1 -2
  17. package/{expression → application}/index.js +1 -2
  18. package/application/index.js.map +1 -0
  19. package/{expression → application}/operand/builder.d.ts +3 -3
  20. package/{expression → application}/operand/builder.js +2 -2
  21. package/application/operand/builder.js.map +1 -0
  22. package/{expression/operand → application/operand/factory/basic}/evaluators.d.ts +1 -1
  23. package/{expression/operand → application/operand/factory/basic}/evaluators.js +30 -29
  24. package/application/operand/factory/basic/evaluators.js.map +1 -0
  25. package/{expression/operand → application/operand/factory/basic}/factory.d.ts +3 -3
  26. package/{expression/operand → application/operand/factory/basic}/factory.js +32 -31
  27. package/application/operand/factory/basic/factory.js.map +1 -0
  28. package/application/operand/factory/index.d.ts +2 -0
  29. package/application/operand/factory/index.js +19 -0
  30. package/application/operand/factory/index.js.map +1 -0
  31. package/{expression → application/operand/factory}/process/evaluators.d.ts +1 -1
  32. package/{expression → application/operand/factory}/process/evaluators.js +10 -10
  33. package/application/operand/factory/process/evaluators.js.map +1 -0
  34. package/{expression → application/operand/factory}/process/factory.d.ts +3 -3
  35. package/application/operand/factory/process/factory.js +122 -0
  36. package/application/operand/factory/process/factory.js.map +1 -0
  37. package/{expression → application}/operand/index.d.ts +1 -4
  38. package/{expression → application}/operand/index.js +1 -4
  39. package/application/operand/index.js.map +1 -0
  40. package/{expression → application}/operand/library.d.ts +3 -2
  41. package/{expression → application}/operand/library.js +70 -64
  42. package/application/operand/library.js.map +1 -0
  43. package/{expression → application}/operand/model.d.ts +2 -2
  44. package/{expression → application}/operand/model.js +6 -6
  45. package/application/operand/model.js.map +1 -0
  46. package/{expression → application}/operand/normalizer.d.ts +3 -3
  47. package/{expression → application}/operand/normalizer.js +7 -7
  48. package/application/operand/normalizer.js.map +1 -0
  49. package/application/operand/parameters.d.ts +4 -0
  50. package/{expression → application}/operand/parameters.js +7 -6
  51. package/application/operand/parameters.js.map +1 -0
  52. package/{expression → application}/operand/parser.d.ts +2 -2
  53. package/{expression → application}/operand/parser.js +59 -58
  54. package/application/operand/parser.js.map +1 -0
  55. package/{expression → application}/operand/reducer.d.ts +3 -3
  56. package/{expression → application}/operand/reducer.js +5 -5
  57. package/application/operand/reducer.js.map +1 -0
  58. package/{expression → application}/operand/serializer.d.ts +1 -1
  59. package/{expression → application}/operand/serializer.js +4 -3
  60. package/application/operand/serializer.js.map +1 -0
  61. package/{expression → application}/operand/type.d.ts +5 -4
  62. package/{expression → application}/operand/type.js +41 -40
  63. package/application/operand/type.js.map +1 -0
  64. package/domain/index.d.ts +3 -0
  65. package/{expression/process → domain}/index.js +2 -2
  66. package/domain/index.js.map +1 -0
  67. package/domain/model/base.js.map +1 -0
  68. package/domain/model/context.js.map +1 -0
  69. package/{expression/contract → domain/model}/index.d.ts +2 -2
  70. package/{expression/contract → domain/model}/index.js +2 -2
  71. package/domain/model/index.js.map +1 -0
  72. package/domain/model/observer.d.ts +14 -0
  73. package/{expression/contract/managers.js → domain/model/observer.js} +1 -1
  74. package/domain/model/observer.js.map +1 -0
  75. package/{expression/contract → domain/model}/operand.d.ts +2 -1
  76. package/domain/model/operand.js.map +1 -0
  77. package/domain/model/signals.js +3 -0
  78. package/domain/model/signals.js.map +1 -0
  79. package/domain/services/expressions.d.ts +26 -0
  80. package/domain/services/expressions.js +3 -0
  81. package/domain/services/expressions.js.map +1 -0
  82. package/domain/services/index.d.ts +5 -0
  83. package/domain/services/index.js +22 -0
  84. package/domain/services/index.js.map +1 -0
  85. package/domain/services/model.d.ts +28 -0
  86. package/domain/services/model.js.map +1 -0
  87. package/domain/services/operand.d.ts +14 -0
  88. package/domain/services/operand.js +3 -0
  89. package/domain/services/operand.js.map +1 -0
  90. package/domain/services/parameter.d.ts +4 -0
  91. package/domain/services/parameter.js +3 -0
  92. package/domain/services/parameter.js.map +1 -0
  93. package/domain/services/type.d.ts +5 -0
  94. package/domain/services/type.js +3 -0
  95. package/domain/services/type.js.map +1 -0
  96. package/index.d.ts +2 -19
  97. package/index.js +2 -35
  98. package/index.js.map +1 -1
  99. package/infrastructure/builder.d.ts +4 -0
  100. package/infrastructure/builder.js +20 -0
  101. package/infrastructure/builder.js.map +1 -0
  102. package/infrastructure/index.d.ts +19 -0
  103. package/infrastructure/index.js +52 -0
  104. package/infrastructure/index.js.map +1 -0
  105. package/package.json +3 -2
  106. package/expression/contract/base.js.map +0 -1
  107. package/expression/contract/context.js.map +0 -1
  108. package/expression/contract/index.js.map +0 -1
  109. package/expression/contract/managers.d.ts +0 -86
  110. package/expression/contract/managers.js.map +0 -1
  111. package/expression/contract/operand.js.map +0 -1
  112. package/expression/contract/type.d.ts +0 -50
  113. package/expression/contract/type.js +0 -164
  114. package/expression/contract/type.js.map +0 -1
  115. package/expression/expressions.js.map +0 -1
  116. package/expression/helper.js.map +0 -1
  117. package/expression/index.js.map +0 -1
  118. package/expression/operand/builder.js.map +0 -1
  119. package/expression/operand/evaluators.js.map +0 -1
  120. package/expression/operand/factory.js.map +0 -1
  121. package/expression/operand/helper.js.map +0 -1
  122. package/expression/operand/index.js.map +0 -1
  123. package/expression/operand/library.js.map +0 -1
  124. package/expression/operand/model.js.map +0 -1
  125. package/expression/operand/normalizer.js.map +0 -1
  126. package/expression/operand/parameters.d.ts +0 -4
  127. package/expression/operand/parameters.js.map +0 -1
  128. package/expression/operand/parser.js.map +0 -1
  129. package/expression/operand/reducer.js.map +0 -1
  130. package/expression/operand/serializer.js.map +0 -1
  131. package/expression/operand/type.js.map +0 -1
  132. package/expression/process/evaluators.js.map +0 -1
  133. package/expression/process/factory.js +0 -122
  134. package/expression/process/factory.js.map +0 -1
  135. package/expression/process/index.d.ts +0 -3
  136. package/expression/process/index.js.map +0 -1
  137. package/expression/process/model.js.map +0 -1
  138. /package/{expression/contract → domain/model}/base.d.ts +0 -0
  139. /package/{expression/contract → domain/model}/base.js +0 -0
  140. /package/{expression/contract → domain/model}/context.d.ts +0 -0
  141. /package/{expression/contract → domain/model}/context.js +0 -0
  142. /package/{expression/contract → domain/model}/operand.js +0 -0
  143. /package/{expression/process/model.d.ts → domain/model/signals.d.ts} +0 -0
  144. /package/{expression/process → domain/services}/model.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../../../src/lib/application/operand/factory/process/factory.ts"],"names":[],"mappings":";;;AACA,+CAAuG;AACvG,oDAAuJ;AACvJ,6CAKqB;AAErB,MAAa,qBAAqB;IACjC,kDAAkD;IAClD,YAAuC,KAAoB;QAApB,UAAK,GAAL,KAAK,CAAe;IAAI,CAAC;IAEtD,cAAc,CAAE,OAAe;QACxC,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QACtF,IAAI,gBAAgB,CAAC,MAAM,EAAE;YAC5B,sDAAsD;YACtD,OAAO,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;SAC7C;aAAM,IAAI,gBAAgB,CAAC,QAAQ,KAAK,SAAS,EAAE;YACnD,OAAO,IAAI,2BAAc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ACD,OAAO,SAAS,CAAA;IACjB,CAAC;CACD;AA9GD,sDA8GC"}
@@ -1,13 +1,10 @@
1
- export * from './evaluators';
2
1
  export * from './factory';
3
- export * from './helper';
4
2
  export * from './builder';
5
3
  export * from './type';
6
4
  export * from './parameters';
7
5
  export * from './library';
8
6
  export * from './model';
9
- export * from './helper';
10
- export * from './parser';
11
7
  export * from './reducer';
12
8
  export * from './normalizer';
13
9
  export * from './serializer';
10
+ export * from './parser';
@@ -14,17 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./evaluators"), exports);
18
17
  __exportStar(require("./factory"), exports);
19
- __exportStar(require("./helper"), exports);
20
18
  __exportStar(require("./builder"), exports);
21
19
  __exportStar(require("./type"), exports);
22
20
  __exportStar(require("./parameters"), exports);
23
21
  __exportStar(require("./library"), exports);
24
22
  __exportStar(require("./model"), exports);
25
- __exportStar(require("./helper"), exports);
26
- __exportStar(require("./parser"), exports);
27
23
  __exportStar(require("./reducer"), exports);
28
24
  __exportStar(require("./normalizer"), exports);
29
25
  __exportStar(require("./serializer"), exports);
26
+ __exportStar(require("./parser"), exports);
30
27
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/application/operand/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,4CAAyB;AACzB,yCAAsB;AACtB,+CAA4B;AAC5B,4CAAyB;AACzB,0CAAuB;AACvB,4CAAyB;AACzB,+CAA4B;AAC5B,+CAA4B;AAC5B,2CAAwB"}
@@ -1,7 +1,8 @@
1
- import { IModelManager } from '../contract';
1
+ import { IModelService, IOperandBuilder } from '../../domain';
2
2
  export declare class CoreLibrary {
3
3
  private readonly model;
4
- constructor(model: IModelManager);
4
+ private readonly builder;
5
+ constructor(model: IModelService, builder: IOperandBuilder);
5
6
  load(): void;
6
7
  private constants;
7
8
  private enums;
@@ -2,12 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CoreLibrary = void 0;
4
4
  const h3lp_1 = require("h3lp");
5
- const contract_1 = require("../contract");
6
- const __1 = require("../..");
5
+ const domain_1 = require("../../domain");
6
+ const helper_1 = require("../helper");
7
7
  class CoreLibrary {
8
8
  // eslint-disable-next-line no-useless-constructor
9
- constructor(model) {
9
+ constructor(model, builder) {
10
10
  this.model = model;
11
+ this.builder = builder;
11
12
  }
12
13
  load() {
13
14
  this.constants();
@@ -345,7 +346,7 @@ class CoreLibrary {
345
346
  });
346
347
  }
347
348
  arrayFunctions() {
348
- this.model.addFunction('map(list: any[], predicate: T):T[]', new Map());
349
+ this.model.addFunction('map(list: any[], predicate: T):T[]', new Map(this.builder));
349
350
  this.model.addFunctionAlias('select', 'map');
350
351
  this.model.addFunction('foreach(list: any[], predicate: any):void', new Foreach());
351
352
  this.model.addFunctionAlias('each', 'foreach');
@@ -402,7 +403,7 @@ class CoreLibrary {
402
403
  }
403
404
  }
404
405
  exports.CoreLibrary = CoreLibrary;
405
- class And extends contract_1.PrototypeEvaluator {
406
+ class And extends domain_1.PrototypeEvaluator {
406
407
  clone(operand) {
407
408
  return new And(operand);
408
409
  }
@@ -415,7 +416,7 @@ class And extends contract_1.PrototypeEvaluator {
415
416
  return this.operand.children[1].eval(context);
416
417
  }
417
418
  }
418
- class Or extends contract_1.PrototypeEvaluator {
419
+ class Or extends domain_1.PrototypeEvaluator {
419
420
  clone(operand) {
420
421
  return new Or(operand);
421
422
  }
@@ -428,7 +429,7 @@ class Or extends contract_1.PrototypeEvaluator {
428
429
  return this.operand.children[1].eval(context);
429
430
  }
430
431
  }
431
- class Assignment extends contract_1.PrototypeEvaluator {
432
+ class Assignment extends domain_1.PrototypeEvaluator {
432
433
  clone(operand) {
433
434
  return new Assignment(operand);
434
435
  }
@@ -441,7 +442,7 @@ class Assignment extends contract_1.PrototypeEvaluator {
441
442
  return value;
442
443
  }
443
444
  }
444
- class AssignmentAddition extends contract_1.PrototypeEvaluator {
445
+ class AssignmentAddition extends domain_1.PrototypeEvaluator {
445
446
  clone(operand) {
446
447
  return new AssignmentAddition(operand);
447
448
  }
@@ -454,7 +455,7 @@ class AssignmentAddition extends contract_1.PrototypeEvaluator {
454
455
  return value;
455
456
  }
456
457
  }
457
- class AssignmentSubtraction extends contract_1.PrototypeEvaluator {
458
+ class AssignmentSubtraction extends domain_1.PrototypeEvaluator {
458
459
  clone(operand) {
459
460
  return new AssignmentSubtraction(operand);
460
461
  }
@@ -467,7 +468,7 @@ class AssignmentSubtraction extends contract_1.PrototypeEvaluator {
467
468
  return value;
468
469
  }
469
470
  }
470
- class AssignmentMultiplication extends contract_1.PrototypeEvaluator {
471
+ class AssignmentMultiplication extends domain_1.PrototypeEvaluator {
471
472
  clone(operand) {
472
473
  return new AssignmentMultiplication(operand);
473
474
  }
@@ -480,7 +481,7 @@ class AssignmentMultiplication extends contract_1.PrototypeEvaluator {
480
481
  return value;
481
482
  }
482
483
  }
483
- class AssignmentDivision extends contract_1.PrototypeEvaluator {
484
+ class AssignmentDivision extends domain_1.PrototypeEvaluator {
484
485
  clone(operand) {
485
486
  return new AssignmentDivision(operand);
486
487
  }
@@ -493,7 +494,7 @@ class AssignmentDivision extends contract_1.PrototypeEvaluator {
493
494
  return value;
494
495
  }
495
496
  }
496
- class AssignmentExponentiation extends contract_1.PrototypeEvaluator {
497
+ class AssignmentExponentiation extends domain_1.PrototypeEvaluator {
497
498
  clone(operand) {
498
499
  return new AssignmentExponentiation(operand);
499
500
  }
@@ -506,7 +507,7 @@ class AssignmentExponentiation extends contract_1.PrototypeEvaluator {
506
507
  return value;
507
508
  }
508
509
  }
509
- class AssignmentFloorDivision extends contract_1.PrototypeEvaluator {
510
+ class AssignmentFloorDivision extends domain_1.PrototypeEvaluator {
510
511
  clone(operand) {
511
512
  return new AssignmentFloorDivision(operand);
512
513
  }
@@ -519,7 +520,7 @@ class AssignmentFloorDivision extends contract_1.PrototypeEvaluator {
519
520
  return value;
520
521
  }
521
522
  }
522
- class AssignmentMod extends contract_1.PrototypeEvaluator {
523
+ class AssignmentMod extends domain_1.PrototypeEvaluator {
523
524
  clone(operand) {
524
525
  return new AssignmentMod(operand);
525
526
  }
@@ -532,7 +533,7 @@ class AssignmentMod extends contract_1.PrototypeEvaluator {
532
533
  return value;
533
534
  }
534
535
  }
535
- class AssignmentBitAnd extends contract_1.PrototypeEvaluator {
536
+ class AssignmentBitAnd extends domain_1.PrototypeEvaluator {
536
537
  clone(operand) {
537
538
  return new AssignmentBitAnd(operand);
538
539
  }
@@ -545,7 +546,7 @@ class AssignmentBitAnd extends contract_1.PrototypeEvaluator {
545
546
  return value;
546
547
  }
547
548
  }
548
- class AssignmentBitOr extends contract_1.PrototypeEvaluator {
549
+ class AssignmentBitOr extends domain_1.PrototypeEvaluator {
549
550
  clone(operand) {
550
551
  return new AssignmentBitOr(operand);
551
552
  }
@@ -558,7 +559,7 @@ class AssignmentBitOr extends contract_1.PrototypeEvaluator {
558
559
  return value;
559
560
  }
560
561
  }
561
- class AssignmentBitXor extends contract_1.PrototypeEvaluator {
562
+ class AssignmentBitXor extends domain_1.PrototypeEvaluator {
562
563
  clone(operand) {
563
564
  return new AssignmentBitXor(operand);
564
565
  }
@@ -571,7 +572,7 @@ class AssignmentBitXor extends contract_1.PrototypeEvaluator {
571
572
  return value;
572
573
  }
573
574
  }
574
- class AssignmentLeftShift extends contract_1.PrototypeEvaluator {
575
+ class AssignmentLeftShift extends domain_1.PrototypeEvaluator {
575
576
  clone(operand) {
576
577
  return new AssignmentLeftShift(operand);
577
578
  }
@@ -584,7 +585,7 @@ class AssignmentLeftShift extends contract_1.PrototypeEvaluator {
584
585
  return value;
585
586
  }
586
587
  }
587
- class AssignmentRightShift extends contract_1.PrototypeEvaluator {
588
+ class AssignmentRightShift extends domain_1.PrototypeEvaluator {
588
589
  clone(operand) {
589
590
  return new AssignmentRightShift(operand);
590
591
  }
@@ -597,9 +598,14 @@ class AssignmentRightShift extends contract_1.PrototypeEvaluator {
597
598
  return value;
598
599
  }
599
600
  }
600
- class Map extends contract_1.PrototypeEvaluator {
601
+ class Map extends domain_1.PrototypeEvaluator {
602
+ // eslint-disable-next-line no-useless-constructor
603
+ constructor(builder, operand) {
604
+ super(operand);
605
+ this.builder = builder;
606
+ }
601
607
  clone(operand) {
602
- return new Map(operand);
608
+ return new Map(this.builder, operand);
603
609
  }
604
610
  eval(context) {
605
611
  if (this.operand === undefined) {
@@ -610,14 +616,14 @@ class Map extends contract_1.PrototypeEvaluator {
610
616
  if (!list) {
611
617
  throw new Error(`Array ${this.operand.children[0].name} undefined`);
612
618
  }
613
- if (this.operand.children[2].type === contract_1.OperandType.Obj) {
619
+ if (this.operand.children[2].type === domain_1.OperandType.Obj) {
614
620
  const groupers = [];
615
621
  const aggregates = [];
616
622
  for (const child of this.operand.children[2].children) {
617
623
  // In the case of being an object the value to return, find out if there are fields that are summarized
618
624
  const keyValue = child;
619
625
  if (keyValue) {
620
- if (__1.operandHelper.haveAggregates(keyValue.children[0])) {
626
+ if (helper_1.operandHelper.haveAggregates(keyValue.children[0])) {
621
627
  aggregates.push(keyValue);
622
628
  }
623
629
  else {
@@ -627,13 +633,13 @@ class Map extends contract_1.PrototypeEvaluator {
627
633
  }
628
634
  if (aggregates.length > 0) {
629
635
  // case with aggregate functions
630
- const keys = __1.operandHelper.getKeys(this.operand.children[1], groupers, list, context);
636
+ const keys = helper_1.operandHelper.getKeys(this.operand.children[1], groupers, list, context);
631
637
  // once you got all the keys you have to calculate the aggregates fields
632
638
  const variable = this.operand.children[1];
633
639
  for (const key of keys) {
634
640
  for (const keyValue of aggregates) {
635
- const operandCloned = __1.expressions.clone(keyValue.children[0]);
636
- const operandResolved = __1.operandHelper.solveAggregates(key.items, variable, operandCloned, context);
641
+ const operandCloned = this.builder.clone(keyValue.children[0]);
642
+ const operandResolved = helper_1.operandHelper.solveAggregates(key.items, variable, operandCloned, context);
637
643
  const value = operandResolved.eval(context);
638
644
  key.summarizers.push({ name: keyValue.name, value });
639
645
  }
@@ -652,7 +658,7 @@ class Map extends contract_1.PrototypeEvaluator {
652
658
  return rows;
653
659
  }
654
660
  }
655
- else if (this.operand.children[2].type === contract_1.OperandType.Var && !Array.isArray(list)) {
661
+ else if (this.operand.children[2].type === domain_1.OperandType.Var && !Array.isArray(list)) {
656
662
  // Example orders.0.number
657
663
  return list;
658
664
  }
@@ -666,7 +672,7 @@ class Map extends contract_1.PrototypeEvaluator {
666
672
  return rows;
667
673
  }
668
674
  }
669
- class Distinct extends contract_1.PrototypeEvaluator {
675
+ class Distinct extends domain_1.PrototypeEvaluator {
670
676
  clone(operand) {
671
677
  return new Distinct(operand);
672
678
  }
@@ -688,9 +694,9 @@ class Distinct extends contract_1.PrototypeEvaluator {
688
694
  }
689
695
  return rows;
690
696
  }
691
- else if (this.operand.children[2].type === contract_1.OperandType.Obj) {
697
+ else if (this.operand.children[2].type === domain_1.OperandType.Obj) {
692
698
  // case with aggregate functions
693
- const keys = __1.operandHelper.getKeys(this.operand.children[1], this.operand.children[2].children, list, context.newContext());
699
+ const keys = helper_1.operandHelper.getKeys(this.operand.children[1], this.operand.children[2].children, list, context.newContext());
694
700
  // build the list of results
695
701
  for (const key of keys) {
696
702
  const row = {};
@@ -701,7 +707,7 @@ class Distinct extends contract_1.PrototypeEvaluator {
701
707
  }
702
708
  return rows;
703
709
  }
704
- else if (this.operand.children[2].type === contract_1.OperandType.List) {
710
+ else if (this.operand.children[2].type === domain_1.OperandType.List) {
705
711
  throw new Error('Distinct not support Array result');
706
712
  }
707
713
  // simple case without aggregate functions
@@ -716,7 +722,7 @@ class Distinct extends contract_1.PrototypeEvaluator {
716
722
  return rows;
717
723
  }
718
724
  }
719
- class Foreach extends contract_1.PrototypeEvaluator {
725
+ class Foreach extends domain_1.PrototypeEvaluator {
720
726
  clone(operand) {
721
727
  return new Foreach(operand);
722
728
  }
@@ -736,7 +742,7 @@ class Foreach extends contract_1.PrototypeEvaluator {
736
742
  return list;
737
743
  }
738
744
  }
739
- class Filter extends contract_1.PrototypeEvaluator {
745
+ class Filter extends domain_1.PrototypeEvaluator {
740
746
  clone(operand) {
741
747
  return new Filter(operand);
742
748
  }
@@ -759,7 +765,7 @@ class Filter extends contract_1.PrototypeEvaluator {
759
765
  return rows;
760
766
  }
761
767
  }
762
- class Reverse extends contract_1.PrototypeEvaluator {
768
+ class Reverse extends domain_1.PrototypeEvaluator {
763
769
  clone(operand) {
764
770
  return new Reverse(operand);
765
771
  }
@@ -786,7 +792,7 @@ class Reverse extends contract_1.PrototypeEvaluator {
786
792
  return values.map(p => p.p);
787
793
  }
788
794
  }
789
- class Sort extends contract_1.PrototypeEvaluator {
795
+ class Sort extends domain_1.PrototypeEvaluator {
790
796
  clone(operand) {
791
797
  return new Sort(operand);
792
798
  }
@@ -812,7 +818,7 @@ class Sort extends contract_1.PrototypeEvaluator {
812
818
  return values.map(p => p.p);
813
819
  }
814
820
  }
815
- class Remove extends contract_1.PrototypeEvaluator {
821
+ class Remove extends domain_1.PrototypeEvaluator {
816
822
  clone(operand) {
817
823
  return new Remove(operand);
818
824
  }
@@ -835,7 +841,7 @@ class Remove extends contract_1.PrototypeEvaluator {
835
841
  return rows;
836
842
  }
837
843
  }
838
- class First extends contract_1.PrototypeEvaluator {
844
+ class First extends domain_1.PrototypeEvaluator {
839
845
  clone(operand) {
840
846
  return new First(operand);
841
847
  }
@@ -850,10 +856,10 @@ class First extends contract_1.PrototypeEvaluator {
850
856
  if (this.operand.children.length === 1) {
851
857
  return list && list.length > 0 ? list[0] : null;
852
858
  }
853
- return __1.operandHelper.first(list, this.operand.children[1], this.operand.children[2], context.newContext());
859
+ return helper_1.operandHelper.first(list, this.operand.children[1], this.operand.children[2], context.newContext());
854
860
  }
855
861
  }
856
- class Last extends contract_1.PrototypeEvaluator {
862
+ class Last extends domain_1.PrototypeEvaluator {
857
863
  clone(operand) {
858
864
  return new Last(operand);
859
865
  }
@@ -868,10 +874,10 @@ class Last extends contract_1.PrototypeEvaluator {
868
874
  if (this.operand.children.length === 1) {
869
875
  return list && list.length > 0 ? list[list.length - 1] : null;
870
876
  }
871
- return __1.operandHelper.last(list, this.operand.children[1], this.operand.children[2], context.newContext());
877
+ return helper_1.operandHelper.last(list, this.operand.children[1], this.operand.children[2], context.newContext());
872
878
  }
873
879
  }
874
- class Count extends contract_1.PrototypeEvaluator {
880
+ class Count extends domain_1.PrototypeEvaluator {
875
881
  clone(operand) {
876
882
  return new Count(operand);
877
883
  }
@@ -886,10 +892,10 @@ class Count extends contract_1.PrototypeEvaluator {
886
892
  if (this.operand.children.length === 1) {
887
893
  return list.length;
888
894
  }
889
- return __1.operandHelper.count(list, this.operand.children[1], this.operand.children[2], context.newContext());
895
+ return helper_1.operandHelper.count(list, this.operand.children[1], this.operand.children[2], context.newContext());
890
896
  }
891
897
  }
892
- class Max extends contract_1.PrototypeEvaluator {
898
+ class Max extends domain_1.PrototypeEvaluator {
893
899
  clone(operand) {
894
900
  return new Max(operand);
895
901
  }
@@ -910,10 +916,10 @@ class Max extends contract_1.PrototypeEvaluator {
910
916
  }
911
917
  return max;
912
918
  }
913
- return __1.operandHelper.max(list, this.operand.children[1], this.operand.children[2], context.newContext());
919
+ return helper_1.operandHelper.max(list, this.operand.children[1], this.operand.children[2], context.newContext());
914
920
  }
915
921
  }
916
- class Min extends contract_1.PrototypeEvaluator {
922
+ class Min extends domain_1.PrototypeEvaluator {
917
923
  clone(operand) {
918
924
  return new Min(operand);
919
925
  }
@@ -934,10 +940,10 @@ class Min extends contract_1.PrototypeEvaluator {
934
940
  }
935
941
  return min;
936
942
  }
937
- return __1.operandHelper.min(list, this.operand.children[1], this.operand.children[2], context.newContext());
943
+ return helper_1.operandHelper.min(list, this.operand.children[1], this.operand.children[2], context.newContext());
938
944
  }
939
945
  }
940
- class Avg extends contract_1.PrototypeEvaluator {
946
+ class Avg extends domain_1.PrototypeEvaluator {
941
947
  clone(operand) {
942
948
  return new Avg(operand);
943
949
  }
@@ -958,10 +964,10 @@ class Avg extends contract_1.PrototypeEvaluator {
958
964
  }
959
965
  return list.length > 0 ? sum / list.length : 0;
960
966
  }
961
- return __1.operandHelper.avg(list, this.operand.children[1], this.operand.children[2], context.newContext());
967
+ return helper_1.operandHelper.avg(list, this.operand.children[1], this.operand.children[2], context.newContext());
962
968
  }
963
969
  }
964
- class Sum extends contract_1.PrototypeEvaluator {
970
+ class Sum extends domain_1.PrototypeEvaluator {
965
971
  clone(operand) {
966
972
  return new Sum(operand);
967
973
  }
@@ -982,10 +988,10 @@ class Sum extends contract_1.PrototypeEvaluator {
982
988
  }
983
989
  return sum;
984
990
  }
985
- return __1.operandHelper.sum(list, this.operand.children[1], this.operand.children[2], context.newContext());
991
+ return helper_1.operandHelper.sum(list, this.operand.children[1], this.operand.children[2], context.newContext());
986
992
  }
987
993
  }
988
- class Union extends contract_1.PrototypeEvaluator {
994
+ class Union extends domain_1.PrototypeEvaluator {
989
995
  clone(operand) {
990
996
  return new Union(operand);
991
997
  }
@@ -1013,11 +1019,11 @@ class Union extends contract_1.PrototypeEvaluator {
1013
1019
  }
1014
1020
  else if (typeof a[0] === 'object') {
1015
1021
  for (const element of a) {
1016
- const key = __1.operandHelper.objectKey(element);
1022
+ const key = helper_1.operandHelper.objectKey(element);
1017
1023
  result.push({ key, value: element });
1018
1024
  }
1019
1025
  for (const element of b) {
1020
- const key = __1.operandHelper.objectKey(element);
1026
+ const key = helper_1.operandHelper.objectKey(element);
1021
1027
  if (!result.find((p) => p.key === key)) {
1022
1028
  result.push({ key, value: element });
1023
1029
  }
@@ -1033,7 +1039,7 @@ class Union extends contract_1.PrototypeEvaluator {
1033
1039
  return result;
1034
1040
  }
1035
1041
  }
1036
- class Intersection extends contract_1.PrototypeEvaluator {
1042
+ class Intersection extends domain_1.PrototypeEvaluator {
1037
1043
  clone(operand) {
1038
1044
  return new Intersection(operand);
1039
1045
  }
@@ -1057,9 +1063,9 @@ class Intersection extends contract_1.PrototypeEvaluator {
1057
1063
  throw new Error('Cannot union arrays of arrays');
1058
1064
  }
1059
1065
  else if (typeof a[0] === 'object') {
1060
- const keys = a.map((p) => __1.operandHelper.objectKey(p));
1066
+ const keys = a.map((p) => helper_1.operandHelper.objectKey(p));
1061
1067
  for (const element of b) {
1062
- const key = __1.operandHelper.objectKey(element);
1068
+ const key = helper_1.operandHelper.objectKey(element);
1063
1069
  if (keys.includes(key)) {
1064
1070
  result.push(element);
1065
1071
  }
@@ -1076,7 +1082,7 @@ class Intersection extends contract_1.PrototypeEvaluator {
1076
1082
  }
1077
1083
  }
1078
1084
  }
1079
- class Difference extends contract_1.PrototypeEvaluator {
1085
+ class Difference extends domain_1.PrototypeEvaluator {
1080
1086
  clone(operand) {
1081
1087
  return new Difference(operand);
1082
1088
  }
@@ -1103,9 +1109,9 @@ class Difference extends contract_1.PrototypeEvaluator {
1103
1109
  throw new Error('Cannot union arrays of arrays');
1104
1110
  }
1105
1111
  else if (typeof a[0] === 'object') {
1106
- const keys = b.map((p) => __1.operandHelper.objectKey(p));
1112
+ const keys = b.map((p) => helper_1.operandHelper.objectKey(p));
1107
1113
  for (const element of a) {
1108
- const key = __1.operandHelper.objectKey(element);
1114
+ const key = helper_1.operandHelper.objectKey(element);
1109
1115
  if (!keys.includes(key)) {
1110
1116
  result.push(element);
1111
1117
  }
@@ -1122,7 +1128,7 @@ class Difference extends contract_1.PrototypeEvaluator {
1122
1128
  }
1123
1129
  }
1124
1130
  }
1125
- class SymmetricDifference extends contract_1.PrototypeEvaluator {
1131
+ class SymmetricDifference extends domain_1.PrototypeEvaluator {
1126
1132
  clone(operand) {
1127
1133
  return new SymmetricDifference(operand);
1128
1134
  }
@@ -1149,16 +1155,16 @@ class SymmetricDifference extends contract_1.PrototypeEvaluator {
1149
1155
  throw new Error('Cannot union arrays of arrays');
1150
1156
  }
1151
1157
  else if (typeof a[0] === 'object') {
1152
- const aKeys = a.map((p) => __1.operandHelper.objectKey(p));
1153
- const bKeys = b.map((p) => __1.operandHelper.objectKey(p));
1158
+ const aKeys = a.map((p) => helper_1.operandHelper.objectKey(p));
1159
+ const bKeys = b.map((p) => helper_1.operandHelper.objectKey(p));
1154
1160
  for (const element of a) {
1155
- const key = __1.operandHelper.objectKey(element);
1161
+ const key = helper_1.operandHelper.objectKey(element);
1156
1162
  if (!bKeys.includes(key)) {
1157
1163
  result.push(element);
1158
1164
  }
1159
1165
  }
1160
1166
  for (const element of b) {
1161
- const key = __1.operandHelper.objectKey(element);
1167
+ const key = helper_1.operandHelper.objectKey(element);
1162
1168
  if (!aKeys.includes(key)) {
1163
1169
  result.push(element);
1164
1170
  }