@oneuptime/common 8.0.5185 → 8.0.5199
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.
- package/Models/DatabaseModels/Project.ts +24 -0
- package/Server/API/BillingAPI.ts +123 -0
- package/Server/API/SlackAPI.ts +10 -10
- package/Server/API/StatusPageAPI.ts +1 -1
- package/Server/Infrastructure/ClickhouseDatabase.ts +3 -1
- package/Server/Infrastructure/Postgres/SchemaMigrations/1758313975491-MigrationName.ts +17 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
- package/Server/Services/AnalyticsDatabaseService.ts +7 -9
- package/Server/Services/BillingService.ts +17 -0
- package/Server/Services/CallService.ts +5 -5
- package/Server/Services/DatabaseService.ts +5 -5
- package/Server/Services/MailService.ts +5 -5
- package/Server/Services/SmsService.ts +5 -5
- package/Server/Services/StatusPageCertificateService.ts +24 -12
- package/Server/Services/StatusPageDomainService.ts +9 -9
- package/Server/Services/WorkflowService.ts +5 -5
- package/Server/Types/Workflow/Components/API/Delete.ts +5 -5
- package/Server/Types/Workflow/Components/API/Get.ts +5 -5
- package/Server/Types/Workflow/Components/API/Patch.ts +5 -5
- package/Server/Types/Workflow/Components/API/Post.ts +5 -5
- package/Server/Types/Workflow/Components/API/Put.ts +5 -5
- package/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.ts +24 -21
- package/Server/Utils/CodeRepository/GitHub/GitHub.ts +22 -20
- package/Server/Utils/Errors.ts +1 -0
- package/Server/Utils/VM/VMAPI.ts +5 -5
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +4 -1
- package/Server/Utils/Workspace/Slack/Slack.ts +84 -83
- package/Tests/Utils/API.test.ts +27 -22
- package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +16 -17
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +18 -19
- package/UI/Components/LogsViewer/LogsViewer.tsx +9 -9
- package/UI/Components/ModelList/ModelList.tsx +5 -5
- package/UI/Components/Workflow/DocumentationViewer.tsx +5 -5
- package/UI/Utils/API/API.ts +1 -1
- package/UI/Utils/AnalyticsModelAPI/AnalyticsModelAPI.ts +47 -43
- package/UI/Utils/ModelAPI/ModelAPI.ts +34 -35
- package/UI/Utils/User.ts +6 -6
- package/Utils/API.ts +127 -153
- package/build/dist/Models/DatabaseModels/Project.js +26 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Server/API/BillingAPI.js +76 -0
- package/build/dist/Server/API/BillingAPI.js.map +1 -0
- package/build/dist/Server/API/SlackAPI.js +12 -4
- package/build/dist/Server/API/SlackAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +1 -1
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/ClickhouseDatabase.js +3 -1
- package/build/dist/Server/Infrastructure/ClickhouseDatabase.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1758313975491-MigrationName.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1758313975491-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +4 -2
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/BillingService.js +17 -0
- package/build/dist/Server/Services/BillingService.js.map +1 -1
- package/build/dist/Server/Services/CallService.js +5 -1
- package/build/dist/Server/Services/CallService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +8 -4
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/MailService.js +5 -1
- package/build/dist/Server/Services/MailService.js.map +1 -1
- package/build/dist/Server/Services/SmsService.js +5 -1
- package/build/dist/Server/Services/SmsService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageCertificateService.js +12 -3
- package/build/dist/Server/Services/StatusPageCertificateService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageDomainService.js +18 -12
- package/build/dist/Server/Services/StatusPageDomainService.js.map +1 -1
- package/build/dist/Server/Services/WorkflowService.js +5 -1
- package/build/dist/Server/Services/WorkflowService.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js +5 -1
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Get.js +5 -1
- package/build/dist/Server/Types/Workflow/Components/API/Get.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js +5 -1
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Post.js +5 -1
- package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Put.js +5 -1
- package/build/dist/Server/Types/Workflow/Components/API/Put.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.js +24 -21
- package/build/dist/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.js.map +1 -1
- package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js +29 -17
- package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js.map +1 -1
- package/build/dist/Server/Utils/Errors.js +1 -0
- package/build/dist/Server/Utils/Errors.js.map +1 -1
- package/build/dist/Server/Utils/VM/VMAPI.js +5 -1
- package/build/dist/Server/Utils/VM/VMAPI.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +4 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js +170 -106
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
- package/build/dist/Tests/Utils/API.test.js +26 -5
- package/build/dist/Tests/Utils/API.test.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +15 -16
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +15 -16
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js +9 -5
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
- package/build/dist/UI/Components/ModelList/ModelList.js +5 -1
- package/build/dist/UI/Components/ModelList/ModelList.js.map +1 -1
- package/build/dist/UI/Components/Workflow/DocumentationViewer.js +7 -3
- package/build/dist/UI/Components/Workflow/DocumentationViewer.js.map +1 -1
- package/build/dist/UI/Utils/API/API.js.map +1 -1
- package/build/dist/UI/Utils/AnalyticsModelAPI/AnalyticsModelAPI.js +60 -25
- package/build/dist/UI/Utils/AnalyticsModelAPI/AnalyticsModelAPI.js.map +1 -1
- package/build/dist/UI/Utils/ModelAPI/ModelAPI.js +52 -22
- package/build/dist/UI/Utils/ModelAPI/ModelAPI.js.map +1 -1
- package/build/dist/UI/Utils/User.js +3 -1
- package/build/dist/UI/Utils/User.js.map +1 -1
- package/build/dist/Utils/API.js +60 -27
- package/build/dist/Utils/API.js.map +1 -1
- package/package.json +1 -1
|
@@ -121,7 +121,7 @@ const LegendItem: React.FunctionComponent<LegendItemProps> = ({
|
|
|
121
121
|
// base
|
|
122
122
|
"group inline-flex flex-nowrap items-center gap-1.5 rounded-sm px-2 py-1 whitespace-nowrap transition",
|
|
123
123
|
hasOnValueChange
|
|
124
|
-
? "cursor-pointer hover:bg-gray-100
|
|
124
|
+
? "cursor-pointer hover:bg-gray-100"
|
|
125
125
|
: "cursor-default",
|
|
126
126
|
)}
|
|
127
127
|
onClick={(e: React.MouseEvent) => {
|
|
@@ -142,9 +142,8 @@ const LegendItem: React.FunctionComponent<LegendItemProps> = ({
|
|
|
142
142
|
// base
|
|
143
143
|
"truncate text-xs whitespace-nowrap",
|
|
144
144
|
// text color
|
|
145
|
-
"text-gray-700
|
|
146
|
-
hasOnValueChange &&
|
|
147
|
-
"group-hover:text-gray-900 dark:group-hover:text-gray-50",
|
|
145
|
+
"text-gray-700",
|
|
146
|
+
hasOnValueChange && "group-hover:text-gray-900",
|
|
148
147
|
activeLegend && activeLegend !== name ? "opacity-40" : "opacity-100",
|
|
149
148
|
)}
|
|
150
149
|
>
|
|
@@ -197,8 +196,8 @@ const ScrollButton: React.FunctionComponent<ScrollButtonProps> = ({
|
|
|
197
196
|
// base
|
|
198
197
|
"group inline-flex size-5 items-center truncate rounded-sm transition",
|
|
199
198
|
disabled
|
|
200
|
-
? "cursor-not-allowed text-gray-400
|
|
201
|
-
: "cursor-pointer text-gray-700 hover:bg-gray-100 hover:text-gray-900
|
|
199
|
+
? "cursor-not-allowed text-gray-400"
|
|
200
|
+
: "cursor-pointer text-gray-700 hover:bg-gray-100 hover:text-gray-900",
|
|
202
201
|
)}
|
|
203
202
|
disabled={disabled}
|
|
204
203
|
onClick={(e: React.MouseEvent) => {
|
|
@@ -381,7 +380,7 @@ const Legend: React.ForwardRefExoticComponent<
|
|
|
381
380
|
// base
|
|
382
381
|
"absolute top-0 right-0 bottom-0 flex h-full items-center justify-center pr-1",
|
|
383
382
|
// background color
|
|
384
|
-
"bg-white
|
|
383
|
+
"bg-white",
|
|
385
384
|
)}
|
|
386
385
|
>
|
|
387
386
|
<ScrollButton
|
|
@@ -512,9 +511,9 @@ const ChartTooltip: React.FunctionComponent<ChartTooltipProps> = ({
|
|
|
512
511
|
// base
|
|
513
512
|
"rounded-md border text-sm shadow-md",
|
|
514
513
|
// border color
|
|
515
|
-
"border-gray-200
|
|
514
|
+
"border-gray-200",
|
|
516
515
|
// background color
|
|
517
|
-
"bg-white
|
|
516
|
+
"bg-white",
|
|
518
517
|
)}
|
|
519
518
|
>
|
|
520
519
|
<div className={cx("border-b border-inherit px-4 py-2")}>
|
|
@@ -523,7 +522,7 @@ const ChartTooltip: React.FunctionComponent<ChartTooltipProps> = ({
|
|
|
523
522
|
// base
|
|
524
523
|
"font-medium",
|
|
525
524
|
// text color
|
|
526
|
-
"text-gray-900
|
|
525
|
+
"text-gray-900",
|
|
527
526
|
)}
|
|
528
527
|
>
|
|
529
528
|
{label}
|
|
@@ -550,7 +549,7 @@ const ChartTooltip: React.FunctionComponent<ChartTooltipProps> = ({
|
|
|
550
549
|
// base
|
|
551
550
|
"text-right whitespace-nowrap",
|
|
552
551
|
// text color
|
|
553
|
-
"text-gray-700
|
|
552
|
+
"text-gray-700",
|
|
554
553
|
)}
|
|
555
554
|
>
|
|
556
555
|
{category}
|
|
@@ -561,7 +560,7 @@ const ChartTooltip: React.FunctionComponent<ChartTooltipProps> = ({
|
|
|
561
560
|
// base
|
|
562
561
|
"text-right font-medium whitespace-nowrap tabular-nums",
|
|
563
562
|
// text color
|
|
564
|
-
"text-gray-900
|
|
563
|
+
"text-gray-900",
|
|
565
564
|
)}
|
|
566
565
|
>
|
|
567
566
|
{valueFormatter(value)}
|
|
@@ -771,7 +770,7 @@ const BarChart: React.ForwardRefExoticComponent<
|
|
|
771
770
|
>
|
|
772
771
|
{showGridLines ? (
|
|
773
772
|
<CartesianGrid
|
|
774
|
-
className={cx("stroke-gray-200 stroke-1
|
|
773
|
+
className={cx("stroke-gray-200 stroke-1")}
|
|
775
774
|
horizontal={layout !== "vertical"}
|
|
776
775
|
vertical={layout === "vertical"}
|
|
777
776
|
/>
|
|
@@ -788,7 +787,7 @@ const BarChart: React.ForwardRefExoticComponent<
|
|
|
788
787
|
// base
|
|
789
788
|
"text-xs",
|
|
790
789
|
// text fill
|
|
791
|
-
"fill-gray-500
|
|
790
|
+
"fill-gray-500",
|
|
792
791
|
{ "mt-4": layout !== "vertical" },
|
|
793
792
|
)}
|
|
794
793
|
tickLine={false}
|
|
@@ -823,7 +822,7 @@ const BarChart: React.ForwardRefExoticComponent<
|
|
|
823
822
|
<Label
|
|
824
823
|
position="insideBottom"
|
|
825
824
|
offset={-20}
|
|
826
|
-
className="fill-gray-800 text-sm font-medium
|
|
825
|
+
className="fill-gray-800 text-sm font-medium"
|
|
827
826
|
>
|
|
828
827
|
{xAxisLabel}
|
|
829
828
|
</Label>
|
|
@@ -840,7 +839,7 @@ const BarChart: React.ForwardRefExoticComponent<
|
|
|
840
839
|
// base
|
|
841
840
|
"text-xs",
|
|
842
841
|
// text fill
|
|
843
|
-
"fill-gray-500
|
|
842
|
+
"fill-gray-500",
|
|
844
843
|
)}
|
|
845
844
|
tick={{
|
|
846
845
|
transform:
|
|
@@ -876,7 +875,7 @@ const BarChart: React.ForwardRefExoticComponent<
|
|
|
876
875
|
style={{ textAnchor: "middle" }}
|
|
877
876
|
angle={-90}
|
|
878
877
|
offset={-15}
|
|
879
|
-
className="fill-gray-800 text-sm font-medium
|
|
878
|
+
className="fill-gray-800 text-sm font-medium"
|
|
880
879
|
>
|
|
881
880
|
{yAxisLabel}
|
|
882
881
|
</Label>
|
|
@@ -58,7 +58,7 @@ const LegendItem: ({
|
|
|
58
58
|
// base
|
|
59
59
|
"group inline-flex flex-nowrap items-center gap-1.5 whitespace-nowrap rounded px-2 py-1 transition",
|
|
60
60
|
hasOnValueChange
|
|
61
|
-
? "cursor-pointer hover:bg-gray-100
|
|
61
|
+
? "cursor-pointer hover:bg-gray-100"
|
|
62
62
|
: "cursor-default",
|
|
63
63
|
)}
|
|
64
64
|
onClick={(e: React.MouseEvent<HTMLLIElement, MouseEvent>) => {
|
|
@@ -79,9 +79,8 @@ const LegendItem: ({
|
|
|
79
79
|
// base
|
|
80
80
|
"truncate whitespace-nowrap text-xs",
|
|
81
81
|
// text color
|
|
82
|
-
"text-gray-700
|
|
83
|
-
hasOnValueChange &&
|
|
84
|
-
"group-hover:text-gray-900 dark:group-hover:text-gray-50",
|
|
82
|
+
"text-gray-700",
|
|
83
|
+
hasOnValueChange && "group-hover:text-gray-900",
|
|
85
84
|
activeLegend && activeLegend !== name ? "opacity-40" : "opacity-100",
|
|
86
85
|
)}
|
|
87
86
|
>
|
|
@@ -138,8 +137,8 @@ const ScrollButton: ({
|
|
|
138
137
|
// base
|
|
139
138
|
"group inline-flex size-5 items-center truncate rounded transition",
|
|
140
139
|
disabled
|
|
141
|
-
? "cursor-not-allowed text-gray-400
|
|
142
|
-
: "cursor-pointer text-gray-700 hover:bg-gray-100 hover:text-gray-900
|
|
140
|
+
? "cursor-not-allowed text-gray-400"
|
|
141
|
+
: "cursor-pointer text-gray-700 hover:bg-gray-100 hover:text-gray-900",
|
|
143
142
|
)}
|
|
144
143
|
disabled={disabled}
|
|
145
144
|
onClick={(e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
|
|
@@ -321,7 +320,7 @@ const Legend: React.ForwardRefExoticComponent<
|
|
|
321
320
|
// base
|
|
322
321
|
"absolute bottom-0 right-0 top-0 flex h-full items-center justify-center pr-1",
|
|
323
322
|
// background color
|
|
324
|
-
"bg-white
|
|
323
|
+
"bg-white",
|
|
325
324
|
)}
|
|
326
325
|
>
|
|
327
326
|
<ScrollButton
|
|
@@ -463,9 +462,9 @@ const ChartTooltip: ({
|
|
|
463
462
|
// base
|
|
464
463
|
"rounded-md border text-sm shadow-md",
|
|
465
464
|
// border color
|
|
466
|
-
"border-gray-200
|
|
465
|
+
"border-gray-200",
|
|
467
466
|
// background color
|
|
468
|
-
"bg-white
|
|
467
|
+
"bg-white",
|
|
469
468
|
)}
|
|
470
469
|
>
|
|
471
470
|
<div className={cx("border-b border-inherit px-4 py-2")}>
|
|
@@ -474,7 +473,7 @@ const ChartTooltip: ({
|
|
|
474
473
|
// base
|
|
475
474
|
"font-medium",
|
|
476
475
|
// text color
|
|
477
|
-
"text-gray-900
|
|
476
|
+
"text-gray-900",
|
|
478
477
|
)}
|
|
479
478
|
>
|
|
480
479
|
{label}
|
|
@@ -501,7 +500,7 @@ const ChartTooltip: ({
|
|
|
501
500
|
// base
|
|
502
501
|
"whitespace-nowrap text-right",
|
|
503
502
|
// text color
|
|
504
|
-
"text-gray-700
|
|
503
|
+
"text-gray-700",
|
|
505
504
|
)}
|
|
506
505
|
>
|
|
507
506
|
{category}
|
|
@@ -512,7 +511,7 @@ const ChartTooltip: ({
|
|
|
512
511
|
// base
|
|
513
512
|
"whitespace-nowrap text-right font-medium tabular-nums",
|
|
514
513
|
// text color
|
|
515
|
-
"text-gray-900
|
|
514
|
+
"text-gray-900",
|
|
516
515
|
)}
|
|
517
516
|
>
|
|
518
517
|
{valueFormatter(value)}
|
|
@@ -711,7 +710,7 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
711
710
|
>
|
|
712
711
|
{showGridLines ? (
|
|
713
712
|
<CartesianGrid
|
|
714
|
-
className={cx("stroke-gray-200 stroke-1
|
|
713
|
+
className={cx("stroke-gray-200 stroke-1")}
|
|
715
714
|
horizontal={true}
|
|
716
715
|
vertical={false}
|
|
717
716
|
/>
|
|
@@ -736,7 +735,7 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
736
735
|
// base
|
|
737
736
|
"text-xs",
|
|
738
737
|
// text fill
|
|
739
|
-
"fill-gray-500
|
|
738
|
+
"fill-gray-500",
|
|
740
739
|
)}
|
|
741
740
|
tickLine={false}
|
|
742
741
|
axisLine={false}
|
|
@@ -746,7 +745,7 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
746
745
|
<Label
|
|
747
746
|
position="insideBottom"
|
|
748
747
|
offset={-20}
|
|
749
|
-
className="fill-gray-800 text-sm font-medium
|
|
748
|
+
className="fill-gray-800 text-sm font-medium"
|
|
750
749
|
>
|
|
751
750
|
{xAxisLabel}
|
|
752
751
|
</Label>
|
|
@@ -766,7 +765,7 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
766
765
|
// base
|
|
767
766
|
"text-xs",
|
|
768
767
|
// text fill
|
|
769
|
-
"fill-gray-500
|
|
768
|
+
"fill-gray-500",
|
|
770
769
|
)}
|
|
771
770
|
tickFormatter={valueFormatter}
|
|
772
771
|
allowDecimals={allowDecimals}
|
|
@@ -777,7 +776,7 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
777
776
|
style={{ textAnchor: "middle" }}
|
|
778
777
|
angle={-90}
|
|
779
778
|
offset={-15}
|
|
780
|
-
className="fill-gray-800 text-sm font-medium
|
|
779
|
+
className="fill-gray-800 text-sm font-medium"
|
|
781
780
|
>
|
|
782
781
|
{yAxisLabel}
|
|
783
782
|
</Label>
|
|
@@ -884,7 +883,7 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
884
883
|
return (
|
|
885
884
|
<Dot
|
|
886
885
|
className={cx(
|
|
887
|
-
"stroke-white
|
|
886
|
+
"stroke-white",
|
|
888
887
|
onValueChange ? "cursor-pointer" : "",
|
|
889
888
|
getColorClassName(
|
|
890
889
|
categoryColors.get(
|
|
@@ -940,7 +939,7 @@ const LineChart: React.ForwardRefExoticComponent<
|
|
|
940
939
|
strokeLinejoin={strokeLinejoin}
|
|
941
940
|
strokeWidth={strokeWidth}
|
|
942
941
|
className={cx(
|
|
943
|
-
"stroke-white
|
|
942
|
+
"stroke-white",
|
|
944
943
|
onValueChange ? "cursor-pointer" : "",
|
|
945
944
|
getColorClassName(
|
|
946
945
|
categoryColors.get(
|
|
@@ -93,15 +93,15 @@ const LogsViewer: FunctionComponent<ComponentProps> = (
|
|
|
93
93
|
setServiceMap(services);
|
|
94
94
|
|
|
95
95
|
const attributeRepsonse: HTTPResponse<JSONObject> | HTTPErrorResponse =
|
|
96
|
-
await API.post(
|
|
97
|
-
URL.fromString(APP_API_URL.toString()).addRoute(
|
|
96
|
+
await API.post({
|
|
97
|
+
url: URL.fromString(APP_API_URL.toString()).addRoute(
|
|
98
98
|
"/telemetry/logs/get-attributes",
|
|
99
99
|
),
|
|
100
|
-
{},
|
|
101
|
-
{
|
|
100
|
+
data: {},
|
|
101
|
+
headers: {
|
|
102
102
|
...ModelAPI.getCommonHeaders(),
|
|
103
103
|
},
|
|
104
|
-
);
|
|
104
|
+
});
|
|
105
105
|
|
|
106
106
|
if (attributeRepsonse instanceof HTTPErrorResponse) {
|
|
107
107
|
throw attributeRepsonse;
|
|
@@ -230,7 +230,7 @@ const LogsViewer: FunctionComponent<ComponentProps> = (
|
|
|
230
230
|
</div>
|
|
231
231
|
|
|
232
232
|
{/* Enhanced Controls Section */}
|
|
233
|
-
<div className="-mx-6 -mb-6 px-6 py-3 border-t border-slate-200
|
|
233
|
+
<div className="-mx-6 -mb-6 px-6 py-3 border-t border-slate-200 bg-white/50">
|
|
234
234
|
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
|
235
235
|
<div className="flex items-center gap-4 flex-wrap">
|
|
236
236
|
<div className="flex items-center gap-2">
|
|
@@ -241,12 +241,12 @@ const LogsViewer: FunctionComponent<ComponentProps> = (
|
|
|
241
241
|
return setAutoScroll(checked);
|
|
242
242
|
}}
|
|
243
243
|
/>
|
|
244
|
-
<span className="text-xs text-slate-600
|
|
244
|
+
<span className="text-xs text-slate-600">
|
|
245
245
|
{autoScroll ? "Live" : "Paused"}
|
|
246
246
|
</span>
|
|
247
247
|
</div>
|
|
248
|
-
<span className="hidden sm:block h-4 w-px bg-slate-200
|
|
249
|
-
<span className="text-xs text-slate-500
|
|
248
|
+
<span className="hidden sm:block h-4 w-px bg-slate-200" />
|
|
249
|
+
<span className="text-xs text-slate-500">
|
|
250
250
|
{props.logs.length} result
|
|
251
251
|
{props.logs.length !== 1 ? "s" : ""}
|
|
252
252
|
</span>
|
|
@@ -111,11 +111,11 @@ const ModelList: <TBaseModel extends BaseModel>(
|
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
if (props.overrideFetchApiUrl) {
|
|
114
|
-
const result: HTTPResponse<JSONArray> = (await API.post(
|
|
115
|
-
props.overrideFetchApiUrl,
|
|
116
|
-
{},
|
|
117
|
-
{},
|
|
118
|
-
)) as HTTPResponse<JSONArray>;
|
|
114
|
+
const result: HTTPResponse<JSONArray> = (await API.post({
|
|
115
|
+
url: props.overrideFetchApiUrl,
|
|
116
|
+
data: {},
|
|
117
|
+
headers: {},
|
|
118
|
+
})) as HTTPResponse<JSONArray>;
|
|
119
119
|
|
|
120
120
|
listResult = {
|
|
121
121
|
data: BaseModel.fromJSONArray(
|
|
@@ -38,14 +38,14 @@ const DocumentationViewer: FunctionComponent<ComponentProps> = (
|
|
|
38
38
|
if (props.documentationLink) {
|
|
39
39
|
try {
|
|
40
40
|
setIsLoading(true);
|
|
41
|
-
const body: HTTPResponse<any> = await API.get(
|
|
42
|
-
new URL(HTTP_PROTOCOL, HOST, props.documentationLink),
|
|
43
|
-
{},
|
|
44
|
-
{
|
|
41
|
+
const body: HTTPResponse<any> = await API.get({
|
|
42
|
+
url: new URL(HTTP_PROTOCOL, HOST, props.documentationLink),
|
|
43
|
+
data: {},
|
|
44
|
+
headers: {
|
|
45
45
|
Accept: "text/plain",
|
|
46
46
|
"Content-Type": "text/plain",
|
|
47
47
|
},
|
|
48
|
-
);
|
|
48
|
+
});
|
|
49
49
|
setMarkdown(populateWithEnvVars((body.data as any).data.toString()));
|
|
50
50
|
setIsLoading(false);
|
|
51
51
|
} catch (err) {
|
package/UI/Utils/API/API.ts
CHANGED
|
@@ -95,7 +95,7 @@ class BaseAPI extends API {
|
|
|
95
95
|
return User.logout();
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
public static override handleError(
|
|
99
99
|
error: HTTPErrorResponse | APIException,
|
|
100
100
|
): HTTPErrorResponse | APIException {
|
|
101
101
|
// 405 Status - Tenant not found. If Project was deleted.
|
|
@@ -96,18 +96,23 @@ export default class ModelAPI {
|
|
|
96
96
|
|
|
97
97
|
apiUrl = apiUrl.addRoute(`/${id.toString()}`);
|
|
98
98
|
|
|
99
|
-
const result:
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
const result:
|
|
100
|
+
| HTTPErrorResponse
|
|
101
|
+
| HTTPResponse<
|
|
102
|
+
| JSONObject
|
|
103
|
+
| JSONArray
|
|
104
|
+
| TAnalyticsBaseModel
|
|
105
|
+
| Array<TAnalyticsBaseModel>
|
|
106
|
+
> = await API.fetch<
|
|
102
107
|
JSONObject | JSONArray | TAnalyticsBaseModel | Array<TAnalyticsBaseModel>
|
|
103
|
-
>(
|
|
104
|
-
HTTPMethod.PUT,
|
|
105
|
-
apiUrl,
|
|
106
|
-
{
|
|
108
|
+
>({
|
|
109
|
+
method: HTTPMethod.PUT,
|
|
110
|
+
url: apiUrl,
|
|
111
|
+
data: {
|
|
107
112
|
data: data,
|
|
108
113
|
},
|
|
109
|
-
this.getCommonHeaders(requestOptions),
|
|
110
|
-
);
|
|
114
|
+
headers: this.getCommonHeaders(requestOptions),
|
|
115
|
+
});
|
|
111
116
|
|
|
112
117
|
if (result.isSuccess()) {
|
|
113
118
|
return result;
|
|
@@ -150,20 +155,20 @@ export default class ModelAPI {
|
|
|
150
155
|
}
|
|
151
156
|
|
|
152
157
|
const apiResult: HTTPErrorResponse | HTTPResponse<TAnalyticsBaseModel> =
|
|
153
|
-
await API.fetch<TAnalyticsBaseModel>(
|
|
154
|
-
httpMethod,
|
|
155
|
-
apiUrl,
|
|
156
|
-
{
|
|
158
|
+
await API.fetch<TAnalyticsBaseModel>({
|
|
159
|
+
method: httpMethod,
|
|
160
|
+
url: apiUrl,
|
|
161
|
+
data: {
|
|
157
162
|
data: JSONFunctions.serialize(
|
|
158
163
|
AnalyticsBaseModel.toJSON(model, modelType),
|
|
159
164
|
),
|
|
160
165
|
miscDataProps: miscDataProps || {},
|
|
161
166
|
},
|
|
162
|
-
{
|
|
167
|
+
headers: {
|
|
163
168
|
...this.getCommonHeaders(requestOptions),
|
|
164
169
|
...(requestOptions?.requestHeaders || {}),
|
|
165
170
|
},
|
|
166
|
-
);
|
|
171
|
+
});
|
|
167
172
|
|
|
168
173
|
if (apiResult.isSuccess() && apiResult instanceof HTTPResponse) {
|
|
169
174
|
const result: HTTPResponse<TAnalyticsBaseModel> =
|
|
@@ -216,14 +221,14 @@ export default class ModelAPI {
|
|
|
216
221
|
const headers: Dictionary<string> = this.getCommonHeaders(requestOptions);
|
|
217
222
|
|
|
218
223
|
const result: HTTPResponse<JSONArray> | HTTPErrorResponse =
|
|
219
|
-
await API.fetch<JSONArray>(
|
|
220
|
-
HTTPMethod.POST,
|
|
221
|
-
apiUrl,
|
|
222
|
-
{
|
|
224
|
+
await API.fetch<JSONArray>({
|
|
225
|
+
method: HTTPMethod.POST,
|
|
226
|
+
url: apiUrl,
|
|
227
|
+
data: {
|
|
223
228
|
aggregateBy: JSONFunctions.serialize(aggregateBy as any),
|
|
224
229
|
},
|
|
225
230
|
headers,
|
|
226
|
-
);
|
|
231
|
+
});
|
|
227
232
|
|
|
228
233
|
if (result.isSuccess()) {
|
|
229
234
|
const aggregatedResult: AggregatedResult = result.data as any;
|
|
@@ -283,21 +288,21 @@ export default class ModelAPI {
|
|
|
283
288
|
const headers: Dictionary<string> = this.getCommonHeaders(requestOptions);
|
|
284
289
|
|
|
285
290
|
const result: HTTPResponse<JSONArray> | HTTPErrorResponse =
|
|
286
|
-
await API.fetch<JSONArray>(
|
|
287
|
-
HTTPMethod.POST,
|
|
288
|
-
apiUrl,
|
|
289
|
-
{
|
|
291
|
+
await API.fetch<JSONArray>({
|
|
292
|
+
method: HTTPMethod.POST,
|
|
293
|
+
url: apiUrl,
|
|
294
|
+
data: {
|
|
290
295
|
query: JSONFunctions.serialize(query as JSONObject),
|
|
291
296
|
select: JSONFunctions.serialize(select as JSONObject),
|
|
292
297
|
sort: JSONFunctions.serialize(sort as JSONObject),
|
|
293
298
|
groupBy: JSONFunctions.serialize(groupBy as JSONObject),
|
|
294
299
|
},
|
|
295
300
|
headers,
|
|
296
|
-
{
|
|
301
|
+
params: {
|
|
297
302
|
limit: limit.toString(),
|
|
298
303
|
skip: skip.toString(),
|
|
299
304
|
},
|
|
300
|
-
);
|
|
305
|
+
});
|
|
301
306
|
|
|
302
307
|
if (result.isSuccess()) {
|
|
303
308
|
const list: Array<TAnalyticsBaseModel> = AnalyticsBaseModel.fromJSONArray(
|
|
@@ -348,14 +353,14 @@ export default class ModelAPI {
|
|
|
348
353
|
const headers: Dictionary<string> = this.getCommonHeaders(requestOptions);
|
|
349
354
|
|
|
350
355
|
const result: HTTPResponse<JSONObject> | HTTPErrorResponse =
|
|
351
|
-
await API.fetch<JSONObject>(
|
|
352
|
-
HTTPMethod.POST,
|
|
353
|
-
apiUrl,
|
|
354
|
-
{
|
|
356
|
+
await API.fetch<JSONObject>({
|
|
357
|
+
method: HTTPMethod.POST,
|
|
358
|
+
url: apiUrl,
|
|
359
|
+
data: {
|
|
355
360
|
query: JSONFunctions.serialize(query as JSONObject),
|
|
356
361
|
},
|
|
357
362
|
headers,
|
|
358
|
-
);
|
|
363
|
+
});
|
|
359
364
|
|
|
360
365
|
if (result.isSuccess()) {
|
|
361
366
|
const count: number = result.data["count"] as number;
|
|
@@ -433,14 +438,14 @@ export default class ModelAPI {
|
|
|
433
438
|
requestOptions?: RequestOptions | undefined,
|
|
434
439
|
): Promise<TAnalyticsBaseModel | null> {
|
|
435
440
|
const result: HTTPResponse<TAnalyticsBaseModel> | HTTPErrorResponse =
|
|
436
|
-
await API.fetch<TAnalyticsBaseModel>(
|
|
437
|
-
HTTPMethod.POST,
|
|
438
|
-
apiUrl,
|
|
439
|
-
{
|
|
441
|
+
await API.fetch<TAnalyticsBaseModel>({
|
|
442
|
+
method: HTTPMethod.POST,
|
|
443
|
+
url: apiUrl,
|
|
444
|
+
data: {
|
|
440
445
|
select: JSONFunctions.serialize(select as JSONObject) || {},
|
|
441
446
|
},
|
|
442
|
-
this.getCommonHeaders(requestOptions),
|
|
443
|
-
);
|
|
447
|
+
headers: this.getCommonHeaders(requestOptions),
|
|
448
|
+
});
|
|
444
449
|
|
|
445
450
|
if (result.isSuccess()) {
|
|
446
451
|
return AnalyticsBaseModel.fromJSON(
|
|
@@ -481,12 +486,11 @@ export default class ModelAPI {
|
|
|
481
486
|
}
|
|
482
487
|
|
|
483
488
|
const result: HTTPResponse<TAnalyticsBaseModel> | HTTPErrorResponse =
|
|
484
|
-
await API.fetch<TAnalyticsBaseModel>(
|
|
485
|
-
HTTPMethod.DELETE,
|
|
486
|
-
apiUrl,
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
);
|
|
489
|
+
await API.fetch<TAnalyticsBaseModel>({
|
|
490
|
+
method: HTTPMethod.DELETE,
|
|
491
|
+
url: apiUrl,
|
|
492
|
+
headers: this.getCommonHeaders(requestOptions),
|
|
493
|
+
});
|
|
490
494
|
|
|
491
495
|
if (result.isSuccess()) {
|
|
492
496
|
return;
|
|
@@ -94,14 +94,14 @@ export default class ModelAPI {
|
|
|
94
94
|
JSONObject | JSONArray | TBaseModel | Array<TBaseModel>
|
|
95
95
|
> = await API.fetch<
|
|
96
96
|
JSONObject | JSONArray | TBaseModel | Array<TBaseModel>
|
|
97
|
-
>(
|
|
98
|
-
HTTPMethod.PUT,
|
|
99
|
-
apiUrl,
|
|
100
|
-
{
|
|
97
|
+
>({
|
|
98
|
+
method: HTTPMethod.PUT,
|
|
99
|
+
url: apiUrl,
|
|
100
|
+
data: {
|
|
101
101
|
data: data.data,
|
|
102
102
|
},
|
|
103
|
-
this.getCommonHeaders(data.requestOptions),
|
|
104
|
-
);
|
|
103
|
+
headers: this.getCommonHeaders(data.requestOptions),
|
|
104
|
+
});
|
|
105
105
|
|
|
106
106
|
if (result.isSuccess()) {
|
|
107
107
|
return result;
|
|
@@ -143,20 +143,20 @@ export default class ModelAPI {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
const apiResult: HTTPErrorResponse | HTTPResponse<TBaseModel> =
|
|
146
|
-
await API.fetch<TBaseModel>(
|
|
147
|
-
httpMethod,
|
|
148
|
-
apiUrl,
|
|
149
|
-
{
|
|
146
|
+
await API.fetch<TBaseModel>({
|
|
147
|
+
method: httpMethod,
|
|
148
|
+
url: apiUrl,
|
|
149
|
+
data: {
|
|
150
150
|
data: JSONFunctions.serialize(
|
|
151
151
|
BaseModel.toJSON(data.model, data.modelType),
|
|
152
152
|
),
|
|
153
153
|
miscDataProps: data.miscDataProps || {},
|
|
154
154
|
},
|
|
155
|
-
{
|
|
155
|
+
headers: {
|
|
156
156
|
...this.getCommonHeaders(data.requestOptions),
|
|
157
157
|
...(data.requestOptions?.requestHeaders || {}),
|
|
158
158
|
},
|
|
159
|
-
);
|
|
159
|
+
});
|
|
160
160
|
|
|
161
161
|
if (apiResult.isSuccess() && apiResult instanceof HTTPResponse) {
|
|
162
162
|
const result: ModelAPIHttpResponse<TBaseModel> =
|
|
@@ -217,21 +217,21 @@ export default class ModelAPI {
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
const result: HTTPResponse<JSONArray> | HTTPErrorResponse =
|
|
220
|
-
await API.fetch<JSONArray>(
|
|
221
|
-
HTTPMethod.POST,
|
|
222
|
-
apiUrl,
|
|
223
|
-
{
|
|
220
|
+
await API.fetch<JSONArray>({
|
|
221
|
+
method: HTTPMethod.POST,
|
|
222
|
+
url: apiUrl,
|
|
223
|
+
data: {
|
|
224
224
|
query: JSONFunctions.serialize(data.query as JSONObject),
|
|
225
225
|
select: JSONFunctions.serialize(data.select as JSONObject),
|
|
226
226
|
sort: JSONFunctions.serialize(data.sort as JSONObject),
|
|
227
227
|
groupBy: JSONFunctions.serialize(data.groupBy as JSONObject),
|
|
228
228
|
},
|
|
229
229
|
headers,
|
|
230
|
-
{
|
|
230
|
+
params: {
|
|
231
231
|
limit: data.limit.toString(),
|
|
232
232
|
skip: data.skip.toString(),
|
|
233
233
|
},
|
|
234
|
-
);
|
|
234
|
+
});
|
|
235
235
|
|
|
236
236
|
if (result.isSuccess()) {
|
|
237
237
|
const list: Array<TBaseModel> = BaseModel.fromJSONArray(
|
|
@@ -287,14 +287,14 @@ export default class ModelAPI {
|
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
const result: HTTPResponse<JSONObject> | HTTPErrorResponse =
|
|
290
|
-
await API.fetch<JSONObject>(
|
|
291
|
-
HTTPMethod.POST,
|
|
292
|
-
apiUrl,
|
|
293
|
-
{
|
|
290
|
+
await API.fetch<JSONObject>({
|
|
291
|
+
method: HTTPMethod.POST,
|
|
292
|
+
url: apiUrl,
|
|
293
|
+
data: {
|
|
294
294
|
query: JSONFunctions.serialize(data.query as JSONObject),
|
|
295
295
|
},
|
|
296
296
|
headers,
|
|
297
|
-
);
|
|
297
|
+
});
|
|
298
298
|
|
|
299
299
|
if (result.isSuccess()) {
|
|
300
300
|
const count: number = result.data["count"] as number;
|
|
@@ -376,14 +376,14 @@ export default class ModelAPI {
|
|
|
376
376
|
requestOptions?: RequestOptions | undefined;
|
|
377
377
|
}): Promise<TBaseModel | null> {
|
|
378
378
|
const result: HTTPResponse<TBaseModel> | HTTPErrorResponse =
|
|
379
|
-
await API.fetch<TBaseModel>(
|
|
380
|
-
HTTPMethod.POST,
|
|
381
|
-
data.apiUrl,
|
|
382
|
-
{
|
|
379
|
+
await API.fetch<TBaseModel>({
|
|
380
|
+
method: HTTPMethod.POST,
|
|
381
|
+
url: data.apiUrl,
|
|
382
|
+
data: {
|
|
383
383
|
select: JSONFunctions.serialize(data.select as JSONObject) || {},
|
|
384
384
|
},
|
|
385
|
-
this.getCommonHeaders(data.requestOptions),
|
|
386
|
-
);
|
|
385
|
+
headers: this.getCommonHeaders(data.requestOptions),
|
|
386
|
+
});
|
|
387
387
|
|
|
388
388
|
if (result.isSuccess()) {
|
|
389
389
|
const baseModel: TBaseModel = BaseModel.fromJSONObject(
|
|
@@ -422,12 +422,11 @@ export default class ModelAPI {
|
|
|
422
422
|
}
|
|
423
423
|
|
|
424
424
|
const result: HTTPResponse<TBaseModel> | HTTPErrorResponse =
|
|
425
|
-
await API.fetch<TBaseModel>(
|
|
426
|
-
HTTPMethod.DELETE,
|
|
427
|
-
apiUrl,
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
);
|
|
425
|
+
await API.fetch<TBaseModel>({
|
|
426
|
+
method: HTTPMethod.DELETE,
|
|
427
|
+
url: apiUrl,
|
|
428
|
+
headers: this.getCommonHeaders(data.requestOptions),
|
|
429
|
+
});
|
|
431
430
|
|
|
432
431
|
if (result.isSuccess()) {
|
|
433
432
|
return;
|
package/UI/Utils/User.ts
CHANGED
|
@@ -176,12 +176,12 @@ export default class UserUtil {
|
|
|
176
176
|
SessionStorage.clear();
|
|
177
177
|
Cookie.clearAllCookies();
|
|
178
178
|
|
|
179
|
-
API.post(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
);
|
|
179
|
+
API.post({
|
|
180
|
+
url: URL.fromString(IDENTITY_URL.toString()).addRoute("/logout"),
|
|
181
|
+
}).catch((err: Error) => {
|
|
182
|
+
Logger.error("Error during logout:");
|
|
183
|
+
Logger.error(err.message);
|
|
184
|
+
});
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
public static getUtmParams(): Dictionary<string> {
|