@wealthfolio/addon-sdk 1.0.0 → 3.0.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.
@@ -43,44 +43,28 @@ var PERMISSION_CATEGORIES = [
43
43
  id: "market-data",
44
44
  name: "Market Data",
45
45
  description: "Access to market prices, quotes, and financial data",
46
- functions: [
47
- "searchTicker",
48
- "syncHistory",
49
- "sync",
50
- "getProviders"
51
- ],
46
+ functions: ["searchTicker", "syncHistory", "sync", "getProviders"],
52
47
  riskLevel: "low"
53
48
  },
54
49
  {
55
50
  id: "assets",
56
51
  name: "Asset Management",
57
52
  description: "Access to asset profiles and data sources",
58
- functions: [
59
- "getProfile",
60
- "updateProfile",
61
- "updateDataSource"
62
- ],
53
+ functions: ["getProfile", "updateProfile", "updateQuoteMode"],
63
54
  riskLevel: "medium"
64
55
  },
65
56
  {
66
57
  id: "quotes",
67
58
  name: "Quote Management",
68
59
  description: "Access to price quotes and historical data",
69
- functions: [
70
- "update",
71
- "getHistory"
72
- ],
60
+ functions: ["update", "getHistory"],
73
61
  riskLevel: "low"
74
62
  },
75
63
  {
76
64
  id: "performance",
77
65
  name: "Performance Analytics",
78
66
  description: "Access to performance calculations and metrics",
79
- functions: [
80
- "calculateHistory",
81
- "calculateSummary",
82
- "calculateAccountsSimple"
83
- ],
67
+ functions: ["calculateHistory", "calculateSummary", "calculateAccountsSimple"],
84
68
  riskLevel: "medium"
85
69
  },
86
70
  {
@@ -94,25 +78,14 @@ var PERMISSION_CATEGORIES = [
94
78
  id: "goals",
95
79
  name: "Goals Management",
96
80
  description: "Access to financial goals and allocations",
97
- functions: [
98
- "getAll",
99
- "create",
100
- "update",
101
- "updateAllocations",
102
- "getAllocations"
103
- ],
81
+ functions: ["getAll", "create", "update", "updateAllocations", "getAllocations"],
104
82
  riskLevel: "medium"
105
83
  },
106
84
  {
107
85
  id: "contribution-limits",
108
86
  name: "Contribution Limits",
109
87
  description: "Access to contribution limits and deposit calculations",
110
- functions: [
111
- "getAll",
112
- "create",
113
- "update",
114
- "calculateDeposits"
115
- ],
88
+ functions: ["getAll", "create", "update", "calculateDeposits"],
116
89
  riskLevel: "medium"
117
90
  },
118
91
  {
@@ -202,12 +175,9 @@ function addDetectedFunction(permission, functionName, detectedAt) {
202
175
  existingFunc.isDetected = true;
203
176
  existingFunc.detectedAt = detectedAt || (/* @__PURE__ */ new Date()).toISOString();
204
177
  } else {
205
- permission.functions.push(createFunctionPermission(
206
- functionName,
207
- false,
208
- true,
209
- detectedAt
210
- ));
178
+ permission.functions.push(
179
+ createFunctionPermission(functionName, false, true, detectedAt)
180
+ );
211
181
  }
212
182
  return permission;
213
183
  }
@@ -235,4 +205,4 @@ export {
235
205
  addDetectedFunction,
236
206
  markFunctionAsDeclared
237
207
  };
238
- //# sourceMappingURL=chunk-3OBZP7TN.mjs.map
208
+ //# sourceMappingURL=chunk-6MGUTH7T.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/permissions.ts"],"sourcesContent":["/**\n * Permission system types and constants for Wealthfolio addons\n */\n\n/**\n * Security risk levels for addon operations\n */\nexport type RiskLevel = 'low' | 'medium' | 'high';\n\n/**\n * Function permission details with declaration and detection tracking\n */\nexport interface FunctionPermission {\n /** Function name */\n name: string;\n /** Whether this function was declared by the developer in manifest */\n isDeclared: boolean;\n /** Whether this function was detected by static analysis during installation */\n isDetected: boolean;\n /** ISO timestamp when this function was detected (if isDetected is true) */\n detectedAt?: string;\n}\n\n/**\n * Permission requirement for specific addon functionality\n */\nexport interface Permission {\n /** Permission category identifier */\n category: string;\n /** List of API functions this permission grants access to with their declaration/detection status */\n functions: FunctionPermission[];\n /** Human-readable explanation of why this permission is needed */\n purpose: string;\n}\n\n/**\n * Permission category definition\n */\nexport interface PermissionCategory {\n /** Unique category identifier */\n id: string;\n /** Display name for the category */\n name: string;\n /** Detailed description of what this category covers */\n description: string;\n /** List of API functions in this category */\n functions: string[];\n /** Security risk level for this category */\n riskLevel: RiskLevel;\n}\n\n/**\n * Predefined permission categories with their associated functions and risk levels\n */\nexport const PERMISSION_CATEGORIES: PermissionCategory[] = [\n {\n id: 'accounts',\n name: 'Account Management',\n description: 'Access to account information and settings',\n functions: ['getAll', 'create'],\n riskLevel: 'high',\n },\n {\n id: 'portfolio',\n name: 'Portfolio Data',\n description: 'Access to holdings, portfolio performance, and account valuations',\n functions: [\n 'getHoldings',\n 'getHolding',\n 'update',\n 'recalculate',\n 'getIncomeSummary',\n 'getHistoricalValuations',\n 'getLatestValuations',\n ],\n riskLevel: 'high',\n },\n {\n id: 'activities',\n name: 'Transaction History',\n description: 'Access to transaction records and activity management',\n functions: [\n 'getAll',\n 'search',\n 'create',\n 'update',\n 'saveMany',\n 'import',\n 'checkImport',\n 'getImportMapping',\n 'saveImportMapping',\n ],\n riskLevel: 'high',\n },\n {\n id: 'market-data',\n name: 'Market Data',\n description: 'Access to market prices, quotes, and financial data',\n functions: ['searchTicker', 'syncHistory', 'sync', 'getProviders'],\n riskLevel: 'low',\n },\n {\n id: 'assets',\n name: 'Asset Management',\n description: 'Access to asset profiles and data sources',\n functions: ['getProfile', 'updateProfile', 'updateQuoteMode'],\n riskLevel: 'medium',\n },\n {\n id: 'quotes',\n name: 'Quote Management',\n description: 'Access to price quotes and historical data',\n functions: ['update', 'getHistory'],\n riskLevel: 'low',\n },\n {\n id: 'performance',\n name: 'Performance Analytics',\n description: 'Access to performance calculations and metrics',\n functions: ['calculateHistory', 'calculateSummary', 'calculateAccountsSimple'],\n riskLevel: 'medium',\n },\n {\n id: 'currency',\n name: 'Exchange Rates',\n description: 'Access to currency exchange rates and conversion data',\n functions: ['getAll', 'update', 'add'],\n riskLevel: 'low',\n },\n {\n id: 'goals',\n name: 'Goals Management',\n description: 'Access to financial goals and allocations',\n functions: ['getAll', 'create', 'update', 'updateAllocations', 'getAllocations'],\n riskLevel: 'medium',\n },\n {\n id: 'contribution-limits',\n name: 'Contribution Limits',\n description: 'Access to contribution limits and deposit calculations',\n functions: ['getAll', 'create', 'update', 'calculateDeposits'],\n riskLevel: 'medium',\n },\n {\n id: 'settings',\n name: 'Application Settings',\n description: 'Access to application settings and configuration',\n functions: ['get', 'update', 'backupDatabase'],\n riskLevel: 'medium',\n },\n {\n id: 'files',\n name: 'File Operations',\n description: 'Access to file dialogs and file system operations',\n functions: ['openCsvDialog', 'openSaveDialog'],\n riskLevel: 'medium',\n },\n {\n id: 'secrets',\n name: 'Secrets Management',\n description: 'Access to secure storage for addon secrets',\n functions: ['set', 'get', 'delete'],\n riskLevel: 'high',\n },\n {\n id: 'events',\n name: 'Event Listeners',\n description: 'Access to application events and notifications',\n functions: [\n 'onDropHover',\n 'onDrop',\n 'onDropCancelled',\n 'onUpdateStart',\n 'onUpdateComplete',\n 'onUpdateError',\n 'onSyncStart',\n 'onSyncComplete',\n ],\n riskLevel: 'low',\n },\n {\n id: 'ui',\n name: 'User Interface',\n description: 'Access to modify navigation and add UI components',\n functions: ['sidebar.addItem', 'router.add'],\n riskLevel: 'low',\n },\n];\n\n/**\n * Helper functions for permission management\n */\n\n/**\n * Create a FunctionPermission object\n */\nexport function createFunctionPermission(\n name: string,\n isDeclared = false,\n isDetected = false,\n detectedAt?: string,\n): FunctionPermission {\n return {\n name,\n isDeclared,\n isDetected,\n detectedAt: isDetected ? detectedAt || new Date().toISOString() : undefined,\n };\n}\n\n/**\n * Get permission category by ID\n */\nexport function getPermissionCategory(id: string): PermissionCategory | undefined {\n return PERMISSION_CATEGORIES.find((category) => category.id === id);\n}\n\n/**\n * Get permission categories by risk level\n */\nexport function getPermissionCategoriesByRisk(\n riskLevel: RiskLevel,\n): PermissionCategory[] {\n return PERMISSION_CATEGORIES.filter((category) => category.riskLevel === riskLevel);\n}\n\n/**\n * Get the risk level for a specific function\n */\nexport function getFunctionRiskLevel(functionName: string): RiskLevel | undefined {\n const category = PERMISSION_CATEGORIES.find((cat) =>\n cat.functions.includes(functionName),\n );\n return category?.riskLevel;\n}\n\n/**\n * Check if a function requires a specific permission category\n */\nexport function isPermissionRequired(functionName: string, categoryId: string): boolean {\n const category = getPermissionCategory(categoryId);\n return category ? category.functions.includes(functionName) : false;\n}\n\n/**\n * Get all declared functions from a permission\n */\nexport function getDeclaredFunctions(permission: Permission): string[] {\n return permission.functions.filter((func) => func.isDeclared).map((func) => func.name);\n}\n\n/**\n * Get all detected functions from a permission\n */\nexport function getDetectedFunctions(permission: Permission): string[] {\n return permission.functions.filter((func) => func.isDetected).map((func) => func.name);\n}\n\n/**\n * Get functions that were detected but not declared (potential security concern)\n */\nexport function getUndeclaredDetectedFunctions(permission: Permission): string[] {\n return permission.functions\n .filter((func) => func.isDetected && !func.isDeclared)\n .map((func) => func.name);\n}\n\n/**\n * Check if a permission has any undeclared detected functions\n */\nexport function hasUndeclaredDetectedFunctions(permission: Permission): boolean {\n return permission.functions.some((func) => func.isDetected && !func.isDeclared);\n}\n\n/**\n * Add a detected function to a permission\n */\nexport function addDetectedFunction(\n permission: Permission,\n functionName: string,\n detectedAt?: string,\n): Permission {\n const existingFunc = permission.functions.find((f) => f.name === functionName);\n\n if (existingFunc) {\n // Update existing function to mark as detected\n existingFunc.isDetected = true;\n existingFunc.detectedAt = detectedAt || new Date().toISOString();\n } else {\n // Add new detected function\n permission.functions.push(\n createFunctionPermission(functionName, false, true, detectedAt),\n );\n }\n\n return permission;\n}\n\n/**\n * Mark a function as declared in a permission\n */\nexport function markFunctionAsDeclared(\n permission: Permission,\n functionName: string,\n): Permission {\n const existingFunc = permission.functions.find((f) => f.name === functionName);\n\n if (existingFunc) {\n existingFunc.isDeclared = true;\n } else {\n // Add new declared function\n permission.functions.push(createFunctionPermission(functionName, true, false));\n }\n\n return permission;\n}\n"],"mappings":";AAsDO,IAAM,wBAA8C;AAAA,EACzD;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,WAAW,CAAC,UAAU,QAAQ;AAAA,IAC9B,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,IAAI;A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Ac,MAAM,KAAK,CAAC;AAAA,EAC/E;AAEA,SAAO;AACT;","names":[]}
@@ -4,7 +4,7 @@ import {
4
4
  getPermissionCategoriesByRisk,
5
5
  getPermissionCategory,
6
6
  isPermissionRequired
7
- } from "./chunk-3OBZP7TN.mjs";
7
+ } from "./chunk-6MGUTH7T.js";
8
8
 
9
9
  // src/query-keys.ts
10
10
  var QueryKeys = {
@@ -69,22 +69,23 @@ function isInstalledManifest(manifest) {
69
69
  // package.json
70
70
  var package_default = {
71
71
  name: "@wealthfolio/addon-sdk",
72
- version: "1.0.0",
72
+ version: "3.0.0",
73
+ type: "module",
73
74
  description: "TypeScript SDK for building Wealthfolio addons with enhanced functionality and type safety",
74
- main: "dist/index.mjs",
75
- types: "dist/index.d.mts",
75
+ main: "dist/index.js",
76
+ types: "dist/src/index.d.ts",
76
77
  exports: {
77
78
  ".": {
78
- import: "./dist/index.mjs",
79
- types: "./dist/index.d.mts"
79
+ import: "./dist/index.js",
80
+ types: "./dist/src/index.d.ts"
80
81
  },
81
82
  "./types": {
82
- import: "./dist/types.mjs",
83
- types: "./dist/types.d.mts"
83
+ import: "./dist/types.js",
84
+ types: "./dist/src/types.d.ts"
84
85
  },
85
86
  "./permissions": {
86
- import: "./dist/permissions.mjs",
87
- types: "./dist/permissions.d.mts"
87
+ import: "./dist/permissions.js",
88
+ types: "./dist/src/permissions.d.ts"
88
89
  }
89
90
  },
90
91
  files: [
@@ -113,18 +114,28 @@ var package_default = {
113
114
  url: "https://github.com/afadil/wealthfolio/issues"
114
115
  },
115
116
  scripts: {
116
- build: "tsup",
117
+ build: "tsup && pnpm run build:types",
117
118
  dev: "tsup --watch",
118
119
  clean: "rm -rf dist",
119
- lint: "tsc --noEmit",
120
+ lint: "eslint .",
121
+ "lint:fix": "eslint . --fix",
122
+ "lint:quiet": "eslint . --quiet",
123
+ format: "prettier --write .",
124
+ "format:check": "prettier --check .",
125
+ "type-check": "tsc --noEmit",
126
+ "build:types": "tsc -p tsconfig.json",
120
127
  prepack: "npm run build"
121
128
  },
122
- devDependencies: {
123
- tsup: "^8.5.0",
124
- typescript: "^5.8.3"
125
- },
126
129
  peerDependencies: {
127
- react: "^18.0.0"
130
+ react: "^19.2.4",
131
+ "react-dom": "^19.2.4"
132
+ },
133
+ devDependencies: {
134
+ "@tanstack/react-query": "^5.90.20",
135
+ "@types/react": "^19.2.13",
136
+ "@types/react-dom": "^19.2.3",
137
+ tsup: "^8.5.1",
138
+ typescript: "^5.9.3"
128
139
  },
129
140
  engines: {
130
141
  node: ">=20.0.0"
@@ -199,10 +210,45 @@ function isAddonManifest(obj) {
199
210
  return typeof obj === "object" && obj !== null && typeof obj.id === "string" && typeof obj.name === "string" && typeof obj.version === "string";
200
211
  }
201
212
 
213
+ // src/goal-progress.ts
214
+ function calculateGoalProgress(accountsValuations, goals, allocations) {
215
+ if (!accountsValuations || accountsValuations.length === 0 || !goals || !allocations) {
216
+ return [];
217
+ }
218
+ const baseCurrency = accountsValuations[0].baseCurrency ?? "USD";
219
+ const accountValueMap = /* @__PURE__ */ new Map();
220
+ accountsValuations.forEach((account) => {
221
+ const valueInBaseCurrency = (account.totalValue ?? 0) * (account.fxRateToBase ?? 1);
222
+ accountValueMap.set(account.accountId, valueInBaseCurrency);
223
+ });
224
+ const allocationsByGoal = /* @__PURE__ */ new Map();
225
+ allocations.forEach((alloc) => {
226
+ const existing = allocationsByGoal.get(alloc.goalId) ?? [];
227
+ allocationsByGoal.set(alloc.goalId, [...existing, alloc]);
228
+ });
229
+ const sortedGoals = [...goals].sort((a, b) => a.targetAmount - b.targetAmount);
230
+ return sortedGoals.map((goal) => {
231
+ const goalAllocations = allocationsByGoal.get(goal.id) ?? [];
232
+ const totalAllocatedValue = goalAllocations.reduce((total, allocation) => {
233
+ const accountValueInBase = accountValueMap.get(allocation.accountId) ?? 0;
234
+ return total + accountValueInBase * allocation.percentAllocation / 100;
235
+ }, 0);
236
+ const progress = goal.targetAmount > 0 ? totalAllocatedValue / goal.targetAmount : 0;
237
+ return {
238
+ name: goal.title,
239
+ targetValue: goal.targetAmount,
240
+ currentValue: totalAllocatedValue,
241
+ progress,
242
+ currency: baseCurrency
243
+ };
244
+ });
245
+ }
246
+
202
247
  // src/index.ts
203
- var ReactVersion = "18.3.1";
204
- var React = window.React;
205
- var ReactDOM = window.ReactDOM;
248
+ var ReactVersion = "19.1.1";
249
+ var hostGlobals = window;
250
+ var React = hostGlobals.React;
251
+ var ReactDOM = hostGlobals.ReactDOM;
206
252
  export {
207
253
  PERMISSION_CATEGORIES,
208
254
  QueryKeys,
@@ -210,6 +256,7 @@ export {
210
256
  ReactDOM,
211
257
  ReactVersion,
212
258
  SDK_VERSION,
259
+ calculateGoalProgress,
213
260
  formatAddonSize,
214
261
  generateAddonId,
215
262
  getFunctionRiskLevel,
@@ -223,12 +270,12 @@ export {
223
270
  };
224
271
  /**
225
272
  * @wealthfolio/addon-sdk
226
- *
273
+ *
227
274
  * TypeScript SDK for building Wealthfolio addons with enhanced functionality,
228
275
  * type safety, and comprehensive permission management.
229
- *
276
+ *
230
277
  * @version 1.0.0
231
278
  * @author Wealthfolio Team
232
279
  * @license MIT
233
280
  */
234
- //# sourceMappingURL=index.mjs.map
281
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/query-keys.ts","../src/manifest.ts","../package.json","../src/version.ts","../src/utils.ts","../src/goal-progress.ts","../src/index.ts"],"sourcesContent":["/**\n * Shared Query Keys for React Query\n * These keys should match the main application's query keys to ensure cache consistency\n */\nexport const QueryKeys = {\n // Account related keys\n ACCOUNTS: 'accounts',\n ACCOUNTS_SUMMARY: 'accounts_summary',\n\n // Activity related keys\n ACTIVITY_DATA: 'activity-data',\n ACTIVITIES: 'activities',\n\n // Portfolio related keys\n HOLDINGS: 'holdings',\n HOLDING: 'holding',\n INCOME_SUMMARY: 'incomeSummary',\n PORTFOLIO_SUMMARY: 'portfolioSummary',\n QUOTE_HISTORY: 'quoteHistory',\n\n // Goals related keys\n GOALS: 'goals',\n GOALS_ALLOCATIONS: 'goals_allocations',\n\n // Settings related keys\n SETTINGS: 'settings',\n EXCHANGE_RATES: 'exchangeRates',\n\n // New keys for exchange rates\n EXCHANGE_RATE_SYMBOLS: 'exchange_rate_symbols',\n QUOTE: 'quote',\n\n CONTRIBUTION_LIMITS: 'contributionLimits',\n CONTRIBUTION_LIMIT_PROGRESS: 'contributionLimitProgress',\n\n ASSET_DATA: 'asset_data',\n IMPORT_MAPPING: 'import_mapping',\n\n PERFORMANCE_SUMMARY: 'performanceSummary',\n PERFORMANCE_HISTORY: 'performanceHistory',\n\n HISTORY_VALUATION: 'historyValuation',\n // Helper function to create account-specific keys\n valuationHistory: (id: string) => [QueryKeys.HISTORY_VALUATION, id],\n\n // Account simple performance\n ACCOUNTS_SIMPLE_PERFORMANCE: 'accountsSimplePerformance',\n accountsSimplePerformance: (accountIds: string[]) => [\n QueryKeys.ACCOUNTS_SIMPLE_PERFORMANCE,\n [...accountIds].sort().join(',') || 'none',\n ],\n\n // Market Data Providers\n MARKET_DATA_PROVIDERS: 'marketDataProviders',\n MARKET_DATA_PROVIDER_SETTINGS: 'marketDataProviderSettings',\n\n transactions: 'transactions',\n latestValuations: 'latest-valuations',\n\n // Market Data\n symbolSearch: 'symbol-search',\n\n ASSET_HISTORY: 'asset-history',\n\n // Addons\n INSTALLED_ADDONS: 'installedAddons',\n ADDON_STORE_LISTINGS: 'addonStoreListings',\n ADDON_AUTO_UPDATE_CHECK: 'addonAutoUpdateCheck',\n\n secrets: {\n apiKey: (providerId: string) => ['secrets', 'apiKey', providerId],\n },\n} as const;\n\nexport type QueryKeys = typeof QueryKeys;\n","/**\n * Addon manifest and metadata types\n */\n\nimport type { Permission } from './permissions';\n\n/**\n * Unified addon manifest structure that handles both development and runtime scenarios\n * This represents both what developers write in their manifest.json and installed addon metadata\n */\nexport interface AddonManifest {\n // Core manifest fields (always present)\n /** Unique addon identifier (lowercase, no spaces, hyphens allowed) */\n id: string;\n /** Human-readable addon name */\n name: string;\n /** Semantic version (e.g., \"1.0.0\") */\n version: string;\n /** Brief description of the addon's functionality */\n description?: string;\n /** Author name or organization */\n author?: string;\n /** Compatible SDK version */\n sdkVersion?: string;\n /** Main entry point file (relative to addon root) */\n main?: string;\n /** Whether the addon is enabled by default */\n enabled?: boolean;\n /** Permission declarations for security review */\n permissions?: Permission[];\n /** Addon homepage or documentation URL */\n homepage?: string;\n /** Support or issues URL */\n repository?: string;\n /** License identifier (e.g., \"MIT\", \"Apache-2.0\") */\n license?: string;\n /** Minimum Wealthfolio version required */\n minWealthfolioVersion?: string;\n /** Keywords for discoverability */\n keywords?: string[];\n /** Addon icon (base64 or relative path) */\n icon?: string;\n\n // Runtime fields (only present after installation)\n /** Installation timestamp in ISO format */\n installedAt?: string;\n /** Last update timestamp */\n updatedAt?: string;\n /** Installation source */\n source?: 'local' | 'store' | 'sideload';\n /** File size in bytes */\n size?: number;\n}\n\n/**\n * Type guard to check if a manifest has been installed (has runtime fields)\n */\nexport function isInstalledManifest(\n manifest: AddonManifest,\n): manifest is Required<Pick<AddonManifest, 'main' | 'enabled' | 'installedAt'>> &\n AddonManifest {\n return !!(\n manifest.installedAt &&\n manifest.main !== undefined &&\n manifest.enabled !== undefined\n );\n}\n\n/**\n * Helper type for development manifests (without runtime fields)\n */\nexport type DevelopmentManifest = Omit<\n AddonManifest,\n 'installedAt' | 'updatedAt' | 'source' | 'size'\n>;\n\n/**\n * Helper type for installed manifests (with runtime fields)\n */\nexport type InstalledManifest = Required<\n Pick<AddonManifest, 'main' | 'enabled' | 'installedAt'>\n> &\n AddonManifest;\n\n/**\n * Addon file information\n */\nexport interface AddonFile {\n /** File name */\n name: string;\n /** File content */\n content: string;\n /** Whether this is the main entry point */\n is_main: boolean;\n /** File size in bytes */\n size?: number;\n}\n\n/**\n * Extracted addon package\n */\nexport interface ExtractedAddon {\n /** Addon metadata from manifest */\n metadata: AddonManifest;\n /** List of files in the addon package */\n files: AddonFile[];\n}\n\n/**\n * Installed addon information\n */\nexport interface InstalledAddon {\n /** Addon metadata */\n metadata: AddonManifest;\n /** Installation path */\n path?: string;\n /** Whether the addon is currently active */\n active?: boolean;\n}\n\n/**\n * Addon installation result\n */\nexport interface AddonInstallResult {\n /** Whether installation was successful */\n success: boolean;\n /** Error message if installation failed */\n error?: string;\n /** Installed addon metadata */\n addon?: AddonManifest;\n}\n\n/**\n * Addon validation result\n */\nexport interface AddonValidationResult {\n /** Whether the addon is valid */\n valid: boolean;\n /** List of validation errors */\n errors: string[];\n /** List of validation warnings */\n warnings: string[];\n}\n\n/**\n * Addon update information\n */\nexport interface AddonUpdateInfo {\n /** Current installed version */\n currentVersion: string;\n /** Latest available version */\n latestVersion: string;\n /** Whether an update is available */\n updateAvailable: boolean;\n /** Download URL for the update */\n downloadUrl?: string;\n /** Release notes for the latest version */\n releaseNotes?: string;\n /** Release date of the latest version */\n releaseDate?: string;\n /** Changelog URL */\n changelogUrl?: string;\n /** Whether this is a critical security update */\n isCritical?: boolean;\n /** Breaking changes in this update */\n hasBreakingChanges?: boolean;\n /** Minimum Wealthfolio version required for this update */\n minWealthfolioVersion?: string;\n}\n\n/**\n * Addon update check result\n */\nexport interface AddonUpdateCheckResult {\n /** Addon ID */\n addonId: string;\n /** Update information */\n updateInfo: AddonUpdateInfo;\n /** Any errors during update check */\n error?: string;\n}\n\n/**\n * Addon store listing\n */\nexport interface AddonStoreListing {\n /** Addon metadata */\n metadata: AddonManifest;\n /** Download URL */\n downloadUrl: string;\n /** Number of downloads */\n downloads?: number;\n /** Average rating */\n rating?: number;\n /** Number of reviews */\n reviewCount?: number;\n /** Whether it's verified by Wealthfolio team */\n verified?: boolean;\n /** Last update date */\n lastUpdated?: string;\n /** Screenshots or images */\n images?: string[];\n /** Release notes for the latest version */\n releaseNotes?: string;\n /** Changelog URL */\n changelogUrl?: string;\n}\n","{\n \"name\": \"@wealthfolio/addon-sdk\",\n \"version\": \"3.0.0\",\n \"type\": \"module\",\n \"description\": \"TypeScript SDK for building Wealthfolio addons with enhanced functionality and type safety\",\n \"main\": \"dist/index.js\",\n \"types\": \"dist/src/index.d.ts\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"types\": \"./dist/src/index.d.ts\"\n },\n \"./types\": {\n \"import\": \"./dist/types.js\",\n \"types\": \"./dist/src/types.d.ts\"\n },\n \"./permissions\": {\n \"import\": \"./dist/permissions.js\",\n \"types\": \"./dist/src/permissions.d.ts\"\n }\n },\n \"files\": [\n \"dist\",\n \"README.md\",\n \"CHANGELOG.md\"\n ],\n \"keywords\": [\n \"wealthfolio\",\n \"addon\",\n \"plugin\",\n \"sdk\",\n \"typescript\",\n \"financial\",\n \"portfolio\"\n ],\n \"author\": \"Wealthfolio Team\",\n \"license\": \"MIT\",\n \"homepage\": \"https://wealthfolio.app/addons\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/afadil/wealthfolio.git\",\n \"directory\": \"packages/addon-sdk\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/afadil/wealthfolio/issues\"\n },\n \"scripts\": {\n \"build\": \"tsup && pnpm run build:types\",\n \"dev\": \"tsup --watch\",\n \"clean\": \"rm -rf dist\",\n \"lint\": \"eslint .\",\n \"lint:fix\": \"eslint . --fix\",\n \"lint:quiet\": \"eslint . --quiet\",\n \"format\": \"prettier --write .\",\n \"format:check\": \"prettier --check .\",\n \"type-check\": \"tsc --noEmit\",\n \"build:types\": \"tsc -p tsconfig.json\",\n \"prepack\": \"npm run build\"\n },\n \"peerDependencies\": {\n \"react\": \"^19.2.4\",\n \"react-dom\": \"^19.2.4\"\n },\n \"devDependencies\": {\n \"@tanstack/react-query\": \"^5.90.20\",\n \"@types/react\": \"^19.2.13\",\n \"@types/react-dom\": \"^19.2.3\",\n \"tsup\": \"^8.5.1\",\n \"typescript\": \"^5.9.3\"\n },\n \"engines\": {\n \"node\": \">=20.0.0\"\n }\n}\n","import packageJson from '../package.json';\n\n/**\n * Current SDK version from package.json\n */\nexport const SDK_VERSION = packageJson.version;\n","/**\n * Utility functions for addon development\n */\n\nimport type { AddonManifest, AddonValidationResult } from './manifest';\nimport { SDK_VERSION } from './version';\n\n/**\n * Validates an addon manifest\n */\nexport function validateManifest(manifest: AddonManifest): AddonValidationResult {\n const errors: string[] = [];\n const warnings: string[] = [];\n\n // Required fields\n if (!manifest.id) {\n errors.push('Addon ID is required');\n } else if (!/^[a-z0-9-]+$/.test(manifest.id)) {\n errors.push('Addon ID must contain only lowercase letters, numbers, and hyphens');\n }\n\n if (!manifest.name) {\n errors.push('Addon name is required');\n }\n\n if (!manifest.version) {\n errors.push('Addon version is required');\n } else if (!/^\\d+\\.\\d+\\.\\d+/.test(manifest.version)) {\n warnings.push('Version should follow semantic versioning (e.g., 1.0.0)');\n }\n\n // Optional but recommended fields\n if (!manifest.description) {\n warnings.push('Description is recommended for better discoverability');\n }\n\n if (!manifest.author) {\n warnings.push('Author information is recommended');\n }\n\n if (!manifest.main) {\n warnings.push('Main entry point not specified, defaulting to \"addon.js\"');\n }\n\n // Validate permissions if present\n if (manifest.permissions) {\n manifest.permissions.forEach((permission, index) => {\n if (!permission.category) {\n errors.push(`Permission ${index}: category is required`);\n }\n if (!permission.functions || permission.functions.length === 0) {\n errors.push(`Permission ${index}: at least one function must be specified`);\n }\n if (!permission.purpose) {\n warnings.push(`Permission ${index}: purpose explanation is recommended`);\n }\n });\n }\n\n return {\n valid: errors.length === 0,\n errors,\n warnings,\n };\n}\n\n/**\n * Checks if an addon version is compatible with the current SDK\n */\nexport function isCompatibleVersion(\n addonSdkVersion?: string,\n currentSdkVersion = SDK_VERSION,\n): boolean {\n if (!addonSdkVersion) return true; // Assume compatible if not specified\n\n const [addonMajor, addonMinor] = addonSdkVersion.split('.').map(Number);\n const [currentMajor, currentMinor] = currentSdkVersion.split('.').map(Number);\n\n // Same major version, and addon minor version <= current minor version\n return addonMajor === currentMajor && addonMinor <= currentMinor;\n}\n\n/**\n * Formats addon size in human-readable format\n */\nexport function formatAddonSize(bytes: number): string {\n const sizes = ['B', 'KB', 'MB', 'GB'];\n if (bytes === 0) return '0 B';\n\n const i = Math.floor(Math.log(bytes) / Math.log(1024));\n const size = bytes / Math.pow(1024, i);\n\n return `${size.toFixed(i === 0 ? 0 : 1)} ${sizes[i]}`;\n}\n\n/**\n * Generates a unique addon ID from a name\n */\nexport function generateAddonId(name: string): string {\n return name\n .toLowerCase()\n .replace(/[^a-z0-9\\s-]/g, '') // Remove special characters\n .replace(/\\s+/g, '-') // Replace spaces with hyphens\n .replace(/-+/g, '-') // Replace multiple hyphens with single\n .replace(/^-|-$/g, ''); // Remove leading/trailing hyphens\n}\n\n/**\n * Type guard to check if an object is a valid addon manifest\n */\nexport function isAddonManifest(obj: unknown): obj is AddonManifest {\n return (\n typeof obj === 'object' &&\n obj !== null &&\n typeof (obj as Record<string, unknown>).id === 'string' &&\n typeof (obj as Record<string, unknown>).name === 'string' &&\n typeof (obj as Record<string, unknown>).version === 'string'\n );\n}\n","import type { Goal, GoalAllocation, AccountValuation, GoalProgress } from './data-types';\n\n/**\n * Calculate goal progress using allocations.\n * Converts account values to base currency, applies percent allocation per account,\n * and computes progress ratio (0–1+) against target amount.\n */\nexport function calculateGoalProgress(\n accountsValuations: AccountValuation[],\n goals: Goal[],\n allocations: GoalAllocation[],\n): GoalProgress[] {\n if (!accountsValuations || accountsValuations.length === 0 || !goals || !allocations) {\n return [];\n }\n\n const baseCurrency = accountsValuations[0].baseCurrency ?? 'USD';\n\n // accountId -> totalValue in base currency\n const accountValueMap = new Map<string, number>();\n accountsValuations.forEach((account) => {\n const valueInBaseCurrency = (account.totalValue ?? 0) * (account.fxRateToBase ?? 1);\n accountValueMap.set(account.accountId, valueInBaseCurrency);\n });\n\n // goalId -> allocations\n const allocationsByGoal = new Map<string, GoalAllocation[]>();\n allocations.forEach((alloc) => {\n const existing = allocationsByGoal.get(alloc.goalId) ?? [];\n allocationsByGoal.set(alloc.goalId, [...existing, alloc]);\n });\n\n const sortedGoals = [...goals].sort((a, b) => a.targetAmount - b.targetAmount);\n\n return sortedGoals.map((goal) => {\n const goalAllocations = allocationsByGoal.get(goal.id) ?? [];\n\n const totalAllocatedValue = goalAllocations.reduce((total, allocation) => {\n const accountValueInBase = accountValueMap.get(allocation.accountId) ?? 0;\n return total + (accountValueInBase * allocation.percentAllocation) / 100;\n }, 0);\n\n const progress = goal.targetAmount > 0 ? totalAllocatedValue / goal.targetAmount : 0;\n\n return {\n name: goal.title,\n targetValue: goal.targetAmount,\n currentValue: totalAllocatedValue,\n progress,\n currency: baseCurrency,\n };\n });\n}\n","/**\n * @wealthfolio/addon-sdk\n *\n * TypeScript SDK for building Wealthfolio addons with enhanced functionality,\n * type safety, and comprehensive permission management.\n *\n * @version 1.0.0\n * @author Wealthfolio Team\n * @license MIT\n */\n\n// Core types\nexport type {\n AddonContext,\n AddonEnableFunction,\n EventCallback,\n RouteConfig,\n RouterManager,\n SidebarItemConfig,\n SidebarItemHandle,\n SidebarManager,\n UnlistenFn,\n} from './types';\n\n// Host API interface\nexport type { HostAPI, ActivitySearchFilters, ActivitySort } from './host-api';\n\n// Query Client and Keys exports\nexport type { QueryClient } from '@tanstack/react-query';\nexport { QueryKeys } from './query-keys';\n\n// Comprehensive data types\nexport type * from './data-types';\n\n// Manifest and metadata types\nexport type {\n AddonFile,\n AddonInstallResult,\n AddonManifest,\n AddonStoreListing,\n AddonUpdateCheckResult,\n AddonUpdateInfo,\n AddonValidationResult,\n DevelopmentManifest,\n ExtractedAddon,\n InstalledAddon,\n InstalledManifest,\n} from './manifest';\n\nexport { isInstalledManifest } from './manifest';\n\n// Permission system\nexport type {\n FunctionPermission,\n Permission,\n PermissionCategory,\n RiskLevel,\n} from './permissions';\n\nexport {\n getFunctionRiskLevel,\n getPermissionCategoriesByRisk,\n getPermissionCategory,\n isPermissionRequired,\n PERMISSION_CATEGORIES,\n} from './permissions';\n\n// Utilities\nexport {\n formatAddonSize,\n generateAddonId,\n isAddonManifest,\n isCompatibleVersion,\n validateManifest,\n} from './utils';\n\n// Goal progress calculation\nexport { calculateGoalProgress } from './goal-progress';\n\n// -----------------------------------------------------------------------------\n// Framework version contract\n// -----------------------------------------------------------------------------\n\n/**\n * React version guaranteed by the host application. Addons may assert against\n * this at runtime if they rely on a particular React feature set.\n */\nexport const ReactVersion = '19.1.1';\n\n/**\n * Addons receive their context as a parameter to the enable() function.\n * Each addon gets its own isolated context with scoped secret storage.\n *\n * Example:\n * export default function enable(ctx: AddonContext) {\n * // Use ctx.api.secrets.set/get/delete for secure storage\n * // Use ctx.sidebar.addItem() to add navigation\n * // Use ctx.router.add() to register routes\n * }\n */\n\ninterface HostGlobals {\n React: typeof import('react');\n ReactDOM: typeof import('react-dom');\n}\nconst hostGlobals = window as unknown as Partial<HostGlobals>;\nexport const React = hostGlobals.React!;\nexport const ReactDOM = hostGlobals.ReactDOM!;\n\n// Version\nexport { SDK_VERSION } from './version';\n"],"mappings":";;;;;;;;;AAIO,IAAM,YAAY;AAAA;AAAA,EAEvB,UAAU;AAAA,EACV,kBAAkB;AAAA;AAAA,EAGlB,eAAe;AAAA,EACf,YAAY;AAAA;AAAA,EAGZ,UAAU;AAAA,EACV,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,eAAe;AAAA;AAAA,EAGf,OAAO;AAAA,EACP,mBAAmB;AAAA;AAAA,EAGnB,UAAU;AAAA,EACV,gBAAgB;AAAA;AAAA,EAGhB,uBAAuB;AAAA,EACvB,OAAO;AAAA,EAEP,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAE7B,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAEhB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EAErB,mBAAmB;AAAA;AAAA,EAEnB,kBAAkB,CAAC,OAAe,CAAC,UAAU,mBAAmB,EAAE;AAAA;AAAA,EAGlE,6BAA6B;AAAA,EAC7B,2BAA2B,CAAC,eAAyB;AAAA,IACnD,UAAU;AAAA,IACV,CAAC,GAAG,UAAU,E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unk-3OBZP7TN.mjs";
14
+ } from "./chunk-6MGUTH7T.js";
15
15
  export {
16
16
  PERMISSION_CATEGORIES,
17
17
  addDetectedFunction,
@@ -26,4 +26,4 @@ export {
26
26
  isPermissionRequired,
27
27
  markFunctionAsDeclared
28
28
  };
29
- //# sourceMappingURL=permissions.mjs.map
29
+ //# sourceMappingURL=permissions.js.map