@thinkai/tai-api-contract 2.60.0 → 2.61.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.
@@ -2640,7 +2640,7 @@ export interface paths {
2640
2640
  put?: never;
2641
2641
  /**
2642
2642
  * Attempt silent ZenHR reconnect
2643
- * @description Attempts a silent token refresh and branch ping using stored ZenHR OAuth credentials. Returns `{ ok: true }` when the connection is restored without user interaction. Returns `{ ok: false, oauthRequired: true }` when stored credentials exist but refresh failed with an OAuth re-authorization error (e.g. `invalid_grant`); the SPA should start ZenHR OAuth next. Returns `502` for other upstream failures (same semantics as `GET .../integrations/zenhr/branches`).
2643
+ * @description Attempts a silent token refresh and branch ping using stored ZenHR OAuth credentials. Returns `{ ok: true }` when the connection is restored without user interaction. Returns `{ ok: false, oauthRequired: true }` when stored credentials exist but refresh failed with an OAuth re-authorization error (e.g. `invalid_grant`); the SPA should start ZenHR OAuth next. Returns `502` for other upstream failures (same semantics as `GET .../integrations/zenhr/branches`). Returns `503` with `zenhr_sync_in_progress` when an HRIS sync or OAuth refresh is already in progress for this workspace (retry shortly).
2644
2644
  */
2645
2645
  post: operations["reconnectWorkspaceZenHr"];
2646
2646
  delete?: never;
@@ -2649,6 +2649,46 @@ export interface paths {
2649
2649
  patch?: never;
2650
2650
  trace?: never;
2651
2651
  };
2652
+ "/workspaces/{workspaceId}/integrations/zenhr/branches": {
2653
+ parameters: {
2654
+ query?: never;
2655
+ header?: never;
2656
+ path?: never;
2657
+ cookie?: never;
2658
+ };
2659
+ /**
2660
+ * List ZenHR branches
2661
+ * @description Lists ZenHR branches for the connected OAuth app so a workspace admin can pick one. Requires workspace admin role. Returns `503` with `zenhr_sync_in_progress` when an HRIS sync or OAuth refresh is already in progress (retry shortly).
2662
+ */
2663
+ get: operations["listWorkspaceZenHrBranches"];
2664
+ put?: never;
2665
+ post?: never;
2666
+ delete?: never;
2667
+ options?: never;
2668
+ head?: never;
2669
+ patch?: never;
2670
+ trace?: never;
2671
+ };
2672
+ "/workspaces/{workspaceId}/integrations/zenhr/branch": {
2673
+ parameters: {
2674
+ query?: never;
2675
+ header?: never;
2676
+ path?: never;
2677
+ cookie?: never;
2678
+ };
2679
+ get?: never;
2680
+ put?: never;
2681
+ post?: never;
2682
+ delete?: never;
2683
+ options?: never;
2684
+ head?: never;
2685
+ /**
2686
+ * Save selected ZenHR branch
2687
+ * @description Validates and persists the admin-selected ZenHR branch id on the workspace source. Requires workspace admin role. Returns `503` with `zenhr_sync_in_progress` when an HRIS sync or OAuth refresh is already in progress (retry shortly).
2688
+ */
2689
+ patch: operations["patchWorkspaceZenHrBranch"];
2690
+ trace?: never;
2691
+ };
2652
2692
  "/workspaces/{workspaceId}/hris/status": {
2653
2693
  parameters: {
2654
2694
  query?: never;
@@ -3057,6 +3097,7 @@ export interface components {
3057
3097
  };
3058
3098
  TestConnectionResponseDto: {
3059
3099
  success: boolean;
3100
+ /** @description Machine-readable failure code when success=false (e.g. invalid_token, zenhr_sync_in_progress when ZenHR OAuth refresh is contended). */
3060
3101
  error?: string;
3061
3102
  /** @description Present when `executionToken` was included in the test request. `true` = key passed save-time validation (format + not-admin-key check). `false` = key failed validation (see `executionKeyError` for detail). `null` = `executionToken` was not provided. */
3062
3103
  executionKeyValid?: boolean | null;
@@ -5781,6 +5822,19 @@ export interface components {
5781
5822
  */
5782
5823
  error?: "zenhr_oauth_required";
5783
5824
  };
5825
+ ZenHrBranchDto: {
5826
+ id: string;
5827
+ name: string;
5828
+ };
5829
+ ZenHrBranchesListDto: {
5830
+ branches: components["schemas"]["ZenHrBranchDto"][];
5831
+ };
5832
+ ZenHrBranchSelectionDto: {
5833
+ branchId: string;
5834
+ };
5835
+ ZenHrBranchSelectionResultDto: {
5836
+ branchId: string;
5837
+ };
5784
5838
  HrisTriggerSyncResultDto: {
5785
5839
  /** @enum {string} */
5786
5840
  status: "ok" | "skipped" | "error" | "partial";
@@ -5944,6 +5998,20 @@ export interface components {
5944
5998
  "application/json": components["schemas"]["ErrorMessageDto"];
5945
5999
  };
5946
6000
  };
6001
+ /** @description HRIS sync or ZenHR OAuth refresh already in progress for this workspace */
6002
+ ZenHrSyncInProgress: {
6003
+ headers: {
6004
+ [name: string]: unknown;
6005
+ };
6006
+ content: {
6007
+ /**
6008
+ * @example {
6009
+ * "error": "zenhr_sync_in_progress"
6010
+ * }
6011
+ */
6012
+ "application/json": components["schemas"]["ErrorMessageDto"];
6013
+ };
6014
+ };
5947
6015
  };
5948
6016
  parameters: {
5949
6017
  WorkspaceId: string;
@@ -6276,6 +6344,10 @@ export type WorkspaceAbsenceListDto = components['schemas']['WorkspaceAbsenceLis
6276
6344
  export type HrisSyncStatusDto = components['schemas']['HrisSyncStatusDto'];
6277
6345
  export type HrisSyncStatusListDto = components['schemas']['HrisSyncStatusListDto'];
6278
6346
  export type ZenHrReconnectResultDto = components['schemas']['ZenHrReconnectResultDto'];
6347
+ export type ZenHrBranchDto = components['schemas']['ZenHrBranchDto'];
6348
+ export type ZenHrBranchesListDto = components['schemas']['ZenHrBranchesListDto'];
6349
+ export type ZenHrBranchSelectionDto = components['schemas']['ZenHrBranchSelectionDto'];
6350
+ export type ZenHrBranchSelectionResultDto = components['schemas']['ZenHrBranchSelectionResultDto'];
6279
6351
  export type HrisTriggerSyncResultDto = components['schemas']['HrisTriggerSyncResultDto'];
6280
6352
  export type HrisProviderSyncResultDto = components['schemas']['HrisProviderSyncResultDto'];
6281
6353
  export type ActivityLogPageDto = components['schemas']['ActivityLogPageDto'];
@@ -6283,6 +6355,7 @@ export type ReadinessTokenUsageRowDto = components['schemas']['ReadinessTokenUsa
6283
6355
  export type ReadinessTokenUsageByDimensionRowDto = components['schemas']['ReadinessTokenUsageByDimensionRowDto'];
6284
6356
  export type ResponseUnauthorized = components['responses']['Unauthorized'];
6285
6357
  export type ResponseForbidden = components['responses']['Forbidden'];
6358
+ export type ResponseZenHrSyncInProgress = components['responses']['ZenHrSyncInProgress'];
6286
6359
  export type ParameterWorkspaceId = components['parameters']['WorkspaceId'];
6287
6360
  export type ParameterRepoId = components['parameters']['RepoId'];
6288
6361
  export type ParameterProviderSlug = components['parameters']['ProviderSlug'];
@@ -13091,6 +13164,126 @@ export interface operations {
13091
13164
  "application/json": components["schemas"]["ErrorMessageDto"];
13092
13165
  };
13093
13166
  };
13167
+ 503: components["responses"]["ZenHrSyncInProgress"];
13168
+ };
13169
+ };
13170
+ listWorkspaceZenHrBranches: {
13171
+ parameters: {
13172
+ query?: never;
13173
+ header?: never;
13174
+ path: {
13175
+ workspaceId: components["parameters"]["WorkspaceId"];
13176
+ };
13177
+ cookie?: never;
13178
+ };
13179
+ requestBody?: never;
13180
+ responses: {
13181
+ /** @description Branch list */
13182
+ 200: {
13183
+ headers: {
13184
+ [name: string]: unknown;
13185
+ };
13186
+ content: {
13187
+ "application/json": components["schemas"]["ZenHrBranchesListDto"];
13188
+ };
13189
+ };
13190
+ 401: components["responses"]["Unauthorized"];
13191
+ 403: components["responses"]["Forbidden"];
13192
+ /** @description ZenHR is not connected for this workspace */
13193
+ 404: {
13194
+ headers: {
13195
+ [name: string]: unknown;
13196
+ };
13197
+ content: {
13198
+ /**
13199
+ * @example {
13200
+ * "error": "zenhr_not_connected"
13201
+ * }
13202
+ */
13203
+ "application/json": components["schemas"]["ErrorMessageDto"];
13204
+ };
13205
+ };
13206
+ /** @description ZenHR branch list unavailable */
13207
+ 502: {
13208
+ headers: {
13209
+ [name: string]: unknown;
13210
+ };
13211
+ content: {
13212
+ /**
13213
+ * @example {
13214
+ * "error": "zenhr_branches_unavailable"
13215
+ * }
13216
+ */
13217
+ "application/json": components["schemas"]["ErrorMessageDto"];
13218
+ };
13219
+ };
13220
+ 503: components["responses"]["ZenHrSyncInProgress"];
13221
+ };
13222
+ };
13223
+ patchWorkspaceZenHrBranch: {
13224
+ parameters: {
13225
+ query?: never;
13226
+ header?: never;
13227
+ path: {
13228
+ workspaceId: components["parameters"]["WorkspaceId"];
13229
+ };
13230
+ cookie?: never;
13231
+ };
13232
+ requestBody: {
13233
+ content: {
13234
+ "application/json": components["schemas"]["ZenHrBranchSelectionDto"];
13235
+ };
13236
+ };
13237
+ responses: {
13238
+ /** @description Branch saved */
13239
+ 200: {
13240
+ headers: {
13241
+ [name: string]: unknown;
13242
+ };
13243
+ content: {
13244
+ "application/json": components["schemas"]["ZenHrBranchSelectionResultDto"];
13245
+ };
13246
+ };
13247
+ /** @description Invalid body or unknown branch id */
13248
+ 400: {
13249
+ headers: {
13250
+ [name: string]: unknown;
13251
+ };
13252
+ content: {
13253
+ "application/json": components["schemas"]["ErrorMessageDto"];
13254
+ };
13255
+ };
13256
+ 401: components["responses"]["Unauthorized"];
13257
+ 403: components["responses"]["Forbidden"];
13258
+ /** @description ZenHR is not connected for this workspace */
13259
+ 404: {
13260
+ headers: {
13261
+ [name: string]: unknown;
13262
+ };
13263
+ content: {
13264
+ /**
13265
+ * @example {
13266
+ * "error": "zenhr_not_connected"
13267
+ * }
13268
+ */
13269
+ "application/json": components["schemas"]["ErrorMessageDto"];
13270
+ };
13271
+ };
13272
+ /** @description ZenHR branch validation unavailable */
13273
+ 502: {
13274
+ headers: {
13275
+ [name: string]: unknown;
13276
+ };
13277
+ content: {
13278
+ /**
13279
+ * @example {
13280
+ * "error": "zenhr_branches_unavailable"
13281
+ * }
13282
+ */
13283
+ "application/json": components["schemas"]["ErrorMessageDto"];
13284
+ };
13285
+ };
13286
+ 503: components["responses"]["ZenHrSyncInProgress"];
13094
13287
  };
13095
13288
  };
13096
13289
  getHrisSyncStatus: {