@vibexp/api-client 0.79.0 → 0.81.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.
@@ -4664,6 +4664,39 @@ export type AdminUserListItem = {
4664
4664
  * Number of teams the user belongs to.
4665
4665
  */
4666
4666
  team_count: number;
4667
+ /**
4668
+ * Number of projects the user created.
4669
+ */
4670
+ project_count: number;
4671
+ resource_counts: AdminResourceCounts;
4672
+ /**
4673
+ * When the user's most recent resource (any of the nine types counted in
4674
+ * resource_counts) was created; null for a user who has authored none.
4675
+ *
4676
+ */
4677
+ last_resource_created_at?: string | null;
4678
+ };
4679
+ /**
4680
+ * How many resources of each type a user authored, counted by the author
4681
+ * column of each table (feeds by creator, feed items by poster). Every row
4682
+ * counts regardless of its status or archive state. `total` is the sum of the
4683
+ * nine types.
4684
+ *
4685
+ */
4686
+ export type AdminResourceCounts = {
4687
+ prompts: number;
4688
+ memories: number;
4689
+ artifacts: number;
4690
+ blueprints: number;
4691
+ agents: number;
4692
+ feeds: number;
4693
+ feed_items: number;
4694
+ comments: number;
4695
+ attachments: number;
4696
+ /**
4697
+ * Sum of the nine per-type counts.
4698
+ */
4699
+ total: number;
4667
4700
  };
4668
4701
  /**
4669
4702
  * A page of the instance-wide user listing, newest first.
@@ -5138,6 +5171,145 @@ export type AdminProjectDetail = {
5138
5171
  created_at: string;
5139
5172
  updated_at: string;
5140
5173
  };
5174
+ /**
5175
+ * How many PROJECT-SCOPED resources the user authored in one project. Only the
5176
+ * four types with a NOT NULL project_id are attributed to a project; every
5177
+ * other type is counted at the team level only.
5178
+ *
5179
+ */
5180
+ export type AdminUserProjectResourceCounts = {
5181
+ project_id: string;
5182
+ project_name: string;
5183
+ counts: AdminProjectResourceCounts;
5184
+ };
5185
+ /**
5186
+ * How many resources the user authored in one team, with the per-project breakdown.
5187
+ */
5188
+ export type AdminUserTeamResourceCounts = {
5189
+ team_id: string;
5190
+ team_name: string;
5191
+ /**
5192
+ * Whether the user is still a member of the team. A former member's
5193
+ * authored resources stay in the team and are still counted here.
5194
+ *
5195
+ */
5196
+ is_member: boolean;
5197
+ counts: AdminResourceCounts;
5198
+ /**
5199
+ * Per-project counts, ordered by project name.
5200
+ */
5201
+ projects: Array<AdminUserProjectResourceCounts>;
5202
+ };
5203
+ /**
5204
+ * Per-type counts of the resources one user authored, instance-wide, per team
5205
+ * and per project (GET /api/v1/admin/users/{id}/insights). For every type the
5206
+ * per-team counts sum to `totals`. An attachment whose author was deleted
5207
+ * (user_id set to NULL) counts for nobody.
5208
+ *
5209
+ */
5210
+ export type AdminUserInsights = {
5211
+ user_id: string;
5212
+ totals: AdminResourceCounts;
5213
+ /**
5214
+ * Teams the user authored at least one resource in, ordered by team name.
5215
+ */
5216
+ teams: Array<AdminUserTeamResourceCounts>;
5217
+ };
5218
+ /**
5219
+ * How many resources of each type the user created within one time bucket.
5220
+ */
5221
+ export type AdminUserCreationPoint = {
5222
+ /**
5223
+ * Start of the bucket, in UTC.
5224
+ */
5225
+ bucket: string;
5226
+ prompts: number;
5227
+ memories: number;
5228
+ artifacts: number;
5229
+ blueprints: number;
5230
+ agents: number;
5231
+ feeds: number;
5232
+ feed_items: number;
5233
+ comments: number;
5234
+ attachments: number;
5235
+ };
5236
+ /**
5237
+ * Resources the user created per bucket, stacked by type
5238
+ * (GET /api/v1/admin/users/{id}/resource-creation-metrics). Every bucket in
5239
+ * the range is present with an explicit 0 for every type.
5240
+ *
5241
+ */
5242
+ export type AdminUserResourceCreationMetrics = {
5243
+ /**
5244
+ * Inclusive start of the range actually used, snapped DOWN to the start of
5245
+ * its bucket (same rule as AdminTimeseriesResponse.from).
5246
+ *
5247
+ */
5248
+ from: string;
5249
+ /**
5250
+ * Exclusive end of the range actually used (after defaulting); not snapped.
5251
+ */
5252
+ to: string;
5253
+ /**
5254
+ * Bucket size actually used.
5255
+ */
5256
+ granularity: 'day' | 'week' | 'month';
5257
+ /**
5258
+ * One point per bucket, ascending by bucket.
5259
+ */
5260
+ series: Array<AdminUserCreationPoint>;
5261
+ };
5262
+ /**
5263
+ * One opaque timeline entry: which kind of resource the user created or last
5264
+ * updated, where, and when. Deliberately carries no title, slug or content —
5265
+ * only the first 8 characters of the resource id.
5266
+ *
5267
+ */
5268
+ export type AdminUserTimelineEvent = {
5269
+ resource_type: 'prompt' | 'memory' | 'artifact' | 'blueprint' | 'agent' | 'feed' | 'feed_item' | 'comment' | 'attachment';
5270
+ action: 'created' | 'updated';
5271
+ team_id: string;
5272
+ team_name: string;
5273
+ /**
5274
+ * Null for team-scoped resources and for feed items posted without a project.
5275
+ */
5276
+ project_id: string | null;
5277
+ project_name: string | null;
5278
+ /**
5279
+ * First 8 characters of the resource id.
5280
+ */
5281
+ resource_short_id: string;
5282
+ occurred_at: string;
5283
+ };
5284
+ /**
5285
+ * One page of a user's resource timeline, newest first.
5286
+ */
5287
+ export type AdminUserTimelinePage = {
5288
+ items: Array<AdminUserTimelineEvent>;
5289
+ /**
5290
+ * Opaque cursor for the next page; null on the last page.
5291
+ */
5292
+ next_cursor: string | null;
5293
+ };
5294
+ /**
5295
+ * A user's notification preferences, read-only
5296
+ * (GET /api/v1/admin/users/{id}/notification-preferences). When the user has
5297
+ * never saved preferences, the defaults are returned with `is_default: true`
5298
+ * and `updated_at: null`.
5299
+ *
5300
+ */
5301
+ export type AdminUserNotificationPreferences = {
5302
+ email_notification: EmailNotificationPreferences;
5303
+ notifications: NotificationPreferences;
5304
+ /**
5305
+ * When the user last saved their preferences; null when defaults are returned.
5306
+ */
5307
+ updated_at: string | null;
5308
+ /**
5309
+ * True when the user has no stored preferences and the defaults are shown.
5310
+ */
5311
+ is_default: boolean;
5312
+ };
5141
5313
  export type ProjectResponse = Project & {
5142
5314
  /**
5143
5315
  * Whether the project's git URL matches a repository accessible via the team's GitHub App installation
@@ -5257,6 +5429,33 @@ export type ActivityEntityTypesEnvelope = {
5257
5429
  message: string;
5258
5430
  data: Array<string>;
5259
5431
  };
5432
+ export type EmailNotificationPreferences = {
5433
+ /**
5434
+ * Receive platform announcement emails
5435
+ */
5436
+ platform_announcement: boolean;
5437
+ /**
5438
+ * Receive account security emails
5439
+ */
5440
+ account_security: boolean;
5441
+ /**
5442
+ * Receive new feature emails
5443
+ */
5444
+ new_feature: boolean;
5445
+ /**
5446
+ * Receive marketing and promotional emails
5447
+ */
5448
+ marketing_promotional: boolean;
5449
+ };
5450
+ export type NotificationPreferences = {
5451
+ channels: NotificationChannelPreferences;
5452
+ /**
5453
+ * Per-type delivery preferences keyed by notification type (e.g. "feed.item.created", "feed.reply.created")
5454
+ */
5455
+ types: {
5456
+ [key: string]: NotificationTypePreference;
5457
+ };
5458
+ };
5260
5459
  export type PreferencesResponse = {
5261
5460
  preferences: Preferences;
5262
5461
  /**
@@ -5492,24 +5691,6 @@ export type TeamTopAccessedResourcesData = {
5492
5691
  range: '7d' | '14d' | '30d' | '60d' | '90d' | '180d';
5493
5692
  items: Array<TopAccessedResourceItem>;
5494
5693
  };
5495
- export type EmailNotificationPreferences = {
5496
- /**
5497
- * Receive platform announcement emails
5498
- */
5499
- platform_announcement: boolean;
5500
- /**
5501
- * Receive account security emails
5502
- */
5503
- account_security: boolean;
5504
- /**
5505
- * Receive new feature emails
5506
- */
5507
- new_feature: boolean;
5508
- /**
5509
- * Receive marketing and promotional emails
5510
- */
5511
- marketing_promotional: boolean;
5512
- };
5513
5694
  export type NotificationChannelPreferences = {
5514
5695
  /**
5515
5696
  * Enable in-app notifications globally
@@ -5530,15 +5711,6 @@ export type NotificationTypePreference = {
5530
5711
  */
5531
5712
  email: 'instant' | 'digest' | 'none';
5532
5713
  };
5533
- export type NotificationPreferences = {
5534
- channels: NotificationChannelPreferences;
5535
- /**
5536
- * Per-type delivery preferences keyed by notification type (e.g. "feed.item.created", "feed.reply.created")
5537
- */
5538
- types: {
5539
- [key: string]: NotificationTypePreference;
5540
- };
5541
- };
5542
5714
  export type Preferences = {
5543
5715
  email_notification: EmailNotificationPreferences;
5544
5716
  notifications: NotificationPreferences;
@@ -11574,10 +11746,121 @@ export type ListAdminUsersData = {
11574
11746
  * Narrow to accounts in this lifecycle state.
11575
11747
  */
11576
11748
  status?: 'active' | 'suspended';
11749
+ /**
11750
+ * Only users with at least this many teams the user belongs to (inclusive).
11751
+ */
11752
+ team_count_min?: number;
11753
+ /**
11754
+ * Only users with at most this many teams the user belongs to (inclusive).
11755
+ */
11756
+ team_count_max?: number;
11757
+ /**
11758
+ * Only users with at least this many projects the user created (inclusive).
11759
+ */
11760
+ project_count_min?: number;
11761
+ /**
11762
+ * Only users with at most this many projects the user created (inclusive).
11763
+ */
11764
+ project_count_max?: number;
11765
+ /**
11766
+ * Only users with at least this many prompts the user authored (inclusive).
11767
+ */
11768
+ prompt_count_min?: number;
11769
+ /**
11770
+ * Only users with at most this many prompts the user authored (inclusive).
11771
+ */
11772
+ prompt_count_max?: number;
11773
+ /**
11774
+ * Only users with at least this many memories the user authored (inclusive).
11775
+ */
11776
+ memory_count_min?: number;
11777
+ /**
11778
+ * Only users with at most this many memories the user authored (inclusive).
11779
+ */
11780
+ memory_count_max?: number;
11781
+ /**
11782
+ * Only users with at least this many artifacts the user authored (inclusive).
11783
+ */
11784
+ artifact_count_min?: number;
11785
+ /**
11786
+ * Only users with at most this many artifacts the user authored (inclusive).
11787
+ */
11788
+ artifact_count_max?: number;
11789
+ /**
11790
+ * Only users with at least this many blueprints the user authored (inclusive).
11791
+ */
11792
+ blueprint_count_min?: number;
11793
+ /**
11794
+ * Only users with at most this many blueprints the user authored (inclusive).
11795
+ */
11796
+ blueprint_count_max?: number;
11797
+ /**
11798
+ * Only users with at least this many agents the user created (inclusive).
11799
+ */
11800
+ agent_count_min?: number;
11801
+ /**
11802
+ * Only users with at most this many agents the user created (inclusive).
11803
+ */
11804
+ agent_count_max?: number;
11805
+ /**
11806
+ * Only users with at least this many feeds the user created (inclusive).
11807
+ */
11808
+ feed_count_min?: number;
11809
+ /**
11810
+ * Only users with at most this many feeds the user created (inclusive).
11811
+ */
11812
+ feed_count_max?: number;
11813
+ /**
11814
+ * Only users with at least this many feed items the user posted (inclusive).
11815
+ */
11816
+ feed_item_count_min?: number;
11817
+ /**
11818
+ * Only users with at most this many feed items the user posted (inclusive).
11819
+ */
11820
+ feed_item_count_max?: number;
11821
+ /**
11822
+ * Only users with at least this many comments the user wrote (inclusive).
11823
+ */
11824
+ comment_count_min?: number;
11825
+ /**
11826
+ * Only users with at most this many comments the user wrote (inclusive).
11827
+ */
11828
+ comment_count_max?: number;
11829
+ /**
11830
+ * Only users with at least this many attachments the user uploaded (inclusive).
11831
+ */
11832
+ attachment_count_min?: number;
11833
+ /**
11834
+ * Only users with at most this many attachments the user uploaded (inclusive).
11835
+ */
11836
+ attachment_count_max?: number;
11837
+ /**
11838
+ * Only users with at least this many resources the user authored across all nine types (the sum of resource_counts) (inclusive).
11839
+ */
11840
+ total_resource_count_min?: number;
11841
+ /**
11842
+ * Only users with at most this many resources the user authored across all nine types (the sum of resource_counts) (inclusive).
11843
+ */
11844
+ total_resource_count_max?: number;
11845
+ /**
11846
+ * Only users whose most recent resource (any of the nine types) was created
11847
+ * at or after this instant (inclusive). Users with no resources never match.
11848
+ *
11849
+ */
11850
+ last_resource_created_from?: string;
11851
+ /**
11852
+ * Only users whose most recent resource (any of the nine types) was created
11853
+ * at or before this instant (inclusive). Users with no resources never match.
11854
+ *
11855
+ */
11856
+ last_resource_created_to?: string;
11577
11857
  /**
11578
11858
  * Column to sort by. Ties are always broken by user id so paging is stable.
11859
+ * Sorting by last_resource_created_at places users with no resources last
11860
+ * in both directions.
11861
+ *
11579
11862
  */
11580
- sort_by?: 'created_at' | 'email' | 'name' | 'team_count';
11863
+ sort_by?: 'created_at' | 'email' | 'name' | 'team_count' | 'project_count' | 'prompt_count' | 'memory_count' | 'artifact_count' | 'blueprint_count' | 'agent_count' | 'feed_count' | 'feed_item_count' | 'comment_count' | 'attachment_count' | 'total_resource_count' | 'last_resource_created_at';
11581
11864
  /**
11582
11865
  * Sort direction.
11583
11866
  */
@@ -11587,7 +11870,7 @@ export type ListAdminUsersData = {
11587
11870
  };
11588
11871
  export type ListAdminUsersErrors = {
11589
11872
  /**
11590
- * Bad request — a query parameter is malformed or outside its enum
11873
+ * Bad request — a query parameter is malformed or outside its enum, a count bound is negative, or a min/max or from/to pair is inverted
11591
11874
  */
11592
11875
  400: ErrorResponse;
11593
11876
  /**
@@ -12062,6 +12345,162 @@ export type GetAdminProjectResponses = {
12062
12345
  200: AdminProjectDetail;
12063
12346
  };
12064
12347
  export type GetAdminProjectResponse = GetAdminProjectResponses[keyof GetAdminProjectResponses];
12348
+ export type GetAdminUserInsightsData = {
12349
+ body?: never;
12350
+ path: {
12351
+ /**
12352
+ * User id (UUID)
12353
+ */
12354
+ id: string;
12355
+ };
12356
+ query?: never;
12357
+ url: '/api/v1/admin/users/{id}/insights';
12358
+ };
12359
+ export type GetAdminUserInsightsErrors = {
12360
+ /**
12361
+ * Bad request — malformed user id
12362
+ */
12363
+ 400: ErrorResponse;
12364
+ /**
12365
+ * Not found — unknown user id, or the caller is not an instance admin
12366
+ */
12367
+ 404: ErrorResponse;
12368
+ /**
12369
+ * Internal server error
12370
+ */
12371
+ 500: ErrorResponse;
12372
+ };
12373
+ export type GetAdminUserInsightsError = GetAdminUserInsightsErrors[keyof GetAdminUserInsightsErrors];
12374
+ export type GetAdminUserInsightsResponses = {
12375
+ /**
12376
+ * The user's per-type resource counts
12377
+ */
12378
+ 200: AdminUserInsights;
12379
+ };
12380
+ export type GetAdminUserInsightsResponse = GetAdminUserInsightsResponses[keyof GetAdminUserInsightsResponses];
12381
+ export type GetAdminUserResourceCreationMetricsData = {
12382
+ body?: never;
12383
+ path: {
12384
+ /**
12385
+ * User id (UUID)
12386
+ */
12387
+ id: string;
12388
+ };
12389
+ query?: {
12390
+ /**
12391
+ * Inclusive start of the range. Defaults to 30 days before `to`.
12392
+ */
12393
+ from?: string;
12394
+ /**
12395
+ * Exclusive end of the range. Defaults to now.
12396
+ */
12397
+ to?: string;
12398
+ /**
12399
+ * Bucket size.
12400
+ */
12401
+ granularity?: 'day' | 'week' | 'month';
12402
+ };
12403
+ url: '/api/v1/admin/users/{id}/resource-creation-metrics';
12404
+ };
12405
+ export type GetAdminUserResourceCreationMetricsErrors = {
12406
+ /**
12407
+ * Bad request — malformed user id, `to` is not after `from`, the range
12408
+ * exceeds the maximum span, or `granularity` is outside its enum
12409
+ *
12410
+ */
12411
+ 400: ErrorResponse;
12412
+ /**
12413
+ * Not found — unknown user id, or the caller is not an instance admin
12414
+ */
12415
+ 404: ErrorResponse;
12416
+ /**
12417
+ * Internal server error
12418
+ */
12419
+ 500: ErrorResponse;
12420
+ };
12421
+ export type GetAdminUserResourceCreationMetricsError = GetAdminUserResourceCreationMetricsErrors[keyof GetAdminUserResourceCreationMetricsErrors];
12422
+ export type GetAdminUserResourceCreationMetricsResponses = {
12423
+ /**
12424
+ * Bucketed creation counts per type
12425
+ */
12426
+ 200: AdminUserResourceCreationMetrics;
12427
+ };
12428
+ export type GetAdminUserResourceCreationMetricsResponse = GetAdminUserResourceCreationMetricsResponses[keyof GetAdminUserResourceCreationMetricsResponses];
12429
+ export type GetAdminUserTimelineData = {
12430
+ body?: never;
12431
+ path: {
12432
+ /**
12433
+ * User id (UUID)
12434
+ */
12435
+ id: string;
12436
+ };
12437
+ query?: {
12438
+ /**
12439
+ * Opaque cursor from a previous page's `next_cursor`.
12440
+ */
12441
+ cursor?: string;
12442
+ /**
12443
+ * Page size.
12444
+ */
12445
+ limit?: number;
12446
+ };
12447
+ url: '/api/v1/admin/users/{id}/timeline';
12448
+ };
12449
+ export type GetAdminUserTimelineErrors = {
12450
+ /**
12451
+ * Bad request — malformed user id, malformed cursor, or `limit` out of range
12452
+ */
12453
+ 400: ErrorResponse;
12454
+ /**
12455
+ * Not found — unknown user id, or the caller is not an instance admin
12456
+ */
12457
+ 404: ErrorResponse;
12458
+ /**
12459
+ * Internal server error
12460
+ */
12461
+ 500: ErrorResponse;
12462
+ };
12463
+ export type GetAdminUserTimelineError = GetAdminUserTimelineErrors[keyof GetAdminUserTimelineErrors];
12464
+ export type GetAdminUserTimelineResponses = {
12465
+ /**
12466
+ * One page of timeline events, newest first
12467
+ */
12468
+ 200: AdminUserTimelinePage;
12469
+ };
12470
+ export type GetAdminUserTimelineResponse = GetAdminUserTimelineResponses[keyof GetAdminUserTimelineResponses];
12471
+ export type GetAdminUserNotificationPreferencesData = {
12472
+ body?: never;
12473
+ path: {
12474
+ /**
12475
+ * User id (UUID)
12476
+ */
12477
+ id: string;
12478
+ };
12479
+ query?: never;
12480
+ url: '/api/v1/admin/users/{id}/notification-preferences';
12481
+ };
12482
+ export type GetAdminUserNotificationPreferencesErrors = {
12483
+ /**
12484
+ * Bad request — malformed user id
12485
+ */
12486
+ 400: ErrorResponse;
12487
+ /**
12488
+ * Not found — unknown user id, or the caller is not an instance admin
12489
+ */
12490
+ 404: ErrorResponse;
12491
+ /**
12492
+ * Internal server error
12493
+ */
12494
+ 500: ErrorResponse;
12495
+ };
12496
+ export type GetAdminUserNotificationPreferencesError = GetAdminUserNotificationPreferencesErrors[keyof GetAdminUserNotificationPreferencesErrors];
12497
+ export type GetAdminUserNotificationPreferencesResponses = {
12498
+ /**
12499
+ * The user's notification preferences
12500
+ */
12501
+ 200: AdminUserNotificationPreferences;
12502
+ };
12503
+ export type GetAdminUserNotificationPreferencesResponse = GetAdminUserNotificationPreferencesResponses[keyof GetAdminUserNotificationPreferencesResponses];
12065
12504
  export type ListCommentsData = {
12066
12505
  body?: never;
12067
12506
  path: {