@proposit/shared 0.7.1 → 0.8.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-client/argument/batch.d.ts +46 -9
- package/dist/api-client/argument/batch.d.ts.map +1 -1
- package/dist/api-client/argument/claims.d.ts +192 -44
- package/dist/api-client/argument/claims.d.ts.map +1 -1
- package/dist/api-client/argument/index.d.ts +198 -50
- package/dist/api-client/argument/index.d.ts.map +1 -1
- package/dist/api-client/user/citations.d.ts +92 -18
- package/dist/api-client/user/citations.d.ts.map +1 -1
- package/dist/api-client/user/claims.d.ts +46 -9
- package/dist/api-client/user/claims.d.ts.map +1 -1
- package/dist/consts/argument.d.ts +3 -1
- package/dist/consts/argument.d.ts.map +1 -1
- package/dist/consts/argument.js +3 -1
- package/dist/consts/argument.js.map +1 -1
- package/dist/consts/axioms.d.ts +4 -0
- package/dist/consts/axioms.d.ts.map +1 -0
- package/dist/consts/axioms.js +17 -0
- package/dist/consts/axioms.js.map +1 -0
- package/dist/consts/index.d.ts +1 -0
- package/dist/consts/index.d.ts.map +1 -1
- package/dist/consts/index.js +1 -0
- package/dist/consts/index.js.map +1 -1
- package/dist/engine/engine.d.ts +14 -14
- package/dist/engine/engine.d.ts.map +1 -1
- package/dist/engine/engine.js +35 -35
- package/dist/engine/engine.js.map +1 -1
- package/dist/engine/library-adapters.d.ts +2 -2
- package/dist/engine/library-adapters.d.ts.map +1 -1
- package/dist/engine/library-adapters.js +2 -2
- package/dist/engine/library-adapters.js.map +1 -1
- package/dist/engine/mutations/premises.d.ts +2 -2
- package/dist/engine/mutations/premises.d.ts.map +1 -1
- package/dist/engine/mutations/premises.js +5 -5
- package/dist/engine/mutations/premises.js.map +1 -1
- package/dist/engine/optimistic/verification.d.ts.map +1 -1
- package/dist/engine/optimistic/verification.js +1 -2
- package/dist/engine/optimistic/verification.js.map +1 -1
- package/dist/engine/text-tree.d.ts +2 -1
- package/dist/engine/text-tree.d.ts.map +1 -1
- package/dist/engine/text-tree.js +8 -3
- package/dist/engine/text-tree.js.map +1 -1
- package/dist/schemas/api/argument/batch/provision.d.ts +46 -9
- package/dist/schemas/api/argument/batch/provision.d.ts.map +1 -1
- package/dist/schemas/api/argument/claims.d.ts +147 -35
- package/dist/schemas/api/argument/claims.d.ts.map +1 -1
- package/dist/schemas/api/argument/index.d.ts +51 -14
- package/dist/schemas/api/argument/index.d.ts.map +1 -1
- package/dist/schemas/api/argument/index.js +1 -1
- package/dist/schemas/api/argument/index.js.map +1 -1
- package/dist/schemas/api/citations.d.ts +230 -45
- package/dist/schemas/api/citations.d.ts.map +1 -1
- package/dist/schemas/api/claims.d.ts +92 -18
- package/dist/schemas/api/claims.d.ts.map +1 -1
- package/dist/schemas/model/arguments.d.ts +147 -36
- package/dist/schemas/model/arguments.d.ts.map +1 -1
- package/dist/schemas/model/arguments.js +1 -1
- package/dist/schemas/model/arguments.js.map +1 -1
- package/dist/schemas/model/citations.d.ts +4 -4
- package/dist/schemas/model/citations.js +2 -2
- package/dist/schemas/model/citations.js.map +1 -1
- package/dist/schemas/model/claims.d.ts +127 -22
- package/dist/schemas/model/claims.d.ts.map +1 -1
- package/dist/schemas/model/claims.js +85 -24
- package/dist/schemas/model/claims.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,28 +1,50 @@
|
|
|
1
1
|
import Type, { type Static } from "typebox";
|
|
2
|
+
export declare const ClaimTypeSchema: Type.TUnion<[Type.TLiteral<"normal">, Type.TLiteral<"citation">, Type.TLiteral<"axiomatic">]>;
|
|
3
|
+
export type TClaimType = Static<typeof ClaimTypeSchema>;
|
|
4
|
+
export declare const AxiomKindSchema: Type.TUnion<[Type.TLiteral<"definition">, Type.TLiteral<"stipulation">, Type.TLiteral<"logical-principle">, Type.TLiteral<"mathematical-principle">, Type.TLiteral<"domain-rule">, Type.TLiteral<"background-assumption">]>;
|
|
5
|
+
export type TAxiomKind = Static<typeof AxiomKindSchema>;
|
|
2
6
|
export declare const MutableClaimFieldsSchema: Type.TObject<{
|
|
3
7
|
title: Type.TString;
|
|
4
8
|
body: Type.TString;
|
|
9
|
+
titleContentHash: Type.TString;
|
|
5
10
|
}>;
|
|
6
11
|
export type TMutableClaimFields = Static<typeof MutableClaimFieldsSchema>;
|
|
7
12
|
export declare const ClaimUpdateRequestSchema: Type.TObject<{
|
|
8
13
|
title: Type.TString;
|
|
9
14
|
body: Type.TString;
|
|
15
|
+
titleContentHash: Type.TString;
|
|
10
16
|
digest: Type.TString;
|
|
11
17
|
}>;
|
|
12
18
|
export type TClaimUpdateFields = Static<typeof ClaimUpdateRequestSchema>;
|
|
13
|
-
export declare const
|
|
19
|
+
export declare const NormalClaimKinds: {
|
|
14
20
|
readonly CLAIM: "claim";
|
|
15
21
|
readonly CONCLUSION: "conclusion";
|
|
16
22
|
readonly DEFINITION: "definition";
|
|
17
23
|
readonly CRITERION: "criterion";
|
|
18
24
|
};
|
|
19
|
-
export declare const
|
|
20
|
-
export type
|
|
21
|
-
export declare const
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
export declare const NormalClaimKindsSchema: Type.TUnion<[Type.TUnion<[Type.TLiteral<"definition">, Type.TLiteral<"criterion">]>, Type.TUnion<[Type.TLiteral<"conclusion">, Type.TLiteral<"claim">]>]>;
|
|
26
|
+
export type TNormalClaimKinds = Static<typeof NormalClaimKindsSchema>;
|
|
27
|
+
export declare const NormalClaimSchema: Type.TObject<{
|
|
28
|
+
digest: Type.TString;
|
|
29
|
+
id: Type.TString;
|
|
30
|
+
argumentId: Type.TString;
|
|
31
|
+
version: Type.TNumber;
|
|
32
|
+
claimForkId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
33
|
+
creatorId: Type.TString;
|
|
34
|
+
createdOn: import("../common.js").TDateType;
|
|
35
|
+
parentId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
24
36
|
title: Type.TString;
|
|
25
37
|
body: Type.TString;
|
|
38
|
+
titleContentHash: Type.TString;
|
|
39
|
+
type: Type.TLiteral<"normal">;
|
|
40
|
+
kind: Type.TUnion<[Type.TUnion<[Type.TLiteral<"definition">, Type.TLiteral<"criterion">]>, Type.TUnion<[Type.TLiteral<"conclusion">, Type.TLiteral<"claim">]>]>;
|
|
41
|
+
url: Type.TNull;
|
|
42
|
+
citation: Type.TNull;
|
|
43
|
+
citationContentHash: Type.TNull;
|
|
44
|
+
axiom: Type.TNull;
|
|
45
|
+
}>;
|
|
46
|
+
export type TNormalClaim = Static<typeof NormalClaimSchema>;
|
|
47
|
+
export declare const CitationClaimSchema: Type.TObject<{
|
|
26
48
|
digest: Type.TString;
|
|
27
49
|
id: Type.TString;
|
|
28
50
|
argumentId: Type.TString;
|
|
@@ -30,12 +52,14 @@ export declare const ClaimSchema: Type.TObject<{
|
|
|
30
52
|
claimForkId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
31
53
|
creatorId: Type.TString;
|
|
32
54
|
createdOn: import("../common.js").TDateType;
|
|
33
|
-
kind: Type.TUnion<[Type.TUnion<[Type.TLiteral<"definition">, Type.TLiteral<"criterion">]>, Type.TUnion<[Type.TLiteral<"conclusion">, Type.TLiteral<"claim">]>]>;
|
|
34
|
-
type: Type.TUnion<[Type.TLiteral<"normal">, Type.TLiteral<"citation">]>;
|
|
35
55
|
parentId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
56
|
+
type: Type.TLiteral<"citation">;
|
|
57
|
+
kind: Type.TNull;
|
|
58
|
+
title: Type.TNull;
|
|
59
|
+
body: Type.TNull;
|
|
60
|
+
titleContentHash: Type.TNull;
|
|
61
|
+
url: Type.TString;
|
|
62
|
+
citation: Type.TUnion<[Type.TIntersect<[Type.TObject<{
|
|
39
63
|
type: Type.TUnion<[Type.TLiteral<"Book">, Type.TLiteral<"Website">, Type.TLiteral<"BookChapter">, Type.TLiteral<"Handbook">, Type.TLiteral<"TechnicalReport">, Type.TLiteral<"Standard">, Type.TLiteral<"Thesis">, Type.TLiteral<"Patent">, Type.TLiteral<"Dictionary">, Type.TLiteral<"Encyclopedia">, Type.TLiteral<"JournalArticle">, Type.TLiteral<"MagazineArticle">, Type.TLiteral<"NewspaperArticle">, Type.TLiteral<"ConferencePaper">, Type.TLiteral<"ConferenceProceedings">, Type.TLiteral<"Dataset">, Type.TLiteral<"Software">, Type.TLiteral<"OnlineDocument">, Type.TLiteral<"Blog">, Type.TLiteral<"SocialMedia">, Type.TLiteral<"Preprint">, Type.TLiteral<"Video">, Type.TLiteral<"Podcast">, Type.TLiteral<"Course">, Type.TLiteral<"Presentation">, Type.TLiteral<"Interview">, Type.TLiteral<"PersonalCommunication">, Type.TLiteral<"Email">, Type.TLiteral<"Law">, Type.TLiteral<"CourtCase">, Type.TLiteral<"GovernmentPublication">, Type.TLiteral<"Datasheet">, Type.TLiteral<"ProductManual">, Type.TLiteral<"UnparsedURL">]>;
|
|
40
64
|
}>, Type.TObject<{
|
|
41
65
|
type: Type.TLiteral<"Book">;
|
|
@@ -463,13 +487,50 @@ export declare const ClaimSchema: Type.TObject<{
|
|
|
463
487
|
type: Type.TLiteral<"UnparsedURL">;
|
|
464
488
|
url: Type.TString;
|
|
465
489
|
text: Type.TOptional<Type.TString>;
|
|
466
|
-
}>]>]
|
|
467
|
-
citationContentHash: Type.
|
|
490
|
+
}>]>]>;
|
|
491
|
+
citationContentHash: Type.TString;
|
|
492
|
+
axiom: Type.TNull;
|
|
468
493
|
}>;
|
|
469
|
-
export type
|
|
470
|
-
export declare const
|
|
494
|
+
export type TCitationClaim = Static<typeof CitationClaimSchema>;
|
|
495
|
+
export declare const AxiomaticClaimSchema: Type.TObject<{
|
|
496
|
+
digest: Type.TString;
|
|
497
|
+
id: Type.TString;
|
|
498
|
+
argumentId: Type.TString;
|
|
499
|
+
version: Type.TNumber;
|
|
500
|
+
claimForkId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
501
|
+
creatorId: Type.TString;
|
|
502
|
+
createdOn: import("../common.js").TDateType;
|
|
503
|
+
parentId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
504
|
+
type: Type.TLiteral<"axiomatic">;
|
|
505
|
+
kind: Type.TNull;
|
|
506
|
+
title: Type.TNull;
|
|
507
|
+
body: Type.TNull;
|
|
508
|
+
titleContentHash: Type.TNull;
|
|
509
|
+
url: Type.TNull;
|
|
510
|
+
citation: Type.TNull;
|
|
511
|
+
citationContentHash: Type.TNull;
|
|
512
|
+
axiom: Type.TUnion<[Type.TLiteral<"definition">, Type.TLiteral<"stipulation">, Type.TLiteral<"logical-principle">, Type.TLiteral<"mathematical-principle">, Type.TLiteral<"domain-rule">, Type.TLiteral<"background-assumption">]>;
|
|
513
|
+
}>;
|
|
514
|
+
export type TAxiomaticClaim = Static<typeof AxiomaticClaimSchema>;
|
|
515
|
+
export declare const ClaimSchema: Type.TUnion<[Type.TObject<{
|
|
516
|
+
digest: Type.TString;
|
|
517
|
+
id: Type.TString;
|
|
518
|
+
argumentId: Type.TString;
|
|
519
|
+
version: Type.TNumber;
|
|
520
|
+
claimForkId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
521
|
+
creatorId: Type.TString;
|
|
522
|
+
createdOn: import("../common.js").TDateType;
|
|
523
|
+
parentId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
471
524
|
title: Type.TString;
|
|
472
525
|
body: Type.TString;
|
|
526
|
+
titleContentHash: Type.TString;
|
|
527
|
+
type: Type.TLiteral<"normal">;
|
|
528
|
+
kind: Type.TUnion<[Type.TUnion<[Type.TLiteral<"definition">, Type.TLiteral<"criterion">]>, Type.TUnion<[Type.TLiteral<"conclusion">, Type.TLiteral<"claim">]>]>;
|
|
529
|
+
url: Type.TNull;
|
|
530
|
+
citation: Type.TNull;
|
|
531
|
+
citationContentHash: Type.TNull;
|
|
532
|
+
axiom: Type.TNull;
|
|
533
|
+
}>, Type.TObject<{
|
|
473
534
|
digest: Type.TString;
|
|
474
535
|
id: Type.TString;
|
|
475
536
|
argumentId: Type.TString;
|
|
@@ -477,12 +538,14 @@ export declare const ClaimWithChildrenSchema: Type.TObject<{
|
|
|
477
538
|
claimForkId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
478
539
|
creatorId: Type.TString;
|
|
479
540
|
createdOn: import("../common.js").TDateType;
|
|
480
|
-
kind: Type.TUnion<[Type.TUnion<[Type.TLiteral<"definition">, Type.TLiteral<"criterion">]>, Type.TUnion<[Type.TLiteral<"conclusion">, Type.TLiteral<"claim">]>]>;
|
|
481
|
-
type: Type.TUnion<[Type.TLiteral<"normal">, Type.TLiteral<"citation">]>;
|
|
482
541
|
parentId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
542
|
+
type: Type.TLiteral<"citation">;
|
|
543
|
+
kind: Type.TNull;
|
|
544
|
+
title: Type.TNull;
|
|
545
|
+
body: Type.TNull;
|
|
546
|
+
titleContentHash: Type.TNull;
|
|
547
|
+
url: Type.TString;
|
|
548
|
+
citation: Type.TUnion<[Type.TIntersect<[Type.TObject<{
|
|
486
549
|
type: Type.TUnion<[Type.TLiteral<"Book">, Type.TLiteral<"Website">, Type.TLiteral<"BookChapter">, Type.TLiteral<"Handbook">, Type.TLiteral<"TechnicalReport">, Type.TLiteral<"Standard">, Type.TLiteral<"Thesis">, Type.TLiteral<"Patent">, Type.TLiteral<"Dictionary">, Type.TLiteral<"Encyclopedia">, Type.TLiteral<"JournalArticle">, Type.TLiteral<"MagazineArticle">, Type.TLiteral<"NewspaperArticle">, Type.TLiteral<"ConferencePaper">, Type.TLiteral<"ConferenceProceedings">, Type.TLiteral<"Dataset">, Type.TLiteral<"Software">, Type.TLiteral<"OnlineDocument">, Type.TLiteral<"Blog">, Type.TLiteral<"SocialMedia">, Type.TLiteral<"Preprint">, Type.TLiteral<"Video">, Type.TLiteral<"Podcast">, Type.TLiteral<"Course">, Type.TLiteral<"Presentation">, Type.TLiteral<"Interview">, Type.TLiteral<"PersonalCommunication">, Type.TLiteral<"Email">, Type.TLiteral<"Law">, Type.TLiteral<"CourtCase">, Type.TLiteral<"GovernmentPublication">, Type.TLiteral<"Datasheet">, Type.TLiteral<"ProductManual">, Type.TLiteral<"UnparsedURL">]>;
|
|
487
550
|
}>, Type.TObject<{
|
|
488
551
|
type: Type.TLiteral<"Book">;
|
|
@@ -910,8 +973,50 @@ export declare const ClaimWithChildrenSchema: Type.TObject<{
|
|
|
910
973
|
type: Type.TLiteral<"UnparsedURL">;
|
|
911
974
|
url: Type.TString;
|
|
912
975
|
text: Type.TOptional<Type.TString>;
|
|
913
|
-
}>]>]
|
|
914
|
-
citationContentHash: Type.
|
|
976
|
+
}>]>]>;
|
|
977
|
+
citationContentHash: Type.TString;
|
|
978
|
+
axiom: Type.TNull;
|
|
979
|
+
}>, Type.TObject<{
|
|
980
|
+
digest: Type.TString;
|
|
981
|
+
id: Type.TString;
|
|
982
|
+
argumentId: Type.TString;
|
|
983
|
+
version: Type.TNumber;
|
|
984
|
+
claimForkId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
985
|
+
creatorId: Type.TString;
|
|
986
|
+
createdOn: import("../common.js").TDateType;
|
|
987
|
+
parentId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
988
|
+
type: Type.TLiteral<"axiomatic">;
|
|
989
|
+
kind: Type.TNull;
|
|
990
|
+
title: Type.TNull;
|
|
991
|
+
body: Type.TNull;
|
|
992
|
+
titleContentHash: Type.TNull;
|
|
993
|
+
url: Type.TNull;
|
|
994
|
+
citation: Type.TNull;
|
|
995
|
+
citationContentHash: Type.TNull;
|
|
996
|
+
axiom: Type.TUnion<[Type.TLiteral<"definition">, Type.TLiteral<"stipulation">, Type.TLiteral<"logical-principle">, Type.TLiteral<"mathematical-principle">, Type.TLiteral<"domain-rule">, Type.TLiteral<"background-assumption">]>;
|
|
997
|
+
}>]>;
|
|
998
|
+
export type TClaim = Static<typeof ClaimSchema>;
|
|
999
|
+
export declare function isNormalClaim(claim: TClaim): claim is TNormalClaim;
|
|
1000
|
+
export declare function isCitationClaim(claim: TClaim): claim is TCitationClaim;
|
|
1001
|
+
export declare function isAxiomaticClaim(claim: TClaim): claim is TAxiomaticClaim;
|
|
1002
|
+
export declare const ClaimWithChildrenSchema: Type.TObject<{
|
|
1003
|
+
digest: Type.TString;
|
|
1004
|
+
id: Type.TString;
|
|
1005
|
+
argumentId: Type.TString;
|
|
1006
|
+
version: Type.TNumber;
|
|
1007
|
+
claimForkId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
1008
|
+
creatorId: Type.TString;
|
|
1009
|
+
createdOn: import("../common.js").TDateType;
|
|
1010
|
+
parentId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
1011
|
+
title: Type.TString;
|
|
1012
|
+
body: Type.TString;
|
|
1013
|
+
titleContentHash: Type.TString;
|
|
1014
|
+
type: Type.TLiteral<"normal">;
|
|
1015
|
+
kind: Type.TUnion<[Type.TUnion<[Type.TLiteral<"definition">, Type.TLiteral<"criterion">]>, Type.TUnion<[Type.TLiteral<"conclusion">, Type.TLiteral<"claim">]>]>;
|
|
1016
|
+
url: Type.TNull;
|
|
1017
|
+
citation: Type.TNull;
|
|
1018
|
+
citationContentHash: Type.TNull;
|
|
1019
|
+
axiom: Type.TNull;
|
|
915
1020
|
childClaimIds: Type.TArray<Type.TString>;
|
|
916
1021
|
childCitationIds: Type.TArray<Type.TString>;
|
|
917
1022
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claims.d.ts","sourceRoot":"","sources":["../../../src/schemas/model/claims.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"claims.d.ts","sourceRoot":"","sources":["../../../src/schemas/model/claims.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAY3C,eAAO,MAAM,eAAe,+FAAsB,CAAA;AAClD,MAAM,MAAM,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,CAAC,CAAA"}
|
|
@@ -1,50 +1,111 @@
|
|
|
1
1
|
import Type, {} from "typebox";
|
|
2
2
|
import { EncodableDate, Nullable, UUID } from "../common.js";
|
|
3
3
|
import { IEEEReferenceSchema } from "./references.js";
|
|
4
|
+
import { CoreClaimAxiomaticTypeSchema, CoreClaimCitationTypeSchema, CoreClaimNormalTypeSchema, CoreClaimTypeSchema, } from "@proposit/proposit-core";
|
|
5
|
+
// Re-export aliases so consumers that imported ClaimTypeSchema / TClaimType
|
|
6
|
+
// from @proposit/shared/schemas keep working without code edits.
|
|
7
|
+
export const ClaimTypeSchema = CoreClaimTypeSchema;
|
|
8
|
+
export const AxiomKindSchema = Type.Union([
|
|
9
|
+
Type.Literal("definition"),
|
|
10
|
+
Type.Literal("stipulation"),
|
|
11
|
+
Type.Literal("logical-principle"),
|
|
12
|
+
Type.Literal("mathematical-principle"),
|
|
13
|
+
Type.Literal("domain-rule"),
|
|
14
|
+
Type.Literal("background-assumption"),
|
|
15
|
+
]);
|
|
16
|
+
// Single source of truth for `digest`. Everything that needs digest inherits
|
|
17
|
+
// from this rather than re-declaring the field.
|
|
18
|
+
const ClaimMetadataFieldsSchema = Type.Object({
|
|
19
|
+
digest: Type.String(),
|
|
20
|
+
});
|
|
21
|
+
// Normal-only mutable fields. Citation/Axiomatic variants do NOT inherit from
|
|
22
|
+
// this — they redeclare title/body/titleContentHash inline as Type.Null().
|
|
4
23
|
export const MutableClaimFieldsSchema = Type.Object({
|
|
5
24
|
title: Type.String(),
|
|
6
25
|
body: Type.String(),
|
|
26
|
+
titleContentHash: Type.String(),
|
|
7
27
|
});
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
|
|
28
|
+
// Update request: Normal mutable fields + digest. Update is Normal-only in
|
|
29
|
+
// this bump (creation/update for Citation/Axiomatic comes later).
|
|
30
|
+
export const ClaimUpdateRequestSchema = Type.Interface([MutableClaimFieldsSchema, ClaimMetadataFieldsSchema], {});
|
|
31
|
+
// Presentation taxonomy — Normal-claim-only. `kind` is null on Citation and
|
|
32
|
+
// Axiomatic claims.
|
|
33
|
+
export const NormalClaimKinds = {
|
|
12
34
|
CLAIM: "claim",
|
|
13
35
|
CONCLUSION: "conclusion",
|
|
14
36
|
DEFINITION: "definition",
|
|
15
37
|
CRITERION: "criterion",
|
|
16
38
|
};
|
|
17
|
-
const
|
|
18
|
-
Type.Literal(
|
|
19
|
-
Type.Literal(
|
|
39
|
+
const NormalClaimChildKindsSchema = Type.Union([
|
|
40
|
+
Type.Literal(NormalClaimKinds.DEFINITION),
|
|
41
|
+
Type.Literal(NormalClaimKinds.CRITERION),
|
|
20
42
|
]);
|
|
21
|
-
const
|
|
22
|
-
Type.Literal(
|
|
23
|
-
Type.Literal(
|
|
43
|
+
const NormalClaimLogicalKindsSchema = Type.Union([
|
|
44
|
+
Type.Literal(NormalClaimKinds.CONCLUSION),
|
|
45
|
+
Type.Literal(NormalClaimKinds.CLAIM),
|
|
24
46
|
]);
|
|
25
|
-
export const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Type.Literal("citation"),
|
|
47
|
+
export const NormalClaimKindsSchema = Type.Union([
|
|
48
|
+
NormalClaimChildKindsSchema,
|
|
49
|
+
NormalClaimLogicalKindsSchema,
|
|
29
50
|
]);
|
|
30
|
-
|
|
51
|
+
// Identity / lineage fields shared by all variants, with digest inherited.
|
|
52
|
+
const ClaimSharedFieldsSchema = Type.Interface([ClaimMetadataFieldsSchema], {
|
|
31
53
|
id: UUID,
|
|
32
54
|
argumentId: UUID,
|
|
33
55
|
version: Type.Number(),
|
|
34
56
|
claimForkId: Nullable(UUID),
|
|
35
57
|
creatorId: UUID,
|
|
36
58
|
createdOn: EncodableDate,
|
|
37
|
-
kind: Type.Union([ChildClaimKinds, LogicalClaimKinds]),
|
|
38
|
-
type: ClaimTypeSchema,
|
|
39
59
|
parentId: Nullable(UUID),
|
|
40
|
-
titleContentHash: Type.Optional(Nullable(Type.String())),
|
|
41
|
-
// Citation-extra fields. Optional at the schema level; consumer code
|
|
42
|
-
// populates these on claims with type === "citation".
|
|
43
|
-
url: Type.Optional(Nullable(Type.String())),
|
|
44
|
-
citation: Type.Optional(Nullable(IEEEReferenceSchema)),
|
|
45
|
-
citationContentHash: Type.Optional(Nullable(Type.String())),
|
|
46
60
|
});
|
|
47
|
-
export const
|
|
61
|
+
export const NormalClaimSchema = Type.Interface([ClaimSharedFieldsSchema, MutableClaimFieldsSchema], {
|
|
62
|
+
type: CoreClaimNormalTypeSchema,
|
|
63
|
+
kind: NormalClaimKindsSchema,
|
|
64
|
+
url: Type.Null(),
|
|
65
|
+
citation: Type.Null(),
|
|
66
|
+
citationContentHash: Type.Null(),
|
|
67
|
+
axiom: Type.Null(),
|
|
68
|
+
});
|
|
69
|
+
export const CitationClaimSchema = Type.Interface([ClaimSharedFieldsSchema], {
|
|
70
|
+
type: CoreClaimCitationTypeSchema,
|
|
71
|
+
kind: Type.Null(),
|
|
72
|
+
title: Type.Null(),
|
|
73
|
+
body: Type.Null(),
|
|
74
|
+
titleContentHash: Type.Null(),
|
|
75
|
+
url: Type.String(),
|
|
76
|
+
citation: IEEEReferenceSchema,
|
|
77
|
+
citationContentHash: Type.String(),
|
|
78
|
+
axiom: Type.Null(),
|
|
79
|
+
});
|
|
80
|
+
export const AxiomaticClaimSchema = Type.Interface([ClaimSharedFieldsSchema], {
|
|
81
|
+
type: CoreClaimAxiomaticTypeSchema,
|
|
82
|
+
kind: Type.Null(),
|
|
83
|
+
title: Type.Null(),
|
|
84
|
+
body: Type.Null(),
|
|
85
|
+
titleContentHash: Type.Null(),
|
|
86
|
+
url: Type.Null(),
|
|
87
|
+
citation: Type.Null(),
|
|
88
|
+
citationContentHash: Type.Null(),
|
|
89
|
+
axiom: AxiomKindSchema,
|
|
90
|
+
});
|
|
91
|
+
export const ClaimSchema = Type.Union([
|
|
92
|
+
NormalClaimSchema,
|
|
93
|
+
CitationClaimSchema,
|
|
94
|
+
AxiomaticClaimSchema,
|
|
95
|
+
]);
|
|
96
|
+
export function isNormalClaim(claim) {
|
|
97
|
+
return claim.type === "normal";
|
|
98
|
+
}
|
|
99
|
+
export function isCitationClaim(claim) {
|
|
100
|
+
return claim.type === "citation";
|
|
101
|
+
}
|
|
102
|
+
export function isAxiomaticClaim(claim) {
|
|
103
|
+
return claim.type === "axiomatic";
|
|
104
|
+
}
|
|
105
|
+
// Re-based on NormalClaimSchema. Server's getClaims() filters by
|
|
106
|
+
// type='normal' before populating childClaimIds/childCitationIds, so this
|
|
107
|
+
// type accurately describes only Normal-with-children rows.
|
|
108
|
+
export const ClaimWithChildrenSchema = Type.Interface([NormalClaimSchema], {
|
|
48
109
|
childClaimIds: Type.Array(UUID),
|
|
49
110
|
childCitationIds: Type.Array(UUID),
|
|
50
111
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claims.js","sourceRoot":"","sources":["../../../src/schemas/model/claims.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAe,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"claims.js","sourceRoot":"","sources":["../../../src/schemas/model/claims.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAe,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EACH,4BAA4B,EAC5B,2BAA2B,EAC3B,yBAAyB,EACzB,mBAAmB,GACtB,MAAM,yBAAyB,CAAA;AAEhC,4EAA4E;AAC5E,iEAAiE;AACjE,MAAM,CAAC,MAAM,eAAe,GAAG,mBAAmB,CAAA;AAGlD,MAAM,CAAC,MAAM,eAAe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C,IAAI,CAAC;IAC/B,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;CACrC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proposit/shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Runtime-agnostic TypeScript shared between proposit-server and proposit-mobile. Schemas, engine, api-client, and utilities.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/Proposit-App/proposit-shared",
|
|
@@ -126,14 +126,14 @@
|
|
|
126
126
|
"access": "public"
|
|
127
127
|
},
|
|
128
128
|
"peerDependencies": {
|
|
129
|
-
"@proposit/proposit-core": "^0.
|
|
129
|
+
"@proposit/proposit-core": "^0.12.3"
|
|
130
130
|
},
|
|
131
131
|
"dependencies": {
|
|
132
132
|
"typebox": "^1.1.14"
|
|
133
133
|
},
|
|
134
134
|
"devDependencies": {
|
|
135
135
|
"@eslint/js": "^9.39.4",
|
|
136
|
-
"@proposit/proposit-core": "^0.
|
|
136
|
+
"@proposit/proposit-core": "^0.12.3",
|
|
137
137
|
"@types/node": "^25.5.2",
|
|
138
138
|
"eslint": "^9.39.4",
|
|
139
139
|
"eslint-plugin-check-file": "^3.3.1",
|