meadow-integration 1.0.20 → 1.0.21

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 (29) hide show
  1. package/example-applications/mapping-demo/.quackage.json +10 -0
  2. package/example-applications/mapping-demo/README.md +99 -0
  3. package/example-applications/mapping-demo/data/books-sample.csv +21 -0
  4. package/example-applications/mapping-demo/generate-build-config.js +44 -0
  5. package/example-applications/mapping-demo/mappings/books-to-book.json +14 -0
  6. package/example-applications/mapping-demo/package.json +14 -0
  7. package/example-applications/mapping-demo/server.js +814 -0
  8. package/example-applications/mapping-demo/source/MappingDemoApp.js +52 -0
  9. package/example-applications/mapping-demo/source/views/MappingDemoEditorView.js +186 -0
  10. package/example-applications/mapping-demo/web/index.html +892 -0
  11. package/example-applications/mapping-demo/web/mapping-demo-editor.js +3195 -0
  12. package/example-applications/mapping-demo/web/mapping-demo-editor.js.map +1 -0
  13. package/example-applications/mapping-demo/web/mapping-demo-editor.min.js +2 -0
  14. package/example-applications/mapping-demo/web/mapping-demo-editor.min.js.map +1 -0
  15. package/example-applications/mapping-demo/web/pict.min.js +12 -0
  16. package/package.json +8 -4
  17. package/source/Meadow-Integration-Browser.js +31 -0
  18. package/source/Meadow-Integration.js +16 -1
  19. package/source/services/certainty/Service-CertaintyAccumulator.js +402 -0
  20. package/source/services/clone/Meadow-Service-Sync-Entity-Initial.js +16 -3
  21. package/source/services/clone/Meadow-Service-Sync-Entity-Ongoing.js +15 -2
  22. package/source/services/clone/Meadow-Service-Sync.js +21 -0
  23. package/source/views/MappingEditor-SchemaUtils.js +71 -0
  24. package/source/views/PictView-MeadowMappingEditor.js +1299 -0
  25. package/source/views/flow-cards/FlowCard-MappingSource.js +50 -0
  26. package/source/views/flow-cards/FlowCard-MappingTarget.js +49 -0
  27. package/source/views/flow-cards/FlowCard-SolverExpression.js +78 -0
  28. package/source/views/flow-cards/FlowCard-TemplateExpression.js +77 -0
  29. package/test/Meadow-Integration-CloneDeleteSync_test.js +809 -0
@@ -0,0 +1,50 @@
1
+ const libPictFlowCard = require('pict-section-flow').PictFlowCard;
2
+
3
+ /**
4
+ * FlowCard-MappingSource
5
+ *
6
+ * Represents a source dataset in the mapping flow.
7
+ * Output ports are dynamically generated from discovered fields.
8
+ */
9
+ class FlowCardMappingSource extends libPictFlowCard
10
+ {
11
+ constructor(pFable, pOptions, pServiceHash)
12
+ {
13
+ let tmpOptions = Object.assign({},
14
+ {
15
+ Title: 'Mapping Source',
16
+ Name: 'Mapping Source',
17
+ Code: 'SRC',
18
+ Category: 'Data Source',
19
+ Description: 'Source dataset with discovered record fields',
20
+ TitleBarColor: '#2980b9',
21
+ Width: 200,
22
+ Height: 100,
23
+ Inputs: [],
24
+ Outputs:
25
+ [
26
+ { Name: 'Whole Record', Side: 'right' }
27
+ ],
28
+ ShowTypeLabel: true,
29
+ PortLabelsOnHover: false,
30
+ PortLabelsOutside: true
31
+ },
32
+ pOptions);
33
+
34
+ super(pFable, tmpOptions, pServiceHash);
35
+
36
+ this.serviceType = 'FlowCardMappingSource';
37
+ }
38
+ }
39
+
40
+ module.exports = FlowCardMappingSource;
41
+
42
+ module.exports.default_configuration =
43
+ {
44
+ Title: 'Mapping Source',
45
+ Code: 'SRC',
46
+ Category: 'Data Source',
47
+ TitleBarColor: '#2980b9',
48
+ Width: 200,
49
+ Height: 100
50
+ };
@@ -0,0 +1,49 @@
1
+ const libPictFlowCard = require('pict-section-flow').PictFlowCard;
2
+
3
+ /**
4
+ * FlowCard-MappingTarget
5
+ *
6
+ * Represents the mapping target table in the mapping flow.
7
+ * Input ports are dynamically generated from schema columns.
8
+ */
9
+ class FlowCardMappingTarget extends libPictFlowCard
10
+ {
11
+ constructor(pFable, pOptions, pServiceHash)
12
+ {
13
+ let tmpOptions = Object.assign({},
14
+ {
15
+ Title: 'Mapping Target',
16
+ Name: 'Mapping Target',
17
+ Code: 'TGT',
18
+ Category: 'Data Target',
19
+ Description: 'Mapping target table with schema columns',
20
+ TitleBarColor: '#27ae60',
21
+ Width: 200,
22
+ Height: 100,
23
+ Inputs:
24
+ [
25
+ ],
26
+ Outputs: [],
27
+ ShowTypeLabel: true,
28
+ PortLabelsOnHover: false,
29
+ PortLabelsOutside: true
30
+ },
31
+ pOptions);
32
+
33
+ super(pFable, tmpOptions, pServiceHash);
34
+
35
+ this.serviceType = 'FlowCardMappingTarget';
36
+ }
37
+ }
38
+
39
+ module.exports = FlowCardMappingTarget;
40
+
41
+ module.exports.default_configuration =
42
+ {
43
+ Title: 'Mapping Target',
44
+ Code: 'TGT',
45
+ Category: 'Data Target',
46
+ TitleBarColor: '#27ae60',
47
+ Width: 200,
48
+ Height: 100
49
+ };
@@ -0,0 +1,78 @@
1
+ const libPictFlowCard = require('pict-section-flow').PictFlowCard;
2
+
3
+ /**
4
+ * FlowCard-SolverExpression
5
+ *
6
+ * A transform card that applies a Fable ExpressionParser solver expression
7
+ * to compute a derived value from the whole incoming record. Connect the
8
+ * Source "Whole Record" output to this card's input, then connect this
9
+ * card's output to a target column.
10
+ *
11
+ * Double-click the node to edit the solver expression in the properties panel.
12
+ *
13
+ * @class FlowCardSolverExpression
14
+ * @extends PictFlowCard
15
+ */
16
+ class FlowCardSolverExpression extends libPictFlowCard
17
+ {
18
+ constructor(pFable, pOptions, pServiceHash)
19
+ {
20
+ let tmpOptions = Object.assign({},
21
+ {
22
+ Title: 'Solver Expression',
23
+ Name: 'Solver Expression',
24
+ Code: 'SOL',
25
+ Category: 'Transform',
26
+ Description: 'Apply a Fable solver expression for conditional logic and computed values',
27
+ TitleBarColor: '#d35400',
28
+ Width: 220,
29
+ Height: 90,
30
+ Inputs:
31
+ [
32
+ { Name: 'Whole Record', Side: 'left' }
33
+ ],
34
+ Outputs:
35
+ [
36
+ { Name: 'Result', Side: 'right' }
37
+ ],
38
+ ShowTypeLabel: true,
39
+ PortLabelsOnHover: false,
40
+ PortLabelsOutside: true,
41
+ LabelsInFront: true,
42
+ Enabled: true,
43
+ BodyContent:
44
+ {
45
+ ContentType: 'html',
46
+ Template: '<div style="font-size:10px; padding:2px 4px; color:#ccc; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; max-width:200px;">{~D:Record.Data.SolverExpression~}</div>'
47
+ },
48
+ PropertiesPanel:
49
+ {
50
+ PanelType: 'Template',
51
+ DefaultWidth: 420,
52
+ DefaultHeight: 160,
53
+ Title: 'Solver Expression',
54
+ Configuration:
55
+ {
56
+ Template: '<div style="padding:8px;"><label style="display:block; margin-bottom:4px; font-weight:bold; font-size:12px;">Solver Expression</label><textarea id="FlowCard-SOL-{~D:Record.Hash~}" style="width:100%; height:80px; font-family:monospace; font-size:12px; resize:vertical; background:#1a1a2e; color:#e0e0e0; border:1px solid #444; border-radius:4px; padding:6px;" onchange="(function(el){var n=pict.views[\'MeadowMapping-Flow\'];if(n&&n._FlowData){for(var i=0;i<n._FlowData.Nodes.length;i++){if(n._FlowData.Nodes[i].Hash===\'{~D:Record.Hash~}\'){n._FlowData.Nodes[i].Data.SolverExpression=el.value;if(typeof n.renderFlow===\'function\')n.renderFlow();break;}}}})(this)">{~D:Record.Data.SolverExpression~}</textarea><div style="font-size:10px; color:#888; margin-top:4px;">Example: IF(IncomingRecord.Type == \'Premium\', \'GOLD\', \'SILVER\')</div></div>'
57
+ }
58
+ }
59
+ },
60
+ pOptions);
61
+
62
+ super(pFable, tmpOptions, pServiceHash);
63
+
64
+ this.serviceType = 'FlowCardSolverExpression';
65
+ }
66
+ }
67
+
68
+ module.exports = FlowCardSolverExpression;
69
+
70
+ module.exports.default_configuration =
71
+ {
72
+ Title: 'Solver Expression',
73
+ Code: 'SOL',
74
+ Category: 'Transform',
75
+ TitleBarColor: '#d35400',
76
+ Width: 220,
77
+ Height: 90
78
+ };
@@ -0,0 +1,77 @@
1
+ const libPictFlowCard = require('pict-section-flow').PictFlowCard;
2
+
3
+ /**
4
+ * FlowCard-TemplateExpression
5
+ *
6
+ * A transform card that applies a Manyfest template expression to the
7
+ * whole incoming record. Connect the Source "Whole Record" output to this
8
+ * card's input, then connect this card's output to a target column.
9
+ *
10
+ * Double-click the node to edit the template expression in the properties panel.
11
+ *
12
+ * @class FlowCardTemplateExpression
13
+ * @extends PictFlowCard
14
+ */
15
+ class FlowCardTemplateExpression extends libPictFlowCard
16
+ {
17
+ constructor(pFable, pOptions, pServiceHash)
18
+ {
19
+ let tmpOptions = Object.assign({},
20
+ {
21
+ Title: 'Template Expression',
22
+ Name: 'Template Expression',
23
+ Code: 'TPL',
24
+ Category: 'Transform',
25
+ Description: 'Apply a Manyfest template expression to map source fields to a target column',
26
+ TitleBarColor: '#8e44ad',
27
+ Width: 220,
28
+ Height: 90,
29
+ Inputs:
30
+ [
31
+ { Name: 'Whole Record', Side: 'left' }
32
+ ],
33
+ Outputs:
34
+ [
35
+ { Name: 'Result', Side: 'right' }
36
+ ],
37
+ ShowTypeLabel: true,
38
+ PortLabelsOnHover: false,
39
+ PortLabelsOutside: true,
40
+ LabelsInFront: true,
41
+ Enabled: true,
42
+ BodyContent:
43
+ {
44
+ ContentType: 'html',
45
+ Template: '<div style="font-size:10px; padding:2px 4px; color:#ccc; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; max-width:200px;">{~D:Record.Data.TemplateExpression~}</div>'
46
+ },
47
+ PropertiesPanel:
48
+ {
49
+ PanelType: 'Template',
50
+ DefaultWidth: 420,
51
+ DefaultHeight: 160,
52
+ Title: 'Template Expression',
53
+ Configuration:
54
+ {
55
+ Template: '<div style="padding:8px;"><label style="display:block; margin-bottom:4px; font-weight:bold; font-size:12px;">Template Expression</label><textarea id="FlowCard-TPL-{~D:Record.Hash~}" style="width:100%; height:80px; font-family:monospace; font-size:12px; resize:vertical; background:#1a1a2e; color:#e0e0e0; border:1px solid #444; border-radius:4px; padding:6px;" onchange="(function(el){var n=pict.views[\'MeadowMapping-Flow\'];if(n&&n._FlowData){for(var i=0;i<n._FlowData.Nodes.length;i++){if(n._FlowData.Nodes[i].Hash===\'{~D:Record.Hash~}\'){n._FlowData.Nodes[i].Data.TemplateExpression=el.value;if(typeof n.renderFlow===\'function\')n.renderFlow();break;}}}})(this)">{~D:Record.Data.TemplateExpression~}</textarea><div style="font-size:10px; color:#888; margin-top:4px;">Use {~D:Record.FieldName~} syntax. Example: {~D:Record.Name~} in {~D:Record.City~}</div></div>'
56
+ }
57
+ }
58
+ },
59
+ pOptions);
60
+
61
+ super(pFable, tmpOptions, pServiceHash);
62
+
63
+ this.serviceType = 'FlowCardTemplateExpression';
64
+ }
65
+ }
66
+
67
+ module.exports = FlowCardTemplateExpression;
68
+
69
+ module.exports.default_configuration =
70
+ {
71
+ Title: 'Template Expression',
72
+ Code: 'TPL',
73
+ Category: 'Transform',
74
+ TitleBarColor: '#8e44ad',
75
+ Width: 220,
76
+ Height: 90
77
+ };