|
@ -160,12 +160,20 @@ export interface ConfigureOptions { |
|
|
prefetchLeadMinutes?: number; |
|
|
prefetchLeadMinutes?: number; |
|
|
maxNotificationsPerDay?: number; |
|
|
maxNotificationsPerDay?: number; |
|
|
retentionDays?: number; |
|
|
retentionDays?: number; |
|
|
// Phase 1: ActiveDid Integration Enhancement
|
|
|
// Phase 2: TimeSafari ActiveDid Integration Enhancement
|
|
|
activeDidIntegration?: { |
|
|
activeDidIntegration?: { |
|
|
platform: 'android' | 'ios' | 'web' | 'electron'; |
|
|
platform: 'android' | 'ios' | 'web' | 'electron'; |
|
|
storageType: 'plugin-managed' | 'host-managed'; |
|
|
storageType: 'plugin-managed' | 'host-managed'; |
|
|
jwtExpirationSeconds?: number; |
|
|
jwtExpirationSeconds?: number; |
|
|
apiServer?: string; |
|
|
apiServer?: string; |
|
|
|
|
|
// Phase 2: Host-provided activeDid configuration
|
|
|
|
|
|
activeDid?: string; // Initial activeDid from host
|
|
|
|
|
|
hostCredentials?: { |
|
|
|
|
|
platform?: string; // Platform identifier
|
|
|
|
|
|
accessToken?: string; // Optional access token
|
|
|
|
|
|
}; |
|
|
|
|
|
autoSync?: boolean; // Auto-sync activeDid changes
|
|
|
|
|
|
identityChangeGraceSeconds?: number; // Grace period for activeDid changes
|
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -189,6 +197,30 @@ export interface ContentFetchConfig { |
|
|
contentHandler?: ContentHandler; |
|
|
contentHandler?: ContentHandler; |
|
|
cachePolicy?: CachePolicy; |
|
|
cachePolicy?: CachePolicy; |
|
|
networkConfig?: NetworkConfig; |
|
|
networkConfig?: NetworkConfig; |
|
|
|
|
|
// Phase 2: TimeSafari Endorser.ch API configuration
|
|
|
|
|
|
timesafariConfig?: { |
|
|
|
|
|
activeDid: string; // Required activeDid for authentication
|
|
|
|
|
|
endpoints?: { |
|
|
|
|
|
offersToPerson?: string; |
|
|
|
|
|
offersToPlans?: string; |
|
|
|
|
|
projectsLastUpdated?: string; |
|
|
|
|
|
}; |
|
|
|
|
|
syncConfig?: { |
|
|
|
|
|
enableParallel?: boolean; // Enable parallel API requests
|
|
|
|
|
|
maxConcurrent?: number; // Max concurrent requests
|
|
|
|
|
|
batchSize?: number; // Batch size for requests
|
|
|
|
|
|
}; |
|
|
|
|
|
credentialConfig?: { |
|
|
|
|
|
jwtSecret?: string; // JWT secret for signing
|
|
|
|
|
|
tokenExpirationMinutes?: number; // Token expiration
|
|
|
|
|
|
refreshThresholdMinutes?: number; // Refresh threshold
|
|
|
|
|
|
}; |
|
|
|
|
|
errorPolicy?: { |
|
|
|
|
|
maxRetries?: number; |
|
|
|
|
|
backoffMultiplier?: number; |
|
|
|
|
|
activeDidChangeRetries?: number; // Special retry for activeDid changes
|
|
|
|
|
|
}; |
|
|
|
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export interface UserNotificationConfig { |
|
|
export interface UserNotificationConfig { |
|
@ -397,6 +429,116 @@ export interface PlanSummary { |
|
|
url?: string; |
|
|
url?: string; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Phase 2: Detailed TimeSafari Notification Types
|
|
|
|
|
|
export interface TimeSafariNotificationBundle { |
|
|
|
|
|
offersToPerson?: OffersResponse; |
|
|
|
|
|
offersToProjects?: OffersToPlansResponse; |
|
|
|
|
|
projectUpdates?: PlansLastUpdatedResponse; |
|
|
|
|
|
fetchTimestamp: number; |
|
|
|
|
|
success: boolean; |
|
|
|
|
|
error?: string; |
|
|
|
|
|
metadata?: { |
|
|
|
|
|
activeDid: string; |
|
|
|
|
|
fetchDurationMs: number; |
|
|
|
|
|
cachedResponses: number; |
|
|
|
|
|
networkResponses: number; |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export interface TimeSafariUserConfig { |
|
|
|
|
|
activeDid: string; // Required for all operations
|
|
|
|
|
|
lastKnownOfferId?: string; |
|
|
|
|
|
lastKnownPlanId?: string; |
|
|
|
|
|
starredPlanIds?: string[]; |
|
|
|
|
|
fetchOffersToPerson?: boolean; |
|
|
|
|
|
fetchOffersToProjects?: boolean; |
|
|
|
|
|
fetchProjectUpdates?: boolean; |
|
|
|
|
|
notificationPreferences?: { |
|
|
|
|
|
offers: boolean; |
|
|
|
|
|
projects: boolean; |
|
|
|
|
|
people: boolean; |
|
|
|
|
|
items: boolean; |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Enhanced notification types per specification
|
|
|
|
|
|
export interface TimeSafariOfferNotification { |
|
|
|
|
|
type: 'offer'; |
|
|
|
|
|
subtype: 'new_to_me' | 'changed_to_me' | 'new_to_projects' | 'changed_to_projects' | 'new_to_favorites' | 'changed_to_favorites'; |
|
|
|
|
|
offer: OfferSummaryRecord; |
|
|
|
|
|
relevantProjects?: PlanSummary[]; |
|
|
|
|
|
notificationPriority: 'high' | 'medium' | 'low'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export interface TimeSafariProjectNotification { |
|
|
|
|
|
type: 'project'; |
|
|
|
|
|
subtype: 'local_and_new' | 'local_and_changed' | 'with_content_and_new' | 'favorite_and_changed'; |
|
|
|
|
|
project: PlanSummary; |
|
|
|
|
|
changes?: { |
|
|
|
|
|
fields: string[]; |
|
|
|
|
|
previousValues?: Record<string, any>; |
|
|
|
|
|
}; |
|
|
|
|
|
relevantOffers?: OfferSummaryRecord[]; |
|
|
|
|
|
notificationPriority: 'high' | 'medium' | 'low'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export interface TimeSafariPersonNotification { |
|
|
|
|
|
type: 'person'; |
|
|
|
|
|
subtype: 'local_and_new' | 'local_and_changed' | 'with_content_and_new' | 'favorite_and_changed'; |
|
|
|
|
|
personDid: string; |
|
|
|
|
|
changes?: { |
|
|
|
|
|
fields: string[]; |
|
|
|
|
|
previousValues?: Record<string, any>; |
|
|
|
|
|
}; |
|
|
|
|
|
relevantProjects?: PlanSummary[]; |
|
|
|
|
|
notificationPriority: 'high' | 'medium' | 'low'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export interface TimeSafariItemNotification { |
|
|
|
|
|
type: 'item'; |
|
|
|
|
|
subtype: 'local_and_new' | 'local_and_changed' | 'favorite_and_changed'; |
|
|
|
|
|
itemId: string; |
|
|
|
|
|
changes?: { |
|
|
|
|
|
fields: string[]; |
|
|
|
|
|
previousValues?: Record<string, any>; |
|
|
|
|
|
}; |
|
|
|
|
|
relevantContext?: 'project' | 'offer' | 'person'; |
|
|
|
|
|
notificationPriority: 'high' | 'medium' | 'low'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Union type for TimeSafari notifications
|
|
|
|
|
|
export type TimeSafariNotification = |
|
|
|
|
|
| TimeSafariOfferNotification |
|
|
|
|
|
| TimeSafariProjectNotification |
|
|
|
|
|
| TimeSafariPersonNotification |
|
|
|
|
|
| TimeSafariItemNotification; |
|
|
|
|
|
|
|
|
|
|
|
// Enhanced ActiveDid Management Events
|
|
|
|
|
|
export interface ActiveDidChangeEventEnhanced extends ActiveDidChangeEvent { |
|
|
|
|
|
sourceComponent: string; // 'host' | 'plugin' | 'background' | 'sync'
|
|
|
|
|
|
changeReason: 'user_switch' | 'session_expired' | 'background_refresh' | 'setup'; |
|
|
|
|
|
transitionDurationMs?: number; |
|
|
|
|
|
relatedNotifications?: TimeSafariNotification[]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// TimeSafari-specific Platform Configuration
|
|
|
|
|
|
export interface TimeSafariPlatformConfig { |
|
|
|
|
|
platform: 'android' | 'ios' | 'web' | 'electron'; |
|
|
|
|
|
storageType: 'plugin-managed' | 'host-managed'; |
|
|
|
|
|
syncStrategy: 'immediate' | 'batched' | 'scheduled'; |
|
|
|
|
|
permissions: { |
|
|
|
|
|
notifications: boolean; |
|
|
|
|
|
backgroundRefresh: boolean; |
|
|
|
|
|
networkAccess: boolean; |
|
|
|
|
|
}; |
|
|
|
|
|
capabilities: { |
|
|
|
|
|
pushNotifications: boolean; |
|
|
|
|
|
backgroundTasks: boolean; |
|
|
|
|
|
identityManagement: boolean; |
|
|
|
|
|
cryptoSigning: boolean; |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
export interface ActiveDidIntegrationConfig { |
|
|
export interface ActiveDidIntegrationConfig { |
|
|
platform: 'android' | 'ios' | 'web' | 'electron'; |
|
|
platform: 'android' | 'ios' | 'web' | 'electron'; |
|
|
storageType: 'plugin-managed' | 'host-managed'; |
|
|
storageType: 'plugin-managed' | 'host-managed'; |
|
|