@opentabs-dev/opentabs-plugin-ynab 0.0.74
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/README.md +159 -0
- package/dist/adapter.iife.js +15312 -0
- package/dist/adapter.iife.js.map +7 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/create-transaction.d.ts +46 -0
- package/dist/tools/create-transaction.d.ts.map +1 -0
- package/dist/tools/create-transaction.js +57 -0
- package/dist/tools/create-transaction.js.map +1 -0
- package/dist/tools/delete-transaction.d.ts +8 -0
- package/dist/tools/delete-transaction.d.ts.map +1 -0
- package/dist/tools/delete-transaction.js +32 -0
- package/dist/tools/delete-transaction.js.map +1 -0
- package/dist/tools/get-account.d.ts +18 -0
- package/dist/tools/get-account.d.ts.map +1 -0
- package/dist/tools/get-account.js +34 -0
- package/dist/tools/get-account.js.map +1 -0
- package/dist/tools/get-current-user.d.ts +9 -0
- package/dist/tools/get-current-user.d.ts.map +1 -0
- package/dist/tools/get-current-user.js +19 -0
- package/dist/tools/get-current-user.js.map +1 -0
- package/dist/tools/get-month.d.ts +33 -0
- package/dist/tools/get-month.d.ts.map +1 -0
- package/dist/tools/get-month.js +70 -0
- package/dist/tools/get-month.js.map +1 -0
- package/dist/tools/get-plan.d.ts +12 -0
- package/dist/tools/get-plan.d.ts.map +1 -0
- package/dist/tools/get-plan.js +22 -0
- package/dist/tools/get-plan.js.map +1 -0
- package/dist/tools/get-transaction.d.ts +39 -0
- package/dist/tools/get-transaction.d.ts.map +1 -0
- package/dist/tools/get-transaction.js +43 -0
- package/dist/tools/get-transaction.js.map +1 -0
- package/dist/tools/list-accounts.d.ts +18 -0
- package/dist/tools/list-accounts.d.ts.map +1 -0
- package/dist/tools/list-accounts.js +34 -0
- package/dist/tools/list-accounts.js.map +1 -0
- package/dist/tools/list-categories.d.ts +26 -0
- package/dist/tools/list-categories.d.ts.map +1 -0
- package/dist/tools/list-categories.js +62 -0
- package/dist/tools/list-categories.js.map +1 -0
- package/dist/tools/list-months.d.ts +16 -0
- package/dist/tools/list-months.d.ts.map +1 -0
- package/dist/tools/list-months.js +43 -0
- package/dist/tools/list-months.js.map +1 -0
- package/dist/tools/list-payees.d.ts +9 -0
- package/dist/tools/list-payees.d.ts.map +1 -0
- package/dist/tools/list-payees.js +29 -0
- package/dist/tools/list-payees.js.map +1 -0
- package/dist/tools/list-scheduled-transactions.d.ts +21 -0
- package/dist/tools/list-scheduled-transactions.d.ts.map +1 -0
- package/dist/tools/list-scheduled-transactions.js +32 -0
- package/dist/tools/list-scheduled-transactions.js.map +1 -0
- package/dist/tools/list-transactions.d.ts +27 -0
- package/dist/tools/list-transactions.d.ts.map +1 -0
- package/dist/tools/list-transactions.js +44 -0
- package/dist/tools/list-transactions.js.map +1 -0
- package/dist/tools/schemas.d.ts +347 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +266 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/tools/update-category-budget.d.ts +23 -0
- package/dist/tools/update-category-budget.d.ts.map +1 -0
- package/dist/tools/update-category-budget.js +50 -0
- package/dist/tools/update-category-budget.js.map +1 -0
- package/dist/tools/update-transaction.d.ts +47 -0
- package/dist/tools/update-transaction.d.ts.map +1 -0
- package/dist/tools/update-transaction.js +62 -0
- package/dist/tools/update-transaction.js.map +1 -0
- package/dist/tools.json +1684 -0
- package/dist/ynab-api.d.ts +19 -0
- package/dist/ynab-api.d.ts.map +1 -0
- package/dist/ynab-api.js +168 -0
- package/dist/ynab-api.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface CatalogResponse<T = Record<string, unknown>> {
|
|
2
|
+
error: {
|
|
3
|
+
message: string;
|
|
4
|
+
} | null;
|
|
5
|
+
session_token?: string;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
data?: T;
|
|
8
|
+
}
|
|
9
|
+
export declare const isAuthenticated: () => boolean;
|
|
10
|
+
export declare const waitForAuth: () => Promise<boolean>;
|
|
11
|
+
export declare const getPlanId: () => string;
|
|
12
|
+
export declare const catalog: <T = Record<string, unknown>>(operationName: string, requestData?: Record<string, unknown>) => Promise<CatalogResponse<T>>;
|
|
13
|
+
export declare const syncWrite: (planId: string, changedEntities: Record<string, unknown>) => Promise<CatalogResponse>;
|
|
14
|
+
export declare const api: <T>(endpoint: string, options?: {
|
|
15
|
+
method?: string;
|
|
16
|
+
body?: Record<string, unknown>;
|
|
17
|
+
}) => Promise<T>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=ynab-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ynab-api.d.ts","sourceRoot":"","sources":["../src/ynab-api.ts"],"names":[],"mappings":"AAsBA,UAAU,eAAe,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACnD,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,CAAC,CAAC;CACV;AA4CD,eAAO,MAAM,eAAe,QAAO,OAA6B,CAAC;AAEjE,eAAO,MAAM,WAAW,QAAO,OAAO,CAAC,OAAO,CAI3C,CAAC;AAEJ,eAAO,MAAM,SAAS,QAAO,MAI5B,CAAC;AAwCF,eAAO,MAAM,OAAO,GAAU,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvD,eAAe,MAAM,EACrB,cAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,KACxC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CA8B5B,CAAC;AAMF,eAAO,MAAM,SAAS,GAAU,QAAQ,MAAM,EAAE,iBAAiB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,OAAO,CAAC,eAAe,CAoBjH,CAAC;AAIF,eAAO,MAAM,GAAG,GAAU,CAAC,EACzB,UAAU,MAAM,EAChB,UAAS;IACP,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3B,KACL,OAAO,CAAC,CAAC,CAgCX,CAAC"}
|
package/dist/ynab-api.js
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { ToolError, getMetaContent, getPageGlobal, getCurrentUrl, waitUntil, parseRetryAfterMs, getAuthCache, setAuthCache, clearAuthCache, } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
// --- Auth extraction ---
|
|
3
|
+
// YNAB uses HttpOnly session cookies for primary auth, plus a session token
|
|
4
|
+
// embedded in a <meta name="session-token"> tag. The internal API requires
|
|
5
|
+
// this token in the X-Session-Token header along with device identification
|
|
6
|
+
// headers. The user ID comes from YNAB_CLIENT_CONSTANTS.USER.
|
|
7
|
+
const generateDeviceId = () => crypto.randomUUID();
|
|
8
|
+
const extractPlanId = () => {
|
|
9
|
+
const url = getCurrentUrl();
|
|
10
|
+
const match = url.match(/app\.ynab\.com\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/);
|
|
11
|
+
return match?.[1] ?? null;
|
|
12
|
+
};
|
|
13
|
+
const getAuth = () => {
|
|
14
|
+
const cached = getAuthCache('ynab');
|
|
15
|
+
if (cached?.sessionToken && cached.planId)
|
|
16
|
+
return cached;
|
|
17
|
+
const sessionToken = getMetaContent('session-token');
|
|
18
|
+
if (!sessionToken)
|
|
19
|
+
return null;
|
|
20
|
+
const user = getPageGlobal('YNAB_CLIENT_CONSTANTS.USER');
|
|
21
|
+
if (!user?.id)
|
|
22
|
+
return null;
|
|
23
|
+
const planId = extractPlanId();
|
|
24
|
+
if (!planId)
|
|
25
|
+
return null;
|
|
26
|
+
const appVersion = getPageGlobal('YNAB_CLIENT_CONSTANTS.YNAB_APP_VERSION') ?? '26.33.1';
|
|
27
|
+
const deviceId = cached?.deviceId ?? generateDeviceId();
|
|
28
|
+
const auth = {
|
|
29
|
+
sessionToken,
|
|
30
|
+
deviceId,
|
|
31
|
+
appVersion,
|
|
32
|
+
userId: user.id,
|
|
33
|
+
planId,
|
|
34
|
+
};
|
|
35
|
+
setAuthCache('ynab', auth);
|
|
36
|
+
return auth;
|
|
37
|
+
};
|
|
38
|
+
export const isAuthenticated = () => getAuth() !== null;
|
|
39
|
+
export const waitForAuth = () => waitUntil(() => isAuthenticated(), { interval: 500, timeout: 5000 }).then(() => true, () => false);
|
|
40
|
+
export const getPlanId = () => {
|
|
41
|
+
const auth = getAuth();
|
|
42
|
+
if (!auth)
|
|
43
|
+
throw ToolError.auth('Not authenticated — please log in to YNAB.');
|
|
44
|
+
return auth.planId;
|
|
45
|
+
};
|
|
46
|
+
// --- Internal API headers ---
|
|
47
|
+
const getHeaders = () => {
|
|
48
|
+
const auth = getAuth();
|
|
49
|
+
if (!auth)
|
|
50
|
+
throw ToolError.auth('Not authenticated — please log in to YNAB.');
|
|
51
|
+
return {
|
|
52
|
+
'X-Session-Token': auth.sessionToken,
|
|
53
|
+
'X-YNAB-Device-Id': auth.deviceId,
|
|
54
|
+
'X-YNAB-Device-OS': 'web',
|
|
55
|
+
'X-YNAB-Device-App-Version': auth.appVersion,
|
|
56
|
+
'X-Requested-With': 'XMLHttpRequest',
|
|
57
|
+
Accept: 'application/json, text/javascript, */*; q=0.01',
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
// --- Error handling ---
|
|
61
|
+
const handleApiError = async (response, context) => {
|
|
62
|
+
const errorBody = (await response.text().catch(() => '')).substring(0, 512);
|
|
63
|
+
if (response.status === 429) {
|
|
64
|
+
const retryAfter = response.headers.get('Retry-After');
|
|
65
|
+
const retryMs = retryAfter !== null ? parseRetryAfterMs(retryAfter) : undefined;
|
|
66
|
+
throw ToolError.rateLimited(`Rate limited: ${context} — ${errorBody}`, retryMs);
|
|
67
|
+
}
|
|
68
|
+
if (response.status === 401 || response.status === 403) {
|
|
69
|
+
clearAuthCache('ynab');
|
|
70
|
+
throw ToolError.auth(`Auth error (${response.status}): ${errorBody}`);
|
|
71
|
+
}
|
|
72
|
+
if (response.status === 404)
|
|
73
|
+
throw ToolError.notFound(`Not found: ${context} — ${errorBody}`);
|
|
74
|
+
if (response.status === 422)
|
|
75
|
+
throw ToolError.validation(`Validation error: ${context} — ${errorBody}`);
|
|
76
|
+
throw ToolError.internal(`API error (${response.status}): ${context} — ${errorBody}`);
|
|
77
|
+
};
|
|
78
|
+
// --- Catalog API (internal RPC endpoint) ---
|
|
79
|
+
// YNAB's web app uses POST /api/v1/catalog with operation_name + request_data
|
|
80
|
+
// as the primary data access mechanism for budget operations.
|
|
81
|
+
export const catalog = async (operationName, requestData = {}) => {
|
|
82
|
+
const headers = getHeaders();
|
|
83
|
+
headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
|
|
84
|
+
let response;
|
|
85
|
+
try {
|
|
86
|
+
response = await fetch('/api/v1/catalog', {
|
|
87
|
+
method: 'POST',
|
|
88
|
+
headers,
|
|
89
|
+
credentials: 'include',
|
|
90
|
+
body: `operation_name=${encodeURIComponent(operationName)}&request_data=${encodeURIComponent(JSON.stringify(requestData))}`,
|
|
91
|
+
signal: AbortSignal.timeout(30_000),
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
if (err instanceof DOMException && err.name === 'TimeoutError')
|
|
96
|
+
throw ToolError.timeout(`Catalog request timed out: ${operationName}`);
|
|
97
|
+
if (err instanceof DOMException && err.name === 'AbortError')
|
|
98
|
+
throw new ToolError('Request was aborted', 'aborted');
|
|
99
|
+
throw new ToolError(`Network error: ${err instanceof Error ? err.message : String(err)}`, 'network_error', {
|
|
100
|
+
category: 'internal',
|
|
101
|
+
retryable: true,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
if (!response.ok)
|
|
105
|
+
return handleApiError(response, operationName);
|
|
106
|
+
const data = (await response.json());
|
|
107
|
+
if (data.error) {
|
|
108
|
+
throw ToolError.internal(`Catalog error (${operationName}): ${data.error.message}`);
|
|
109
|
+
}
|
|
110
|
+
return data;
|
|
111
|
+
};
|
|
112
|
+
// --- Sync write helper ---
|
|
113
|
+
// Write operations require the current server_knowledge to succeed.
|
|
114
|
+
// This fetches it first, then sends the write in one round-trip.
|
|
115
|
+
export const syncWrite = async (planId, changedEntities) => {
|
|
116
|
+
// Step 1: Get current server knowledge with a read sync
|
|
117
|
+
const readResult = await catalog('syncBudgetData', {
|
|
118
|
+
budget_version_id: planId,
|
|
119
|
+
starting_device_knowledge: 0,
|
|
120
|
+
ending_device_knowledge: 0,
|
|
121
|
+
device_knowledge_of_server: 0,
|
|
122
|
+
});
|
|
123
|
+
const serverKnowledge = readResult.current_server_knowledge ?? 0;
|
|
124
|
+
// Step 2: Write with correct knowledge values
|
|
125
|
+
return catalog('syncBudgetData', {
|
|
126
|
+
budget_version_id: planId,
|
|
127
|
+
starting_device_knowledge: 0,
|
|
128
|
+
ending_device_knowledge: 1,
|
|
129
|
+
device_knowledge_of_server: serverKnowledge,
|
|
130
|
+
calculated_entities_included: false,
|
|
131
|
+
changed_entities: changedEntities,
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
// --- REST API (internal v2 endpoints) ---
|
|
135
|
+
export const api = async (endpoint, options = {}) => {
|
|
136
|
+
const headers = getHeaders();
|
|
137
|
+
let fetchBody;
|
|
138
|
+
if (options.body) {
|
|
139
|
+
headers['Content-Type'] = 'application/json';
|
|
140
|
+
fetchBody = JSON.stringify(options.body);
|
|
141
|
+
}
|
|
142
|
+
let response;
|
|
143
|
+
try {
|
|
144
|
+
response = await fetch(`/api/v2${endpoint}`, {
|
|
145
|
+
method: options.method ?? 'GET',
|
|
146
|
+
headers,
|
|
147
|
+
body: fetchBody,
|
|
148
|
+
credentials: 'include',
|
|
149
|
+
signal: AbortSignal.timeout(30_000),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
catch (err) {
|
|
153
|
+
if (err instanceof DOMException && err.name === 'TimeoutError')
|
|
154
|
+
throw ToolError.timeout(`API request timed out: ${endpoint}`);
|
|
155
|
+
if (err instanceof DOMException && err.name === 'AbortError')
|
|
156
|
+
throw new ToolError('Request was aborted', 'aborted');
|
|
157
|
+
throw new ToolError(`Network error: ${err instanceof Error ? err.message : String(err)}`, 'network_error', {
|
|
158
|
+
category: 'internal',
|
|
159
|
+
retryable: true,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
if (!response.ok)
|
|
163
|
+
return handleApiError(response, endpoint);
|
|
164
|
+
if (response.status === 204)
|
|
165
|
+
return {};
|
|
166
|
+
return (await response.json());
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=ynab-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ynab-api.js","sourceRoot":"","sources":["../src/ynab-api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,cAAc,EACd,aAAa,EACb,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,cAAc,GACf,MAAM,0BAA0B,CAAC;AAmBlC,0BAA0B;AAC1B,4EAA4E;AAC5E,2EAA2E;AAC3E,4EAA4E;AAC5E,8DAA8D;AAE9D,MAAM,gBAAgB,GAAG,GAAW,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;AAE3D,MAAM,aAAa,GAAG,GAAkB,EAAE;IACxC,MAAM,GAAG,GAAG,aAAa,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,gFAAgF,CAAC,CAAC;IAC1G,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AAC5B,CAAC,CAAC;AAEF,MAAM,OAAO,GA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O,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,eAAe,EAAE;YACzG,QAAQ,EAAE,UAAU;YACpB,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,OAAO,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAE5D,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG;QAAE,OAAO,EAAO,CAAC;IAC5C,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAM,CAAC;AACtC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opentabs-dev/opentabs-plugin-ynab",
|
|
3
|
+
"description": "OpenTabs plugin for YNAB (You Need A Budget)",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"version": "0.0.74",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "dist/adapter.iife.js",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"opentabs-plugin"
|
|
12
|
+
],
|
|
13
|
+
"opentabs": {
|
|
14
|
+
"displayName": "YNAB",
|
|
15
|
+
"description": "OpenTabs plugin for YNAB (You Need A Budget)",
|
|
16
|
+
"urlPatterns": [
|
|
17
|
+
"*://app.ynab.com/*"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://app.ynab.com"
|
|
20
|
+
},
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc && opentabs-plugin build",
|
|
33
|
+
"dev": "tsc --watch --preserveWatchOutput & opentabs-plugin build --watch",
|
|
34
|
+
"type-check": "tsc --noEmit",
|
|
35
|
+
"lint": "biome lint src/",
|
|
36
|
+
"lint:fix": "biome lint --fix src/",
|
|
37
|
+
"format:check": "biome format src/",
|
|
38
|
+
"format": "biome format --write src/",
|
|
39
|
+
"check": "npm run build && npm run type-check && npm run lint && npm run format:check"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"zod": "^4.0.0"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@opentabs-dev/plugin-sdk": "^0.0.74"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@opentabs-dev/plugin-tools": "^0.0.74",
|
|
49
|
+
"@biomejs/biome": "2.4.6",
|
|
50
|
+
"jiti": "^2.6.1",
|
|
51
|
+
"typescript": "^5.9.3",
|
|
52
|
+
"zod": "^4.3.6"
|
|
53
|
+
},
|
|
54
|
+
"license": "MIT"
|
|
55
|
+
}
|