/** * EDC Type Definitions * * Comprehensive type definitions for Eclipse Dataspace Connector (EDC) v3 API * including Assets, Policies, Contracts, and supporting types. */ // ============================================================================ // Asset Types // ============================================================================ export interface Asset { '@type': 'Asset'; '@id': string; '@context'?: any; properties?: Record; dataAddress?: DataAddress; createdAt?: number; } export interface DataAddress { '@type': 'DataAddress'; type: string; endpoint?: string; baseUrl?: string; properties?: Record; } export interface AssetInput { '@id': string; properties?: Record; dataAddress?: DataAddress; } // ============================================================================ // ODRL Policy Types // ============================================================================ export interface PolicyDefinition { '@type': 'PolicyDefinition'; '@id': string; '@context'?: any; policy: OdrlPolicy; createdAt?: number; } export interface OdrlPolicy { '@type': 'Set' | 'Offer' | 'Agreement'; '@id'?: string; target?: string; permission?: Permission[]; prohibition?: Prohibition[]; obligation?: Duty[]; } export interface Permission { '@type': 'Permission'; action: string | string[]; target?: string; assignee?: string; assigner?: string; constraint?: Constraint[]; } export interface Prohibition { '@type': 'Prohibition'; action: string | string[]; target?: string; assignee?: string; assigner?: string; constraint?: Constraint[]; } export interface Duty { '@type': 'Duty'; action: string | string[]; target?: string; assignee?: string; assigner?: string; constraint?: Constraint[]; } export interface Constraint { '@type': 'Constraint'; leftOperand: string; operator: 'EQ' | 'NEQ' | 'LT' | 'GT' | 'LE' | 'GE' | 'IN' | 'HAS_PART' | 'IS_PART_OF'; rightOperand: string | number | boolean; } export interface PolicyDefinitionInput { '@id': string; policy: OdrlPolicy; } // ============================================================================ // Contract Definition Types // ============================================================================ export interface ContractDefinition { '@type': 'ContractDefinition'; '@id': string; '@context'?: any; accessPolicyId: string; contractPolicyId: string; assetsSelector?: AssetSelector; createdAt?: number; } export interface AssetSelector { '@type': 'CriterionDto'; operandLeft: string; operator: 'EQ' | 'NEQ' | 'IN'; operandRight: string | string[]; } export interface ContractDefinitionInput { '@id': string; accessPolicyId: string; contractPolicyId: string; assetsSelector?: AssetSelector; } // ============================================================================ // Contract Negotiation Types (Future) // ============================================================================ export interface ContractNegotiation { '@type': 'ContractNegotiation'; '@id': string; '@context'?: any; counterPartyAddress: string; protocol: string; state: NegotiationState; contractAgreementId?: string; createdAt?: number; } export type NegotiationState = | 'REQUESTING' | 'REQUESTED' | 'OFFERING' | 'OFFERED' | 'ACCEPTING' | 'ACCEPTED' | 'AGREEING' | 'AGREED' | 'VERIFYING' | 'VERIFIED' | 'FINALIZING' | 'FINALIZED' | 'TERMINATING' | 'TERMINATED'; // ============================================================================ // Navigation & UI Types // ============================================================================ export type TabId = 'assets' | 'policies' | 'contracts' | 'negotiations'; export interface Tab { id: TabId; label: string; icon: string; description: string; } export type ConnectionStatus = 'connected' | 'partial' | 'mock'; export type SortDirection = 'asc' | 'desc'; export type MessageType = 'success' | 'error' | 'info' | 'warning'; // ============================================================================ // EDC Query Specification // ============================================================================ export interface QuerySpec { '@context': { '@vocab': string; }; '@type': 'QuerySpec'; offset: number; limit: number; filterExpression: any[]; sortField?: string; sortOrder?: 'ASC' | 'DESC'; } // ============================================================================ // Store Interface // ============================================================================ export interface EdcStoreInterface { // Assets getAllAssets(): Promise; createAsset(assetData: AssetInput): Promise; updateAsset(assetId: string, assetData: AssetInput): Promise; deleteAsset(assetId: string): Promise; // Policies getAllPolicies(): Promise; createPolicy(policyData: PolicyDefinitionInput): Promise; updatePolicy(policyId: string, policyData: PolicyDefinitionInput): Promise; deletePolicy(policyId: string): Promise; // Contracts (future) getAllContracts?(): Promise; createContract?(contractData: ContractDefinitionInput): Promise; updateContract?(contractId: string, contractData: ContractDefinitionInput): Promise; deleteContract?(contractId: string): Promise; // Negotiations (future) getAllNegotiations?(): Promise; getNegotiation?(negotiationId: string): Promise; }