@iveri/contracts 0.108.0 → 0.110.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.
@@ -0,0 +1,35 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { Nullable } from '../../type/nil.type.js';
3
+ /**
4
+ * Where a company's HR posts to Slack: one channel, through an incoming webhook the company's own Slack admin made.
5
+ *
6
+ * **The webhook address is never returned**, not masked and not truncated: it is the credential that posts into the
7
+ * channel. `webhookHost` answers the only question an HR person has about it, which service it points at.
8
+ */
9
+ export interface HrSlackChannel {
10
+ isConnected: boolean;
11
+ webhookHost: Nullable<string>;
12
+ /** The language posts are written in: everybody in a channel reads the same message. */
13
+ localeCode: string;
14
+ /** A post when somebody's time off is agreed: who and when, never why. */
15
+ postsApprovedTimeOff: boolean;
16
+ /** A post every working morning naming who is away that day, or saying everybody is in. */
17
+ postsDailyAbsences: boolean;
18
+ /** `HH:mm` in the company's own time zone. */
19
+ dailyPostTime: string;
20
+ /** The last day a morning post went out, `YYYY-MM-DD` in the company's time zone. */
21
+ lastDailyPostOn: Nullable<string>;
22
+ /** When Slack last refused a post, so HR can tell a channel that stopped working from a quiet one. */
23
+ lastFailedAt: Nullable<IsoDateTime>;
24
+ }
25
+ /**
26
+ * Every field is optional and an omitted one keeps its value. `webhookUrl: null` disconnects the channel, and a new
27
+ * address replaces the old one.
28
+ */
29
+ export interface HrUpdateSlackChannelRequest {
30
+ webhookUrl?: Nullable<string>;
31
+ localeCode?: string;
32
+ postsApprovedTimeOff?: boolean;
33
+ postsDailyAbsences?: boolean;
34
+ dailyPostTime?: string;
35
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -58,6 +58,7 @@ export * from './hr-resource-status.enum.js';
58
58
  export * from './hr-review-cycle-status.enum.js';
59
59
  export * from './hr-review-question-kind.enum.js';
60
60
  export * from './hr-review-status.enum.js';
61
+ export * from './hr-slack-channel.type.js';
61
62
  export * from './hr-stand-in.type.js';
62
63
  export * from './hr-survey-audience.enum.js';
63
64
  export * from './hr-survey-group-kind.enum.js';
@@ -58,6 +58,7 @@ export * from './hr-resource-status.enum.js';
58
58
  export * from './hr-review-cycle-status.enum.js';
59
59
  export * from './hr-review-question-kind.enum.js';
60
60
  export * from './hr-review-status.enum.js';
61
+ export * from './hr-slack-channel.type.js';
61
62
  export * from './hr-stand-in.type.js';
62
63
  export * from './hr-survey-audience.enum.js';
63
64
  export * from './hr-survey-group-kind.enum.js';
@@ -18,3 +18,5 @@ export * from './social-refusal.enum.js';
18
18
  export * from './social-report-reason.enum.js';
19
19
  export * from './social-report-target.enum.js';
20
20
  export * from './social-story.type.js';
21
+ export * from './social-video-state.enum.js';
22
+ export * from './social-video.type.js';
@@ -18,3 +18,5 @@ export * from './social-refusal.enum.js';
18
18
  export * from './social-report-reason.enum.js';
19
19
  export * from './social-report-target.enum.js';
20
20
  export * from './social-story.type.js';
21
+ export * from './social-video-state.enum.js';
22
+ export * from './social-video.type.js';
@@ -14,9 +14,17 @@ export declare const SOCIAL_LIMITS: {
14
14
  readonly APPEAL_STATEMENT_MAX: 2000;
15
15
  readonly MODERATION_NOTE_MAX: 2000;
16
16
  readonly IMAGE_BYTES_MAX: number;
17
+ readonly VIDEO_BYTES_MAX: number;
18
+ /** A longer video is refused, never cut short. */
19
+ readonly VIDEO_SECONDS_MAX: 60;
17
20
  readonly MINIMUM_AGE: 16;
18
21
  };
19
22
  /** The characters a handle may use, in the form they are stored. */
20
23
  export declare const SOCIAL_HANDLE_PATTERN: RegExp;
21
24
  /** The version of the terms a new member accepts. A placeholder until the real terms exist. */
22
25
  export declare const SOCIAL_TERMS_VERSION = "2026-11-draft";
26
+ /**
27
+ * What a file picker offers for a video. Only a hint for the picker: the API decides by decoding,
28
+ * never by the type a browser or phone reports.
29
+ */
30
+ export declare const SOCIAL_VIDEO_MIME_TYPES: readonly ["video/mp4", "video/quicktime", "video/webm", "video/x-matroska"];
@@ -14,9 +14,17 @@ export const SOCIAL_LIMITS = {
14
14
  APPEAL_STATEMENT_MAX: 2000,
15
15
  MODERATION_NOTE_MAX: 2000,
16
16
  IMAGE_BYTES_MAX: 15 * 1024 * 1024,
17
+ VIDEO_BYTES_MAX: 100 * 1024 * 1024,
18
+ /** A longer video is refused, never cut short. */
19
+ VIDEO_SECONDS_MAX: 60,
17
20
  MINIMUM_AGE: 16,
18
21
  };
19
22
  /** The characters a handle may use, in the form they are stored. */
20
23
  export const SOCIAL_HANDLE_PATTERN = /^[a-z0-9](?:[a-z0-9._]*[a-z0-9])?$/;
21
24
  /** The version of the terms a new member accepts. A placeholder until the real terms exist. */
22
25
  export const SOCIAL_TERMS_VERSION = '2026-11-draft';
26
+ /**
27
+ * What a file picker offers for a video. Only a hint for the picker: the API decides by decoding,
28
+ * never by the type a browser or phone reports.
29
+ */
30
+ export const SOCIAL_VIDEO_MIME_TYPES = ['video/mp4', 'video/quicktime', 'video/webm', 'video/x-matroska'];
@@ -9,6 +9,7 @@ import type { SocialMemberCard } from './social-member.type.js';
9
9
  import type { SocialModerationReason } from './social-moderation-reason.enum.js';
10
10
  import type { SocialReportReason } from './social-report-reason.enum.js';
11
11
  import type { SocialReportTarget } from './social-report-target.enum.js';
12
+ import type { SocialVideoState } from './social-video-state.enum.js';
12
13
  export interface CreateSocialReportRequest {
13
14
  targetType: SocialReportTarget;
14
15
  targetId: UUID;
@@ -35,8 +36,23 @@ export interface CreateSocialAppealRequest {
35
36
  export interface SocialCaseEvidence {
36
37
  text: Nullable<string>;
37
38
  imageUrls: string[];
39
+ /** A reported video's poster only. Playing it goes through `SocialCaseVideoView`, which is logged. */
40
+ videos: SocialCaseVideo[];
38
41
  createdAt: Nullable<IsoDateTime>;
39
42
  }
43
+ export interface SocialCaseVideo {
44
+ id: UUID;
45
+ state: SocialVideoState;
46
+ width: number;
47
+ height: number;
48
+ durationMs: number;
49
+ posterUrl: Nullable<string>;
50
+ }
51
+ /** The address of a reported video, handed out once per request and written to the access log. */
52
+ export interface SocialCaseVideoView {
53
+ url: string;
54
+ expiresAt: IsoDateTime;
55
+ }
40
56
  export interface SocialCaseSummary {
41
57
  id: UUID;
42
58
  targetType: SocialReportTarget;
@@ -3,11 +3,14 @@ import type { Nullable } from '../../type/nil.type.js';
3
3
  import type { UUID } from '../../type/uuid.type.js';
4
4
  import type { SocialImage } from './social-image.type.js';
5
5
  import type { SocialMemberCard } from './social-member.type.js';
6
+ import type { SocialVideo } from './social-video.type.js';
6
7
  export interface SocialPost {
7
8
  id: UUID;
8
9
  author: SocialMemberCard;
9
10
  caption: Nullable<string>;
10
11
  images: SocialImage[];
12
+ /** A post carries photographs or one video, never both. */
13
+ video: Nullable<SocialVideo>;
11
14
  commentsDisabled: boolean;
12
15
  likeCount: number;
13
16
  commentCount: number;
@@ -17,6 +20,7 @@ export interface SocialPost {
17
20
  createdAt: IsoDateTime;
18
21
  editedAt: Nullable<IsoDateTime>;
19
22
  }
23
+ /** A photograph or a video upload. A post names up to ten photographs or exactly one video. */
20
24
  export interface CreateSocialPostMedia {
21
25
  id: UUID;
22
26
  altText?: Nullable<string>;
@@ -20,6 +20,11 @@ export declare enum SocialRefusal {
20
20
  IMAGE_UNREADABLE = "image-unreadable",
21
21
  IMAGE_TOO_LARGE = "image-too-large",
22
22
  MEDIA_UNAVAILABLE = "media-unavailable",
23
+ VIDEO_UNREADABLE = "video-unreadable",
24
+ VIDEO_TOO_LARGE = "video-too-large",
25
+ VIDEO_TOO_LONG = "video-too-long",
26
+ /** A post carries photographs or one video, never both and never two videos. */
27
+ POST_MEDIA_MIXED = "post-media-mixed",
23
28
  POST_EMPTY = "post-empty",
24
29
  COMMENTS_DISABLED = "comments-disabled",
25
30
  CANNOT_FOLLOW_SELF = "cannot-follow-self",
@@ -21,6 +21,11 @@ export var SocialRefusal;
21
21
  SocialRefusal["IMAGE_UNREADABLE"] = "image-unreadable";
22
22
  SocialRefusal["IMAGE_TOO_LARGE"] = "image-too-large";
23
23
  SocialRefusal["MEDIA_UNAVAILABLE"] = "media-unavailable";
24
+ SocialRefusal["VIDEO_UNREADABLE"] = "video-unreadable";
25
+ SocialRefusal["VIDEO_TOO_LARGE"] = "video-too-large";
26
+ SocialRefusal["VIDEO_TOO_LONG"] = "video-too-long";
27
+ /** A post carries photographs or one video, never both and never two videos. */
28
+ SocialRefusal["POST_MEDIA_MIXED"] = "post-media-mixed";
24
29
  SocialRefusal["POST_EMPTY"] = "post-empty";
25
30
  SocialRefusal["COMMENTS_DISABLED"] = "comments-disabled";
26
31
  SocialRefusal["CANNOT_FOLLOW_SELF"] = "cannot-follow-self";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Where a posted video is between upload and playback.
3
+ *
4
+ * Only its author ever sees one that is not `ready`: a post carrying such a video is shown to nobody
5
+ * else until processing finishes.
6
+ */
7
+ export declare enum SocialVideoState {
8
+ PROCESSING = "processing",
9
+ READY = "ready",
10
+ /** It could not be decoded or encoded. Nothing will change it; the author deletes the post. */
11
+ FAILED = "failed"
12
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Where a posted video is between upload and playback.
3
+ *
4
+ * Only its author ever sees one that is not `ready`: a post carrying such a video is shown to nobody
5
+ * else until processing finishes.
6
+ */
7
+ export var SocialVideoState;
8
+ (function (SocialVideoState) {
9
+ SocialVideoState["PROCESSING"] = "processing";
10
+ SocialVideoState["READY"] = "ready";
11
+ /** It could not be decoded or encoded. Nothing will change it; the author deletes the post. */
12
+ SocialVideoState["FAILED"] = "failed";
13
+ })(SocialVideoState || (SocialVideoState = {}));
@@ -0,0 +1,32 @@
1
+ import type { Nullable } from '../../type/nil.type.js';
2
+ import type { UUID } from '../../type/uuid.type.js';
3
+ import type { SocialImageUrls } from './social-image.type.js';
4
+ import type { SocialVideoState } from './social-video-state.enum.js';
5
+ /**
6
+ * A short video on a post.
7
+ *
8
+ * `url` and `posterUrls` are signed like a photograph's and are null until the video is `ready`.
9
+ * Everybody but the author only ever receives a ready one.
10
+ */
11
+ export interface SocialVideo {
12
+ id: UUID;
13
+ state: SocialVideoState;
14
+ width: number;
15
+ height: number;
16
+ durationMs: number;
17
+ /** A solid colour to paint while the poster loads. */
18
+ placeholderColor: string;
19
+ altText: Nullable<string>;
20
+ /** The still shown before playing, in the three photograph sizes. */
21
+ posterUrls: Nullable<SocialImageUrls>;
22
+ /** One MP4 (H.264 and AAC) every browser and phone plays. */
23
+ url: Nullable<string>;
24
+ }
25
+ /** What a video upload answers. It is decoded enough to be refused at once; encoding happens afterwards. */
26
+ export interface SocialVideoUpload {
27
+ id: UUID;
28
+ state: SocialVideoState;
29
+ width: number;
30
+ height: number;
31
+ durationMs: number;
32
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iveri/contracts",
3
- "version": "0.108.0",
3
+ "version": "0.110.0",
4
4
  "description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {