@tracearr/shared 2.2.0-beta.2 → 2.2.0-beta.3

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 (84) hide show
  1. package/dist/automations/__tests__/actions.test.d.ts +2 -0
  2. package/dist/automations/__tests__/actions.test.d.ts.map +1 -0
  3. package/dist/automations/__tests__/actions.test.js +68 -0
  4. package/dist/automations/__tests__/actions.test.js.map +1 -0
  5. package/dist/automations/__tests__/conditions.test.d.ts +2 -0
  6. package/dist/automations/__tests__/conditions.test.d.ts.map +1 -0
  7. package/dist/automations/__tests__/conditions.test.js +55 -0
  8. package/dist/automations/__tests__/conditions.test.js.map +1 -0
  9. package/dist/automations/__tests__/definition.test.d.ts +2 -0
  10. package/dist/automations/__tests__/definition.test.d.ts.map +1 -0
  11. package/dist/automations/__tests__/definition.test.js +376 -0
  12. package/dist/automations/__tests__/definition.test.js.map +1 -0
  13. package/dist/automations/__tests__/share.test.d.ts +2 -0
  14. package/dist/automations/__tests__/share.test.d.ts.map +1 -0
  15. package/dist/automations/__tests__/share.test.js +98 -0
  16. package/dist/automations/__tests__/share.test.js.map +1 -0
  17. package/dist/automations/__tests__/templates.test.d.ts +2 -0
  18. package/dist/automations/__tests__/templates.test.d.ts.map +1 -0
  19. package/dist/automations/__tests__/templates.test.js +278 -0
  20. package/dist/automations/__tests__/templates.test.js.map +1 -0
  21. package/dist/automations/__tests__/triggers.test.d.ts +2 -0
  22. package/dist/automations/__tests__/triggers.test.d.ts.map +1 -0
  23. package/dist/automations/__tests__/triggers.test.js +42 -0
  24. package/dist/automations/__tests__/triggers.test.js.map +1 -0
  25. package/dist/automations/actions.d.ts +783 -0
  26. package/dist/automations/actions.d.ts.map +1 -0
  27. package/dist/automations/actions.js +97 -0
  28. package/dist/automations/actions.js.map +1 -0
  29. package/dist/automations/conditions.d.ts +459 -0
  30. package/dist/automations/conditions.d.ts.map +1 -0
  31. package/dist/automations/conditions.js +460 -0
  32. package/dist/automations/conditions.js.map +1 -0
  33. package/dist/automations/definition.d.ts +1389 -0
  34. package/dist/automations/definition.d.ts.map +1 -0
  35. package/dist/automations/definition.js +215 -0
  36. package/dist/automations/definition.js.map +1 -0
  37. package/dist/automations/dryRun.d.ts +413 -0
  38. package/dist/automations/dryRun.d.ts.map +1 -0
  39. package/dist/automations/dryRun.js +9 -0
  40. package/dist/automations/dryRun.js.map +1 -0
  41. package/dist/automations/index.d.ts +8 -0
  42. package/dist/automations/index.d.ts.map +1 -0
  43. package/dist/automations/index.js +8 -0
  44. package/dist/automations/index.js.map +1 -0
  45. package/dist/automations/share.d.ts +27 -0
  46. package/dist/automations/share.d.ts.map +1 -0
  47. package/dist/automations/share.js +119 -0
  48. package/dist/automations/share.js.map +1 -0
  49. package/dist/automations/templates.d.ts +1304 -0
  50. package/dist/automations/templates.d.ts.map +1 -0
  51. package/dist/automations/templates.js +525 -0
  52. package/dist/automations/templates.js.map +1 -0
  53. package/dist/automations/triggers.d.ts +141 -0
  54. package/dist/automations/triggers.d.ts.map +1 -0
  55. package/dist/automations/triggers.js +172 -0
  56. package/dist/automations/triggers.js.map +1 -0
  57. package/dist/constants.d.ts +22 -40
  58. package/dist/constants.d.ts.map +1 -1
  59. package/dist/constants.js +25 -56
  60. package/dist/constants.js.map +1 -1
  61. package/dist/destinations.d.ts +21 -22
  62. package/dist/destinations.d.ts.map +1 -1
  63. package/dist/destinations.js +13 -2
  64. package/dist/destinations.js.map +1 -1
  65. package/dist/index.d.ts +10 -5
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +15 -9
  68. package/dist/index.js.map +1 -1
  69. package/dist/listQuery.d.ts +41 -0
  70. package/dist/listQuery.d.ts.map +1 -0
  71. package/dist/listQuery.js +33 -0
  72. package/dist/listQuery.js.map +1 -0
  73. package/dist/schemas.d.ts +152 -832
  74. package/dist/schemas.d.ts.map +1 -1
  75. package/dist/schemas.js +90 -287
  76. package/dist/schemas.js.map +1 -1
  77. package/dist/types.d.ts +51 -137
  78. package/dist/types.d.ts.map +1 -1
  79. package/dist/types.js.map +1 -1
  80. package/dist/violations.d.ts +2 -1
  81. package/dist/violations.d.ts.map +1 -1
  82. package/dist/violations.js +7 -0
  83. package/dist/violations.js.map +1 -1
  84. package/package.json +2 -1
package/dist/schemas.d.ts CHANGED
@@ -16,12 +16,12 @@ export declare const mediaTypeSchema: z.ZodEnum<{
16
16
  }>;
17
17
  export type MediaType = z.infer<typeof mediaTypeSchema>;
18
18
  export declare const statPeriodSchema: z.ZodEnum<{
19
+ custom: "custom";
19
20
  all: "all";
20
21
  day: "day";
21
22
  week: "week";
22
23
  month: "month";
23
24
  year: "year";
24
- custom: "custom";
25
25
  }>;
26
26
  export type StatPeriod = z.infer<typeof statPeriodSchema>;
27
27
  /**
@@ -53,6 +53,10 @@ export declare const dateValidationRefinements: {
53
53
  export declare const uuidSchema: z.ZodUUID;
54
54
  export declare const serverIdsQuerySchema: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
55
55
  export declare const userIdsQuerySchema: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
56
+ export declare const serverIdFilterSchema: z.ZodObject<{
57
+ serverId: z.ZodOptional<z.ZodUUID>;
58
+ serverIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
59
+ }, z.core.$strip>;
56
60
  export declare const libraryKeySchema: z.ZodString;
57
61
  export declare const paginationSchema: z.ZodObject<{
58
62
  page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -137,6 +141,7 @@ export declare const mergeUserParamSchema: z.ZodObject<{
137
141
  export declare const splitServerUserParamSchema: z.ZodObject<{
138
142
  id: z.ZodUUID;
139
143
  }, z.core.$strip>;
144
+ export declare const USER_SORT_FIELDS: readonly ["username", "trustScore", "joinedAt", "lastActivityAt"];
140
145
  export declare const userSortFieldSchema: z.ZodEnum<{
141
146
  trustScore: "trustScore";
142
147
  username: "username";
@@ -144,6 +149,65 @@ export declare const userSortFieldSchema: z.ZodEnum<{
144
149
  lastActivityAt: "lastActivityAt";
145
150
  }>;
146
151
  export type UserSortField = z.infer<typeof userSortFieldSchema>;
152
+ /**
153
+ * The roster filter set, shared by GET /users and POST /users/bulk/reset-trust.
154
+ *
155
+ * Both endpoints resolve their row set from this one schema, so a bulk action
156
+ * can never reach further than the table showed. Adding a filter to the list
157
+ * query alone is exactly how "Select all 3 users" turns into resetting every
158
+ * account on the server: z.object strips unknown keys, so the bulk endpoint
159
+ * would drop the narrowing filter silently rather than reject it.
160
+ */
161
+ export declare const userRosterFilterSchema: z.ZodObject<{
162
+ serverId: z.ZodOptional<z.ZodUUID>;
163
+ serverIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
164
+ includeRemoved: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>, z.ZodTransform<boolean, string | boolean>>>;
165
+ search: z.ZodOptional<z.ZodString>;
166
+ hasAccessTo: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
167
+ joinedAfter: z.ZodOptional<z.ZodISODate>;
168
+ joinedBefore: z.ZodOptional<z.ZodISODate>;
169
+ activeAfter: z.ZodOptional<z.ZodISODate>;
170
+ activeBefore: z.ZodOptional<z.ZodISODate>;
171
+ }, z.core.$strip>;
172
+ export type UserRosterFilters = z.infer<typeof userRosterFilterSchema>;
173
+ export declare const userListQuerySchema: z.ZodObject<{
174
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
175
+ pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
176
+ serverId: z.ZodOptional<z.ZodUUID>;
177
+ serverIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
178
+ includeRemoved: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>, z.ZodTransform<boolean, string | boolean>>>;
179
+ search: z.ZodOptional<z.ZodString>;
180
+ hasAccessTo: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
181
+ joinedAfter: z.ZodOptional<z.ZodISODate>;
182
+ joinedBefore: z.ZodOptional<z.ZodISODate>;
183
+ activeAfter: z.ZodOptional<z.ZodISODate>;
184
+ activeBefore: z.ZodOptional<z.ZodISODate>;
185
+ orderBy: z.ZodDefault<z.ZodEnum<{
186
+ trustScore: "trustScore";
187
+ username: "username";
188
+ joinedAt: "joinedAt";
189
+ lastActivityAt: "lastActivityAt";
190
+ }>>;
191
+ orderDir: z.ZodOptional<z.ZodEnum<{
192
+ asc: "asc";
193
+ desc: "desc";
194
+ }>>;
195
+ }, z.core.$strip>;
196
+ export declare const bulkResetTrustBodySchema: z.ZodObject<{
197
+ ids: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
198
+ selectAll: z.ZodOptional<z.ZodBoolean>;
199
+ filters: z.ZodOptional<z.ZodObject<{
200
+ serverId: z.ZodOptional<z.ZodUUID>;
201
+ serverIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
202
+ includeRemoved: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>, z.ZodTransform<boolean, string | boolean>>>;
203
+ search: z.ZodOptional<z.ZodString>;
204
+ hasAccessTo: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
205
+ joinedAfter: z.ZodOptional<z.ZodISODate>;
206
+ joinedBefore: z.ZodOptional<z.ZodISODate>;
207
+ activeAfter: z.ZodOptional<z.ZodISODate>;
208
+ activeBefore: z.ZodOptional<z.ZodISODate>;
209
+ }, z.core.$strip>>;
210
+ }, z.core.$strip>;
147
211
  export declare const sessionQuerySchema: z.ZodObject<{
148
212
  page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
149
213
  pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -200,6 +264,8 @@ export declare const historyQuerySchema: z.ZodObject<{
200
264
  }>>;
201
265
  }, z.core.$strip>;
202
266
  export declare const historyAggregatesQuerySchema: z.ZodObject<{
267
+ search: z.ZodOptional<z.ZodString>;
268
+ serverIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
203
269
  serverId: z.ZodOptional<z.ZodUUID>;
204
270
  state: z.ZodOptional<z.ZodEnum<{
205
271
  playing: "playing";
@@ -208,8 +274,6 @@ export declare const historyAggregatesQuerySchema: z.ZodObject<{
208
274
  }>>;
209
275
  startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
210
276
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
211
- serverIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
212
- search: z.ZodOptional<z.ZodString>;
213
277
  serverUserIds: z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>>, z.ZodTransform<unknown[] | undefined, string[] | unknown[] | undefined>>;
214
278
  mediaTypes: z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>>, z.ZodTransform<unknown[] | undefined, string[] | unknown[] | undefined>>;
215
279
  platforms: z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>>, z.ZodTransform<unknown[] | undefined, string[] | unknown[] | undefined>>;
@@ -266,530 +330,10 @@ export declare const accountInactivityParamsSchema: z.ZodObject<{
266
330
  months: "months";
267
331
  }>>;
268
332
  }, z.core.$strip>;
269
- export declare const ruleParamsSchema: z.ZodUnion<readonly [z.ZodObject<{
270
- maxSpeedKmh: z.ZodDefault<z.ZodNumber>;
271
- ignoreVpnRanges: z.ZodOptional<z.ZodBoolean>;
272
- }, z.core.$strip>, z.ZodObject<{
273
- minDistanceKm: z.ZodDefault<z.ZodNumber>;
274
- }, z.core.$strip>, z.ZodObject<{
275
- maxIps: z.ZodDefault<z.ZodNumber>;
276
- windowHours: z.ZodDefault<z.ZodNumber>;
277
- }, z.core.$strip>, z.ZodObject<{
278
- maxStreams: z.ZodDefault<z.ZodNumber>;
279
- }, z.core.$strip>, z.ZodObject<{
280
- mode: z.ZodDefault<z.ZodEnum<{
281
- blocklist: "blocklist";
282
- allowlist: "allowlist";
283
- }>>;
284
- countries: z.ZodDefault<z.ZodArray<z.ZodString>>;
285
- }, z.core.$strip>, z.ZodObject<{
286
- inactivityValue: z.ZodDefault<z.ZodNumber>;
287
- inactivityUnit: z.ZodDefault<z.ZodEnum<{
288
- days: "days";
289
- weeks: "weeks";
290
- months: "months";
291
- }>>;
292
- }, z.core.$strip>]>;
293
- export declare const createRuleSchema: z.ZodObject<{
294
- name: z.ZodString;
295
- type: z.ZodEnum<{
296
- concurrent_streams: "concurrent_streams";
297
- impossible_travel: "impossible_travel";
298
- simultaneous_locations: "simultaneous_locations";
299
- device_velocity: "device_velocity";
300
- geo_restriction: "geo_restriction";
301
- account_inactivity: "account_inactivity";
302
- }>;
303
- params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
304
- serverUserId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
305
- isActive: z.ZodDefault<z.ZodBoolean>;
306
- }, z.core.$strip>;
307
- export declare const updateRuleSchema: z.ZodObject<{
308
- name: z.ZodOptional<z.ZodString>;
309
- params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
310
- isActive: z.ZodOptional<z.ZodBoolean>;
311
- }, z.core.$strip>;
312
- export declare const ruleIdParamSchema: z.ZodObject<{
313
- id: z.ZodUUID;
314
- }, z.core.$strip>;
315
- export declare const comparisonOperatorSchema: z.ZodEnum<{
316
- eq: "eq";
317
- neq: "neq";
318
- gt: "gt";
319
- gte: "gte";
320
- lt: "lt";
321
- lte: "lte";
322
- }>;
323
- export declare const arrayOperatorSchema: z.ZodEnum<{
324
- in: "in";
325
- not_in: "not_in";
326
- }>;
327
- export declare const stringOperatorSchema: z.ZodEnum<{
328
- contains: "contains";
329
- not_contains: "not_contains";
330
- }>;
331
- export declare const operatorSchema: z.ZodUnion<readonly [z.ZodEnum<{
332
- eq: "eq";
333
- neq: "neq";
334
- gt: "gt";
335
- gte: "gte";
336
- lt: "lt";
337
- lte: "lte";
338
- }>, z.ZodEnum<{
339
- in: "in";
340
- not_in: "not_in";
341
- }>, z.ZodEnum<{
342
- contains: "contains";
343
- not_contains: "not_contains";
344
- }>]>;
345
- export declare const sessionBehaviorFieldSchema: z.ZodEnum<{
346
- concurrent_streams: "concurrent_streams";
347
- active_session_distance_km: "active_session_distance_km";
348
- travel_speed_kmh: "travel_speed_kmh";
349
- unique_ips_in_window: "unique_ips_in_window";
350
- unique_devices_in_window: "unique_devices_in_window";
351
- inactive_days: "inactive_days";
352
- current_pause_minutes: "current_pause_minutes";
353
- total_pause_minutes: "total_pause_minutes";
354
- }>;
355
- export declare const streamQualityFieldSchema: z.ZodEnum<{
356
- source_resolution: "source_resolution";
357
- output_resolution: "output_resolution";
358
- is_transcoding: "is_transcoding";
359
- is_transcode_downgrade: "is_transcode_downgrade";
360
- source_bitrate_mbps: "source_bitrate_mbps";
361
- }>;
362
- export declare const transcodingConditionValueSchema: z.ZodEnum<{
363
- video: "video";
364
- audio: "audio";
365
- video_or_audio: "video_or_audio";
366
- neither: "neither";
367
- }>;
368
- export declare const userAttributeFieldSchema: z.ZodEnum<{
369
- user_id: "user_id";
370
- trust_score: "trust_score";
371
- account_age_days: "account_age_days";
372
- }>;
373
- export declare const deviceClientFieldSchema: z.ZodEnum<{
374
- device_type: "device_type";
375
- client_name: "client_name";
376
- platform: "platform";
377
- }>;
378
- export declare const networkLocationFieldSchema: z.ZodEnum<{
379
- is_local_network: "is_local_network";
380
- country: "country";
381
- ip_in_range: "ip_in_range";
382
- }>;
383
- export declare const scopeFieldSchema: z.ZodEnum<{
384
- server_id: "server_id";
385
- media_type: "media_type";
386
- }>;
387
- export declare const conditionFieldSchema: z.ZodUnion<readonly [z.ZodEnum<{
388
- concurrent_streams: "concurrent_streams";
389
- active_session_distance_km: "active_session_distance_km";
390
- travel_speed_kmh: "travel_speed_kmh";
391
- unique_ips_in_window: "unique_ips_in_window";
392
- unique_devices_in_window: "unique_devices_in_window";
393
- inactive_days: "inactive_days";
394
- current_pause_minutes: "current_pause_minutes";
395
- total_pause_minutes: "total_pause_minutes";
396
- }>, z.ZodEnum<{
397
- source_resolution: "source_resolution";
398
- output_resolution: "output_resolution";
399
- is_transcoding: "is_transcoding";
400
- is_transcode_downgrade: "is_transcode_downgrade";
401
- source_bitrate_mbps: "source_bitrate_mbps";
402
- }>, z.ZodEnum<{
403
- user_id: "user_id";
404
- trust_score: "trust_score";
405
- account_age_days: "account_age_days";
406
- }>, z.ZodEnum<{
407
- device_type: "device_type";
408
- client_name: "client_name";
409
- platform: "platform";
410
- }>, z.ZodEnum<{
411
- is_local_network: "is_local_network";
412
- country: "country";
413
- ip_in_range: "ip_in_range";
414
- }>, z.ZodEnum<{
415
- server_id: "server_id";
416
- media_type: "media_type";
417
- }>]>;
418
- export declare const videoResolutionSchema: z.ZodEnum<{
419
- "4K": "4K";
420
- "1080p": "1080p";
421
- "720p": "720p";
422
- "480p": "480p";
423
- SD: "SD";
424
- unknown: "unknown";
425
- }>;
426
- export declare const deviceTypeSchema: z.ZodEnum<{
427
- unknown: "unknown";
428
- mobile: "mobile";
429
- tablet: "tablet";
430
- tv: "tv";
431
- desktop: "desktop";
432
- browser: "browser";
433
- }>;
434
- export declare const platformSchema: z.ZodEnum<{
435
- unknown: "unknown";
436
- ios: "ios";
437
- android: "android";
438
- windows: "windows";
439
- macos: "macos";
440
- linux: "linux";
441
- tvos: "tvos";
442
- androidtv: "androidtv";
443
- roku: "roku";
444
- webos: "webos";
445
- tizen: "tizen";
446
- }>;
447
- export declare const mediaTypeEnumSchema: z.ZodEnum<{
448
- movie: "movie";
449
- episode: "episode";
450
- track: "track";
451
- live: "live";
452
- photo: "photo";
453
- trailer: "trailer";
454
- }>;
455
- export declare const conditionValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>]>;
456
- export declare const conditionSchema: z.ZodObject<{
457
- field: z.ZodUnion<readonly [z.ZodEnum<{
458
- concurrent_streams: "concurrent_streams";
459
- active_session_distance_km: "active_session_distance_km";
460
- travel_speed_kmh: "travel_speed_kmh";
461
- unique_ips_in_window: "unique_ips_in_window";
462
- unique_devices_in_window: "unique_devices_in_window";
463
- inactive_days: "inactive_days";
464
- current_pause_minutes: "current_pause_minutes";
465
- total_pause_minutes: "total_pause_minutes";
466
- }>, z.ZodEnum<{
467
- source_resolution: "source_resolution";
468
- output_resolution: "output_resolution";
469
- is_transcoding: "is_transcoding";
470
- is_transcode_downgrade: "is_transcode_downgrade";
471
- source_bitrate_mbps: "source_bitrate_mbps";
472
- }>, z.ZodEnum<{
473
- user_id: "user_id";
474
- trust_score: "trust_score";
475
- account_age_days: "account_age_days";
476
- }>, z.ZodEnum<{
477
- device_type: "device_type";
478
- client_name: "client_name";
479
- platform: "platform";
480
- }>, z.ZodEnum<{
481
- is_local_network: "is_local_network";
482
- country: "country";
483
- ip_in_range: "ip_in_range";
484
- }>, z.ZodEnum<{
485
- server_id: "server_id";
486
- media_type: "media_type";
487
- }>]>;
488
- operator: z.ZodUnion<readonly [z.ZodEnum<{
489
- eq: "eq";
490
- neq: "neq";
491
- gt: "gt";
492
- gte: "gte";
493
- lt: "lt";
494
- lte: "lte";
495
- }>, z.ZodEnum<{
496
- in: "in";
497
- not_in: "not_in";
498
- }>, z.ZodEnum<{
499
- contains: "contains";
500
- not_contains: "not_contains";
501
- }>]>;
502
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>]>;
503
- params: z.ZodOptional<z.ZodObject<{
504
- window_hours: z.ZodOptional<z.ZodNumber>;
505
- exclude_same_device: z.ZodOptional<z.ZodBoolean>;
506
- exclude_same_ip: z.ZodOptional<z.ZodBoolean>;
507
- count_device_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
508
- unknown: "unknown";
509
- mobile: "mobile";
510
- tablet: "tablet";
511
- tv: "tv";
512
- desktop: "desktop";
513
- browser: "browser";
514
- }>>>;
515
- }, z.core.$strip>>;
516
- }, z.core.$strip>;
517
- export declare const conditionGroupSchema: z.ZodObject<{
518
- conditions: z.ZodArray<z.ZodObject<{
519
- field: z.ZodUnion<readonly [z.ZodEnum<{
520
- concurrent_streams: "concurrent_streams";
521
- active_session_distance_km: "active_session_distance_km";
522
- travel_speed_kmh: "travel_speed_kmh";
523
- unique_ips_in_window: "unique_ips_in_window";
524
- unique_devices_in_window: "unique_devices_in_window";
525
- inactive_days: "inactive_days";
526
- current_pause_minutes: "current_pause_minutes";
527
- total_pause_minutes: "total_pause_minutes";
528
- }>, z.ZodEnum<{
529
- source_resolution: "source_resolution";
530
- output_resolution: "output_resolution";
531
- is_transcoding: "is_transcoding";
532
- is_transcode_downgrade: "is_transcode_downgrade";
533
- source_bitrate_mbps: "source_bitrate_mbps";
534
- }>, z.ZodEnum<{
535
- user_id: "user_id";
536
- trust_score: "trust_score";
537
- account_age_days: "account_age_days";
538
- }>, z.ZodEnum<{
539
- device_type: "device_type";
540
- client_name: "client_name";
541
- platform: "platform";
542
- }>, z.ZodEnum<{
543
- is_local_network: "is_local_network";
544
- country: "country";
545
- ip_in_range: "ip_in_range";
546
- }>, z.ZodEnum<{
547
- server_id: "server_id";
548
- media_type: "media_type";
549
- }>]>;
550
- operator: z.ZodUnion<readonly [z.ZodEnum<{
551
- eq: "eq";
552
- neq: "neq";
553
- gt: "gt";
554
- gte: "gte";
555
- lt: "lt";
556
- lte: "lte";
557
- }>, z.ZodEnum<{
558
- in: "in";
559
- not_in: "not_in";
560
- }>, z.ZodEnum<{
561
- contains: "contains";
562
- not_contains: "not_contains";
563
- }>]>;
564
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>]>;
565
- params: z.ZodOptional<z.ZodObject<{
566
- window_hours: z.ZodOptional<z.ZodNumber>;
567
- exclude_same_device: z.ZodOptional<z.ZodBoolean>;
568
- exclude_same_ip: z.ZodOptional<z.ZodBoolean>;
569
- count_device_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
570
- unknown: "unknown";
571
- mobile: "mobile";
572
- tablet: "tablet";
573
- tv: "tv";
574
- desktop: "desktop";
575
- browser: "browser";
576
- }>>>;
577
- }, z.core.$strip>>;
578
- }, z.core.$strip>>;
579
- }, z.core.$strip>;
580
- /**
581
- * Condition fields evaluable for a dormant account outside a playback
582
- * session. Rules containing inactive_days run in the hourly inactivity
583
- * worker, where no session exists, so they may only use these fields.
584
- */
585
- export declare const INACTIVITY_COMPATIBLE_FIELDS: readonly ["inactive_days", "server_id", "user_id", "trust_score", "account_age_days"];
586
- export declare const ruleConditionsSchema: z.ZodObject<{
587
- groups: z.ZodArray<z.ZodObject<{
588
- conditions: z.ZodArray<z.ZodObject<{
589
- field: z.ZodUnion<readonly [z.ZodEnum<{
590
- concurrent_streams: "concurrent_streams";
591
- active_session_distance_km: "active_session_distance_km";
592
- travel_speed_kmh: "travel_speed_kmh";
593
- unique_ips_in_window: "unique_ips_in_window";
594
- unique_devices_in_window: "unique_devices_in_window";
595
- inactive_days: "inactive_days";
596
- current_pause_minutes: "current_pause_minutes";
597
- total_pause_minutes: "total_pause_minutes";
598
- }>, z.ZodEnum<{
599
- source_resolution: "source_resolution";
600
- output_resolution: "output_resolution";
601
- is_transcoding: "is_transcoding";
602
- is_transcode_downgrade: "is_transcode_downgrade";
603
- source_bitrate_mbps: "source_bitrate_mbps";
604
- }>, z.ZodEnum<{
605
- user_id: "user_id";
606
- trust_score: "trust_score";
607
- account_age_days: "account_age_days";
608
- }>, z.ZodEnum<{
609
- device_type: "device_type";
610
- client_name: "client_name";
611
- platform: "platform";
612
- }>, z.ZodEnum<{
613
- is_local_network: "is_local_network";
614
- country: "country";
615
- ip_in_range: "ip_in_range";
616
- }>, z.ZodEnum<{
617
- server_id: "server_id";
618
- media_type: "media_type";
619
- }>]>;
620
- operator: z.ZodUnion<readonly [z.ZodEnum<{
621
- eq: "eq";
622
- neq: "neq";
623
- gt: "gt";
624
- gte: "gte";
625
- lt: "lt";
626
- lte: "lte";
627
- }>, z.ZodEnum<{
628
- in: "in";
629
- not_in: "not_in";
630
- }>, z.ZodEnum<{
631
- contains: "contains";
632
- not_contains: "not_contains";
633
- }>]>;
634
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>]>;
635
- params: z.ZodOptional<z.ZodObject<{
636
- window_hours: z.ZodOptional<z.ZodNumber>;
637
- exclude_same_device: z.ZodOptional<z.ZodBoolean>;
638
- exclude_same_ip: z.ZodOptional<z.ZodBoolean>;
639
- count_device_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
640
- unknown: "unknown";
641
- mobile: "mobile";
642
- tablet: "tablet";
643
- tv: "tv";
644
- desktop: "desktop";
645
- browser: "browser";
646
- }>>>;
647
- }, z.core.$strip>>;
648
- }, z.core.$strip>>;
649
- }, z.core.$strip>>;
650
- }, z.core.$strip>;
651
- export declare const actionTypeSchema: z.ZodEnum<{
652
- log_only: "log_only";
653
- send: "send";
654
- adjust_trust: "adjust_trust";
655
- set_trust: "set_trust";
656
- reset_trust: "reset_trust";
657
- kill_stream: "kill_stream";
658
- message_client: "message_client";
659
- }>;
660
- export declare const logOnlyActionSchema: z.ZodObject<{
661
- type: z.ZodLiteral<"log_only">;
662
- message: z.ZodOptional<z.ZodString>;
663
- }, z.core.$strip>;
664
- export declare const sendActionSchema: z.ZodObject<{
665
- type: z.ZodLiteral<"send">;
666
- to: z.ZodArray<z.ZodUUID>;
667
- cooldown_minutes: z.ZodOptional<z.ZodNumber>;
668
- }, z.core.$strip>;
669
- export declare const adjustTrustActionSchema: z.ZodObject<{
670
- type: z.ZodLiteral<"adjust_trust">;
671
- amount: z.ZodNumber;
672
- }, z.core.$strip>;
673
- export declare const setTrustActionSchema: z.ZodObject<{
674
- type: z.ZodLiteral<"set_trust">;
675
- value: z.ZodNumber;
676
- }, z.core.$strip>;
677
- export declare const resetTrustActionSchema: z.ZodObject<{
678
- type: z.ZodLiteral<"reset_trust">;
679
- }, z.core.$strip>;
680
- export declare const sessionTargetSchema: z.ZodEnum<{
681
- triggering: "triggering";
682
- oldest: "oldest";
683
- newest: "newest";
684
- all_except_one: "all_except_one";
685
- all_user: "all_user";
686
- }>;
687
- export type SessionTarget = z.infer<typeof sessionTargetSchema>;
688
- export declare const killStreamActionSchema: z.ZodObject<{
689
- type: z.ZodLiteral<"kill_stream">;
690
- delay_seconds: z.ZodOptional<z.ZodNumber>;
691
- require_confirmation: z.ZodOptional<z.ZodBoolean>;
692
- cooldown_minutes: z.ZodOptional<z.ZodNumber>;
693
- message: z.ZodOptional<z.ZodString>;
694
- target: z.ZodOptional<z.ZodEnum<{
695
- triggering: "triggering";
696
- oldest: "oldest";
697
- newest: "newest";
698
- all_except_one: "all_except_one";
699
- all_user: "all_user";
700
- }>>;
701
- }, z.core.$strip>;
702
- export declare const messageClientActionSchema: z.ZodObject<{
703
- type: z.ZodLiteral<"message_client">;
704
- message: z.ZodString;
705
- target: z.ZodOptional<z.ZodEnum<{
706
- triggering: "triggering";
707
- oldest: "oldest";
708
- newest: "newest";
709
- all_except_one: "all_except_one";
710
- all_user: "all_user";
711
- }>>;
712
- }, z.core.$strip>;
713
- export declare const actionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
714
- type: z.ZodLiteral<"log_only">;
715
- message: z.ZodOptional<z.ZodString>;
716
- }, z.core.$strip>, z.ZodObject<{
717
- type: z.ZodLiteral<"send">;
718
- to: z.ZodArray<z.ZodUUID>;
719
- cooldown_minutes: z.ZodOptional<z.ZodNumber>;
720
- }, z.core.$strip>, z.ZodObject<{
721
- type: z.ZodLiteral<"adjust_trust">;
722
- amount: z.ZodNumber;
723
- }, z.core.$strip>, z.ZodObject<{
724
- type: z.ZodLiteral<"set_trust">;
725
- value: z.ZodNumber;
726
- }, z.core.$strip>, z.ZodObject<{
727
- type: z.ZodLiteral<"reset_trust">;
728
- }, z.core.$strip>, z.ZodObject<{
729
- type: z.ZodLiteral<"kill_stream">;
730
- delay_seconds: z.ZodOptional<z.ZodNumber>;
731
- require_confirmation: z.ZodOptional<z.ZodBoolean>;
732
- cooldown_minutes: z.ZodOptional<z.ZodNumber>;
733
- message: z.ZodOptional<z.ZodString>;
734
- target: z.ZodOptional<z.ZodEnum<{
735
- triggering: "triggering";
736
- oldest: "oldest";
737
- newest: "newest";
738
- all_except_one: "all_except_one";
739
- all_user: "all_user";
740
- }>>;
741
- }, z.core.$strip>, z.ZodObject<{
742
- type: z.ZodLiteral<"message_client">;
743
- message: z.ZodString;
744
- target: z.ZodOptional<z.ZodEnum<{
745
- triggering: "triggering";
746
- oldest: "oldest";
747
- newest: "newest";
748
- all_except_one: "all_except_one";
749
- all_user: "all_user";
750
- }>>;
751
- }, z.core.$strip>], "type">;
752
- export declare const ruleActionsSchema: z.ZodObject<{
753
- actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
754
- type: z.ZodLiteral<"log_only">;
755
- message: z.ZodOptional<z.ZodString>;
756
- }, z.core.$strip>, z.ZodObject<{
757
- type: z.ZodLiteral<"send">;
758
- to: z.ZodArray<z.ZodUUID>;
759
- cooldown_minutes: z.ZodOptional<z.ZodNumber>;
760
- }, z.core.$strip>, z.ZodObject<{
761
- type: z.ZodLiteral<"adjust_trust">;
762
- amount: z.ZodNumber;
763
- }, z.core.$strip>, z.ZodObject<{
764
- type: z.ZodLiteral<"set_trust">;
765
- value: z.ZodNumber;
766
- }, z.core.$strip>, z.ZodObject<{
767
- type: z.ZodLiteral<"reset_trust">;
768
- }, z.core.$strip>, z.ZodObject<{
769
- type: z.ZodLiteral<"kill_stream">;
770
- delay_seconds: z.ZodOptional<z.ZodNumber>;
771
- require_confirmation: z.ZodOptional<z.ZodBoolean>;
772
- cooldown_minutes: z.ZodOptional<z.ZodNumber>;
773
- message: z.ZodOptional<z.ZodString>;
774
- target: z.ZodOptional<z.ZodEnum<{
775
- triggering: "triggering";
776
- oldest: "oldest";
777
- newest: "newest";
778
- all_except_one: "all_except_one";
779
- all_user: "all_user";
780
- }>>;
781
- }, z.core.$strip>, z.ZodObject<{
782
- type: z.ZodLiteral<"message_client">;
783
- message: z.ZodString;
784
- target: z.ZodOptional<z.ZodEnum<{
785
- triggering: "triggering";
786
- oldest: "oldest";
787
- newest: "newest";
788
- all_except_one: "all_except_one";
789
- all_user: "all_user";
790
- }>>;
791
- }, z.core.$strip>], "type">>;
792
- }, z.core.$strip>;
333
+ export { comparisonOperatorSchema, arrayOperatorSchema, stringOperatorSchema, operatorSchema, sessionBehaviorFieldSchema, streamQualityFieldSchema, transcodingConditionValueSchema, userAttributeFieldSchema, deviceClientFieldSchema, networkLocationFieldSchema, scopeFieldSchema, conditionFieldSchema, videoResolutionSchema, deviceTypeSchema, platformSchema, mediaTypeEnumSchema, conditionValueSchema, conditionSchema, conditionGroupSchema, automationConditionsSchema, } from './automations/conditions.js';
334
+ export type { ComparisonOperator, ArrayOperator, StringOperator, Operator, SessionBehaviorField, StreamQualityField, UserAttributeField, DeviceClientField, NetworkLocationField, ScopeField, ConditionField, VideoResolution, DeviceType, Platform, MediaTypeEnum, ConditionValue, Condition, ConditionGroup, AutomationConditions, } from './automations/conditions.js';
335
+ export { sendActionSchema, trustActionSchema, sessionTargetSchema, killStreamActionSchema, messageClientActionSchema, actionSchema, actionTypeSchema, automationActionsSchema, } from './automations/actions.js';
336
+ export type { SessionTarget, ActionType, SendAction, TrustAction, KillStreamAction, MessageClientAction, Action, AutomationActions, } from './automations/actions.js';
793
337
  export declare const violationSeveritySchema: z.ZodEnum<{
794
338
  low: "low";
795
339
  warning: "warning";
@@ -800,269 +344,61 @@ export declare function hasAtMostOneScope(data: {
800
344
  serverUserId?: string | null;
801
345
  userId?: string | null;
802
346
  }): boolean;
803
- export declare const RULE_SCOPE_ERROR_MESSAGE = "A rule can only be scoped to one of server, account, or person";
347
+ export declare const AUTOMATION_SCOPE_ERROR_MESSAGE = "An automation can only be scoped to one of server, account, or person";
348
+ export declare const scopeRefinement: {
349
+ readonly message: "An automation can only be scoped to one of server, account, or person";
350
+ };
804
351
  export declare function scopeAllowsCrossServerEnforcement(data: {
805
352
  serverId?: string | null;
806
353
  enforceAcrossServers?: boolean;
807
354
  }): boolean;
808
- export declare const RULE_CROSS_SERVER_ENFORCEMENT_ERROR_MESSAGE = "A server-scoped rule cannot enforce actions across all servers";
809
- export declare const createRuleV2Schema: z.ZodObject<{
810
- name: z.ZodString;
811
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
812
- serverId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
813
- serverUserId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
814
- userId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
815
- enforceAcrossServers: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
816
- isActive: z.ZodDefault<z.ZodBoolean>;
817
- severity: z.ZodDefault<z.ZodEnum<{
818
- low: "low";
819
- warning: "warning";
820
- high: "high";
821
- }>>;
822
- conditions: z.ZodObject<{
823
- groups: z.ZodArray<z.ZodObject<{
824
- conditions: z.ZodArray<z.ZodObject<{
825
- field: z.ZodUnion<readonly [z.ZodEnum<{
826
- concurrent_streams: "concurrent_streams";
827
- active_session_distance_km: "active_session_distance_km";
828
- travel_speed_kmh: "travel_speed_kmh";
829
- unique_ips_in_window: "unique_ips_in_window";
830
- unique_devices_in_window: "unique_devices_in_window";
831
- inactive_days: "inactive_days";
832
- current_pause_minutes: "current_pause_minutes";
833
- total_pause_minutes: "total_pause_minutes";
834
- }>, z.ZodEnum<{
835
- source_resolution: "source_resolution";
836
- output_resolution: "output_resolution";
837
- is_transcoding: "is_transcoding";
838
- is_transcode_downgrade: "is_transcode_downgrade";
839
- source_bitrate_mbps: "source_bitrate_mbps";
840
- }>, z.ZodEnum<{
841
- user_id: "user_id";
842
- trust_score: "trust_score";
843
- account_age_days: "account_age_days";
844
- }>, z.ZodEnum<{
845
- device_type: "device_type";
846
- client_name: "client_name";
847
- platform: "platform";
848
- }>, z.ZodEnum<{
849
- is_local_network: "is_local_network";
850
- country: "country";
851
- ip_in_range: "ip_in_range";
852
- }>, z.ZodEnum<{
853
- server_id: "server_id";
854
- media_type: "media_type";
855
- }>]>;
856
- operator: z.ZodUnion<readonly [z.ZodEnum<{
857
- eq: "eq";
858
- neq: "neq";
859
- gt: "gt";
860
- gte: "gte";
861
- lt: "lt";
862
- lte: "lte";
863
- }>, z.ZodEnum<{
864
- in: "in";
865
- not_in: "not_in";
866
- }>, z.ZodEnum<{
867
- contains: "contains";
868
- not_contains: "not_contains";
869
- }>]>;
870
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>]>;
871
- params: z.ZodOptional<z.ZodObject<{
872
- window_hours: z.ZodOptional<z.ZodNumber>;
873
- exclude_same_device: z.ZodOptional<z.ZodBoolean>;
874
- exclude_same_ip: z.ZodOptional<z.ZodBoolean>;
875
- count_device_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
876
- unknown: "unknown";
877
- mobile: "mobile";
878
- tablet: "tablet";
879
- tv: "tv";
880
- desktop: "desktop";
881
- browser: "browser";
882
- }>>>;
883
- }, z.core.$strip>>;
884
- }, z.core.$strip>>;
885
- }, z.core.$strip>>;
886
- }, z.core.$strip>;
887
- actions: z.ZodObject<{
888
- actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
889
- type: z.ZodLiteral<"log_only">;
890
- message: z.ZodOptional<z.ZodString>;
891
- }, z.core.$strip>, z.ZodObject<{
892
- type: z.ZodLiteral<"send">;
893
- to: z.ZodArray<z.ZodUUID>;
894
- cooldown_minutes: z.ZodOptional<z.ZodNumber>;
895
- }, z.core.$strip>, z.ZodObject<{
896
- type: z.ZodLiteral<"adjust_trust">;
897
- amount: z.ZodNumber;
898
- }, z.core.$strip>, z.ZodObject<{
899
- type: z.ZodLiteral<"set_trust">;
900
- value: z.ZodNumber;
901
- }, z.core.$strip>, z.ZodObject<{
902
- type: z.ZodLiteral<"reset_trust">;
903
- }, z.core.$strip>, z.ZodObject<{
904
- type: z.ZodLiteral<"kill_stream">;
905
- delay_seconds: z.ZodOptional<z.ZodNumber>;
906
- require_confirmation: z.ZodOptional<z.ZodBoolean>;
907
- cooldown_minutes: z.ZodOptional<z.ZodNumber>;
908
- message: z.ZodOptional<z.ZodString>;
909
- target: z.ZodOptional<z.ZodEnum<{
910
- triggering: "triggering";
911
- oldest: "oldest";
912
- newest: "newest";
913
- all_except_one: "all_except_one";
914
- all_user: "all_user";
915
- }>>;
916
- }, z.core.$strip>, z.ZodObject<{
917
- type: z.ZodLiteral<"message_client">;
918
- message: z.ZodString;
919
- target: z.ZodOptional<z.ZodEnum<{
920
- triggering: "triggering";
921
- oldest: "oldest";
922
- newest: "newest";
923
- all_except_one: "all_except_one";
924
- all_user: "all_user";
925
- }>>;
926
- }, z.core.$strip>], "type">>;
927
- }, z.core.$strip>;
928
- }, z.core.$strip>;
929
- export declare const updateRuleV2Schema: z.ZodObject<{
930
- name: z.ZodOptional<z.ZodString>;
931
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
932
- serverId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
933
- serverUserId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
934
- userId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
935
- enforceAcrossServers: z.ZodOptional<z.ZodBoolean>;
936
- isActive: z.ZodOptional<z.ZodBoolean>;
937
- severity: z.ZodOptional<z.ZodEnum<{
938
- low: "low";
939
- warning: "warning";
940
- high: "high";
941
- }>>;
942
- conditions: z.ZodOptional<z.ZodObject<{
943
- groups: z.ZodArray<z.ZodObject<{
944
- conditions: z.ZodArray<z.ZodObject<{
945
- field: z.ZodUnion<readonly [z.ZodEnum<{
946
- concurrent_streams: "concurrent_streams";
947
- active_session_distance_km: "active_session_distance_km";
948
- travel_speed_kmh: "travel_speed_kmh";
949
- unique_ips_in_window: "unique_ips_in_window";
950
- unique_devices_in_window: "unique_devices_in_window";
951
- inactive_days: "inactive_days";
952
- current_pause_minutes: "current_pause_minutes";
953
- total_pause_minutes: "total_pause_minutes";
954
- }>, z.ZodEnum<{
955
- source_resolution: "source_resolution";
956
- output_resolution: "output_resolution";
957
- is_transcoding: "is_transcoding";
958
- is_transcode_downgrade: "is_transcode_downgrade";
959
- source_bitrate_mbps: "source_bitrate_mbps";
960
- }>, z.ZodEnum<{
961
- user_id: "user_id";
962
- trust_score: "trust_score";
963
- account_age_days: "account_age_days";
964
- }>, z.ZodEnum<{
965
- device_type: "device_type";
966
- client_name: "client_name";
967
- platform: "platform";
968
- }>, z.ZodEnum<{
969
- is_local_network: "is_local_network";
970
- country: "country";
971
- ip_in_range: "ip_in_range";
972
- }>, z.ZodEnum<{
973
- server_id: "server_id";
974
- media_type: "media_type";
975
- }>]>;
976
- operator: z.ZodUnion<readonly [z.ZodEnum<{
977
- eq: "eq";
978
- neq: "neq";
979
- gt: "gt";
980
- gte: "gte";
981
- lt: "lt";
982
- lte: "lte";
983
- }>, z.ZodEnum<{
984
- in: "in";
985
- not_in: "not_in";
986
- }>, z.ZodEnum<{
987
- contains: "contains";
988
- not_contains: "not_contains";
989
- }>]>;
990
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>]>;
991
- params: z.ZodOptional<z.ZodObject<{
992
- window_hours: z.ZodOptional<z.ZodNumber>;
993
- exclude_same_device: z.ZodOptional<z.ZodBoolean>;
994
- exclude_same_ip: z.ZodOptional<z.ZodBoolean>;
995
- count_device_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
996
- unknown: "unknown";
997
- mobile: "mobile";
998
- tablet: "tablet";
999
- tv: "tv";
1000
- desktop: "desktop";
1001
- browser: "browser";
1002
- }>>>;
1003
- }, z.core.$strip>>;
1004
- }, z.core.$strip>>;
1005
- }, z.core.$strip>>;
1006
- }, z.core.$strip>>;
1007
- actions: z.ZodOptional<z.ZodObject<{
1008
- actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1009
- type: z.ZodLiteral<"log_only">;
1010
- message: z.ZodOptional<z.ZodString>;
1011
- }, z.core.$strip>, z.ZodObject<{
1012
- type: z.ZodLiteral<"send">;
1013
- to: z.ZodArray<z.ZodUUID>;
1014
- cooldown_minutes: z.ZodOptional<z.ZodNumber>;
1015
- }, z.core.$strip>, z.ZodObject<{
1016
- type: z.ZodLiteral<"adjust_trust">;
1017
- amount: z.ZodNumber;
1018
- }, z.core.$strip>, z.ZodObject<{
1019
- type: z.ZodLiteral<"set_trust">;
1020
- value: z.ZodNumber;
1021
- }, z.core.$strip>, z.ZodObject<{
1022
- type: z.ZodLiteral<"reset_trust">;
1023
- }, z.core.$strip>, z.ZodObject<{
1024
- type: z.ZodLiteral<"kill_stream">;
1025
- delay_seconds: z.ZodOptional<z.ZodNumber>;
1026
- require_confirmation: z.ZodOptional<z.ZodBoolean>;
1027
- cooldown_minutes: z.ZodOptional<z.ZodNumber>;
1028
- message: z.ZodOptional<z.ZodString>;
1029
- target: z.ZodOptional<z.ZodEnum<{
1030
- triggering: "triggering";
1031
- oldest: "oldest";
1032
- newest: "newest";
1033
- all_except_one: "all_except_one";
1034
- all_user: "all_user";
1035
- }>>;
1036
- }, z.core.$strip>, z.ZodObject<{
1037
- type: z.ZodLiteral<"message_client">;
1038
- message: z.ZodString;
1039
- target: z.ZodOptional<z.ZodEnum<{
1040
- triggering: "triggering";
1041
- oldest: "oldest";
1042
- newest: "newest";
1043
- all_except_one: "all_except_one";
1044
- all_user: "all_user";
1045
- }>>;
1046
- }, z.core.$strip>], "type">>;
1047
- }, z.core.$strip>>;
1048
- }, z.core.$strip>;
1049
- export declare const bulkUpdateRulesSchema: z.ZodObject<{
355
+ export declare const AUTOMATION_CROSS_SERVER_ENFORCEMENT_ERROR_MESSAGE = "A server-scoped automation cannot enforce actions across all servers";
356
+ export declare const crossServerEnforcementRefinement: {
357
+ readonly message: "A server-scoped automation cannot enforce actions across all servers";
358
+ };
359
+ export declare const bulkUpdateAutomationsSchema: z.ZodObject<{
1050
360
  ids: z.ZodArray<z.ZodUUID>;
1051
361
  isActive: z.ZodBoolean;
1052
362
  }, z.core.$strip>;
1053
- export declare const bulkDeleteRulesSchema: z.ZodObject<{
363
+ export declare const bulkDeleteAutomationsSchema: z.ZodObject<{
1054
364
  ids: z.ZodArray<z.ZodUUID>;
1055
365
  }, z.core.$strip>;
1056
- export declare const bulkMigrateRulesSchema: z.ZodObject<{
1057
- ids: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
1058
- }, z.core.$strip>;
366
+ export declare const VIOLATION_SORT_FIELDS: readonly ["createdAt", "severity", "user", "rule"];
1059
367
  export declare const violationSortFieldSchema: z.ZodEnum<{
1060
- severity: "severity";
1061
368
  createdAt: "createdAt";
369
+ severity: "severity";
1062
370
  user: "user";
1063
371
  rule: "rule";
1064
372
  }>;
1065
373
  export type ViolationSortField = z.infer<typeof violationSortFieldSchema>;
374
+ /**
375
+ * The violations roster filter set, shared by GET /violations and both bulk
376
+ * endpoints.
377
+ *
378
+ * All three resolve their row set from this one schema, so a bulk action can
379
+ * never reach past what the table showed. The bulk body used to carry a
380
+ * narrower copy that omitted ruleId, serverUserId and the date bounds: z.object
381
+ * strips unknown keys, so filtering the table to one rule and one week and
382
+ * hitting "select all" dismissed every violation on the server and reversed
383
+ * their trust adjustments.
384
+ */
385
+ export declare const violationRosterFilterSchema: z.ZodObject<{
386
+ serverId: z.ZodOptional<z.ZodUUID>;
387
+ serverIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
388
+ serverUserId: z.ZodOptional<z.ZodUUID>;
389
+ userId: z.ZodOptional<z.ZodUUID>;
390
+ userIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
391
+ ruleId: z.ZodOptional<z.ZodUUID>;
392
+ severity: z.ZodOptional<z.ZodEnum<{
393
+ low: "low";
394
+ warning: "warning";
395
+ high: "high";
396
+ }>>;
397
+ acknowledged: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>, z.ZodTransform<boolean, string | boolean>>>;
398
+ startDate: z.ZodOptional<z.ZodISODate>;
399
+ endDate: z.ZodOptional<z.ZodISODate>;
400
+ }, z.core.$strip>;
401
+ export type ViolationRosterFilters = z.infer<typeof violationRosterFilterSchema>;
1066
402
  export declare const violationQuerySchema: z.ZodObject<{
1067
403
  page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1068
404
  pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -1078,11 +414,11 @@ export declare const violationQuerySchema: z.ZodObject<{
1078
414
  high: "high";
1079
415
  }>>;
1080
416
  acknowledged: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>, z.ZodTransform<boolean, string | boolean>>>;
1081
- startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
1082
- endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
1083
- orderBy: z.ZodOptional<z.ZodEnum<{
1084
- severity: "severity";
417
+ startDate: z.ZodOptional<z.ZodISODate>;
418
+ endDate: z.ZodOptional<z.ZodISODate>;
419
+ orderBy: z.ZodDefault<z.ZodEnum<{
1085
420
  createdAt: "createdAt";
421
+ severity: "severity";
1086
422
  user: "user";
1087
423
  rule: "rule";
1088
424
  }>>;
@@ -1091,13 +427,30 @@ export declare const violationQuerySchema: z.ZodObject<{
1091
427
  desc: "desc";
1092
428
  }>>;
1093
429
  }, z.core.$strip>;
430
+ export declare const violationBulkBodySchema: z.ZodObject<{
431
+ ids: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
432
+ selectAll: z.ZodOptional<z.ZodBoolean>;
433
+ filters: z.ZodOptional<z.ZodObject<{
434
+ serverId: z.ZodOptional<z.ZodUUID>;
435
+ serverIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
436
+ serverUserId: z.ZodOptional<z.ZodUUID>;
437
+ userId: z.ZodOptional<z.ZodUUID>;
438
+ userIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
439
+ ruleId: z.ZodOptional<z.ZodUUID>;
440
+ severity: z.ZodOptional<z.ZodEnum<{
441
+ low: "low";
442
+ warning: "warning";
443
+ high: "high";
444
+ }>>;
445
+ acknowledged: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>, z.ZodTransform<boolean, string | boolean>>>;
446
+ startDate: z.ZodOptional<z.ZodISODate>;
447
+ endDate: z.ZodOptional<z.ZodISODate>;
448
+ }, z.core.$strip>>;
449
+ }, z.core.$strip>;
450
+ export type ViolationBulkBody = z.infer<typeof violationBulkBodySchema>;
1094
451
  export declare const violationIdParamSchema: z.ZodObject<{
1095
452
  id: z.ZodUUID;
1096
453
  }, z.core.$strip>;
1097
- export declare const serverIdFilterSchema: z.ZodObject<{
1098
- serverId: z.ZodOptional<z.ZodUUID>;
1099
- serverIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
1100
- }, z.core.$strip>;
1101
454
  export declare const dashboardQuerySchema: z.ZodObject<{
1102
455
  serverId: z.ZodOptional<z.ZodUUID>;
1103
456
  serverIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
@@ -1105,12 +458,12 @@ export declare const dashboardQuerySchema: z.ZodObject<{
1105
458
  }, z.core.$strip>;
1106
459
  export declare const statsQuerySchema: z.ZodObject<{
1107
460
  period: z.ZodDefault<z.ZodEnum<{
461
+ custom: "custom";
1108
462
  all: "all";
1109
463
  day: "day";
1110
464
  week: "week";
1111
465
  month: "month";
1112
466
  year: "year";
1113
- custom: "custom";
1114
467
  }>>;
1115
468
  startDate: z.ZodOptional<z.ZodISODateTime>;
1116
469
  endDate: z.ZodOptional<z.ZodISODateTime>;
@@ -1120,12 +473,12 @@ export declare const statsQuerySchema: z.ZodObject<{
1120
473
  }, z.core.$strip>;
1121
474
  export declare const locationStatsQuerySchema: z.ZodObject<{
1122
475
  period: z.ZodDefault<z.ZodEnum<{
476
+ custom: "custom";
1123
477
  all: "all";
1124
478
  day: "day";
1125
479
  week: "week";
1126
480
  month: "month";
1127
481
  year: "year";
1128
- custom: "custom";
1129
482
  }>>;
1130
483
  startDate: z.ZodOptional<z.ZodISODateTime>;
1131
484
  endDate: z.ZodOptional<z.ZodISODateTime>;
@@ -1168,6 +521,8 @@ export declare const updateSettingsSchema: z.ZodObject<{
1168
521
  backupScheduleDayOfWeek: z.ZodOptional<z.ZodNumber>;
1169
522
  backupScheduleDayOfMonth: z.ZodOptional<z.ZodNumber>;
1170
523
  backupRetentionCount: z.ZodOptional<z.ZodNumber>;
524
+ pluginUpdateCheckEnabled: z.ZodOptional<z.ZodBoolean>;
525
+ serverUpdateCheckEnabled: z.ZodOptional<z.ZodBoolean>;
1171
526
  watchedThresholdMovie: z.ZodOptional<z.ZodNumber>;
1172
527
  watchedThresholdTv: z.ZodOptional<z.ZodNumber>;
1173
528
  watchedThresholdMusic: z.ZodOptional<z.ZodNumber>;
@@ -1299,12 +654,12 @@ export declare const userBehaviorTypeSchema: z.ZodEnum<{
1299
654
  export type UserBehaviorType = z.infer<typeof userBehaviorTypeSchema>;
1300
655
  export declare const engagementQuerySchema: z.ZodObject<{
1301
656
  period: z.ZodDefault<z.ZodEnum<{
657
+ custom: "custom";
1302
658
  all: "all";
1303
659
  day: "day";
1304
660
  week: "week";
1305
661
  month: "month";
1306
662
  year: "year";
1307
- custom: "custom";
1308
663
  }>>;
1309
664
  startDate: z.ZodOptional<z.ZodISODateTime>;
1310
665
  endDate: z.ZodOptional<z.ZodISODateTime>;
@@ -1321,12 +676,12 @@ export declare const engagementQuerySchema: z.ZodObject<{
1321
676
  }, z.core.$strip>;
1322
677
  export declare const showsQuerySchema: z.ZodObject<{
1323
678
  period: z.ZodDefault<z.ZodEnum<{
679
+ custom: "custom";
1324
680
  all: "all";
1325
681
  day: "day";
1326
682
  week: "week";
1327
683
  month: "month";
1328
684
  year: "year";
1329
- custom: "custom";
1330
685
  }>>;
1331
686
  startDate: z.ZodOptional<z.ZodISODateTime>;
1332
687
  endDate: z.ZodOptional<z.ZodISODateTime>;
@@ -1356,8 +711,8 @@ export declare const libraryGrowthQuerySchema: z.ZodObject<{
1356
711
  serverIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
1357
712
  libraryId: z.ZodOptional<z.ZodUUID>;
1358
713
  period: z.ZodDefault<z.ZodEnum<{
1359
- "30d": "30d";
1360
714
  all: "all";
715
+ "30d": "30d";
1361
716
  "7d": "7d";
1362
717
  "90d": "90d";
1363
718
  "1y": "1y";
@@ -1369,8 +724,8 @@ export declare const libraryGrowthQuerySchema: z.ZodObject<{
1369
724
  export declare const libraryQualityQuerySchema: z.ZodObject<{
1370
725
  serverId: z.ZodOptional<z.ZodUUID>;
1371
726
  period: z.ZodDefault<z.ZodEnum<{
1372
- "30d": "30d";
1373
727
  all: "all";
728
+ "30d": "30d";
1374
729
  "7d": "7d";
1375
730
  "90d": "90d";
1376
731
  "1y": "1y";
@@ -1387,8 +742,8 @@ export declare const libraryStorageQuerySchema: z.ZodObject<{
1387
742
  serverIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
1388
743
  libraryId: z.ZodOptional<z.ZodUUID>;
1389
744
  period: z.ZodDefault<z.ZodEnum<{
1390
- "30d": "30d";
1391
745
  all: "all";
746
+ "30d": "30d";
1392
747
  "7d": "7d";
1393
748
  "90d": "90d";
1394
749
  "1y": "1y";
@@ -1467,10 +822,10 @@ export declare const libraryRoiQuerySchema: z.ZodObject<{
1467
822
  serverIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
1468
823
  libraryId: z.ZodOptional<z.ZodString>;
1469
824
  mediaType: z.ZodDefault<z.ZodEnum<{
1470
- all: "all";
1471
825
  movie: "movie";
1472
826
  show: "show";
1473
827
  artist: "artist";
828
+ all: "all";
1474
829
  }>>;
1475
830
  valueCategory: z.ZodDefault<z.ZodEnum<{
1476
831
  all: "all";
@@ -1500,8 +855,8 @@ export declare const libraryPatternsQuerySchema: z.ZodObject<{
1500
855
  libraryId: z.ZodOptional<z.ZodString>;
1501
856
  periodWeeks: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1502
857
  scope: z.ZodDefault<z.ZodEnum<{
1503
- user: "user";
1504
858
  server: "server";
859
+ user: "user";
1505
860
  }>>;
1506
861
  includeBinge: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
1507
862
  includePeakTimes: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
@@ -1519,8 +874,8 @@ export declare const libraryCompletionQuerySchema: z.ZodObject<{
1519
874
  show: "show";
1520
875
  }>>;
1521
876
  aggregateLevel: z.ZodDefault<z.ZodEnum<{
1522
- item: "item";
1523
877
  season: "season";
878
+ item: "item";
1524
879
  series: "series";
1525
880
  }>>;
1526
881
  status: z.ZodDefault<z.ZodEnum<{
@@ -1547,8 +902,8 @@ export declare const topContentQuerySchema: z.ZodObject<{
1547
902
  serverId: z.ZodOptional<z.ZodUUID>;
1548
903
  serverIds: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUUID, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodUUID>]>>;
1549
904
  period: z.ZodDefault<z.ZodEnum<{
1550
- "30d": "30d";
1551
905
  all: "all";
906
+ "30d": "30d";
1552
907
  "7d": "7d";
1553
908
  "90d": "90d";
1554
909
  "1y": "1y";
@@ -1569,12 +924,12 @@ export declare const topContentQuerySchema: z.ZodObject<{
1569
924
  }, z.core.$strip>;
1570
925
  export declare const shelvesQuerySchema: z.ZodObject<{
1571
926
  period: z.ZodDefault<z.ZodEnum<{
927
+ custom: "custom";
1572
928
  all: "all";
1573
929
  day: "day";
1574
930
  week: "week";
1575
931
  month: "month";
1576
932
  year: "year";
1577
- custom: "custom";
1578
933
  }>>;
1579
934
  startDate: z.ZodOptional<z.ZodISODateTime>;
1580
935
  endDate: z.ZodOptional<z.ZodISODateTime>;
@@ -1604,42 +959,8 @@ export type SessionQueryInput = z.infer<typeof sessionQuerySchema>;
1604
959
  export type HistoryQueryInput = z.infer<typeof historyQuerySchema>;
1605
960
  export type HistoryAggregatesQueryInput = z.infer<typeof historyAggregatesQuerySchema>;
1606
961
  export type FilterOptionsQueryInput = z.infer<typeof filterOptionsQuerySchema>;
1607
- export type CreateRuleInput = z.infer<typeof createRuleSchema>;
1608
- export type UpdateRuleInput = z.infer<typeof updateRuleSchema>;
1609
- export type ComparisonOperator = z.infer<typeof comparisonOperatorSchema>;
1610
- export type ArrayOperator = z.infer<typeof arrayOperatorSchema>;
1611
- export type StringOperator = z.infer<typeof stringOperatorSchema>;
1612
- export type Operator = z.infer<typeof operatorSchema>;
1613
- export type SessionBehaviorField = z.infer<typeof sessionBehaviorFieldSchema>;
1614
- export type StreamQualityField = z.infer<typeof streamQualityFieldSchema>;
1615
- export type UserAttributeField = z.infer<typeof userAttributeFieldSchema>;
1616
- export type DeviceClientField = z.infer<typeof deviceClientFieldSchema>;
1617
- export type NetworkLocationField = z.infer<typeof networkLocationFieldSchema>;
1618
- export type ScopeField = z.infer<typeof scopeFieldSchema>;
1619
- export type ConditionField = z.infer<typeof conditionFieldSchema>;
1620
- export type VideoResolution = z.infer<typeof videoResolutionSchema>;
1621
- export type DeviceType = z.infer<typeof deviceTypeSchema>;
1622
- export type Platform = z.infer<typeof platformSchema>;
1623
- export type MediaTypeEnum = z.infer<typeof mediaTypeEnumSchema>;
1624
- export type ConditionValue = z.infer<typeof conditionValueSchema>;
1625
- export type Condition = z.infer<typeof conditionSchema>;
1626
- export type ConditionGroup = z.infer<typeof conditionGroupSchema>;
1627
- export type RuleConditions = z.infer<typeof ruleConditionsSchema>;
1628
- export type ActionType = z.infer<typeof actionTypeSchema>;
1629
- export type LogOnlyAction = z.infer<typeof logOnlyActionSchema>;
1630
- export type AdjustTrustAction = z.infer<typeof adjustTrustActionSchema>;
1631
- export type SetTrustAction = z.infer<typeof setTrustActionSchema>;
1632
- export type ResetTrustAction = z.infer<typeof resetTrustActionSchema>;
1633
- export type KillStreamAction = z.infer<typeof killStreamActionSchema>;
1634
- export type MessageClientAction = z.infer<typeof messageClientActionSchema>;
1635
- export type Action = z.infer<typeof actionSchema>;
1636
- export type RuleActions = z.infer<typeof ruleActionsSchema>;
1637
- export type CreateRuleV2Input = z.infer<typeof createRuleV2Schema>;
1638
- export type UpdateRuleV2Input = z.infer<typeof updateRuleV2Schema>;
1639
- export type BulkUpdateRulesInput = z.infer<typeof bulkUpdateRulesSchema>;
1640
- export type BulkDeleteRulesInput = z.infer<typeof bulkDeleteRulesSchema>;
1641
- export type BulkMigrateRulesInput = z.infer<typeof bulkMigrateRulesSchema>;
1642
- export type ViolationQueryInput = z.infer<typeof violationQuerySchema>;
962
+ export type BulkUpdateAutomationsInput = z.infer<typeof bulkUpdateAutomationsSchema>;
963
+ export type BulkDeleteAutomationsInput = z.infer<typeof bulkDeleteAutomationsSchema>;
1643
964
  export type ServerIdFilterInput = z.infer<typeof serverIdFilterSchema>;
1644
965
  export type DashboardQueryInput = z.infer<typeof dashboardQuerySchema>;
1645
966
  export type StatsQueryInput = z.infer<typeof statsQuerySchema>;
@@ -1654,5 +975,4 @@ export type JellystatImportBody = z.infer<typeof jellystatImportBodySchema>;
1654
975
  export type ImportJobStatus = z.infer<typeof importJobStatusSchema>;
1655
976
  export type EngagementQueryInput = z.infer<typeof engagementQuerySchema>;
1656
977
  export type ShowsQueryInput = z.infer<typeof showsQuerySchema>;
1657
- export {};
1658
978
  //# sourceMappingURL=schemas.d.ts.map