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