forked from trent_larson/crowd-funder-for-time-pwa
fix some errors and correct recent type duplications & bloat (cherry-picked from d8f2587d1c)
This commit is contained in:
@@ -1,14 +1,24 @@
|
||||
import { GenericVerifiableCredential } from "./common";
|
||||
/**
|
||||
* Types of Claims
|
||||
*
|
||||
* Note that these are for the claims that get signed.
|
||||
* Records that are the latest edited entities are in the records.ts file.
|
||||
*
|
||||
*/
|
||||
|
||||
export interface AgreeVerifiableCredential {
|
||||
"@context": string;
|
||||
import { ClaimObject } from "./common";
|
||||
|
||||
export interface AgreeActionClaim extends ClaimObject {
|
||||
"@context": "https://schema.org";
|
||||
"@type": string;
|
||||
object: Record<string, unknown>;
|
||||
}
|
||||
|
||||
// Note that previous VCs may have additional fields.
|
||||
// https://endorser.ch/doc/html/transactions.html#id4
|
||||
export interface GiveVerifiableCredential extends GenericVerifiableCredential {
|
||||
export interface GiveActionClaim extends ClaimObject {
|
||||
// context is optional because it might be embedded in another claim, eg. an AgreeAction
|
||||
"@context"?: "https://schema.org";
|
||||
"@type": "GiveAction";
|
||||
agent?: { identifier: string };
|
||||
description?: string;
|
||||
@@ -16,43 +26,21 @@ export interface GiveVerifiableCredential extends GenericVerifiableCredential {
|
||||
identifier?: string;
|
||||
image?: string;
|
||||
object?: { amountOfThisGood: number; unitCode: string };
|
||||
provider?: GenericVerifiableCredential;
|
||||
provider?: ClaimObject;
|
||||
recipient?: { identifier: string };
|
||||
type: string[];
|
||||
issuer: string;
|
||||
issuanceDate: string;
|
||||
credentialSubject: {
|
||||
id: string;
|
||||
type: "GiveAction";
|
||||
offeredBy?: {
|
||||
type: "Person";
|
||||
identifier: string;
|
||||
};
|
||||
offeredTo?: {
|
||||
type: "Person";
|
||||
identifier: string;
|
||||
};
|
||||
offeredToProject?: {
|
||||
type: "Project";
|
||||
identifier: string;
|
||||
};
|
||||
offeredToProjectVisibleToDids?: string[];
|
||||
offeredToVisibleToDids?: string[];
|
||||
offeredByVisibleToDids?: string[];
|
||||
amount: {
|
||||
type: "QuantitativeValue";
|
||||
value: number;
|
||||
unitCode: string;
|
||||
};
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface JoinActionClaim extends ClaimObject {
|
||||
agent?: { identifier: string };
|
||||
event?: { organizer?: { name: string }; name?: string; startTime?: string };
|
||||
}
|
||||
|
||||
// Note that previous VCs may have additional fields.
|
||||
// https://endorser.ch/doc/html/transactions.html#id8
|
||||
export interface OfferVerifiableCredential extends GenericVerifiableCredential {
|
||||
export interface OfferClaim extends ClaimObject {
|
||||
"@context": "https://schema.org";
|
||||
"@type": "Offer";
|
||||
agent?: { identifier: string };
|
||||
description?: string;
|
||||
fulfills?: { "@type": string; identifier?: string; lastClaimId?: string }[];
|
||||
identifier?: string;
|
||||
@@ -67,43 +55,18 @@ export interface OfferVerifiableCredential extends GenericVerifiableCredential {
|
||||
name?: string;
|
||||
};
|
||||
};
|
||||
provider?: GenericVerifiableCredential;
|
||||
offeredBy?: {
|
||||
type?: "Person";
|
||||
identifier: string;
|
||||
};
|
||||
provider?: ClaimObject;
|
||||
recipient?: { identifier: string };
|
||||
validThrough?: string;
|
||||
type: string[];
|
||||
issuer: string;
|
||||
issuanceDate: string;
|
||||
credentialSubject: {
|
||||
id: string;
|
||||
type: "Offer";
|
||||
offeredBy?: {
|
||||
type: "Person";
|
||||
identifier: string;
|
||||
};
|
||||
offeredTo?: {
|
||||
type: "Person";
|
||||
identifier: string;
|
||||
};
|
||||
offeredToProject?: {
|
||||
type: "Project";
|
||||
identifier: string;
|
||||
};
|
||||
offeredToProjectVisibleToDids?: string[];
|
||||
offeredToVisibleToDids?: string[];
|
||||
offeredByVisibleToDids?: string[];
|
||||
amount: {
|
||||
type: "QuantitativeValue";
|
||||
value: number;
|
||||
unitCode: string;
|
||||
};
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
};
|
||||
}
|
||||
|
||||
// Note that previous VCs may have additional fields.
|
||||
// https://endorser.ch/doc/html/transactions.html#id7
|
||||
export interface PlanVerifiableCredential extends GenericVerifiableCredential {
|
||||
export interface PlanActionClaim extends ClaimObject {
|
||||
"@context": "https://schema.org";
|
||||
"@type": "PlanAction";
|
||||
name: string;
|
||||
@@ -117,11 +80,18 @@ export interface PlanVerifiableCredential extends GenericVerifiableCredential {
|
||||
}
|
||||
|
||||
// AKA Registration & RegisterAction
|
||||
export interface RegisterVerifiableCredential {
|
||||
"@context": string;
|
||||
export interface RegisterActionClaim extends ClaimObject {
|
||||
"@context": "https://schema.org";
|
||||
"@type": "RegisterAction";
|
||||
agent: { identifier: string };
|
||||
identifier?: string;
|
||||
object: string;
|
||||
object?: string;
|
||||
participant?: { identifier: string };
|
||||
}
|
||||
|
||||
export interface TenureClaim extends ClaimObject {
|
||||
"@context": "https://endorser.ch";
|
||||
"@type": "Tenure";
|
||||
party?: { identifier: string };
|
||||
spatialUnit?: { geo?: { polygon?: string } };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user