@iveri/contracts 0.140.0 → 0.142.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/README.md +8 -0
- package/dist/api/chat/chat-conversation.type.d.ts +7 -0
- package/dist/api/chat/chat-message.type.d.ts +7 -0
- package/dist/api/chat/chat-person.type.d.ts +5 -0
- package/dist/api/localization/index.d.ts +2 -0
- package/dist/api/localization/index.js +2 -0
- package/dist/api/localization/translation-match-kind.enum.d.ts +17 -0
- package/dist/api/localization/translation-match-kind.enum.js +18 -0
- package/dist/api/localization/translation-memory.type.d.ts +78 -0
- package/dist/api/localization/translation-memory.type.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -212,6 +212,9 @@ frontend build pulls and commits; `RenderBody`/`RenderedMessage` is what a backe
|
|
|
212
212
|
needs a string in the _recipient's_ language. `Locale`, `Namespace`, `Message` with its
|
|
213
213
|
`MessageVariable` declarations, `Translation`, `Release` and `ReleaseDiff` carry the authoring
|
|
214
214
|
surface the translator panel is written against, with `TranslationStatus` and `VariableType`.
|
|
215
|
+
`TranslationMemory` (what other messages already say for the same source text) and
|
|
216
|
+
`TranslationConsistencyPage` (source texts translated more than one way in a locale) are the
|
|
217
|
+
translator aids, with `TranslationMatchKind`.
|
|
215
218
|
|
|
216
219
|
`Locale` is a row rather than an enum on purpose — see the type's own note. Nothing in the
|
|
217
220
|
platform branches on _which_ language a string is in, so encoding the set in a type would make
|
|
@@ -319,6 +322,11 @@ Conduit's outbox.
|
|
|
319
322
|
`UniboxAgents` under `@iveri/contracts/unibox`, so the inbox picks agents by name.
|
|
320
323
|
- Version `0.139.0` adds a trainer's notes on a member: `GymTrainerNote`, `GymTrainerNotes`, `SaveGymTrainerNoteRequest`,
|
|
321
324
|
`GymMyTrainerNote` and the `GymRefusal` member `not-their-trainer` under `@iveri/contracts/gym`.
|
|
325
|
+
- Version `0.142.0` adds `isErased` on `ChatPersonCard`, `ChatParticipant` and `ChatMessageSender`, and
|
|
326
|
+
`senderIsErased` on `ChatLastMessagePreview` and `ChatReplyPreview`, so a client can say "Deleted account".
|
|
327
|
+
- Version `0.141.0` adds `TranslationMemory`, `TranslationMemorySuggestion`, `TranslationUse`, the
|
|
328
|
+
`TranslationConsistencyPage`/`Group`/`Variant` shapes and the `TranslationMatchKind` enum under
|
|
329
|
+
`@iveri/contracts/localization`, for translation memory and the consistency report.
|
|
322
330
|
- Version `0.140.0` adds `DeleteOwnAccountBody` and the `IdentityRefusal` enum (`password-incorrect`,
|
|
323
331
|
`not-self-registered`) under `@iveri/contracts/identity`, for deleting one's own account at `DELETE /auth/me`.
|
|
324
332
|
- Version `0.134.0` adds `delivery:job:create-any`, `delivery:job:read-any` and `delivery:job:operate-any`, so a shop's
|
|
@@ -35,6 +35,8 @@ export interface ChatLastMessagePreview {
|
|
|
35
35
|
*/
|
|
36
36
|
systemVariables: Nullable<Record<string, string>>;
|
|
37
37
|
senderName: Nullable<string>;
|
|
38
|
+
/** The sender deleted their Baasi account, so `senderName` is empty; see {@link ChatPersonCard.isErased}. */
|
|
39
|
+
senderIsErased: boolean;
|
|
38
40
|
isOwn: boolean;
|
|
39
41
|
isDeleted: boolean;
|
|
40
42
|
sentAt: IsoDateTime;
|
|
@@ -96,6 +98,11 @@ export interface ChatParticipant {
|
|
|
96
98
|
lastReadSeq: Nullable<number>;
|
|
97
99
|
lastActiveAt: Nullable<IsoDateTime>;
|
|
98
100
|
isMe: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* They deleted their Baasi account: their name and photograph are gone, so `displayName` is empty and a client says
|
|
103
|
+
* "Deleted account" in its own words. Never true of an outside app's user, whose app may bring the same id back.
|
|
104
|
+
*/
|
|
105
|
+
isErased: boolean;
|
|
99
106
|
}
|
|
100
107
|
export interface ChatConversation extends ChatConversationSummary {
|
|
101
108
|
participants: ChatParticipant[];
|
|
@@ -8,12 +8,19 @@ export interface ChatMessageSender {
|
|
|
8
8
|
/** The name this conversation shows: a product's label for an embedded one. */
|
|
9
9
|
displayName: string;
|
|
10
10
|
avatar: Nullable<ChatImage>;
|
|
11
|
+
/**
|
|
12
|
+
* They deleted their Baasi account: their name and photograph are gone, so `displayName` is empty and a client says
|
|
13
|
+
* "Deleted account" in its own words. Never true of an outside app's user, whose app may bring the same id back.
|
|
14
|
+
*/
|
|
15
|
+
isErased: boolean;
|
|
11
16
|
}
|
|
12
17
|
/** The message a reply points at, enough to draw the quote above it. */
|
|
13
18
|
export interface ChatReplyPreview {
|
|
14
19
|
id: UUID;
|
|
15
20
|
seq: number;
|
|
16
21
|
senderName: Nullable<string>;
|
|
22
|
+
/** The sender deleted their Baasi account, so `senderName` is empty; see {@link ChatMessageSender.isErased}. */
|
|
23
|
+
senderIsErased: boolean;
|
|
17
24
|
kind: ChatMessageKind;
|
|
18
25
|
excerpt: Nullable<string>;
|
|
19
26
|
isDeleted: boolean;
|
|
@@ -14,6 +14,11 @@ export interface ChatPersonCard {
|
|
|
14
14
|
avatar: Nullable<ChatImage>;
|
|
15
15
|
/** Null when they hide it, or when the reader shares no conversation with them. */
|
|
16
16
|
lastActiveAt: Nullable<IsoDateTime>;
|
|
17
|
+
/**
|
|
18
|
+
* They deleted their Baasi account: their name and photograph are gone, so `displayName` is empty and a client says
|
|
19
|
+
* "Deleted account" in its own words. Never true of an outside app's user, whose app may bring the same id back.
|
|
20
|
+
*/
|
|
21
|
+
isErased: boolean;
|
|
17
22
|
}
|
|
18
23
|
export interface ChatSettings {
|
|
19
24
|
/** Whether people who share a conversation with me can see when I was last active. */
|
|
@@ -4,6 +4,8 @@ export * from './message.type.js';
|
|
|
4
4
|
export * from './namespace.type.js';
|
|
5
5
|
export * from './release.type.js';
|
|
6
6
|
export * from './render.type.js';
|
|
7
|
+
export * from './translation-match-kind.enum.js';
|
|
8
|
+
export * from './translation-memory.type.js';
|
|
7
9
|
export * from './translation-status.enum.js';
|
|
8
10
|
export * from './translation.type.js';
|
|
9
11
|
export * from './variable-type.enum.js';
|
|
@@ -4,6 +4,8 @@ export * from './message.type.js';
|
|
|
4
4
|
export * from './namespace.type.js';
|
|
5
5
|
export * from './release.type.js';
|
|
6
6
|
export * from './render.type.js';
|
|
7
|
+
export * from './translation-match-kind.enum.js';
|
|
8
|
+
export * from './translation-memory.type.js';
|
|
7
9
|
export * from './translation-status.enum.js';
|
|
8
10
|
export * from './translation.type.js';
|
|
9
11
|
export * from './variable-type.enum.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a translation memory suggestion's source text relates to the message being translated.
|
|
3
|
+
*
|
|
4
|
+
* Two kinds and no third, because the panel shows them differently and a translator acts on them
|
|
5
|
+
* differently: an exact match is the same English, so its translation can be taken as it stands;
|
|
6
|
+
* a similar one is different English, so its source is shown beside it and the translator decides
|
|
7
|
+
* what to change.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum TranslationMatchKind {
|
|
10
|
+
/** The same source text once runs of whitespace are collapsed and the ends trimmed. */
|
|
11
|
+
EXACT = "exact",
|
|
12
|
+
/**
|
|
13
|
+
* Source text that is close but not the same, scored by trigram similarity. A difference of
|
|
14
|
+
* case alone lands here too, because `Cancel` and `cancel` can need different words.
|
|
15
|
+
*/
|
|
16
|
+
SIMILAR = "similar"
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a translation memory suggestion's source text relates to the message being translated.
|
|
3
|
+
*
|
|
4
|
+
* Two kinds and no third, because the panel shows them differently and a translator acts on them
|
|
5
|
+
* differently: an exact match is the same English, so its translation can be taken as it stands;
|
|
6
|
+
* a similar one is different English, so its source is shown beside it and the translator decides
|
|
7
|
+
* what to change.
|
|
8
|
+
*/
|
|
9
|
+
export var TranslationMatchKind;
|
|
10
|
+
(function (TranslationMatchKind) {
|
|
11
|
+
/** The same source text once runs of whitespace are collapsed and the ends trimmed. */
|
|
12
|
+
TranslationMatchKind["EXACT"] = "exact";
|
|
13
|
+
/**
|
|
14
|
+
* Source text that is close but not the same, scored by trigram similarity. A difference of
|
|
15
|
+
* case alone lands here too, because `Cancel` and `cancel` can need different words.
|
|
16
|
+
*/
|
|
17
|
+
TranslationMatchKind["SIMILAR"] = "similar";
|
|
18
|
+
})(TranslationMatchKind || (TranslationMatchKind = {}));
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { Paginated } from '../../type/paginated.type.js';
|
|
2
|
+
import type { TranslationMatchKind } from './translation-match-kind.enum.js';
|
|
3
|
+
import type { TranslationStatus } from './translation-status.enum.js';
|
|
4
|
+
/** One message that carries a given translation: where to find it, and how far along it is. */
|
|
5
|
+
export interface TranslationUse {
|
|
6
|
+
namespaceKey: string;
|
|
7
|
+
messageKey: string;
|
|
8
|
+
status: TranslationStatus;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* One way another message already says this in the target language.
|
|
12
|
+
*
|
|
13
|
+
* Grouped by the translated text rather than listed per message: when `Cancel` is `Отмена` in
|
|
14
|
+
* twelve namespaces, twelve identical rows bury the one that differs. `useCount` says how many
|
|
15
|
+
* messages carry it and `uses` names a few of them, so a translator can open the one they trust.
|
|
16
|
+
*/
|
|
17
|
+
export interface TranslationMemorySuggestion {
|
|
18
|
+
matchKind: TranslationMatchKind;
|
|
19
|
+
/** 1 for an exact match; the trigram similarity, between 0 and 1, for a similar one. */
|
|
20
|
+
similarity: number;
|
|
21
|
+
/** The other message's source text, shown so a similar match's difference is visible. */
|
|
22
|
+
sourceValue: string;
|
|
23
|
+
/** Its translation in the requested locale, as stored. ICU MessageFormat. */
|
|
24
|
+
value: string;
|
|
25
|
+
/** How many messages carry this source and this translation. */
|
|
26
|
+
useCount: number;
|
|
27
|
+
/** At most five of them, approved ones first. */
|
|
28
|
+
uses: TranslationUse[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* `GET /api/v1/namespaces/:key/messages/:messageKey/translations/:localeCode/memory`.
|
|
32
|
+
*
|
|
33
|
+
* What other messages in the workspace already say in this locale for the same or nearly the same
|
|
34
|
+
* source text. It reads and never writes: taking a suggestion fills the editor, and the translator
|
|
35
|
+
* still saves it through the ordinary write, with its placeholder check.
|
|
36
|
+
*/
|
|
37
|
+
export interface TranslationMemory {
|
|
38
|
+
localeCode: string;
|
|
39
|
+
sourceLocaleCode: string;
|
|
40
|
+
/** The message's own source text, which every suggestion is compared against. */
|
|
41
|
+
sourceValue: string;
|
|
42
|
+
/** Exact matches first, then similar ones by score; at most ten. */
|
|
43
|
+
suggestions: TranslationMemorySuggestion[];
|
|
44
|
+
}
|
|
45
|
+
/** One spelling a source text has in a locale, and the messages that use it. */
|
|
46
|
+
export interface TranslationConsistencyVariant {
|
|
47
|
+
/** The translation, as stored. Two variants differ once runs of whitespace are collapsed. */
|
|
48
|
+
value: string;
|
|
49
|
+
useCount: number;
|
|
50
|
+
/** At most twenty of the messages, approved ones first. */
|
|
51
|
+
uses: TranslationUse[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* One source text that the workspace translates into one locale in more than one way.
|
|
55
|
+
*
|
|
56
|
+
* Not necessarily a mistake: `Open` as a button and `Open` as a status are one English word and
|
|
57
|
+
* two Georgian ones. The report says where the words differ; the translator decides whether they
|
|
58
|
+
* should.
|
|
59
|
+
*/
|
|
60
|
+
export interface TranslationConsistencyGroup {
|
|
61
|
+
/** The source text, with runs of whitespace collapsed. Compared with case kept. */
|
|
62
|
+
sourceValue: string;
|
|
63
|
+
/** Messages with this source text that have a translation in the locale. */
|
|
64
|
+
messageCount: number;
|
|
65
|
+
/** Most used first. Always two or more. */
|
|
66
|
+
variants: TranslationConsistencyVariant[];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* `GET /api/v1/translation-consistency?localeCode=&namespaceKey=`.
|
|
70
|
+
*
|
|
71
|
+
* Groups ordered by how many messages they touch. With `namespaceKey`, only groups with at least
|
|
72
|
+
* one message in that namespace — but each group still lists every variant in the workspace,
|
|
73
|
+
* because the inconsistency is between namespaces.
|
|
74
|
+
*/
|
|
75
|
+
export interface TranslationConsistencyPage extends Paginated<TranslationConsistencyGroup> {
|
|
76
|
+
localeCode: string;
|
|
77
|
+
sourceLocaleCode: string;
|
|
78
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|