@abyss-project/reflex 5.8.0 → 5.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +32 -32
- package/.prettierrc +5 -5
- package/README.md +15 -15
- package/dist/api/alert-rule.api.d.ts +5 -0
- package/dist/api/alert-rule.api.js +16 -0
- package/dist/api/alert-rule.api.js.map +1 -0
- package/dist/api/application-insights.api.d.ts +3 -0
- package/dist/api/application-insights.api.js +12 -0
- package/dist/api/application-insights.api.js.map +1 -0
- package/dist/api/application-run-settings.api.d.ts +3 -0
- package/dist/api/application-run-settings.api.js +11 -0
- package/dist/api/application-run-settings.api.js.map +1 -0
- package/dist/api/function-settings.api.d.ts +2 -1
- package/dist/api/function-settings.api.js +3 -1
- package/dist/api/function-settings.api.js.map +1 -1
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.js +4 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/route-stats.api.d.ts +3 -0
- package/dist/api/route-stats.api.js +9 -0
- package/dist/api/route-stats.api.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/dist/insights/index.d.ts +1 -0
- package/dist/insights/index.js +18 -0
- package/dist/insights/index.js.map +1 -0
- package/dist/insights/percentiles.d.ts +2 -0
- package/dist/insights/percentiles.js +28 -0
- package/dist/insights/percentiles.js.map +1 -0
- package/dist/types/enum/index.d.ts +4 -0
- package/dist/types/enum/index.js +4 -0
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/enum/log-cap-mode.enum.d.ts +5 -0
- package/dist/types/enum/log-cap-mode.enum.js +10 -0
- package/dist/types/enum/log-cap-mode.enum.js.map +1 -0
- package/dist/types/enum/reflex-alert-metric.enum.d.ts +4 -0
- package/dist/types/enum/reflex-alert-metric.enum.js +9 -0
- package/dist/types/enum/reflex-alert-metric.enum.js.map +1 -0
- package/dist/types/enum/reflex-alert-notification-state.enum.d.ts +5 -0
- package/dist/types/enum/reflex-alert-notification-state.enum.js +10 -0
- package/dist/types/enum/reflex-alert-notification-state.enum.js.map +1 -0
- package/dist/types/enum/reflex-alert-scope.enum.d.ts +5 -0
- package/dist/types/enum/reflex-alert-scope.enum.js +10 -0
- package/dist/types/enum/reflex-alert-scope.enum.js.map +1 -0
- package/dist/types/interface/api/requests/alert-rule.request.d.ts +38 -0
- package/dist/types/interface/api/requests/alert-rule.request.js +3 -0
- package/dist/types/interface/api/requests/alert-rule.request.js.map +1 -0
- package/dist/types/interface/api/requests/application-insights.request.d.ts +14 -0
- package/dist/types/interface/api/requests/application-insights.request.js +3 -0
- package/dist/types/interface/api/requests/application-insights.request.js.map +1 -0
- package/dist/types/interface/api/requests/application-run-settings.request.d.ts +9 -0
- package/dist/types/interface/api/requests/application-run-settings.request.js +3 -0
- package/dist/types/interface/api/requests/application-run-settings.request.js.map +1 -0
- package/dist/types/interface/api/requests/function-settings.request.d.ts +6 -1
- package/dist/types/interface/api/requests/index.d.ts +4 -0
- package/dist/types/interface/api/requests/index.js +4 -0
- package/dist/types/interface/api/requests/index.js.map +1 -1
- package/dist/types/interface/api/requests/route-stats.request.d.ts +18 -0
- package/dist/types/interface/api/requests/route-stats.request.js +3 -0
- package/dist/types/interface/api/requests/route-stats.request.js.map +1 -0
- package/dist/types/interface/api/responses/alert-rule.response.d.ts +17 -0
- package/dist/types/interface/api/responses/alert-rule.response.js +3 -0
- package/dist/types/interface/api/responses/alert-rule.response.js.map +1 -0
- package/dist/types/interface/api/responses/application-insights.response.d.ts +8 -0
- package/dist/types/interface/api/responses/application-insights.response.js +3 -0
- package/dist/types/interface/api/responses/application-insights.response.js.map +1 -0
- package/dist/types/interface/api/responses/application-run-settings.response.d.ts +6 -0
- package/dist/types/interface/api/responses/application-run-settings.response.js +3 -0
- package/dist/types/interface/api/responses/application-run-settings.response.js.map +1 -0
- package/dist/types/interface/api/responses/function-settings.response.d.ts +3 -1
- package/dist/types/interface/api/responses/index.d.ts +4 -0
- package/dist/types/interface/api/responses/index.js +4 -0
- package/dist/types/interface/api/responses/index.js.map +1 -1
- package/dist/types/interface/api/responses/route-stats.response.d.ts +12 -0
- package/dist/types/interface/api/responses/route-stats.response.js +3 -0
- package/dist/types/interface/api/responses/route-stats.response.js.map +1 -0
- package/dist/types/interface/models/index.d.ts +2 -0
- package/dist/types/interface/models/index.js +2 -0
- package/dist/types/interface/models/index.js.map +1 -1
- package/dist/types/interface/models/reflex-alert-rule.model.d.ts +55 -0
- package/dist/types/interface/models/reflex-alert-rule.model.js +15 -0
- package/dist/types/interface/models/reflex-alert-rule.model.js.map +1 -0
- package/dist/types/interface/models/reflex-discord.model.d.ts +2 -0
- package/dist/types/interface/models/reflex-discord.model.js +4 -1
- package/dist/types/interface/models/reflex-discord.model.js.map +1 -1
- package/dist/types/interface/models/reflex-insights.model.d.ts +63 -0
- package/dist/types/interface/models/reflex-insights.model.js +4 -1
- package/dist/types/interface/models/reflex-insights.model.js.map +1 -1
- package/dist/types/interface/models/reflex-run-settings.model.d.ts +19 -0
- package/dist/types/interface/models/reflex-run-settings.model.js +9 -0
- package/dist/types/interface/models/reflex-run-settings.model.js.map +1 -0
- package/dist/types/interface/models/reflex-run.model.d.ts +40 -3
- package/dist/types/interface/models/reflex-run.model.js +9 -0
- package/dist/types/interface/models/reflex-run.model.js.map +1 -1
- package/jest.config.ts +11 -11
- package/package.json +15 -10
- package/src/api/alert-rule.api.test.ts +72 -0
- package/src/api/alert-rule.api.ts +57 -0
- package/src/api/application-insights.api.test.ts +42 -0
- package/src/api/application-insights.api.ts +38 -0
- package/src/api/application-run-settings.api.test.ts +51 -0
- package/src/api/application-run-settings.api.ts +30 -0
- package/src/api/function-access.api.ts +36 -36
- package/src/api/function-insights.api.test.ts +27 -27
- package/src/api/function-insights.api.ts +18 -18
- package/src/api/function-run.api.ts +38 -38
- package/src/api/function-settings.api.ts +74 -59
- package/src/api/function-test.api.ts +34 -34
- package/src/api/function-version.api.ts +48 -48
- package/src/api/function.api.test.ts +249 -249
- package/src/api/function.api.ts +62 -62
- package/src/api/health.api.ts +10 -10
- package/src/api/index.ts +21 -17
- package/src/api/route-stats.api.test.ts +45 -0
- package/src/api/route-stats.api.ts +36 -0
- package/src/api/service-configuration.api.ts +16 -16
- package/src/api/service-deployment.api.ts +79 -79
- package/src/api/service-discord-event.api.test.ts +106 -106
- package/src/api/service-discord-event.api.ts +78 -78
- package/src/api/service-discord.api.test.ts +197 -197
- package/src/api/service-discord.api.ts +241 -241
- package/src/api/service-insights.api.test.ts +36 -36
- package/src/api/service-insights.api.ts +42 -42
- package/src/api/service-route.api.ts +72 -72
- package/src/api/service-task.api.test.ts +140 -140
- package/src/api/service-task.api.ts +141 -141
- package/src/api/service-version.api.ts +54 -54
- package/src/api/service.api.test.ts +215 -215
- package/src/api/service.api.ts +55 -55
- package/src/discord/discord-event-filter-cases.ts +261 -261
- package/src/discord/discord-event-filters.test.ts +91 -91
- package/src/discord/discord-event-filters.ts +95 -95
- package/src/discord/discord-event-intents.test.ts +112 -112
- package/src/discord/discord-event-intents.ts +55 -55
- package/src/discord/index.ts +3 -3
- package/src/index.test.ts +87 -75
- package/src/index.ts +371 -317
- package/src/insights/index.ts +1 -0
- package/src/insights/percentiles.test.ts +75 -0
- package/src/insights/percentiles.ts +37 -0
- package/src/types/enum/access-grant-status.enum.ts +12 -12
- package/src/types/enum/access-kind.enum.ts +7 -7
- package/src/types/enum/bot-event-block-reason.enum.ts +7 -7
- package/src/types/enum/configuration-read-as.enum.ts +5 -5
- package/src/types/enum/discord-activity-type.enum.ts +9 -9
- package/src/types/enum/discord-component-kind.enum.ts +7 -7
- package/src/types/enum/discord-event-drop-reason.enum.ts +13 -13
- package/src/types/enum/discord-event-filter-name.enum.ts +11 -11
- package/src/types/enum/discord-event-status.enum.ts +13 -13
- package/src/types/enum/discord-event-type.enum.ts +7 -7
- package/src/types/enum/discord-gateway-failure-code.enum.ts +11 -11
- package/src/types/enum/discord-gateway-state.enum.ts +11 -11
- package/src/types/enum/discord-option-type.enum.ts +12 -12
- package/src/types/enum/discord-presence-status.enum.ts +8 -8
- package/src/types/enum/discord-sync-status.enum.ts +6 -6
- package/src/types/enum/discord-token-state.enum.ts +11 -11
- package/src/types/enum/execution-mode.enum.ts +9 -9
- package/src/types/enum/execution-profile.enum.ts +20 -20
- package/src/types/enum/execution-settings-source.enum.ts +9 -9
- package/src/types/enum/health-status.enum.ts +4 -4
- package/src/types/enum/index.ts +44 -40
- package/src/types/enum/insights-period.enum.ts +8 -8
- package/src/types/enum/log-cap-mode.enum.ts +6 -0
- package/src/types/enum/reflex-alert-metric.enum.ts +5 -0
- package/src/types/enum/reflex-alert-notification-state.enum.ts +6 -0
- package/src/types/enum/reflex-alert-scope.enum.ts +6 -0
- package/src/types/enum/reflex-error-code.enum.ts +43 -43
- package/src/types/enum/route-method.enum.ts +9 -9
- package/src/types/enum/run-log-level.enum.ts +6 -6
- package/src/types/enum/run-mode.enum.ts +11 -11
- package/src/types/enum/run-status.enum.ts +11 -11
- package/src/types/enum/run-step-status.enum.ts +7 -7
- package/src/types/enum/schedule-sync-status.enum.ts +6 -6
- package/src/types/enum/scheduled-run-failure-code.enum.ts +12 -12
- package/src/types/enum/scheduled-run-origin.enum.ts +5 -5
- package/src/types/enum/scheduled-run-status.enum.ts +17 -17
- package/src/types/enum/service-deployment-action.enum.ts +11 -11
- package/src/types/enum/service-deployment-status.enum.ts +5 -5
- package/src/types/enum/service-type.enum.ts +9 -9
- package/src/types/enum/service-version-change-kind.enum.ts +6 -6
- package/src/types/enum/trace-effect-type.enum.ts +12 -12
- package/src/types/enum/trigger-access-mode.enum.ts +12 -12
- package/src/types/enum/trigger-kind.enum.ts +8 -8
- package/src/types/enum/vault-value-source.enum.ts +12 -12
- package/src/types/enum/vault-visibility.enum.ts +5 -5
- package/src/types/index.ts +2 -2
- package/src/types/interface/api/index.ts +3 -3
- package/src/types/interface/api/requests/alert-rule.request.ts +53 -0
- package/src/types/interface/api/requests/application-insights.request.ts +18 -0
- package/src/types/interface/api/requests/application-run-settings.request.ts +11 -0
- package/src/types/interface/api/requests/function-access.request.ts +25 -25
- package/src/types/interface/api/requests/function-run.request.ts +30 -30
- package/src/types/interface/api/requests/function-settings.request.ts +34 -27
- package/src/types/interface/api/requests/function-test.request.ts +39 -39
- package/src/types/interface/api/requests/function-version.request.ts +20 -20
- package/src/types/interface/api/requests/function.request.ts +36 -36
- package/src/types/interface/api/requests/index.ts +19 -15
- package/src/types/interface/api/requests/route-stats.request.ts +22 -0
- package/src/types/interface/api/requests/service-configuration.request.ts +4 -4
- package/src/types/interface/api/requests/service-deployment.request.ts +49 -49
- package/src/types/interface/api/requests/service-discord-event.request.ts +68 -68
- package/src/types/interface/api/requests/service-discord.request.ts +173 -173
- package/src/types/interface/api/requests/service-insights.request.ts +31 -31
- package/src/types/interface/api/requests/service-route.request.ts +44 -44
- package/src/types/interface/api/requests/service-task.request.ts +80 -80
- package/src/types/interface/api/requests/service-version.request.ts +24 -24
- package/src/types/interface/api/requests/service.request.ts +46 -46
- package/src/types/interface/api/response.ts +4 -4
- package/src/types/interface/api/responses/alert-rule.response.ts +24 -0
- package/src/types/interface/api/responses/application-insights.response.ts +11 -0
- package/src/types/interface/api/responses/application-run-settings.response.ts +8 -0
- package/src/types/interface/api/responses/function-access.response.ts +17 -17
- package/src/types/interface/api/responses/function-run.response.ts +18 -18
- package/src/types/interface/api/responses/function-settings.response.ts +40 -36
- package/src/types/interface/api/responses/function-test.response.ts +12 -12
- package/src/types/interface/api/responses/function-version.response.ts +31 -31
- package/src/types/interface/api/responses/function.response.ts +25 -25
- package/src/types/interface/api/responses/index.ts +19 -15
- package/src/types/interface/api/responses/route-stats.response.ts +15 -0
- package/src/types/interface/api/responses/service-configuration.response.ts +8 -8
- package/src/types/interface/api/responses/service-deployment.response.ts +32 -32
- package/src/types/interface/api/responses/service-discord-event.response.ts +24 -24
- package/src/types/interface/api/responses/service-discord.response.ts +122 -122
- package/src/types/interface/api/responses/service-insights.response.ts +11 -11
- package/src/types/interface/api/responses/service-route.response.ts +31 -31
- package/src/types/interface/api/responses/service-task.response.ts +57 -57
- package/src/types/interface/api/responses/service-version.response.ts +106 -106
- package/src/types/interface/api/responses/service.response.ts +31 -31
- package/src/types/interface/health.response.ts +7 -7
- package/src/types/interface/index.ts +3 -3
- package/src/types/interface/models/index.ts +21 -19
- package/src/types/interface/models/reflex-access-grant.model.ts +14 -14
- package/src/types/interface/models/reflex-alert-rule.model.ts +56 -0
- package/src/types/interface/models/reflex-bot-limits.model.ts +92 -92
- package/src/types/interface/models/reflex-definition.model.ts +31 -31
- package/src/types/interface/models/reflex-discord-event-log.model.ts +58 -58
- package/src/types/interface/models/reflex-discord-event.model.ts +79 -79
- package/src/types/interface/models/reflex-discord.model.ts +196 -187
- package/src/types/interface/models/reflex-execution-settings.model.ts +50 -50
- package/src/types/interface/models/reflex-function-version.model.ts +14 -14
- package/src/types/interface/models/reflex-function.model.ts +16 -16
- package/src/types/interface/models/reflex-insights.model.ts +215 -120
- package/src/types/interface/models/reflex-price-list.model.ts +20 -20
- package/src/types/interface/models/reflex-route.model.ts +19 -19
- package/src/types/interface/models/reflex-run-settings.model.ts +28 -0
- package/src/types/interface/models/reflex-run.model.ts +250 -186
- package/src/types/interface/models/reflex-service-configuration.model.ts +22 -22
- package/src/types/interface/models/reflex-service-deployment.model.ts +46 -46
- package/src/types/interface/models/reflex-service-version.model.ts +61 -61
- package/src/types/interface/models/reflex-service.model.ts +45 -45
- package/src/types/interface/models/reflex-step-stats.model.ts +35 -35
- package/src/types/interface/models/reflex-task.model.ts +97 -97
- package/tsconfig.check.json +15 -15
- package/tsconfig.json +35 -35
package/src/index.ts
CHANGED
|
@@ -1,317 +1,371 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
import * as healthApi from './api/health.api';
|
|
3
|
-
import * as functionApi from './api/function.api';
|
|
4
|
-
import * as functionAccessApi from './api/function-access.api';
|
|
5
|
-
import * as functionTestApi from './api/function-test.api';
|
|
6
|
-
import * as functionVersionApi from './api/function-version.api';
|
|
7
|
-
import * as functionRunApi from './api/function-run.api';
|
|
8
|
-
import * as functionSettingsApi from './api/function-settings.api';
|
|
9
|
-
import * as serviceApi from './api/service.api';
|
|
10
|
-
import * as serviceRouteApi from './api/service-route.api';
|
|
11
|
-
import * as serviceVersionApi from './api/service-version.api';
|
|
12
|
-
import * as serviceDeploymentApi from './api/service-deployment.api';
|
|
13
|
-
import * as serviceConfigurationApi from './api/service-configuration.api';
|
|
14
|
-
import * as serviceDiscordApi from './api/service-discord.api';
|
|
15
|
-
import * as serviceDiscordEventApi from './api/service-discord-event.api';
|
|
16
|
-
import * as serviceInsightsApi from './api/service-insights.api';
|
|
17
|
-
import * as functionInsightsApi from './api/function-insights.api';
|
|
18
|
-
import * as serviceTaskApi from './api/service-task.api';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
list: typeof
|
|
57
|
-
get: typeof
|
|
58
|
-
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
get: typeof
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
/** The
|
|
152
|
-
|
|
153
|
-
list: typeof
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import * as healthApi from './api/health.api';
|
|
3
|
+
import * as functionApi from './api/function.api';
|
|
4
|
+
import * as functionAccessApi from './api/function-access.api';
|
|
5
|
+
import * as functionTestApi from './api/function-test.api';
|
|
6
|
+
import * as functionVersionApi from './api/function-version.api';
|
|
7
|
+
import * as functionRunApi from './api/function-run.api';
|
|
8
|
+
import * as functionSettingsApi from './api/function-settings.api';
|
|
9
|
+
import * as serviceApi from './api/service.api';
|
|
10
|
+
import * as serviceRouteApi from './api/service-route.api';
|
|
11
|
+
import * as serviceVersionApi from './api/service-version.api';
|
|
12
|
+
import * as serviceDeploymentApi from './api/service-deployment.api';
|
|
13
|
+
import * as serviceConfigurationApi from './api/service-configuration.api';
|
|
14
|
+
import * as serviceDiscordApi from './api/service-discord.api';
|
|
15
|
+
import * as serviceDiscordEventApi from './api/service-discord-event.api';
|
|
16
|
+
import * as serviceInsightsApi from './api/service-insights.api';
|
|
17
|
+
import * as functionInsightsApi from './api/function-insights.api';
|
|
18
|
+
import * as serviceTaskApi from './api/service-task.api';
|
|
19
|
+
import * as applicationRunSettingsApi from './api/application-run-settings.api';
|
|
20
|
+
import * as applicationInsightsApi from './api/application-insights.api';
|
|
21
|
+
import * as alertRuleApi from './api/alert-rule.api';
|
|
22
|
+
import * as routeStatsApi from './api/route-stats.api';
|
|
23
|
+
|
|
24
|
+
export * from './api';
|
|
25
|
+
export * from './types';
|
|
26
|
+
export * from './discord';
|
|
27
|
+
export * from './insights';
|
|
28
|
+
|
|
29
|
+
const DEFAULT_BASE_URL = 'https://reflex-api.abyss-project.fr/';
|
|
30
|
+
|
|
31
|
+
type CoreConfig = {
|
|
32
|
+
baseURL?: string;
|
|
33
|
+
/** The session token of the member (`Authorization: Bearer`). Every route but `health` needs it. */
|
|
34
|
+
token?: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type AbyssReflexCoreSDK = {
|
|
38
|
+
/** `GET /health` — status of the database and Redis behind the API. */
|
|
39
|
+
health: typeof healthApi.health;
|
|
40
|
+
function: {
|
|
41
|
+
list: typeof functionApi.listFunction;
|
|
42
|
+
create: typeof functionApi.createFunction;
|
|
43
|
+
get: typeof functionApi.getFunction;
|
|
44
|
+
update: typeof functionApi.updateFunction;
|
|
45
|
+
delete: typeof functionApi.deleteFunction;
|
|
46
|
+
access: {
|
|
47
|
+
list: typeof functionAccessApi.listFunctionAccess;
|
|
48
|
+
grant: typeof functionAccessApi.grantFunctionAccess;
|
|
49
|
+
revoke: typeof functionAccessApi.revokeFunctionAccess;
|
|
50
|
+
};
|
|
51
|
+
test: {
|
|
52
|
+
simulate: typeof functionTestApi.simulateFunction;
|
|
53
|
+
dryRun: typeof functionTestApi.dryRunFunction;
|
|
54
|
+
};
|
|
55
|
+
version: {
|
|
56
|
+
list: typeof functionVersionApi.listFunctionVersion;
|
|
57
|
+
get: typeof functionVersionApi.getFunctionVersion;
|
|
58
|
+
stepStats: typeof functionVersionApi.getFunctionVersionStepStats;
|
|
59
|
+
};
|
|
60
|
+
run: {
|
|
61
|
+
list: typeof functionRunApi.listFunctionRun;
|
|
62
|
+
get: typeof functionRunApi.getFunctionRun;
|
|
63
|
+
state: typeof functionRunApi.getFunctionRunState;
|
|
64
|
+
};
|
|
65
|
+
/** The dashboard of the function: tiles, series, ranking. */
|
|
66
|
+
insights: {
|
|
67
|
+
get: typeof functionInsightsApi.getFunctionInsights;
|
|
68
|
+
};
|
|
69
|
+
settings: {
|
|
70
|
+
get: typeof functionSettingsApi.getFunctionSettings;
|
|
71
|
+
setDefault: typeof functionSettingsApi.setFunctionDefaultSettings;
|
|
72
|
+
setEnvironment: typeof functionSettingsApi.setFunctionEnvironmentSettings;
|
|
73
|
+
removeEnvironment: typeof functionSettingsApi.removeFunctionEnvironmentSettings;
|
|
74
|
+
};
|
|
75
|
+
/** The log cap of the function: inherit the one of the application, none, or a number of lines. */
|
|
76
|
+
logCap: {
|
|
77
|
+
set: typeof functionSettingsApi.setFunctionLogCap;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
/** Applications: run settings, overview, calendar and alert rules (`/api/application/:applicationId/...`). */
|
|
81
|
+
application: {
|
|
82
|
+
runSettings: {
|
|
83
|
+
get: typeof applicationRunSettingsApi.getApplicationRunSettings;
|
|
84
|
+
set: typeof applicationRunSettingsApi.setApplicationRunSettings;
|
|
85
|
+
};
|
|
86
|
+
insights: {
|
|
87
|
+
get: typeof applicationInsightsApi.getApplicationInsights;
|
|
88
|
+
calendar: typeof applicationInsightsApi.getApplicationCalendar;
|
|
89
|
+
};
|
|
90
|
+
alertRule: {
|
|
91
|
+
list: typeof alertRuleApi.listAlertRule;
|
|
92
|
+
create: typeof alertRuleApi.createAlertRule;
|
|
93
|
+
update: typeof alertRuleApi.updateAlertRule;
|
|
94
|
+
delete: typeof alertRuleApi.deleteAlertRule;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
/** Services: the unit versioned, put in service and paused as one (`/api/service/:applicationId/...`). */
|
|
98
|
+
service: {
|
|
99
|
+
list: typeof serviceApi.listService;
|
|
100
|
+
create: typeof serviceApi.createService;
|
|
101
|
+
get: typeof serviceApi.getService;
|
|
102
|
+
update: typeof serviceApi.updateService;
|
|
103
|
+
delete: typeof serviceApi.deleteService;
|
|
104
|
+
route: {
|
|
105
|
+
list: typeof serviceRouteApi.listServiceRoute;
|
|
106
|
+
create: typeof serviceRouteApi.createServiceRoute;
|
|
107
|
+
update: typeof serviceRouteApi.updateServiceRoute;
|
|
108
|
+
delete: typeof serviceRouteApi.deleteServiceRoute;
|
|
109
|
+
rotate: typeof serviceRouteApi.rotateServiceRoute;
|
|
110
|
+
};
|
|
111
|
+
version: {
|
|
112
|
+
list: typeof serviceVersionApi.listServiceVersion;
|
|
113
|
+
create: typeof serviceVersionApi.createServiceVersion;
|
|
114
|
+
get: typeof serviceVersionApi.getServiceVersion;
|
|
115
|
+
draftStatus: typeof serviceVersionApi.getServiceVersionDraftStatus;
|
|
116
|
+
};
|
|
117
|
+
deployment: {
|
|
118
|
+
list: typeof serviceDeploymentApi.listServiceDeployment;
|
|
119
|
+
goLive: typeof serviceDeploymentApi.goLiveService;
|
|
120
|
+
rollback: typeof serviceDeploymentApi.rollbackService;
|
|
121
|
+
pause: typeof serviceDeploymentApi.pauseService;
|
|
122
|
+
resume: typeof serviceDeploymentApi.resumeService;
|
|
123
|
+
};
|
|
124
|
+
configuration: {
|
|
125
|
+
list: typeof serviceConfigurationApi.listServiceConfiguration;
|
|
126
|
+
};
|
|
127
|
+
/** The dashboards of the Service, and of the Discord events of a bot. */
|
|
128
|
+
insights: {
|
|
129
|
+
get: typeof serviceInsightsApi.getServiceInsights;
|
|
130
|
+
events: typeof serviceInsightsApi.getServiceEventInsights;
|
|
131
|
+
};
|
|
132
|
+
/** The statistics of every route of the Service, and the dashboard of one route. */
|
|
133
|
+
routeStats: {
|
|
134
|
+
list: typeof routeStatsApi.getServiceRouteStats;
|
|
135
|
+
insights: typeof routeStatsApi.getRouteInsights;
|
|
136
|
+
};
|
|
137
|
+
/** A Discord bot Service: its commands and components, its connection, the push to Discord. */
|
|
138
|
+
discord: {
|
|
139
|
+
command: {
|
|
140
|
+
list: typeof serviceDiscordApi.listServiceDiscordCommand;
|
|
141
|
+
create: typeof serviceDiscordApi.createServiceDiscordCommand;
|
|
142
|
+
update: typeof serviceDiscordApi.updateServiceDiscordCommand;
|
|
143
|
+
delete: typeof serviceDiscordApi.deleteServiceDiscordCommand;
|
|
144
|
+
};
|
|
145
|
+
component: {
|
|
146
|
+
list: typeof serviceDiscordApi.listServiceDiscordComponent;
|
|
147
|
+
create: typeof serviceDiscordApi.createServiceDiscordComponent;
|
|
148
|
+
update: typeof serviceDiscordApi.updateServiceDiscordComponent;
|
|
149
|
+
delete: typeof serviceDiscordApi.deleteServiceDiscordComponent;
|
|
150
|
+
};
|
|
151
|
+
/** The Discord event triggers of the draft (message, reaction, member arrival and departure). */
|
|
152
|
+
event: {
|
|
153
|
+
list: typeof serviceDiscordEventApi.listServiceDiscordEvent;
|
|
154
|
+
create: typeof serviceDiscordEventApi.createServiceDiscordEvent;
|
|
155
|
+
update: typeof serviceDiscordEventApi.updateServiceDiscordEvent;
|
|
156
|
+
delete: typeof serviceDiscordEventApi.deleteServiceDiscordEvent;
|
|
157
|
+
};
|
|
158
|
+
/** The events of the bot in an environment: the retained ones and a sample of the dropped ones. */
|
|
159
|
+
eventLog: {
|
|
160
|
+
list: typeof serviceDiscordEventApi.listServiceDiscordEventLog;
|
|
161
|
+
};
|
|
162
|
+
connection: {
|
|
163
|
+
get: typeof serviceDiscordApi.getServiceDiscordConnection;
|
|
164
|
+
setTokenSecret: typeof serviceDiscordApi.setServiceDiscordTokenSecret;
|
|
165
|
+
setEnvironment: typeof serviceDiscordApi.setServiceDiscordEnvironment;
|
|
166
|
+
/** The lots of the reserve of events per minute the bot holds in an environment. */
|
|
167
|
+
setAllocation: typeof serviceDiscordApi.setServiceDiscordAllocation;
|
|
168
|
+
/** Credit overage, monthly spend cap and alerts of the bot in an environment. */
|
|
169
|
+
setBotSettings: typeof serviceDiscordApi.setServiceDiscordBotSettings;
|
|
170
|
+
check: typeof serviceDiscordApi.checkServiceDiscordConnection;
|
|
171
|
+
};
|
|
172
|
+
/** Pushes the interactions address and the commands to Discord again. */
|
|
173
|
+
sync: typeof serviceDiscordApi.retryServiceDiscordSync;
|
|
174
|
+
};
|
|
175
|
+
/** The tasks of the Service (cron and delayed runs), their delayed runs, the synchronization with Flow. */
|
|
176
|
+
task: {
|
|
177
|
+
list: typeof serviceTaskApi.listServiceTask;
|
|
178
|
+
create: typeof serviceTaskApi.createServiceTask;
|
|
179
|
+
update: typeof serviceTaskApi.updateServiceTask;
|
|
180
|
+
delete: typeof serviceTaskApi.deleteServiceTask;
|
|
181
|
+
testRun: typeof serviceTaskApi.testRunServiceTask;
|
|
182
|
+
/** The history of a task in an environment: its runs of every status, those that ran nothing included. */
|
|
183
|
+
scheduledRun: {
|
|
184
|
+
list: typeof serviceTaskApi.listServiceTaskScheduledRun;
|
|
185
|
+
};
|
|
186
|
+
delayedRun: {
|
|
187
|
+
list: typeof serviceTaskApi.listServiceDelayedRun;
|
|
188
|
+
cancel: typeof serviceTaskApi.cancelServiceDelayedRun;
|
|
189
|
+
};
|
|
190
|
+
/** Synchronizes the cron tasks of the version in service with Flow again. */
|
|
191
|
+
sync: typeof serviceTaskApi.retryServiceScheduleSync;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export class AbyssReflexCore {
|
|
197
|
+
private static config: CoreConfig = {
|
|
198
|
+
baseURL: DEFAULT_BASE_URL,
|
|
199
|
+
};
|
|
200
|
+
static axios = axios.create({
|
|
201
|
+
baseURL: DEFAULT_BASE_URL,
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
private static _sdk: AbyssReflexCoreSDK | null = null;
|
|
205
|
+
|
|
206
|
+
public static get sdk(): AbyssReflexCoreSDK {
|
|
207
|
+
if (!AbyssReflexCore._sdk) {
|
|
208
|
+
AbyssReflexCore._sdk = {
|
|
209
|
+
health: healthApi.health,
|
|
210
|
+
function: {
|
|
211
|
+
list: functionApi.listFunction,
|
|
212
|
+
create: functionApi.createFunction,
|
|
213
|
+
get: functionApi.getFunction,
|
|
214
|
+
update: functionApi.updateFunction,
|
|
215
|
+
delete: functionApi.deleteFunction,
|
|
216
|
+
access: {
|
|
217
|
+
list: functionAccessApi.listFunctionAccess,
|
|
218
|
+
grant: functionAccessApi.grantFunctionAccess,
|
|
219
|
+
revoke: functionAccessApi.revokeFunctionAccess,
|
|
220
|
+
},
|
|
221
|
+
test: {
|
|
222
|
+
simulate: functionTestApi.simulateFunction,
|
|
223
|
+
dryRun: functionTestApi.dryRunFunction,
|
|
224
|
+
},
|
|
225
|
+
version: {
|
|
226
|
+
list: functionVersionApi.listFunctionVersion,
|
|
227
|
+
get: functionVersionApi.getFunctionVersion,
|
|
228
|
+
stepStats: functionVersionApi.getFunctionVersionStepStats,
|
|
229
|
+
},
|
|
230
|
+
run: {
|
|
231
|
+
list: functionRunApi.listFunctionRun,
|
|
232
|
+
get: functionRunApi.getFunctionRun,
|
|
233
|
+
state: functionRunApi.getFunctionRunState,
|
|
234
|
+
},
|
|
235
|
+
insights: {
|
|
236
|
+
get: functionInsightsApi.getFunctionInsights,
|
|
237
|
+
},
|
|
238
|
+
settings: {
|
|
239
|
+
get: functionSettingsApi.getFunctionSettings,
|
|
240
|
+
setDefault: functionSettingsApi.setFunctionDefaultSettings,
|
|
241
|
+
setEnvironment: functionSettingsApi.setFunctionEnvironmentSettings,
|
|
242
|
+
removeEnvironment: functionSettingsApi.removeFunctionEnvironmentSettings,
|
|
243
|
+
},
|
|
244
|
+
logCap: {
|
|
245
|
+
set: functionSettingsApi.setFunctionLogCap,
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
application: {
|
|
249
|
+
runSettings: {
|
|
250
|
+
get: applicationRunSettingsApi.getApplicationRunSettings,
|
|
251
|
+
set: applicationRunSettingsApi.setApplicationRunSettings,
|
|
252
|
+
},
|
|
253
|
+
insights: {
|
|
254
|
+
get: applicationInsightsApi.getApplicationInsights,
|
|
255
|
+
calendar: applicationInsightsApi.getApplicationCalendar,
|
|
256
|
+
},
|
|
257
|
+
alertRule: {
|
|
258
|
+
list: alertRuleApi.listAlertRule,
|
|
259
|
+
create: alertRuleApi.createAlertRule,
|
|
260
|
+
update: alertRuleApi.updateAlertRule,
|
|
261
|
+
delete: alertRuleApi.deleteAlertRule,
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
service: {
|
|
265
|
+
list: serviceApi.listService,
|
|
266
|
+
create: serviceApi.createService,
|
|
267
|
+
get: serviceApi.getService,
|
|
268
|
+
update: serviceApi.updateService,
|
|
269
|
+
delete: serviceApi.deleteService,
|
|
270
|
+
route: {
|
|
271
|
+
list: serviceRouteApi.listServiceRoute,
|
|
272
|
+
create: serviceRouteApi.createServiceRoute,
|
|
273
|
+
update: serviceRouteApi.updateServiceRoute,
|
|
274
|
+
delete: serviceRouteApi.deleteServiceRoute,
|
|
275
|
+
rotate: serviceRouteApi.rotateServiceRoute,
|
|
276
|
+
},
|
|
277
|
+
version: {
|
|
278
|
+
list: serviceVersionApi.listServiceVersion,
|
|
279
|
+
create: serviceVersionApi.createServiceVersion,
|
|
280
|
+
get: serviceVersionApi.getServiceVersion,
|
|
281
|
+
draftStatus: serviceVersionApi.getServiceVersionDraftStatus,
|
|
282
|
+
},
|
|
283
|
+
deployment: {
|
|
284
|
+
list: serviceDeploymentApi.listServiceDeployment,
|
|
285
|
+
goLive: serviceDeploymentApi.goLiveService,
|
|
286
|
+
rollback: serviceDeploymentApi.rollbackService,
|
|
287
|
+
pause: serviceDeploymentApi.pauseService,
|
|
288
|
+
resume: serviceDeploymentApi.resumeService,
|
|
289
|
+
},
|
|
290
|
+
configuration: {
|
|
291
|
+
list: serviceConfigurationApi.listServiceConfiguration,
|
|
292
|
+
},
|
|
293
|
+
insights: {
|
|
294
|
+
get: serviceInsightsApi.getServiceInsights,
|
|
295
|
+
events: serviceInsightsApi.getServiceEventInsights,
|
|
296
|
+
},
|
|
297
|
+
routeStats: {
|
|
298
|
+
list: routeStatsApi.getServiceRouteStats,
|
|
299
|
+
insights: routeStatsApi.getRouteInsights,
|
|
300
|
+
},
|
|
301
|
+
discord: {
|
|
302
|
+
command: {
|
|
303
|
+
list: serviceDiscordApi.listServiceDiscordCommand,
|
|
304
|
+
create: serviceDiscordApi.createServiceDiscordCommand,
|
|
305
|
+
update: serviceDiscordApi.updateServiceDiscordCommand,
|
|
306
|
+
delete: serviceDiscordApi.deleteServiceDiscordCommand,
|
|
307
|
+
},
|
|
308
|
+
component: {
|
|
309
|
+
list: serviceDiscordApi.listServiceDiscordComponent,
|
|
310
|
+
create: serviceDiscordApi.createServiceDiscordComponent,
|
|
311
|
+
update: serviceDiscordApi.updateServiceDiscordComponent,
|
|
312
|
+
delete: serviceDiscordApi.deleteServiceDiscordComponent,
|
|
313
|
+
},
|
|
314
|
+
event: {
|
|
315
|
+
list: serviceDiscordEventApi.listServiceDiscordEvent,
|
|
316
|
+
create: serviceDiscordEventApi.createServiceDiscordEvent,
|
|
317
|
+
update: serviceDiscordEventApi.updateServiceDiscordEvent,
|
|
318
|
+
delete: serviceDiscordEventApi.deleteServiceDiscordEvent,
|
|
319
|
+
},
|
|
320
|
+
eventLog: {
|
|
321
|
+
list: serviceDiscordEventApi.listServiceDiscordEventLog,
|
|
322
|
+
},
|
|
323
|
+
connection: {
|
|
324
|
+
get: serviceDiscordApi.getServiceDiscordConnection,
|
|
325
|
+
setTokenSecret: serviceDiscordApi.setServiceDiscordTokenSecret,
|
|
326
|
+
setEnvironment: serviceDiscordApi.setServiceDiscordEnvironment,
|
|
327
|
+
setAllocation: serviceDiscordApi.setServiceDiscordAllocation,
|
|
328
|
+
setBotSettings: serviceDiscordApi.setServiceDiscordBotSettings,
|
|
329
|
+
check: serviceDiscordApi.checkServiceDiscordConnection,
|
|
330
|
+
},
|
|
331
|
+
sync: serviceDiscordApi.retryServiceDiscordSync,
|
|
332
|
+
},
|
|
333
|
+
task: {
|
|
334
|
+
list: serviceTaskApi.listServiceTask,
|
|
335
|
+
create: serviceTaskApi.createServiceTask,
|
|
336
|
+
update: serviceTaskApi.updateServiceTask,
|
|
337
|
+
delete: serviceTaskApi.deleteServiceTask,
|
|
338
|
+
testRun: serviceTaskApi.testRunServiceTask,
|
|
339
|
+
scheduledRun: {
|
|
340
|
+
list: serviceTaskApi.listServiceTaskScheduledRun,
|
|
341
|
+
},
|
|
342
|
+
delayedRun: {
|
|
343
|
+
list: serviceTaskApi.listServiceDelayedRun,
|
|
344
|
+
cancel: serviceTaskApi.cancelServiceDelayedRun,
|
|
345
|
+
},
|
|
346
|
+
sync: serviceTaskApi.retryServiceScheduleSync,
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
return AbyssReflexCore._sdk;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
public static setConfig(config: CoreConfig): void {
|
|
355
|
+
AbyssReflexCore._sdk = null;
|
|
356
|
+
|
|
357
|
+
AbyssReflexCore.config = { ...AbyssReflexCore.config, ...config };
|
|
358
|
+
|
|
359
|
+
if (config.baseURL) {
|
|
360
|
+
AbyssReflexCore.axios.defaults.baseURL = config.baseURL;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (config.token) {
|
|
364
|
+
AbyssReflexCore.axios.defaults.headers.common.Authorization = `Bearer ${config.token}`;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
public static getConfig(): CoreConfig {
|
|
369
|
+
return AbyssReflexCore.config;
|
|
370
|
+
}
|
|
371
|
+
}
|