tt-help-cli-ycl 1.3.41 → 1.3.43

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.
@@ -499,6 +499,89 @@ export function startWatchServer(dataAnchor, port = 3000, existingStore) {
499
499
  return;
500
500
  }
501
501
 
502
+ if (req.method === "GET" && routePath === "/api/pending-by-country") {
503
+ const countries = store.getPendingByCountry();
504
+ sendJSON(res, 200, { countries });
505
+ return;
506
+ }
507
+
508
+ if (req.method === "GET" && routePath === "/api/user-update-by-country") {
509
+ const countries = store.getUserUpdateByCountry();
510
+ sendJSON(res, 200, { countries });
511
+ return;
512
+ }
513
+
514
+ if (
515
+ req.method === "GET" &&
516
+ routePath === "/api/attach-stuck-by-country"
517
+ ) {
518
+ const countries = store.getAttachStuckByCountry();
519
+ sendJSON(res, 200, { countries });
520
+ return;
521
+ }
522
+
523
+ if (req.method === "GET" && routePath === "/api/raw-by-country") {
524
+ const countries = store.getRawByCountry();
525
+ sendJSON(res, 200, { countries });
526
+ return;
527
+ }
528
+
529
+ if (req.method === "GET" && routePath === "/api/raw-jobs") {
530
+ const result = store.getRawJobsPage({
531
+ search: params.search,
532
+ location: params.location,
533
+ limit: params.limit,
534
+ offset: params.offset,
535
+ });
536
+ sendJSON(res, 200, result);
537
+ return;
538
+ }
539
+
540
+ if (req.method === "POST" && routePath === "/api/jobs/move-to-raw") {
541
+ try {
542
+ const body = await readBody(req);
543
+ const result = store.moveJobsToRawByCountry(body.scope, body.country);
544
+ if (result.error) {
545
+ sendJSON(res, 400, result);
546
+ return;
547
+ }
548
+ sendJSON(res, 200, result);
549
+ } catch (e) {
550
+ sendJSON(res, 400, { error: e.message });
551
+ }
552
+ return;
553
+ }
554
+
555
+ if (req.method === "POST" && routePath === "/api/raw-jobs/restore") {
556
+ try {
557
+ const body = await readBody(req);
558
+ const result = store.restoreRawJobsByCountry(body.country);
559
+ if (result.error) {
560
+ sendJSON(res, 400, result);
561
+ return;
562
+ }
563
+ sendJSON(res, 200, result);
564
+ } catch (e) {
565
+ sendJSON(res, 400, { error: e.message });
566
+ }
567
+ return;
568
+ }
569
+
570
+ if (req.method === "POST" && routePath === "/api/attach-stuck/restore") {
571
+ try {
572
+ const body = await readBody(req);
573
+ const result = store.restoreAttachStuckByCountry(body.country);
574
+ if (result.error) {
575
+ sendJSON(res, 400, result);
576
+ return;
577
+ }
578
+ sendJSON(res, 200, result);
579
+ } catch (e) {
580
+ sendJSON(res, 400, { error: e.message });
581
+ }
582
+ return;
583
+ }
584
+
502
585
  if (
503
586
  req.method === "DELETE" &&
504
587
  routePath.startsWith("/api/client-error/")