@wealthfolio/addon-sdk 3.6.0 → 3.6.2

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 CHANGED
@@ -4,6 +4,221 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4
4
  and this project adheres to
5
5
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [3.6.1] - 2026-07-06
8
+
9
+ Follow-up to the v3.6 sandbox release: sidebar icons are now a typed, curated
10
+ set. See the
11
+ [v3.5 → v3.6 migration guide](../../docs/addons/addon-migration-guide-v3.5-to-v3.6.md).
12
+
13
+ ### Breaking
14
+
15
+ - **`SidebarItemConfig.icon`** is now a typed `AddonIconName` (was `string`).
16
+ Names outside the curated set fail type-checking; unknown or omitted names
17
+ render a neutral `caret-right` fallback at runtime.
18
+
19
+ ### Added
20
+
21
+ - `AddonIconName` type and `ADDON_ICON_NAMES` — the curated set of duotone
22
+ Phosphor sidebar icon names, exported from the package entry point.
23
+
24
+ ## [3.6.0] - 2026-07-04
25
+
26
+ Addons now run in an isolated sandbox iframe. This is a **breaking** release for
27
+ addons that register routes. See the
28
+ [v3.5 → v3.6 migration guide](../../docs/addons/addon-migration-guide-v3.5-to-v3.6.md).
29
+
30
+ ### Breaking
31
+
32
+ - **Route registration**: `RouteConfig.component` (a lazy React component) is
33
+ replaced by `RouteConfig.render(ctx)`, which mounts into a host-provided
34
+ `ctx.root: HTMLElement`. New types: `AddonRouteRenderer`,
35
+ `AddonRouteRenderContext`, `AddonRouteLocation`.
36
+ - **React exports removed**: the SDK no longer re-exports `React` / `ReactDOM`
37
+ from host globals. Import from `react` / `react-dom/client`; mark them
38
+ `external` in your build.
39
+ - **`SidebarItemConfig`**: `icon` is now a host-supported icon name (`string`)
40
+ instead of a `React.ReactNode`, and the `onClick` handler was removed — use
41
+ `route`.
42
+ - **React** guaranteed version bumped 19.1.1 → 19.2.4.
43
+
44
+ ### Added
45
+
46
+ - `HOST_DEPENDENCIES` export — the versioned packages the sandbox provides
47
+ (react, react-dom, @tanstack/react-query, @wealthfolio/ui, date-fns,
48
+ lucide-react, recharts).
49
+ - Brokered networking: `ctx.api.network.request()` with manifest-declared
50
+ `network.allowedHosts` and bearer auth resolved from scoped secret storage
51
+ (`NetworkAPI`, `NetworkRequest`, `NetworkResponse`, `NetworkAuth`).
52
+ - Manifest fields: `minWealthfolioVersion`, `hostDependencies`, `network`,
53
+ `sha256`. `AddonHostDependencies` type.
54
+ - Addon SDK tax fields on activity/data types (#1188).
55
+
56
+ ## [3.5.1] - 2026-06-09
57
+
58
+ Also includes the unpublished 3.4.0 and 3.5.0.
59
+
60
+ ### Added
61
+
62
+ - `PerformanceResult` — a comprehensive performance model replacing
63
+ `PerformanceMetrics`, with supporting types `PerformanceScopeDescriptor`,
64
+ `PerformancePeriod`, `ReturnMethod`, `PerformanceReturns`,
65
+ `PerformanceAttribution`, `PerformanceRisk`, `PerformanceDataQuality`.
66
+ - Goal enrichment: `GoalType`, `GoalLifecycle`, `GoalHealth` types; `Goal` gains
67
+ `goalType`, `statusHealth`, `priority`, `coverImageKey`, `currency`, dates,
68
+ valuation summaries, and timestamps. `GoalProgress` gains `goalId`,
69
+ `statusHealth`, `targetDate`.
70
+ - Asset resolution: `AssetResolutionInput` (`quoteCcy`, `instrumentType`,
71
+ `providerId`, `providerSymbol`); an `asset` field on `ActivityCreate` /
72
+ `ActivityUpdate`; `assetId` on `ActivityImport`.
73
+ - Provider-aware market data: `providerId` / `providerSymbol` plus canonical
74
+ `canonicalSymbol` / `canonicalExchangeMic` on `SymbolSearchResult`;
75
+ `DividendEvent` type and `FetchDividendsOptions`.
76
+ - `AccountType` gains `CREDIT_CARD`; `Settings.defaultReturnMetric`
77
+ (`'twr' | 'irr' | 'valueReturn'`).
78
+ - Base-currency fields on `AccountValuation` (`totalValueBase`, `costBasisBase`,
79
+ `netContributionBase`, …) and provider/quote fields on `SnapshotHoldingInput`
80
+ / `SnapshotPositionInput`.
81
+
82
+ ### Changed
83
+
84
+ - Performance API now returns the new `Result` types: `calculateHistory()` (with
85
+ `startDate` / `endDate` now optional) and `calculateSummary()` return
86
+ `PerformanceResult`; `calculateAccountsSimple()`, `AccountSummaryView`, and
87
+ `AccountGroup` use `SimplePerformanceResult`.
88
+ - `fetchDividends()` accepts an optional `FetchDividendsOptions` and returns
89
+ `DividendEvent[]` (was `YahooDividend[]`).
90
+ - `backupDatabase()` returns `{ filename: string }` (dropped the
91
+ `data: Uint8Array` payload).
92
+
93
+ ### Deprecated
94
+
95
+ - `PerformanceMetrics` / `SimplePerformanceMetrics` (aliases for their `Result`
96
+ counterparts), `SymbolInput` (use `AssetResolutionInput`), and the `symbol`
97
+ field on `ActivityCreate` / `ActivityUpdate` (use `asset`).
98
+
99
+ ### Removed
100
+
101
+ - `YahooDividend` (replaced by `DividendEvent`); `dayGainLossAmount` and
102
+ `dayReturnPercentModDietz` from `SimplePerformanceResult`.
103
+
104
+ ## [3.3.0] - 2026-05-01
105
+
106
+ ### Added
107
+
108
+ - `GoalsAPI.getFunding(goalId)` and `saveFunding(goalId, rules)`, with matching
109
+ `getFunding` / `saveFunding` functions under the renamed `financial-planning`
110
+ permission.
111
+ - `GoalAllocation.taxBucket`.
112
+
113
+ ### Changed
114
+
115
+ - `Goal.isAchieved` replaced by `Goal.statusLifecycle`
116
+ (`'active' | 'achieved' | 'archived'`).
117
+ - `GoalAllocation.percentAllocation` renamed to `sharePercent`.
118
+ - `goals` permission category renamed to `financial-planning`.
119
+
120
+ ### Deprecated
121
+
122
+ - `GoalsAPI.updateAllocations()` (use `saveFunding`) and `getAllocations()` (use
123
+ `getAll()` + `getFunding(goalId)`).
124
+
125
+ ## [3.2.0] - 2026-04-02
126
+
127
+ ### Changed
128
+
129
+ - `ActivitiesAPI.checkImport()` dropped its `accountId` parameter — now
130
+ `checkImport(activities)`, a read-only preview.
131
+ - `ActivitiesAPI.getImportMapping()` accepts an optional `contextKind` (default
132
+ `'ACTIVITY'`).
133
+ - `ImportMappingData.fieldMappings` widened to
134
+ `Record<string, string | string[]>`.
135
+ - `PerformanceMetrics.periodReturn` is now nullable (`number | null`).
136
+
137
+ ## [3.1.1] - 2026-03-14
138
+
139
+ A large release that overhauls the asset and activity data models (also includes
140
+ the unpublished 3.0.1–3.1.0). **Breaking** for addons that read or write assets,
141
+ activities, or quotes.
142
+
143
+ ### Breaking
144
+
145
+ - **Asset model** is now keyed by an opaque UUID instead of a symbol. `Asset` is
146
+ redesigned with `kind` (`AssetKind`), `displayCode`, `quoteMode`, `quoteCcy`,
147
+ `instrumentType`, `instrumentSymbol`, `instrumentKey`, `providerConfig`, …;
148
+ removed `symbol`, `isin`, `assetClass`, `countries`, `sectors`, `dataSource`,
149
+ and more.
150
+ - **Activity model** redesigned: `type` → `activityType`, `date` →
151
+ `activityDate`, `assetId` now optional, monetary/quantity fields are decimal
152
+ strings; new lifecycle fields (`subtype`, `status`, `settlementDate`,
153
+ `idempotencyKey`, `importRunId`, `metadata`, …). `ActivityType` is now a
154
+ closed set of 14 (removed `ADD_HOLDING` / `REMOVE_HOLDING`; added `SPLIT`,
155
+ `CREDIT`, `ADJUSTMENT`, `UNKNOWN`).
156
+ - **Quotes / assets APIs** now take `assetId` instead of `symbol`:
157
+ `QuotesAPI.update()` / `getHistory()`, `Quote` / `QuoteUpdate`,
158
+ `MarketDataAPI.sync(assetIds)`. `AssetsAPI.updateDataSource()` →
159
+ `updateQuoteMode(assetId, quoteMode)`. `searchTicker()` returns
160
+ `SymbolSearchResult` (renamed from `QuoteSummary`).
161
+ - `ActivitiesAPI.import()` returns `ImportActivitiesResult` (was
162
+ `ActivityImport[]`); `SettingsAPI.update()` takes `Partial<Settings>`;
163
+ `IncomeSummary.bySymbol` → `byAsset`.
164
+
165
+ ### Added
166
+
167
+ - New APIs: `SnapshotsAPI` (holdings snapshots) and `ToastAPI` (`success` /
168
+ `error` / `warning` / `info`), each with a matching permission category;
169
+ `MarketDataAPI.fetchDividends(symbol)`.
170
+ - Activity taxonomy: `ActivityStatus`, `ACTIVITY_SUBTYPES` / `ActivitySubtype`,
171
+ `AssetKind`, `QuoteMode` constants; helpers `getEffectiveType()` and
172
+ `hasUserOverride()`.
173
+ - `calculateGoalProgress()` helper (new `goal-progress` module).
174
+ - Import/sync types (`ImportRun*`, `BrokerSyncState`, `SyncStatus`), snapshot
175
+ types (`Snapshot*`), classification types (`AssetClassifications`,
176
+ `TaxonomyCategory`, `CategoryWithWeight`), and `QueryKeys.SNAPSHOTS`.
177
+ - React peer dependency bumped to `^19.2.4`.
178
+
179
+ ### Removed
180
+
181
+ - `AssetProfile`, `MarketData`, `Sector`, `Country`, `SettingsContextType`;
182
+ `ActivityType` values `ADD_HOLDING` / `REMOVE_HOLDING`.
183
+
184
+ ## [3.0.0] - 2026-02-24
185
+
186
+ ### Breaking
187
+
188
+ - React peer dependency updated to 19 (`ReactVersion` `18.3.1` → `19.1.1`).
189
+ - `ActivitiesAPI.search()` now takes typed `ActivitySearchFilters` and
190
+ `ActivitySort` (was `unknown`).
191
+ - `ActivitiesAPI.saveMany()` takes `ActivityBulkMutationRequest` and returns
192
+ `ActivityBulkMutationResult` (was `ActivityUpdate[]` → `Activity[]`).
193
+
194
+ ### Added
195
+
196
+ - Bulk-mutation types: `ActivityBulkMutationRequest`,
197
+ `ActivityBulkMutationResult`, `ActivityBulkMutationError`,
198
+ `ActivityBulkIdentifierMapping`; exported `ActivitySearchFilters` and
199
+ `ActivitySort`.
200
+ - `Activity.assetDataSource`, `ActivityCreate.id` / `assetDataSource`,
201
+ `UpdateAssetProfile.symbolMapping`.
202
+
203
+ ### Changed
204
+
205
+ - Build now emits `.js` / `.d.ts` (was `.mjs` / `.d.mts`); the types entry moved
206
+ to `dist/src/index.d.ts`.
207
+
208
+ ## [2.0.0] - 2025-11-22
209
+
210
+ ### Breaking
211
+
212
+ - Package now ships as an ES module (`"type": "module"`).
213
+
214
+ ### Changed
215
+
216
+ - Tightened types: loose `any` parameters/returns replaced with `unknown` across
217
+ `AccountsAPI.create()`, `ActivitiesAPI.search()`, `GoalsAPI.create()`,
218
+ `FilesAPI.openSaveDialog()`, `QueryAPI.getClient()`, `isAddonManifest()`, and
219
+ `RouteConfig.component`.
220
+ - `DateRange` and `TrackedItem` changed from type aliases to interfaces.
221
+
7
222
  ## [1.0.0] - 2024-12-19
8
223
 
9
224
  ### Added
package/README.md CHANGED
@@ -70,9 +70,13 @@ mkdir src && touch src/index.ts
70
70
 
71
71
  ```typescript
72
72
  // src/index.ts
73
+ import { createRoot, type Root } from 'react-dom/client';
73
74
  import { getAddonContext, type AddonContext } from '@wealthfolio/addon-sdk';
75
+ import { MyComponent } from './MyComponent';
74
76
 
75
77
  export default function enable(context: AddonContext) {
78
+ let root: Root | null = null;
79
+
76
80
  // Add navigation item
77
81
  const navItem = context.sidebar.addItem({
78
82
  id: 'my-addon',
@@ -84,7 +88,10 @@ export default function enable(context: AddonContext) {
84
88
  // Register route
85
89
  context.router.add({
86
90
  path: '/addons/my-addon',
87
- component: () => import('./MyComponent'),
91
+ render: ({ root: routeRoot }) => {
92
+ root ??= createRoot(routeRoot);
93
+ root.render(<MyComponent ctx={context} />);
94
+ },
88
95
  });
89
96
 
90
97
  // Log activation
@@ -92,6 +99,8 @@ export default function enable(context: AddonContext) {
92
99
 
93
100
  // Cleanup on disable
94
101
  context.onDisable(() => {
102
+ root?.unmount();
103
+ root = null;
95
104
  navItem.remove();
96
105
  context.api.logger.info('My addon deactivated');
97
106
  });
@@ -235,10 +244,9 @@ example:
235
244
 
236
245
  ```typescript
237
246
  // src/addon.tsx
238
- import React from 'react';
247
+ import { createRoot, type Root } from 'react-dom/client';
239
248
  import { QueryClientProvider } from '@tanstack/react-query';
240
249
  import type { AddonContext, AddonEnableFunction } from '@wealthfolio/addon-sdk';
241
- import { Icons } from '@wealthfolio/ui';
242
250
  import FeesPage from './pages/fees-page';
243
251
 
244
252
  // Main addon component
@@ -256,6 +264,7 @@ const enable: AddonEnableFunction = (context) => {
256
264
 
257
265
  // Store references to items for cleanup
258
266
  const addedItems: Array<{ remove: () => void }> = [];
267
+ let root: Root | null = null;
259
268
 
260
269
  try {
261
270
  // Add sidebar navigation item with a host-supported icon token
@@ -280,12 +289,13 @@ const enable: AddonEnableFunction = (context) => {
280
289
  );
281
290
  };
282
291
 
283
- // Register route with lazy loading
292
+ // Register route
284
293
  context.router.add({
285
294
  path: '/addons/investment-fees-tracker',
286
- component: React.lazy(() => Promise.resolve({
287
- default: InvestmentFeesTrackerWrapper
288
- }))
295
+ render: ({ root: routeRoot }) => {
296
+ root ??= createRoot(routeRoot);
297
+ root.render(<InvestmentFeesTrackerWrapper />);
298
+ },
289
299
  });
290
300
 
291
301
  context.api.logger.debug('Route registered successfully');
@@ -300,6 +310,10 @@ const enable: AddonEnableFunction = (context) => {
300
310
  context.onDisable(() => {
301
311
  context.api.logger.info('🛑 Investment Fees Tracker addon is being disabled');
302
312
 
313
+ // Unmount the addon's React root
314
+ root?.unmount();
315
+ root = null;
316
+
303
317
  // Remove all sidebar items
304
318
  addedItems.forEach(item => {
305
319
  try {
@@ -325,7 +339,8 @@ export default enable;
325
339
  3. **Error Handling**: Comprehensive error handling with logging
326
340
  4. **Resource Management**: Proper cleanup of sidebar items and event listeners
327
341
  5. **TypeScript**: Full type safety with proper imports
328
- 6. **Lazy Loading**: Efficient component loading with React.lazy
342
+ 6. **Sandbox Rendering**: Mounts into the route root with `createRoot` and
343
+ unmounts on disable
329
344
 
330
345
  ````
331
346
 
@@ -608,13 +623,18 @@ export default defineConfig({
608
623
  formats: ['es'],
609
624
  },
610
625
  rollupOptions: {
611
- external: ['react', 'react-dom'],
612
- output: {
613
- globals: {
614
- react: 'React',
615
- 'react-dom': 'ReactDOM',
616
- },
617
- },
626
+ external: [
627
+ '@tanstack/react-query',
628
+ '@wealthfolio/addon-sdk',
629
+ '@wealthfolio/ui',
630
+ 'date-fns',
631
+ 'lucide-react',
632
+ 'react',
633
+ 'react-dom',
634
+ 'react-dom/client',
635
+ 'react/jsx-runtime',
636
+ 'recharts',
637
+ ],
618
638
  },
619
639
  outDir: 'dist',
620
640
  minify: 'terser',
@@ -741,7 +761,8 @@ Register a new route in the application.
741
761
  **Parameters:**
742
762
 
743
763
  - `route.path` (string): Route path pattern
744
- - `route.component` (LazyExoticComponent): Lazy-loaded component
764
+ - `route.render` (function): `({ root, location }) => void` — mount your React
765
+ root into the provided `root` element
745
766
 
746
767
  #### `onDisable(callback)`
747
768
 
@@ -994,13 +1015,18 @@ export default defineConfig({
994
1015
  formats: ['es'],
995
1016
  },
996
1017
  rollupOptions: {
997
- external: ['react', 'react-dom'],
998
- output: {
999
- globals: {
1000
- react: 'React',
1001
- 'react-dom': 'ReactDOM',
1002
- },
1003
- },
1018
+ external: [
1019
+ '@tanstack/react-query',
1020
+ '@wealthfolio/addon-sdk',
1021
+ '@wealthfolio/ui',
1022
+ 'date-fns',
1023
+ 'lucide-react',
1024
+ 'react',
1025
+ 'react-dom',
1026
+ 'react-dom/client',
1027
+ 'react/jsx-runtime',
1028
+ 'recharts',
1029
+ ],
1004
1030
  },
1005
1031
  outDir: 'dist',
1006
1032
  minify: 'terser',
@@ -5,7 +5,7 @@ import {
5
5
  // package.json
6
6
  var package_default = {
7
7
  name: "@wealthfolio/addon-sdk",
8
- version: "3.6.0",
8
+ version: "3.6.2",
9
9
  type: "module",
10
10
  description: "TypeScript SDK for building Wealthfolio addons with enhanced functionality and type safety",
11
11
  main: "dist/index.js",
@@ -190,4 +190,4 @@ export {
190
190
  generateAddonId,
191
191
  isAddonManifest
192
192
  };
193
- //# sourceMappingURL=chunk-5XUF4TB3.js.map
193
+ //# sourceMappingURL=chunk-BFZMXPHG.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../package.json","../src/version.ts","../src/utils.ts"],"sourcesContent":["{\n \"name\": \"@wealthfolio/addon-sdk\",\n \"version\": \"3.6.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 \"./host-api\": {\n \"import\": \"./dist/host-api.js\",\n \"types\": \"./dist/src/host-api.d.ts\"\n },\n \"./host-dependencies\": {\n \"import\": \"./dist/host-dependencies.js\",\n \"types\": \"./dist/src/host-dependencies.d.ts\"\n },\n \"./manifest\": {\n \"import\": \"./dist/manifest.js\",\n \"types\": \"./dist/src/manifest.d.ts\"\n },\n \"./permissions\": {\n \"import\": \"./dist/permissions.js\",\n \"types\": \"./dist/src/permissions.d.ts\"\n },\n \"./query-keys\": {\n \"import\": \"./dist/query-keys.js\",\n \"types\": \"./dist/src/query-keys.d.ts\"\n },\n \"./utils\": {\n \"import\": \"./dist/utils.js\",\n \"types\": \"./dist/src/utils.d.ts\"\n },\n \"./goal-progress\": {\n \"import\": \"./dist/goal-progress.js\",\n \"types\": \"./dist/src/goal-progress.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/wealthfolio/wealthfolio.git\",\n \"directory\": \"packages/addon-sdk\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/wealthfolio/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 { HOST_DEPENDENCIES } from './host-dependencies';\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 if (manifest.hostDependencies) {\n Object.entries(manifest.hostDependencies).forEach(([name, version]) => {\n if (!version) {\n errors.push(`Host dependency ${name}: version range is required`);\n }\n if (!Object.prototype.hasOwnProperty.call(HOST_DEPENDENCIES, name)) {\n warnings.push(\n `Host dependency ${name} is not provided by Wealthfolio and should be bundled`,\n );\n }\n });\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"],"mappings":";;;;;AAAA;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,MAAQ;AAAA,EACR,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,OAAS;AAAA,EACT,SAAW;AAAA,IACT,KAAK;AAAA,MACH,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACT,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,uBAAuB;AAAA,MACrB,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,iBAAiB;AAAA,MACf,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,gBAAgB;AAAA,MACd,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACT,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,mBAAmB;AAAA,MACjB,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,QAAU;AAAA,EACV,SAAW;AAAA,EACX,UAAY;AAAA,EACZ,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,IACP,WAAa;AAAA,EACf;AAAA,EACA,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AAAA,EACA,SAAW;AAAA,IACT,OAAS;AAAA,IACT,KAAO;AAAA,IACP,OAAS;AAAA,IACT,MAAQ;AAAA,IACR,YAAY;AAAA,IACZ,cAAc;AAA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EAAE,EAC3B,QAAQ,QAAQ,GAAG,EACnB,QAAQ,OAAO,GAAG,EAClB,QAAQ,UAAU,EAAE;AACzB;AAKO,SAAS,gBAAgB,KAAoC;AAClE,SACE,OAAO,QAAQ,YACf,QAAQ,QACR,OAAQ,IAAgC,OAAO,YAC/C,OAAQ,IAAgC,SAAS,YACjD,OAAQ,IAAgC,YAAY;AAExD;","names":[]}
1
+ {"version":3,"sources":["../package.json","../src/version.ts","../src/utils.ts"],"sourcesContent":["{\n \"name\": \"@wealthfolio/addon-sdk\",\n \"version\": \"3.6.2\",\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 \"./host-api\": {\n \"import\": \"./dist/host-api.js\",\n \"types\": \"./dist/src/host-api.d.ts\"\n },\n \"./host-dependencies\": {\n \"import\": \"./dist/host-dependencies.js\",\n \"types\": \"./dist/src/host-dependencies.d.ts\"\n },\n \"./manifest\": {\n \"import\": \"./dist/manifest.js\",\n \"types\": \"./dist/src/manifest.d.ts\"\n },\n \"./permissions\": {\n \"import\": \"./dist/permissions.js\",\n \"types\": \"./dist/src/permissions.d.ts\"\n },\n \"./query-keys\": {\n \"import\": \"./dist/query-keys.js\",\n \"types\": \"./dist/src/query-keys.d.ts\"\n },\n \"./utils\": {\n \"import\": \"./dist/utils.js\",\n \"types\": \"./dist/src/utils.d.ts\"\n },\n \"./goal-progress\": {\n \"import\": \"./dist/goal-progress.js\",\n \"types\": \"./dist/src/goal-progress.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/wealthfolio/wealthfolio.git\",\n \"directory\": \"packages/addon-sdk\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/wealthfolio/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 { HOST_DEPENDENCIES } from './host-dependencies';\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 if (manifest.hostDependencies) {\n Object.entries(manifest.hostDependencies).forEach(([name, version]) => {\n if (!version) {\n errors.push(`Host dependency ${name}: version range is required`);\n }\n if (!Object.prototype.hasOwnProperty.call(HOST_DEPENDENCIES, name)) {\n warnings.push(\n `Host dependency ${name} is not provided by Wealthfolio and should be bundled`,\n );\n }\n });\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"],"mappings":";;;;;AAAA;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,MAAQ;AAAA,EACR,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,OAAS;AAAA,EACT,SAAW;AAAA,IACT,KAAK;AAAA,MACH,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACT,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,uBAAuB;AAAA,MACrB,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,iBAAiB;AAAA,MACf,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,gBAAgB;AAAA,MACd,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACT,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,IACA,mBAAmB;AAAA,MACjB,QAAU;AAAA,MACV,OAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,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AAc;AACtD;AAKO,SAAS,gBAAgB,OAAuB;AACrD,QAAM,QAAQ,CAAC,KAAK,MAAM,MAAM,IAAI;AACpC,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,IAAI,KAAK,MAAM,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,IAAI,CAAC;AACrD,QAAM,OAAO,QAAQ,KAAK,IAAI,MAAM,CAAC;AAErC,SAAO,GAAG,KAAK,QAAQ,MAAM,IAAI,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AACrD;AAKO,SAAS,gBAAgB,MAAsB;AACpD,SAAO,KACJ,YAAY,EACZ,QAAQ,iBAAiB,EAAE,EAC3B,QAAQ,QAAQ,GAAG,EACnB,QAAQ,OAAO,GAAG,EAClB,QAAQ,UAAU,EAAE;AACzB;AAKO,SAAS,gBAAgB,KAAoC;AAClE,SACE,OAAO,QAAQ,YACf,QAAQ,QACR,OAAQ,IAAgC,OAAO,YAC/C,OAAQ,IAAgC,SAAS,YACjD,OAAQ,IAAgC,YAAY;AAExD;","names":[]}
@@ -6,4 +6,4 @@ function isInstalledManifest(manifest) {
6
6
  export {
7
7
  isInstalledManifest
8
8
  };
9
- //# sourceMappingURL=chunk-O566EAIL.js.map
9
+ //# sourceMappingURL=chunk-K7KLLX42.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/manifest.ts"],"sourcesContent":["/**\n * Addon manifest and metadata types\n */\n\nimport type { AddonIconName } from './icons';\nimport type { Permission } from './permissions';\n\nexport interface AddonNetworkAccess {\n allowedHosts: string[];\n approvedHosts?: string[];\n}\n\nexport type AddonHostDependencies = Record<string, string>;\n\n/**\n * A durable addon page declared via `contributes.routes`. The host ingests\n * these at boot without executing addon code, so the route exists before (and\n * independently of) the addon's runtime activation — it is the lazy-activation\n * surface.\n */\nexport interface AddonContributedRoute {\n /** Stable route id. MUST equal the route id the addon registers at runtime. */\n id: string;\n /**\n * Optional path relative to the host-owned `/addons/<addon-id>` mount.\n * Omit for the addon root; use a suffix such as `reports/:year` for a\n * nested page. Absolute paths, traversal, query strings, and fragments are\n * rejected by the host.\n */\n path?: string;\n}\n\n/**\n * A placement in a host slot (e.g. `\"sidebar\"`) declared via\n * `contributes.links`, pointing at a route declared in `contributes.routes`\n * of the same addon.\n */\nexport interface AddonContributedLink {\n /** Optional stable link id; defaults to the referenced route id */\n id?: string;\n /** Id of a route declared in this addon's `contributes.routes` */\n route: string;\n /** Human-readable label shown in the host slot */\n label: string;\n /** Optional host-supported icon name (see {@link AddonIconName}) */\n icon?: AddonIconName;\n /** Optional sort order within the slot */\n order?: number;\n}\n\n/**\n * Declarative contributions an addon makes to the host: durable routes plus\n * links placed in host slots, keyed by slot id. Only the `\"sidebar\"` slot is\n * consumed today; unknown slot keys are preserved for future host surfaces.\n */\nexport interface AddonContributes {\n /** Durable addon pages, host-renderable before the addon boots */\n routes?: AddonContributedRoute[];\n /** Slot placements pointing at declared routes, keyed by slot id */\n links?: Record<string, AddonContributedLink[]>;\n}\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 /** Network hosts this addon may reach through the host broker */\n network?: AddonNetworkAccess;\n /** Host-provided packages this addon imports instead of bundling */\n hostDependencies?: AddonHostDependencies;\n /** Declarative contributions to the host (routes + slot links) */\n contributes?: AddonContributes;\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 /** Optional SHA-256 digest for the update package bytes */\n sha256?: 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 /** Optional SHA-256 digest for the package bytes */\n sha256?: 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"],"mappings":";AAuHO,SAAS,oBACd,UAEc;AACd,SAAO,CAAC,EACN,SAAS,eACT,SAAS,SAAS,UAClB,SAAS,YAAY;AAEzB;","names":[]}
@@ -147,28 +147,24 @@ var PERMISSION_CATEGORIES = [
147
147
  ],
148
148
  riskLevel: "low"
149
149
  },
150
- {
151
- id: "query",
152
- name: "Query Cache",
153
- description: "Access to refresh host application data",
154
- functions: ["invalidateQueries", "refetchQueries"],
155
- riskLevel: "low"
156
- },
157
150
  {
158
151
  id: "network",
159
152
  name: "Network Access",
160
153
  description: "Access to declared external HTTPS hosts through the host network broker",
161
154
  functions: ["request"],
162
155
  riskLevel: "high"
163
- },
164
- {
165
- id: "ui",
166
- name: "User Interface",
167
- description: "Access to modify navigation and add UI components",
168
- functions: ["sidebar.addItem", "router.add", "navigation.navigate", "onDisable"],
169
- riskLevel: "low"
170
156
  }
171
157
  ];
158
+ var BASELINE_PERMISSION_CATEGORIES = [
159
+ "ui",
160
+ "query",
161
+ "toast",
162
+ "logger",
163
+ "storage"
164
+ ];
165
+ function isBaselineCategory(id) {
166
+ return BASELINE_PERMISSION_CATEGORIES.includes(id);
167
+ }
172
168
  function createFunctionPermission(name, isDeclared = false, isDetected = false, detectedAt) {
173
169
  return {
174
170
  name,
@@ -229,6 +225,8 @@ function markFunctionAsDeclared(permission, functionName) {
229
225
 
230
226
  export {
231
227
  PERMISSION_CATEGORIES,
228
+ BASELINE_PERMISSION_CATEGORIES,
229
+ isBaselineCategory,
232
230
  createFunctionPermission,
233
231
  getPermissionCategory,
234
232
  getPermissionCategoriesByRisk,
@@ -241,4 +239,4 @@ export {
241
239
  addDetectedFunction,
242
240
  markFunctionAsDeclared
243
241
  };
244
- //# sourceMappingURL=chunk-SEHD46ND.js.map
242
+ //# sourceMappingURL=chunk-KCG6RCFW.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', 'fetchDividends'],\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: 'financial-planning',\n name: 'Financial Planning',\n description: 'Access to financial goals and allocations',\n functions: [\n 'getAll',\n 'create',\n 'update',\n 'getFunding',\n 'saveFunding',\n 'updateAllocations',\n 'getAllocations',\n ],\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', 'use', 'delete'],\n riskLevel: 'high',\n },\n {\n id: 'snapshots',\n name: 'Snapshot Management',\n description: 'Access to holdings snapshots for accounts with holdings tracking mode',\n functions: [\n 'getAll',\n 'getByDate',\n 'save',\n 'checkImport',\n 'importSnapshots',\n 'delete',\n ],\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: 'network',\n name: 'Network Access',\n description:\n 'Access to declared external HTTPS hosts through the host network broker',\n functions: ['request'],\n riskLevel: 'high',\n },\n];\n\n/**\n * Baseline capabilities that every addon may use without declaring a permission\n * or obtaining user consent. These are treated as an ignore-filter: legacy manifests\n * that still declare them keep parsing, but they are never surfaced in consent UI,\n * never guarded at runtime, and never count as a permission escalation on update.\n */\nexport const BASELINE_PERMISSION_CATEGORIES = [\n 'ui',\n 'query',\n 'toast',\n 'logger',\n 'storage',\n] as const;\n\n/**\n * Check whether a permission category is an implicit baseline capability.\n */\nexport function isBaselineCategory(id: string): boolean {\n return (BASELINE_PERMISSION_CATEGORIES as readonly string[]).includes(id);\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;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,WAAW;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,WAAW;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,WAAW,C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