@openvtc/trust-tasks 0.26.20 → 0.26.22
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/CHANGELOG.md +84 -0
- package/dist/_shared/components.d.ts +328 -17
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/device/list/0.1/payload.d.ts +4 -4
- package/dist/device/list/0.1/payload.d.ts.map +1 -1
- package/dist/device/list/0.1/payload.js +4 -2
- package/dist/device/list/0.1/payload.js.map +1 -1
- package/dist/device/list/0.2/payload.d.ts +4 -4
- package/dist/device/list/0.2/payload.d.ts.map +1 -1
- package/dist/device/list/0.2/payload.js +4 -2
- package/dist/device/list/0.2/payload.js.map +1 -1
- package/dist/device/register/0.1/payload.d.ts +4 -4
- package/dist/device/register/0.1/payload.d.ts.map +1 -1
- package/dist/device/register/0.1/payload.js +4 -2
- package/dist/device/register/0.1/payload.js.map +1 -1
- package/dist/device/register/0.2/payload.d.ts +4 -4
- package/dist/device/register/0.2/payload.d.ts.map +1 -1
- package/dist/device/register/0.2/payload.js +4 -2
- package/dist/device/register/0.2/payload.js.map +1 -1
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/dist/voting/_shared/0.1/voting.d.ts +16 -0
- package/dist/voting/_shared/0.1/voting.d.ts.map +1 -0
- package/dist/voting/_shared/0.1/voting.js +6 -0
- package/dist/voting/_shared/0.1/voting.js.map +1 -0
- package/dist/voting/ballot/cast/0.1/payload.d.ts +887 -0
- package/dist/voting/ballot/cast/0.1/payload.d.ts.map +1 -0
- package/dist/voting/ballot/cast/0.1/payload.js +506 -0
- package/dist/voting/ballot/cast/0.1/payload.js.map +1 -0
- package/dist/voting/board/consistency/0.1/payload.d.ts +389 -0
- package/dist/voting/board/consistency/0.1/payload.d.ts.map +1 -0
- package/dist/voting/board/consistency/0.1/payload.js +218 -0
- package/dist/voting/board/consistency/0.1/payload.js.map +1 -0
- package/dist/voting/board/head/0.1/payload.d.ts +380 -0
- package/dist/voting/board/head/0.1/payload.d.ts.map +1 -0
- package/dist/voting/board/head/0.1/payload.js +224 -0
- package/dist/voting/board/head/0.1/payload.js.map +1 -0
- package/dist/voting/board/inclusion/0.1/payload.d.ts +449 -0
- package/dist/voting/board/inclusion/0.1/payload.d.ts.map +1 -0
- package/dist/voting/board/inclusion/0.1/payload.js +246 -0
- package/dist/voting/board/inclusion/0.1/payload.js.map +1 -0
- package/dist/voting/board/read/0.1/payload.d.ts +1596 -0
- package/dist/voting/board/read/0.1/payload.d.ts.map +1 -0
- package/dist/voting/board/read/0.1/payload.js +920 -0
- package/dist/voting/board/read/0.1/payload.js.map +1 -0
- package/dist/voting/election/cancel/0.1/payload.d.ts +540 -0
- package/dist/voting/election/cancel/0.1/payload.d.ts.map +1 -0
- package/dist/voting/election/cancel/0.1/payload.js +331 -0
- package/dist/voting/election/cancel/0.1/payload.js.map +1 -0
- package/dist/voting/election/close/0.1/payload.d.ts +540 -0
- package/dist/voting/election/close/0.1/payload.d.ts.map +1 -0
- package/dist/voting/election/close/0.1/payload.js +330 -0
- package/dist/voting/election/close/0.1/payload.js.map +1 -0
- package/dist/voting/election/register/0.1/payload.d.ts +1920 -0
- package/dist/voting/election/register/0.1/payload.d.ts.map +1 -0
- package/dist/voting/election/register/0.1/payload.js +1166 -0
- package/dist/voting/election/register/0.1/payload.js.map +1 -0
- package/dist/voting/election/show/0.1/payload.d.ts +1824 -0
- package/dist/voting/election/show/0.1/payload.d.ts.map +1 -0
- package/dist/voting/election/show/0.1/payload.js +1112 -0
- package/dist/voting/election/show/0.1/payload.js.map +1 -0
- package/dist/voting/result/show/0.1/payload.d.ts +849 -0
- package/dist/voting/result/show/0.1/payload.d.ts.map +1 -0
- package/dist/voting/result/show/0.1/payload.js +498 -0
- package/dist/voting/result/show/0.1/payload.js.map +1 -0
- package/dist/vta/_shared/0.1/app-state-record.d.ts +1 -1
- package/dist/vta/_shared/0.1/app-state-record.d.ts.map +1 -1
- package/dist/vta/_shared/0.4/pcs-engine.d.ts +1 -1
- package/dist/vta/_shared/0.4/pcs-engine.d.ts.map +1 -1
- package/dist/vta/app-state/delete/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/delete/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/get/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/get/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/get-many/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/get-many/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/list/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/list/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/put/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/put/1.0/payload.d.ts.map +1 -1
- package/dist/vta/app-state/put-many/1.0/payload.d.ts +1 -1
- package/dist/vta/app-state/put-many/1.0/payload.d.ts.map +1 -1
- package/dist/vta/pcs/applications/create/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/applications/create/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/applications/show/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/applications/show/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/attest/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/attest/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/prove/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/prove/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/root-accept/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/root-accept/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/tokens/abandon/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/tokens/abandon/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/tokens/accept/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/tokens/accept/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/verify-attestation/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/verify-attestation/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/vetter/show/0.1/payload.d.ts +1 -1
- package/dist/vta/pcs/vetter/show/0.1/payload.d.ts.map +1 -1
- package/dist/vta/pcs/vote/0.1/payload.d.ts +2208 -0
- package/dist/vta/pcs/vote/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/vote/0.1/payload.js +1282 -0
- package/dist/vta/pcs/vote/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/voter/accept/0.1/payload.d.ts +450 -0
- package/dist/vta/pcs/voter/accept/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/voter/accept/0.1/payload.js +247 -0
- package/dist/vta/pcs/voter/accept/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/voter/receipt/0.1/payload.d.ts +531 -0
- package/dist/vta/pcs/voter/receipt/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/voter/receipt/0.1/payload.js +301 -0
- package/dist/vta/pcs/voter/receipt/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/voter/register/0.1/payload.d.ts +1934 -0
- package/dist/vta/pcs/voter/register/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/voter/register/0.1/payload.js +1133 -0
- package/dist/vta/pcs/voter/register/0.1/payload.js.map +1 -0
- package/dist/vtc/directory/card/present/0.1/payload.d.ts +2 -2
- package/dist/vtc/directory/card/present/0.1/payload.js +1 -1
- package/dist/vtc/directory/card/present/0.1/payload.js.map +1 -1
- package/dist/vtc/elections/cancel/0.1/payload.d.ts +301 -0
- package/dist/vtc/elections/cancel/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/cancel/0.1/payload.js +183 -0
- package/dist/vtc/elections/cancel/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/certify/0.1/payload.d.ts +914 -0
- package/dist/vtc/elections/certify/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/certify/0.1/payload.js +512 -0
- package/dist/vtc/elections/certify/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/close/0.1/payload.d.ts +301 -0
- package/dist/vtc/elections/close/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/close/0.1/payload.js +182 -0
- package/dist/vtc/elections/close/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/create/0.1/payload.d.ts +1656 -0
- package/dist/vtc/elections/create/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/create/0.1/payload.js +994 -0
- package/dist/vtc/elections/create/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/list/0.1/payload.d.ts +521 -0
- package/dist/vtc/elections/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/list/0.1/payload.js +290 -0
- package/dist/vtc/elections/list/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/show/0.1/payload.d.ts +2688 -0
- package/dist/vtc/elections/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/show/0.1/payload.js +1581 -0
- package/dist/vtc/elections/show/0.1/payload.js.map +1 -0
- package/dist/vtc/elections/tickets/issue/0.1/payload.d.ts +597 -0
- package/dist/vtc/elections/tickets/issue/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/elections/tickets/issue/0.1/payload.js +318 -0
- package/dist/vtc/elections/tickets/issue/0.1/payload.js.map +1 -0
- package/dist/vtc/groups/create/0.1/payload.d.ts +4 -4
- package/dist/vtc/groups/create/0.1/payload.js +2 -2
- package/dist/vtc/groups/create/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/list/0.1/payload.d.ts +4 -4
- package/dist/vtc/groups/list/0.1/payload.js +2 -2
- package/dist/vtc/groups/list/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/managers/add/0.1/payload.d.ts +337 -0
- package/dist/vtc/groups/managers/add/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/groups/managers/add/0.1/payload.js +184 -0
- package/dist/vtc/groups/managers/add/0.1/payload.js.map +1 -0
- package/dist/vtc/groups/managers/remove/0.1/payload.d.ts +337 -0
- package/dist/vtc/groups/managers/remove/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/groups/managers/remove/0.1/payload.js +184 -0
- package/dist/vtc/groups/managers/remove/0.1/payload.js.map +1 -0
- package/dist/vtc/groups/show/0.1/payload.d.ts +4 -4
- package/dist/vtc/groups/show/0.1/payload.js +2 -2
- package/dist/vtc/groups/show/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/update/0.1/payload.d.ts +4 -4
- package/dist/vtc/groups/update/0.1/payload.js +2 -2
- package/dist/vtc/groups/update/0.1/payload.js.map +1 -1
- package/package.json +1 -1
- package/src/_shared/components.ts +332 -17
- package/src/device/list/0.1/payload.ts +4 -2
- package/src/device/list/0.2/payload.ts +4 -2
- package/src/device/register/0.1/payload.ts +4 -2
- package/src/device/register/0.2/payload.ts +4 -2
- package/src/index.ts +24 -0
- package/src/voting/_shared/0.1/voting.ts +17 -0
- package/src/voting/ballot/cast/0.1/payload.ts +560 -0
- package/src/voting/board/consistency/0.1/payload.ts +264 -0
- package/src/voting/board/head/0.1/payload.ts +257 -0
- package/src/voting/board/inclusion/0.1/payload.ts +300 -0
- package/src/voting/board/read/0.1/payload.ts +981 -0
- package/src/voting/election/cancel/0.1/payload.ts +368 -0
- package/src/voting/election/close/0.1/payload.ts +367 -0
- package/src/voting/election/register/0.1/payload.ts +1207 -0
- package/src/voting/election/show/0.1/payload.ts +1149 -0
- package/src/voting/result/show/0.1/payload.ts +536 -0
- package/src/vta/_shared/0.1/app-state-record.ts +1 -1
- package/src/vta/_shared/0.4/pcs-engine.ts +1 -1
- package/src/vta/app-state/delete/1.0/payload.ts +1 -1
- package/src/vta/app-state/get/1.0/payload.ts +1 -1
- package/src/vta/app-state/get-many/1.0/payload.ts +1 -1
- package/src/vta/app-state/list/1.0/payload.ts +1 -1
- package/src/vta/app-state/put/1.0/payload.ts +1 -1
- package/src/vta/app-state/put-many/1.0/payload.ts +1 -1
- package/src/vta/pcs/applications/create/0.1/payload.ts +1 -1
- package/src/vta/pcs/applications/show/0.1/payload.ts +1 -1
- package/src/vta/pcs/attest/0.1/payload.ts +1 -1
- package/src/vta/pcs/prove/0.1/payload.ts +1 -1
- package/src/vta/pcs/root-accept/0.1/payload.ts +1 -1
- package/src/vta/pcs/tokens/abandon/0.1/payload.ts +1 -1
- package/src/vta/pcs/tokens/accept/0.1/payload.ts +1 -1
- package/src/vta/pcs/verify-attestation/0.1/payload.ts +1 -1
- package/src/vta/pcs/vetter/show/0.1/payload.ts +1 -1
- package/src/vta/pcs/vote/0.1/payload.ts +1365 -0
- package/src/vta/pcs/voter/accept/0.1/payload.ts +306 -0
- package/src/vta/pcs/voter/receipt/0.1/payload.ts +367 -0
- package/src/vta/pcs/voter/register/0.1/payload.ts +1211 -0
- package/src/vtc/directory/card/present/0.1/payload.ts +1 -1
- package/src/vtc/elections/cancel/0.1/payload.ts +223 -0
- package/src/vtc/elections/certify/0.1/payload.ts +565 -0
- package/src/vtc/elections/close/0.1/payload.ts +222 -0
- package/src/vtc/elections/create/0.1/payload.ts +1041 -0
- package/src/vtc/elections/list/0.1/payload.ts +371 -0
- package/src/vtc/elections/show/0.1/payload.ts +1671 -0
- package/src/vtc/elections/tickets/issue/0.1/payload.ts +394 -0
- package/src/vtc/groups/create/0.1/payload.ts +2 -2
- package/src/vtc/groups/list/0.1/payload.ts +2 -2
- package/src/vtc/groups/managers/add/0.1/payload.ts +230 -0
- package/src/vtc/groups/managers/remove/0.1/payload.ts +230 -0
- package/src/vtc/groups/show/0.1/payload.ts +2 -2
- package/src/vtc/groups/update/0.1/payload.ts +2 -2
package/src/index.ts
CHANGED
|
@@ -584,6 +584,17 @@ export * as VettingAttestation_v0_1 from "./vetting/attestation/0.1/payload.js";
|
|
|
584
584
|
export * as VettingDecline_v0_1 from "./vetting/decline/0.1/payload.js";
|
|
585
585
|
export * as VettingRequest_v0_1 from "./vetting/request/0.1/payload.js";
|
|
586
586
|
export * as VettingSession_v0_1 from "./vetting/session/0.1/payload.js";
|
|
587
|
+
export * as VotingShared_v0_1 from "./voting/_shared/0.1/voting.js";
|
|
588
|
+
export * as VotingBallotCast_v0_1 from "./voting/ballot/cast/0.1/payload.js";
|
|
589
|
+
export * as VotingBoardConsistency_v0_1 from "./voting/board/consistency/0.1/payload.js";
|
|
590
|
+
export * as VotingBoardHead_v0_1 from "./voting/board/head/0.1/payload.js";
|
|
591
|
+
export * as VotingBoardInclusion_v0_1 from "./voting/board/inclusion/0.1/payload.js";
|
|
592
|
+
export * as VotingBoardRead_v0_1 from "./voting/board/read/0.1/payload.js";
|
|
593
|
+
export * as VotingElectionCancel_v0_1 from "./voting/election/cancel/0.1/payload.js";
|
|
594
|
+
export * as VotingElectionClose_v0_1 from "./voting/election/close/0.1/payload.js";
|
|
595
|
+
export * as VotingElectionRegister_v0_1 from "./voting/election/register/0.1/payload.js";
|
|
596
|
+
export * as VotingElectionShow_v0_1 from "./voting/election/show/0.1/payload.js";
|
|
597
|
+
export * as VotingResultShow_v0_1 from "./voting/result/show/0.1/payload.js";
|
|
587
598
|
export * as VrcRelationshipsIssue_v0_1 from "./vrc/relationships/issue/0.1/payload.js";
|
|
588
599
|
export * as VrcRelationshipsPropose_v0_1 from "./vrc/relationships/propose/0.1/payload.js";
|
|
589
600
|
export * as AppStateRecordShared_v0_1 from "./vta/_shared/0.1/app-state-record.js";
|
|
@@ -676,6 +687,10 @@ export * as VtaPcsTokensAccept_v0_1 from "./vta/pcs/tokens/accept/0.1/payload.js
|
|
|
676
687
|
export * as VtaPcsTokensRequest_v0_1 from "./vta/pcs/tokens/request/0.1/payload.js";
|
|
677
688
|
export * as VtaPcsVerifyAttestation_v0_1 from "./vta/pcs/verify-attestation/0.1/payload.js";
|
|
678
689
|
export * as VtaPcsVetterShow_v0_1 from "./vta/pcs/vetter/show/0.1/payload.js";
|
|
690
|
+
export * as VtaPcsVote_v0_1 from "./vta/pcs/vote/0.1/payload.js";
|
|
691
|
+
export * as VtaPcsVoterAccept_v0_1 from "./vta/pcs/voter/accept/0.1/payload.js";
|
|
692
|
+
export * as VtaPcsVoterReceipt_v0_1 from "./vta/pcs/voter/receipt/0.1/payload.js";
|
|
693
|
+
export * as VtaPcsVoterRegister_v0_1 from "./vta/pcs/voter/register/0.1/payload.js";
|
|
679
694
|
export * as VtaRestoreStatus_v0_1 from "./vta/restore/status/0.1/payload.js";
|
|
680
695
|
export * as VtaServicesDisable_v1_0 from "./vta/services/disable/1.0/payload.js";
|
|
681
696
|
export * as VtaServicesDrainCancel_v1_0 from "./vta/services/drain/cancel/1.0/payload.js";
|
|
@@ -812,6 +827,13 @@ export * as VtcDirectoryNotesAppend_v0_1 from "./vtc/directory/notes/append/0.1/
|
|
|
812
827
|
export * as VtcDirectoryNotesExport_v0_1 from "./vtc/directory/notes/export/0.1/payload.js";
|
|
813
828
|
export * as VtcDirectoryNotesList_v0_1 from "./vtc/directory/notes/list/0.1/payload.js";
|
|
814
829
|
export * as VtcDirectoryQuery_v0_1 from "./vtc/directory/query/0.1/payload.js";
|
|
830
|
+
export * as VtcElectionsCancel_v0_1 from "./vtc/elections/cancel/0.1/payload.js";
|
|
831
|
+
export * as VtcElectionsCertify_v0_1 from "./vtc/elections/certify/0.1/payload.js";
|
|
832
|
+
export * as VtcElectionsClose_v0_1 from "./vtc/elections/close/0.1/payload.js";
|
|
833
|
+
export * as VtcElectionsCreate_v0_1 from "./vtc/elections/create/0.1/payload.js";
|
|
834
|
+
export * as VtcElectionsList_v0_1 from "./vtc/elections/list/0.1/payload.js";
|
|
835
|
+
export * as VtcElectionsShow_v0_1 from "./vtc/elections/show/0.1/payload.js";
|
|
836
|
+
export * as VtcElectionsTicketsIssue_v0_1 from "./vtc/elections/tickets/issue/0.1/payload.js";
|
|
815
837
|
export * as VtcEndorsementTypesDelete_v0_1 from "./vtc/endorsement-types/delete/0.1/payload.js";
|
|
816
838
|
export * as VtcEndorsementTypesList_v0_1 from "./vtc/endorsement-types/list/0.1/payload.js";
|
|
817
839
|
export * as VtcEndorsementTypesRegister_v0_1 from "./vtc/endorsement-types/register/0.1/payload.js";
|
|
@@ -828,6 +850,8 @@ export * as VtcGroupsDelete_v0_1 from "./vtc/groups/delete/0.1/payload.js";
|
|
|
828
850
|
export * as VtcGroupsJoin_v0_1 from "./vtc/groups/join/0.1/payload.js";
|
|
829
851
|
export * as VtcGroupsLeave_v0_1 from "./vtc/groups/leave/0.1/payload.js";
|
|
830
852
|
export * as VtcGroupsList_v0_1 from "./vtc/groups/list/0.1/payload.js";
|
|
853
|
+
export * as VtcGroupsManagersAdd_v0_1 from "./vtc/groups/managers/add/0.1/payload.js";
|
|
854
|
+
export * as VtcGroupsManagersRemove_v0_1 from "./vtc/groups/managers/remove/0.1/payload.js";
|
|
831
855
|
export * as VtcGroupsMembersAdd_v0_1 from "./vtc/groups/members/add/0.1/payload.js";
|
|
832
856
|
export * as VtcGroupsMembersList_v0_1 from "./vtc/groups/members/list/0.1/payload.js";
|
|
833
857
|
export * as VtcGroupsMembersRemove_v0_1 from "./vtc/groups/members/remove/0.1/payload.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/voting/_shared/0.1/voting.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Reusable $defs for the voting/*, vtc/elections/* and vta/pcs/voter/* task families. Not itself a Trust Task specification. The conventions these shapes serve are in CONVENTIONS.md beside this file; the normative requirements are VTI-VOT-001 – 100 of the VTI specification.
|
|
8
|
+
*/
|
|
9
|
+
export interface CommunityVotingSharedDefinitions {
|
|
10
|
+
[k: string]: unknown | undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The definitions this shared schema publishes, hoisted to one declaration each.
|
|
15
|
+
* See "../../../_shared/components.js".
|
|
16
|
+
*/
|
|
17
|
+
export type { Answer, Ballot, BoardEntry, BoardHead, BoardVisibility, Cast, Disclosure, ElectionId, ElectionResult, ElectionState, ElectionSummary, Key_VotingV0_1 as Key, Manifest, MerklePath, Multibase_VotingV0_1 as Multibase, Question, QuestionOption, QuestionResult, Revote, RollRule, SecrecyLevel, Trustees, VotingParameters } from "../../../_shared/components.js";
|
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/voting/ballot/cast/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Answer, Ballot, BoardHead, Cast, DigestMultibase, ElectionId, Ext, Key_VotingV0_1 as Key, Multibase_VotingV0_1 as Multibase } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A voter's client sends one cast — a ballot and the PCS attestation that admits it — to the election's ballot box, signed by a did:key made for this cast alone. The ballot box answers with a signed receipt.
|
|
11
|
+
*/
|
|
12
|
+
export interface VotingBallotCastPayload {
|
|
13
|
+
/**
|
|
14
|
+
* The DID of the community whose election this is.
|
|
15
|
+
*/
|
|
16
|
+
community: string;
|
|
17
|
+
electionId: ElectionId;
|
|
18
|
+
cast: Cast;
|
|
19
|
+
ext?: Ext;
|
|
20
|
+
}
|
|
21
|
+
export interface VotingBallotCastResponsePayloadTheReceipt {
|
|
22
|
+
electionId: ElectionId;
|
|
23
|
+
/**
|
|
24
|
+
* `counted`: the first ballot under this tag, now counted. `replaced`: a later ballot under a tag that already had one; it is counted and the earlier one no longer is. `alreadyCounted`: this cast was admitted before; nothing changed, and the receipt is the first one's.
|
|
25
|
+
*/
|
|
26
|
+
outcome: "counted" | "replaced" | "alreadyCounted";
|
|
27
|
+
/**
|
|
28
|
+
* The board index of this cast's CastEntry.
|
|
29
|
+
*/
|
|
30
|
+
leafIndex: number;
|
|
31
|
+
/**
|
|
32
|
+
* The RFC 9162 leaf hash of the CastEntry at `leafIndex` (SHA-256, as a multihash).
|
|
33
|
+
*/
|
|
34
|
+
entryHash: DigestMultibase;
|
|
35
|
+
/**
|
|
36
|
+
* A head whose tree includes `leafIndex` — and, for `replaced`, the ReplacementEntry that follows it.
|
|
37
|
+
*/
|
|
38
|
+
head: BoardHead;
|
|
39
|
+
/**
|
|
40
|
+
* 32 random bytes, multibase base58btc. On a private board it authorizes voting/board/inclusion reads of this one leaf.
|
|
41
|
+
*/
|
|
42
|
+
receiptToken: Multibase;
|
|
43
|
+
ext?: Ext;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
47
|
+
export type { Answer, Ballot, BoardHead, Cast, DigestMultibase, ElectionId, Ext, Key, Multibase };
|
|
48
|
+
|
|
49
|
+
/** Trust Task type URI. */
|
|
50
|
+
export const TYPE_URI = "https://trusttasks.org/spec/voting/ballot/cast/0.1" as const;
|
|
51
|
+
|
|
52
|
+
/** Stable alias for this specification's request payload shape. */
|
|
53
|
+
export type Payload = VotingBallotCastPayload;
|
|
54
|
+
|
|
55
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
56
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/voting/ballot/cast/0.1#response" as const;
|
|
57
|
+
|
|
58
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
59
|
+
export type Response = VotingBallotCastResponsePayloadTheReceipt;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* This specification's payload schema, as a value.
|
|
63
|
+
*
|
|
64
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
65
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
66
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
67
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
68
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
69
|
+
*/
|
|
70
|
+
export const PAYLOAD_SCHEMA = {
|
|
71
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
72
|
+
"$id": "https://trusttasks.org/spec/voting/ballot/cast/0.1",
|
|
73
|
+
"title": "Voting — Ballot Cast — payload",
|
|
74
|
+
"description": "A voter's client sends one cast — a ballot and the PCS attestation that admits it — to the election's ballot box, signed by a did:key made for this cast alone. The ballot box answers with a signed receipt.",
|
|
75
|
+
"type": "object",
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"required": [
|
|
78
|
+
"community",
|
|
79
|
+
"electionId",
|
|
80
|
+
"cast"
|
|
81
|
+
],
|
|
82
|
+
"properties": {
|
|
83
|
+
"community": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"minLength": 1,
|
|
86
|
+
"maxLength": 2048,
|
|
87
|
+
"description": "The DID of the community whose election this is."
|
|
88
|
+
},
|
|
89
|
+
"electionId": {
|
|
90
|
+
"$ref": "#/$defs/ElectionId"
|
|
91
|
+
},
|
|
92
|
+
"cast": {
|
|
93
|
+
"$ref": "#/$defs/Cast"
|
|
94
|
+
},
|
|
95
|
+
"ext": {
|
|
96
|
+
"$ref": "#/$defs/Ext"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"$defs": {
|
|
100
|
+
"Response": {
|
|
101
|
+
"$anchor": "response",
|
|
102
|
+
"title": "Voting — Ballot Cast — response payload (the receipt)",
|
|
103
|
+
"type": "object",
|
|
104
|
+
"additionalProperties": false,
|
|
105
|
+
"required": [
|
|
106
|
+
"electionId",
|
|
107
|
+
"outcome",
|
|
108
|
+
"leafIndex",
|
|
109
|
+
"entryHash",
|
|
110
|
+
"head",
|
|
111
|
+
"receiptToken"
|
|
112
|
+
],
|
|
113
|
+
"properties": {
|
|
114
|
+
"electionId": {
|
|
115
|
+
"$ref": "#/$defs/ElectionId"
|
|
116
|
+
},
|
|
117
|
+
"outcome": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"enum": [
|
|
120
|
+
"counted",
|
|
121
|
+
"replaced",
|
|
122
|
+
"alreadyCounted"
|
|
123
|
+
],
|
|
124
|
+
"description": "`counted`: the first ballot under this tag, now counted. `replaced`: a later ballot under a tag that already had one; it is counted and the earlier one no longer is. `alreadyCounted`: this cast was admitted before; nothing changed, and the receipt is the first one's."
|
|
125
|
+
},
|
|
126
|
+
"leafIndex": {
|
|
127
|
+
"type": "integer",
|
|
128
|
+
"minimum": 0,
|
|
129
|
+
"description": "The board index of this cast's CastEntry."
|
|
130
|
+
},
|
|
131
|
+
"entryHash": {
|
|
132
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
133
|
+
"description": "The RFC 9162 leaf hash of the CastEntry at `leafIndex` (SHA-256, as a multihash)."
|
|
134
|
+
},
|
|
135
|
+
"head": {
|
|
136
|
+
"$ref": "#/$defs/BoardHead",
|
|
137
|
+
"description": "A head whose tree includes `leafIndex` — and, for `replaced`, the ReplacementEntry that follows it."
|
|
138
|
+
},
|
|
139
|
+
"receiptToken": {
|
|
140
|
+
"$ref": "#/$defs/Multibase",
|
|
141
|
+
"description": "32 random bytes, multibase base58btc. On a private board it authorizes voting/board/inclusion reads of this one leaf."
|
|
142
|
+
},
|
|
143
|
+
"ext": {
|
|
144
|
+
"$ref": "#/$defs/Ext"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"Ext": {
|
|
149
|
+
"title": "Ext",
|
|
150
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
151
|
+
"type": "object",
|
|
152
|
+
"minProperties": 1,
|
|
153
|
+
"additionalProperties": true,
|
|
154
|
+
"propertyNames": {
|
|
155
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"Multibase": {
|
|
159
|
+
"title": "Multibase",
|
|
160
|
+
"description": "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.",
|
|
161
|
+
"type": "string",
|
|
162
|
+
"maxLength": 16384,
|
|
163
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
164
|
+
},
|
|
165
|
+
"BoardHead": {
|
|
166
|
+
"title": "BoardHead",
|
|
167
|
+
"description": "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.",
|
|
168
|
+
"type": "object",
|
|
169
|
+
"additionalProperties": false,
|
|
170
|
+
"required": [
|
|
171
|
+
"electionId",
|
|
172
|
+
"treeSize",
|
|
173
|
+
"rootHash",
|
|
174
|
+
"issuedAt"
|
|
175
|
+
],
|
|
176
|
+
"properties": {
|
|
177
|
+
"electionId": {
|
|
178
|
+
"$ref": "#/$defs/ElectionId"
|
|
179
|
+
},
|
|
180
|
+
"treeSize": {
|
|
181
|
+
"type": "integer",
|
|
182
|
+
"minimum": 0
|
|
183
|
+
},
|
|
184
|
+
"rootHash": {
|
|
185
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
186
|
+
"description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
|
|
187
|
+
},
|
|
188
|
+
"issuedAt": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"format": "date-time"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
"ElectionId": {
|
|
195
|
+
"title": "ElectionId",
|
|
196
|
+
"description": "An election's identifier, unique within its community. A closed alphabet: it appears in the ticket class label `voter/<electionId>` and is framed into every hash a cast is bound to.",
|
|
197
|
+
"type": "string",
|
|
198
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
199
|
+
},
|
|
200
|
+
"DigestMultibase": {
|
|
201
|
+
"title": "DigestMultibase",
|
|
202
|
+
"description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
|
|
203
|
+
"type": "string",
|
|
204
|
+
"minLength": 16,
|
|
205
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
206
|
+
"examples": [
|
|
207
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
"Cast": {
|
|
211
|
+
"title": "Cast",
|
|
212
|
+
"description": "A ballot and the PCS attestation that admits it (VTI-VOT-030). `attestation` is the suite's canonical encoding of the attestation made for the election point with the ballot context bound in (CONVENTIONS §3); `tag` repeats its tag so a ballot box can refuse a duplicate before the pairing check.",
|
|
213
|
+
"type": "object",
|
|
214
|
+
"additionalProperties": false,
|
|
215
|
+
"required": [
|
|
216
|
+
"ballot",
|
|
217
|
+
"tag",
|
|
218
|
+
"attestation"
|
|
219
|
+
],
|
|
220
|
+
"properties": {
|
|
221
|
+
"ballot": {
|
|
222
|
+
"$ref": "#/$defs/Ballot"
|
|
223
|
+
},
|
|
224
|
+
"tag": {
|
|
225
|
+
"$ref": "#/$defs/Multibase"
|
|
226
|
+
},
|
|
227
|
+
"attestation": {
|
|
228
|
+
"$ref": "#/$defs/Multibase"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
"Ballot": {
|
|
233
|
+
"title": "Ballot",
|
|
234
|
+
"description": "An open ballot: one answer per question of the manifest, in any order. The bytes a cast's proof binds are the RFC 8785 (JCS) canonicalization of this object as received.",
|
|
235
|
+
"type": "object",
|
|
236
|
+
"additionalProperties": false,
|
|
237
|
+
"required": [
|
|
238
|
+
"electionId",
|
|
239
|
+
"manifestDigest",
|
|
240
|
+
"answers"
|
|
241
|
+
],
|
|
242
|
+
"properties": {
|
|
243
|
+
"electionId": {
|
|
244
|
+
"$ref": "#/$defs/ElectionId"
|
|
245
|
+
},
|
|
246
|
+
"manifestDigest": {
|
|
247
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
248
|
+
},
|
|
249
|
+
"answers": {
|
|
250
|
+
"type": "array",
|
|
251
|
+
"minItems": 1,
|
|
252
|
+
"maxItems": 128,
|
|
253
|
+
"items": {
|
|
254
|
+
"$ref": "#/$defs/Answer"
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"Answer": {
|
|
260
|
+
"title": "Answer",
|
|
261
|
+
"description": "The answer to one question. Exactly one member besides `question` is present, matching the question's type, or `abstain` for an optional question left unanswered.",
|
|
262
|
+
"type": "object",
|
|
263
|
+
"additionalProperties": false,
|
|
264
|
+
"required": [
|
|
265
|
+
"question"
|
|
266
|
+
],
|
|
267
|
+
"minProperties": 2,
|
|
268
|
+
"maxProperties": 2,
|
|
269
|
+
"properties": {
|
|
270
|
+
"question": {
|
|
271
|
+
"$ref": "#/$defs/Key"
|
|
272
|
+
},
|
|
273
|
+
"choice": {
|
|
274
|
+
"type": "array",
|
|
275
|
+
"items": {
|
|
276
|
+
"$ref": "#/$defs/Key"
|
|
277
|
+
},
|
|
278
|
+
"uniqueItems": true
|
|
279
|
+
},
|
|
280
|
+
"ranking": {
|
|
281
|
+
"type": "array",
|
|
282
|
+
"items": {
|
|
283
|
+
"$ref": "#/$defs/Key"
|
|
284
|
+
},
|
|
285
|
+
"uniqueItems": true
|
|
286
|
+
},
|
|
287
|
+
"scores": {
|
|
288
|
+
"type": "object",
|
|
289
|
+
"propertyNames": {
|
|
290
|
+
"$ref": "#/$defs/Key"
|
|
291
|
+
},
|
|
292
|
+
"additionalProperties": {
|
|
293
|
+
"type": "integer"
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
"text": {
|
|
297
|
+
"type": "string",
|
|
298
|
+
"maxLength": 4096
|
|
299
|
+
},
|
|
300
|
+
"abstain": {
|
|
301
|
+
"const": true
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
"Key": {
|
|
306
|
+
"title": "Key",
|
|
307
|
+
"description": "A question or option key, unique within its manifest or question.",
|
|
308
|
+
"type": "string",
|
|
309
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
} as const;
|
|
313
|
+
|
|
314
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
315
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
316
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
317
|
+
"$ref": "#/$defs/Response",
|
|
318
|
+
"$defs": {
|
|
319
|
+
"Response": {
|
|
320
|
+
"$anchor": "response",
|
|
321
|
+
"title": "Voting — Ballot Cast — response payload (the receipt)",
|
|
322
|
+
"type": "object",
|
|
323
|
+
"additionalProperties": false,
|
|
324
|
+
"required": [
|
|
325
|
+
"electionId",
|
|
326
|
+
"outcome",
|
|
327
|
+
"leafIndex",
|
|
328
|
+
"entryHash",
|
|
329
|
+
"head",
|
|
330
|
+
"receiptToken"
|
|
331
|
+
],
|
|
332
|
+
"properties": {
|
|
333
|
+
"electionId": {
|
|
334
|
+
"$ref": "#/$defs/ElectionId"
|
|
335
|
+
},
|
|
336
|
+
"outcome": {
|
|
337
|
+
"type": "string",
|
|
338
|
+
"enum": [
|
|
339
|
+
"counted",
|
|
340
|
+
"replaced",
|
|
341
|
+
"alreadyCounted"
|
|
342
|
+
],
|
|
343
|
+
"description": "`counted`: the first ballot under this tag, now counted. `replaced`: a later ballot under a tag that already had one; it is counted and the earlier one no longer is. `alreadyCounted`: this cast was admitted before; nothing changed, and the receipt is the first one's."
|
|
344
|
+
},
|
|
345
|
+
"leafIndex": {
|
|
346
|
+
"type": "integer",
|
|
347
|
+
"minimum": 0,
|
|
348
|
+
"description": "The board index of this cast's CastEntry."
|
|
349
|
+
},
|
|
350
|
+
"entryHash": {
|
|
351
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
352
|
+
"description": "The RFC 9162 leaf hash of the CastEntry at `leafIndex` (SHA-256, as a multihash)."
|
|
353
|
+
},
|
|
354
|
+
"head": {
|
|
355
|
+
"$ref": "#/$defs/BoardHead",
|
|
356
|
+
"description": "A head whose tree includes `leafIndex` — and, for `replaced`, the ReplacementEntry that follows it."
|
|
357
|
+
},
|
|
358
|
+
"receiptToken": {
|
|
359
|
+
"$ref": "#/$defs/Multibase",
|
|
360
|
+
"description": "32 random bytes, multibase base58btc. On a private board it authorizes voting/board/inclusion reads of this one leaf."
|
|
361
|
+
},
|
|
362
|
+
"ext": {
|
|
363
|
+
"$ref": "#/$defs/Ext"
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
"Ext": {
|
|
368
|
+
"title": "Ext",
|
|
369
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
370
|
+
"type": "object",
|
|
371
|
+
"minProperties": 1,
|
|
372
|
+
"additionalProperties": true,
|
|
373
|
+
"propertyNames": {
|
|
374
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
"Multibase": {
|
|
378
|
+
"title": "Multibase",
|
|
379
|
+
"description": "A binary value, multibase base58btc over the suite's canonical (compressed) encoding.",
|
|
380
|
+
"type": "string",
|
|
381
|
+
"maxLength": 16384,
|
|
382
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
383
|
+
},
|
|
384
|
+
"BoardHead": {
|
|
385
|
+
"title": "BoardHead",
|
|
386
|
+
"description": "A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.",
|
|
387
|
+
"type": "object",
|
|
388
|
+
"additionalProperties": false,
|
|
389
|
+
"required": [
|
|
390
|
+
"electionId",
|
|
391
|
+
"treeSize",
|
|
392
|
+
"rootHash",
|
|
393
|
+
"issuedAt"
|
|
394
|
+
],
|
|
395
|
+
"properties": {
|
|
396
|
+
"electionId": {
|
|
397
|
+
"$ref": "#/$defs/ElectionId"
|
|
398
|
+
},
|
|
399
|
+
"treeSize": {
|
|
400
|
+
"type": "integer",
|
|
401
|
+
"minimum": 0
|
|
402
|
+
},
|
|
403
|
+
"rootHash": {
|
|
404
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
405
|
+
"description": "The RFC 9162 Merkle tree hash (SHA-256) of the first `treeSize` entries, as a multihash."
|
|
406
|
+
},
|
|
407
|
+
"issuedAt": {
|
|
408
|
+
"type": "string",
|
|
409
|
+
"format": "date-time"
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
"ElectionId": {
|
|
414
|
+
"title": "ElectionId",
|
|
415
|
+
"description": "An election's identifier, unique within its community. A closed alphabet: it appears in the ticket class label `voter/<electionId>` and is framed into every hash a cast is bound to.",
|
|
416
|
+
"type": "string",
|
|
417
|
+
"pattern": "^[A-Za-z0-9._-]{1,128}$"
|
|
418
|
+
},
|
|
419
|
+
"DigestMultibase": {
|
|
420
|
+
"title": "DigestMultibase",
|
|
421
|
+
"description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
|
|
422
|
+
"type": "string",
|
|
423
|
+
"minLength": 16,
|
|
424
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
425
|
+
"examples": [
|
|
426
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
427
|
+
]
|
|
428
|
+
},
|
|
429
|
+
"Cast": {
|
|
430
|
+
"title": "Cast",
|
|
431
|
+
"description": "A ballot and the PCS attestation that admits it (VTI-VOT-030). `attestation` is the suite's canonical encoding of the attestation made for the election point with the ballot context bound in (CONVENTIONS §3); `tag` repeats its tag so a ballot box can refuse a duplicate before the pairing check.",
|
|
432
|
+
"type": "object",
|
|
433
|
+
"additionalProperties": false,
|
|
434
|
+
"required": [
|
|
435
|
+
"ballot",
|
|
436
|
+
"tag",
|
|
437
|
+
"attestation"
|
|
438
|
+
],
|
|
439
|
+
"properties": {
|
|
440
|
+
"ballot": {
|
|
441
|
+
"$ref": "#/$defs/Ballot"
|
|
442
|
+
},
|
|
443
|
+
"tag": {
|
|
444
|
+
"$ref": "#/$defs/Multibase"
|
|
445
|
+
},
|
|
446
|
+
"attestation": {
|
|
447
|
+
"$ref": "#/$defs/Multibase"
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"Ballot": {
|
|
452
|
+
"title": "Ballot",
|
|
453
|
+
"description": "An open ballot: one answer per question of the manifest, in any order. The bytes a cast's proof binds are the RFC 8785 (JCS) canonicalization of this object as received.",
|
|
454
|
+
"type": "object",
|
|
455
|
+
"additionalProperties": false,
|
|
456
|
+
"required": [
|
|
457
|
+
"electionId",
|
|
458
|
+
"manifestDigest",
|
|
459
|
+
"answers"
|
|
460
|
+
],
|
|
461
|
+
"properties": {
|
|
462
|
+
"electionId": {
|
|
463
|
+
"$ref": "#/$defs/ElectionId"
|
|
464
|
+
},
|
|
465
|
+
"manifestDigest": {
|
|
466
|
+
"$ref": "#/$defs/DigestMultibase"
|
|
467
|
+
},
|
|
468
|
+
"answers": {
|
|
469
|
+
"type": "array",
|
|
470
|
+
"minItems": 1,
|
|
471
|
+
"maxItems": 128,
|
|
472
|
+
"items": {
|
|
473
|
+
"$ref": "#/$defs/Answer"
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
"Answer": {
|
|
479
|
+
"title": "Answer",
|
|
480
|
+
"description": "The answer to one question. Exactly one member besides `question` is present, matching the question's type, or `abstain` for an optional question left unanswered.",
|
|
481
|
+
"type": "object",
|
|
482
|
+
"additionalProperties": false,
|
|
483
|
+
"required": [
|
|
484
|
+
"question"
|
|
485
|
+
],
|
|
486
|
+
"minProperties": 2,
|
|
487
|
+
"maxProperties": 2,
|
|
488
|
+
"properties": {
|
|
489
|
+
"question": {
|
|
490
|
+
"$ref": "#/$defs/Key"
|
|
491
|
+
},
|
|
492
|
+
"choice": {
|
|
493
|
+
"type": "array",
|
|
494
|
+
"items": {
|
|
495
|
+
"$ref": "#/$defs/Key"
|
|
496
|
+
},
|
|
497
|
+
"uniqueItems": true
|
|
498
|
+
},
|
|
499
|
+
"ranking": {
|
|
500
|
+
"type": "array",
|
|
501
|
+
"items": {
|
|
502
|
+
"$ref": "#/$defs/Key"
|
|
503
|
+
},
|
|
504
|
+
"uniqueItems": true
|
|
505
|
+
},
|
|
506
|
+
"scores": {
|
|
507
|
+
"type": "object",
|
|
508
|
+
"propertyNames": {
|
|
509
|
+
"$ref": "#/$defs/Key"
|
|
510
|
+
},
|
|
511
|
+
"additionalProperties": {
|
|
512
|
+
"type": "integer"
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
"text": {
|
|
516
|
+
"type": "string",
|
|
517
|
+
"maxLength": 4096
|
|
518
|
+
},
|
|
519
|
+
"abstain": {
|
|
520
|
+
"const": true
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
"Key": {
|
|
525
|
+
"title": "Key",
|
|
526
|
+
"description": "A question or option key, unique within its manifest or question.",
|
|
527
|
+
"type": "string",
|
|
528
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
} as const;
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
535
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
536
|
+
* per-specification and cannot be derived from the document alone, and
|
|
537
|
+
* item 2 needs the schema this carries.
|
|
538
|
+
*/
|
|
539
|
+
export const SPEC = {
|
|
540
|
+
typeUri: TYPE_URI,
|
|
541
|
+
isBearer: false,
|
|
542
|
+
isProofRequired: true,
|
|
543
|
+
isRecipientRequired: true,
|
|
544
|
+
isIssuedAtRequired: true,
|
|
545
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
546
|
+
} as const;
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
550
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
551
|
+
* parties (§7.3 item 5).
|
|
552
|
+
*/
|
|
553
|
+
export const RESPONSE_SPEC = {
|
|
554
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
555
|
+
isBearer: false,
|
|
556
|
+
isProofRequired: true,
|
|
557
|
+
isRecipientRequired: true,
|
|
558
|
+
isIssuedAtRequired: true,
|
|
559
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
560
|
+
} as const;
|