@hpcc-js/marshaller 2.28.10 → 3.1.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 (172) hide show
  1. package/dist/index.js +2 -18051
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.umd.cjs +3 -0
  4. package/dist/index.umd.cjs.map +1 -0
  5. package/package.json +46 -46
  6. package/src/__package__.ts +3 -3
  7. package/src/dashy.css +45 -34
  8. package/src/dashy.ts +20 -18
  9. package/src/ddl1/FlyoutButton.ts +3 -2
  10. package/src/ddl1/Graph.ts +8 -5
  11. package/src/ddl1/HTML.ts +1 -1
  12. package/src/ddl1/HipieDDL.ts +5 -1
  13. package/src/ddl1/HipieDDLMixin.ts +31 -20
  14. package/src/ddl1/Tabbed.ts +1 -1
  15. package/src/ddl1/TargetMarshaller.ts +1 -1
  16. package/src/ddl2/PopupManager.ts +2 -2
  17. package/src/ddl2/activities/activity.ts +1 -1
  18. package/src/ddl2/activities/databomb.ts +3 -3
  19. package/src/ddl2/activities/datasource.ts +25 -18
  20. package/src/ddl2/activities/dspicker.ts +38 -29
  21. package/src/ddl2/activities/filter.ts +79 -56
  22. package/src/ddl2/activities/form.ts +29 -20
  23. package/src/ddl2/activities/groupby.ts +55 -37
  24. package/src/ddl2/activities/hipiepipeline.ts +61 -74
  25. package/src/ddl2/activities/limit.ts +8 -6
  26. package/src/ddl2/activities/logicalfile.ts +14 -10
  27. package/src/ddl2/activities/nullview.ts +1 -1
  28. package/src/ddl2/activities/project.ts +78 -50
  29. package/src/ddl2/activities/rest.ts +95 -70
  30. package/src/ddl2/activities/roxie.ts +55 -41
  31. package/src/ddl2/activities/sort.ts +23 -14
  32. package/src/ddl2/activities/wuresult.ts +78 -54
  33. package/src/ddl2/dashboard.css +8 -8
  34. package/src/ddl2/dashboard.ts +17 -17
  35. package/src/ddl2/dashboardDockPanel.ts +3 -3
  36. package/src/ddl2/dashboardGrid.ts +4 -4
  37. package/src/ddl2/ddl.ts +19 -21
  38. package/src/ddl2/dsTable.ts +22 -18
  39. package/src/ddl2/dvTable.ts +1 -1
  40. package/src/ddl2/graphadapter.ts +11 -11
  41. package/src/ddl2/javascriptadapter.ts +4 -4
  42. package/src/ddl2/model/element.ts +56 -42
  43. package/src/ddl2/model/visualization.ts +92 -70
  44. package/src/ddl2/pipelinePanel.ts +26 -18
  45. package/src/index.ts +25 -25
  46. package/types/__package__.d.ts +3 -4
  47. package/types/dashy.d.ts +9 -7
  48. package/types/ddl2/PopupManager.d.ts +2 -3
  49. package/types/ddl2/activities/activity.d.ts +0 -1
  50. package/types/ddl2/activities/databomb.d.ts +3 -4
  51. package/types/ddl2/activities/datasource.d.ts +12 -10
  52. package/types/ddl2/activities/dspicker.d.ts +11 -8
  53. package/types/ddl2/activities/filter.d.ts +45 -26
  54. package/types/ddl2/activities/form.d.ts +19 -10
  55. package/types/ddl2/activities/groupby.d.ts +29 -15
  56. package/types/ddl2/activities/hipiepipeline.d.ts +27 -20
  57. package/types/ddl2/activities/limit.d.ts +6 -5
  58. package/types/ddl2/activities/logicalfile.d.ts +10 -7
  59. package/types/ddl2/activities/nullview.d.ts +1 -2
  60. package/types/ddl2/activities/project.d.ts +42 -21
  61. package/types/ddl2/activities/rest.d.ts +49 -30
  62. package/types/ddl2/activities/roxie.d.ts +28 -18
  63. package/types/ddl2/activities/sort.d.ts +13 -7
  64. package/types/ddl2/activities/wuresult.d.ts +24 -16
  65. package/types/ddl2/dashboard.d.ts +3 -4
  66. package/types/ddl2/dashboardDockPanel.d.ts +2 -3
  67. package/types/ddl2/dashboardGrid.d.ts +3 -4
  68. package/types/ddl2/ddl.d.ts +11 -12
  69. package/types/ddl2/ddleditor.d.ts +2 -2
  70. package/types/ddl2/dsTable.d.ts +2 -3
  71. package/types/ddl2/dvTable.d.ts +1 -2
  72. package/types/ddl2/graphadapter.d.ts +4 -5
  73. package/types/ddl2/javascriptadapter.d.ts +2 -3
  74. package/types/ddl2/model/element.d.ts +22 -14
  75. package/types/ddl2/model/visualization.d.ts +28 -20
  76. package/types/ddl2/model/vizChartPanel.d.ts +0 -1
  77. package/types/ddl2/pipelinePanel.d.ts +5 -3
  78. package/types/index.d.ts +25 -26
  79. package/dist/index.es6.js +0 -17994
  80. package/dist/index.es6.js.map +0 -1
  81. package/dist/index.min.js +0 -3
  82. package/dist/index.min.js.map +0 -1
  83. package/types/__package__.d.ts.map +0 -1
  84. package/types/dashy.d.ts.map +0 -1
  85. package/types/ddl1/DDLApi.d.ts +0 -179
  86. package/types/ddl1/DDLApi.d.ts.map +0 -1
  87. package/types/ddl1/FlyoutButton.d.ts +0 -24
  88. package/types/ddl1/FlyoutButton.d.ts.map +0 -1
  89. package/types/ddl1/Graph.d.ts +0 -22
  90. package/types/ddl1/Graph.d.ts.map +0 -1
  91. package/types/ddl1/HTML.d.ts +0 -12
  92. package/types/ddl1/HTML.d.ts.map +0 -1
  93. package/types/ddl1/HipieDDL.d.ts +0 -100
  94. package/types/ddl1/HipieDDL.d.ts.map +0 -1
  95. package/types/ddl1/HipieDDLMixin.d.ts +0 -77
  96. package/types/ddl1/HipieDDLMixin.d.ts.map +0 -1
  97. package/types/ddl1/Tabbed.d.ts +0 -12
  98. package/types/ddl1/Tabbed.d.ts.map +0 -1
  99. package/types/ddl1/TargetMarshaller.d.ts +0 -5
  100. package/types/ddl1/TargetMarshaller.d.ts.map +0 -1
  101. package/types/ddl2/PopupManager.d.ts.map +0 -1
  102. package/types/ddl2/activities/activity.d.ts.map +0 -1
  103. package/types/ddl2/activities/databomb.d.ts.map +0 -1
  104. package/types/ddl2/activities/datasource.d.ts.map +0 -1
  105. package/types/ddl2/activities/dspicker.d.ts.map +0 -1
  106. package/types/ddl2/activities/filter.d.ts.map +0 -1
  107. package/types/ddl2/activities/form.d.ts.map +0 -1
  108. package/types/ddl2/activities/groupby.d.ts.map +0 -1
  109. package/types/ddl2/activities/hipiepipeline.d.ts.map +0 -1
  110. package/types/ddl2/activities/limit.d.ts.map +0 -1
  111. package/types/ddl2/activities/logicalfile.d.ts.map +0 -1
  112. package/types/ddl2/activities/nullview.d.ts.map +0 -1
  113. package/types/ddl2/activities/project.d.ts.map +0 -1
  114. package/types/ddl2/activities/rest.d.ts.map +0 -1
  115. package/types/ddl2/activities/roxie.d.ts.map +0 -1
  116. package/types/ddl2/activities/sort.d.ts.map +0 -1
  117. package/types/ddl2/activities/wuresult.d.ts.map +0 -1
  118. package/types/ddl2/dashboard.d.ts.map +0 -1
  119. package/types/ddl2/dashboardDockPanel.d.ts.map +0 -1
  120. package/types/ddl2/dashboardGrid.d.ts.map +0 -1
  121. package/types/ddl2/ddl.d.ts.map +0 -1
  122. package/types/ddl2/ddleditor.d.ts.map +0 -1
  123. package/types/ddl2/dsTable.d.ts.map +0 -1
  124. package/types/ddl2/dvTable.d.ts.map +0 -1
  125. package/types/ddl2/graphadapter.d.ts.map +0 -1
  126. package/types/ddl2/javascriptadapter.d.ts.map +0 -1
  127. package/types/ddl2/model/element.d.ts.map +0 -1
  128. package/types/ddl2/model/visualization.d.ts.map +0 -1
  129. package/types/ddl2/model/vizChartPanel.d.ts.map +0 -1
  130. package/types/ddl2/pipelinePanel.d.ts.map +0 -1
  131. package/types/index.d.ts.map +0 -1
  132. package/types-3.4/__package__.d.ts +0 -4
  133. package/types-3.4/dashy.d.ts +0 -54
  134. package/types-3.4/ddl1/DDLApi.d.ts +0 -179
  135. package/types-3.4/ddl1/FlyoutButton.d.ts +0 -24
  136. package/types-3.4/ddl1/Graph.d.ts +0 -22
  137. package/types-3.4/ddl1/HTML.d.ts +0 -12
  138. package/types-3.4/ddl1/HipieDDL.d.ts +0 -100
  139. package/types-3.4/ddl1/HipieDDLMixin.d.ts +0 -77
  140. package/types-3.4/ddl1/Tabbed.d.ts +0 -12
  141. package/types-3.4/ddl1/TargetMarshaller.d.ts +0 -5
  142. package/types-3.4/ddl2/PopupManager.d.ts +0 -20
  143. package/types-3.4/ddl2/activities/activity.d.ts +0 -106
  144. package/types-3.4/ddl2/activities/databomb.d.ts +0 -46
  145. package/types-3.4/ddl2/activities/datasource.d.ts +0 -24
  146. package/types-3.4/ddl2/activities/dspicker.d.ts +0 -29
  147. package/types-3.4/ddl2/activities/filter.d.ts +0 -113
  148. package/types-3.4/ddl2/activities/form.d.ts +0 -40
  149. package/types-3.4/ddl2/activities/groupby.d.ts +0 -85
  150. package/types-3.4/ddl2/activities/hipiepipeline.d.ts +0 -37
  151. package/types-3.4/ddl2/activities/limit.d.ts +0 -15
  152. package/types-3.4/ddl2/activities/logicalfile.d.ts +0 -19
  153. package/types-3.4/ddl2/activities/nullview.d.ts +0 -6
  154. package/types-3.4/ddl2/activities/project.d.ts +0 -122
  155. package/types-3.4/ddl2/activities/rest.d.ts +0 -142
  156. package/types-3.4/ddl2/activities/roxie.d.ts +0 -112
  157. package/types-3.4/ddl2/activities/sort.d.ts +0 -38
  158. package/types-3.4/ddl2/activities/wuresult.d.ts +0 -87
  159. package/types-3.4/ddl2/dashboard.d.ts +0 -53
  160. package/types-3.4/ddl2/dashboardDockPanel.d.ts +0 -19
  161. package/types-3.4/ddl2/dashboardGrid.d.ts +0 -29
  162. package/types-3.4/ddl2/ddl.d.ts +0 -44
  163. package/types-3.4/ddl2/ddleditor.d.ts +0 -14
  164. package/types-3.4/ddl2/dsTable.d.ts +0 -21
  165. package/types-3.4/ddl2/dvTable.d.ts +0 -10
  166. package/types-3.4/ddl2/graphadapter.d.ts +0 -30
  167. package/types-3.4/ddl2/javascriptadapter.d.ts +0 -31
  168. package/types-3.4/ddl2/model/element.d.ts +0 -99
  169. package/types-3.4/ddl2/model/visualization.d.ts +0 -48
  170. package/types-3.4/ddl2/model/vizChartPanel.d.ts +0 -44
  171. package/types-3.4/ddl2/pipelinePanel.d.ts +0 -16
  172. package/types-3.4/index.d.ts +0 -27
@@ -1,14 +1,9 @@
1
- import { publish } from "@hpcc-js/common";
2
1
  import { DDL2 } from "@hpcc-js/ddl-shim";
3
2
  import { hashSum } from "@hpcc-js/util";
4
- import { Activity } from "./activity";
3
+ import { Activity } from "./activity.ts";
5
4
 
6
5
  export class Limit extends Activity {
7
6
 
8
- @publish(undefined, "number", "Limit output")
9
- rows: publish<this, number | undefined>;
10
- rows_exists: () => boolean;
11
-
12
7
  constructor() {
13
8
  super();
14
9
  }
@@ -47,3 +42,10 @@ export class Limit extends Activity {
47
42
  }
48
43
  }
49
44
  Limit.prototype._class += " Limit";
45
+
46
+ export interface Limit {
47
+ rows(): number | undefined;
48
+ rows(_: number | undefined): this;
49
+ rows_exists(): boolean;
50
+ }
51
+ Limit.prototype.publish("rows", undefined, "number", "Limit output");
@@ -1,18 +1,10 @@
1
- import { publish } from "@hpcc-js/common";
2
1
  import { Result } from "@hpcc-js/comms";
3
2
  import { DDL2 } from "@hpcc-js/ddl-shim";
4
- import { ElementContainer } from "../model/element";
5
- import { ESPResult } from "./wuresult";
3
+ import { ElementContainer } from "../model/element.ts";
4
+ import { ESPResult } from "./wuresult.ts";
6
5
 
7
6
  export class LogicalFile extends ESPResult {
8
7
 
9
- @publish("", "string", "ESP Url (http://x.x.x.x:8010)")
10
- url: publish<this, string>;
11
- @publish("", "string", "Node Group")
12
- nodeGroup: publish<this, string>;
13
- @publish("", "string", "Logical File Name")
14
- logicalFile: publish<this, string>;
15
-
16
8
  constructor(_ec: ElementContainer) {
17
9
  super(_ec);
18
10
  }
@@ -60,3 +52,15 @@ export class LogicalFile extends ESPResult {
60
52
  }
61
53
  }
62
54
  LogicalFile.prototype._class += " LogicalFile";
55
+
56
+ export interface LogicalFile {
57
+ url(): string;
58
+ url(_: string): this;
59
+ nodeGroup(): string;
60
+ nodeGroup(_: string): this;
61
+ logicalFile(): string;
62
+ logicalFile(_: string): this;
63
+ }
64
+ LogicalFile.prototype.publish("url", "", "string", "ESP Url (http://x.x.x.x:8010)");
65
+ LogicalFile.prototype.publish("nodeGroup", "", "string", "Node Group");
66
+ LogicalFile.prototype.publish("logicalFile", "", "string", "Logical File Name");
@@ -1,4 +1,4 @@
1
- import { HipiePipeline } from "./hipiepipeline";
1
+ import { HipiePipeline } from "./hipiepipeline.ts";
2
2
 
3
3
  export class NullView extends HipiePipeline {
4
4
  hash(): string {
@@ -1,22 +1,11 @@
1
- import { PropertyExt, publish, Utility } from "@hpcc-js/common";
1
+ import { PropertyExt, Utility } from "@hpcc-js/common";
2
2
  import { DDL2 } from "@hpcc-js/ddl-shim";
3
3
  import { hashSum, isArray } from "@hpcc-js/util";
4
- import { Activity, IActivityError, ReferencedFields } from "./activity";
4
+ import { Activity, IActivityError, ReferencedFields } from "./activity.ts";
5
5
 
6
6
  export class ComputedMapping extends PropertyExt {
7
7
  protected _owner: ComputedField;
8
8
 
9
- @publish(null, "any", "Compare Value", undefined, {
10
- validate: (w: ComputedMapping): boolean => (!w.value() && !w.newValue()) || (!!w.value() && !!w.newValue())
11
- })
12
- value: publish<this, any>;
13
- value_valid: () => boolean;
14
- @publish(null, "any", "New Value", undefined, {
15
- validate: (w: ComputedMapping): boolean => (!w.value() && !w.newValue()) || (!!w.value() && !!w.newValue())
16
- })
17
- newValue: publish<this, any>;
18
- newValue_valid: () => boolean;
19
-
20
9
  validate(prefix: string): IActivityError[] {
21
10
  const retVal: IActivityError[] = [];
22
11
  if (!this.value_valid()) {
@@ -72,6 +61,15 @@ export class ComputedMapping extends PropertyExt {
72
61
  }
73
62
  ComputedMapping.prototype._class += " ComputedMapping";
74
63
 
64
+ export interface ComputedMapping {
65
+ value(): any;
66
+ value(_: any): this;
67
+ value_valid(): boolean;
68
+ newValue(): any;
69
+ newValue(_: any): this;
70
+ newValue_valid(): boolean;
71
+ }
72
+
75
73
  export type ComputedType = "=" | "*" | "/" | "+" | "-" | "scale" | "template" | "map";
76
74
 
77
75
  export interface IComputedFieldOwner extends PropertyExt {
@@ -82,35 +80,6 @@ export interface IComputedFieldOwner extends PropertyExt {
82
80
  export class ComputedField extends PropertyExt {
83
81
  private _owner: IComputedFieldOwner;
84
82
 
85
- @publish(null, "string", "Label", null, { optional: true })
86
- label: publish<this, string>;
87
- @publish("mapping", "set", "Project type", ["=", "*", "/", "+", "-", "scale", "template", "map"], { optional: true, disable: w => !w.label() })
88
- type: publish<this, ComputedType>;
89
- @publish(null, "set", "Param 1", function (this: ComputedField) { return this.columns(); }, {
90
- optional: true,
91
- disable: (w: ComputedField) => w.disableColumn1(),
92
- validate: (w: ComputedField): boolean => w.columns().indexOf(w.column1()) >= 0
93
- })
94
- column1: publish<this, string>;
95
- column1_valid: () => boolean;
96
- @publish(null, "set", "Param 2", function (this: ComputedField) { return this.columns(); }, {
97
- optional: true,
98
- disable: (w: ComputedField) => w.disableColumn2(),
99
- validate: (w: ComputedField): boolean => w.columns().indexOf(w.column2()) >= 0
100
- })
101
- column2: publish<this, string>;
102
- column2_valid: () => boolean;
103
- @publish(null, "number", "Const value", null, { optional: true, disable: (w: ComputedField) => !w.label() || ["scale"].indexOf(w.type()) < 0 })
104
- constValue: publish<this, number>;
105
- @publish(null, "string", "template", null, { optional: true, disable: (w: ComputedField) => !w.label() || ["template"].indexOf(w.type()) < 0 })
106
- template: publish<this, string>;
107
- @publish(null, "any", "Default Value", null, { optional: true, disable: (w: ComputedField) => !w.label() || ["map"].indexOf(w.type()) < 0 })
108
- default: publish<this, any>;
109
- @publish([], "propertyArray", "Mapped Values", null, { autoExpand: ComputedMapping, disable: (w: ComputedField) => w.disableMapping() })
110
- mapping: publish<this, ComputedMapping[]>;
111
- @publish([], "propertyArray", "Child Fields", null, { autoExpand: ComputedField, disable: (w: ComputedField) => w.disableChildField() })
112
- childField: publish<this, ComputedField[]>;
113
-
114
83
  disableColumn1(): boolean {
115
84
  return !this.label() || ["=", "*", "/", "+", "-", "scale", "map"].indexOf(this.type()) < 0;
116
85
  }
@@ -435,15 +404,34 @@ export class ComputedField extends PropertyExt {
435
404
  }
436
405
  }
437
406
  ComputedField.prototype._class += " ComputedField";
407
+
408
+ export interface ComputedField {
409
+ label(): string;
410
+ label(_: string): this;
411
+ type(): ComputedType;
412
+ type(_: ComputedType): this;
413
+ column1(): string;
414
+ column1(_: string): this;
415
+ column1_valid(): boolean;
416
+ column2(): string;
417
+ column2(_: string): this;
418
+ column2_valid(): boolean;
419
+ constValue(): number;
420
+ constValue(_: number): this;
421
+ template(): string;
422
+ template(_: string): this;
423
+ default(): any;
424
+ default(_: any): this;
425
+ mapping(): ComputedMapping[];
426
+ mapping(_: ComputedMapping[]): this;
427
+ childField(): ComputedField[];
428
+ childField(_: ComputedField[]): this;
429
+ }
430
+
438
431
  // ===========================================================================
439
432
  export class MultiField extends PropertyExt implements IComputedFieldOwner {
440
433
  private _owner: IComputedFieldOwner;
441
434
 
442
- @publish("", "string", "Label")
443
- label: publish<this, string>;
444
- @publish([], "propertyArray", "Multi Fields", null, { autoExpand: ComputedField })
445
- multiFields: publish<this, ComputedField[]>;
446
-
447
435
  constructor() {
448
436
  super();
449
437
  }
@@ -513,6 +501,14 @@ export class MultiField extends PropertyExt implements IComputedFieldOwner {
513
501
  }
514
502
  }
515
503
  MultiField.prototype._class += " MultiField";
504
+
505
+ export interface MultiField {
506
+ label(): string;
507
+ label(_: string): this;
508
+ multiFields(): ComputedField[];
509
+ multiFields(_: ComputedField[]): this;
510
+ }
511
+
516
512
  // ===========================================================================
517
513
  export class ProjectBase extends Activity {
518
514
  static ComputedField = ComputedField;
@@ -520,9 +516,6 @@ export class ProjectBase extends Activity {
520
516
  _includeLParam = false;
521
517
  _trim = false;
522
518
 
523
- @publish([], "propertyArray", "Computed Fields", null, { autoExpand: ComputedField, noDeserialize: true })
524
- computedFields: publish<this, Array<ComputedField | MultiField>>;
525
-
526
519
  validate(): IActivityError[] {
527
520
  let retVal: IActivityError[] = [];
528
521
  for (const cf of this.validComputedFields()) {
@@ -762,3 +755,38 @@ export class Mappings extends ProjectBase {
762
755
  }
763
756
  }
764
757
  Mappings.prototype._class += " Mappings";
758
+
759
+ ComputedMapping.prototype.publish("value", null, "any", "Compare Value", undefined, {
760
+ validate: (w: ComputedMapping): boolean => (!w.value() && !w.newValue()) || (!!w.value() && !!w.newValue())
761
+ });
762
+ ComputedMapping.prototype.publish("newValue", null, "any", "New Value", undefined, {
763
+ validate: (w: ComputedMapping): boolean => (!w.value() && !w.newValue()) || (!!w.value() && !!w.newValue())
764
+ });
765
+
766
+ ComputedField.prototype.publish("label", null, "string", "Label", null, { optional: true });
767
+ ComputedField.prototype.publish("type", "mapping", "set", "Project type", ["=", "*", "/", "+", "-", "scale", "template", "map"], { optional: true, disable: w => !w.label() });
768
+ ComputedField.prototype.publish("column1", null, "set", "Param 1", function (this: ComputedField) { return this.columns(); }, {
769
+ optional: true,
770
+ disable: (w: ComputedField) => w.disableColumn1(),
771
+ validate: (w: ComputedField): boolean => w.columns().indexOf(w.column1()) >= 0
772
+ });
773
+ ComputedField.prototype.publish("column2", null, "set", "Param 2", function (this: ComputedField) { return this.columns(); }, {
774
+ optional: true,
775
+ disable: (w: ComputedField) => w.disableColumn2(),
776
+ validate: (w: ComputedField): boolean => w.columns().indexOf(w.column2()) >= 0
777
+ });
778
+ ComputedField.prototype.publish("constValue", null, "number", "Const value", null, { optional: true, disable: (w: ComputedField) => !w.label() || ["scale"].indexOf(w.type()) < 0 });
779
+ ComputedField.prototype.publish("template", null, "string", "template", null, { optional: true, disable: (w: ComputedField) => !w.label() || ["template"].indexOf(w.type()) < 0 });
780
+ ComputedField.prototype.publish("default", null, "any", "Default Value", null, { optional: true, disable: (w: ComputedField) => !w.label() || ["map"].indexOf(w.type()) < 0 });
781
+ ComputedField.prototype.publish("mapping", [], "propertyArray", "Mapped Values", null, { autoExpand: ComputedMapping, disable: (w: ComputedField) => w.disableMapping() });
782
+ ComputedField.prototype.publish("childField", [], "propertyArray", "Child Fields", null, { autoExpand: ComputedField, disable: (w: ComputedField) => w.disableChildField() });
783
+
784
+ MultiField.prototype.publish("label", "", "string", "Label");
785
+ MultiField.prototype.publish("multiFields", [], "propertyArray", "Multi Fields", null, { autoExpand: ComputedField });
786
+
787
+ export interface ProjectBase {
788
+ computedFields(): Array<ComputedField | MultiField>;
789
+ computedFields(_: Array<ComputedField | MultiField>): this;
790
+ }
791
+
792
+ ProjectBase.prototype.publish("computedFields", [], "propertyArray", "Computed Fields", null, { autoExpand: ComputedField });
@@ -1,18 +1,15 @@
1
- import { PropertyExt, publish } from "@hpcc-js/common";
1
+ import { PropertyExt } from "@hpcc-js/common";
2
2
  import { createConnection } from "@hpcc-js/comms";
3
3
  import { DDL2 } from "@hpcc-js/ddl-shim";
4
4
  import { AsyncOrderedQueue, compare, hashSum } from "@hpcc-js/util";
5
- import { Element, ElementContainer } from "../model/element";
6
- import { IActivityError, ReferencedFields } from "./activity";
7
- import { rowToFields } from "./databomb";
8
- import { Datasource, DatasourceRef } from "./datasource";
5
+ import { Element, ElementContainer } from "../model/element.ts";
6
+ import { IActivityError, ReferencedFields } from "./activity.ts";
7
+ import { rowToFields } from "./databomb.ts";
8
+ import { Datasource, DatasourceRef } from "./datasource.ts";
9
9
 
10
10
  export class RestField extends PropertyExt {
11
11
  protected _owner: RestService;
12
12
 
13
- @publish("", "string", "RestField Label")
14
- fieldID: publish<this, string>;
15
-
16
13
  constructor() {
17
14
  super();
18
15
  }
@@ -51,15 +48,6 @@ export class RestService extends Datasource {
51
48
 
52
49
  private _responseFields: { [outputID: string]: DDL2.IField[] } = {};
53
50
 
54
- @publish("", "string", "REST Url")
55
- url: publish<this, string>;
56
- @publish("", "string", "Query Set")
57
- action: publish<this, string>;
58
- @publish("get", "set", "Request mode", ["get", "post"])
59
- mode: publish<this, "get" | "post">;
60
- @publish([], "propertyArray", "Multi Fields", null, { autoExpand: RestField })
61
- requestFields: publish<this, RestField[]>;
62
-
63
51
  constructor(readonly _ec: ElementContainer) {
64
52
  super();
65
53
  }
@@ -153,22 +141,13 @@ RestService.prototype._class += " RestService";
153
141
 
154
142
  export class RestResult extends Datasource {
155
143
 
156
- @publish(null, "widget", "Rest service")
157
- _service: RestService = new RestService(this._ec);
158
- service(): RestService;
159
- service(_: RestService): this;
160
- service(_?: RestService): this | RestService {
161
- if (!arguments.length) return this._service;
162
- this._service = _;
163
- this._service.refreshMeta();
164
- return this;
165
- }
144
+ _origService;
166
145
 
167
- @publish("", "string", "Result Name")
168
- resultName: publish<this, string>;
146
+ declare _service: RestService;
169
147
 
170
148
  constructor(private _ec: ElementContainer) {
171
149
  super();
150
+ this._service = new RestService(this._ec);
172
151
  }
173
152
 
174
153
  validRequestFields(): RestField[] {
@@ -268,37 +247,6 @@ RestResult.prototype._class += " RestResult";
268
247
 
269
248
  export class Param extends PropertyExt {
270
249
 
271
- @publish(null, "string", "Label") // TODO Add ReadOnly
272
- localField: publish<this, string>;
273
- localField_exists: () => boolean;
274
- @publish(null, "set", "Activity", function (this: Param) { return this.visualizationIDs(); }, {
275
- optional: true,
276
- disable: (w: Param): boolean => w.value_exists(),
277
- validate: (w: Param): boolean => w.source_disabled() || w.visualizationIDs().indexOf(w.source()) >= 0
278
- })
279
- source: publish<this, string>;
280
- source_exists: () => boolean;
281
- source_valid: () => boolean;
282
- source_disabled: () => boolean;
283
- @publish(null, "set", "Source Field", function (this: Param) { return this.sourceFields(); }, {
284
- optional: true,
285
- disable: (w: Param): boolean => !w.source_exists() || w.value_exists(),
286
- validate: (w: Param): boolean => w.remoteField_disabled() || w.sourceFields().indexOf(w.remoteField()) >= 0
287
- })
288
- remoteField: publish<this, string>;
289
- remoteField_exists: () => boolean;
290
- remoteField_valid: () => boolean;
291
- remoteField_disabled: () => boolean;
292
- @publish(null, "string", "Static Value", null, {
293
- optional: true,
294
- disable: (w: Param): boolean => w.source_exists(),
295
- validate: (w: Param): boolean => w.value_disabled() || w.value_exists()
296
- })
297
- value: publish<this, string>;
298
- value_exists: () => boolean;
299
- value_valid: () => boolean;
300
- value_disabled: () => boolean;
301
-
302
250
  validate(prefix: string): IActivityError[] {
303
251
  const retVal: IActivityError[] = [];
304
252
  if (!this.source_valid()) {
@@ -421,16 +369,6 @@ export class RestResultRef extends DatasourceRef {
421
369
  return this.datasource().resultName();
422
370
  }
423
371
 
424
- @publish([], "propertyArray", "Request Fields")
425
- _request: Param[];
426
- request(): Param[];
427
- request(_: Param[]): this;
428
- request(_?: Param[]): Param[] | this {
429
- if (!arguments.length) return this._request;
430
- this._request = _;
431
- return this;
432
- }
433
-
434
372
  validate(): IActivityError[] {
435
373
  let retVal: IActivityError[] = [];
436
374
  for (const filter of this.validParams()) {
@@ -566,3 +504,90 @@ export class RestResultRef extends DatasourceRef {
566
504
  }
567
505
  }
568
506
  RestResultRef.prototype._class += " RestResultRef";
507
+
508
+ export interface RestField {
509
+ fieldID(): string;
510
+ fieldID(_: string): this;
511
+ }
512
+
513
+ RestField.prototype.publish("fieldID", "", "string", "RestField Label");
514
+
515
+ export interface RestService {
516
+ url(): string;
517
+ url(_: string): this;
518
+ action(): string;
519
+ action(_: string): this;
520
+ mode(): "get" | "post";
521
+ mode(_: "get" | "post"): this;
522
+ requestFields(): RestField[];
523
+ requestFields(_: RestField[]): this;
524
+ }
525
+
526
+ RestService.prototype.publish("url", "", "string", "REST Url");
527
+ RestService.prototype.publish("action", "", "string", "Query Set");
528
+ RestService.prototype.publish("mode", "get", "set", "Request mode", ["get", "post"]);
529
+ RestService.prototype.publish("requestFields", [], "propertyArray", "Multi Fields", null, { autoExpand: RestField });
530
+
531
+ export interface RestResult {
532
+ service(): RestService;
533
+ service(_: RestService): this;
534
+ resultName(): string;
535
+ resultName(_: string): this;
536
+ }
537
+
538
+ RestResult.prototype.publish("service", null, "widget", "Rest service");
539
+ RestResult.prototype.publish("resultName", "", "string", "Result Name");
540
+
541
+ RestResult.prototype._origService = RestResult.prototype.service;
542
+ RestResult.prototype.service = function (this: RestResult, _?) {
543
+ const retVal = RestResult.prototype._origService.apply(this, arguments);
544
+ if (_ !== undefined) {
545
+ this._service.refreshMeta();
546
+ }
547
+ return retVal;
548
+ };
549
+
550
+ export interface Param {
551
+ localField(): string;
552
+ localField(_: string): this;
553
+ localField_exists(): boolean;
554
+ source(): string;
555
+ source(_: string): this;
556
+ source_exists(): boolean;
557
+ source_valid(): boolean;
558
+ source_disabled(): boolean;
559
+ remoteField(): string;
560
+ remoteField(_: string): this;
561
+ remoteField_exists(): boolean;
562
+ remoteField_valid(): boolean;
563
+ remoteField_disabled(): boolean;
564
+ value(): string;
565
+ value(_: string): this;
566
+ value_exists(): boolean;
567
+ value_valid(): boolean;
568
+ value_disabled(): boolean;
569
+ }
570
+
571
+ Param.prototype.publish("localField", null, "string", "Label");
572
+ Param.prototype.publish("source", null, "set", "Activity", function (this: Param) { return this.visualizationIDs(); }, {
573
+ optional: true,
574
+ disable: (w: Param): boolean => w.value_exists(),
575
+ validate: (w: Param): boolean => w.source_disabled() || w.visualizationIDs().indexOf(w.source()) >= 0
576
+ });
577
+ Param.prototype.publish("remoteField", null, "set", "Source Field", function (this: Param) { return this.sourceFields(); }, {
578
+ optional: true,
579
+ disable: (w: Param): boolean => !w.source_exists() || w.value_exists(),
580
+ validate: (w: Param): boolean => w.remoteField_disabled() || w.sourceFields().indexOf(w.remoteField()) >= 0
581
+ });
582
+ Param.prototype.publish("value", null, "string", "Static Value", null, {
583
+ optional: true,
584
+ disable: (w: Param): boolean => w.source_exists(),
585
+ validate: (w: Param): boolean => w.value_disabled() || w.value_exists()
586
+ });
587
+
588
+ export interface RestResultRef {
589
+ request(): Param[];
590
+ request(_: Param[]): this;
591
+ }
592
+
593
+ RestResultRef.prototype.publish("request", [], "propertyArray", "Request Fields");
@@ -1,11 +1,10 @@
1
- import { publish } from "@hpcc-js/common";
2
1
  import { Query as CommsQuery } from "@hpcc-js/comms";
3
2
  import { DDL2 } from "@hpcc-js/ddl-shim";
4
3
  import { AsyncOrderedQueue, compare, hashSum } from "@hpcc-js/util";
5
- import { ElementContainer } from "../model/element";
6
- import { IActivityError, ReferencedFields } from "./activity";
7
- import { Datasource, DatasourceRef } from "./datasource";
8
- import { Param } from "./rest";
4
+ import { ElementContainer } from "../model/element.ts";
5
+ import { IActivityError, ReferencedFields } from "./activity.ts";
6
+ import { Datasource, DatasourceRef } from "./datasource.ts";
7
+ import { Param } from "./rest.ts";
9
8
 
10
9
  function parseUrl(_: string): { url: string, querySet: string, queryID: string } {
11
10
  // "http://10.241.100.157:8002/WsEcl/submit/query/roxie/carmigjx_govbisgsavi.Ins4621360_Service_00000006/json",
@@ -38,17 +37,6 @@ export class RoxieService extends Datasource {
38
37
  private _responseFields: { [outputID: string]: DDL2.IField[] } = {};
39
38
  private _type: "roxie" | "hipie" = "roxie";
40
39
 
41
- @publish("", "string", "ESP Url (http://x.x.x.x:8002)")
42
- url: publish<this, string>;
43
- @publish("", "string", "Query Set")
44
- querySet: publish<this, string>;
45
- @publish("", "string", "Query ID")
46
- queryID: publish<this, string>;
47
- @publish(false, "boolean", "Ignore provided DDL request")
48
- ignoreHipieRequest: publish<this, boolean>;
49
- @publish(false, "boolean", "Ignore provided DDL response")
50
- ignoreHipieResponse: publish<this, boolean>;
51
-
52
40
  constructor(private _ec: ElementContainer) {
53
41
  super();
54
42
  }
@@ -178,26 +166,34 @@ export class RoxieService extends Datasource {
178
166
  }
179
167
  RoxieService.prototype._class += " RoxieService";
180
168
 
169
+ export interface RoxieService {
170
+ url(): string;
171
+ url(_: string): this;
172
+ querySet(): string;
173
+ querySet(_: string): this;
174
+ queryID(): string;
175
+ queryID(_: string): this;
176
+ ignoreHipieRequest(): boolean;
177
+ ignoreHipieRequest(_: boolean): this;
178
+ ignoreHipieResponse(): boolean;
179
+ ignoreHipieResponse(_: boolean): this;
180
+ }
181
+
182
+ RoxieService.prototype.publish("url", "", "string", "ESP Url (http://x.x.x.x:8002)");
183
+ RoxieService.prototype.publish("querySet", "", "string", "Query Set");
184
+ RoxieService.prototype.publish("queryID", "", "string", "Query ID");
185
+ RoxieService.prototype.publish("ignoreHipieRequest", false, "boolean", "Ignore provided DDL request");
186
+ RoxieService.prototype.publish("ignoreHipieResponse", false, "boolean", "Ignore provided DDL response");
187
+
181
188
  export class RoxieResult extends Datasource {
182
189
 
183
- @publish(null, "widget", "Roxie service")
184
- _service: RoxieService = new RoxieService(this._ec);
185
- service(): RoxieService;
186
- service(_: RoxieService): this;
187
- service(_?: RoxieService): this | RoxieService {
188
- if (!arguments.length) return this._service;
189
- this._service = _;
190
- this._service.refreshMeta();
191
- return this;
192
- }
190
+ _origService;
193
191
 
194
- @publish("", "set", "Result Name", function (this: RoxieResult): string[] {
195
- return this._service !== undefined ? this._service.resultNames() : [];
196
- })
197
- resultName: publish<this, string>;
192
+ declare _service: RoxieService;
198
193
 
199
194
  constructor(private _ec: ElementContainer) {
200
195
  super();
196
+ this._service = new RoxieService(this._ec);
201
197
  }
202
198
 
203
199
  toDDL(): DDL2.IRoxieService | DDL2.IHipieService {
@@ -263,6 +259,27 @@ export class RoxieResult extends Datasource {
263
259
  }
264
260
  RoxieResult.prototype._class += " RoxieResult";
265
261
 
262
+ export interface RoxieResult {
263
+ service(): RoxieService;
264
+ service(_: RoxieService): this;
265
+ resultName(): string;
266
+ resultName(_: string): this;
267
+ }
268
+
269
+ RoxieResult.prototype.publish("service", null, "widget", "Roxie service");
270
+ RoxieResult.prototype.publish("resultName", "", "set", "Result Name", function (this: RoxieResult): string[] {
271
+ return this._service !== undefined ? this._service.resultNames() : [];
272
+ });
273
+
274
+ RoxieResult.prototype._origService = RoxieResult.prototype.service;
275
+ RoxieResult.prototype.service = function (this: RoxieResult, _?) {
276
+ const retVal = RoxieResult.prototype._origService.apply(this, arguments);
277
+ if (_ !== undefined) {
278
+ this._service.refreshMeta();
279
+ }
280
+ return retVal;
281
+ };
282
+
266
283
  export class RoxieResultRef extends DatasourceRef {
267
284
 
268
285
  serviceID(): string {
@@ -293,16 +310,6 @@ export class RoxieResultRef extends DatasourceRef {
293
310
  return this.datasource().resultName();
294
311
  }
295
312
 
296
- @publish([], "propertyArray", "Request Fields")
297
- _request: Param[];
298
- request(): Param[];
299
- request(_: Param[]): this;
300
- request(_?: Param[]): Param[] | this {
301
- if (!arguments.length) return this._request;
302
- this._request = _;
303
- return this;
304
- }
305
-
306
313
  validate(): IActivityError[] {
307
314
  let retVal: IActivityError[] = [];
308
315
  for (const filter of this.validParams()) {
@@ -467,6 +474,13 @@ export class RoxieResultRef extends DatasourceRef {
467
474
  }
468
475
  RoxieResultRef.prototype._class += " RoxieResultRef";
469
476
 
477
+ export interface RoxieResultRef {
478
+ request(): Param[];
479
+ request(_: Param[]): this;
480
+ }
481
+
482
+ RoxieResultRef.prototype.publish("request", [], "propertyArray", "Request Fields");
483
+
470
484
  export class HipieResultRef extends RoxieResultRef {
471
485
 
472
486
  fullUrl(_: string): this {
@@ -487,4 +501,4 @@ export class HipieResultRef extends RoxieResultRef {
487
501
  return request;
488
502
  }
489
503
  }
490
- HipieResultRef.prototype._class += " HipieResultRef";
504
+ HipieResultRef.prototype._class += " HipieResultRef";
@@ -1,21 +1,12 @@
1
- import { PropertyExt, publish } from "@hpcc-js/common";
1
+ import { PropertyExt } from "@hpcc-js/common";
2
2
  import { DDL2 } from "@hpcc-js/ddl-shim";
3
3
  import { hashSum } from "@hpcc-js/util";
4
4
  import { ascending as d3Ascending, descending as d3Descending } from "d3-array";
5
- import { Activity, IActivityError, ReferencedFields } from "./activity";
5
+ import { Activity, IActivityError, ReferencedFields } from "./activity.ts";
6
6
 
7
7
  export class SortColumn extends PropertyExt {
8
8
  private _owner: Sort;
9
9
 
10
- @publish(null, "set", "Sort Field", function (this: SortColumn) { return this.fieldIDs(); }, {
11
- optional: true,
12
- validate: (w: SortColumn): boolean => w.fieldIDs().indexOf(w.fieldID()) >= 0
13
- })
14
- fieldID: publish<this, string>;
15
- fieldID_valid: () => boolean;
16
- @publish(false, "boolean", "Sort Field")
17
- descending: publish<this, boolean>;
18
-
19
10
  validate(prefix: string): IActivityError[] {
20
11
  const retVal: IActivityError[] = [];
21
12
  if (!this.fieldID_valid()) {
@@ -81,13 +72,18 @@ export class SortColumn extends PropertyExt {
81
72
  }
82
73
  SortColumn.prototype._class += " SortColumn";
83
74
 
75
+ export interface SortColumn {
76
+ fieldID(): string;
77
+ fieldID(_: string): this;
78
+ fieldID_valid(): boolean;
79
+ descending(): boolean;
80
+ descending(_: boolean): this;
81
+ }
82
+
84
83
  // ===========================================================================
85
84
  export class Sort extends Activity {
86
85
  static Column = SortColumn;
87
86
 
88
- @publish([], "propertyArray", "Source Columns", null, { autoExpand: SortColumn })
89
- column: publish<this, SortColumn[]>;
90
-
91
87
  validate(): IActivityError[] {
92
88
  let retVal: IActivityError[] = [];
93
89
  for (const sb of this.validSortBy()) {
@@ -174,3 +170,16 @@ export class Sort extends Activity {
174
170
  }
175
171
  }
176
172
  Sort.prototype._class += " Sort";
173
+
174
+ export interface Sort {
175
+ column(): SortColumn[];
176
+ column(_: SortColumn[]): this;
177
+ }
178
+
179
+ SortColumn.prototype.publish("fieldID", null, "set", "Sort Field", function (this: SortColumn) { return this.fieldIDs(); }, {
180
+ optional: true,
181
+ validate: (w: SortColumn): boolean => w.fieldIDs().indexOf(w.fieldID()) >= 0
182
+ });
183
+ SortColumn.prototype.publish("descending", false, "boolean", "Sort Field");
184
+
185
+ Sort.prototype.publish("column", [], "propertyArray", "Source Columns", null, { autoExpand: SortColumn });