@n1k1t/mock-server 0.1.4 → 0.1.5

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 (104) hide show
  1. package/lib/package.json +1 -1
  2. package/lib/src/expectations/models/expectation.d.ts +1 -1
  3. package/lib/src/expectations/models/expectation.d.ts.map +1 -1
  4. package/lib/src/expectations/models/expectation.js +4 -8
  5. package/lib/src/expectations/models/expectation.js.map +1 -1
  6. package/lib/src/expectations/models/operator.d.ts +2 -1
  7. package/lib/src/expectations/models/operator.d.ts.map +1 -1
  8. package/lib/src/expectations/models/operator.js.map +1 -1
  9. package/lib/src/expectations/models/storage.js +1 -1
  10. package/lib/src/expectations/models/storage.js.map +1 -1
  11. package/lib/src/expectations/operators/and.operator.d.ts +2 -1
  12. package/lib/src/expectations/operators/and.operator.d.ts.map +1 -1
  13. package/lib/src/expectations/operators/and.operator.js +3 -0
  14. package/lib/src/expectations/operators/and.operator.js.map +1 -1
  15. package/lib/src/expectations/operators/exec.operator.d.ts +2 -1
  16. package/lib/src/expectations/operators/exec.operator.d.ts.map +1 -1
  17. package/lib/src/expectations/operators/exec.operator.js +3 -0
  18. package/lib/src/expectations/operators/exec.operator.js.map +1 -1
  19. package/lib/src/expectations/operators/has.operator.d.ts +2 -1
  20. package/lib/src/expectations/operators/has.operator.d.ts.map +1 -1
  21. package/lib/src/expectations/operators/has.operator.js +33 -0
  22. package/lib/src/expectations/operators/has.operator.js.map +1 -1
  23. package/lib/src/expectations/operators/if.operator.d.ts +2 -1
  24. package/lib/src/expectations/operators/if.operator.d.ts.map +1 -1
  25. package/lib/src/expectations/operators/if.operator.js +7 -0
  26. package/lib/src/expectations/operators/if.operator.js.map +1 -1
  27. package/lib/src/expectations/operators/merge.operator.d.ts +2 -1
  28. package/lib/src/expectations/operators/merge.operator.d.ts.map +1 -1
  29. package/lib/src/expectations/operators/merge.operator.js +3 -0
  30. package/lib/src/expectations/operators/merge.operator.js.map +1 -1
  31. package/lib/src/expectations/operators/not.operator.d.ts +2 -1
  32. package/lib/src/expectations/operators/not.operator.d.ts.map +1 -1
  33. package/lib/src/expectations/operators/not.operator.js +3 -0
  34. package/lib/src/expectations/operators/not.operator.js.map +1 -1
  35. package/lib/src/expectations/operators/or.operator.d.ts +2 -1
  36. package/lib/src/expectations/operators/or.operator.d.ts.map +1 -1
  37. package/lib/src/expectations/operators/or.operator.js +3 -0
  38. package/lib/src/expectations/operators/or.operator.js.map +1 -1
  39. package/lib/src/expectations/operators/remove.operator.d.ts +2 -1
  40. package/lib/src/expectations/operators/remove.operator.d.ts.map +1 -1
  41. package/lib/src/expectations/operators/remove.operator.js +3 -0
  42. package/lib/src/expectations/operators/remove.operator.js.map +1 -1
  43. package/lib/src/expectations/operators/root.operator.d.ts +2 -1
  44. package/lib/src/expectations/operators/root.operator.d.ts.map +1 -1
  45. package/lib/src/expectations/operators/root.operator.js +3 -0
  46. package/lib/src/expectations/operators/root.operator.js.map +1 -1
  47. package/lib/src/expectations/operators/set.operator.d.ts +2 -1
  48. package/lib/src/expectations/operators/set.operator.d.ts.map +1 -1
  49. package/lib/src/expectations/operators/set.operator.js +13 -0
  50. package/lib/src/expectations/operators/set.operator.js.map +1 -1
  51. package/lib/src/expectations/operators/switch.operator.d.ts +2 -1
  52. package/lib/src/expectations/operators/switch.operator.d.ts.map +1 -1
  53. package/lib/src/expectations/operators/switch.operator.js +10 -0
  54. package/lib/src/expectations/operators/switch.operator.js.map +1 -1
  55. package/lib/src/expectations/types.d.ts +12 -15
  56. package/lib/src/expectations/types.d.ts.map +1 -1
  57. package/lib/src/expectations/types.js +3 -6
  58. package/lib/src/expectations/types.js.map +1 -1
  59. package/lib/src/expectations/utils.d.ts +1 -6
  60. package/lib/src/expectations/utils.d.ts.map +1 -1
  61. package/lib/src/expectations/utils.js +2 -33
  62. package/lib/src/expectations/utils.js.map +1 -1
  63. package/lib/src/index.d.ts +0 -1
  64. package/lib/src/index.d.ts.map +1 -1
  65. package/lib/src/index.js +0 -1
  66. package/lib/src/index.js.map +1 -1
  67. package/lib/src/logger/index.d.ts.map +1 -1
  68. package/lib/src/logger/index.js +3 -1
  69. package/lib/src/logger/index.js.map +1 -1
  70. package/lib/src/logger/utils.d.ts.map +1 -1
  71. package/lib/src/logger/utils.js +6 -5
  72. package/lib/src/logger/utils.js.map +1 -1
  73. package/lib/src/server/endpoints/history.get-list.endpoint.d.ts +3 -3
  74. package/lib/src/server/history/model.d.ts +9 -13
  75. package/lib/src/server/history/model.d.ts.map +1 -1
  76. package/lib/src/server/history/model.js +14 -8
  77. package/lib/src/server/history/model.js.map +1 -1
  78. package/lib/src/server/history/storage.d.ts +1 -1
  79. package/lib/src/server/history/storage.d.ts.map +1 -1
  80. package/lib/src/server/history/storage.js +6 -6
  81. package/lib/src/server/history/storage.js.map +1 -1
  82. package/lib/src/server/history/types.d.ts +9 -1
  83. package/lib/src/server/history/types.d.ts.map +1 -1
  84. package/lib/src/server/middlewares/destroy.midleware.js +2 -2
  85. package/lib/src/server/middlewares/destroy.midleware.js.map +1 -1
  86. package/lib/src/server/middlewares/forward.middleware.d.ts.map +1 -1
  87. package/lib/src/server/middlewares/forward.middleware.js +22 -14
  88. package/lib/src/server/middlewares/forward.middleware.js.map +1 -1
  89. package/lib/src/server/middlewares/history.middleware.js +1 -1
  90. package/lib/src/server/middlewares/history.middleware.js.map +1 -1
  91. package/lib/src/server/middlewares/match-expectation.middleware.d.ts.map +1 -1
  92. package/lib/src/server/middlewares/match-expectation.middleware.js +10 -4
  93. package/lib/src/server/middlewares/match-expectation.middleware.js.map +1 -1
  94. package/lib/src/server/middlewares/reply.middleware.js +2 -2
  95. package/lib/src/server/middlewares/reply.middleware.js.map +1 -1
  96. package/lib/tsconfig.tsbuildinfo +1 -1
  97. package/package.json +1 -1
  98. package/public/index.html +13 -7
  99. package/public/scripts/main.js +1233 -533
  100. package/public/styles/main.css +199 -121
  101. package/lib/src/process.d.ts +0 -2
  102. package/lib/src/process.d.ts.map +0 -1
  103. package/lib/src/process.js +0 -7
  104. package/lib/src/process.js.map +0 -1
@@ -1,84 +1,210 @@
1
- body {
1
+ @keyframes pending {
2
+ 0% {
3
+ content: "\f251";
4
+ }
5
+ 33% {
6
+ content: "\f252";
7
+ }
8
+ 66% {
9
+ content: "\f253";
10
+ }
11
+ }
12
+ html {
2
13
  background-color: #1e1e1e;
3
- margin: 0;
4
14
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
15
+ }
16
+
17
+ body {
5
18
  color: #fff;
6
- min-width: 600px;
19
+ min-width: 772px;
7
20
  max-width: 1600px;
8
21
  margin: auto;
9
22
  margin-top: 20px;
23
+ padding-bottom: 100px;
10
24
  }
11
25
 
12
26
  button {
27
+ position: relative;
28
+ border: none;
29
+ background-color: #333;
30
+ padding: 6px 15px;
31
+ margin: 5px;
32
+ color: #fff;
33
+ border-radius: 10px;
34
+ font-weight: bold;
13
35
  cursor: pointer;
14
36
  }
37
+ button i {
38
+ float: left;
39
+ margin-right: 5px;
40
+ pointer-events: none;
41
+ }
42
+ button.checked {
43
+ background-color: #aaa;
44
+ pointer-events: none;
45
+ }
46
+ button.processed {
47
+ animation: process 0.5s infinite;
48
+ pointer-events: none;
49
+ }
50
+ @keyframes process {
51
+ 0% {
52
+ opacity: 1;
53
+ }
54
+ 50% {
55
+ opacity: 0.5;
56
+ }
57
+ 100% {
58
+ opacity: 1;
59
+ }
60
+ }
61
+
62
+ section {
63
+ margin-top: 50px;
64
+ }
15
65
 
16
- div.empty-placeholder {
66
+ div.container {
67
+ max-width: 1300px;
68
+ margin: auto;
69
+ border-radius: 10px;
70
+ padding: 10px 20px;
71
+ margin-top: 20px;
72
+ overflow: hidden;
73
+ position: relative;
74
+ }
75
+
76
+ div.empty {
17
77
  display: flex;
18
78
  justify-content: center;
19
79
  align-items: center;
20
80
  margin-top: 50px;
21
81
  }
22
- div.empty-placeholder i {
82
+ div.empty i {
23
83
  color: #ffd37b;
24
84
  font-size: 50px;
25
85
  margin-right: 30px;
26
86
  }
27
- div.empty-placeholder i:before {
87
+ div.empty i:before {
28
88
  animation: pending 1s infinite;
29
89
  }
30
- div.empty-placeholder p {
31
- font-size: 30px;
90
+ div.empty p {
91
+ color: rgba(255, 255, 255, 0.3);
92
+ font-size: 25px;
32
93
  font-weight: 300;
33
94
  }
34
95
 
35
- ul.tabs {
36
- padding: 0;
37
- margin: 0;
96
+ .hidden {
97
+ visibility: hidden;
98
+ display: none !important;
99
+ }
100
+
101
+ .selected:after {
102
+ content: "";
38
103
  width: 100%;
39
- display: flex;
40
- justify-content: center;
104
+ height: 100%;
105
+ position: absolute;
106
+ left: 0;
107
+ top: 0;
108
+ border-radius: inherit;
109
+ box-shadow: inset 0 0 0 3px #48d1cc;
41
110
  }
42
- ul.tabs li {
43
- list-style: none;
44
- cursor: pointer;
111
+
112
+ @keyframes popup {
113
+ 0% {
114
+ opacity: 0;
115
+ transform: translateY(20px);
116
+ }
117
+ 20% {
118
+ opacity: 1;
119
+ transform: none;
120
+ }
121
+ 80% {
122
+ opacity: 1;
123
+ transform: none;
124
+ }
125
+ 100% {
126
+ transform: translateY(-10px);
127
+ opacity: 0;
128
+ }
129
+ }
130
+ div.popups {
131
+ position: fixed;
132
+ bottom: 20px;
133
+ right: 20px;
134
+ }
135
+ div.popups div.popup-message {
136
+ display: flex;
137
+ background-color: #ffd37b;
138
+ color: #1e1e1e;
139
+ padding: 10px 30px;
140
+ width: 200px;
45
141
  border-radius: 10px;
142
+ text-align: center;
143
+ align-items: center;
144
+ margin-top: 5px;
145
+ box-shadow: 0 5px 10px 10px rgba(0, 0, 0, 0.1);
146
+ animation: popup 1s ease-in-out forwards;
46
147
  }
47
- ul.tabs li.selected {
48
- background-color: rgba(255, 255, 255, 0.05);
148
+ div.popups div.popup-message i {
149
+ font-size: 20px;
49
150
  }
50
- ul.tabs li.selected a {
51
- color: #ffd37b;
151
+ div.popups div.popup-message span {
152
+ flex-basis: 90%;
52
153
  }
53
- ul.tabs li a {
154
+
155
+ body > header {
156
+ display: flex;
157
+ justify-content: center;
158
+ position: relative;
159
+ }
160
+ body > header button {
54
161
  text-decoration: none;
55
162
  color: rgba(255, 255, 255, 0.5);
56
- padding: 10px 20px;
57
- display: inline-block;
58
163
  }
59
- ul.tabs li:hover:not(.selected) a {
60
- color: #fff;
164
+ body > header button i {
165
+ margin-right: 10px;
166
+ }
167
+ body > header button.checked {
168
+ background-color: #ffd37b;
169
+ color: #1e1e1e;
170
+ }
171
+ body > header button:not(.checked) {
172
+ color: rgba(255, 255, 255, 0.5);
173
+ background-color: rgba(255, 255, 255, 0.05);
174
+ }
175
+ body > header hr {
176
+ position: relative;
177
+ width: 1px;
178
+ height: 25px;
179
+ border: none;
180
+ background-color: #ddd;
181
+ margin: 10px 10px;
182
+ }
183
+ body > header div.buttons-container#container-select button {
184
+ padding: 10px 20px;
61
185
  }
62
186
 
63
- div.tab-container {
64
- width: calc(100% - 80px);
65
- padding: 20px;
66
- margin: 0 20px;
67
- border-radius: 5px;
187
+ section#history div.history:hover div.meta {
188
+ cursor: pointer;
68
189
  }
69
- div.tab-container div.row {
70
- border-radius: inherit;
190
+ section#history div.history:hover div.meta span.time, section#history div.history:hover div.meta span.status, section#history div.history:hover div.meta span.name {
191
+ background-color: rgba(255, 255, 255, 0.15);
192
+ }
193
+
194
+ div.container {
195
+ padding: 0 20px;
196
+ margin-top: 0;
71
197
  }
72
- div.tab-container div.row div.meta {
198
+ div.container div.meta {
73
199
  display: flex;
74
200
  flex-wrap: wrap;
75
201
  border-radius: inherit;
76
202
  }
77
- div.tab-container div.row div.meta div.segment {
203
+ div.container div.meta div.segment {
78
204
  display: inherit;
79
205
  flex-wrap: inherit;
80
206
  }
81
- div.tab-container div.row div.meta span, div.tab-container div.row div.meta button {
207
+ div.container div.meta span, div.container div.meta button {
82
208
  padding: 7px 15px;
83
209
  display: inline-block;
84
210
  background-color: rgba(255, 255, 255, 0.05);
@@ -87,159 +213,111 @@ div.tab-container div.row div.meta span, div.tab-container div.row div.meta butt
87
213
  margin-bottom: 5px;
88
214
  font-size: 14px;
89
215
  }
90
- div.tab-container div.row div.meta button {
91
- border: none;
216
+ div.container div.meta button {
92
217
  min-width: 50px;
218
+ margin-top: 0;
219
+ margin-left: 0;
220
+ }
221
+ div.container div.meta button i {
222
+ float: none;
223
+ margin-right: 0;
93
224
  }
94
- div.tab-container div.row div.meta span.arrow {
225
+ div.container div.meta span.arrow {
95
226
  background: transparent;
96
227
  color: rgba(255, 255, 255, 0.3);
97
228
  padding: 7px 5px;
98
229
  margin-right: 0;
99
230
  }
100
- div.tab-container div.row div.meta span.arrow i {
231
+ div.container div.meta span.arrow i {
101
232
  margin: 0 10px;
102
233
  }
103
- div.tab-container div.row div.meta button.activity i.fa-plug {
234
+ div.container div.meta button.activity i.fa-plug {
104
235
  color: #a7ff7b;
105
236
  }
106
- div.tab-container div.row div.meta button.activity i.fa-power-off {
237
+ div.container div.meta button.activity i.fa-power-off {
107
238
  color: #ff7b7b;
108
239
  }
109
- div.tab-container div.row div.meta span.status.red {
240
+ div.container div.meta span.status.red {
110
241
  color: #ff7b7b;
111
242
  }
112
- div.tab-container div.row div.meta span.status.green {
243
+ div.container div.meta span.status.green {
113
244
  color: #a7ff7b;
114
245
  }
115
- div.tab-container div.row div.meta span.method {
246
+ div.container div.meta span.method {
116
247
  background-color: #ffd37b;
117
248
  color: #1e1e1e;
118
249
  }
119
- div.tab-container div.row div.meta span.path {
250
+ div.container div.meta span.path {
120
251
  background-color: #ffa77b;
121
252
  color: #1e1e1e;
122
253
  }
123
- div.tab-container div.row div.meta span.time {
254
+ div.container div.meta span.time {
124
255
  width: 60px;
125
256
  text-align: center;
126
257
  }
127
- div.tab-container div.row div.meta span.calls-count, div.tab-container div.row div.meta span.name, div.tab-container div.row div.meta span.time {
258
+ div.container div.meta span.calls-count, div.container div.meta span.name, div.container div.meta span.time {
128
259
  color: rgba(255, 255, 255, 0.5);
129
260
  }
130
- div.tab-container div.row div.meta span.calls-count.active, div.tab-container div.row div.meta span.name.active, div.tab-container div.row div.meta span.time.active {
261
+ div.container div.meta span.calls-count.active, div.container div.meta span.name.active, div.container div.meta span.time.active {
131
262
  color: #fff;
132
263
  }
133
- div.tab-container div.row div.meta span.calls-count i, div.tab-container div.row div.meta span.name i, div.tab-container div.row div.meta span.time i {
264
+ div.container div.meta span.calls-count i, div.container div.meta span.name i, div.container div.meta span.time i {
134
265
  opacity: 0.2;
135
266
  margin-right: 10px;
136
267
  }
137
- div.tab-container div.row div.meta span.pending i:before {
268
+ div.container div.meta span.pending {
269
+ min-width: 25px;
270
+ text-align: center;
271
+ }
272
+ div.container div.meta span.pending i:before {
138
273
  animation: pending 1s infinite;
139
274
  }
140
- div.tab-container div.row div.meta span.separator, div.tab-container div.row div.meta span.label {
275
+ div.container div.meta span.separator, div.container div.meta span.label {
141
276
  padding: 0 5px;
142
277
  color: rgba(0, 0, 0, 0.3);
143
278
  font-size: 12px;
144
279
  margin-right: 0;
145
280
  margin-bottom: 0;
146
281
  }
147
- div.tab-container div.row div.meta span.label {
282
+ div.container div.meta span.label {
148
283
  padding-left: 0;
149
284
  }
150
- div.tab-container div.row div.meta span.handled-with {
285
+ div.container div.meta span.handled-with {
151
286
  background-color: transparent;
152
287
  color: rgba(255, 255, 255, 0.3);
153
288
  margin-right: 0;
154
289
  padding: 7px 5px;
155
290
  }
156
- div.tab-container div.row div.meta span.handled-with span.handler-name {
291
+ div.container div.meta span.handled-with span.handler-name {
157
292
  margin: 0;
158
293
  padding: 0;
159
294
  background-color: transparent;
160
295
  color: #ffd37b;
161
296
  }
162
- div.tab-container div.row div.meta span.handled-with span.handler-name.red {
297
+ div.container div.meta span.handled-with span.handler-name.red {
163
298
  color: #ff7b7b;
164
299
  }
165
- div.tab-container div.row div.meta span.forward {
300
+ div.container div.meta span.forward {
166
301
  background-color: #7b7bff;
167
302
  }
168
- div.tab-container div.row div.meta span.error {
303
+ div.container div.meta span.error {
169
304
  background-color: #ff4848;
170
305
  }
171
- div.tab-container div.row.history:hover div.meta {
172
- cursor: pointer;
173
- }
174
- div.tab-container div.row.history:hover div.meta span.time, div.tab-container div.row.history:hover div.meta span.status, div.tab-container div.row.history:hover div.meta span.name {
175
- background-color: rgba(255, 255, 255, 0.15);
306
+ div.container div.meta span.seed {
307
+ background-color: #a7ff7b;
308
+ color: #1e1e1e;
176
309
  }
177
- div.tab-container pre {
310
+ div.container pre {
178
311
  margin: 0;
179
- margin-bottom: 40px;
312
+ margin-bottom: 20px;
180
313
  padding: 20px;
181
314
  border-radius: 5px;
182
315
  background-color: rgba(255, 255, 255, 0.05);
183
316
  overflow: hidden;
184
317
  }
185
- div.tab-container pre.hidden {
318
+ div.container pre.hidden {
186
319
  display: none;
187
320
  }
188
- div.tab-container pre:not(:last-child) {
321
+ div.container pre:not(:last-child) {
189
322
  margin-bottom: 20px;
190
- }
191
-
192
- div.popups-container {
193
- position: fixed;
194
- bottom: 20px;
195
- right: 20px;
196
- }
197
- div.popups-container div.popup-message {
198
- display: flex;
199
- background-color: #ffd37b;
200
- color: #1e1e1e;
201
- padding: 10px 30px;
202
- width: 200px;
203
- border-radius: 10px;
204
- text-align: center;
205
- align-items: center;
206
- margin-top: 5px;
207
- box-shadow: 0 5px 10px 10px rgba(0, 0, 0, 0.1);
208
- animation: popup 1s ease-in-out forwards;
209
- }
210
- div.popups-container div.popup-message i {
211
- font-size: 20px;
212
- }
213
- div.popups-container div.popup-message span {
214
- flex-basis: 90%;
215
- }
216
-
217
- @keyframes pending {
218
- 0% {
219
- content: "\f251";
220
- }
221
- 33% {
222
- content: "\f252";
223
- }
224
- 66% {
225
- content: "\f253";
226
- }
227
- }
228
- @keyframes popup {
229
- 0% {
230
- opacity: 0;
231
- transform: translateY(20px);
232
- }
233
- 20% {
234
- opacity: 1;
235
- transform: none;
236
- }
237
- 80% {
238
- opacity: 1;
239
- transform: none;
240
- }
241
- 100% {
242
- transform: translateY(-10px);
243
- opacity: 0;
244
- }
245
323
  }
@@ -1,2 +0,0 @@
1
- import 'colors';
2
- //# sourceMappingURL=process.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/process.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,CAAC"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- require("colors");
4
- // process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
5
- // process.on('uncaughtException', (error) => console.error(error.stack));
6
- // process.on('unhandledRejection', (reason) => console.error(reason));
7
- //# sourceMappingURL=process.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/process.ts"],"names":[],"mappings":";;AAAA,kBAAgB;AAEhB,kDAAkD;AAElD,0EAA0E;AAC1E,uEAAuE"}