@_linked/translation 0.9.3 → 0.9.5

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/package.json +5 -4
  2. package/src/archive.ts +0 -914
  3. package/src/authorization.ts +0 -56
  4. package/src/backend.ts +0 -2
  5. package/src/cdn-loader.ts +0 -264
  6. package/src/checks.ts +0 -413
  7. package/src/compile.ts +0 -168
  8. package/src/core/messages.ts +0 -139
  9. package/src/data/translation.ttl +0 -489
  10. package/src/discovery.ts +0 -594
  11. package/src/exchange.ts +0 -437
  12. package/src/export.ts +0 -138
  13. package/src/formats/csv.ts +0 -467
  14. package/src/formats/json.ts +0 -596
  15. package/src/formats/xliff.ts +0 -733
  16. package/src/import.ts +0 -648
  17. package/src/index.ts +0 -201
  18. package/src/key-sync-node.ts +0 -269
  19. package/src/key-sync.ts +0 -208
  20. package/src/key-version.ts +0 -207
  21. package/src/languages.ts +0 -102
  22. package/src/linked-discovery.ts +0 -385
  23. package/src/message-format.ts +0 -214
  24. package/src/mt.ts +0 -253
  25. package/src/ontologies/translation.register.ts +0 -17
  26. package/src/ontologies/translation.ts +0 -239
  27. package/src/package.ts +0 -14
  28. package/src/react.tsx +0 -378
  29. package/src/records.ts +0 -181
  30. package/src/release.ts +0 -754
  31. package/src/shape-catalog.ts +0 -198
  32. package/src/shapes/GlossaryTerm.ts +0 -61
  33. package/src/shapes/TranslationInventoryOrigin.ts +0 -131
  34. package/src/shapes/TranslationKey.ts +0 -183
  35. package/src/shapes/TranslationKeyVersion.ts +0 -77
  36. package/src/shapes/TranslationLanguage.ts +0 -51
  37. package/src/shapes/TranslationProvider.ts +0 -1927
  38. package/src/shapes/TranslationRelease.ts +0 -114
  39. package/src/shapes/TranslationRevision.ts +0 -105
  40. package/src/shapes/TranslationUnit.ts +0 -72
  41. package/src/shapes/index.ts +0 -13
@@ -1,114 +0,0 @@
1
- import { Shape } from '@_linked/core/shapes/Shape';
2
- import { literalProperty, objectProperty } from '@_linked/core/shapes/SHACL';
3
- import * as xsd from '@_linked/xsd/ontologies/xsd';
4
- import { Server } from '@_linked/server-utils/utils/Server';
5
- import { tr } from '../ontologies/translation.js';
6
- import { linkedShape } from '../package.js';
7
- import type { TranslationReleaseRecord } from '../records.js';
8
-
9
- /**
10
- * Graph metadata for an immutable translation release. Key/language selections
11
- * live in the content-addressed manifest rather than repeated RDF predicates.
12
- */
13
- @linkedShape
14
- export class TranslationRelease extends Shape {
15
- static targetClass = tr.TranslationRelease;
16
-
17
- @objectProperty({ path: tr.ofApplication, maxCount: 1 })
18
- get ofApplication(): string {
19
- return '';
20
- }
21
-
22
- @objectProperty({ path: tr.branch, maxCount: 1 })
23
- get branch(): string {
24
- return '';
25
- }
26
-
27
- @literalProperty({ path: tr.releaseId, maxCount: 1 })
28
- get releaseId(): string {
29
- return '';
30
- }
31
-
32
- @literalProperty({ path: tr.buildId, maxCount: 1 })
33
- get buildId(): string {
34
- return '';
35
- }
36
-
37
- @literalProperty({ path: tr.channel, maxCount: 1 })
38
- get channel(): string {
39
- return 'preview';
40
- }
41
-
42
- @literalProperty({ path: tr.status, maxCount: 1 })
43
- get status(): string {
44
- return 'draft';
45
- }
46
-
47
- @literalProperty({ path: tr.contractSetHash, maxCount: 1 })
48
- get contractSetHash(): string {
49
- return '';
50
- }
51
-
52
- @literalProperty({ path: tr.manifestHash, maxCount: 1 })
53
- get manifestHash(): string {
54
- return '';
55
- }
56
-
57
- @literalProperty({ path: tr.hotfixSequence, datatype: xsd.integer, maxCount: 1 })
58
- get hotfixSequence(): number {
59
- return 0;
60
- }
61
-
62
- @literalProperty({ path: tr.createdAt, datatype: xsd.dateTime, maxCount: 1 })
63
- get createdAt(): Date {
64
- return new Date(0);
65
- }
66
-
67
- @literalProperty({ path: tr.publishedAt, datatype: xsd.dateTime, maxCount: 1 })
68
- get publishedAt(): Date {
69
- return new Date(0);
70
- }
71
-
72
- @literalProperty({ path: tr.supportedUntil, datatype: xsd.dateTime, maxCount: 1 })
73
- get supportedUntil(): Date {
74
- return new Date(0);
75
- }
76
-
77
- /** Canonical JSON summary; the full per-language detail also lives in the manifest. */
78
- @literalProperty({ path: tr.qualitySummary, maxCount: 1 })
79
- get qualitySummary(): string {
80
- return '';
81
- }
82
-
83
- @objectProperty({ path: tr.supersedes, shape: TranslationRelease, maxCount: 1 })
84
- get supersedes(): TranslationRelease {
85
- return undefined as any;
86
- }
87
-
88
- static list(data: { appId: string }) {
89
- return Server.call(this, 'listReleases', data) as Promise<
90
- TranslationReleaseRecord[]
91
- >;
92
- }
93
-
94
- static createRelease(
95
- data: Omit<TranslationReleaseRecord, 'id' | 'createdAt'> & {
96
- createdAt?: string;
97
- },
98
- ) {
99
- return Server.call(this, 'createRelease', data) as Promise<
100
- TranslationReleaseRecord
101
- >;
102
- }
103
-
104
- static advanceHotfix(data: {
105
- id: string;
106
- expectedSequence: number;
107
- hotfixSequence: number;
108
- manifestHash: string;
109
- }) {
110
- return Server.call(this, 'advanceReleaseHotfix', data) as Promise<
111
- TranslationReleaseRecord
112
- >;
113
- }
114
- }
@@ -1,105 +0,0 @@
1
- import { Shape } from '@_linked/core/shapes/Shape';
2
- import { literalProperty, objectProperty } from '@_linked/core/shapes/SHACL';
3
- import * as xsd from '@_linked/xsd/ontologies/xsd';
4
- import { tr } from '../ontologies/translation.js';
5
- import { linkedShape } from '../package.js';
6
- import { TranslationKey } from './TranslationKey.js';
7
- import { TranslationKeyVersion } from './TranslationKeyVersion.js';
8
-
9
- /**
10
- * One authored value for a (key, language) cell — append-only (Plan 017 AD-P).
11
- * A single primitive powers three workflows: change HISTORY (every direct edit
12
- * records a `status:'applied'` revision), translator PROPOSALS (`proposed`,
13
- * decided by a reviewer), and MT SUGGESTIONS (`suggested`, authorKind
14
- * `machine`). The {@link TranslationUnit} stays the fast runtime/grid read
15
- * path; revisions are never updated in place except their decision fields
16
- * (`status`, `decidedAt`, `decidedBy`).
17
- */
18
- @linkedShape
19
- export class TranslationRevision extends Shape {
20
- static targetClass = tr.TranslationRevision;
21
-
22
- /** IRI of the owning Application (same app-scoping law as Key/Unit). */
23
- @objectProperty({ path: tr.ofApplication, maxCount: 1 })
24
- get ofApplication(): string {
25
- return '';
26
- }
27
-
28
- /** The key, NOT the unit — revisions can exist before any unit does. */
29
- @objectProperty({ path: tr.ofKey, shape: TranslationKey, maxCount: 1 })
30
- get ofKey(): TranslationKey {
31
- return undefined as any;
32
- }
33
-
34
- @objectProperty({
35
- path: tr.ofKeyVersion,
36
- shape: TranslationKeyVersion,
37
- maxCount: 1,
38
- })
39
- get ofKeyVersion(): TranslationKeyVersion {
40
- return undefined as any;
41
- }
42
-
43
- /** BCP-47 language tag, e.g. "es", "zh-Hans". */
44
- @literalProperty({ path: tr.language, maxCount: 1 })
45
- get language(): string {
46
- return '';
47
- }
48
-
49
- @literalProperty({ path: tr.text, maxCount: 1 })
50
- get text(): string {
51
- return '';
52
- }
53
-
54
- /** applied | proposed | suggested | accepted | rejected | superseded. */
55
- @literalProperty({ path: tr.status, maxCount: 1 })
56
- get status(): string {
57
- return 'applied';
58
- }
59
-
60
- /** WebID of the human author, or the MT provider IRI. */
61
- @objectProperty({ path: tr.author, maxCount: 1 })
62
- get author(): string {
63
- return '';
64
- }
65
-
66
- /** 'human' | 'machine'. */
67
- @literalProperty({ path: tr.authorKind, maxCount: 1 })
68
- get authorKind(): string {
69
- return 'human';
70
- }
71
-
72
- /** MT provider key ('claude', 'deepl', …) when authorKind is 'machine'. */
73
- @literalProperty({ path: tr.mtProvider, maxCount: 1 })
74
- get mtProvider(): string {
75
- return '';
76
- }
77
-
78
- /** The unit's text when this revision was authored (conflict detection). */
79
- @literalProperty({ path: tr.basedOnText, maxCount: 1 })
80
- get basedOnText(): string {
81
- return '';
82
- }
83
-
84
- /** Free-text translator/reviewer comment. */
85
- @literalProperty({ path: tr.note, maxCount: 1 })
86
- get note(): string {
87
- return '';
88
- }
89
-
90
- @literalProperty({ path: tr.createdAt, datatype: xsd.dateTime, maxCount: 1 })
91
- get createdAt(): Date {
92
- return new Date(0);
93
- }
94
-
95
- @literalProperty({ path: tr.decidedAt, datatype: xsd.dateTime, maxCount: 1 })
96
- get decidedAt(): Date {
97
- return new Date(0);
98
- }
99
-
100
- /** WebID of the reviewer who accepted/rejected a pending revision. */
101
- @objectProperty({ path: tr.decidedBy, maxCount: 1 })
102
- get decidedBy(): string {
103
- return '';
104
- }
105
- }
@@ -1,72 +0,0 @@
1
- import { Shape } from '@_linked/core/shapes/Shape';
2
- import { literalProperty, objectProperty } from '@_linked/core/shapes/SHACL';
3
- import * as xsd from '@_linked/xsd/ontologies/xsd';
4
- import { tr } from '../ontologies/translation.js';
5
- import { linkedShape } from '../package.js';
6
- import { TranslationKey } from './TranslationKey.js';
7
- import { TranslationKeyVersion } from './TranslationKeyVersion.js';
8
-
9
- /**
10
- * One language's value for a {@link TranslationKey} (Plan 014 AD-H). Explicit
11
- * per-language node (not `rdf:langString`) so it can be filtered per-language
12
- * through the LINKED DSL AND carry management metadata — review `state` and
13
- * provenance — that a bare literal cannot hold.
14
- */
15
- @linkedShape
16
- export class TranslationUnit extends Shape {
17
- static targetClass = tr.TranslationUnit;
18
-
19
- /** IRI of the owning Application (explicitly app-scoped per Plan 014 AD-I). */
20
- @objectProperty({ path: tr.ofApplication, maxCount: 1 })
21
- get ofApplication(): string {
22
- return '';
23
- }
24
-
25
- @objectProperty({ path: tr.ofKey, shape: TranslationKey, maxCount: 1 })
26
- get ofKey(): TranslationKey {
27
- return undefined as any;
28
- }
29
-
30
- @objectProperty({
31
- path: tr.ofKeyVersion,
32
- shape: TranslationKeyVersion,
33
- maxCount: 1,
34
- })
35
- get ofKeyVersion(): TranslationKeyVersion {
36
- return undefined as any;
37
- }
38
-
39
- /** BCP-47 language tag, e.g. "es", "zh-Hans". */
40
- @literalProperty({ path: tr.language, maxCount: 1 })
41
- get language(): string {
42
- return '';
43
- }
44
-
45
- @literalProperty({ path: tr.text, maxCount: 1 })
46
- get text(): string {
47
- return '';
48
- }
49
-
50
- /** untranslated | machine | reviewed | stale. */
51
- @literalProperty({ path: tr.state, maxCount: 1 })
52
- get state(): string {
53
- return 'untranslated';
54
- }
55
-
56
- @literalProperty({ path: tr.updatedAt, datatype: xsd.dateTime, maxCount: 1 })
57
- get updatedAt(): Date {
58
- return new Date(0);
59
- }
60
-
61
- /** WebID (IRI) of the last editor. */
62
- @objectProperty({ path: tr.updatedBy, maxCount: 1 })
63
- get updatedBy(): string {
64
- return '';
65
- }
66
-
67
- /** Current-value provenance (`tm` for exact translation-memory reuse). */
68
- @literalProperty({ path: tr.origin, maxCount: 1 })
69
- get origin(): string {
70
- return '';
71
- }
72
- }
@@ -1,13 +0,0 @@
1
- // Registers every shape this package defines. Side-effect imports only: a
2
- // consumer (or the host app) can load this one module to get the full set of
3
- // shapes registered, without pulling in components, providers or other exports.
4
- import '../ontologies/translation.register.js';
5
-
6
- import './TranslationKey.js';
7
- import './TranslationKeyVersion.js';
8
- import './TranslationRelease.js';
9
- import './TranslationUnit.js';
10
- import './TranslationRevision.js';
11
- import './GlossaryTerm.js';
12
- import './TranslationInventoryOrigin.js';
13
- import './TranslationLanguage.js';