@thinkai/tai-api-contract 2.11.1 → 2.13.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.
@@ -948,7 +948,12 @@ export interface paths {
948
948
  delete?: never;
949
949
  options?: never;
950
950
  head?: never;
951
- patch?: never;
951
+ /**
952
+ * Archive (remove) or restore (re-add) a repository
953
+ * @description Set `archived: true` to soft-remove the repo (Inactive). Set `archived: false` to re-add a previously Inactive repo (Active). Re-add reuses the same `repo_id` row so historical scan foreign keys remain intact, and automatically enqueues a fresh readiness scan.
954
+ * Returns `409` with `code: repo_scan_in_progress` if a scan is queued or running when archiving. Returns `409` with `code: repo_already_active` if re-adding a repo that is already Active.
955
+ */
956
+ patch: operations["patchReadinessRepo"];
952
957
  trace?: never;
953
958
  };
954
959
  "/workspaces/{workspaceId}/readiness/repos/{repoId}/runs": {
@@ -991,6 +996,26 @@ export interface paths {
991
996
  patch?: never;
992
997
  trace?: never;
993
998
  };
999
+ "/workspaces/{workspaceId}/activity": {
1000
+ parameters: {
1001
+ query?: never;
1002
+ header?: never;
1003
+ path?: never;
1004
+ cookie?: never;
1005
+ };
1006
+ /**
1007
+ * Workspace activity log (paginated)
1008
+ * @description Paginated, chronological feed of workspace-scoped lifecycle events: repository add/remove/re-add and GitHub integration add/remove. Inactive repos remain visible in this log. Filter by `eventType`, `actorUserId`, or date range (`since`/`until`).
1009
+ */
1010
+ get: operations["listWorkspaceActivity"];
1011
+ put?: never;
1012
+ post?: never;
1013
+ delete?: never;
1014
+ options?: never;
1015
+ head?: never;
1016
+ patch?: never;
1017
+ trace?: never;
1018
+ };
994
1019
  "/workspaces/{workspaceId}/readiness/score-history": {
995
1020
  parameters: {
996
1021
  query?: never;
@@ -1639,6 +1664,66 @@ export interface paths {
1639
1664
  patch?: never;
1640
1665
  trace?: never;
1641
1666
  };
1667
+ "/workspaces/{workspaceId}/absences": {
1668
+ parameters: {
1669
+ query?: never;
1670
+ header?: never;
1671
+ path?: never;
1672
+ cookie?: never;
1673
+ };
1674
+ /**
1675
+ * List absence records
1676
+ * @description Returns time-off/absence records sourced from connected HRIS providers (e.g. Personio) for the given date window. Requires workspace membership.
1677
+ */
1678
+ get: operations["listWorkspaceAbsences"];
1679
+ put?: never;
1680
+ post?: never;
1681
+ delete?: never;
1682
+ options?: never;
1683
+ head?: never;
1684
+ patch?: never;
1685
+ trace?: never;
1686
+ };
1687
+ "/workspaces/{workspaceId}/hris/status": {
1688
+ parameters: {
1689
+ query?: never;
1690
+ header?: never;
1691
+ path?: never;
1692
+ cookie?: never;
1693
+ };
1694
+ /**
1695
+ * HRIS sync status
1696
+ * @description Returns the last sync status for every HRIS provider connected to the workspace. Returns an empty `statuses` array when no HRIS source has been synced yet. Requires workspace membership.
1697
+ */
1698
+ get: operations["getHrisSyncStatus"];
1699
+ put?: never;
1700
+ post?: never;
1701
+ delete?: never;
1702
+ options?: never;
1703
+ head?: never;
1704
+ patch?: never;
1705
+ trace?: never;
1706
+ };
1707
+ "/workspaces/{workspaceId}/hris/sync": {
1708
+ parameters: {
1709
+ query?: never;
1710
+ header?: never;
1711
+ path?: never;
1712
+ cookie?: never;
1713
+ };
1714
+ get?: never;
1715
+ put?: never;
1716
+ /**
1717
+ * Trigger manual HRIS sync
1718
+ * @description Manually triggers an HRIS sync for the workspace. Runs synchronously and returns the result. Requires editor role (same permission level as org-chart writes). Returns 422 when no HRIS source is configured.
1719
+ */
1720
+ post: operations["triggerHrisSync"];
1721
+ delete?: never;
1722
+ options?: never;
1723
+ head?: never;
1724
+ patch?: never;
1725
+ trace?: never;
1726
+ };
1642
1727
  }
1643
1728
  export type webhooks = Record<string, never>;
1644
1729
  export interface components {
@@ -3119,6 +3204,130 @@ export interface components {
3119
3204
  activeUsers: number;
3120
3205
  }[];
3121
3206
  };
3207
+ PatchRepoArchiveBodyDto: {
3208
+ /** @description `true` to soft-remove (Inactive). `false` to restore a previously Inactive repo (Active), which also enqueues a fresh readiness scan. */
3209
+ archived: boolean;
3210
+ };
3211
+ PatchRepoArchiveResponseDto: {
3212
+ /** Format: uuid */
3213
+ repoId: string;
3214
+ /**
3215
+ * @description Current lifecycle status of the repository after the operation.
3216
+ * @enum {string}
3217
+ */
3218
+ status: "Active" | "Inactive";
3219
+ /**
3220
+ * Format: uuid
3221
+ * @description ID of the freshly enqueued readiness scan run (only present on re-add).
3222
+ */
3223
+ runId?: string | null;
3224
+ };
3225
+ /**
3226
+ * @description Type of workspace lifecycle event.
3227
+ * @enum {string}
3228
+ */
3229
+ ActivityLogEventTypeDto: "repo.added" | "repo.removed" | "repo.readded" | "integration.github.added" | "integration.github.updated" | "integration.github.removed" | "integration.github.permissions_changed" | "integration.github.repo_added" | "integration.github.repo_removed" | "fix.requested" | "fix.generating" | "fix.pr_created" | "fix.merged" | "fix.failed" | "readiness.scan_started" | "readiness.scan_completed" | "readiness.scan_failed" | "readiness.scan_partial" | "config.cursor.added" | "config.cursor.updated" | "config.cursor.removed" | "config.cursor.platform_key_enabled" | "config.cursor.platform_key_disabled" | "config.claude.added" | "config.claude.updated" | "config.claude.removed" | "member.invited" | "member.role_changed" | "member.removed";
3230
+ ActivityLogActorDto: {
3231
+ /** Format: uuid */
3232
+ userId: string;
3233
+ /** Format: email */
3234
+ email?: string | null;
3235
+ name?: string | null;
3236
+ };
3237
+ ActivityLogEntryDto: {
3238
+ /** Format: uuid */
3239
+ id: string;
3240
+ eventType: components["schemas"]["ActivityLogEventTypeDto"];
3241
+ /** @description Namespace prefix derived from event_type (e.g. "fix", "repo", "config"). */
3242
+ eventCategory: string;
3243
+ /** Format: date-time */
3244
+ occurredAt: string;
3245
+ /**
3246
+ * @description Whether the event was triggered by a human user, a batch/system process, or a webhook.
3247
+ * @enum {string}
3248
+ */
3249
+ actorType: "user" | "system" | "webhook";
3250
+ actor?: components["schemas"]["ActivityLogActorDto"] | null;
3251
+ /** Format: uuid */
3252
+ repoId?: string | null;
3253
+ repoName?: string | null;
3254
+ /** Format: uuid */
3255
+ integrationId?: string | null;
3256
+ integrationType?: string | null;
3257
+ /**
3258
+ * Format: uuid
3259
+ * @description ID of the related fix request (fix.* events).
3260
+ */
3261
+ fixRequestId?: string | null;
3262
+ /**
3263
+ * Format: uuid
3264
+ * @description ID of the related readiness issue (fix.* events).
3265
+ */
3266
+ issueId?: string | null;
3267
+ /**
3268
+ * Format: uuid
3269
+ * @description ID of the related readiness run (readiness.* events).
3270
+ */
3271
+ readinessRunId?: string | null;
3272
+ /** @description Event-specific supplementary data (before/after state, installation IDs, etc.). */
3273
+ metadata?: {
3274
+ [key: string]: unknown;
3275
+ } | null;
3276
+ };
3277
+ WorkspaceAbsenceDto: {
3278
+ /** @description HRIS provider that sourced this record (e.g. 'personio', 'zenhr'). */
3279
+ source: string;
3280
+ /** Format: email */
3281
+ employeeEmail: string;
3282
+ absenceType: string;
3283
+ /** Format: date */
3284
+ startDate: string;
3285
+ /** Format: date */
3286
+ endDate: string;
3287
+ halfDayStart: boolean;
3288
+ halfDayEnd: boolean;
3289
+ /** @enum {string} */
3290
+ status: "approved" | "pending" | "rejected";
3291
+ };
3292
+ WorkspaceAbsenceListDto: {
3293
+ absences: components["schemas"]["WorkspaceAbsenceDto"][];
3294
+ /**
3295
+ * Format: date-time
3296
+ * @description ISO timestamp of the most recent successful HRIS sync, or null if never synced.
3297
+ */
3298
+ syncedAt: string | null;
3299
+ };
3300
+ HrisSyncStatusDto: {
3301
+ /** @description Provider identifier (e.g. 'personio', 'zenhr'). */
3302
+ provider: string;
3303
+ /** Format: date-time */
3304
+ lastSyncAt: string | null;
3305
+ /** @enum {string} */
3306
+ status: "ok" | "error" | "never";
3307
+ lastError?: string | null;
3308
+ };
3309
+ HrisSyncStatusListDto: {
3310
+ statuses: components["schemas"]["HrisSyncStatusDto"][];
3311
+ };
3312
+ HrisTriggerSyncResultDto: {
3313
+ /** @enum {string} */
3314
+ status: "ok" | "skipped" | "error";
3315
+ /** @description Stable machine-readable code (e.g. 'no_personio_source', 'hris_sync_failed'). */
3316
+ code?: string;
3317
+ /** @description Number of employees synced (present when status = 'ok'). */
3318
+ employeeCount?: number;
3319
+ /** @description Number of absence records synced (present when status = 'ok'). */
3320
+ absenceCount?: number;
3321
+ /** @description Wall-clock duration of the sync in milliseconds (present when status = 'ok'). */
3322
+ durationMs?: number;
3323
+ /** @description Machine-readable reason for a skipped sync (e.g. 'no_personio_source'). */
3324
+ reason?: string;
3325
+ /** @description Error message when status = 'error'. */
3326
+ error?: string;
3327
+ };
3328
+ ActivityLogPageDto: components["schemas"]["PageMetaDto"] & {
3329
+ items: components["schemas"]["ActivityLogEntryDto"][];
3330
+ };
3122
3331
  };
3123
3332
  responses: {
3124
3333
  /** @description Missing or invalid bearer token */
@@ -3340,6 +3549,17 @@ export type YourAiJourneyReadinessAggregateDto = components['schemas']['YourAiJo
3340
3549
  export type YourAiJourneyAnalyticsDto = components['schemas']['YourAiJourneyAnalyticsDto'];
3341
3550
  export type YourAiJourneyAiSpendWeekDto = components['schemas']['YourAiJourneyAiSpendWeekDto'];
3342
3551
  export type YourAiJourneyAiSpendDto = components['schemas']['YourAiJourneyAiSpendDto'];
3552
+ export type PatchRepoArchiveBodyDto = components['schemas']['PatchRepoArchiveBodyDto'];
3553
+ export type PatchRepoArchiveResponseDto = components['schemas']['PatchRepoArchiveResponseDto'];
3554
+ export type ActivityLogEventTypeDto = components['schemas']['ActivityLogEventTypeDto'];
3555
+ export type ActivityLogActorDto = components['schemas']['ActivityLogActorDto'];
3556
+ export type ActivityLogEntryDto = components['schemas']['ActivityLogEntryDto'];
3557
+ export type WorkspaceAbsenceDto = components['schemas']['WorkspaceAbsenceDto'];
3558
+ export type WorkspaceAbsenceListDto = components['schemas']['WorkspaceAbsenceListDto'];
3559
+ export type HrisSyncStatusDto = components['schemas']['HrisSyncStatusDto'];
3560
+ export type HrisSyncStatusListDto = components['schemas']['HrisSyncStatusListDto'];
3561
+ export type HrisTriggerSyncResultDto = components['schemas']['HrisTriggerSyncResultDto'];
3562
+ export type ActivityLogPageDto = components['schemas']['ActivityLogPageDto'];
3343
3563
  export type ResponseUnauthorized = components['responses']['Unauthorized'];
3344
3564
  export type ResponseForbidden = components['responses']['Forbidden'];
3345
3565
  export type ParameterWorkspaceId = components['parameters']['WorkspaceId'];
@@ -5536,6 +5756,8 @@ export interface operations {
5536
5756
  search?: components["parameters"]["ReadinessRepoSearch"];
5537
5757
  /** @description Exact language filter (e.g. `typescript`). */
5538
5758
  language?: components["parameters"]["ReadinessRepoLanguage"];
5759
+ /** @description When `true`, includes Inactive (user-removed) repos alongside Active ones. Default is `false` (active only). */
5760
+ includeArchived?: boolean;
5539
5761
  };
5540
5762
  header?: never;
5541
5763
  path: {
@@ -5750,6 +5972,62 @@ export interface operations {
5750
5972
  };
5751
5973
  };
5752
5974
  };
5975
+ patchReadinessRepo: {
5976
+ parameters: {
5977
+ query?: never;
5978
+ header?: never;
5979
+ path: {
5980
+ workspaceId: components["parameters"]["WorkspaceId"];
5981
+ repoId: components["parameters"]["RepoId"];
5982
+ };
5983
+ cookie?: never;
5984
+ };
5985
+ requestBody: {
5986
+ content: {
5987
+ "application/json": components["schemas"]["PatchRepoArchiveBodyDto"];
5988
+ };
5989
+ };
5990
+ responses: {
5991
+ /** @description Repo status updated */
5992
+ 200: {
5993
+ headers: {
5994
+ [name: string]: unknown;
5995
+ };
5996
+ content: {
5997
+ "application/json": components["schemas"]["PatchRepoArchiveResponseDto"];
5998
+ };
5999
+ };
6000
+ /** @description Malformed request body or repoId */
6001
+ 400: {
6002
+ headers: {
6003
+ [name: string]: unknown;
6004
+ };
6005
+ content: {
6006
+ "application/json": components["schemas"]["ErrorMessageDto"];
6007
+ };
6008
+ };
6009
+ 401: components["responses"]["Unauthorized"];
6010
+ 403: components["responses"]["Forbidden"];
6011
+ /** @description Workspace or repository not found */
6012
+ 404: {
6013
+ headers: {
6014
+ [name: string]: unknown;
6015
+ };
6016
+ content: {
6017
+ "application/json": components["schemas"]["ErrorMessageDto"];
6018
+ };
6019
+ };
6020
+ /** @description Conflict — scan in progress or repo already in the requested state */
6021
+ 409: {
6022
+ headers: {
6023
+ [name: string]: unknown;
6024
+ };
6025
+ content: {
6026
+ "application/json": components["schemas"]["ErrorMessageDto"];
6027
+ };
6028
+ };
6029
+ };
6030
+ };
5753
6031
  listReadinessRepoRuns: {
5754
6032
  parameters: {
5755
6033
  query?: {
@@ -5853,6 +6131,67 @@ export interface operations {
5853
6131
  };
5854
6132
  };
5855
6133
  };
6134
+ listWorkspaceActivity: {
6135
+ parameters: {
6136
+ query?: {
6137
+ /** @description Page size (default 25, max 100). */
6138
+ limit?: components["parameters"]["PaginationLimit"];
6139
+ /** @description Zero-based row offset into the filtered, sorted result set. */
6140
+ offset?: components["parameters"]["PaginationOffset"];
6141
+ /** @description Sort direction. */
6142
+ order?: components["parameters"]["PaginationOrder"];
6143
+ /** @description Filter to a specific event type. */
6144
+ eventType?: components["schemas"]["ActivityLogEventTypeDto"];
6145
+ /** @description Filter to events performed by a specific user (UUID). */
6146
+ actorUserId?: string;
6147
+ /** @description ISO-8601 lower bound on `occurredAt` (inclusive). */
6148
+ since?: string;
6149
+ /** @description ISO-8601 upper bound on `occurredAt` (inclusive). */
6150
+ until?: string;
6151
+ /** @description Filter by event namespace prefix (e.g. "fix", "repo", "integration", "readiness", "config", "member"). */
6152
+ eventCategory?: string;
6153
+ /** @description Case-insensitive substring filter applied across repo name, integration type, actor email, and actor display name. */
6154
+ search?: string;
6155
+ };
6156
+ header?: never;
6157
+ path: {
6158
+ workspaceId: components["parameters"]["WorkspaceId"];
6159
+ };
6160
+ cookie?: never;
6161
+ };
6162
+ requestBody?: never;
6163
+ responses: {
6164
+ /** @description Paginated activity log entries */
6165
+ 200: {
6166
+ headers: {
6167
+ [name: string]: unknown;
6168
+ };
6169
+ content: {
6170
+ "application/json": components["schemas"]["ActivityLogPageDto"];
6171
+ };
6172
+ };
6173
+ /** @description Invalid query parameters */
6174
+ 400: {
6175
+ headers: {
6176
+ [name: string]: unknown;
6177
+ };
6178
+ content: {
6179
+ "application/json": components["schemas"]["ErrorMessageDto"];
6180
+ };
6181
+ };
6182
+ 401: components["responses"]["Unauthorized"];
6183
+ 403: components["responses"]["Forbidden"];
6184
+ /** @description Workspace does not exist */
6185
+ 404: {
6186
+ headers: {
6187
+ [name: string]: unknown;
6188
+ };
6189
+ content: {
6190
+ "application/json": components["schemas"]["ErrorMessageDto"];
6191
+ };
6192
+ };
6193
+ };
6194
+ };
5856
6195
  getReadinessScoreHistory: {
5857
6196
  parameters: {
5858
6197
  query?: {
@@ -7396,5 +7735,150 @@ export interface operations {
7396
7735
  };
7397
7736
  };
7398
7737
  };
7738
+ listWorkspaceAbsences: {
7739
+ parameters: {
7740
+ query?: {
7741
+ /** @description Start of date window (ISO YYYY-MM-DD). Defaults to today. */
7742
+ from?: string;
7743
+ /** @description End of date window (ISO YYYY-MM-DD). Defaults to 90 days from today. */
7744
+ to?: string;
7745
+ };
7746
+ header?: never;
7747
+ path: {
7748
+ workspaceId: components["parameters"]["WorkspaceId"];
7749
+ };
7750
+ cookie?: never;
7751
+ };
7752
+ requestBody?: never;
7753
+ responses: {
7754
+ /** @description Absence list with last sync timestamp */
7755
+ 200: {
7756
+ headers: {
7757
+ [name: string]: unknown;
7758
+ };
7759
+ content: {
7760
+ /**
7761
+ * @example {
7762
+ * "absences": [
7763
+ * {
7764
+ * "source": "personio",
7765
+ * "employeeEmail": "alice@example.com",
7766
+ * "absenceType": "Vacation",
7767
+ * "startDate": "2025-07-01",
7768
+ * "endDate": "2025-07-05",
7769
+ * "halfDayStart": false,
7770
+ * "halfDayEnd": false,
7771
+ * "status": "approved"
7772
+ * }
7773
+ * ],
7774
+ * "syncedAt": "2025-06-30T08:00:00.000Z"
7775
+ * }
7776
+ */
7777
+ "application/json": components["schemas"]["WorkspaceAbsenceListDto"];
7778
+ };
7779
+ };
7780
+ 401: components["responses"]["Unauthorized"];
7781
+ 403: components["responses"]["Forbidden"];
7782
+ };
7783
+ };
7784
+ getHrisSyncStatus: {
7785
+ parameters: {
7786
+ query?: never;
7787
+ header?: never;
7788
+ path: {
7789
+ workspaceId: components["parameters"]["WorkspaceId"];
7790
+ };
7791
+ cookie?: never;
7792
+ };
7793
+ requestBody?: never;
7794
+ responses: {
7795
+ /** @description Sync status list */
7796
+ 200: {
7797
+ headers: {
7798
+ [name: string]: unknown;
7799
+ };
7800
+ content: {
7801
+ /**
7802
+ * @example {
7803
+ * "statuses": [
7804
+ * {
7805
+ * "provider": "personio",
7806
+ * "lastSyncAt": "2025-06-30T08:00:00.000Z",
7807
+ * "status": "ok"
7808
+ * }
7809
+ * ]
7810
+ * }
7811
+ */
7812
+ "application/json": components["schemas"]["HrisSyncStatusListDto"];
7813
+ };
7814
+ };
7815
+ 401: components["responses"]["Unauthorized"];
7816
+ 403: components["responses"]["Forbidden"];
7817
+ };
7818
+ };
7819
+ triggerHrisSync: {
7820
+ parameters: {
7821
+ query?: never;
7822
+ header?: never;
7823
+ path: {
7824
+ workspaceId: components["parameters"]["WorkspaceId"];
7825
+ };
7826
+ cookie?: never;
7827
+ };
7828
+ requestBody?: never;
7829
+ responses: {
7830
+ /** @description Sync completed successfully */
7831
+ 200: {
7832
+ headers: {
7833
+ [name: string]: unknown;
7834
+ };
7835
+ content: {
7836
+ /**
7837
+ * @example {
7838
+ * "status": "ok",
7839
+ * "employeeCount": 42,
7840
+ * "absenceCount": 7,
7841
+ * "durationMs": 1234
7842
+ * }
7843
+ */
7844
+ "application/json": components["schemas"]["HrisTriggerSyncResultDto"];
7845
+ };
7846
+ };
7847
+ 401: components["responses"]["Unauthorized"];
7848
+ 403: components["responses"]["Forbidden"];
7849
+ /** @description No HRIS source configured for this workspace */
7850
+ 422: {
7851
+ headers: {
7852
+ [name: string]: unknown;
7853
+ };
7854
+ content: {
7855
+ /**
7856
+ * @example {
7857
+ * "status": "skipped",
7858
+ * "code": "no_personio_source",
7859
+ * "reason": "no_personio_source"
7860
+ * }
7861
+ */
7862
+ "application/json": components["schemas"]["HrisTriggerSyncResultDto"];
7863
+ };
7864
+ };
7865
+ /** @description Sync failed (Personio API error, decryption failure, etc.) */
7866
+ 500: {
7867
+ headers: {
7868
+ [name: string]: unknown;
7869
+ };
7870
+ content: {
7871
+ /**
7872
+ * @example {
7873
+ * "status": "error",
7874
+ * "code": "hris_sync_failed",
7875
+ * "error": "Personio employees API 401"
7876
+ * }
7877
+ */
7878
+ "application/json": components["schemas"]["HrisTriggerSyncResultDto"];
7879
+ };
7880
+ };
7881
+ };
7882
+ };
7399
7883
  }
7400
7884
  //# sourceMappingURL=openapi.d.ts.map