@iveri/contracts 0.88.0 → 0.90.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.
Files changed (41) hide show
  1. package/dist/api/chat/chat-app-console.type.d.ts +34 -0
  2. package/dist/api/chat/chat-app-console.type.js +1 -0
  3. package/dist/api/chat/chat-app-push.type.d.ts +24 -0
  4. package/dist/api/chat/chat-app-push.type.js +1 -0
  5. package/dist/api/chat/chat-app-webhook.type.d.ts +110 -0
  6. package/dist/api/chat/chat-app-webhook.type.js +1 -0
  7. package/dist/api/chat/chat-app.constant.d.ts +6 -0
  8. package/dist/api/chat/chat-app.constant.js +6 -0
  9. package/dist/api/chat/chat-app.type.d.ts +2 -0
  10. package/dist/api/chat/chat-push-credential-kind.enum.d.ts +7 -0
  11. package/dist/api/chat/chat-push-credential-kind.enum.js +8 -0
  12. package/dist/api/chat/chat-push-token-kind.enum.d.ts +9 -0
  13. package/dist/api/chat/chat-push-token-kind.enum.js +10 -0
  14. package/dist/api/chat/chat-realtime.type.d.ts +3 -0
  15. package/dist/api/chat/chat-webhook-delivery-status.enum.d.ts +12 -0
  16. package/dist/api/chat/chat-webhook-delivery-status.enum.js +13 -0
  17. package/dist/api/chat/chat-webhook-event.enum.d.ts +9 -0
  18. package/dist/api/chat/chat-webhook-event.enum.js +10 -0
  19. package/dist/api/chat/index.d.ts +7 -0
  20. package/dist/api/chat/index.js +7 -0
  21. package/dist/api/hr/hr-application-source.enum.d.ts +3 -2
  22. package/dist/api/hr/hr-application-source.enum.js +2 -1
  23. package/dist/api/hr/hr-calendar-feed-kind.enum.d.ts +9 -0
  24. package/dist/api/hr/hr-calendar-feed-kind.enum.js +10 -0
  25. package/dist/api/hr/hr-calendar-feed.type.d.ts +27 -0
  26. package/dist/api/hr/hr-calendar-feed.type.js +1 -0
  27. package/dist/api/hr/hr-hiring.type.d.ts +8 -0
  28. package/dist/api/hr/hr-organization.type.d.ts +4 -0
  29. package/dist/api/hr/hr-referral-outcome.enum.d.ts +11 -0
  30. package/dist/api/hr/hr-referral-outcome.enum.js +12 -0
  31. package/dist/api/hr/hr-referral.type.d.ts +29 -0
  32. package/dist/api/hr/hr-referral.type.js +1 -0
  33. package/dist/api/hr/hr-stand-in.type.d.ts +27 -0
  34. package/dist/api/hr/hr-stand-in.type.js +1 -0
  35. package/dist/api/hr/hr-work-day.type.d.ts +61 -0
  36. package/dist/api/hr/hr-work-day.type.js +1 -0
  37. package/dist/api/hr/hr-work-place.enum.d.ts +5 -0
  38. package/dist/api/hr/hr-work-place.enum.js +6 -0
  39. package/dist/api/hr/index.d.ts +7 -0
  40. package/dist/api/hr/index.js +7 -0
  41. package/package.json +1 -1
@@ -0,0 +1,34 @@
1
+ import type { CursorPage } from '../../type/cursor-page.type.js';
2
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
3
+ import type { Nullable } from '../../type/nil.type.js';
4
+ import type { UUID } from '../../type/uuid.type.js';
5
+ import type { ChatAppUser } from './chat-app.type.js';
6
+ import type { ChatConversationKind } from './chat-conversation-kind.enum.js';
7
+ /** `GET /apps/:appId/users`. */
8
+ export type ChatAppUsersPage = CursorPage<ChatAppUser>;
9
+ /** Somebody in a conversation, as a console lists them: the app's id for them and the name they show. */
10
+ export interface ChatAppConversationParticipant {
11
+ externalId: Nullable<string>;
12
+ displayName: Nullable<string>;
13
+ }
14
+ /**
15
+ * A conversation as a customer's console lists it: who is in it and when it was last used. **Never what it says**: a
16
+ * console reads a conversation only through a report, the rule Baasi's own staff work under.
17
+ */
18
+ export interface ChatAppConversationSummary {
19
+ id: UUID;
20
+ kind: ChatConversationKind;
21
+ /** A group's own name, or the product's title for a conversation it opened. */
22
+ title: Nullable<string>;
23
+ context: Nullable<{
24
+ product: string;
25
+ type: string;
26
+ id: string;
27
+ }>;
28
+ participants: ChatAppConversationParticipant[];
29
+ lastActivityAt: IsoDateTime;
30
+ closedAt: Nullable<IsoDateTime>;
31
+ createdAt: IsoDateTime;
32
+ }
33
+ /** `GET /apps/:appId/conversations`. Most recently used first. */
34
+ export type ChatAppConversationsPage = CursorPage<ChatAppConversationSummary>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { ChatPushCredentialKind } from './chat-push-credential-kind.enum.js';
3
+ /** `GET /apps/:appId/push-credentials`: which kinds are set and since when. Never the key itself. */
4
+ export interface ChatAppPushCredential {
5
+ kind: ChatPushCredentialKind;
6
+ createdAt: IsoDateTime;
7
+ }
8
+ /** `PUT /apps/:appId/push-credentials/apns`. Replaces the app's APNs key. */
9
+ export interface PutChatApnsCredentialRequest {
10
+ /** The ten-character key id Apple shows beside the `.p8`. */
11
+ keyId: string;
12
+ teamId: string;
13
+ /** The app's bundle id, sent as `apns-topic`. */
14
+ bundleId: string;
15
+ /** The `.p8` file's contents, PEM. */
16
+ privateKey: string;
17
+ /** `true` sends to Apple's production service, `false` to its sandbox. */
18
+ production: boolean;
19
+ }
20
+ /** `PUT /apps/:appId/push-credentials/fcm`. Replaces the app's Firebase service account. */
21
+ export interface PutChatFcmCredentialRequest {
22
+ /** The service account's JSON key file, as text. */
23
+ serviceAccountJson: string;
24
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,110 @@
1
+ import type { CursorPage } from '../../type/cursor-page.type.js';
2
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
3
+ import type { Nullable } from '../../type/nil.type.js';
4
+ import type { UUID } from '../../type/uuid.type.js';
5
+ import type { ChatAttachmentKind } from './chat-attachment-kind.enum.js';
6
+ import type { ChatCaseDecision } from './chat-case-decision.enum.js';
7
+ import type { ChatMessageKind } from './chat-message-kind.enum.js';
8
+ import type { ChatReportReason } from './chat-report-reason.enum.js';
9
+ import type { ChatReportTarget } from './chat-report-target.enum.js';
10
+ import type { ChatWebhookDeliveryStatus } from './chat-webhook-delivery-status.enum.js';
11
+ import type { ChatWebhookEvent } from './chat-webhook-event.enum.js';
12
+ /** An address an app's server listens at, and what it wants to hear about. */
13
+ export interface ChatAppWebhook {
14
+ id: UUID;
15
+ appId: UUID;
16
+ /** `https://`, or `http://` only where the deployment allows private addresses. */
17
+ url: string;
18
+ events: ChatWebhookEvent[];
19
+ isActive: boolean;
20
+ createdAt: IsoDateTime;
21
+ updatedAt: IsoDateTime;
22
+ }
23
+ /** `POST /apps/:appId/webhooks`. */
24
+ export interface CreateChatAppWebhookRequest {
25
+ url: string;
26
+ /** At least one. */
27
+ events: ChatWebhookEvent[];
28
+ /** Omitted means active. */
29
+ isActive?: boolean;
30
+ }
31
+ /** `PATCH /apps/:appId/webhooks/:webhookId`. The address is fixed: a new address is a new webhook. */
32
+ export interface UpdateChatAppWebhookRequest {
33
+ events?: ChatWebhookEvent[];
34
+ isActive?: boolean;
35
+ }
36
+ /**
37
+ * `POST /apps/:appId/webhooks` and `POST …/rotate-secret`. The only answers that hold the signing secret: Baasi does
38
+ * not keep it, and after a rotation the old one stops signing at once.
39
+ */
40
+ export interface CreatedChatAppWebhook extends ChatAppWebhook {
41
+ /** `bwh_` and 32 random bytes in base64url. The HMAC key for `Baasi-Signature`. */
42
+ signingSecret: string;
43
+ }
44
+ /** One attempt by Baasi to tell an app's server something, read from the delivery queue. */
45
+ export interface ChatAppWebhookDelivery {
46
+ id: UUID;
47
+ /** The event's own id, which is also the `id` of the body the server received. */
48
+ eventId: Nullable<string>;
49
+ status: ChatWebhookDeliveryStatus;
50
+ attemptCount: number;
51
+ maxAttempts: number;
52
+ nextAttemptAt: IsoDateTime;
53
+ lastAttemptAt: Nullable<IsoDateTime>;
54
+ /** What the app's server answered last. Null when nothing answered. */
55
+ lastResponseStatus: Nullable<number>;
56
+ lastError: Nullable<string>;
57
+ completedAt: Nullable<IsoDateTime>;
58
+ createdAt: IsoDateTime;
59
+ }
60
+ /** `GET /apps/:appId/webhooks/:webhookId/deliveries`. Newest first. */
61
+ export type ChatAppWebhookDeliveriesPage = CursorPage<ChatAppWebhookDelivery>;
62
+ /**
63
+ * The body every webhook carries, signed with `Baasi-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of
64
+ * "<t>.<body>">`. Users are named by the app's own ids for them. `id` is stable across retries, so a server that has
65
+ * seen it may answer 200 and do nothing.
66
+ */
67
+ export interface ChatWebhookPayload<TType extends ChatWebhookEvent = ChatWebhookEvent, TData = unknown> {
68
+ id: UUID;
69
+ type: TType;
70
+ appId: UUID;
71
+ createdAt: IsoDateTime;
72
+ data: TData;
73
+ }
74
+ /** A conversation's product context, when the app's server opened it about something. */
75
+ export interface ChatWebhookConversationContext {
76
+ product: string;
77
+ type: string;
78
+ id: string;
79
+ }
80
+ /** `message.created`. The text is the app's own data on its way to its own server. */
81
+ export interface ChatWebhookMessageCreatedData {
82
+ conversationId: UUID;
83
+ context: Nullable<ChatWebhookConversationContext>;
84
+ messageId: UUID;
85
+ seq: number;
86
+ /** The app's own id for whoever wrote it. */
87
+ senderExternalId: Nullable<string>;
88
+ kind: ChatMessageKind;
89
+ text: Nullable<string>;
90
+ attachmentKinds: ChatAttachmentKind[];
91
+ }
92
+ /** `report.created`. The reporter is not named: a report is the reporter's own and staff decide it. */
93
+ export interface ChatWebhookReportCreatedData {
94
+ caseId: UUID;
95
+ target: ChatReportTarget;
96
+ reason: ChatReportReason;
97
+ reportedExternalId: Nullable<string>;
98
+ conversationId: Nullable<UUID>;
99
+ messageId: Nullable<UUID>;
100
+ }
101
+ /** `person.sanctioned`. The moderator's note stays in the record. */
102
+ export interface ChatWebhookPersonSanctionedData {
103
+ externalId: Nullable<string>;
104
+ decision: ChatCaseDecision;
105
+ suspendedUntil: Nullable<IsoDateTime>;
106
+ caseId: Nullable<UUID>;
107
+ }
108
+ export type ChatWebhookMessageCreated = ChatWebhookPayload<ChatWebhookEvent.MESSAGE_CREATED, ChatWebhookMessageCreatedData>;
109
+ export type ChatWebhookReportCreated = ChatWebhookPayload<ChatWebhookEvent.REPORT_CREATED, ChatWebhookReportCreatedData>;
110
+ export type ChatWebhookPersonSanctioned = ChatWebhookPayload<ChatWebhookEvent.PERSON_SANCTIONED, ChatWebhookPersonSanctionedData>;
@@ -0,0 +1 @@
1
+ export {};
@@ -10,3 +10,9 @@ export declare const CHAT_APP_TOKEN_MAX_TTL_SECONDS = 86400;
10
10
  export declare const CHAT_APP_TOKEN_DEFAULT_TTL_SECONDS = 3600;
11
11
  /** The longest id an app may give one of its users. */
12
12
  export declare const CHAT_EXTERNAL_USER_ID_MAX_LENGTH = 255;
13
+ /** At most this many webhooks per app. */
14
+ export declare const CHAT_APP_MAX_WEBHOOKS = 5;
15
+ /** What a webhook's signing secret looks like: this prefix, then 32 random bytes in base64url. */
16
+ export declare const CHAT_WEBHOOK_SECRET_PREFIX = "bwh_";
17
+ /** The header every webhook is signed in: `t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<body>">`. */
18
+ export declare const CHAT_WEBHOOK_SIGNATURE_HEADER = "Baasi-Signature";
@@ -10,3 +10,9 @@ export const CHAT_APP_TOKEN_MAX_TTL_SECONDS = 86_400;
10
10
  export const CHAT_APP_TOKEN_DEFAULT_TTL_SECONDS = 3_600;
11
11
  /** The longest id an app may give one of its users. */
12
12
  export const CHAT_EXTERNAL_USER_ID_MAX_LENGTH = 255;
13
+ /** At most this many webhooks per app. */
14
+ export const CHAT_APP_MAX_WEBHOOKS = 5;
15
+ /** What a webhook's signing secret looks like: this prefix, then 32 random bytes in base64url. */
16
+ export const CHAT_WEBHOOK_SECRET_PREFIX = 'bwh_';
17
+ /** The header every webhook is signed in: `t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<body>">`. */
18
+ export const CHAT_WEBHOOK_SIGNATURE_HEADER = 'Baasi-Signature';
@@ -59,6 +59,8 @@ export interface ChatAppUser {
59
59
  /** Their tokens signed before this moment are refused. */
60
60
  tokensNotBefore: Nullable<IsoDateTime>;
61
61
  createdAt: IsoDateTime;
62
+ /** Their last request, to the minute. Null for a user created ahead of time who has not signed in yet. */
63
+ lastActiveAt: Nullable<IsoDateTime>;
62
64
  }
63
65
  /** `POST /server/tokens`. For a company that would rather not sign a token itself. */
64
66
  export interface MintChatTokenRequest {
@@ -0,0 +1,7 @@
1
+ /** Whose servers an app's own push credential talks to. */
2
+ export declare enum ChatPushCredentialKind {
3
+ /** Apple Push Notification service, with the app's `.p8` key. */
4
+ APNS = "apns",
5
+ /** Firebase Cloud Messaging, with the app's service account. */
6
+ FCM = "fcm"
7
+ }
@@ -0,0 +1,8 @@
1
+ /** Whose servers an app's own push credential talks to. */
2
+ export var ChatPushCredentialKind;
3
+ (function (ChatPushCredentialKind) {
4
+ /** Apple Push Notification service, with the app's `.p8` key. */
5
+ ChatPushCredentialKind["APNS"] = "apns";
6
+ /** Firebase Cloud Messaging, with the app's service account. */
7
+ ChatPushCredentialKind["FCM"] = "fcm";
8
+ })(ChatPushCredentialKind || (ChatPushCredentialKind = {}));
@@ -0,0 +1,9 @@
1
+ /** What kind of push token a device holds, which decides who delivers to it. */
2
+ export declare enum ChatPushTokenKind {
3
+ /** An Expo push token, sent through Expo. What every Iveri app holds. */
4
+ EXPO = "expo",
5
+ /** A raw APNs device token, sent through Apple with the app's own key. */
6
+ APNS = "apns",
7
+ /** A raw FCM registration token, sent through Firebase with the app's own service account. */
8
+ FCM = "fcm"
9
+ }
@@ -0,0 +1,10 @@
1
+ /** What kind of push token a device holds, which decides who delivers to it. */
2
+ export var ChatPushTokenKind;
3
+ (function (ChatPushTokenKind) {
4
+ /** An Expo push token, sent through Expo. What every Iveri app holds. */
5
+ ChatPushTokenKind["EXPO"] = "expo";
6
+ /** A raw APNs device token, sent through Apple with the app's own key. */
7
+ ChatPushTokenKind["APNS"] = "apns";
8
+ /** A raw FCM registration token, sent through Firebase with the app's own service account. */
9
+ ChatPushTokenKind["FCM"] = "fcm";
10
+ })(ChatPushTokenKind || (ChatPushTokenKind = {}));
@@ -1,6 +1,7 @@
1
1
  import type { Nullable } from '../../type/nil.type.js';
2
2
  import type { UUID } from '../../type/uuid.type.js';
3
3
  import type { ChatDevicePlatform } from './chat-device-platform.enum.js';
4
+ import type { ChatPushTokenKind } from './chat-push-token-kind.enum.js';
4
5
  import type { ChatRealtimeEvent } from './chat-realtime-event.enum.js';
5
6
  /** What a socket receives. Identifiers only, and never a tenant id. */
6
7
  export interface ChatRealtimeFrame {
@@ -16,5 +17,7 @@ export interface RegisterChatDeviceRequest {
16
17
  installationId: string;
17
18
  platform: ChatDevicePlatform;
18
19
  pushToken: string;
20
+ /** Omitted means `expo`, which is what every Iveri app holds. An app's own build may hold a raw APNs or FCM token. */
21
+ tokenKind?: ChatPushTokenKind;
19
22
  locale?: Nullable<string>;
20
23
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Where one webhook delivery is. The same states Conduit's outbound queue has, under Baasi's own name, so a console
3
+ * never imports Conduit's contract to read its own app's log.
4
+ */
5
+ export declare enum ChatWebhookDeliveryStatus {
6
+ PENDING = "pending",
7
+ IN_FLIGHT = "in-flight",
8
+ DELIVERED = "delivered",
9
+ /** Every attempt failed. It can be sent again from the console. */
10
+ DEAD_LETTERED = "dead-lettered",
11
+ CANCELLED = "cancelled"
12
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Where one webhook delivery is. The same states Conduit's outbound queue has, under Baasi's own name, so a console
3
+ * never imports Conduit's contract to read its own app's log.
4
+ */
5
+ export var ChatWebhookDeliveryStatus;
6
+ (function (ChatWebhookDeliveryStatus) {
7
+ ChatWebhookDeliveryStatus["PENDING"] = "pending";
8
+ ChatWebhookDeliveryStatus["IN_FLIGHT"] = "in-flight";
9
+ ChatWebhookDeliveryStatus["DELIVERED"] = "delivered";
10
+ /** Every attempt failed. It can be sent again from the console. */
11
+ ChatWebhookDeliveryStatus["DEAD_LETTERED"] = "dead-lettered";
12
+ ChatWebhookDeliveryStatus["CANCELLED"] = "cancelled";
13
+ })(ChatWebhookDeliveryStatus || (ChatWebhookDeliveryStatus = {}));
@@ -0,0 +1,9 @@
1
+ /** What an app's server can be told about, through a webhook it registered. */
2
+ export declare enum ChatWebhookEvent {
3
+ /** Somebody wrote in one of the app's conversations. A product's own notice is not one. */
4
+ MESSAGE_CREATED = "message.created",
5
+ /** One of the app's users reported a message or a person. */
6
+ REPORT_CREATED = "report.created",
7
+ /** A moderator warned, suspended or banned one of the app's users, or reinstated them. */
8
+ PERSON_SANCTIONED = "person.sanctioned"
9
+ }
@@ -0,0 +1,10 @@
1
+ /** What an app's server can be told about, through a webhook it registered. */
2
+ export var ChatWebhookEvent;
3
+ (function (ChatWebhookEvent) {
4
+ /** Somebody wrote in one of the app's conversations. A product's own notice is not one. */
5
+ ChatWebhookEvent["MESSAGE_CREATED"] = "message.created";
6
+ /** One of the app's users reported a message or a person. */
7
+ ChatWebhookEvent["REPORT_CREATED"] = "report.created";
8
+ /** A moderator warned, suspended or banned one of the app's users, or reinstated them. */
9
+ ChatWebhookEvent["PERSON_SANCTIONED"] = "person.sanctioned";
10
+ })(ChatWebhookEvent || (ChatWebhookEvent = {}));
@@ -1,4 +1,7 @@
1
+ export * from './chat-app-console.type.js';
1
2
  export * from './chat-app-conversation-mode.enum.js';
3
+ export * from './chat-app-push.type.js';
4
+ export * from './chat-app-webhook.type.js';
2
5
  export * from './chat-app.constant.js';
3
6
  export * from './chat-app.type.js';
4
7
  export * from './chat-attachment-kind.enum.js';
@@ -18,8 +21,12 @@ export * from './chat-participant-role.enum.js';
18
21
  export * from './chat-participant-status.enum.js';
19
22
  export * from './chat-person-status.enum.js';
20
23
  export * from './chat-person.type.js';
24
+ export * from './chat-push-credential-kind.enum.js';
25
+ export * from './chat-push-token-kind.enum.js';
21
26
  export * from './chat-realtime-event.enum.js';
22
27
  export * from './chat-realtime.type.js';
23
28
  export * from './chat-refusal.enum.js';
24
29
  export * from './chat-report-reason.enum.js';
25
30
  export * from './chat-report-target.enum.js';
31
+ export * from './chat-webhook-delivery-status.enum.js';
32
+ export * from './chat-webhook-event.enum.js';
@@ -1,4 +1,7 @@
1
+ export * from './chat-app-console.type.js';
1
2
  export * from './chat-app-conversation-mode.enum.js';
3
+ export * from './chat-app-push.type.js';
4
+ export * from './chat-app-webhook.type.js';
2
5
  export * from './chat-app.constant.js';
3
6
  export * from './chat-app.type.js';
4
7
  export * from './chat-attachment-kind.enum.js';
@@ -18,8 +21,12 @@ export * from './chat-participant-role.enum.js';
18
21
  export * from './chat-participant-status.enum.js';
19
22
  export * from './chat-person-status.enum.js';
20
23
  export * from './chat-person.type.js';
24
+ export * from './chat-push-credential-kind.enum.js';
25
+ export * from './chat-push-token-kind.enum.js';
21
26
  export * from './chat-realtime-event.enum.js';
22
27
  export * from './chat-realtime.type.js';
23
28
  export * from './chat-refusal.enum.js';
24
29
  export * from './chat-report-reason.enum.js';
25
30
  export * from './chat-report-target.enum.js';
31
+ export * from './chat-webhook-delivery-status.enum.js';
32
+ export * from './chat-webhook-event.enum.js';
@@ -1,5 +1,6 @@
1
- /** How an application arrived: through the careers page, or typed in by HR. */
1
+ /** How an application arrived: through the careers page, typed in by HR, or put forward by a colleague. */
2
2
  export declare enum HrApplicationSource {
3
3
  CAREERS = "careers",
4
- ADDED = "added"
4
+ ADDED = "added",
5
+ REFERRAL = "referral"
5
6
  }
@@ -1,6 +1,7 @@
1
- /** How an application arrived: through the careers page, or typed in by HR. */
1
+ /** How an application arrived: through the careers page, typed in by HR, or put forward by a colleague. */
2
2
  export var HrApplicationSource;
3
3
  (function (HrApplicationSource) {
4
4
  HrApplicationSource["CAREERS"] = "careers";
5
5
  HrApplicationSource["ADDED"] = "added";
6
+ HrApplicationSource["REFERRAL"] = "referral";
6
7
  })(HrApplicationSource || (HrApplicationSource = {}));
@@ -0,0 +1,9 @@
1
+ /**
2
+ * What a calendar subscription follows: a person's own time off, one of their teams, or the whole company.
3
+ * Colleagues' entries say who and when, never which kind of leave.
4
+ */
5
+ export declare enum HrCalendarFeedKind {
6
+ MINE = "mine",
7
+ TEAM = "team",
8
+ COMPANY = "company"
9
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * What a calendar subscription follows: a person's own time off, one of their teams, or the whole company.
3
+ * Colleagues' entries say who and when, never which kind of leave.
4
+ */
5
+ export var HrCalendarFeedKind;
6
+ (function (HrCalendarFeedKind) {
7
+ HrCalendarFeedKind["MINE"] = "mine";
8
+ HrCalendarFeedKind["TEAM"] = "team";
9
+ HrCalendarFeedKind["COMPANY"] = "company";
10
+ })(HrCalendarFeedKind || (HrCalendarFeedKind = {}));
@@ -0,0 +1,27 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { Nullable } from '../../type/nil.type.js';
3
+ import type { UUID } from '../../type/uuid.type.js';
4
+ import type { HrCalendarFeedKind } from './hr-calendar-feed-kind.enum.js';
5
+ /** A private address a calendar app subscribes to. The address itself is shown once, when it is made. */
6
+ export interface HrCalendarFeed {
7
+ id: UUID;
8
+ kind: HrCalendarFeedKind;
9
+ teamId: Nullable<UUID>;
10
+ teamName: Nullable<string>;
11
+ /** The language leave types and public holidays are named in. */
12
+ locale: string;
13
+ createdAt: IsoDateTime;
14
+ /** When a calendar app last fetched it, so a person can tell whether their subscription works. */
15
+ lastReadAt: Nullable<IsoDateTime>;
16
+ }
17
+ /** A new address, which replaces any earlier one for the same calendar. */
18
+ export interface HrCalendarFeedCreated extends HrCalendarFeed {
19
+ /** Relative to the API's versioned root, such as `calendar-feeds/<secret>/calendar.ics`. */
20
+ path: string;
21
+ }
22
+ export interface HrCreateCalendarFeedRequest {
23
+ kind: HrCalendarFeedKind;
24
+ /** Required for a team's calendar, and refused for the others. */
25
+ teamId?: Nullable<UUID>;
26
+ locale: string;
27
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -31,9 +31,17 @@ export interface HrApplication {
31
31
  stageChangedAt: IsoDateTime;
32
32
  decidedAt: Nullable<IsoDateTime>;
33
33
  hiredEmployeeId: Nullable<UUID>;
34
+ /** The colleague who put this person forward, when `source` is `referral`. */
35
+ referredBy: Nullable<HrApplicationReferrer>;
36
+ /** Why the colleague thinks they fit. Removed with the applicant's other details. */
37
+ referralNote: Nullable<string>;
34
38
  isRemoved: boolean;
35
39
  createdAt: IsoDateTime;
36
40
  }
41
+ export interface HrApplicationReferrer {
42
+ employeeId: UUID;
43
+ name: string;
44
+ }
37
45
  export interface HrCareersOpening {
38
46
  id: UUID;
39
47
  title: string;
@@ -15,6 +15,8 @@ export interface HrCompany {
15
15
  pensionEmployerBasisPoints: number;
16
16
  careersSlug: string | null;
17
17
  applicantRetentionDays: number;
18
+ /** How many days in one Monday-to-Sunday week somebody may work from home, or null for no limit. */
19
+ homeDaysPerWeek: Nullable<number>;
18
20
  }
19
21
  export interface HrDepartment {
20
22
  id: UUID;
@@ -71,6 +73,8 @@ export interface UpdateHrCompanyRequest {
71
73
  pensionEmployerBasisPoints?: number;
72
74
  careersSlug?: string;
73
75
  applicantRetentionDays?: number;
76
+ /** Null lifts the limit. */
77
+ homeDaysPerWeek?: Nullable<number>;
74
78
  }
75
79
  export interface UpdateHrDepartmentRequest {
76
80
  name?: string;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * What somebody who put a colleague forward is told about it.
3
+ *
4
+ * Deliberately coarser than the application's stage: the person who referred them is not part of the hiring, so
5
+ * they learn that it is still going, that the person was hired, or that it has ended, and never why.
6
+ */
7
+ export declare enum HrReferralOutcome {
8
+ IN_PROGRESS = "in-progress",
9
+ HIRED = "hired",
10
+ CLOSED = "closed"
11
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * What somebody who put a colleague forward is told about it.
3
+ *
4
+ * Deliberately coarser than the application's stage: the person who referred them is not part of the hiring, so
5
+ * they learn that it is still going, that the person was hired, or that it has ended, and never why.
6
+ */
7
+ export var HrReferralOutcome;
8
+ (function (HrReferralOutcome) {
9
+ HrReferralOutcome["IN_PROGRESS"] = "in-progress";
10
+ HrReferralOutcome["HIRED"] = "hired";
11
+ HrReferralOutcome["CLOSED"] = "closed";
12
+ })(HrReferralOutcome || (HrReferralOutcome = {}));
@@ -0,0 +1,29 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { Nullable } from '../../type/nil.type.js';
3
+ import type { UUID } from '../../type/uuid.type.js';
4
+ import type { HrReferralOutcome } from './hr-referral-outcome.enum.js';
5
+ /** Somebody the signed-in person put forward, as they are allowed to see it. */
6
+ export interface HrMyReferral {
7
+ id: UUID;
8
+ openingId: UUID;
9
+ openingTitle: string;
10
+ /** Null once the company's retention window has removed the person's details. */
11
+ candidateName: Nullable<string>;
12
+ outcome: HrReferralOutcome;
13
+ referredAt: IsoDateTime;
14
+ }
15
+ /**
16
+ * Putting somebody forward for an open role. Sent as a form, so a CV can come with it.
17
+ *
18
+ * `candidateAgreed` is the referrer saying the person agreed to be put forward, which is what lets their details
19
+ * be kept; it is sent as the string `true`.
20
+ */
21
+ export interface CreateHrReferralRequest {
22
+ openingId: UUID;
23
+ firstName: string;
24
+ lastName: string;
25
+ email: string;
26
+ phone?: string;
27
+ note?: string;
28
+ candidateAgreed: string;
29
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import type { UUID } from '../../type/uuid.type.js';
2
+ /**
3
+ * A colleague who, while somebody is away, decides what that person would have: the time off and the expense claims of
4
+ * their reports and of the teams they lead. It covers whole days, both ends included.
5
+ */
6
+ export interface HrStandIn {
7
+ id: UUID;
8
+ /** Who is away. */
9
+ employeeId: UUID;
10
+ employeeName: string;
11
+ standInEmployeeId: UUID;
12
+ standInName: string;
13
+ startDate: string;
14
+ endDate: string;
15
+ /** Today, in the company's time zone, falls inside the dates. */
16
+ isActive: boolean;
17
+ }
18
+ /** Who stands in for me, and for whom I stand in, from today on. */
19
+ export interface HrMyStandIns {
20
+ mine: HrStandIn[];
21
+ forOthers: HrStandIn[];
22
+ }
23
+ export interface HrSaveStandInRequest {
24
+ standInEmployeeId: UUID;
25
+ startDate: string;
26
+ endDate: string;
27
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,61 @@
1
+ import type { Nullable } from '../../type/nil.type.js';
2
+ import type { UUID } from '../../type/uuid.type.js';
3
+ import type { HrWorkPlace } from './hr-work-place.enum.js';
4
+ import type { LocalizedText } from './localized-text.type.js';
5
+ /** One day of somebody's own week, planned or not. */
6
+ export interface HrMyWorkDay {
7
+ date: string;
8
+ /** One of the company's working weekdays and not a public holiday. */
9
+ isWorkingDay: boolean;
10
+ holidayName: Nullable<LocalizedText>;
11
+ /** Time off, agreed or waiting, covers it. */
12
+ isAway: boolean;
13
+ /** Null until the person says where they will work. */
14
+ place: Nullable<HrWorkPlace>;
15
+ /** The office, on an office day. */
16
+ locationId: Nullable<UUID>;
17
+ locationName: Nullable<string>;
18
+ }
19
+ /** An office somebody can say they will work at. */
20
+ export interface HrWorkOffice {
21
+ id: UUID;
22
+ name: string;
23
+ city: Nullable<string>;
24
+ }
25
+ /** Somebody's own plan for a stretch of days, with what they need to make it. */
26
+ export interface HrMyWorkDays {
27
+ from: string;
28
+ to: string;
29
+ /** How many days in one Monday-to-Sunday week the company lets somebody work from home, or null for no limit. */
30
+ homeDaysPerWeek: Nullable<number>;
31
+ /** The office a day is placed at when the person names none. */
32
+ defaultLocationId: Nullable<UUID>;
33
+ offices: HrWorkOffice[];
34
+ days: HrMyWorkDay[];
35
+ }
36
+ export interface HrSaveWorkDayRequest {
37
+ place: HrWorkPlace;
38
+ /** Which office, on an office day. Left out, it is the person's own office; a home day names none. */
39
+ locationId?: Nullable<UUID>;
40
+ }
41
+ /** Somebody who has said where they will work on a day. */
42
+ export interface HrWorkDayPerson {
43
+ employeeId: UUID;
44
+ name: string;
45
+ jobTitle: Nullable<string>;
46
+ }
47
+ /** Everybody who will be at one office on a day. An office day with no office named has a null location. */
48
+ export interface HrWorkDayOffice {
49
+ locationId: Nullable<UUID>;
50
+ locationName: Nullable<string>;
51
+ people: HrWorkDayPerson[];
52
+ }
53
+ /**
54
+ * Who has said where they will work on a day, by office, and who will be at home. Nobody away that day is in it, and
55
+ * nobody who has not said.
56
+ */
57
+ export interface HrWhoIsIn {
58
+ date: string;
59
+ offices: HrWorkDayOffice[];
60
+ home: HrWorkDayPerson[];
61
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ /** Where somebody works on a day they have planned: at one of the company's offices, or from home. */
2
+ export declare enum HrWorkPlace {
3
+ OFFICE = "office",
4
+ HOME = "home"
5
+ }
@@ -0,0 +1,6 @@
1
+ /** Where somebody works on a day they have planned: at one of the company's offices, or from home. */
2
+ export var HrWorkPlace;
3
+ (function (HrWorkPlace) {
4
+ HrWorkPlace["OFFICE"] = "office";
5
+ HrWorkPlace["HOME"] = "home";
6
+ })(HrWorkPlace || (HrWorkPlace = {}));
@@ -6,6 +6,8 @@ export * from './hr-attendance-correction-status.enum.js';
6
6
  export * from './hr-attendance-source.enum.js';
7
7
  export * from './hr-attendance-state.enum.js';
8
8
  export * from './hr-attendance.type.js';
9
+ export * from './hr-calendar-feed-kind.enum.js';
10
+ export * from './hr-calendar-feed.type.js';
9
11
  export * from './hr-celebration.type.js';
10
12
  export * from './hr-checklist-kind.enum.js';
11
13
  export * from './hr-compensation.type.js';
@@ -49,11 +51,14 @@ export * from './hr-planning-entry-kind.enum.js';
49
51
  export * from './hr-planning.type.js';
50
52
  export * from './hr-probation-outcome.enum.js';
51
53
  export * from './hr-probation.type.js';
54
+ export * from './hr-referral-outcome.enum.js';
55
+ export * from './hr-referral.type.js';
52
56
  export * from './hr-report.type.js';
53
57
  export * from './hr-resource-status.enum.js';
54
58
  export * from './hr-review-cycle-status.enum.js';
55
59
  export * from './hr-review-question-kind.enum.js';
56
60
  export * from './hr-review-status.enum.js';
61
+ export * from './hr-stand-in.type.js';
57
62
  export * from './hr-survey-audience.enum.js';
58
63
  export * from './hr-survey-group-kind.enum.js';
59
64
  export * from './hr-survey-question-kind.enum.js';
@@ -65,4 +70,6 @@ export * from './hr-team-role.enum.js';
65
70
  export * from './hr-team.type.js';
66
71
  export * from './hr-thanks.type.js';
67
72
  export * from './hr-time-off.type.js';
73
+ export * from './hr-work-day.type.js';
74
+ export * from './hr-work-place.enum.js';
68
75
  export * from './localized-text.type.js';
@@ -6,6 +6,8 @@ export * from './hr-attendance-correction-status.enum.js';
6
6
  export * from './hr-attendance-source.enum.js';
7
7
  export * from './hr-attendance-state.enum.js';
8
8
  export * from './hr-attendance.type.js';
9
+ export * from './hr-calendar-feed-kind.enum.js';
10
+ export * from './hr-calendar-feed.type.js';
9
11
  export * from './hr-celebration.type.js';
10
12
  export * from './hr-checklist-kind.enum.js';
11
13
  export * from './hr-compensation.type.js';
@@ -49,11 +51,14 @@ export * from './hr-planning-entry-kind.enum.js';
49
51
  export * from './hr-planning.type.js';
50
52
  export * from './hr-probation-outcome.enum.js';
51
53
  export * from './hr-probation.type.js';
54
+ export * from './hr-referral-outcome.enum.js';
55
+ export * from './hr-referral.type.js';
52
56
  export * from './hr-report.type.js';
53
57
  export * from './hr-resource-status.enum.js';
54
58
  export * from './hr-review-cycle-status.enum.js';
55
59
  export * from './hr-review-question-kind.enum.js';
56
60
  export * from './hr-review-status.enum.js';
61
+ export * from './hr-stand-in.type.js';
57
62
  export * from './hr-survey-audience.enum.js';
58
63
  export * from './hr-survey-group-kind.enum.js';
59
64
  export * from './hr-survey-question-kind.enum.js';
@@ -65,4 +70,6 @@ export * from './hr-team-role.enum.js';
65
70
  export * from './hr-team.type.js';
66
71
  export * from './hr-thanks.type.js';
67
72
  export * from './hr-time-off.type.js';
73
+ export * from './hr-work-day.type.js';
74
+ export * from './hr-work-place.enum.js';
68
75
  export * from './localized-text.type.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iveri/contracts",
3
- "version": "0.88.0",
3
+ "version": "0.90.0",
4
4
  "description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {