@tuturuuu/internal-api 0.9.0 → 0.10.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.
Files changed (118) hide show
  1. package/dist/account-delete.d.ts +25 -0
  2. package/dist/account-delete.d.ts.map +1 -0
  3. package/dist/account-delete.js +22 -0
  4. package/dist/ai.d.ts +2 -1
  5. package/dist/ai.d.ts.map +1 -1
  6. package/dist/api-keys.d.ts +66 -0
  7. package/dist/api-keys.d.ts.map +1 -0
  8. package/dist/api-keys.js +93 -0
  9. package/dist/auth.d.ts +5 -0
  10. package/dist/auth.d.ts.map +1 -1
  11. package/dist/auth.js +9 -0
  12. package/dist/backend.d.ts +556 -0
  13. package/dist/backend.d.ts.map +1 -0
  14. package/dist/backend.js +528 -0
  15. package/dist/calendar.d.ts +29 -0
  16. package/dist/calendar.d.ts.map +1 -1
  17. package/dist/calendar.js +18 -0
  18. package/dist/client.d.ts.map +1 -1
  19. package/dist/client.js +2 -0
  20. package/dist/cron.d.ts +16 -0
  21. package/dist/cron.d.ts.map +1 -0
  22. package/dist/cron.js +41 -0
  23. package/dist/documents.d.ts +38 -0
  24. package/dist/documents.d.ts.map +1 -0
  25. package/dist/documents.js +71 -0
  26. package/dist/education.d.ts +228 -12
  27. package/dist/education.d.ts.map +1 -1
  28. package/dist/education.js +229 -0
  29. package/dist/group-tags.d.ts +87 -0
  30. package/dist/group-tags.d.ts.map +1 -0
  31. package/dist/group-tags.js +116 -0
  32. package/dist/index.d.ts +24 -14
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +164 -14
  35. package/dist/infrastructure/abuse.d.ts +7 -0
  36. package/dist/infrastructure/abuse.d.ts.map +1 -0
  37. package/dist/infrastructure/abuse.js +39 -0
  38. package/dist/infrastructure/ai.d.ts +53 -0
  39. package/dist/infrastructure/ai.d.ts.map +1 -0
  40. package/dist/infrastructure/ai.js +331 -0
  41. package/dist/infrastructure/apps.d.ts +9 -0
  42. package/dist/infrastructure/apps.d.ts.map +1 -0
  43. package/dist/infrastructure/apps.js +49 -0
  44. package/dist/infrastructure/blocked-ips.d.ts +65 -0
  45. package/dist/infrastructure/blocked-ips.d.ts.map +1 -0
  46. package/dist/infrastructure/blocked-ips.js +56 -0
  47. package/dist/infrastructure/github-bot.d.ts +10 -0
  48. package/dist/infrastructure/github-bot.d.ts.map +1 -0
  49. package/dist/infrastructure/github-bot.js +73 -0
  50. package/dist/infrastructure/index.d.ts +11 -0
  51. package/dist/infrastructure/index.d.ts.map +1 -0
  52. package/dist/infrastructure/index.js +26 -0
  53. package/dist/infrastructure/mobile.d.ts +23 -0
  54. package/dist/infrastructure/mobile.d.ts.map +1 -0
  55. package/dist/infrastructure/mobile.js +183 -0
  56. package/dist/infrastructure/monitoring.d.ts +34 -0
  57. package/dist/infrastructure/monitoring.d.ts.map +1 -0
  58. package/dist/infrastructure/monitoring.js +356 -0
  59. package/dist/infrastructure/realtime.d.ts +55 -0
  60. package/dist/infrastructure/realtime.d.ts.map +1 -0
  61. package/dist/infrastructure/realtime.js +29 -0
  62. package/dist/infrastructure/types.d.ts +1652 -0
  63. package/dist/infrastructure/types.d.ts.map +1 -0
  64. package/dist/infrastructure/types.js +2 -0
  65. package/dist/infrastructure/workspace.d.ts +5 -0
  66. package/dist/infrastructure/workspace.d.ts.map +1 -0
  67. package/dist/infrastructure/workspace.js +15 -0
  68. package/dist/infrastructure.d.ts +10 -1725
  69. package/dist/infrastructure.d.ts.map +1 -1
  70. package/dist/infrastructure.js +24 -1019
  71. package/dist/inventory.d.ts +34 -0
  72. package/dist/inventory.d.ts.map +1 -1
  73. package/dist/inventory.js +7 -0
  74. package/dist/notifications.d.ts +90 -0
  75. package/dist/notifications.d.ts.map +1 -0
  76. package/dist/notifications.js +62 -0
  77. package/dist/promotions.d.ts +3 -0
  78. package/dist/promotions.d.ts.map +1 -1
  79. package/dist/promotions.js +8 -0
  80. package/dist/rate-limits.d.ts +18 -5
  81. package/dist/rate-limits.d.ts.map +1 -1
  82. package/dist/task-plans.d.ts +220 -0
  83. package/dist/task-plans.d.ts.map +1 -0
  84. package/dist/task-plans.js +153 -0
  85. package/dist/tasks.d.ts +200 -0
  86. package/dist/tasks.d.ts.map +1 -1
  87. package/dist/tasks.js +143 -0
  88. package/dist/teach.d.ts +67 -0
  89. package/dist/teach.d.ts.map +1 -1
  90. package/dist/teach.js +20 -0
  91. package/dist/templates.d.ts +2 -0
  92. package/dist/templates.d.ts.map +1 -1
  93. package/dist/templates.js +8 -0
  94. package/dist/tulearn.d.ts +46 -0
  95. package/dist/tulearn.d.ts.map +1 -1
  96. package/dist/tulearn.js +36 -0
  97. package/dist/user-group-attendance.d.ts +29 -0
  98. package/dist/user-group-attendance.d.ts.map +1 -0
  99. package/dist/user-group-attendance.js +38 -0
  100. package/dist/user-group-schedule.d.ts +193 -0
  101. package/dist/user-group-schedule.d.ts.map +1 -0
  102. package/dist/user-group-schedule.js +84 -0
  103. package/dist/user-groups.d.ts +18 -0
  104. package/dist/user-groups.d.ts.map +1 -1
  105. package/dist/user-groups.js +18 -0
  106. package/dist/users-server.d.ts +14 -0
  107. package/dist/users-server.d.ts.map +1 -0
  108. package/dist/users-server.js +37 -0
  109. package/dist/users.d.ts +64 -1
  110. package/dist/users.d.ts.map +1 -1
  111. package/dist/users.js +78 -6
  112. package/dist/workspace-config-ids.d.ts +6 -0
  113. package/dist/workspace-config-ids.d.ts.map +1 -1
  114. package/dist/workspace-config-ids.js +13 -1
  115. package/dist/workspace-configs.d.ts +4 -1
  116. package/dist/workspace-configs.d.ts.map +1 -1
  117. package/dist/workspace-configs.js +25 -1
  118. package/package.json +63 -8
@@ -0,0 +1,356 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBlueGreenMonitoringSnapshot = getBlueGreenMonitoringSnapshot;
4
+ exports.getBlueGreenMonitoringRequestArchive = getBlueGreenMonitoringRequestArchive;
5
+ exports.getBlueGreenMonitoringWatcherLogArchive = getBlueGreenMonitoringWatcherLogArchive;
6
+ exports.getCronMonitoringSnapshot = getCronMonitoringSnapshot;
7
+ exports.getCronMonitoringExecutionArchive = getCronMonitoringExecutionArchive;
8
+ exports.queueCronRun = queueCronRun;
9
+ exports.updateCronMonitoringControl = updateCronMonitoringControl;
10
+ exports.getInfrastructureStressTestSnapshot = getInfrastructureStressTestSnapshot;
11
+ exports.queueInfrastructureStressTest = queueInfrastructureStressTest;
12
+ exports.getInfrastructureStressTestRun = getInfrastructureStressTestRun;
13
+ exports.abortInfrastructureStressTest = abortInfrastructureStressTest;
14
+ exports.getObservabilityOverview = getObservabilityOverview;
15
+ exports.getObservabilityDeployments = getObservabilityDeployments;
16
+ exports.getObservabilityLogs = getObservabilityLogs;
17
+ exports.getObservabilityRequests = getObservabilityRequests;
18
+ exports.getObservabilityAnalytics = getObservabilityAnalytics;
19
+ exports.getObservabilityCronRuns = getObservabilityCronRuns;
20
+ exports.getObservabilityResources = getObservabilityResources;
21
+ exports.getInfrastructureProjects = getInfrastructureProjects;
22
+ exports.createInfrastructureProject = createInfrastructureProject;
23
+ exports.updateInfrastructureProject = updateInfrastructureProject;
24
+ exports.deleteInfrastructureProject = deleteInfrastructureProject;
25
+ exports.syncInfrastructureProject = syncInfrastructureProject;
26
+ exports.queueInfrastructureProjectDeploy = queueInfrastructureProjectDeploy;
27
+ exports.requestBlueGreenInstantRollout = requestBlueGreenInstantRollout;
28
+ exports.requestBlueGreenDeploymentRevert = requestBlueGreenDeploymentRevert;
29
+ exports.requestBlueGreenWatcherRecovery = requestBlueGreenWatcherRecovery;
30
+ exports.updateBlueGreenDockerRecoverySettings = updateBlueGreenDockerRecoverySettings;
31
+ exports.pinBlueGreenDeployment = pinBlueGreenDeployment;
32
+ exports.clearBlueGreenDeploymentPin = clearBlueGreenDeploymentPin;
33
+ const client_1 = require("../client");
34
+ async function getBlueGreenMonitoringSnapshot(params, options) {
35
+ const client = (0, client_1.getInternalApiClient)(options);
36
+ const searchParams = new URLSearchParams();
37
+ if (params?.requestPreviewLimit != null) {
38
+ searchParams.set('requestPreviewLimit', String(params.requestPreviewLimit));
39
+ }
40
+ if (params?.watcherLogLimit != null) {
41
+ searchParams.set('watcherLogLimit', String(params.watcherLogLimit));
42
+ }
43
+ return client.json(`/api/v1/infrastructure/monitoring/blue-green${searchParams.size > 0 ? `?${searchParams.toString()}` : ''}`, {
44
+ cache: 'no-store',
45
+ });
46
+ }
47
+ async function getBlueGreenMonitoringRequestArchive(params, options) {
48
+ const client = (0, client_1.getInternalApiClient)(options);
49
+ const searchParams = new URLSearchParams();
50
+ if (params?.page != null) {
51
+ searchParams.set('page', String(params.page));
52
+ }
53
+ if (params?.pageSize != null) {
54
+ searchParams.set('pageSize', String(params.pageSize));
55
+ }
56
+ if (params?.timeframeDays != null) {
57
+ searchParams.set('timeframeDays', String(params.timeframeDays));
58
+ }
59
+ if (params?.q) {
60
+ searchParams.set('q', params.q);
61
+ }
62
+ if (params?.status && params.status !== 'all') {
63
+ searchParams.set('status', params.status);
64
+ }
65
+ if (params?.route && params.route !== 'all') {
66
+ searchParams.set('route', params.route);
67
+ }
68
+ if (params?.since != null) {
69
+ searchParams.set('since', String(params.since));
70
+ }
71
+ if (params?.render && params.render !== 'all') {
72
+ searchParams.set('render', params.render);
73
+ }
74
+ if (params?.traffic && params.traffic !== 'all') {
75
+ searchParams.set('traffic', params.traffic);
76
+ }
77
+ if (params?.until != null) {
78
+ searchParams.set('until', String(params.until));
79
+ }
80
+ return client.json(`/api/v1/infrastructure/monitoring/blue-green/requests${searchParams.size > 0 ? `?${searchParams.toString()}` : ''}`, {
81
+ cache: 'no-store',
82
+ });
83
+ }
84
+ async function getBlueGreenMonitoringWatcherLogArchive(params, options) {
85
+ const client = (0, client_1.getInternalApiClient)(options);
86
+ const searchParams = new URLSearchParams();
87
+ if (params?.page != null) {
88
+ searchParams.set('page', String(params.page));
89
+ }
90
+ if (params?.pageSize != null) {
91
+ searchParams.set('pageSize', String(params.pageSize));
92
+ }
93
+ return client.json(`/api/v1/infrastructure/monitoring/blue-green/watcher-logs${searchParams.size > 0 ? `?${searchParams.toString()}` : ''}`, {
94
+ cache: 'no-store',
95
+ });
96
+ }
97
+ async function getCronMonitoringSnapshot(options) {
98
+ const client = (0, client_1.getInternalApiClient)(options);
99
+ return client.json('/api/v1/infrastructure/monitoring/cron', {
100
+ cache: 'no-store',
101
+ });
102
+ }
103
+ async function getCronMonitoringExecutionArchive(params, options) {
104
+ const client = (0, client_1.getInternalApiClient)(options);
105
+ const searchParams = new URLSearchParams();
106
+ if (params?.page != null) {
107
+ searchParams.set('page', String(params.page));
108
+ }
109
+ if (params?.pageSize != null) {
110
+ searchParams.set('pageSize', String(params.pageSize));
111
+ }
112
+ if (params?.jobId) {
113
+ searchParams.set('jobId', params.jobId);
114
+ }
115
+ return client.json(`/api/v1/infrastructure/monitoring/cron/executions${searchParams.size > 0 ? `?${searchParams.toString()}` : ''}`, {
116
+ cache: 'no-store',
117
+ });
118
+ }
119
+ async function queueCronRun(payload, options) {
120
+ const client = (0, client_1.getInternalApiClient)(options);
121
+ return client.json('/api/v1/infrastructure/monitoring/cron/run', {
122
+ body: JSON.stringify(payload),
123
+ cache: 'no-store',
124
+ headers: {
125
+ 'Content-Type': 'application/json',
126
+ },
127
+ method: 'POST',
128
+ });
129
+ }
130
+ async function updateCronMonitoringControl(payload, options) {
131
+ const client = (0, client_1.getInternalApiClient)(options);
132
+ return client.json('/api/v1/infrastructure/monitoring/cron/control', {
133
+ body: JSON.stringify(payload),
134
+ cache: 'no-store',
135
+ headers: {
136
+ 'Content-Type': 'application/json',
137
+ },
138
+ method: 'PUT',
139
+ });
140
+ }
141
+ async function getInfrastructureStressTestSnapshot(options) {
142
+ const client = (0, client_1.getInternalApiClient)(options);
143
+ return client.json('/api/v1/infrastructure/monitoring/stress-tests', {
144
+ cache: 'no-store',
145
+ });
146
+ }
147
+ async function queueInfrastructureStressTest(payload, options) {
148
+ const client = (0, client_1.getInternalApiClient)(options);
149
+ return client.json('/api/v1/infrastructure/monitoring/stress-tests', {
150
+ body: JSON.stringify(payload),
151
+ cache: 'no-store',
152
+ headers: {
153
+ 'Content-Type': 'application/json',
154
+ },
155
+ method: 'POST',
156
+ });
157
+ }
158
+ async function getInfrastructureStressTestRun(runId, options) {
159
+ const client = (0, client_1.getInternalApiClient)(options);
160
+ return client.json(`/api/v1/infrastructure/monitoring/stress-tests/${(0, client_1.encodePathSegment)(runId)}`, {
161
+ cache: 'no-store',
162
+ });
163
+ }
164
+ async function abortInfrastructureStressTest(runId, payload = {}, options) {
165
+ const client = (0, client_1.getInternalApiClient)(options);
166
+ return client.json(`/api/v1/infrastructure/monitoring/stress-tests/${(0, client_1.encodePathSegment)(runId)}/abort`, {
167
+ body: JSON.stringify(payload),
168
+ cache: 'no-store',
169
+ headers: {
170
+ 'Content-Type': 'application/json',
171
+ },
172
+ method: 'POST',
173
+ });
174
+ }
175
+ function appendObservabilitySearchParams(searchParams, params) {
176
+ if (params?.page != null) {
177
+ searchParams.set('page', String(params.page));
178
+ }
179
+ if (params?.pageSize != null) {
180
+ searchParams.set('pageSize', String(params.pageSize));
181
+ }
182
+ if (params?.projectId) {
183
+ searchParams.set('projectId', params.projectId);
184
+ }
185
+ if (params?.timeframeHours != null) {
186
+ searchParams.set('timeframeHours', String(params.timeframeHours));
187
+ }
188
+ if (params?.q) {
189
+ searchParams.set('q', params.q);
190
+ }
191
+ if (params?.route && params.route !== 'all') {
192
+ searchParams.set('route', params.route);
193
+ }
194
+ if (params?.requestId) {
195
+ searchParams.set('requestId', params.requestId);
196
+ }
197
+ if (params?.user) {
198
+ searchParams.set('user', params.user);
199
+ }
200
+ if (params?.deploymentStamp) {
201
+ searchParams.set('deploymentStamp', params.deploymentStamp);
202
+ }
203
+ if (params?.since != null) {
204
+ searchParams.set('since', String(params.since));
205
+ }
206
+ if (params?.until != null) {
207
+ searchParams.set('until', String(params.until));
208
+ }
209
+ if (params?.level && params.level !== 'all') {
210
+ searchParams.set('level', params.level);
211
+ }
212
+ if (params?.source && params.source !== 'all') {
213
+ searchParams.set('source', params.source);
214
+ }
215
+ if (params?.status && params.status !== 'all') {
216
+ searchParams.set('status', params.status);
217
+ }
218
+ }
219
+ function getObservabilityPath(path, params) {
220
+ const searchParams = new URLSearchParams();
221
+ appendObservabilitySearchParams(searchParams, params);
222
+ return `/api/v1/infrastructure/observability/${path}${searchParams.size > 0 ? `?${searchParams.toString()}` : ''}`;
223
+ }
224
+ async function getObservabilityOverview(params, options) {
225
+ const client = (0, client_1.getInternalApiClient)(options);
226
+ return client.json(getObservabilityPath('overview', params), { cache: 'no-store' });
227
+ }
228
+ async function getObservabilityDeployments(params, options) {
229
+ const client = (0, client_1.getInternalApiClient)(options);
230
+ return client.json(getObservabilityPath('deployments', params), { cache: 'no-store' });
231
+ }
232
+ async function getObservabilityLogs(params, options) {
233
+ const client = (0, client_1.getInternalApiClient)(options);
234
+ return client.json(getObservabilityPath('logs', params), { cache: 'no-store' });
235
+ }
236
+ async function getObservabilityRequests(params, options) {
237
+ const client = (0, client_1.getInternalApiClient)(options);
238
+ return client.json(getObservabilityPath('requests', params), { cache: 'no-store' });
239
+ }
240
+ async function getObservabilityAnalytics(params, options) {
241
+ const client = (0, client_1.getInternalApiClient)(options);
242
+ return client.json(getObservabilityPath('analytics', params), { cache: 'no-store' });
243
+ }
244
+ async function getObservabilityCronRuns(params, options) {
245
+ const client = (0, client_1.getInternalApiClient)(options);
246
+ return client.json(getObservabilityPath('cron-runs', params), { cache: 'no-store' });
247
+ }
248
+ async function getObservabilityResources(params, options) {
249
+ const client = (0, client_1.getInternalApiClient)(options);
250
+ return client.json(getObservabilityPath('resources', params), { cache: 'no-store' });
251
+ }
252
+ async function getInfrastructureProjects(options) {
253
+ const client = (0, client_1.getInternalApiClient)(options);
254
+ return client.json('/api/v1/infrastructure/projects', { cache: 'no-store' });
255
+ }
256
+ async function createInfrastructureProject(payload, options) {
257
+ const client = (0, client_1.getInternalApiClient)(options);
258
+ return client.json('/api/v1/infrastructure/projects', {
259
+ body: JSON.stringify(payload),
260
+ cache: 'no-store',
261
+ headers: {
262
+ 'Content-Type': 'application/json',
263
+ },
264
+ method: 'POST',
265
+ });
266
+ }
267
+ async function updateInfrastructureProject(projectId, payload, options) {
268
+ const client = (0, client_1.getInternalApiClient)(options);
269
+ return client.json(`/api/v1/infrastructure/projects/${encodeURIComponent(projectId)}`, {
270
+ body: JSON.stringify(payload),
271
+ cache: 'no-store',
272
+ headers: {
273
+ 'Content-Type': 'application/json',
274
+ },
275
+ method: 'PATCH',
276
+ });
277
+ }
278
+ async function deleteInfrastructureProject(projectId, options) {
279
+ const client = (0, client_1.getInternalApiClient)(options);
280
+ return client.json(`/api/v1/infrastructure/projects/${encodeURIComponent(projectId)}`, {
281
+ cache: 'no-store',
282
+ method: 'DELETE',
283
+ });
284
+ }
285
+ async function syncInfrastructureProject(projectId, options) {
286
+ const client = (0, client_1.getInternalApiClient)(options);
287
+ return client.json(`/api/v1/infrastructure/projects/${encodeURIComponent(projectId)}/sync`, {
288
+ cache: 'no-store',
289
+ method: 'POST',
290
+ });
291
+ }
292
+ async function queueInfrastructureProjectDeploy(projectId, options) {
293
+ const client = (0, client_1.getInternalApiClient)(options);
294
+ return client.json(`/api/v1/infrastructure/projects/${encodeURIComponent(projectId)}/deploy`, {
295
+ cache: 'no-store',
296
+ method: 'POST',
297
+ });
298
+ }
299
+ async function requestBlueGreenInstantRollout(options) {
300
+ const client = (0, client_1.getInternalApiClient)(options);
301
+ return client.json('/api/v1/infrastructure/monitoring/blue-green/instant-rollout', {
302
+ cache: 'no-store',
303
+ method: 'POST',
304
+ });
305
+ }
306
+ async function requestBlueGreenDeploymentRevert(payload, options) {
307
+ const client = (0, client_1.getInternalApiClient)(options);
308
+ return client.json('/api/v1/infrastructure/monitoring/blue-green/deployment-revert', {
309
+ body: JSON.stringify(payload),
310
+ cache: 'no-store',
311
+ headers: {
312
+ 'Content-Type': 'application/json',
313
+ },
314
+ method: 'POST',
315
+ });
316
+ }
317
+ async function requestBlueGreenWatcherRecovery(payload, options) {
318
+ const client = (0, client_1.getInternalApiClient)(options);
319
+ return client.json('/api/v1/infrastructure/monitoring/blue-green/watcher-recovery', {
320
+ body: JSON.stringify(payload),
321
+ cache: 'no-store',
322
+ headers: {
323
+ 'Content-Type': 'application/json',
324
+ },
325
+ method: 'POST',
326
+ });
327
+ }
328
+ async function updateBlueGreenDockerRecoverySettings(payload, options) {
329
+ const client = (0, client_1.getInternalApiClient)(options);
330
+ return client.json('/api/v1/infrastructure/monitoring/blue-green/recovery-settings', {
331
+ body: JSON.stringify(payload),
332
+ cache: 'no-store',
333
+ headers: {
334
+ 'Content-Type': 'application/json',
335
+ },
336
+ method: 'PATCH',
337
+ });
338
+ }
339
+ async function pinBlueGreenDeployment(payload, options) {
340
+ const client = (0, client_1.getInternalApiClient)(options);
341
+ return client.json('/api/v1/infrastructure/monitoring/blue-green/deployment-pin', {
342
+ body: JSON.stringify(payload),
343
+ cache: 'no-store',
344
+ headers: {
345
+ 'Content-Type': 'application/json',
346
+ },
347
+ method: 'POST',
348
+ });
349
+ }
350
+ async function clearBlueGreenDeploymentPin(options) {
351
+ const client = (0, client_1.getInternalApiClient)(options);
352
+ return client.json('/api/v1/infrastructure/monitoring/blue-green/deployment-pin', {
353
+ cache: 'no-store',
354
+ method: 'DELETE',
355
+ });
356
+ }
@@ -0,0 +1,55 @@
1
+ import { type InternalApiClientOptions } from '../client';
2
+ export type RealtimeAnalyticsMetric = 'requests' | 'users';
3
+ export type RealtimeAnalyticsViewMode = 'daily' | 'hourly';
4
+ export type RealtimeAnalyticsQuery = {
5
+ channelId?: string;
6
+ endDate: string;
7
+ metric?: RealtimeAnalyticsMetric;
8
+ startDate: string;
9
+ viewMode?: RealtimeAnalyticsViewMode;
10
+ workspaceId?: string;
11
+ };
12
+ export type RealtimeAnalyticsRow = {
13
+ time_bucket: string;
14
+ total_count: number;
15
+ user_id: string | null;
16
+ };
17
+ export type RealtimeAnalyticsResponse = {
18
+ data: RealtimeAnalyticsRow[];
19
+ metric: RealtimeAnalyticsMetric;
20
+ };
21
+ export type RealtimeAnalyticsSummary = {
22
+ avgRequestsPerHour: number;
23
+ errorRate: number;
24
+ peakHour: null | string;
25
+ peakHourCount: number;
26
+ requestsByKind: Record<string, number>;
27
+ totalErrors: number;
28
+ totalRequests: number;
29
+ uniqueChannels: number;
30
+ uniqueUsers: number;
31
+ uniqueWorkspaces: number;
32
+ };
33
+ export type RealtimeConsumer = {
34
+ errorRate: number;
35
+ errors: number;
36
+ id: string;
37
+ name: string;
38
+ requests: number;
39
+ };
40
+ export type RealtimeErrorBreakdown = {
41
+ errorRate: number;
42
+ errors: number;
43
+ kind: string;
44
+ total: number;
45
+ };
46
+ export type RealtimeAnalyticsSummaryResponse = {
47
+ errorBreakdown: RealtimeErrorBreakdown[];
48
+ summary: RealtimeAnalyticsSummary;
49
+ topChannels: RealtimeConsumer[];
50
+ topUsers: RealtimeConsumer[];
51
+ topWorkspaces: RealtimeConsumer[];
52
+ };
53
+ export declare function getWorkspaceRealtimeAnalytics(wsId: string, query: RealtimeAnalyticsQuery, options?: InternalApiClientOptions): Promise<RealtimeAnalyticsResponse>;
54
+ export declare function getWorkspaceRealtimeAnalyticsSummary(wsId: string, query: Omit<RealtimeAnalyticsQuery, 'metric' | 'viewMode'>, options?: InternalApiClientOptions): Promise<RealtimeAnalyticsSummaryResponse>;
55
+ //# sourceMappingURL=realtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime.d.ts","sourceRoot":"","sources":["../../src/infrastructure/realtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAE9B,MAAM,WAAW,CAAC;AAEnB,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG,OAAO,CAAC;AAC3D,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3D,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,oBAAoB,EAAE,CAAC;IAC7B,MAAM,EAAE,uBAAuB,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,cAAc,EAAE,sBAAsB,EAAE,CAAC;IACzC,OAAO,EAAE,wBAAwB,CAAC;IAClC,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,aAAa,EAAE,gBAAgB,EAAE,CAAC;CACnC,CAAC;AAaF,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,sBAAsB,EAC7B,OAAO,CAAC,EAAE,wBAAwB,sCAWnC;AAED,wBAAsB,oCAAoC,CACxD,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,IAAI,CAAC,sBAAsB,EAAE,QAAQ,GAAG,UAAU,CAAC,EAC1D,OAAO,CAAC,EAAE,wBAAwB,6CAWnC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getWorkspaceRealtimeAnalytics = getWorkspaceRealtimeAnalytics;
4
+ exports.getWorkspaceRealtimeAnalyticsSummary = getWorkspaceRealtimeAnalyticsSummary;
5
+ const client_1 = require("../client");
6
+ function realtimeAnalyticsQuery(query) {
7
+ return {
8
+ channelId: query.channelId || undefined,
9
+ endDate: query.endDate,
10
+ metric: query.metric,
11
+ startDate: query.startDate,
12
+ viewMode: query.viewMode,
13
+ workspaceId: query.workspaceId || undefined,
14
+ };
15
+ }
16
+ async function getWorkspaceRealtimeAnalytics(wsId, query, options) {
17
+ const client = (0, client_1.getInternalApiClient)(options);
18
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(wsId)}/infrastructure/realtime/analytics`, {
19
+ cache: 'no-store',
20
+ query: realtimeAnalyticsQuery(query),
21
+ });
22
+ }
23
+ async function getWorkspaceRealtimeAnalyticsSummary(wsId, query, options) {
24
+ const client = (0, client_1.getInternalApiClient)(options);
25
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(wsId)}/infrastructure/realtime/analytics/summary`, {
26
+ cache: 'no-store',
27
+ query: realtimeAnalyticsQuery(query),
28
+ });
29
+ }