@teambit/api-server 1.0.349 → 1.0.351

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.
@@ -1,4 +1,4 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="0" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.harmony/api-server@1.0.349" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.harmony/api-server@1.0.351" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </testsuites>
@@ -25,7 +25,7 @@
25
25
  "__schema": "ClassSchema",
26
26
  "location": {
27
27
  "filePath": "api-server.main.runtime.ts",
28
- "line": 25,
28
+ "line": 27,
29
29
  "character": 1
30
30
  },
31
31
  "signature": "class ApiServerMain",
@@ -35,7 +35,7 @@
35
35
  "__schema": "ConstructorSchema",
36
36
  "location": {
37
37
  "filePath": "api-server.main.runtime.ts",
38
- "line": 26,
38
+ "line": 28,
39
39
  "character": 3
40
40
  },
41
41
  "signature": "constructor ApiServerMain(workspace: Workspace, logger: Logger, express: ExpressMain, watcher: WatcherMain, installer: InstallMain, importer: ImporterMain): ApiServerMain",
@@ -45,7 +45,7 @@
45
45
  "__schema": "ParameterSchema",
46
46
  "location": {
47
47
  "filePath": "api-server.main.runtime.ts",
48
- "line": 27,
48
+ "line": 29,
49
49
  "character": 5
50
50
  },
51
51
  "name": "workspace",
@@ -53,7 +53,7 @@
53
53
  "__schema": "TypeRefSchema",
54
54
  "location": {
55
55
  "filePath": "api-server.main.runtime.ts",
56
- "line": 27,
56
+ "line": 29,
57
57
  "character": 24
58
58
  },
59
59
  "name": "Workspace"
@@ -65,7 +65,7 @@
65
65
  "__schema": "ParameterSchema",
66
66
  "location": {
67
67
  "filePath": "api-server.main.runtime.ts",
68
- "line": 28,
68
+ "line": 30,
69
69
  "character": 5
70
70
  },
71
71
  "name": "logger",
@@ -73,7 +73,7 @@
73
73
  "__schema": "TypeRefSchema",
74
74
  "location": {
75
75
  "filePath": "api-server.main.runtime.ts",
76
- "line": 28,
76
+ "line": 30,
77
77
  "character": 21
78
78
  },
79
79
  "name": "Logger"
@@ -85,7 +85,7 @@
85
85
  "__schema": "ParameterSchema",
86
86
  "location": {
87
87
  "filePath": "api-server.main.runtime.ts",
88
- "line": 29,
88
+ "line": 31,
89
89
  "character": 5
90
90
  },
91
91
  "name": "express",
@@ -93,7 +93,7 @@
93
93
  "__schema": "TypeRefSchema",
94
94
  "location": {
95
95
  "filePath": "api-server.main.runtime.ts",
96
- "line": 29,
96
+ "line": 31,
97
97
  "character": 22
98
98
  },
99
99
  "name": "ExpressMain"
@@ -105,7 +105,7 @@
105
105
  "__schema": "ParameterSchema",
106
106
  "location": {
107
107
  "filePath": "api-server.main.runtime.ts",
108
- "line": 30,
108
+ "line": 32,
109
109
  "character": 5
110
110
  },
111
111
  "name": "watcher",
@@ -113,7 +113,7 @@
113
113
  "__schema": "TypeRefSchema",
114
114
  "location": {
115
115
  "filePath": "api-server.main.runtime.ts",
116
- "line": 30,
116
+ "line": 32,
117
117
  "character": 22
118
118
  },
119
119
  "name": "WatcherMain"
@@ -125,7 +125,7 @@
125
125
  "__schema": "ParameterSchema",
126
126
  "location": {
127
127
  "filePath": "api-server.main.runtime.ts",
128
- "line": 31,
128
+ "line": 33,
129
129
  "character": 5
130
130
  },
131
131
  "name": "installer",
@@ -133,7 +133,7 @@
133
133
  "__schema": "TypeRefSchema",
134
134
  "location": {
135
135
  "filePath": "api-server.main.runtime.ts",
136
- "line": 31,
136
+ "line": 33,
137
137
  "character": 24
138
138
  },
139
139
  "name": "InstallMain"
@@ -145,7 +145,7 @@
145
145
  "__schema": "ParameterSchema",
146
146
  "location": {
147
147
  "filePath": "api-server.main.runtime.ts",
148
- "line": 32,
148
+ "line": 34,
149
149
  "character": 5
150
150
  },
151
151
  "name": "importer",
@@ -153,7 +153,7 @@
153
153
  "__schema": "TypeRefSchema",
154
154
  "location": {
155
155
  "filePath": "api-server.main.runtime.ts",
156
- "line": 32,
156
+ "line": 34,
157
157
  "character": 23
158
158
  },
159
159
  "name": "ImporterMain"
@@ -166,7 +166,7 @@
166
166
  "__schema": "ThisTypeSchema",
167
167
  "location": {
168
168
  "filePath": "api-server.main.runtime.ts",
169
- "line": 25,
169
+ "line": 27,
170
170
  "character": 1
171
171
  },
172
172
  "name": "ApiServerMain"
@@ -177,7 +177,7 @@
177
177
  "__schema": "FunctionLikeSchema",
178
178
  "location": {
179
179
  "filePath": "api-server.main.runtime.ts",
180
- "line": 35,
180
+ "line": 37,
181
181
  "character": 3
182
182
  },
183
183
  "signature": "(method) ApiServerMain.runApiServer(options: {\n port: number;\n compile: boolean;\n}): Promise<unknown>",
@@ -187,7 +187,7 @@
187
187
  "__schema": "ParameterSchema",
188
188
  "location": {
189
189
  "filePath": "api-server.main.runtime.ts",
190
- "line": 35,
190
+ "line": 37,
191
191
  "character": 22
192
192
  },
193
193
  "name": "options",
@@ -195,7 +195,7 @@
195
195
  "__schema": "TypeLiteralSchema",
196
196
  "location": {
197
197
  "filePath": "api-server.main.runtime.ts",
198
- "line": 35,
198
+ "line": 37,
199
199
  "character": 31
200
200
  },
201
201
  "members": [
@@ -203,7 +203,7 @@
203
203
  "__schema": "VariableLikeSchema",
204
204
  "location": {
205
205
  "filePath": "api-server.main.runtime.ts",
206
- "line": 35,
206
+ "line": 37,
207
207
  "character": 33
208
208
  },
209
209
  "signature": "(property) port: number",
@@ -212,7 +212,7 @@
212
212
  "__schema": "KeywordTypeSchema",
213
213
  "location": {
214
214
  "filePath": "api-server.main.runtime.ts",
215
- "line": 35,
215
+ "line": 37,
216
216
  "character": 39
217
217
  },
218
218
  "name": "number"
@@ -223,7 +223,7 @@
223
223
  "__schema": "VariableLikeSchema",
224
224
  "location": {
225
225
  "filePath": "api-server.main.runtime.ts",
226
- "line": 35,
226
+ "line": 37,
227
227
  "character": 47
228
228
  },
229
229
  "signature": "(property) compile: boolean",
@@ -232,7 +232,7 @@
232
232
  "__schema": "KeywordTypeSchema",
233
233
  "location": {
234
234
  "filePath": "api-server.main.runtime.ts",
235
- "line": 35,
235
+ "line": 37,
236
236
  "character": 56
237
237
  },
238
238
  "name": "boolean"
@@ -249,7 +249,7 @@
249
249
  "__schema": "InferenceTypeSchema",
250
250
  "location": {
251
251
  "filePath": "api-server.main.runtime.ts",
252
- "line": 35,
252
+ "line": 37,
253
253
  "character": 3
254
254
  },
255
255
  "type": "Promise<unknown>"
@@ -262,7 +262,7 @@
262
262
  "__schema": "VariableLikeSchema",
263
263
  "location": {
264
264
  "filePath": "api-server.main.runtime.ts",
265
- "line": 99,
265
+ "line": 133,
266
266
  "character": 3
267
267
  },
268
268
  "signature": "(property) ApiServerMain.dependencies: Aspect[]",
@@ -271,7 +271,7 @@
271
271
  "__schema": "InferenceTypeSchema",
272
272
  "location": {
273
273
  "filePath": "api-server.main.runtime.ts",
274
- "line": 99,
274
+ "line": 133,
275
275
  "character": 3
276
276
  },
277
277
  "type": "Aspect[]"
@@ -283,7 +283,7 @@
283
283
  "__schema": "VariableLikeSchema",
284
284
  "location": {
285
285
  "filePath": "api-server.main.runtime.ts",
286
- "line": 117,
286
+ "line": 151,
287
287
  "character": 3
288
288
  },
289
289
  "signature": "(property) ApiServerMain.runtime: RuntimeDefinition",
@@ -292,7 +292,7 @@
292
292
  "__schema": "InferenceTypeSchema",
293
293
  "location": {
294
294
  "filePath": "api-server.main.runtime.ts",
295
- "line": 117,
295
+ "line": 151,
296
296
  "character": 3
297
297
  },
298
298
  "type": "RuntimeDefinition"
@@ -304,7 +304,7 @@
304
304
  "__schema": "FunctionLikeSchema",
305
305
  "location": {
306
306
  "filePath": "api-server.main.runtime.ts",
307
- "line": 118,
307
+ "line": 152,
308
308
  "character": 3
309
309
  },
310
310
  "signature": "(method) ApiServerMain.provider([cli, workspace, loggerMain, express, watcher, snapping, lanes, installer, exporter, checkout, componentLog, importer, componentCompare, generator, remove, config,]: [\n CLIMain,\n Workspace,\n LoggerMain,\n ExpressMain,\n WatcherMain,\n SnappingMain,\n LanesMain,\n InstallMain,\n ExportMain,\n CheckoutMain,\n ComponentLogMain,\n ImporterMain,\n ComponentCompareMain,\n GeneratorMain,\n RemoveMain,\n ConfigMain\n]): Promise<ApiServerMain>",
@@ -314,7 +314,7 @@
314
314
  "__schema": "ParameterSchema",
315
315
  "location": {
316
316
  "filePath": "api-server.main.runtime.ts",
317
- "line": 118,
317
+ "line": 152,
318
318
  "character": 25
319
319
  },
320
320
  "name": "[ cli, workspace, loggerMain, express, watcher, snapping, lanes, installer, exporter, checkout, componentLog, importer, componentCompare, generator, remove, config ]",
@@ -322,7 +322,7 @@
322
322
  "__schema": "TupleTypeSchema",
323
323
  "location": {
324
324
  "filePath": "api-server.main.runtime.ts",
325
- "line": 135,
325
+ "line": 169,
326
326
  "character": 6
327
327
  },
328
328
  "elements": [
@@ -330,7 +330,7 @@
330
330
  "__schema": "TypeRefSchema",
331
331
  "location": {
332
332
  "filePath": "api-server.main.runtime.ts",
333
- "line": 136,
333
+ "line": 170,
334
334
  "character": 5
335
335
  },
336
336
  "name": "CLIMain"
@@ -339,7 +339,7 @@
339
339
  "__schema": "TypeRefSchema",
340
340
  "location": {
341
341
  "filePath": "api-server.main.runtime.ts",
342
- "line": 137,
342
+ "line": 171,
343
343
  "character": 5
344
344
  },
345
345
  "name": "Workspace"
@@ -348,7 +348,7 @@
348
348
  "__schema": "TypeRefSchema",
349
349
  "location": {
350
350
  "filePath": "api-server.main.runtime.ts",
351
- "line": 138,
351
+ "line": 172,
352
352
  "character": 5
353
353
  },
354
354
  "name": "LoggerMain"
@@ -357,7 +357,7 @@
357
357
  "__schema": "TypeRefSchema",
358
358
  "location": {
359
359
  "filePath": "api-server.main.runtime.ts",
360
- "line": 139,
360
+ "line": 173,
361
361
  "character": 5
362
362
  },
363
363
  "name": "ExpressMain"
@@ -366,7 +366,7 @@
366
366
  "__schema": "TypeRefSchema",
367
367
  "location": {
368
368
  "filePath": "api-server.main.runtime.ts",
369
- "line": 140,
369
+ "line": 174,
370
370
  "character": 5
371
371
  },
372
372
  "name": "WatcherMain"
@@ -375,7 +375,7 @@
375
375
  "__schema": "TypeRefSchema",
376
376
  "location": {
377
377
  "filePath": "api-server.main.runtime.ts",
378
- "line": 141,
378
+ "line": 175,
379
379
  "character": 5
380
380
  },
381
381
  "name": "SnappingMain"
@@ -384,7 +384,7 @@
384
384
  "__schema": "TypeRefSchema",
385
385
  "location": {
386
386
  "filePath": "api-server.main.runtime.ts",
387
- "line": 142,
387
+ "line": 176,
388
388
  "character": 5
389
389
  },
390
390
  "name": "LanesMain"
@@ -393,7 +393,7 @@
393
393
  "__schema": "TypeRefSchema",
394
394
  "location": {
395
395
  "filePath": "api-server.main.runtime.ts",
396
- "line": 143,
396
+ "line": 177,
397
397
  "character": 5
398
398
  },
399
399
  "name": "InstallMain"
@@ -402,7 +402,7 @@
402
402
  "__schema": "TypeRefSchema",
403
403
  "location": {
404
404
  "filePath": "api-server.main.runtime.ts",
405
- "line": 144,
405
+ "line": 178,
406
406
  "character": 5
407
407
  },
408
408
  "name": "ExportMain"
@@ -411,7 +411,7 @@
411
411
  "__schema": "TypeRefSchema",
412
412
  "location": {
413
413
  "filePath": "api-server.main.runtime.ts",
414
- "line": 145,
414
+ "line": 179,
415
415
  "character": 5
416
416
  },
417
417
  "name": "CheckoutMain"
@@ -420,7 +420,7 @@
420
420
  "__schema": "TypeRefSchema",
421
421
  "location": {
422
422
  "filePath": "api-server.main.runtime.ts",
423
- "line": 146,
423
+ "line": 180,
424
424
  "character": 5
425
425
  },
426
426
  "name": "ComponentLogMain"
@@ -429,7 +429,7 @@
429
429
  "__schema": "TypeRefSchema",
430
430
  "location": {
431
431
  "filePath": "api-server.main.runtime.ts",
432
- "line": 147,
432
+ "line": 181,
433
433
  "character": 5
434
434
  },
435
435
  "name": "ImporterMain"
@@ -438,7 +438,7 @@
438
438
  "__schema": "TypeRefSchema",
439
439
  "location": {
440
440
  "filePath": "api-server.main.runtime.ts",
441
- "line": 148,
441
+ "line": 182,
442
442
  "character": 5
443
443
  },
444
444
  "name": "ComponentCompareMain"
@@ -447,7 +447,7 @@
447
447
  "__schema": "TypeRefSchema",
448
448
  "location": {
449
449
  "filePath": "api-server.main.runtime.ts",
450
- "line": 149,
450
+ "line": 183,
451
451
  "character": 5
452
452
  },
453
453
  "name": "GeneratorMain"
@@ -456,7 +456,7 @@
456
456
  "__schema": "TypeRefSchema",
457
457
  "location": {
458
458
  "filePath": "api-server.main.runtime.ts",
459
- "line": 150,
459
+ "line": 184,
460
460
  "character": 5
461
461
  },
462
462
  "name": "RemoveMain"
@@ -465,7 +465,7 @@
465
465
  "__schema": "TypeRefSchema",
466
466
  "location": {
467
467
  "filePath": "api-server.main.runtime.ts",
468
- "line": 151,
468
+ "line": 185,
469
469
  "character": 5
470
470
  },
471
471
  "name": "ConfigMain"
@@ -480,7 +480,7 @@
480
480
  "__schema": "InferenceTypeSchema",
481
481
  "location": {
482
482
  "filePath": "api-server.main.runtime.ts",
483
- "line": 118,
483
+ "line": 152,
484
484
  "character": 3
485
485
  },
486
486
  "type": "Promise<ApiServerMain>"
@@ -556,7 +556,7 @@
556
556
  "__schema": "ClassSchema",
557
557
  "location": {
558
558
  "filePath": "api-server.main.runtime.ts",
559
- "line": 25,
559
+ "line": 27,
560
560
  "character": 1
561
561
  },
562
562
  "signature": "class ApiServerMain",
@@ -566,7 +566,7 @@
566
566
  "__schema": "ConstructorSchema",
567
567
  "location": {
568
568
  "filePath": "api-server.main.runtime.ts",
569
- "line": 26,
569
+ "line": 28,
570
570
  "character": 3
571
571
  },
572
572
  "signature": "constructor ApiServerMain(workspace: Workspace, logger: Logger, express: ExpressMain, watcher: WatcherMain, installer: InstallMain, importer: ImporterMain): ApiServerMain",
@@ -576,7 +576,7 @@
576
576
  "__schema": "ParameterSchema",
577
577
  "location": {
578
578
  "filePath": "api-server.main.runtime.ts",
579
- "line": 27,
579
+ "line": 29,
580
580
  "character": 5
581
581
  },
582
582
  "name": "workspace",
@@ -584,7 +584,7 @@
584
584
  "__schema": "TypeRefSchema",
585
585
  "location": {
586
586
  "filePath": "api-server.main.runtime.ts",
587
- "line": 27,
587
+ "line": 29,
588
588
  "character": 24
589
589
  },
590
590
  "name": "Workspace"
@@ -596,7 +596,7 @@
596
596
  "__schema": "ParameterSchema",
597
597
  "location": {
598
598
  "filePath": "api-server.main.runtime.ts",
599
- "line": 28,
599
+ "line": 30,
600
600
  "character": 5
601
601
  },
602
602
  "name": "logger",
@@ -604,7 +604,7 @@
604
604
  "__schema": "TypeRefSchema",
605
605
  "location": {
606
606
  "filePath": "api-server.main.runtime.ts",
607
- "line": 28,
607
+ "line": 30,
608
608
  "character": 21
609
609
  },
610
610
  "name": "Logger"
@@ -616,7 +616,7 @@
616
616
  "__schema": "ParameterSchema",
617
617
  "location": {
618
618
  "filePath": "api-server.main.runtime.ts",
619
- "line": 29,
619
+ "line": 31,
620
620
  "character": 5
621
621
  },
622
622
  "name": "express",
@@ -624,7 +624,7 @@
624
624
  "__schema": "TypeRefSchema",
625
625
  "location": {
626
626
  "filePath": "api-server.main.runtime.ts",
627
- "line": 29,
627
+ "line": 31,
628
628
  "character": 22
629
629
  },
630
630
  "name": "ExpressMain"
@@ -636,7 +636,7 @@
636
636
  "__schema": "ParameterSchema",
637
637
  "location": {
638
638
  "filePath": "api-server.main.runtime.ts",
639
- "line": 30,
639
+ "line": 32,
640
640
  "character": 5
641
641
  },
642
642
  "name": "watcher",
@@ -644,7 +644,7 @@
644
644
  "__schema": "TypeRefSchema",
645
645
  "location": {
646
646
  "filePath": "api-server.main.runtime.ts",
647
- "line": 30,
647
+ "line": 32,
648
648
  "character": 22
649
649
  },
650
650
  "name": "WatcherMain"
@@ -656,7 +656,7 @@
656
656
  "__schema": "ParameterSchema",
657
657
  "location": {
658
658
  "filePath": "api-server.main.runtime.ts",
659
- "line": 31,
659
+ "line": 33,
660
660
  "character": 5
661
661
  },
662
662
  "name": "installer",
@@ -664,7 +664,7 @@
664
664
  "__schema": "TypeRefSchema",
665
665
  "location": {
666
666
  "filePath": "api-server.main.runtime.ts",
667
- "line": 31,
667
+ "line": 33,
668
668
  "character": 24
669
669
  },
670
670
  "name": "InstallMain"
@@ -676,7 +676,7 @@
676
676
  "__schema": "ParameterSchema",
677
677
  "location": {
678
678
  "filePath": "api-server.main.runtime.ts",
679
- "line": 32,
679
+ "line": 34,
680
680
  "character": 5
681
681
  },
682
682
  "name": "importer",
@@ -684,7 +684,7 @@
684
684
  "__schema": "TypeRefSchema",
685
685
  "location": {
686
686
  "filePath": "api-server.main.runtime.ts",
687
- "line": 32,
687
+ "line": 34,
688
688
  "character": 23
689
689
  },
690
690
  "name": "ImporterMain"
@@ -697,7 +697,7 @@
697
697
  "__schema": "ThisTypeSchema",
698
698
  "location": {
699
699
  "filePath": "api-server.main.runtime.ts",
700
- "line": 25,
700
+ "line": 27,
701
701
  "character": 1
702
702
  },
703
703
  "name": "ApiServerMain"
@@ -708,7 +708,7 @@
708
708
  "__schema": "FunctionLikeSchema",
709
709
  "location": {
710
710
  "filePath": "api-server.main.runtime.ts",
711
- "line": 35,
711
+ "line": 37,
712
712
  "character": 3
713
713
  },
714
714
  "signature": "(method) ApiServerMain.runApiServer(options: {\n port: number;\n compile: boolean;\n}): Promise<unknown>",
@@ -718,7 +718,7 @@
718
718
  "__schema": "ParameterSchema",
719
719
  "location": {
720
720
  "filePath": "api-server.main.runtime.ts",
721
- "line": 35,
721
+ "line": 37,
722
722
  "character": 22
723
723
  },
724
724
  "name": "options",
@@ -726,7 +726,7 @@
726
726
  "__schema": "TypeLiteralSchema",
727
727
  "location": {
728
728
  "filePath": "api-server.main.runtime.ts",
729
- "line": 35,
729
+ "line": 37,
730
730
  "character": 31
731
731
  },
732
732
  "members": [
@@ -734,7 +734,7 @@
734
734
  "__schema": "VariableLikeSchema",
735
735
  "location": {
736
736
  "filePath": "api-server.main.runtime.ts",
737
- "line": 35,
737
+ "line": 37,
738
738
  "character": 33
739
739
  },
740
740
  "signature": "(property) port: number",
@@ -743,7 +743,7 @@
743
743
  "__schema": "KeywordTypeSchema",
744
744
  "location": {
745
745
  "filePath": "api-server.main.runtime.ts",
746
- "line": 35,
746
+ "line": 37,
747
747
  "character": 39
748
748
  },
749
749
  "name": "number"
@@ -754,7 +754,7 @@
754
754
  "__schema": "VariableLikeSchema",
755
755
  "location": {
756
756
  "filePath": "api-server.main.runtime.ts",
757
- "line": 35,
757
+ "line": 37,
758
758
  "character": 47
759
759
  },
760
760
  "signature": "(property) compile: boolean",
@@ -763,7 +763,7 @@
763
763
  "__schema": "KeywordTypeSchema",
764
764
  "location": {
765
765
  "filePath": "api-server.main.runtime.ts",
766
- "line": 35,
766
+ "line": 37,
767
767
  "character": 56
768
768
  },
769
769
  "name": "boolean"
@@ -780,7 +780,7 @@
780
780
  "__schema": "InferenceTypeSchema",
781
781
  "location": {
782
782
  "filePath": "api-server.main.runtime.ts",
783
- "line": 35,
783
+ "line": 37,
784
784
  "character": 3
785
785
  },
786
786
  "type": "Promise<unknown>"
@@ -793,7 +793,7 @@
793
793
  "__schema": "VariableLikeSchema",
794
794
  "location": {
795
795
  "filePath": "api-server.main.runtime.ts",
796
- "line": 99,
796
+ "line": 133,
797
797
  "character": 3
798
798
  },
799
799
  "signature": "(property) ApiServerMain.dependencies: Aspect[]",
@@ -802,7 +802,7 @@
802
802
  "__schema": "InferenceTypeSchema",
803
803
  "location": {
804
804
  "filePath": "api-server.main.runtime.ts",
805
- "line": 99,
805
+ "line": 133,
806
806
  "character": 3
807
807
  },
808
808
  "type": "Aspect[]"
@@ -814,7 +814,7 @@
814
814
  "__schema": "VariableLikeSchema",
815
815
  "location": {
816
816
  "filePath": "api-server.main.runtime.ts",
817
- "line": 117,
817
+ "line": 151,
818
818
  "character": 3
819
819
  },
820
820
  "signature": "(property) ApiServerMain.runtime: RuntimeDefinition",
@@ -823,7 +823,7 @@
823
823
  "__schema": "InferenceTypeSchema",
824
824
  "location": {
825
825
  "filePath": "api-server.main.runtime.ts",
826
- "line": 117,
826
+ "line": 151,
827
827
  "character": 3
828
828
  },
829
829
  "type": "RuntimeDefinition"
@@ -835,7 +835,7 @@
835
835
  "__schema": "FunctionLikeSchema",
836
836
  "location": {
837
837
  "filePath": "api-server.main.runtime.ts",
838
- "line": 118,
838
+ "line": 152,
839
839
  "character": 3
840
840
  },
841
841
  "signature": "(method) ApiServerMain.provider([cli, workspace, loggerMain, express, watcher, snapping, lanes, installer, exporter, checkout, componentLog, importer, componentCompare, generator, remove, config,]: [\n CLIMain,\n Workspace,\n LoggerMain,\n ExpressMain,\n WatcherMain,\n SnappingMain,\n LanesMain,\n InstallMain,\n ExportMain,\n CheckoutMain,\n ComponentLogMain,\n ImporterMain,\n ComponentCompareMain,\n GeneratorMain,\n RemoveMain,\n ConfigMain\n]): Promise<ApiServerMain>",
@@ -845,7 +845,7 @@
845
845
  "__schema": "ParameterSchema",
846
846
  "location": {
847
847
  "filePath": "api-server.main.runtime.ts",
848
- "line": 118,
848
+ "line": 152,
849
849
  "character": 25
850
850
  },
851
851
  "name": "[ cli, workspace, loggerMain, express, watcher, snapping, lanes, installer, exporter, checkout, componentLog, importer, componentCompare, generator, remove, config ]",
@@ -853,7 +853,7 @@
853
853
  "__schema": "TupleTypeSchema",
854
854
  "location": {
855
855
  "filePath": "api-server.main.runtime.ts",
856
- "line": 135,
856
+ "line": 169,
857
857
  "character": 6
858
858
  },
859
859
  "elements": [
@@ -861,7 +861,7 @@
861
861
  "__schema": "TypeRefSchema",
862
862
  "location": {
863
863
  "filePath": "api-server.main.runtime.ts",
864
- "line": 136,
864
+ "line": 170,
865
865
  "character": 5
866
866
  },
867
867
  "name": "CLIMain"
@@ -870,7 +870,7 @@
870
870
  "__schema": "TypeRefSchema",
871
871
  "location": {
872
872
  "filePath": "api-server.main.runtime.ts",
873
- "line": 137,
873
+ "line": 171,
874
874
  "character": 5
875
875
  },
876
876
  "name": "Workspace"
@@ -879,7 +879,7 @@
879
879
  "__schema": "TypeRefSchema",
880
880
  "location": {
881
881
  "filePath": "api-server.main.runtime.ts",
882
- "line": 138,
882
+ "line": 172,
883
883
  "character": 5
884
884
  },
885
885
  "name": "LoggerMain"
@@ -888,7 +888,7 @@
888
888
  "__schema": "TypeRefSchema",
889
889
  "location": {
890
890
  "filePath": "api-server.main.runtime.ts",
891
- "line": 139,
891
+ "line": 173,
892
892
  "character": 5
893
893
  },
894
894
  "name": "ExpressMain"
@@ -897,7 +897,7 @@
897
897
  "__schema": "TypeRefSchema",
898
898
  "location": {
899
899
  "filePath": "api-server.main.runtime.ts",
900
- "line": 140,
900
+ "line": 174,
901
901
  "character": 5
902
902
  },
903
903
  "name": "WatcherMain"
@@ -906,7 +906,7 @@
906
906
  "__schema": "TypeRefSchema",
907
907
  "location": {
908
908
  "filePath": "api-server.main.runtime.ts",
909
- "line": 141,
909
+ "line": 175,
910
910
  "character": 5
911
911
  },
912
912
  "name": "SnappingMain"
@@ -915,7 +915,7 @@
915
915
  "__schema": "TypeRefSchema",
916
916
  "location": {
917
917
  "filePath": "api-server.main.runtime.ts",
918
- "line": 142,
918
+ "line": 176,
919
919
  "character": 5
920
920
  },
921
921
  "name": "LanesMain"
@@ -924,7 +924,7 @@
924
924
  "__schema": "TypeRefSchema",
925
925
  "location": {
926
926
  "filePath": "api-server.main.runtime.ts",
927
- "line": 143,
927
+ "line": 177,
928
928
  "character": 5
929
929
  },
930
930
  "name": "InstallMain"
@@ -933,7 +933,7 @@
933
933
  "__schema": "TypeRefSchema",
934
934
  "location": {
935
935
  "filePath": "api-server.main.runtime.ts",
936
- "line": 144,
936
+ "line": 178,
937
937
  "character": 5
938
938
  },
939
939
  "name": "ExportMain"
@@ -942,7 +942,7 @@
942
942
  "__schema": "TypeRefSchema",
943
943
  "location": {
944
944
  "filePath": "api-server.main.runtime.ts",
945
- "line": 145,
945
+ "line": 179,
946
946
  "character": 5
947
947
  },
948
948
  "name": "CheckoutMain"
@@ -951,7 +951,7 @@
951
951
  "__schema": "TypeRefSchema",
952
952
  "location": {
953
953
  "filePath": "api-server.main.runtime.ts",
954
- "line": 146,
954
+ "line": 180,
955
955
  "character": 5
956
956
  },
957
957
  "name": "ComponentLogMain"
@@ -960,7 +960,7 @@
960
960
  "__schema": "TypeRefSchema",
961
961
  "location": {
962
962
  "filePath": "api-server.main.runtime.ts",
963
- "line": 147,
963
+ "line": 181,
964
964
  "character": 5
965
965
  },
966
966
  "name": "ImporterMain"
@@ -969,7 +969,7 @@
969
969
  "__schema": "TypeRefSchema",
970
970
  "location": {
971
971
  "filePath": "api-server.main.runtime.ts",
972
- "line": 148,
972
+ "line": 182,
973
973
  "character": 5
974
974
  },
975
975
  "name": "ComponentCompareMain"
@@ -978,7 +978,7 @@
978
978
  "__schema": "TypeRefSchema",
979
979
  "location": {
980
980
  "filePath": "api-server.main.runtime.ts",
981
- "line": 149,
981
+ "line": 183,
982
982
  "character": 5
983
983
  },
984
984
  "name": "GeneratorMain"
@@ -987,7 +987,7 @@
987
987
  "__schema": "TypeRefSchema",
988
988
  "location": {
989
989
  "filePath": "api-server.main.runtime.ts",
990
- "line": 150,
990
+ "line": 184,
991
991
  "character": 5
992
992
  },
993
993
  "name": "RemoveMain"
@@ -996,7 +996,7 @@
996
996
  "__schema": "TypeRefSchema",
997
997
  "location": {
998
998
  "filePath": "api-server.main.runtime.ts",
999
- "line": 151,
999
+ "line": 185,
1000
1000
  "character": 5
1001
1001
  },
1002
1002
  "name": "ConfigMain"
@@ -1011,7 +1011,7 @@
1011
1011
  "__schema": "InferenceTypeSchema",
1012
1012
  "location": {
1013
1013
  "filePath": "api-server.main.runtime.ts",
1014
- "line": 118,
1014
+ "line": 152,
1015
1015
  "character": 3
1016
1016
  },
1017
1017
  "type": "Promise<ApiServerMain>"
@@ -1029,7 +1029,7 @@
1029
1029
  "__schema": "UnImplementedSchema",
1030
1030
  "location": {
1031
1031
  "filePath": "api-server.main.runtime.ts",
1032
- "line": 184,
1032
+ "line": 218,
1033
1033
  "character": 16
1034
1034
  },
1035
1035
  "name": "ApiServerMain",
@@ -1041,7 +1041,7 @@
1041
1041
  "__schema": "UnImplementedSchema",
1042
1042
  "location": {
1043
1043
  "filePath": "api-server.main.runtime.ts",
1044
- "line": 182,
1044
+ "line": 216,
1045
1045
  "character": 1
1046
1046
  },
1047
1047
  "name": "ApiServerAspect.addRuntime(ApiServerMain);",
@@ -1090,7 +1090,7 @@
1090
1090
  "componentId": {
1091
1091
  "scope": "teambit.harmony",
1092
1092
  "name": "api-server",
1093
- "version": "1.0.349"
1093
+ "version": "1.0.351"
1094
1094
  },
1095
1095
  "taggedModuleExports": []
1096
1096
  }
@@ -116,6 +116,20 @@ function _workspace() {
116
116
  };
117
117
  return data;
118
118
  }
119
+ function _cors() {
120
+ const data = _interopRequireDefault(require("cors"));
121
+ _cors = function () {
122
+ return data;
123
+ };
124
+ return data;
125
+ }
126
+ function _httpProxyMiddleware() {
127
+ const data = require("http-proxy-middleware");
128
+ _httpProxyMiddleware = function () {
129
+ return data;
130
+ };
131
+ return data;
132
+ }
119
133
  function _apiServer() {
120
134
  const data = require("./api-server.aspect");
121
135
  _apiServer = function () {
@@ -158,6 +172,7 @@ function _sseEvents() {
158
172
  };
159
173
  return data;
160
174
  }
175
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
161
176
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
162
177
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
163
178
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
@@ -205,7 +220,33 @@ class ApiServerMain {
205
220
  this.logger.error('watcher found an error', err);
206
221
  });
207
222
  const port = options.port || 3000;
208
- const server = await this.express.listen(port);
223
+ const app = this.express.createApp();
224
+ app.use(
225
+ // @ts-ignore todo: it's not clear what's the issue.
226
+ (0, _cors().default)({
227
+ origin(origin, callback) {
228
+ callback(null, true);
229
+ },
230
+ credentials: true
231
+ }));
232
+ app.use('/api/cloud-graphql',
233
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
234
+ (0, _httpProxyMiddleware().createProxyMiddleware)({
235
+ target: 'https://api.main.lanes.bit.cloud/graphql',
236
+ changeOrigin: true,
237
+ on: {
238
+ error: (err, req, res) => {
239
+ this.logger.error('graphql cloud proxy error', err);
240
+ // @ts-ignore
241
+ res.writeHead(500, {
242
+ 'Content-Type': 'text/plain'
243
+ });
244
+ res.end('Something went wrong with the proxy server of bit cloud graphql');
245
+ },
246
+ proxyReq: _httpProxyMiddleware().fixRequestBody
247
+ }
248
+ }));
249
+ const server = await app.listen(port);
209
250
  return new Promise((resolve, reject) => {
210
251
  server.on('error', err => {
211
252
  reject(err);
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_express","_logger","_lanes","_remove","_snapping","_generator","_componentCompare","_componentLog","_watcher","_config","_export","_checkout","_install","_importer","_workspace","_apiServer","_cli2","_server","_ide","_apiForIde","_sseEvents","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ApiServerMain","constructor","workspace","logger","express","watcher","installer","importer","runApiServer","options","Error","process","cwd","registerOnComponentChange","component","files","removedFiles","sendEventsToClients","id","toStringWithoutVersion","registerOnBitmapChange","lastModifiedTimestamp","bitMap","getLastModifiedBitmapThroughBit","secondsPassedSinceLastModified","Date","now","debug","importCurrentObjects","registerOnWorkspaceConfigChange","registerPostInstall","watch","preCompile","compile","catch","err","error","port","server","listen","Promise","resolve","reject","on","consoleSuccess","provider","cli","loggerMain","snapping","lanes","exporter","checkout","componentLog","componentCompare","generator","remove","config","createLogger","ApiServerAspect","apiServer","register","ServerCmd","apiForIDE","APIForIDE","cliRoute","CLIRoute","vscodeRoute","IDERoute","sseEventsRoute","SSEEventsRoute","exports","CLIAspect","WorkspaceAspect","LoggerAspect","ExpressAspect","WatcherAspect","SnappingAspect","LanesAspect","InstallAspect","ExportAspect","CheckoutAspect","ComponentLogAspect","ImporterAspect","ComponentCompareAspect","GeneratorAspect","RemoveAspect","ConfigAspect","MainRuntime","addRuntime","_default","default"],"sources":["api-server.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ExpressAspect, ExpressMain } from '@teambit/express';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { LanesAspect, LanesMain } from '@teambit/lanes';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { SnappingAspect, SnappingMain } from '@teambit/snapping';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { ComponentCompareAspect, ComponentCompareMain } from '@teambit/component-compare';\nimport { ComponentLogAspect, ComponentLogMain } from '@teambit/component-log';\nimport { WatcherAspect, WatcherMain } from '@teambit/watcher';\nimport { ConfigAspect, ConfigMain } from '@teambit/config';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { CheckoutAspect, CheckoutMain } from '@teambit/checkout';\nimport { InstallAspect, InstallMain } from '@teambit/install';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { Component } from '@teambit/component';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\nimport { ApiServerAspect } from './api-server.aspect';\nimport { CLIRoute } from './cli.route';\nimport { ServerCmd } from './server.cmd';\nimport { IDERoute } from './ide.route';\nimport { APIForIDE } from './api-for-ide';\nimport { SSEEventsRoute, sendEventsToClients } from './sse-events.route';\n\nexport class ApiServerMain {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private express: ExpressMain,\n private watcher: WatcherMain,\n private installer: InstallMain,\n private importer: ImporterMain\n ) {}\n\n async runApiServer(options: { port: number; compile: boolean }) {\n if (!this.workspace) {\n throw new Error(`unable to run bit-server, the current directory ${process.cwd()} is not a workspace`);\n }\n\n this.workspace.registerOnComponentChange(\n async (\n component: Component,\n files: string[], // os absolute paths\n removedFiles?: string[] // os absolute paths\n ) => {\n sendEventsToClients('onComponentChange', {\n id: component.id.toStringWithoutVersion(),\n files,\n removedFiles,\n });\n }\n );\n\n this.workspace.registerOnBitmapChange(async () => {\n const lastModifiedTimestamp = await this.workspace.bitMap.getLastModifiedBitmapThroughBit();\n const secondsPassedSinceLastModified = lastModifiedTimestamp && (Date.now() - lastModifiedTimestamp) / 1000;\n if (secondsPassedSinceLastModified && secondsPassedSinceLastModified > 1) {\n // changes by bit were done more than a second ago, so probably this .bitmap change was done by \"git pull\"\n this.logger.debug(\n `running import because we assume the .bitmap file has changed due to \"git pull\", last time it was modified by bit was ${secondsPassedSinceLastModified} seconds ago`\n );\n await this.importer.importCurrentObjects();\n }\n sendEventsToClients('onBitmapChange', {});\n });\n\n this.workspace.registerOnWorkspaceConfigChange(async () => {\n sendEventsToClients('onWorkspaceConfigChange', {});\n });\n\n this.installer.registerPostInstall(async () => {\n sendEventsToClients('onPostInstall', {});\n });\n\n this.watcher\n .watch({\n preCompile: false,\n compile: options.compile,\n })\n .catch((err) => {\n // don't throw an error, we don't want to break the \"run\" process\n this.logger.error('watcher found an error', err);\n });\n\n const port = options.port || 3000;\n const server = await this.express.listen(port);\n\n return new Promise((resolve, reject) => {\n server.on('error', (err) => {\n reject(err);\n });\n server.on('listening', () => {\n this.logger.consoleSuccess(`Bit Server is listening on port ${port}`);\n resolve(true);\n });\n });\n }\n\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n LoggerAspect,\n ExpressAspect,\n WatcherAspect,\n SnappingAspect,\n LanesAspect,\n InstallAspect,\n ExportAspect,\n CheckoutAspect,\n ComponentLogAspect,\n ImporterAspect,\n ComponentCompareAspect,\n GeneratorAspect,\n RemoveAspect,\n ConfigAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n workspace,\n loggerMain,\n express,\n watcher,\n snapping,\n lanes,\n installer,\n exporter,\n checkout,\n componentLog,\n importer,\n componentCompare,\n generator,\n remove,\n config,\n ]: [\n CLIMain,\n Workspace,\n LoggerMain,\n ExpressMain,\n WatcherMain,\n SnappingMain,\n LanesMain,\n InstallMain,\n ExportMain,\n CheckoutMain,\n ComponentLogMain,\n ImporterMain,\n ComponentCompareMain,\n GeneratorMain,\n RemoveMain,\n ConfigMain\n ]) {\n const logger = loggerMain.createLogger(ApiServerAspect.id);\n const apiServer = new ApiServerMain(workspace, logger, express, watcher, installer, importer);\n cli.register(new ServerCmd(apiServer));\n\n const apiForIDE = new APIForIDE(\n workspace,\n snapping,\n lanes,\n installer,\n exporter,\n checkout,\n componentLog,\n componentCompare,\n generator,\n remove,\n config\n );\n const cliRoute = new CLIRoute(logger, cli, apiForIDE);\n const vscodeRoute = new IDERoute(logger, apiForIDE);\n const sseEventsRoute = new SSEEventsRoute(logger, cli);\n // register only when the workspace is available. don't register this on a remote-scope, for security reasons.\n if (workspace) {\n express.register([cliRoute, vscodeRoute, sseEventsRoute]);\n }\n\n return apiServer;\n }\n}\n\nApiServerAspect.addRuntime(ApiServerMain);\n\nexport default ApiServerMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,O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Q,EAAC9D,MAAM,EAAE2C,GAAG,EAAEgB,SAAS,CAAC;IACrD,MAAMI,WAAW,GAAG,KAAIC,eAAQ,EAAChE,MAAM,EAAE2D,SAAS,CAAC;IACnD,MAAMM,cAAc,GAAG,KAAIC,2BAAc,EAAClE,MAAM,EAAE2C,GAAG,CAAC;IACtD;IACA,IAAI5C,SAAS,EAAE;MACbE,OAAO,CAACwD,QAAQ,CAAC,CAACI,QAAQ,EAAEE,WAAW,EAAEE,cAAc,CAAC,CAAC;IAC3D;IAEA,OAAOT,SAAS;EAClB;AACF;AAACW,OAAA,CAAAtE,aAAA,GAAAA,aAAA;AAAAnB,eAAA,CA3JYmB,aAAa,kBA0EF,CACpBuE,gBAAS,EACTC,4BAAe,EACfC,sBAAY,EACZC,wBAAa,EACbC,wBAAa,EACbC,0BAAc,EACdC,oBAAW,EACXC,wBAAa,EACbC,sBAAY,EACZC,0BAAc,EACdC,kCAAkB,EAClBC,0BAAc,EACdC,0CAAsB,EACtBC,4BAAe,EACfC,sBAAY,EACZC,sBAAY,CACb;AAAAzG,eAAA,CA3FUmB,aAAa,aA4FPuF,kBAAW;AAiE9B7B,4BAAe,CAAC8B,UAAU,CAACxF,aAAa,CAAC;AAAC,IAAAyF,QAAA,GAAAnB,OAAA,CAAAoB,OAAA,GAE3B1F,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_express","_logger","_lanes","_remove","_snapping","_generator","_componentCompare","_componentLog","_watcher","_config","_export","_checkout","_install","_importer","_workspace","_cors","_interopRequireDefault","_httpProxyMiddleware","_apiServer","_cli2","_server","_ide","_apiForIde","_sseEvents","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ApiServerMain","constructor","workspace","logger","express","watcher","installer","importer","runApiServer","options","Error","process","cwd","registerOnComponentChange","component","files","removedFiles","sendEventsToClients","id","toStringWithoutVersion","registerOnBitmapChange","lastModifiedTimestamp","bitMap","getLastModifiedBitmapThroughBit","secondsPassedSinceLastModified","Date","now","debug","importCurrentObjects","registerOnWorkspaceConfigChange","registerPostInstall","watch","preCompile","compile","catch","err","error","port","app","createApp","use","cors","origin","callback","credentials","createProxyMiddleware","target","changeOrigin","on","req","res","writeHead","end","proxyReq","fixRequestBody","server","listen","Promise","resolve","reject","consoleSuccess","provider","cli","loggerMain","snapping","lanes","exporter","checkout","componentLog","componentCompare","generator","remove","config","createLogger","ApiServerAspect","apiServer","register","ServerCmd","apiForIDE","APIForIDE","cliRoute","CLIRoute","vscodeRoute","IDERoute","sseEventsRoute","SSEEventsRoute","exports","CLIAspect","WorkspaceAspect","LoggerAspect","ExpressAspect","WatcherAspect","SnappingAspect","LanesAspect","InstallAspect","ExportAspect","CheckoutAspect","ComponentLogAspect","ImporterAspect","ComponentCompareAspect","GeneratorAspect","RemoveAspect","ConfigAspect","MainRuntime","addRuntime","_default"],"sources":["api-server.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ExpressAspect, ExpressMain } from '@teambit/express';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { LanesAspect, LanesMain } from '@teambit/lanes';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { SnappingAspect, SnappingMain } from '@teambit/snapping';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { ComponentCompareAspect, ComponentCompareMain } from '@teambit/component-compare';\nimport { ComponentLogAspect, ComponentLogMain } from '@teambit/component-log';\nimport { WatcherAspect, WatcherMain } from '@teambit/watcher';\nimport { ConfigAspect, ConfigMain } from '@teambit/config';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { CheckoutAspect, CheckoutMain } from '@teambit/checkout';\nimport { InstallAspect, InstallMain } from '@teambit/install';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { Component } from '@teambit/component';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\nimport cors from 'cors';\nimport { createProxyMiddleware, fixRequestBody } from 'http-proxy-middleware';\nimport { ApiServerAspect } from './api-server.aspect';\nimport { CLIRoute } from './cli.route';\nimport { ServerCmd } from './server.cmd';\nimport { IDERoute } from './ide.route';\nimport { APIForIDE } from './api-for-ide';\nimport { SSEEventsRoute, sendEventsToClients } from './sse-events.route';\n\nexport class ApiServerMain {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private express: ExpressMain,\n private watcher: WatcherMain,\n private installer: InstallMain,\n private importer: ImporterMain\n ) {}\n\n async runApiServer(options: { port: number; compile: boolean }) {\n if (!this.workspace) {\n throw new Error(`unable to run bit-server, the current directory ${process.cwd()} is not a workspace`);\n }\n\n this.workspace.registerOnComponentChange(\n async (\n component: Component,\n files: string[], // os absolute paths\n removedFiles?: string[] // os absolute paths\n ) => {\n sendEventsToClients('onComponentChange', {\n id: component.id.toStringWithoutVersion(),\n files,\n removedFiles,\n });\n }\n );\n\n this.workspace.registerOnBitmapChange(async () => {\n const lastModifiedTimestamp = await this.workspace.bitMap.getLastModifiedBitmapThroughBit();\n const secondsPassedSinceLastModified = lastModifiedTimestamp && (Date.now() - lastModifiedTimestamp) / 1000;\n if (secondsPassedSinceLastModified && secondsPassedSinceLastModified > 1) {\n // changes by bit were done more than a second ago, so probably this .bitmap change was done by \"git pull\"\n this.logger.debug(\n `running import because we assume the .bitmap file has changed due to \"git pull\", last time it was modified by bit was ${secondsPassedSinceLastModified} seconds ago`\n );\n await this.importer.importCurrentObjects();\n }\n sendEventsToClients('onBitmapChange', {});\n });\n\n this.workspace.registerOnWorkspaceConfigChange(async () => {\n sendEventsToClients('onWorkspaceConfigChange', {});\n });\n\n this.installer.registerPostInstall(async () => {\n sendEventsToClients('onPostInstall', {});\n });\n\n this.watcher\n .watch({\n preCompile: false,\n compile: options.compile,\n })\n .catch((err) => {\n // don't throw an error, we don't want to break the \"run\" process\n this.logger.error('watcher found an error', err);\n });\n\n const port = options.port || 3000;\n\n const app = this.express.createApp();\n\n app.use(\n // @ts-ignore todo: it's not clear what's the issue.\n cors({\n origin(origin, callback) {\n callback(null, true);\n },\n credentials: true,\n })\n );\n app.use(\n '/api/cloud-graphql',\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n createProxyMiddleware({\n target: 'https://api.main.lanes.bit.cloud/graphql',\n changeOrigin: true,\n on: {\n error: (err, req, res) => {\n this.logger.error('graphql cloud proxy error', err);\n // @ts-ignore\n res.writeHead(500, {\n 'Content-Type': 'text/plain',\n });\n res.end('Something went wrong with the proxy server of bit cloud graphql');\n },\n proxyReq: fixRequestBody,\n },\n })\n );\n\n const server = await app.listen(port);\n\n return new Promise((resolve, reject) => {\n server.on('error', (err) => {\n reject(err);\n });\n server.on('listening', () => {\n this.logger.consoleSuccess(`Bit Server is listening on port ${port}`);\n resolve(true);\n });\n });\n }\n\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n LoggerAspect,\n ExpressAspect,\n WatcherAspect,\n SnappingAspect,\n LanesAspect,\n InstallAspect,\n ExportAspect,\n CheckoutAspect,\n ComponentLogAspect,\n ImporterAspect,\n ComponentCompareAspect,\n GeneratorAspect,\n RemoveAspect,\n ConfigAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n workspace,\n loggerMain,\n express,\n watcher,\n snapping,\n lanes,\n installer,\n exporter,\n checkout,\n componentLog,\n importer,\n componentCompare,\n generator,\n remove,\n config,\n ]: [\n CLIMain,\n Workspace,\n LoggerMain,\n ExpressMain,\n WatcherMain,\n SnappingMain,\n LanesMain,\n InstallMain,\n ExportMain,\n CheckoutMain,\n ComponentLogMain,\n ImporterMain,\n ComponentCompareMain,\n GeneratorMain,\n RemoveMain,\n ConfigMain\n ]) {\n const logger = loggerMain.createLogger(ApiServerAspect.id);\n const apiServer = new ApiServerMain(workspace, logger, express, watcher, installer, importer);\n cli.register(new ServerCmd(apiServer));\n\n const apiForIDE = new APIForIDE(\n workspace,\n snapping,\n lanes,\n installer,\n exporter,\n checkout,\n componentLog,\n componentCompare,\n generator,\n remove,\n config\n );\n const cliRoute = new CLIRoute(logger, cli, apiForIDE);\n const vscodeRoute = new IDERoute(logger, apiForIDE);\n const sseEventsRoute = new SSEEventsRoute(logger, cli);\n // register only when the workspace is available. don't register this on a remote-scope, for security reasons.\n if (workspace) {\n express.register([cliRoute, vscodeRoute, sseEventsRoute]);\n }\n\n return apiServer;\n }\n}\n\nApiServerAspect.addRuntime(ApiServerMain);\n\nexport default ApiServerMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,SAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,WAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,UAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,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bC,sBAAY,EACZC,0BAAc,EACdC,kCAAkB,EAClBC,0BAAc,EACdC,0CAAsB,EACtBC,4BAAe,EACfC,sBAAY,EACZC,sBAAY,CACb;AAAAxH,eAAA,CA3HUkB,aAAa,aA4HPuG,kBAAW;AAiE9B7B,4BAAe,CAAC8B,UAAU,CAACxG,aAAa,CAAC;AAAC,IAAAyG,QAAA,GAAAnB,OAAA,CAAAzG,OAAA,GAE3BmB,aAAa","ignoreList":[]}
package/package.json CHANGED
@@ -1,43 +1,46 @@
1
1
  {
2
2
  "name": "@teambit/api-server",
3
- "version": "1.0.349",
3
+ "version": "1.0.351",
4
4
  "homepage": "https://bit.cloud/teambit/harmony/api-server",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.harmony",
8
8
  "name": "api-server",
9
- "version": "1.0.349"
9
+ "version": "1.0.351"
10
10
  },
11
11
  "dependencies": {
12
12
  "fs-extra": "10.0.0",
13
13
  "lodash": "4.17.21",
14
14
  "p-map": "4.0.0",
15
+ "cors": "2.8.5",
16
+ "http-proxy-middleware": "^3.0.0",
15
17
  "pretty-time": "1.1.0",
16
18
  "@teambit/lane-id": "0.0.311",
17
19
  "@teambit/harmony": "0.4.6",
18
- "@teambit/checkout": "1.0.349",
19
- "@teambit/component-compare": "1.0.349",
20
- "@teambit/component-log": "1.0.349",
21
- "@teambit/config": "0.0.1100",
22
- "@teambit/export": "1.0.349",
23
- "@teambit/generator": "1.0.350",
24
- "@teambit/install": "1.0.349",
25
- "@teambit/lanes": "1.0.349",
20
+ "@teambit/checkout": "1.0.351",
21
+ "@teambit/component-compare": "1.0.351",
22
+ "@teambit/component-log": "1.0.351",
23
+ "@teambit/config": "0.0.1102",
24
+ "@teambit/export": "1.0.351",
25
+ "@teambit/generator": "1.0.352",
26
+ "@teambit/install": "1.0.351",
27
+ "@teambit/lanes": "1.0.351",
26
28
  "@teambit/legacy.utils": "0.0.4",
27
- "@teambit/merging": "1.0.349",
28
- "@teambit/remove": "1.0.349",
29
- "@teambit/snapping": "1.0.349",
30
- "@teambit/workspace": "1.0.349",
31
- "@teambit/cli": "0.0.926",
32
- "@teambit/component": "1.0.349",
33
- "@teambit/express": "0.0.1025",
34
- "@teambit/importer": "1.0.349",
35
- "@teambit/logger": "0.0.1019",
36
- "@teambit/watcher": "1.0.349"
29
+ "@teambit/merging": "1.0.351",
30
+ "@teambit/remove": "1.0.351",
31
+ "@teambit/snapping": "1.0.351",
32
+ "@teambit/workspace": "1.0.351",
33
+ "@teambit/cli": "0.0.928",
34
+ "@teambit/component": "1.0.351",
35
+ "@teambit/express": "0.0.1027",
36
+ "@teambit/importer": "1.0.351",
37
+ "@teambit/logger": "0.0.1021",
38
+ "@teambit/watcher": "1.0.351"
37
39
  },
38
40
  "devDependencies": {
39
41
  "@types/fs-extra": "9.0.7",
40
42
  "@types/lodash": "4.14.165",
43
+ "@types/cors": "2.8.10",
41
44
  "@types/mocha": "9.1.0",
42
45
  "chai": "4.3.0",
43
46
  "@teambit/harmony.envs.core-aspect-env": "0.0.42"