@ocpp-debugkit/toolkit 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 (124) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +14 -0
  3. package/README.md +35 -0
  4. package/dist/cli/commands/inspect.d.ts +8 -0
  5. package/dist/cli/commands/inspect.d.ts.map +1 -0
  6. package/dist/cli/commands/inspect.js +63 -0
  7. package/dist/cli/commands/inspect.js.map +1 -0
  8. package/dist/cli/commands/report.d.ts +9 -0
  9. package/dist/cli/commands/report.d.ts.map +1 -0
  10. package/dist/cli/commands/report.js +54 -0
  11. package/dist/cli/commands/report.js.map +1 -0
  12. package/dist/cli/commands/scenario.d.ts +10 -0
  13. package/dist/cli/commands/scenario.d.ts.map +1 -0
  14. package/dist/cli/commands/scenario.js +104 -0
  15. package/dist/cli/commands/scenario.js.map +1 -0
  16. package/dist/cli/index.d.ts +7 -0
  17. package/dist/cli/index.d.ts.map +1 -0
  18. package/dist/cli/index.js +47 -0
  19. package/dist/cli/index.js.map +1 -0
  20. package/dist/cli/utils.d.ts +13 -0
  21. package/dist/cli/utils.d.ts.map +1 -0
  22. package/dist/cli/utils.js +43 -0
  23. package/dist/cli/utils.js.map +1 -0
  24. package/dist/core/__fixtures__/connector-fault.d.ts +116 -0
  25. package/dist/core/__fixtures__/connector-fault.d.ts.map +1 -0
  26. package/dist/core/__fixtures__/connector-fault.js +231 -0
  27. package/dist/core/__fixtures__/connector-fault.js.map +1 -0
  28. package/dist/core/__fixtures__/failed-auth.d.ts +64 -0
  29. package/dist/core/__fixtures__/failed-auth.d.ts.map +1 -0
  30. package/dist/core/__fixtures__/failed-auth.js +173 -0
  31. package/dist/core/__fixtures__/failed-auth.js.map +1 -0
  32. package/dist/core/__fixtures__/normal-session.d.ts +108 -0
  33. package/dist/core/__fixtures__/normal-session.d.ts.map +1 -0
  34. package/dist/core/__fixtures__/normal-session.js +261 -0
  35. package/dist/core/__fixtures__/normal-session.js.map +1 -0
  36. package/dist/core/detection.d.ts +23 -0
  37. package/dist/core/detection.d.ts.map +1 -0
  38. package/dist/core/detection.js +226 -0
  39. package/dist/core/detection.js.map +1 -0
  40. package/dist/core/fixtures/index.d.ts +298 -0
  41. package/dist/core/fixtures/index.d.ts.map +1 -0
  42. package/dist/core/fixtures/index.js +19 -0
  43. package/dist/core/fixtures/index.js.map +1 -0
  44. package/dist/core/index.d.ts +14 -0
  45. package/dist/core/index.d.ts.map +1 -0
  46. package/dist/core/index.js +22 -0
  47. package/dist/core/index.js.map +1 -0
  48. package/dist/core/normalizer.d.ts +83 -0
  49. package/dist/core/normalizer.d.ts.map +1 -0
  50. package/dist/core/normalizer.js +289 -0
  51. package/dist/core/normalizer.js.map +1 -0
  52. package/dist/core/parser.d.ts +53 -0
  53. package/dist/core/parser.d.ts.map +1 -0
  54. package/dist/core/parser.js +282 -0
  55. package/dist/core/parser.js.map +1 -0
  56. package/dist/core/schemas.d.ts +68 -0
  57. package/dist/core/schemas.d.ts.map +1 -0
  58. package/dist/core/schemas.js +81 -0
  59. package/dist/core/schemas.js.map +1 -0
  60. package/dist/core/summarizer.d.ts +25 -0
  61. package/dist/core/summarizer.d.ts.map +1 -0
  62. package/dist/core/summarizer.js +47 -0
  63. package/dist/core/summarizer.js.map +1 -0
  64. package/dist/core/timeline.d.ts +26 -0
  65. package/dist/core/timeline.d.ts.map +1 -0
  66. package/dist/core/timeline.js +318 -0
  67. package/dist/core/timeline.js.map +1 -0
  68. package/dist/core/types.d.ts +160 -0
  69. package/dist/core/types.d.ts.map +1 -0
  70. package/dist/core/types.js +9 -0
  71. package/dist/core/types.js.map +1 -0
  72. package/dist/core/validator.d.ts +33 -0
  73. package/dist/core/validator.d.ts.map +1 -0
  74. package/dist/core/validator.js +122 -0
  75. package/dist/core/validator.js.map +1 -0
  76. package/dist/index.d.ts +24 -0
  77. package/dist/index.d.ts.map +1 -0
  78. package/dist/index.js +26 -0
  79. package/dist/index.js.map +1 -0
  80. package/dist/react/components.d.ts +50 -0
  81. package/dist/react/components.d.ts.map +1 -0
  82. package/dist/react/components.js +49 -0
  83. package/dist/react/components.js.map +1 -0
  84. package/dist/react/index.d.ts +11 -0
  85. package/dist/react/index.d.ts.map +1 -0
  86. package/dist/react/index.js +10 -0
  87. package/dist/react/index.js.map +1 -0
  88. package/dist/react/types.d.ts +33 -0
  89. package/dist/react/types.d.ts.map +1 -0
  90. package/dist/react/types.js +5 -0
  91. package/dist/react/types.js.map +1 -0
  92. package/dist/replay/engine.d.ts +55 -0
  93. package/dist/replay/engine.d.ts.map +1 -0
  94. package/dist/replay/engine.js +86 -0
  95. package/dist/replay/engine.js.map +1 -0
  96. package/dist/replay/index.d.ts +11 -0
  97. package/dist/replay/index.d.ts.map +1 -0
  98. package/dist/replay/index.js +11 -0
  99. package/dist/replay/index.js.map +1 -0
  100. package/dist/reporter/index.d.ts +6 -0
  101. package/dist/reporter/index.d.ts.map +1 -0
  102. package/dist/reporter/index.js +5 -0
  103. package/dist/reporter/index.js.map +1 -0
  104. package/dist/reporter/markdown.d.ts +20 -0
  105. package/dist/reporter/markdown.d.ts.map +1 -0
  106. package/dist/reporter/markdown.js +181 -0
  107. package/dist/reporter/markdown.js.map +1 -0
  108. package/dist/reporter/types.d.ts +34 -0
  109. package/dist/reporter/types.d.ts.map +1 -0
  110. package/dist/reporter/types.js +9 -0
  111. package/dist/reporter/types.js.map +1 -0
  112. package/dist/scenarios/__scenarios__/station-offline.d.ts +94 -0
  113. package/dist/scenarios/__scenarios__/station-offline.d.ts.map +1 -0
  114. package/dist/scenarios/__scenarios__/station-offline.js +168 -0
  115. package/dist/scenarios/__scenarios__/station-offline.js.map +1 -0
  116. package/dist/scenarios/__scenarios__/unexpected-stop-reason.d.ts +112 -0
  117. package/dist/scenarios/__scenarios__/unexpected-stop-reason.d.ts.map +1 -0
  118. package/dist/scenarios/__scenarios__/unexpected-stop-reason.js +216 -0
  119. package/dist/scenarios/__scenarios__/unexpected-stop-reason.js.map +1 -0
  120. package/dist/scenarios/index.d.ts +21 -0
  121. package/dist/scenarios/index.d.ts.map +1 -0
  122. package/dist/scenarios/index.js +61 -0
  123. package/dist/scenarios/index.js.map +1 -0
  124. package/package.json +110 -0
@@ -0,0 +1,168 @@
1
+ export default {
2
+ name: 'station-offline',
3
+ description: 'Station goes offline during active session: transaction starts but no StopTransaction follows. Expects STATION_OFFLINE_DURING_SESSION failure.',
4
+ trace: {
5
+ traceId: 'scenario-station-offline',
6
+ metadata: {
7
+ stationId: 'CS-SYNTHETIC-004',
8
+ ocppVersion: '1.6',
9
+ source: 'synthetic-scenario',
10
+ description: 'Station offline during active session — StartTransaction with no StopTransaction.',
11
+ },
12
+ events: [
13
+ {
14
+ timestamp: '2024-01-15T14:00:00.000Z',
15
+ direction: 'CS_TO_CSMS',
16
+ message: [
17
+ 2,
18
+ 'msg-001',
19
+ 'BootNotification',
20
+ {
21
+ chargePointVendor: 'SyntheticVendor',
22
+ chargePointModel: 'SM-100',
23
+ chargePointSerialNumber: 'CS-SYNTHETIC-004',
24
+ firmwareVersion: '1.0.0',
25
+ },
26
+ ],
27
+ },
28
+ {
29
+ timestamp: '2024-01-15T14:00:00.500Z',
30
+ direction: 'CSMS_TO_CS',
31
+ message: [
32
+ 3,
33
+ 'msg-001',
34
+ {
35
+ currentTime: '2024-01-15T14:00:00.500Z',
36
+ interval: 300,
37
+ status: 'Accepted',
38
+ },
39
+ ],
40
+ },
41
+ {
42
+ timestamp: '2024-01-15T14:01:00.000Z',
43
+ direction: 'CS_TO_CSMS',
44
+ message: [
45
+ 2,
46
+ 'msg-002',
47
+ 'StatusNotification',
48
+ {
49
+ connectorId: 0,
50
+ status: 'Available',
51
+ errorCode: 'NoError',
52
+ },
53
+ ],
54
+ },
55
+ {
56
+ timestamp: '2024-01-15T14:01:00.500Z',
57
+ direction: 'CSMS_TO_CS',
58
+ message: [3, 'msg-002', {}],
59
+ },
60
+ {
61
+ timestamp: '2024-01-15T14:02:00.000Z',
62
+ direction: 'CS_TO_CSMS',
63
+ message: [
64
+ 2,
65
+ 'msg-003',
66
+ 'Authorize',
67
+ {
68
+ idTag: 'SYNTHETIC-TAG-004',
69
+ },
70
+ ],
71
+ },
72
+ {
73
+ timestamp: '2024-01-15T14:02:00.500Z',
74
+ direction: 'CSMS_TO_CS',
75
+ message: [
76
+ 3,
77
+ 'msg-003',
78
+ {
79
+ idTagInfo: {
80
+ status: 'Accepted',
81
+ expiryDate: '2024-12-31T23:59:59.000Z',
82
+ },
83
+ },
84
+ ],
85
+ },
86
+ {
87
+ timestamp: '2024-01-15T14:02:30.000Z',
88
+ direction: 'CS_TO_CSMS',
89
+ message: [
90
+ 2,
91
+ 'msg-004',
92
+ 'StartTransaction',
93
+ {
94
+ connectorId: 1,
95
+ idTag: 'SYNTHETIC-TAG-004',
96
+ meterStart: 0,
97
+ timestamp: '2024-01-15T14:02:30.000Z',
98
+ },
99
+ ],
100
+ },
101
+ {
102
+ timestamp: '2024-01-15T14:02:30.500Z',
103
+ direction: 'CSMS_TO_CS',
104
+ message: [
105
+ 3,
106
+ 'msg-004',
107
+ {
108
+ transactionId: 100004,
109
+ idTagInfo: {
110
+ status: 'Accepted',
111
+ },
112
+ },
113
+ ],
114
+ },
115
+ {
116
+ timestamp: '2024-01-15T14:02:31.000Z',
117
+ direction: 'CS_TO_CSMS',
118
+ message: [
119
+ 2,
120
+ 'msg-005',
121
+ 'StatusNotification',
122
+ {
123
+ connectorId: 1,
124
+ status: 'Charging',
125
+ errorCode: 'NoError',
126
+ },
127
+ ],
128
+ },
129
+ {
130
+ timestamp: '2024-01-15T14:02:31.500Z',
131
+ direction: 'CSMS_TO_CS',
132
+ message: [3, 'msg-005', {}],
133
+ },
134
+ {
135
+ timestamp: '2024-01-15T14:15:00.000Z',
136
+ direction: 'CS_TO_CSMS',
137
+ message: [
138
+ 2,
139
+ 'msg-006',
140
+ 'MeterValues',
141
+ {
142
+ connectorId: 1,
143
+ transactionId: 100004,
144
+ meterValue: [
145
+ {
146
+ timestamp: '2024-01-15T14:15:00.000Z',
147
+ sampledValue: [
148
+ {
149
+ value: '2000',
150
+ measurand: 'Energy.Active.Import.Register',
151
+ unit: 'Wh',
152
+ },
153
+ ],
154
+ },
155
+ ],
156
+ },
157
+ ],
158
+ },
159
+ {
160
+ timestamp: '2024-01-15T14:15:00.500Z',
161
+ direction: 'CSMS_TO_CS',
162
+ message: [3, 'msg-006', {}],
163
+ },
164
+ ],
165
+ },
166
+ expectedFailures: ['STATION_OFFLINE_DURING_SESSION'],
167
+ };
168
+ //# sourceMappingURL=station-offline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"station-offline.js","sourceRoot":"","sources":["../../../src/scenarios/__scenarios__/station-offline.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,gJAAgJ;IAClJ,KAAK,EAAE;QACL,OAAO,EAAE,0BAA0B;QACnC,QAAQ,EAAE;YACR,SAAS,EAAE,kBAAkB;YAC7B,WAAW,EAAE,KAAK;YAClB,MAAM,EAAE,oBAAoB;YAC5B,WAAW,EACT,mFAAmF;SACtF;QACD,MAAM,EAAE;YACN;gBACE,SAAS,EAAE,0BAA0B;gBACrC,SAAS,EAAE,YAAY;gBACvB,OAAO,EAAE;oBACP,CAAC;oBACD,SAAS;oBACT,kBAAkB;oBAClB;wBACE,iBAAiB,EAAE,iBAAiB;wBACpC,gBAAgB,EAAE,QAAQ;wBAC1B,uBAAuB,EAAE,kBAAkB;wBAC3C,eAAe,EAAE,OAAO;qBACzB;iBACF;aACF;YACD;gBACE,SAAS,EAAE,0BAA0B;gBACrC,SAAS,EAAE,YAAY;gBACvB,OAAO,EAAE;oBACP,CAAC;oBACD,SAAS;oBACT;wBACE,WAAW,EAAE,0BAA0B;wBACvC,QAAQ,EAAE,GAAG;wBACb,MAAM,EAAE,UAAU;qBACnB;iBACF;aACF;YACD;gBACE,SAAS,EAAE,0BAA0B;gBACrC,SAAS,EAAE,YAAY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wBACd,MAAM,EAAE,UAAU;wBAClB,SAAS,EAAE,SAAS;qBACrB;iBACF;aACF;YACD;gBACE,SAAS,EAAE,0BAA0B;gBACrC,SAAS,EAAE,YAAY;gBACvB,OAAO,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC;aAC5B;YACD;gBACE,SAAS,EAAE,0BAA0B;gBACrC,SAAS,EAAE,YAAY;gBACvB,OAAO,EAAE;oBACP,CAAC;oBACD,SAAS;oBACT,aAAa;oBACb;wBACE,WAAW,EAAE,CAAC;wBACd,aAAa,EAAE,MAAM;wBACrB,UAAU,EAAE;4BACV;gCACE,SAAS,EAAE,0BAA0B;gCACrC,YAAY,EAAE;oCACZ;wCACE,KAAK,EAAE,MAAM;wCACb,SAAS,EAAE,+BAA+B;wCAC1C,IAAI,EAAE,IAAI;qCACX;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;YACD;gBACE,SAAS,EAAE,0BAA0B;gBACrC,SAAS,EAAE,YAAY;gBACvB,OAAO,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC;aAC5B;SACF;KACF;IACD,gBAAgB,EAAE,CAAC,gCAAgC,CAAC;CACrD,CAAC"}
@@ -0,0 +1,112 @@
1
+ declare const _default: {
2
+ name: string;
3
+ description: string;
4
+ trace: {
5
+ traceId: string;
6
+ metadata: {
7
+ stationId: string;
8
+ ocppVersion: string;
9
+ source: string;
10
+ description: string;
11
+ };
12
+ events: ({
13
+ timestamp: string;
14
+ direction: string;
15
+ message: (string | number | {
16
+ chargePointVendor: string;
17
+ chargePointModel: string;
18
+ chargePointSerialNumber: string;
19
+ firmwareVersion: string;
20
+ })[];
21
+ } | {
22
+ timestamp: string;
23
+ direction: string;
24
+ message: (string | number | {
25
+ currentTime: string;
26
+ interval: number;
27
+ status: string;
28
+ })[];
29
+ } | {
30
+ timestamp: string;
31
+ direction: string;
32
+ message: (string | number | {
33
+ connectorId: number;
34
+ status: string;
35
+ errorCode: string;
36
+ })[];
37
+ } | {
38
+ timestamp: string;
39
+ direction: string;
40
+ message: {}[];
41
+ } | {
42
+ timestamp: string;
43
+ direction: string;
44
+ message: (string | number | {
45
+ idTag: string;
46
+ })[];
47
+ } | {
48
+ timestamp: string;
49
+ direction: string;
50
+ message: (string | number | {
51
+ idTagInfo: {
52
+ status: string;
53
+ expiryDate: string;
54
+ };
55
+ })[];
56
+ } | {
57
+ timestamp: string;
58
+ direction: string;
59
+ message: (string | number | {
60
+ connectorId: number;
61
+ idTag: string;
62
+ meterStart: number;
63
+ timestamp: string;
64
+ })[];
65
+ } | {
66
+ timestamp: string;
67
+ direction: string;
68
+ message: (string | number | {
69
+ transactionId: number;
70
+ idTagInfo: {
71
+ status: string;
72
+ };
73
+ })[];
74
+ } | {
75
+ timestamp: string;
76
+ direction: string;
77
+ message: (string | number | {
78
+ connectorId: number;
79
+ transactionId: number;
80
+ meterValue: {
81
+ timestamp: string;
82
+ sampledValue: {
83
+ value: string;
84
+ measurand: string;
85
+ unit: string;
86
+ }[];
87
+ }[];
88
+ })[];
89
+ } | {
90
+ timestamp: string;
91
+ direction: string;
92
+ message: (string | number | {
93
+ transactionId: number;
94
+ idTag: string;
95
+ meterStop: number;
96
+ timestamp: string;
97
+ reason: string;
98
+ })[];
99
+ } | {
100
+ timestamp: string;
101
+ direction: string;
102
+ message: (string | number | {
103
+ idTagInfo: {
104
+ status: string;
105
+ };
106
+ })[];
107
+ })[];
108
+ };
109
+ expectedFailures: never[];
110
+ };
111
+ export default _default;
112
+ //# sourceMappingURL=unexpected-stop-reason.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unexpected-stop-reason.d.ts","sourceRoot":"","sources":["../../../src/scenarios/__scenarios__/unexpected-stop-reason.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAwNE"}
@@ -0,0 +1,216 @@
1
+ export default {
2
+ name: 'unexpected-stop-reason',
3
+ description: 'Stop transaction with unexpected stop reason (EVDisconnected replaced by Other). Parser and timeline-only fixture — no v0.1 detection rule matches this pattern. Validates that the parser and timeline builder handle stop events with error payloads correctly.',
4
+ trace: {
5
+ traceId: 'scenario-unexpected-stop-reason',
6
+ metadata: {
7
+ stationId: 'CS-SYNTHETIC-005',
8
+ ocppVersion: '1.6',
9
+ source: 'synthetic-scenario',
10
+ description: 'Stop transaction with unexpected stop reason — parser/timeline validation only.',
11
+ },
12
+ events: [
13
+ {
14
+ timestamp: '2024-01-15T16:00:00.000Z',
15
+ direction: 'CS_TO_CSMS',
16
+ message: [
17
+ 2,
18
+ 'msg-001',
19
+ 'BootNotification',
20
+ {
21
+ chargePointVendor: 'SyntheticVendor',
22
+ chargePointModel: 'SM-100',
23
+ chargePointSerialNumber: 'CS-SYNTHETIC-005',
24
+ firmwareVersion: '1.0.0',
25
+ },
26
+ ],
27
+ },
28
+ {
29
+ timestamp: '2024-01-15T16:00:00.500Z',
30
+ direction: 'CSMS_TO_CS',
31
+ message: [
32
+ 3,
33
+ 'msg-001',
34
+ {
35
+ currentTime: '2024-01-15T16:00:00.500Z',
36
+ interval: 300,
37
+ status: 'Accepted',
38
+ },
39
+ ],
40
+ },
41
+ {
42
+ timestamp: '2024-01-15T16:01:00.000Z',
43
+ direction: 'CS_TO_CSMS',
44
+ message: [
45
+ 2,
46
+ 'msg-002',
47
+ 'StatusNotification',
48
+ {
49
+ connectorId: 0,
50
+ status: 'Available',
51
+ errorCode: 'NoError',
52
+ },
53
+ ],
54
+ },
55
+ {
56
+ timestamp: '2024-01-15T16:01:00.500Z',
57
+ direction: 'CSMS_TO_CS',
58
+ message: [3, 'msg-002', {}],
59
+ },
60
+ {
61
+ timestamp: '2024-01-15T16:02:00.000Z',
62
+ direction: 'CS_TO_CSMS',
63
+ message: [
64
+ 2,
65
+ 'msg-003',
66
+ 'Authorize',
67
+ {
68
+ idTag: 'SYNTHETIC-TAG-005',
69
+ },
70
+ ],
71
+ },
72
+ {
73
+ timestamp: '2024-01-15T16:02:00.500Z',
74
+ direction: 'CSMS_TO_CS',
75
+ message: [
76
+ 3,
77
+ 'msg-003',
78
+ {
79
+ idTagInfo: {
80
+ status: 'Accepted',
81
+ expiryDate: '2024-12-31T23:59:59.000Z',
82
+ },
83
+ },
84
+ ],
85
+ },
86
+ {
87
+ timestamp: '2024-01-15T16:02:30.000Z',
88
+ direction: 'CS_TO_CSMS',
89
+ message: [
90
+ 2,
91
+ 'msg-004',
92
+ 'StartTransaction',
93
+ {
94
+ connectorId: 1,
95
+ idTag: 'SYNTHETIC-TAG-005',
96
+ meterStart: 0,
97
+ timestamp: '2024-01-15T16:02:30.000Z',
98
+ },
99
+ ],
100
+ },
101
+ {
102
+ timestamp: '2024-01-15T16:02:30.500Z',
103
+ direction: 'CSMS_TO_CS',
104
+ message: [
105
+ 3,
106
+ 'msg-004',
107
+ {
108
+ transactionId: 100005,
109
+ idTagInfo: {
110
+ status: 'Accepted',
111
+ },
112
+ },
113
+ ],
114
+ },
115
+ {
116
+ timestamp: '2024-01-15T16:02:31.000Z',
117
+ direction: 'CS_TO_CSMS',
118
+ message: [
119
+ 2,
120
+ 'msg-005',
121
+ 'StatusNotification',
122
+ {
123
+ connectorId: 1,
124
+ status: 'Charging',
125
+ errorCode: 'NoError',
126
+ },
127
+ ],
128
+ },
129
+ {
130
+ timestamp: '2024-01-15T16:02:31.500Z',
131
+ direction: 'CSMS_TO_CS',
132
+ message: [3, 'msg-005', {}],
133
+ },
134
+ {
135
+ timestamp: '2024-01-15T16:20:00.000Z',
136
+ direction: 'CS_TO_CSMS',
137
+ message: [
138
+ 2,
139
+ 'msg-006',
140
+ 'MeterValues',
141
+ {
142
+ connectorId: 1,
143
+ transactionId: 100005,
144
+ meterValue: [
145
+ {
146
+ timestamp: '2024-01-15T16:20:00.000Z',
147
+ sampledValue: [
148
+ {
149
+ value: '4000',
150
+ measurand: 'Energy.Active.Import.Register',
151
+ unit: 'Wh',
152
+ },
153
+ ],
154
+ },
155
+ ],
156
+ },
157
+ ],
158
+ },
159
+ {
160
+ timestamp: '2024-01-15T16:20:00.500Z',
161
+ direction: 'CSMS_TO_CS',
162
+ message: [3, 'msg-006', {}],
163
+ },
164
+ {
165
+ timestamp: '2024-01-15T16:25:00.000Z',
166
+ direction: 'CS_TO_CSMS',
167
+ message: [
168
+ 2,
169
+ 'msg-007',
170
+ 'StopTransaction',
171
+ {
172
+ transactionId: 100005,
173
+ idTag: 'SYNTHETIC-TAG-005',
174
+ meterStop: 4000,
175
+ timestamp: '2024-01-15T16:25:00.000Z',
176
+ reason: 'Other',
177
+ },
178
+ ],
179
+ },
180
+ {
181
+ timestamp: '2024-01-15T16:25:00.500Z',
182
+ direction: 'CSMS_TO_CS',
183
+ message: [
184
+ 3,
185
+ 'msg-007',
186
+ {
187
+ idTagInfo: {
188
+ status: 'Accepted',
189
+ },
190
+ },
191
+ ],
192
+ },
193
+ {
194
+ timestamp: '2024-01-15T16:25:01.000Z',
195
+ direction: 'CS_TO_CSMS',
196
+ message: [
197
+ 2,
198
+ 'msg-008',
199
+ 'StatusNotification',
200
+ {
201
+ connectorId: 1,
202
+ status: 'Available',
203
+ errorCode: 'NoError',
204
+ },
205
+ ],
206
+ },
207
+ {
208
+ timestamp: '2024-01-15T16:25:01.500Z',
209
+ direction: 'CSMS_TO_CS',
210
+ message: [3, 'msg-008', {}],
211
+ },
212
+ ],
213
+ },
214
+ expectedFailures: [],
215
+ };
216
+ //# sourceMappingURL=unexpected-stop-reason.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unexpected-stop-reason.js","sourceRoot":"","sources":["../../../src/scenarios/__scenarios__/unexpected-stop-reason.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EACT,mQAAmQ;IACrQ,KAAK,EAAE;QACL,OAAO,EAAE,iCAAiC;QAC1C,QAAQ,EA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C,SAAS,EAAE,YAAY;gBACvB,OAAO,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC;aAC5B;YACD;gBACE,SAAS,EAAE,0BAA0B;gBACrC,SAAS,EAAE,YAAY;gBACvB,OAAO,EAAE;oBACP,CAAC;oBACD,SAAS;oBACT,iBAAiB;oBACjB;wBACE,aAAa,EAAE,MAAM;wBACrB,KAAK,EAAE,mBAAmB;wBAC1B,SAAS,EAAE,IAAI;wBACf,SAAS,EAAE,0BAA0B;wBACrC,MAAM,EAAE,OAAO;qBAChB;iBACF;aACF;YACD;gBACE,SAAS,EAAE,0BAA0B;gBACrC,SAAS,EAAE,YAAY;gBACvB,OAAO,EAAE;oBACP,CAAC;oBACD,SAAS;oBACT;wBACE,SAAS,EAAE;4BACT,MAAM,EAAE,UAAU;yBACnB;qBACF;iBACF;aACF;YACD;gBACE,SAAS,EAAE,0BAA0B;gBACrC,SAAS,EAAE,YAAY;gBACvB,OAAO,EAAE;oBACP,CAAC;oBACD,SAAS;oBACT,oBAAoB;oBACpB;wBACE,WAAW,EAAE,CAAC;wBACd,MAAM,EAAE,WAAW;wBACnB,SAAS,EAAE,SAAS;qBACrB;iBACF;aACF;YACD;gBACE,SAAS,EAAE,0BAA0B;gBACrC,SAAS,EAAE,YAAY;gBACvB,OAAO,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC;aAC5B;SACF;KACF;IACD,gBAAgB,EAAE,EAAE;CACrB,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Scenario registry — exports all predefined scenarios.
3
+ *
4
+ * All scenario data is fully synthetic — no real station identifiers,
5
+ * transaction IDs, idTag values, or personal data.
6
+ */
7
+ import type { Scenario } from '../core/index.js';
8
+ declare const normalSessionScenario: Scenario;
9
+ declare const failedAuthScenario: Scenario;
10
+ declare const connectorFaultScenario: Scenario;
11
+ declare const stationOfflineScenario: Scenario;
12
+ declare const unexpectedStopReasonScenario: Scenario;
13
+ export declare const scenarios: readonly [Scenario, Scenario, Scenario, Scenario, Scenario];
14
+ export declare const scenarioNames: readonly ["normal-session", "failed-auth", "connector-fault", "station-offline", "unexpected-stop-reason"];
15
+ export { normalSessionScenario, failedAuthScenario, connectorFaultScenario, stationOfflineScenario, unexpectedStopReasonScenario, };
16
+ /**
17
+ * Get a scenario by name.
18
+ * @returns The scenario, or undefined if not found.
19
+ */
20
+ export declare function getScenario(name: string): Scenario | undefined;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scenarios/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAS,MAAM,kBAAkB,CAAC;AAUxD,QAAA,MAAM,qBAAqB,EAAE,QAM5B,CAAC;AAEF,QAAA,MAAM,kBAAkB,EAAE,QAMzB,CAAC;AAEF,QAAA,MAAM,sBAAsB,EAAE,QAM7B,CAAC;AAMF,QAAA,MAAM,sBAAsB,EAAE,QAAgD,CAAC;AAC/E,QAAA,MAAM,4BAA4B,EAAE,QAAsD,CAAC;AAM3F,eAAO,MAAM,SAAS,6DAMZ,CAAC;AAEX,eAAO,MAAM,aAAa,4GAMhB,CAAC;AAEX,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,GAC7B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAE9D"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Scenario registry — exports all predefined scenarios.
3
+ *
4
+ * All scenario data is fully synthetic — no real station identifiers,
5
+ * transaction IDs, idTag values, or personal data.
6
+ */
7
+ import { fixtures } from '../core/index.js';
8
+ import stationOffline from './__scenarios__/station-offline.js';
9
+ import unexpectedStopReason from './__scenarios__/unexpected-stop-reason.js';
10
+ // ---------------------------------------------------------------------------
11
+ // Scenarios derived from core fixtures
12
+ // ---------------------------------------------------------------------------
13
+ const normalSessionScenario = {
14
+ name: 'normal-session',
15
+ description: 'Normal charging session: boot → authorize → start transaction → meter values → stop transaction. No failures expected.',
16
+ trace: fixtures.normalSession,
17
+ expectedFailures: [],
18
+ };
19
+ const failedAuthScenario = {
20
+ name: 'failed-auth',
21
+ description: 'Failed authorization: station connector prepares, idTag is rejected by CSMS. StartTransaction is not attempted. Expects FAILED_AUTHORIZATION failure.',
22
+ trace: fixtures.failedAuth,
23
+ expectedFailures: ['FAILED_AUTHORIZATION'],
24
+ };
25
+ const connectorFaultScenario = {
26
+ name: 'connector-fault',
27
+ description: 'Connector fault during active session: station boots, transaction starts, connector faults mid-charging, transaction stops with fault reason. Expects CONNECTOR_FAULT failure.',
28
+ trace: fixtures.connectorFault,
29
+ expectedFailures: ['CONNECTOR_FAULT'],
30
+ };
31
+ // ---------------------------------------------------------------------------
32
+ // Scenarios from JSON files
33
+ // ---------------------------------------------------------------------------
34
+ const stationOfflineScenario = stationOffline;
35
+ const unexpectedStopReasonScenario = unexpectedStopReason;
36
+ // ---------------------------------------------------------------------------
37
+ // Registry
38
+ // ---------------------------------------------------------------------------
39
+ export const scenarios = [
40
+ normalSessionScenario,
41
+ failedAuthScenario,
42
+ connectorFaultScenario,
43
+ stationOfflineScenario,
44
+ unexpectedStopReasonScenario,
45
+ ];
46
+ export const scenarioNames = [
47
+ 'normal-session',
48
+ 'failed-auth',
49
+ 'connector-fault',
50
+ 'station-offline',
51
+ 'unexpected-stop-reason',
52
+ ];
53
+ export { normalSessionScenario, failedAuthScenario, connectorFaultScenario, stationOfflineScenario, unexpectedStopReasonScenario, };
54
+ /**
55
+ * Get a scenario by name.
56
+ * @returns The scenario, or undefined if not found.
57
+ */
58
+ export function getScenario(name) {
59
+ return scenarios.find((s) => s.name === name);
60
+ }
61
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scenarios/index.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