@iveri/contracts 0.108.0 → 0.109.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/api/social/index.d.ts +2 -0
- package/dist/api/social/index.js +2 -0
- package/dist/api/social/social-limits.constant.d.ts +8 -0
- package/dist/api/social/social-limits.constant.js +8 -0
- package/dist/api/social/social-moderation.type.d.ts +16 -0
- package/dist/api/social/social-post.type.d.ts +4 -0
- package/dist/api/social/social-refusal.enum.d.ts +5 -0
- package/dist/api/social/social-refusal.enum.js +5 -0
- package/dist/api/social/social-video-state.enum.d.ts +12 -0
- package/dist/api/social/social-video-state.enum.js +13 -0
- package/dist/api/social/social-video.type.d.ts +32 -0
- package/dist/api/social/social-video.type.js +1 -0
- package/package.json +1 -1
|
@@ -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';
|
package/dist/api/social/index.js
CHANGED
|
@@ -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 {};
|