@sakibcoolz/core 0.1.2 → 0.2.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 (142) hide show
  1. package/README.md +67 -7
  2. package/dist/acquisition.d.ts +29 -0
  3. package/dist/acquisition.d.ts.map +1 -0
  4. package/dist/acquisition.js +30 -0
  5. package/dist/acquisition.js.map +1 -0
  6. package/dist/assembly.d.ts +5 -2
  7. package/dist/assembly.d.ts.map +1 -1
  8. package/dist/assembly.js +7 -4
  9. package/dist/assembly.js.map +1 -1
  10. package/dist/attach.d.ts +4 -2
  11. package/dist/attach.d.ts.map +1 -1
  12. package/dist/attach.js +5 -3
  13. package/dist/attach.js.map +1 -1
  14. package/dist/clipboard.d.ts +6 -4
  15. package/dist/clipboard.d.ts.map +1 -1
  16. package/dist/clipboard.js +25 -4
  17. package/dist/clipboard.js.map +1 -1
  18. package/dist/collision.d.ts +2 -2
  19. package/dist/collision.js.map +1 -1
  20. package/dist/digest.d.ts +9 -0
  21. package/dist/digest.d.ts.map +1 -0
  22. package/dist/digest.js +68 -0
  23. package/dist/digest.js.map +1 -0
  24. package/dist/flow.d.ts +3 -2
  25. package/dist/flow.d.ts.map +1 -1
  26. package/dist/flow.js.map +1 -1
  27. package/dist/graph.d.ts +67 -7
  28. package/dist/graph.d.ts.map +1 -1
  29. package/dist/graph.js +195 -10
  30. package/dist/graph.js.map +1 -1
  31. package/dist/index.d.ts +13 -6
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +7 -3
  34. package/dist/index.js.map +1 -1
  35. package/dist/observation.d.ts +1 -1
  36. package/dist/observation.d.ts.map +1 -1
  37. package/dist/observation.js +4 -1
  38. package/dist/observation.js.map +1 -1
  39. package/dist/routing.d.ts +6 -3
  40. package/dist/routing.d.ts.map +1 -1
  41. package/dist/routing.js +12 -2
  42. package/dist/routing.js.map +1 -1
  43. package/dist/scene.d.ts +245 -5
  44. package/dist/scene.d.ts.map +1 -1
  45. package/dist/scene.js +94 -3
  46. package/dist/scene.js.map +1 -1
  47. package/dist/serialization.d.ts +7 -7
  48. package/dist/serialization.d.ts.map +1 -1
  49. package/dist/serialization.js +120 -8
  50. package/dist/serialization.js.map +1 -1
  51. package/dist/snapping.d.ts +2 -2
  52. package/dist/snapping.d.ts.map +1 -1
  53. package/dist/snapping.js +10 -7
  54. package/dist/snapping.js.map +1 -1
  55. package/dist/status.d.ts +56 -0
  56. package/dist/status.d.ts.map +1 -0
  57. package/dist/status.js +114 -0
  58. package/dist/status.js.map +1 -0
  59. package/dist/tags.d.ts +52 -0
  60. package/dist/tags.d.ts.map +1 -0
  61. package/dist/tags.js +103 -0
  62. package/dist/tags.js.map +1 -0
  63. package/dist/telemetry.d.ts +42 -4
  64. package/dist/telemetry.d.ts.map +1 -1
  65. package/dist/telemetry.js +84 -8
  66. package/dist/telemetry.js.map +1 -1
  67. package/dist/touching.d.ts +2 -2
  68. package/dist/touching.d.ts.map +1 -1
  69. package/dist/touching.js +7 -4
  70. package/dist/touching.js.map +1 -1
  71. package/dist/units.js +1 -1
  72. package/dist/units.js.map +1 -1
  73. package/dist/upgrade.d.ts +2 -2
  74. package/dist/upgrade.js.map +1 -1
  75. package/dist/validation.d.ts +33 -6
  76. package/dist/validation.d.ts.map +1 -1
  77. package/dist/validation.js +806 -39
  78. package/dist/validation.js.map +1 -1
  79. package/package.json +4 -2
  80. package/schema/fixtures/invalid/association-without-relationship.scene.json +69 -0
  81. package/schema/fixtures/invalid/binding-kind.scene.json +14 -0
  82. package/schema/fixtures/invalid/command-zero-step.scene.json +105 -0
  83. package/schema/fixtures/invalid/empty-name.scene.json +30 -0
  84. package/schema/fixtures/invalid/expected.json +70 -0
  85. package/schema/fixtures/invalid/extension-not-namespaced.scene.json +10 -0
  86. package/schema/fixtures/invalid/extension-prototype-key.scene.json +12 -0
  87. package/schema/fixtures/invalid/missing-document-type.scene.json +6 -0
  88. package/schema/fixtures/invalid/non-string-label.scene.json +32 -0
  89. package/schema/fixtures/invalid/underlay-opacity.scene.json +17 -0
  90. package/schema/fixtures/invalid/unknown-component-kind.scene.json +29 -0
  91. package/schema/fixtures/invalid/unknown-relationship.scene.json +63 -0
  92. package/schema/fixtures/invalid/unknown-root-field.scene.json +8 -0
  93. package/schema/fixtures/invalid/unsupported-version.scene.json +7 -0
  94. package/schema/fixtures/invalid/view-rotation.scene.json +139 -0
  95. package/schema/fixtures/invalid/writable-string.scene.json +93 -0
  96. package/schema/fixtures/invalid/writable-without-limits.scene.json +100 -0
  97. package/schema/fixtures/invalid/zero-scale.scene.json +29 -0
  98. package/schema/fixtures/migration/README.md +18 -0
  99. package/schema/fixtures/migration/v1-demo.scene.json +160 -0
  100. package/schema/fixtures/migration/v1-demo.v4.json +198 -0
  101. package/schema/fixtures/migration/v2-demo.scene.json +244 -0
  102. package/schema/fixtures/migration/v2-demo.v4.json +245 -0
  103. package/schema/fixtures/migration/v2-generated-12.scene.json +473 -0
  104. package/schema/fixtures/migration/v2-generated-12.v4.json +474 -0
  105. package/schema/fixtures/migration/v3-demo.scene.json +244 -0
  106. package/schema/fixtures/migration/v3-demo.v4.json +245 -0
  107. package/schema/fixtures/migration/v3-generated-12.scene.json +473 -0
  108. package/schema/fixtures/migration/v3-generated-12.v4.json +474 -0
  109. package/schema/fixtures/migration/v3-mostly-connected-plant.scene.json +386 -0
  110. package/schema/fixtures/migration/v3-mostly-connected-plant.v4.json +387 -0
  111. package/schema/fixtures/migration/v3-open-joints-plant.scene.json +288 -0
  112. package/schema/fixtures/migration/v3-open-joints-plant.v4.json +289 -0
  113. package/schema/fixtures/migration/v3-unconnected-plant.scene.json +14 -0
  114. package/schema/fixtures/migration/v3-unconnected-plant.v4.json +276 -0
  115. package/schema/fixtures/projection/acquisition.plan.json +50 -0
  116. package/schema/fixtures/projection/control-line.plan.json +86 -0
  117. package/schema/fixtures/valid/acquisition.scene.json +117 -0
  118. package/schema/fixtures/valid/associations.scene.json +79 -0
  119. package/schema/fixtures/valid/commands.scene.json +155 -0
  120. package/schema/fixtures/valid/control-line.scene.json +210 -0
  121. package/schema/fixtures/valid/empty.scene.json +7 -0
  122. package/schema/fixtures/valid/identity-and-extensions.scene.json +96 -0
  123. package/schema/fixtures/valid/tank-valve-line.scene.json +89 -0
  124. package/schema/fixtures/valid/views.scene.json +139 -0
  125. package/schema/fixtures/validator-only/association-id-reuses-connection.scene.json +70 -0
  126. package/schema/fixtures/validator-only/association-unknown-component.scene.json +70 -0
  127. package/schema/fixtures/validator-only/command-max-below-min.scene.json +104 -0
  128. package/schema/fixtures/validator-only/command-out-of-type-range.scene.json +97 -0
  129. package/schema/fixtures/validator-only/connection-domain-mismatch.scene.json +63 -0
  130. package/schema/fixtures/validator-only/credential-in-connection.scene.json +66 -0
  131. package/schema/fixtures/validator-only/credential-in-extension.scene.json +14 -0
  132. package/schema/fixtures/validator-only/credential-label.scene.json +32 -0
  133. package/schema/fixtures/validator-only/duplicate-component-id.scene.json +50 -0
  134. package/schema/fixtures/validator-only/endpoint-with-credentials.scene.json +74 -0
  135. package/schema/fixtures/validator-only/expected.json +66 -0
  136. package/schema/fixtures/validator-only/modbus-coil-float.scene.json +100 -0
  137. package/schema/fixtures/validator-only/non-unit-rotation.scene.json +29 -0
  138. package/schema/fixtures/validator-only/unknown-data-source.scene.json +100 -0
  139. package/schema/fixtures/validator-only/unknown-port.scene.json +62 -0
  140. package/schema/fixtures/validator-only/unregistered-host-type.scene.json +29 -0
  141. package/schema/fixtures/validator-only/view-unknown-component.scene.json +143 -0
  142. package/schema/industrial-scene.v4.schema.json +365 -0
@@ -0,0 +1,100 @@
1
+ {
2
+ "schemaVersion": 4,
3
+ "documentType": "industrial.scene",
4
+ "units": "m",
5
+ "components": [
6
+ {
7
+ "id": "T1",
8
+ "type": "tank",
9
+ "position": {
10
+ "x": 0,
11
+ "y": 0.5,
12
+ "z": 0
13
+ },
14
+ "rotation": {
15
+ "x": 0,
16
+ "y": 0,
17
+ "z": 0,
18
+ "w": 1
19
+ },
20
+ "scale": {
21
+ "x": 1,
22
+ "y": 1,
23
+ "z": 1
24
+ },
25
+ "properties": {}
26
+ },
27
+ {
28
+ "id": "V1",
29
+ "type": "valve",
30
+ "position": {
31
+ "x": 2,
32
+ "y": 0.5,
33
+ "z": 0
34
+ },
35
+ "rotation": {
36
+ "x": 0,
37
+ "y": 0,
38
+ "z": 0,
39
+ "w": 1
40
+ },
41
+ "scale": {
42
+ "x": 1,
43
+ "y": 1,
44
+ "z": 1
45
+ },
46
+ "properties": {}
47
+ }
48
+ ],
49
+ "connections": [
50
+ {
51
+ "id": "c",
52
+ "from": {
53
+ "instanceId": "T1",
54
+ "portId": "outlet"
55
+ },
56
+ "to": {
57
+ "instanceId": "V1",
58
+ "portId": "in"
59
+ }
60
+ }
61
+ ],
62
+ "dataSources": [
63
+ {
64
+ "id": "ds-plc",
65
+ "name": "Line PLC",
66
+ "protocol": "modbus-tcp",
67
+ "endpointRef": "host:gateway-3/plc-01",
68
+ "properties": {
69
+ "pollMs": 500
70
+ }
71
+ }
72
+ ],
73
+ "runtimeVariables": [
74
+ {
75
+ "id": "LT-101",
76
+ "name": "Tank level",
77
+ "componentId": "T1",
78
+ "dataType": "float32",
79
+ "unit": "%",
80
+ "access": "readWrite",
81
+ "source": {
82
+ "dataSourceId": "ds-plc",
83
+ "address": {
84
+ "area": "holding",
85
+ "address": 40,
86
+ "unitId": 1,
87
+ "byteOrder": "big",
88
+ "wordOrder": "high-first"
89
+ }
90
+ },
91
+ "scaling": {
92
+ "kind": "linear",
93
+ "rawMin": 0,
94
+ "rawMax": 27648,
95
+ "min": 0,
96
+ "max": 100
97
+ }
98
+ }
99
+ ]
100
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "schemaVersion": 4,
3
+ "documentType": "industrial.scene",
4
+ "units": "m",
5
+ "components": [
6
+ {
7
+ "id": "P1",
8
+ "type": "pump",
9
+ "position": {
10
+ "x": 0,
11
+ "y": 0.5,
12
+ "z": 0
13
+ },
14
+ "rotation": {
15
+ "x": 0,
16
+ "y": 0,
17
+ "z": 0,
18
+ "w": 1
19
+ },
20
+ "scale": {
21
+ "x": 0,
22
+ "y": 1,
23
+ "z": 1
24
+ },
25
+ "properties": {}
26
+ }
27
+ ],
28
+ "connections": []
29
+ }
@@ -0,0 +1,18 @@
1
+ # Migration corpus (T-095)
2
+
3
+ Documents written by earlier versions of the SDK, each with its expected version 4 output (`*.v4.json`). `packages/react/src/migration-corpus.test.ts` loads each input as the editor does (`importSceneText`: parse, migrate, re-seat to ASME sizes) and checks four things:
4
+ - the result is the golden file;
5
+ - the golden file passes the JSON Schema;
6
+ - loading it again changes nothing;
7
+ - the joints are the same.
8
+
9
+ | Input | Schema | Written by |
10
+ |---|---|---|
11
+ | `v1-demo` | 1 | playground `demoScene` at `814f520^`, as `JSON.stringify` (version 1 had no serializer) |
12
+ | `v2-demo`, `v2-generated-12` | 2 | `serializeScene` and playground `demoScene` / `generatedScene(12)` at `32de410^` |
13
+ | `v3-demo`, `v3-generated-12` | 3 | the same at the `v0.1.2` release |
14
+ | `v3-mostly-connected-plant`, `v3-open-joints-plant`, `v3-unconnected-plant` | 3 | the owner's plant files shipped as components fixtures in 0.1.0–0.1.2; written before ASME fittings (ADR-0014), so loading re-seats them |
15
+
16
+ Every 0.1.x release wrote version 3. No version 1 or 2 file was ever committed, so those inputs were produced with the code of their time.
17
+
18
+ **Do not regenerate the inputs.** If a golden file changes, the change to loading must be deliberate and noted in RELEASE.md.
@@ -0,0 +1,160 @@
1
+ {
2
+ "version": 1,
3
+ "components": [
4
+ {
5
+ "id": "tank",
6
+ "kind": "tank",
7
+ "position": [
8
+ 0,
9
+ 1.535,
10
+ 0
11
+ ],
12
+ "rotation": [
13
+ 0,
14
+ 0,
15
+ 0
16
+ ],
17
+ "properties": {
18
+ "level": 60
19
+ }
20
+ },
21
+ {
22
+ "id": "valve",
23
+ "kind": "valve",
24
+ "position": [
25
+ 3,
26
+ 0.6349999999999999,
27
+ 0
28
+ ],
29
+ "rotation": [
30
+ 0,
31
+ 0,
32
+ 0
33
+ ],
34
+ "properties": {
35
+ "open": true
36
+ }
37
+ },
38
+ {
39
+ "id": "pipe",
40
+ "kind": "pipe",
41
+ "position": [
42
+ 5.6,
43
+ 0.6349999999999999,
44
+ 0
45
+ ],
46
+ "rotation": [
47
+ 0,
48
+ 0,
49
+ 0
50
+ ],
51
+ "properties": {}
52
+ },
53
+ {
54
+ "id": "tee",
55
+ "kind": "tee",
56
+ "position": [
57
+ 8.6,
58
+ 0.6349999999999999,
59
+ 0
60
+ ],
61
+ "rotation": [
62
+ 0,
63
+ 0,
64
+ 0
65
+ ],
66
+ "properties": {}
67
+ },
68
+ {
69
+ "id": "valve-a",
70
+ "kind": "valve",
71
+ "position": [
72
+ 11,
73
+ 0.6349999999999999,
74
+ 0
75
+ ],
76
+ "rotation": [
77
+ 0,
78
+ 0,
79
+ 0
80
+ ],
81
+ "properties": {
82
+ "open": true
83
+ }
84
+ },
85
+ {
86
+ "id": "valve-b",
87
+ "kind": "valve",
88
+ "position": [
89
+ 11,
90
+ 2.0349999999999997,
91
+ 0
92
+ ],
93
+ "rotation": [
94
+ 0,
95
+ 0,
96
+ 0
97
+ ],
98
+ "properties": {
99
+ "open": true
100
+ }
101
+ }
102
+ ],
103
+ "connections": [
104
+ {
105
+ "id": "tank-valve",
106
+ "from": {
107
+ "instanceId": "tank",
108
+ "portId": "outlet"
109
+ },
110
+ "to": {
111
+ "instanceId": "valve",
112
+ "portId": "in"
113
+ }
114
+ },
115
+ {
116
+ "id": "valve-pipe",
117
+ "from": {
118
+ "instanceId": "valve",
119
+ "portId": "out"
120
+ },
121
+ "to": {
122
+ "instanceId": "pipe",
123
+ "portId": "in"
124
+ }
125
+ },
126
+ {
127
+ "id": "pipe-tee",
128
+ "from": {
129
+ "instanceId": "pipe",
130
+ "portId": "out"
131
+ },
132
+ "to": {
133
+ "instanceId": "tee",
134
+ "portId": "left"
135
+ }
136
+ },
137
+ {
138
+ "id": "tee-a",
139
+ "from": {
140
+ "instanceId": "tee",
141
+ "portId": "right"
142
+ },
143
+ "to": {
144
+ "instanceId": "valve-a",
145
+ "portId": "in"
146
+ }
147
+ },
148
+ {
149
+ "id": "tee-b",
150
+ "from": {
151
+ "instanceId": "tee",
152
+ "portId": "branch"
153
+ },
154
+ "to": {
155
+ "instanceId": "valve-b",
156
+ "portId": "in"
157
+ }
158
+ }
159
+ ]
160
+ }
@@ -0,0 +1,198 @@
1
+ {
2
+ "schemaVersion": 4,
3
+ "documentType": "industrial.scene",
4
+ "units": "m",
5
+ "components": [
6
+ {
7
+ "id": "tank",
8
+ "type": "tank",
9
+ "position": {
10
+ "x": 0,
11
+ "y": 1.535,
12
+ "z": 0
13
+ },
14
+ "rotation": {
15
+ "x": 0,
16
+ "y": 0,
17
+ "z": 0,
18
+ "w": 1
19
+ },
20
+ "scale": {
21
+ "x": 1,
22
+ "y": 1,
23
+ "z": 1
24
+ },
25
+ "properties": {
26
+ "level": 60
27
+ }
28
+ },
29
+ {
30
+ "id": "valve",
31
+ "type": "valve",
32
+ "position": {
33
+ "x": 3,
34
+ "y": 0.6349999999999999,
35
+ "z": 0
36
+ },
37
+ "rotation": {
38
+ "x": 0,
39
+ "y": 0,
40
+ "z": 0,
41
+ "w": 1
42
+ },
43
+ "scale": {
44
+ "x": 1,
45
+ "y": 1,
46
+ "z": 1
47
+ },
48
+ "properties": {
49
+ "open": true
50
+ }
51
+ },
52
+ {
53
+ "id": "pipe",
54
+ "type": "pipe",
55
+ "position": {
56
+ "x": 5.6,
57
+ "y": 0.6349999999999999,
58
+ "z": 0
59
+ },
60
+ "rotation": {
61
+ "x": 0,
62
+ "y": 0,
63
+ "z": 0,
64
+ "w": 1
65
+ },
66
+ "scale": {
67
+ "x": 1,
68
+ "y": 1,
69
+ "z": 1
70
+ },
71
+ "properties": {}
72
+ },
73
+ {
74
+ "id": "tee",
75
+ "type": "tee",
76
+ "position": {
77
+ "x": 8.6,
78
+ "y": 0.6349999999999999,
79
+ "z": 0
80
+ },
81
+ "rotation": {
82
+ "x": 0,
83
+ "y": 0,
84
+ "z": 0,
85
+ "w": 1
86
+ },
87
+ "scale": {
88
+ "x": 1,
89
+ "y": 1,
90
+ "z": 1
91
+ },
92
+ "properties": {}
93
+ },
94
+ {
95
+ "id": "valve-a",
96
+ "type": "valve",
97
+ "position": {
98
+ "x": 11,
99
+ "y": 0.6349999999999999,
100
+ "z": 0
101
+ },
102
+ "rotation": {
103
+ "x": 0,
104
+ "y": 0,
105
+ "z": 0,
106
+ "w": 1
107
+ },
108
+ "scale": {
109
+ "x": 1,
110
+ "y": 1,
111
+ "z": 1
112
+ },
113
+ "properties": {
114
+ "open": true
115
+ }
116
+ },
117
+ {
118
+ "id": "valve-b",
119
+ "type": "valve",
120
+ "position": {
121
+ "x": 11,
122
+ "y": 2.0349999999999997,
123
+ "z": 0
124
+ },
125
+ "rotation": {
126
+ "x": 0,
127
+ "y": 0,
128
+ "z": 0,
129
+ "w": 1
130
+ },
131
+ "scale": {
132
+ "x": 1,
133
+ "y": 1,
134
+ "z": 1
135
+ },
136
+ "properties": {
137
+ "open": true
138
+ }
139
+ }
140
+ ],
141
+ "connections": [
142
+ {
143
+ "id": "tank-valve",
144
+ "from": {
145
+ "instanceId": "tank",
146
+ "portId": "outlet"
147
+ },
148
+ "to": {
149
+ "instanceId": "valve",
150
+ "portId": "in"
151
+ }
152
+ },
153
+ {
154
+ "id": "valve-pipe",
155
+ "from": {
156
+ "instanceId": "valve",
157
+ "portId": "out"
158
+ },
159
+ "to": {
160
+ "instanceId": "pipe",
161
+ "portId": "in"
162
+ }
163
+ },
164
+ {
165
+ "id": "pipe-tee",
166
+ "from": {
167
+ "instanceId": "pipe",
168
+ "portId": "out"
169
+ },
170
+ "to": {
171
+ "instanceId": "tee",
172
+ "portId": "left"
173
+ }
174
+ },
175
+ {
176
+ "id": "tee-a",
177
+ "from": {
178
+ "instanceId": "tee",
179
+ "portId": "right"
180
+ },
181
+ "to": {
182
+ "instanceId": "valve-a",
183
+ "portId": "in"
184
+ }
185
+ },
186
+ {
187
+ "id": "tee-b",
188
+ "from": {
189
+ "instanceId": "tee",
190
+ "portId": "branch"
191
+ },
192
+ "to": {
193
+ "instanceId": "valve-b",
194
+ "portId": "in"
195
+ }
196
+ }
197
+ ]
198
+ }