@pfm-platform/shared 0.2.0 → 0.2.1
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/dist/index.cjs +424 -414
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3869 -982
- package/dist/index.d.ts +3869 -982
- package/dist/index.js +396 -397
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
package/dist/index.cjs
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var react = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var supabaseJs = require('@supabase/supabase-js');
|
|
5
6
|
var zod = require('zod');
|
|
6
7
|
|
|
8
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
7
9
|
// src/contexts/AppModeContext.tsx
|
|
8
10
|
var AppModeContext = react.createContext({
|
|
9
11
|
mode: "user",
|
|
@@ -25,7 +27,82 @@ function useAppMode() {
|
|
|
25
27
|
}
|
|
26
28
|
return context;
|
|
27
29
|
}
|
|
30
|
+
var supabaseUrl = typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) }) !== "undefined" ? undefined?.VITE_SUPABASE_URL ?? "" : process.env.VITE_SUPABASE_URL ?? "";
|
|
31
|
+
var supabaseAnonKey = typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) }) !== "undefined" ? undefined?.VITE_SUPABASE_ANON_KEY ?? "" : process.env.VITE_SUPABASE_ANON_KEY ?? "";
|
|
32
|
+
var supabase = supabaseJs.createClient(
|
|
33
|
+
supabaseUrl || "http://placeholder.invalid",
|
|
34
|
+
supabaseAnonKey || "placeholder-key"
|
|
35
|
+
);
|
|
36
|
+
function createSupabaseClient(url, anonKey) {
|
|
37
|
+
return supabaseJs.createClient(
|
|
38
|
+
url ?? supabaseUrl,
|
|
39
|
+
anonKey ?? supabaseAnonKey
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
var AuthContext = react.createContext(null);
|
|
43
|
+
function AuthProvider({ children }) {
|
|
44
|
+
const [user, setUser] = react.useState(null);
|
|
45
|
+
const [session, setSession] = react.useState(null);
|
|
46
|
+
const [isLoading, setIsLoading] = react.useState(true);
|
|
47
|
+
react.useEffect(() => {
|
|
48
|
+
supabase.auth.getSession().then(({ data: { session: initialSession } }) => {
|
|
49
|
+
setSession(initialSession);
|
|
50
|
+
setUser(initialSession?.user ?? null);
|
|
51
|
+
setIsLoading(false);
|
|
52
|
+
});
|
|
53
|
+
const { data: { subscription } } = supabase.auth.onAuthStateChange(
|
|
54
|
+
(_event, newSession) => {
|
|
55
|
+
setSession(newSession);
|
|
56
|
+
setUser(newSession?.user ?? null);
|
|
57
|
+
setIsLoading(false);
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
return () => {
|
|
61
|
+
subscription.unsubscribe();
|
|
62
|
+
};
|
|
63
|
+
}, []);
|
|
64
|
+
const signIn = react.useCallback(async (email, password) => {
|
|
65
|
+
const { error } = await supabase.auth.signInWithPassword({ email, password });
|
|
66
|
+
return { error };
|
|
67
|
+
}, []);
|
|
68
|
+
const signUp = react.useCallback(async (email, password) => {
|
|
69
|
+
const { error } = await supabase.auth.signUp({ email, password });
|
|
70
|
+
return { error };
|
|
71
|
+
}, []);
|
|
72
|
+
const signOut = react.useCallback(async () => {
|
|
73
|
+
const { error } = await supabase.auth.signOut();
|
|
74
|
+
return { error };
|
|
75
|
+
}, []);
|
|
76
|
+
const resetPassword = react.useCallback(async (email) => {
|
|
77
|
+
const { error } = await supabase.auth.resetPasswordForEmail(email);
|
|
78
|
+
return { error };
|
|
79
|
+
}, []);
|
|
80
|
+
const value = react.useMemo(() => ({
|
|
81
|
+
user,
|
|
82
|
+
session,
|
|
83
|
+
isLoading,
|
|
84
|
+
isAuthenticated: !!session,
|
|
85
|
+
signIn,
|
|
86
|
+
signUp,
|
|
87
|
+
signOut,
|
|
88
|
+
resetPassword
|
|
89
|
+
}), [user, session, isLoading, signIn, signUp, signOut, resetPassword]);
|
|
90
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AuthContext.Provider, { value, children });
|
|
91
|
+
}
|
|
28
92
|
var AccountTypeSchema = zod.z.enum([
|
|
93
|
+
"CHECKING",
|
|
94
|
+
"SAVINGS",
|
|
95
|
+
"CREDITCARD",
|
|
96
|
+
"INVESTMENT",
|
|
97
|
+
"LOAN"
|
|
98
|
+
]);
|
|
99
|
+
var AccountStateSchema = zod.z.enum([
|
|
100
|
+
"active",
|
|
101
|
+
"closed",
|
|
102
|
+
"archived",
|
|
103
|
+
"pending_deletion"
|
|
104
|
+
]);
|
|
105
|
+
var DisplayAccountTypeSchema = zod.z.enum([
|
|
29
106
|
"checking",
|
|
30
107
|
"savings",
|
|
31
108
|
"cards",
|
|
@@ -42,239 +119,196 @@ var AccountTypeSchema = zod.z.enum([
|
|
|
42
119
|
"commercial",
|
|
43
120
|
"creditline"
|
|
44
121
|
]);
|
|
45
|
-
var AccountStateSchema = zod.z.enum([
|
|
46
|
-
"active",
|
|
47
|
-
"closed",
|
|
48
|
-
"archived",
|
|
49
|
-
"pending_deletion"
|
|
50
|
-
]);
|
|
51
122
|
var AggregationTypeSchema = zod.z.enum([
|
|
52
123
|
"finicity",
|
|
53
124
|
"cashedge",
|
|
54
|
-
"partner"
|
|
55
|
-
|
|
56
|
-
var PreferredBalanceTypeSchema = zod.z.enum([
|
|
57
|
-
"Available",
|
|
58
|
-
"Current",
|
|
59
|
-
"Outstanding"
|
|
125
|
+
"partner",
|
|
126
|
+
"manual"
|
|
60
127
|
]);
|
|
61
128
|
var FinancialInstitutionSchema = zod.z.object({
|
|
62
|
-
id: zod.z.
|
|
63
|
-
name: zod.z.string()
|
|
64
|
-
}).nullable();
|
|
65
|
-
var CashEdgeAccountTypeSchema = zod.z.object({
|
|
129
|
+
id: zod.z.string().uuid(),
|
|
66
130
|
name: zod.z.string(),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}).nullable();
|
|
71
|
-
var AccountErrorSchema = zod.z.object({
|
|
72
|
-
message: zod.z.string(),
|
|
73
|
-
code: zod.z.string(),
|
|
74
|
-
actionable: zod.z.boolean(),
|
|
75
|
-
description: zod.z.string().optional()
|
|
76
|
-
// Finicity-specific field
|
|
131
|
+
ofx_org: zod.z.string().nullable().optional(),
|
|
132
|
+
ofx_fid: zod.z.string().nullable().optional(),
|
|
133
|
+
created_at: zod.z.string().nullable().optional()
|
|
77
134
|
}).nullable();
|
|
78
|
-
var OtherBalanceSchema = zod.z.object({
|
|
79
|
-
balance_type: zod.z.string(),
|
|
80
|
-
balance: zod.z.string().regex(/^\d+\.\d+$/)
|
|
81
|
-
});
|
|
82
135
|
var AccountSchema = zod.z.object({
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
id: zod.z.number().int().positive(),
|
|
136
|
+
id: zod.z.string().uuid(),
|
|
137
|
+
user_id: zod.z.string().uuid(),
|
|
138
|
+
institution_id: zod.z.string().uuid(),
|
|
87
139
|
name: zod.z.string().min(1),
|
|
88
|
-
// ========================================
|
|
89
|
-
// Balance Fields (STRINGS, not numbers!)
|
|
90
|
-
// ========================================
|
|
91
|
-
balance: zod.z.string().regex(/^-?\d+\.\d{1,2}$/, {
|
|
92
|
-
message: 'Balance must be a string in format "1234.56" with 1-2 decimal places'
|
|
93
|
-
}),
|
|
94
|
-
locked_balance: zod.z.string().regex(/^-?\d+\.\d+$/).nullable().optional(),
|
|
95
|
-
preferred_balance_type: PreferredBalanceTypeSchema.nullable().optional(),
|
|
96
|
-
// ========================================
|
|
97
|
-
// Type and State
|
|
98
|
-
// ========================================
|
|
99
140
|
account_type: AccountTypeSchema,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
//
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
141
|
+
account_number_masked: zod.z.string().nullable().optional(),
|
|
142
|
+
currency: zod.z.string().default("USD"),
|
|
143
|
+
is_active: zod.z.boolean().default(true),
|
|
144
|
+
// New columns from migration 20260215000001
|
|
145
|
+
balance: zod.z.number().default(0),
|
|
146
|
+
state: AccountStateSchema.default("active"),
|
|
147
|
+
display_account_type: DisplayAccountTypeSchema.nullable().optional(),
|
|
148
|
+
include_in_expenses: zod.z.boolean().default(true),
|
|
149
|
+
include_in_budget: zod.z.boolean().default(true),
|
|
150
|
+
include_in_cashflow: zod.z.boolean().default(true),
|
|
151
|
+
include_in_dashboard: zod.z.boolean().default(true),
|
|
152
|
+
include_in_goals: zod.z.boolean().default(false),
|
|
153
|
+
include_in_networth: zod.z.boolean().default(true),
|
|
154
|
+
aggregation_type: AggregationTypeSchema.nullable().optional(),
|
|
155
|
+
created_at: zod.z.string().nullable().optional(),
|
|
156
|
+
updated_at: zod.z.string().nullable().optional()
|
|
157
|
+
});
|
|
158
|
+
var AccountWithInstitutionSchema = AccountSchema.extend({
|
|
159
|
+
institution: FinancialInstitutionSchema
|
|
160
|
+
});
|
|
161
|
+
var AccountsResponseSchema = zod.z.array(AccountSchema);
|
|
162
|
+
var AccountsWithInstitutionResponseSchema = zod.z.array(AccountWithInstitutionSchema);
|
|
163
|
+
var AccountCreateSchema = zod.z.object({
|
|
164
|
+
user_id: zod.z.string().uuid(),
|
|
165
|
+
institution_id: zod.z.string().uuid(),
|
|
166
|
+
name: zod.z.string().min(1),
|
|
167
|
+
account_type: AccountTypeSchema,
|
|
168
|
+
account_number_masked: zod.z.string().nullable().optional(),
|
|
169
|
+
currency: zod.z.string().default("USD"),
|
|
170
|
+
is_active: zod.z.boolean().default(true),
|
|
171
|
+
balance: zod.z.number().default(0),
|
|
172
|
+
state: AccountStateSchema.default("active"),
|
|
173
|
+
display_account_type: DisplayAccountTypeSchema.nullable().optional(),
|
|
174
|
+
include_in_expenses: zod.z.boolean().default(true),
|
|
175
|
+
include_in_budget: zod.z.boolean().default(true),
|
|
176
|
+
include_in_cashflow: zod.z.boolean().default(true),
|
|
177
|
+
include_in_dashboard: zod.z.boolean().default(true),
|
|
178
|
+
include_in_goals: zod.z.boolean().default(false),
|
|
179
|
+
include_in_networth: zod.z.boolean().default(true),
|
|
180
|
+
aggregation_type: AggregationTypeSchema.nullable().optional()
|
|
127
181
|
});
|
|
128
182
|
var AccountCreateSchemaAdmin = zod.z.object({
|
|
183
|
+
user_id: zod.z.string().uuid(),
|
|
184
|
+
institution_id: zod.z.string().uuid(),
|
|
129
185
|
name: zod.z.string().optional().default("Test Account"),
|
|
130
|
-
|
|
131
|
-
|
|
186
|
+
account_type: AccountTypeSchema.optional().default("CHECKING"),
|
|
187
|
+
account_number_masked: zod.z.string().nullable().optional(),
|
|
188
|
+
currency: zod.z.string().optional().default("USD"),
|
|
189
|
+
is_active: zod.z.boolean().optional().default(true),
|
|
190
|
+
balance: zod.z.number().optional().default(0),
|
|
132
191
|
state: AccountStateSchema.optional().default("active"),
|
|
133
|
-
|
|
134
|
-
// Include flags - all optional with defaults
|
|
192
|
+
display_account_type: DisplayAccountTypeSchema.nullable().optional(),
|
|
135
193
|
include_in_expenses: zod.z.boolean().optional().default(true),
|
|
136
194
|
include_in_budget: zod.z.boolean().optional().default(true),
|
|
137
195
|
include_in_cashflow: zod.z.boolean().optional().default(true),
|
|
138
196
|
include_in_dashboard: zod.z.boolean().optional().default(true),
|
|
139
197
|
include_in_goals: zod.z.boolean().optional().default(false),
|
|
140
198
|
include_in_networth: zod.z.boolean().optional().default(true),
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
199
|
+
aggregation_type: AggregationTypeSchema.nullable().optional()
|
|
200
|
+
});
|
|
201
|
+
var AccountCreateSchemaUser = AccountCreateSchema;
|
|
202
|
+
var AccountUpdateSchema = zod.z.object({
|
|
203
|
+
name: zod.z.string().min(1).optional(),
|
|
204
|
+
account_type: AccountTypeSchema.optional(),
|
|
205
|
+
account_number_masked: zod.z.string().nullable().optional(),
|
|
206
|
+
currency: zod.z.string().optional(),
|
|
207
|
+
is_active: zod.z.boolean().optional(),
|
|
208
|
+
balance: zod.z.number().optional(),
|
|
209
|
+
state: AccountStateSchema.optional(),
|
|
210
|
+
display_account_type: DisplayAccountTypeSchema.nullable().optional(),
|
|
211
|
+
include_in_expenses: zod.z.boolean().optional(),
|
|
212
|
+
include_in_budget: zod.z.boolean().optional(),
|
|
213
|
+
include_in_cashflow: zod.z.boolean().optional(),
|
|
214
|
+
include_in_dashboard: zod.z.boolean().optional(),
|
|
215
|
+
include_in_goals: zod.z.boolean().optional(),
|
|
216
|
+
include_in_networth: zod.z.boolean().optional(),
|
|
217
|
+
aggregation_type: AggregationTypeSchema.nullable().optional()
|
|
159
218
|
});
|
|
160
219
|
var AccountDeleteSchema = zod.z.object({
|
|
161
|
-
id: zod.z.
|
|
220
|
+
id: zod.z.string().uuid()
|
|
162
221
|
});
|
|
163
222
|
var AccountArchiveSchema = zod.z.object({
|
|
164
|
-
id: zod.z.
|
|
165
|
-
});
|
|
166
|
-
var PendingAccountSchema = zod.z.object({
|
|
167
|
-
account_ids: zod.z.array(zod.z.number().int()),
|
|
168
|
-
institution_id: zod.z.number().int()
|
|
169
|
-
});
|
|
170
|
-
var PendingAccountsResponseSchema = zod.z.object({
|
|
171
|
-
pending_accounts: zod.z.array(PendingAccountSchema)
|
|
172
|
-
});
|
|
173
|
-
var PendingAccountDeleteSchema = zod.z.object({
|
|
174
|
-
accountId: zod.z.number().int().positive()
|
|
175
|
-
});
|
|
176
|
-
var InvestmentHoldingSchema = zod.z.object({
|
|
177
|
-
symbol: zod.z.string(),
|
|
178
|
-
description: zod.z.string().optional(),
|
|
179
|
-
quantity: zod.z.number().finite(),
|
|
180
|
-
price: zod.z.number().finite().positive(),
|
|
181
|
-
value: zod.z.string().regex(/^\d+\.\d{2}$/),
|
|
182
|
-
// String format like other amounts
|
|
183
|
-
cost_basis: zod.z.string().regex(/^\d+\.\d{2}$/).optional(),
|
|
184
|
-
unrealized_gain_loss: zod.z.string().regex(/^-?\d+\.\d{2}$/).optional()
|
|
223
|
+
id: zod.z.string().uuid()
|
|
185
224
|
});
|
|
186
|
-
var
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
225
|
+
var FinancialInstitutionRowSchema = zod.z.object({
|
|
226
|
+
id: zod.z.string().uuid(),
|
|
227
|
+
user_id: zod.z.string().uuid(),
|
|
228
|
+
name: zod.z.string().min(1),
|
|
229
|
+
ofx_org: zod.z.string().nullable().optional(),
|
|
230
|
+
ofx_fid: zod.z.string().nullable().optional(),
|
|
231
|
+
created_at: zod.z.string().nullable().optional()
|
|
190
232
|
});
|
|
191
|
-
var
|
|
192
|
-
|
|
233
|
+
var InstitutionCreateSchema = zod.z.object({
|
|
234
|
+
user_id: zod.z.string().uuid(),
|
|
235
|
+
name: zod.z.string().min(1),
|
|
236
|
+
ofx_org: zod.z.string().nullable().optional(),
|
|
237
|
+
ofx_fid: zod.z.string().nullable().optional()
|
|
193
238
|
});
|
|
194
239
|
var TransactionTypeSchema = zod.z.enum(["Debit", "Credit"]);
|
|
195
240
|
var TransactionTagSchema = zod.z.object({
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
241
|
+
id: zod.z.string().uuid(),
|
|
242
|
+
transaction_id: zod.z.string().uuid(),
|
|
243
|
+
tag_name: zod.z.string(),
|
|
244
|
+
amount: zod.z.number().finite().nullable(),
|
|
245
|
+
created_at: zod.z.string().nullable().optional()
|
|
201
246
|
});
|
|
202
247
|
var TransactionSchema = zod.z.object({
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
message: "Transaction ID must be in format YYYY_MM_DD_referenceId_accountId"
|
|
208
|
-
}),
|
|
248
|
+
id: zod.z.string().uuid(),
|
|
249
|
+
user_id: zod.z.string().uuid(),
|
|
250
|
+
account_id: zod.z.string().uuid(),
|
|
251
|
+
legacy_id: zod.z.string().nullable().optional(),
|
|
209
252
|
reference_id: zod.z.string(),
|
|
210
|
-
// ========================================
|
|
211
|
-
// Transaction Details
|
|
212
|
-
// ========================================
|
|
213
253
|
transaction_type: TransactionTypeSchema,
|
|
254
|
+
amount: zod.z.number().finite(),
|
|
214
255
|
memo: zod.z.string().nullable().optional(),
|
|
215
|
-
balance: zod.z.number().finite().positive(),
|
|
216
|
-
// NUMBER in legacy data, not string
|
|
217
|
-
// ========================================
|
|
218
|
-
// Timestamps
|
|
219
|
-
// ========================================
|
|
220
|
-
// Note: Legacy uses RFC 3339 format with offset (e.g., "2020-08-06T00:00:00.000+00:00")
|
|
221
|
-
// Zod's .datetime() is too strict (requires 'Z'), so we use string validation
|
|
222
256
|
posted_at: zod.z.string(),
|
|
223
|
-
created_at: zod.z.string(),
|
|
224
|
-
deleted_at: zod.z.string().nullable().optional(),
|
|
225
|
-
// ========================================
|
|
226
|
-
// Names
|
|
227
|
-
// ========================================
|
|
228
257
|
nickname: zod.z.string(),
|
|
229
258
|
original_name: zod.z.string(),
|
|
230
|
-
// ========================================
|
|
231
|
-
// Optional Fields
|
|
232
|
-
// ========================================
|
|
233
259
|
check_number: zod.z.string().nullable().optional(),
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
tags: zod.z.array(TransactionTagSchema),
|
|
238
|
-
links: TransactionLinksSchema
|
|
260
|
+
deleted_at: zod.z.string().nullable().optional(),
|
|
261
|
+
created_at: zod.z.string().nullable().optional(),
|
|
262
|
+
updated_at: zod.z.string().nullable().optional()
|
|
239
263
|
});
|
|
240
|
-
var
|
|
241
|
-
|
|
264
|
+
var TransactionWithTagsSchema = TransactionSchema.extend({
|
|
265
|
+
transaction_tags: zod.z.array(TransactionTagSchema).default([])
|
|
242
266
|
});
|
|
267
|
+
var TransactionsResponseSchema = zod.z.array(TransactionWithTagsSchema);
|
|
243
268
|
var TransactionCreateSchemaAdmin = zod.z.object({
|
|
269
|
+
user_id: zod.z.string().uuid(),
|
|
270
|
+
account_id: zod.z.string().uuid(),
|
|
244
271
|
reference_id: zod.z.string(),
|
|
245
272
|
transaction_type: TransactionTypeSchema,
|
|
246
|
-
|
|
273
|
+
amount: zod.z.number().finite(),
|
|
247
274
|
posted_at: zod.z.string(),
|
|
248
|
-
nickname: zod.z.string().optional().default("
|
|
249
|
-
original_name: zod.z.string().optional().default("
|
|
275
|
+
nickname: zod.z.string().optional().default(""),
|
|
276
|
+
original_name: zod.z.string().optional().default(""),
|
|
250
277
|
memo: zod.z.string().nullable().optional(),
|
|
251
278
|
check_number: zod.z.string().nullable().optional(),
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
279
|
+
legacy_id: zod.z.string().nullable().optional(),
|
|
280
|
+
deleted_at: zod.z.string().nullable().optional()
|
|
281
|
+
});
|
|
282
|
+
var TransactionCreateSchemaUser = zod.z.object({
|
|
283
|
+
user_id: zod.z.string().uuid(),
|
|
284
|
+
account_id: zod.z.string().uuid(),
|
|
285
|
+
reference_id: zod.z.string().min(1),
|
|
286
|
+
transaction_type: TransactionTypeSchema,
|
|
287
|
+
amount: zod.z.number().finite().positive(),
|
|
288
|
+
posted_at: zod.z.string().min(1),
|
|
289
|
+
nickname: zod.z.string().min(1),
|
|
290
|
+
original_name: zod.z.string().min(1),
|
|
291
|
+
memo: zod.z.string().nullable().optional(),
|
|
292
|
+
check_number: zod.z.string().nullable().optional()
|
|
259
293
|
}).strict();
|
|
260
294
|
var TransactionCreateSchema = TransactionCreateSchemaUser;
|
|
261
|
-
var TransactionUpdateSchema =
|
|
262
|
-
id:
|
|
263
|
-
nickname:
|
|
264
|
-
|
|
295
|
+
var TransactionUpdateSchema = zod.z.object({
|
|
296
|
+
id: zod.z.string().uuid(),
|
|
297
|
+
nickname: zod.z.string().optional(),
|
|
298
|
+
memo: zod.z.string().nullable().optional(),
|
|
299
|
+
amount: zod.z.number().finite().optional(),
|
|
300
|
+
transaction_type: TransactionTypeSchema.optional(),
|
|
301
|
+
posted_at: zod.z.string().optional(),
|
|
302
|
+
check_number: zod.z.string().nullable().optional()
|
|
265
303
|
}).strict();
|
|
266
304
|
var TransactionTaggingRegularSchema = zod.z.object({
|
|
267
305
|
type: zod.z.literal("regular"),
|
|
268
306
|
repeat: zod.z.boolean(),
|
|
269
|
-
// Apply to all future matching transactions
|
|
270
307
|
regular: zod.z.array(zod.z.string())
|
|
271
|
-
// Tag names
|
|
272
308
|
});
|
|
273
309
|
var TransactionTaggingSplitItemSchema = zod.z.object({
|
|
274
310
|
name: zod.z.string(),
|
|
275
|
-
// Tag name
|
|
276
311
|
value: zod.z.number().finite().positive()
|
|
277
|
-
// Split amount
|
|
278
312
|
});
|
|
279
313
|
var TransactionTaggingSplitSchema = zod.z.object({
|
|
280
314
|
type: zod.z.literal("split"),
|
|
@@ -286,20 +320,13 @@ var TransactionTaggingSchema = zod.z.discriminatedUnion("type", [
|
|
|
286
320
|
]);
|
|
287
321
|
var TransactionSearchParamsSchema = zod.z.object({
|
|
288
322
|
begin_on: zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
289
|
-
// RFC 3339 date "2020-01-01"
|
|
290
323
|
end_on: zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
291
|
-
// RFC 3339 date "2020-12-31"
|
|
292
324
|
q: zod.z.string().optional(),
|
|
293
|
-
// Search query
|
|
294
325
|
untagged: zod.z.enum(["0", "1"]).optional(),
|
|
295
|
-
// "0" = false, "1" = true
|
|
296
326
|
tags: zod.z.array(zod.z.string()).optional()
|
|
297
|
-
// Filter by tag names
|
|
298
327
|
});
|
|
299
328
|
var TransactionDeleteSchema = zod.z.object({
|
|
300
|
-
id: zod.z.string().
|
|
301
|
-
message: "Transaction ID must be in format YYYY_MM_DD_referenceId_accountId"
|
|
302
|
-
})
|
|
329
|
+
id: zod.z.string().uuid()
|
|
303
330
|
});
|
|
304
331
|
var CashflowEventTypeSchema = zod.z.enum(["bill", "income"]);
|
|
305
332
|
var RecurrenceFrequencySchema = zod.z.enum([
|
|
@@ -373,184 +400,174 @@ var CashflowEventsResponseSchema = zod.z.object({
|
|
|
373
400
|
events: zod.z.array(CashflowEventSchema)
|
|
374
401
|
});
|
|
375
402
|
var BudgetStateSchema = zod.z.enum(["under", "risk", "over"]);
|
|
376
|
-
var
|
|
377
|
-
|
|
378
|
-
|
|
403
|
+
var BudgetTagSchema = zod.z.object({
|
|
404
|
+
budget_id: zod.z.string().uuid(),
|
|
405
|
+
tag_name: zod.z.string()
|
|
406
|
+
});
|
|
407
|
+
var BudgetAccountSchema = zod.z.object({
|
|
408
|
+
budget_id: zod.z.string().uuid(),
|
|
409
|
+
account_id: zod.z.string().uuid()
|
|
379
410
|
});
|
|
380
411
|
var BudgetSchema = zod.z.object({
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
id: zod.z.number().int().positive(),
|
|
385
|
-
// ========================================
|
|
386
|
-
// Time Period
|
|
387
|
-
// ========================================
|
|
412
|
+
id: zod.z.string().uuid(),
|
|
413
|
+
user_id: zod.z.string().uuid(),
|
|
414
|
+
name: zod.z.string().max(255),
|
|
388
415
|
month: zod.z.number().int().min(1).max(12),
|
|
389
416
|
year: zod.z.number().int(),
|
|
390
|
-
|
|
391
|
-
// Budget Details
|
|
392
|
-
// ========================================
|
|
393
|
-
name: zod.z.string().max(255),
|
|
394
|
-
state: BudgetStateSchema,
|
|
417
|
+
budget_amount: zod.z.number().finite(),
|
|
395
418
|
spent: zod.z.number().finite(),
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
// Category Association
|
|
401
|
-
// ========================================
|
|
402
|
-
tag_names: zod.z.array(zod.z.string()),
|
|
403
|
-
// ========================================
|
|
404
|
-
// Related Resources
|
|
405
|
-
// ========================================
|
|
406
|
-
links: BudgetLinksSchema
|
|
419
|
+
state: zod.z.string(),
|
|
420
|
+
show_on_dashboard: zod.z.boolean(),
|
|
421
|
+
created_at: zod.z.string().nullable().optional(),
|
|
422
|
+
updated_at: zod.z.string().nullable().optional()
|
|
407
423
|
});
|
|
408
|
-
var
|
|
409
|
-
|
|
424
|
+
var BudgetWithRelationsSchema = BudgetSchema.extend({
|
|
425
|
+
budget_tags: zod.z.array(BudgetTagSchema).default([]),
|
|
426
|
+
budget_accounts: zod.z.array(BudgetAccountSchema).default([])
|
|
410
427
|
});
|
|
428
|
+
var BudgetsResponseSchema = zod.z.array(BudgetWithRelationsSchema);
|
|
411
429
|
var BudgetCreateSchema = zod.z.object({
|
|
430
|
+
user_id: zod.z.string().uuid(),
|
|
412
431
|
name: zod.z.string().max(255),
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
})
|
|
432
|
+
month: zod.z.number().int().min(1).max(12),
|
|
433
|
+
year: zod.z.number().int(),
|
|
434
|
+
budget_amount: zod.z.number().finite(),
|
|
435
|
+
spent: zod.z.number().finite().optional(),
|
|
436
|
+
state: zod.z.string().optional(),
|
|
437
|
+
show_on_dashboard: zod.z.boolean().optional()
|
|
438
|
+
});
|
|
420
439
|
var BudgetUpdateSchema = zod.z.object({
|
|
421
|
-
id: zod.z.
|
|
422
|
-
name: zod.z.string().max(255),
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
440
|
+
id: zod.z.string().uuid(),
|
|
441
|
+
name: zod.z.string().max(255).optional(),
|
|
442
|
+
month: zod.z.number().int().min(1).max(12).optional(),
|
|
443
|
+
year: zod.z.number().int().optional(),
|
|
444
|
+
budget_amount: zod.z.number().finite().optional(),
|
|
445
|
+
spent: zod.z.number().finite().optional(),
|
|
446
|
+
state: zod.z.string().optional(),
|
|
447
|
+
show_on_dashboard: zod.z.boolean().optional()
|
|
448
|
+
});
|
|
429
449
|
var GoalStateSchema = zod.z.enum(["active", "completed", "archived"]);
|
|
430
450
|
var GoalStatusSchema = zod.z.enum(["complete", "over", "risk", "under"]);
|
|
431
|
-
var
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
var BaseGoalSchema = zod.z.object({
|
|
435
|
-
// ========================================
|
|
436
|
-
// Core Identifiers
|
|
437
|
-
// ========================================
|
|
438
|
-
id: zod.z.number().int().positive(),
|
|
439
|
-
// ========================================
|
|
440
|
-
// Goal Details
|
|
441
|
-
// ========================================
|
|
451
|
+
var SavingsGoalRowSchema = zod.z.object({
|
|
452
|
+
id: zod.z.string().uuid(),
|
|
453
|
+
user_id: zod.z.string().uuid(),
|
|
442
454
|
name: zod.z.string().max(255),
|
|
443
|
-
state:
|
|
444
|
-
status:
|
|
445
|
-
// ========================================
|
|
446
|
-
// Visual Elements
|
|
447
|
-
// ========================================
|
|
455
|
+
state: zod.z.string(),
|
|
456
|
+
status: zod.z.string(),
|
|
448
457
|
image_name: zod.z.string(),
|
|
449
458
|
image_url: zod.z.string(),
|
|
450
|
-
|
|
451
|
-
// Progress Tracking
|
|
452
|
-
// ========================================
|
|
453
|
-
percent_complete: zod.z.number().int().min(0).max(100),
|
|
459
|
+
percent_complete: zod.z.number(),
|
|
454
460
|
complete: zod.z.boolean(),
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
461
|
+
initial_value: zod.z.number(),
|
|
462
|
+
current_value: zod.z.number(),
|
|
463
|
+
target_value: zod.z.number(),
|
|
464
|
+
monthly_contribution: zod.z.number(),
|
|
465
|
+
remaining_monthly_contribution: zod.z.number(),
|
|
466
|
+
current_progress: zod.z.number().nullable(),
|
|
467
|
+
target_contribution: zod.z.number().nullable(),
|
|
468
|
+
target_completion_on: zod.z.string().nullable(),
|
|
469
|
+
weight: zod.z.number().nullable(),
|
|
470
|
+
created_at: zod.z.string().nullable(),
|
|
471
|
+
updated_at: zod.z.string().nullable()
|
|
472
|
+
});
|
|
473
|
+
var PayoffGoalRowSchema = zod.z.object({
|
|
474
|
+
id: zod.z.string().uuid(),
|
|
475
|
+
user_id: zod.z.string().uuid(),
|
|
476
|
+
name: zod.z.string().max(255),
|
|
477
|
+
state: zod.z.string(),
|
|
478
|
+
status: zod.z.string(),
|
|
479
|
+
image_name: zod.z.string(),
|
|
480
|
+
image_url: zod.z.string(),
|
|
481
|
+
percent_complete: zod.z.number(),
|
|
482
|
+
complete: zod.z.boolean(),
|
|
483
|
+
initial_value: zod.z.number(),
|
|
484
|
+
current_value: zod.z.number(),
|
|
485
|
+
target_value: zod.z.number(),
|
|
486
|
+
monthly_contribution: zod.z.number(),
|
|
487
|
+
remaining_monthly_contribution: zod.z.number(),
|
|
488
|
+
current_progress: zod.z.number().nullable(),
|
|
489
|
+
target_contribution: zod.z.number().nullable(),
|
|
490
|
+
target_completion_on: zod.z.string().nullable(),
|
|
491
|
+
created_at: zod.z.string().nullable(),
|
|
492
|
+
updated_at: zod.z.string().nullable()
|
|
493
|
+
});
|
|
494
|
+
var GoalAccountRowSchema = zod.z.object({
|
|
495
|
+
id: zod.z.string().uuid(),
|
|
496
|
+
goal_type: zod.z.string(),
|
|
497
|
+
goal_id: zod.z.string().uuid(),
|
|
498
|
+
account_id: zod.z.string().uuid()
|
|
484
499
|
});
|
|
485
|
-
var
|
|
500
|
+
var SavingsGoalsResponseSchema = zod.z.array(SavingsGoalRowSchema);
|
|
501
|
+
var PayoffGoalsResponseSchema = zod.z.array(PayoffGoalRowSchema);
|
|
486
502
|
var GoalCreateSchema = zod.z.object({
|
|
487
503
|
name: zod.z.string().max(255),
|
|
488
504
|
state: GoalStateSchema.optional(),
|
|
489
505
|
image_name: zod.z.string(),
|
|
490
|
-
target_value: zod.z.
|
|
506
|
+
target_value: zod.z.number().positive(),
|
|
491
507
|
target_completion_on: zod.z.string().optional(),
|
|
492
|
-
target_contribution: zod.z.
|
|
493
|
-
account_ids: zod.z.array(zod.z.
|
|
494
|
-
|
|
495
|
-
}).strict();
|
|
508
|
+
target_contribution: zod.z.number().optional(),
|
|
509
|
+
account_ids: zod.z.array(zod.z.string().uuid()).optional()
|
|
510
|
+
});
|
|
496
511
|
var GoalUpdateSchema = zod.z.object({
|
|
497
|
-
id: zod.z.
|
|
512
|
+
id: zod.z.string().uuid(),
|
|
498
513
|
name: zod.z.string().max(255),
|
|
499
514
|
state: GoalStateSchema.optional(),
|
|
500
515
|
image_name: zod.z.string(),
|
|
501
|
-
target_value: zod.z.
|
|
516
|
+
target_value: zod.z.number().positive(),
|
|
502
517
|
target_completion_on: zod.z.string().optional(),
|
|
503
|
-
target_contribution: zod.z.
|
|
504
|
-
account_ids: zod.z.array(zod.z.
|
|
505
|
-
}).strict();
|
|
506
|
-
var SavingsGoalsResponseSchema = zod.z.object({
|
|
507
|
-
savings_goals: zod.z.array(SavingsGoalSchema)
|
|
518
|
+
target_contribution: zod.z.number().optional(),
|
|
519
|
+
account_ids: zod.z.array(zod.z.string().uuid()).optional()
|
|
508
520
|
});
|
|
509
|
-
var
|
|
510
|
-
|
|
521
|
+
var GoalImageSchema = zod.z.object({
|
|
522
|
+
id: zod.z.string(),
|
|
523
|
+
name: zod.z.string(),
|
|
524
|
+
url: zod.z.string()
|
|
511
525
|
});
|
|
512
526
|
var GoalImagesResponseSchema = zod.z.object({
|
|
513
|
-
images: zod.z.array(
|
|
514
|
-
zod.z.object({
|
|
515
|
-
id: zod.z.number().int().positive(),
|
|
516
|
-
name: zod.z.string(),
|
|
517
|
-
url: zod.z.string()
|
|
518
|
-
})
|
|
519
|
-
)
|
|
527
|
+
images: zod.z.array(GoalImageSchema)
|
|
520
528
|
});
|
|
521
529
|
var UserSexSchema = zod.z.enum(["Male", "Female"]);
|
|
530
|
+
var UserProfileRowSchema = zod.z.object({
|
|
531
|
+
id: zod.z.string().uuid(),
|
|
532
|
+
login: zod.z.string(),
|
|
533
|
+
email: zod.z.string(),
|
|
534
|
+
login_count: zod.z.number().int().nonnegative(),
|
|
535
|
+
last_login_at: zod.z.string().nullable(),
|
|
536
|
+
custom_tags: zod.z.unknown(),
|
|
537
|
+
// JSONB
|
|
538
|
+
custom_settings: zod.z.unknown(),
|
|
539
|
+
// JSONB
|
|
540
|
+
first_name: zod.z.string(),
|
|
541
|
+
last_name: zod.z.string(),
|
|
542
|
+
postal_code: zod.z.string(),
|
|
543
|
+
birth_year: zod.z.number().int().min(1901).nullable(),
|
|
544
|
+
sex: zod.z.enum(["Male", "Female"]).nullable(),
|
|
545
|
+
city: zod.z.string().nullable(),
|
|
546
|
+
state: zod.z.string().nullable(),
|
|
547
|
+
created_at: zod.z.string().nullable(),
|
|
548
|
+
updated_at: zod.z.string().nullable()
|
|
549
|
+
});
|
|
522
550
|
var UserSchema = zod.z.object({
|
|
523
|
-
// ========================================
|
|
524
551
|
// Core Identifiers
|
|
525
|
-
// ========================================
|
|
526
552
|
id: zod.z.string(),
|
|
527
553
|
// Partner customer ID (STRING, not integer)
|
|
528
554
|
login: zod.z.string(),
|
|
529
555
|
email: zod.z.string().email(),
|
|
530
|
-
// ========================================
|
|
531
556
|
// Login Tracking
|
|
532
|
-
// ========================================
|
|
533
557
|
login_count: zod.z.number().int().nonnegative(),
|
|
534
558
|
last_login_at: zod.z.string(),
|
|
535
559
|
// RFC 3339 datetime format
|
|
536
|
-
// ========================================
|
|
537
560
|
// Customization
|
|
538
|
-
// ========================================
|
|
539
561
|
custom_tags: zod.z.array(zod.z.string()),
|
|
540
562
|
custom_settings: zod.z.object({}).passthrough(),
|
|
541
563
|
// Arbitrary key-value pairs
|
|
542
|
-
// ========================================
|
|
543
564
|
// Profile Information
|
|
544
|
-
// ========================================
|
|
545
565
|
first_name: zod.z.string(),
|
|
546
566
|
last_name: zod.z.string(),
|
|
547
567
|
postal_code: zod.z.string(),
|
|
548
568
|
birth_year: zod.z.number().int().min(1901),
|
|
549
569
|
sex: UserSexSchema,
|
|
550
|
-
// ========================================
|
|
551
570
|
// Optional Location Fields
|
|
552
|
-
// ========================================
|
|
553
|
-
// Note: city and state appear in OpenAPI but not in legacy mock data
|
|
554
571
|
city: zod.z.string().optional(),
|
|
555
572
|
state: zod.z.string().optional()
|
|
556
573
|
});
|
|
@@ -607,16 +624,18 @@ var UserUpdateSchemaUser = zod.z.object({
|
|
|
607
624
|
state: zod.z.string().optional()
|
|
608
625
|
}).strict();
|
|
609
626
|
var UserUpdateSchema = UserUpdateSchemaUser;
|
|
610
|
-
var
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
var DefaultTagsSchema = zod.z.object({
|
|
614
|
-
defaultTags: zod.z.array(zod.z.string())
|
|
627
|
+
var DefaultTagRowSchema = zod.z.object({
|
|
628
|
+
name: zod.z.string(),
|
|
629
|
+
created_at: zod.z.string().nullable()
|
|
615
630
|
});
|
|
616
|
-
var
|
|
617
|
-
|
|
618
|
-
|
|
631
|
+
var UserTagRowSchema = zod.z.object({
|
|
632
|
+
user_id: zod.z.string().uuid(),
|
|
633
|
+
name: zod.z.string(),
|
|
634
|
+
color: zod.z.string().nullable(),
|
|
635
|
+
created_at: zod.z.string().nullable()
|
|
619
636
|
});
|
|
637
|
+
var DefaultTagsResponseSchema = zod.z.array(DefaultTagRowSchema);
|
|
638
|
+
var UserTagsResponseSchema = zod.z.array(UserTagRowSchema);
|
|
620
639
|
var TagsUpdateSchema = zod.z.array(zod.z.string()).min(0);
|
|
621
640
|
var TagCreateSchemaAdmin = zod.z.object({
|
|
622
641
|
name: zod.z.string()
|
|
@@ -672,84 +691,60 @@ var AlertDestinationsSchema = zod.z.object({
|
|
|
672
691
|
sms_number: zod.z.string().regex(/^\d{10}$/).nullable(),
|
|
673
692
|
partner_sms_enabled: zod.z.boolean()
|
|
674
693
|
});
|
|
675
|
-
var
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
// ========================================
|
|
679
|
-
id: zod.z.number().int().positive(),
|
|
694
|
+
var AlertRowSchema = zod.z.object({
|
|
695
|
+
id: zod.z.string().uuid(),
|
|
696
|
+
user_id: zod.z.string().uuid(),
|
|
680
697
|
type: AlertTypeSchema,
|
|
681
|
-
|
|
682
|
-
// Alert Configuration
|
|
683
|
-
// ========================================
|
|
684
|
-
options: zod.z.object({}).passthrough(),
|
|
685
|
-
// Dynamic options per alert type
|
|
686
|
-
// ========================================
|
|
687
|
-
// Delivery Settings
|
|
688
|
-
// ========================================
|
|
698
|
+
options: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
689
699
|
email_delivery: zod.z.boolean(),
|
|
690
700
|
sms_delivery: zod.z.boolean(),
|
|
691
|
-
// ========================================
|
|
692
|
-
// Source Object Reference
|
|
693
|
-
// ========================================
|
|
694
701
|
source_type: AlertSourceTypeSchema,
|
|
695
|
-
source_id: zod.z.
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
// Full Source Object (Nested)
|
|
699
|
-
// ========================================
|
|
700
|
-
// Note: Source is fully nested Account, Goal, Budget, etc. object
|
|
701
|
-
// Using unknown for flexibility since it's a oneOf in OpenAPI
|
|
702
|
-
source: zod.z.unknown().optional()
|
|
702
|
+
source_id: zod.z.string().nullable(),
|
|
703
|
+
created_at: zod.z.string().nullable(),
|
|
704
|
+
updated_at: zod.z.string().nullable()
|
|
703
705
|
});
|
|
706
|
+
var AlertsResponseSchema = zod.z.array(AlertRowSchema);
|
|
704
707
|
var AlertCreateSchema = zod.z.object({
|
|
705
|
-
|
|
708
|
+
type: AlertTypeSchema,
|
|
709
|
+
options: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
706
710
|
email_delivery: zod.z.boolean(),
|
|
707
711
|
sms_delivery: zod.z.boolean(),
|
|
708
712
|
source_type: AlertSourceTypeSchema.optional(),
|
|
709
|
-
source_id: zod.z.
|
|
710
|
-
})
|
|
713
|
+
source_id: zod.z.string().nullable().optional()
|
|
714
|
+
});
|
|
711
715
|
var AlertUpdateSchema = zod.z.object({
|
|
712
|
-
options: zod.z.
|
|
716
|
+
options: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
713
717
|
email_delivery: zod.z.boolean(),
|
|
714
718
|
sms_delivery: zod.z.boolean(),
|
|
715
719
|
source_type: AlertSourceTypeSchema.optional(),
|
|
716
|
-
source_id: zod.z.
|
|
717
|
-
})
|
|
720
|
+
source_id: zod.z.string().nullable().optional()
|
|
721
|
+
});
|
|
718
722
|
var AlertDestinationsUpdateSchema = AlertDestinationsSchema;
|
|
719
|
-
var
|
|
720
|
-
|
|
723
|
+
var NotificationRowSchema = zod.z.object({
|
|
724
|
+
id: zod.z.string().uuid(),
|
|
725
|
+
user_id: zod.z.string().uuid(),
|
|
726
|
+
alert_id: zod.z.string().uuid().nullable(),
|
|
727
|
+
alert_type: AlertTypeSchema,
|
|
728
|
+
message: zod.z.string(),
|
|
729
|
+
is_read: zod.z.boolean(),
|
|
730
|
+
created_at: zod.z.string().nullable()
|
|
721
731
|
});
|
|
722
732
|
var NotificationSchema = zod.z.object({
|
|
723
|
-
|
|
724
|
-
// Core Identifiers
|
|
725
|
-
// ========================================
|
|
726
|
-
id: zod.z.number().int().positive(),
|
|
727
|
-
// User ID - links notification to specific user
|
|
733
|
+
id: zod.z.string().uuid(),
|
|
728
734
|
user_id: zod.z.string(),
|
|
729
|
-
|
|
730
|
-
alert_id: zod.z.number().int().positive(),
|
|
731
|
-
// ========================================
|
|
732
|
-
// Notification Content
|
|
733
|
-
// ========================================
|
|
735
|
+
alert_id: zod.z.string().uuid().nullable(),
|
|
734
736
|
message: zod.z.string(),
|
|
735
|
-
// ========================================
|
|
736
|
-
// Alert Reference
|
|
737
|
-
// ========================================
|
|
738
|
-
// Links to Alert domain - uses same AlertType enum
|
|
739
737
|
alert_type: AlertTypeSchema,
|
|
740
|
-
// ========================================
|
|
741
|
-
// Read Status
|
|
742
|
-
// ========================================
|
|
743
|
-
// Tracks whether user has read this notification
|
|
744
738
|
is_read: zod.z.boolean().default(false),
|
|
745
|
-
// ========================================
|
|
746
|
-
// Timestamps
|
|
747
|
-
// ========================================
|
|
748
|
-
// RFC 3339 datetime string (e.g., "2018-01-01T16:54:15Z")
|
|
749
739
|
created_at: zod.z.string()
|
|
750
740
|
});
|
|
751
|
-
var NotificationsResponseSchema = zod.z.
|
|
752
|
-
|
|
741
|
+
var NotificationsResponseSchema = zod.z.array(NotificationRowSchema);
|
|
742
|
+
var NotificationPreferencesRowSchema = zod.z.object({
|
|
743
|
+
user_id: zod.z.string().uuid(),
|
|
744
|
+
email_notifications: zod.z.boolean(),
|
|
745
|
+
push_notifications: zod.z.boolean(),
|
|
746
|
+
frequency: zod.z.enum(["realtime", "daily", "weekly"]),
|
|
747
|
+
updated_at: zod.z.string().nullable()
|
|
753
748
|
});
|
|
754
749
|
var NotificationCreateSchemaAdmin = zod.z.object({
|
|
755
750
|
message: zod.z.string(),
|
|
@@ -776,34 +771,28 @@ var NotificationPreferencesUpdateSchema = zod.z.object({
|
|
|
776
771
|
pushNotifications: zod.z.boolean().optional(),
|
|
777
772
|
frequency: NotificationFrequencySchema.optional()
|
|
778
773
|
});
|
|
774
|
+
var PartnerRowSchema = zod.z.object({
|
|
775
|
+
id: zod.z.string().uuid(),
|
|
776
|
+
domain: zod.z.string(),
|
|
777
|
+
product_name: zod.z.string(),
|
|
778
|
+
browser_title: zod.z.string(),
|
|
779
|
+
partner_alerts_enabled: zod.z.boolean(),
|
|
780
|
+
demo: zod.z.boolean(),
|
|
781
|
+
modules: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
782
|
+
featured_searches: zod.z.array(zod.z.unknown()),
|
|
783
|
+
created_at: zod.z.string().nullable()
|
|
784
|
+
});
|
|
779
785
|
var PartnerSchema = zod.z.object({
|
|
780
|
-
|
|
781
|
-
// Core Identifiers
|
|
782
|
-
// ========================================
|
|
783
|
-
id: zod.z.number().int().positive(),
|
|
784
|
-
// ========================================
|
|
785
|
-
// Partner Configuration
|
|
786
|
-
// ========================================
|
|
786
|
+
id: zod.z.string().uuid(),
|
|
787
787
|
domain: zod.z.string(),
|
|
788
788
|
product_name: zod.z.string(),
|
|
789
789
|
browser_title: zod.z.string(),
|
|
790
|
-
// ========================================
|
|
791
|
-
// Feature Flags
|
|
792
|
-
// ========================================
|
|
793
790
|
partner_alerts_enabled: zod.z.boolean(),
|
|
794
791
|
demo: zod.z.boolean(),
|
|
795
|
-
// ========================================
|
|
796
|
-
// Dynamic Configuration Objects
|
|
797
|
-
// ========================================
|
|
798
|
-
// Modules contains partner-specific feature configuration
|
|
799
|
-
// Structure varies by partner (aggregation, mobile, etc.)
|
|
800
792
|
modules: zod.z.object({}).passthrough(),
|
|
801
|
-
// Featured searches configuration array
|
|
802
793
|
featured_searches: zod.z.array(zod.z.unknown())
|
|
803
794
|
});
|
|
804
|
-
var PartnersResponseSchema = zod.z.
|
|
805
|
-
partners: zod.z.array(PartnerSchema)
|
|
806
|
-
});
|
|
795
|
+
var PartnersResponseSchema = zod.z.array(PartnerRowSchema);
|
|
807
796
|
var PartnerCreateSchemaAdmin = zod.z.object({
|
|
808
797
|
domain: zod.z.string(),
|
|
809
798
|
product_name: zod.z.string(),
|
|
@@ -825,7 +814,7 @@ var PartnerUpdateSchemaAdmin = zod.z.object({
|
|
|
825
814
|
});
|
|
826
815
|
var PartnerUpdateSchemaUser = zod.z.never();
|
|
827
816
|
var PartnerDeleteSchema = zod.z.object({
|
|
828
|
-
id: zod.z.
|
|
817
|
+
id: zod.z.string().uuid()
|
|
829
818
|
});
|
|
830
819
|
var ExpenseSchema = zod.z.object({
|
|
831
820
|
// ========================================
|
|
@@ -841,9 +830,13 @@ var ExpenseSchema = zod.z.object({
|
|
|
841
830
|
// STRING with decimal format: "1.74", "102.19", "1219.83"
|
|
842
831
|
amount: zod.z.string().regex(/^\d+\.\d{2}$/)
|
|
843
832
|
});
|
|
844
|
-
var
|
|
845
|
-
|
|
833
|
+
var ExpenseRowSchema = zod.z.object({
|
|
834
|
+
user_id: zod.z.string().nullable(),
|
|
835
|
+
tag: zod.z.string().nullable(),
|
|
836
|
+
amount: zod.z.number().nullable()
|
|
846
837
|
});
|
|
838
|
+
var ExpensesViewResponseSchema = zod.z.array(ExpenseRowSchema);
|
|
839
|
+
var ExpensesResponseSchema = zod.z.array(ExpenseSchema);
|
|
847
840
|
var ExpenseCreateSchemaAdmin = zod.z.object({
|
|
848
841
|
tag: zod.z.string(),
|
|
849
842
|
amount: zod.z.string()
|
|
@@ -1015,6 +1008,13 @@ var CashEdgeLoginResponseSchema = zod.z.object({
|
|
|
1015
1008
|
expires_at: zod.z.string().optional(),
|
|
1016
1009
|
status: zod.z.string().optional()
|
|
1017
1010
|
});
|
|
1011
|
+
function useAuth() {
|
|
1012
|
+
const context = react.useContext(AuthContext);
|
|
1013
|
+
if (!context) {
|
|
1014
|
+
throw new Error("useAuth must be used within an AuthProvider");
|
|
1015
|
+
}
|
|
1016
|
+
return context;
|
|
1017
|
+
}
|
|
1018
1018
|
|
|
1019
1019
|
// src/utils/chartUtils.ts
|
|
1020
1020
|
function formatCurrency(value) {
|
|
@@ -1315,33 +1315,37 @@ exports.AccountCreateSchema = AccountCreateSchema;
|
|
|
1315
1315
|
exports.AccountCreateSchemaAdmin = AccountCreateSchemaAdmin;
|
|
1316
1316
|
exports.AccountCreateSchemaUser = AccountCreateSchemaUser;
|
|
1317
1317
|
exports.AccountDeleteSchema = AccountDeleteSchema;
|
|
1318
|
-
exports.AccountErrorSchema = AccountErrorSchema;
|
|
1319
1318
|
exports.AccountSchema = AccountSchema;
|
|
1320
1319
|
exports.AccountStateSchema = AccountStateSchema;
|
|
1321
1320
|
exports.AccountTypeSchema = AccountTypeSchema;
|
|
1322
1321
|
exports.AccountUpdateSchema = AccountUpdateSchema;
|
|
1322
|
+
exports.AccountWithInstitutionSchema = AccountWithInstitutionSchema;
|
|
1323
1323
|
exports.AccountsResponseSchema = AccountsResponseSchema;
|
|
1324
|
+
exports.AccountsWithInstitutionResponseSchema = AccountsWithInstitutionResponseSchema;
|
|
1324
1325
|
exports.AggregationTypeSchema = AggregationTypeSchema;
|
|
1325
1326
|
exports.AlertCreateSchema = AlertCreateSchema;
|
|
1326
1327
|
exports.AlertDestinationsSchema = AlertDestinationsSchema;
|
|
1327
1328
|
exports.AlertDestinationsUpdateSchema = AlertDestinationsUpdateSchema;
|
|
1328
|
-
exports.
|
|
1329
|
+
exports.AlertRowSchema = AlertRowSchema;
|
|
1329
1330
|
exports.AlertSourceTypeSchema = AlertSourceTypeSchema;
|
|
1330
1331
|
exports.AlertTypeSchema = AlertTypeSchema;
|
|
1331
1332
|
exports.AlertUpdateSchema = AlertUpdateSchema;
|
|
1332
1333
|
exports.AlertsResponseSchema = AlertsResponseSchema;
|
|
1333
1334
|
exports.AppModeContext = AppModeContext;
|
|
1334
1335
|
exports.AppModeProvider = AppModeProvider;
|
|
1336
|
+
exports.AuthContext = AuthContext;
|
|
1337
|
+
exports.AuthProvider = AuthProvider;
|
|
1335
1338
|
exports.AuthenticateRequestSchema = AuthenticateRequestSchema;
|
|
1336
1339
|
exports.AuthenticateResponseSchema = AuthenticateResponseSchema;
|
|
1340
|
+
exports.BudgetAccountSchema = BudgetAccountSchema;
|
|
1337
1341
|
exports.BudgetCreateSchema = BudgetCreateSchema;
|
|
1338
|
-
exports.BudgetLinksSchema = BudgetLinksSchema;
|
|
1339
1342
|
exports.BudgetSchema = BudgetSchema;
|
|
1340
1343
|
exports.BudgetStateSchema = BudgetStateSchema;
|
|
1344
|
+
exports.BudgetTagSchema = BudgetTagSchema;
|
|
1341
1345
|
exports.BudgetUpdateSchema = BudgetUpdateSchema;
|
|
1346
|
+
exports.BudgetWithRelationsSchema = BudgetWithRelationsSchema;
|
|
1342
1347
|
exports.BudgetsResponseSchema = BudgetsResponseSchema;
|
|
1343
1348
|
exports.CHART_DIMENSIONS = CHART_DIMENSIONS;
|
|
1344
|
-
exports.CashEdgeAccountTypeSchema = CashEdgeAccountTypeSchema;
|
|
1345
1349
|
exports.CashEdgeLoginRequestSchema = CashEdgeLoginRequestSchema;
|
|
1346
1350
|
exports.CashEdgeLoginResponseSchema = CashEdgeLoginResponseSchema;
|
|
1347
1351
|
exports.CashflowEventCreateSchema = CashflowEventCreateSchema;
|
|
@@ -1351,29 +1355,33 @@ exports.CashflowEventTypeSchema = CashflowEventTypeSchema;
|
|
|
1351
1355
|
exports.CashflowEventUpdateSchema = CashflowEventUpdateSchema;
|
|
1352
1356
|
exports.CashflowEventsResponseSchema = CashflowEventsResponseSchema;
|
|
1353
1357
|
exports.ClassifyAccountsRequestSchema = ClassifyAccountsRequestSchema;
|
|
1354
|
-
exports.
|
|
1358
|
+
exports.DefaultTagRowSchema = DefaultTagRowSchema;
|
|
1359
|
+
exports.DefaultTagsResponseSchema = DefaultTagsResponseSchema;
|
|
1360
|
+
exports.DisplayAccountTypeSchema = DisplayAccountTypeSchema;
|
|
1355
1361
|
exports.ExpenseCreateSchemaAdmin = ExpenseCreateSchemaAdmin;
|
|
1356
1362
|
exports.ExpenseCreateSchemaUser = ExpenseCreateSchemaUser;
|
|
1357
1363
|
exports.ExpenseDeleteSchema = ExpenseDeleteSchema;
|
|
1364
|
+
exports.ExpenseRowSchema = ExpenseRowSchema;
|
|
1358
1365
|
exports.ExpenseSchema = ExpenseSchema;
|
|
1359
1366
|
exports.ExpenseSearchParamsSchema = ExpenseSearchParamsSchema;
|
|
1360
1367
|
exports.ExpenseUpdateSchemaAdmin = ExpenseUpdateSchemaAdmin;
|
|
1361
1368
|
exports.ExpenseUpdateSchemaUser = ExpenseUpdateSchemaUser;
|
|
1362
1369
|
exports.ExpensesResponseSchema = ExpensesResponseSchema;
|
|
1370
|
+
exports.ExpensesViewResponseSchema = ExpensesViewResponseSchema;
|
|
1371
|
+
exports.FinancialInstitutionRowSchema = FinancialInstitutionRowSchema;
|
|
1363
1372
|
exports.FinancialInstitutionSchema = FinancialInstitutionSchema;
|
|
1373
|
+
exports.GoalAccountRowSchema = GoalAccountRowSchema;
|
|
1364
1374
|
exports.GoalCreateSchema = GoalCreateSchema;
|
|
1375
|
+
exports.GoalImageSchema = GoalImageSchema;
|
|
1365
1376
|
exports.GoalImagesResponseSchema = GoalImagesResponseSchema;
|
|
1366
|
-
exports.GoalLinksSchema = GoalLinksSchema;
|
|
1367
1377
|
exports.GoalStateSchema = GoalStateSchema;
|
|
1368
1378
|
exports.GoalStatusSchema = GoalStatusSchema;
|
|
1369
1379
|
exports.GoalUpdateSchema = GoalUpdateSchema;
|
|
1380
|
+
exports.InstitutionCreateSchema = InstitutionCreateSchema;
|
|
1370
1381
|
exports.InstitutionLoginParameterSchema = InstitutionLoginParameterSchema;
|
|
1371
1382
|
exports.InstitutionSchema = InstitutionSchema;
|
|
1372
1383
|
exports.InstitutionSearchMetaSchema = InstitutionSearchMetaSchema;
|
|
1373
1384
|
exports.InstitutionsResponseSchema = InstitutionsResponseSchema;
|
|
1374
|
-
exports.InvestmentHoldingSchema = InvestmentHoldingSchema;
|
|
1375
|
-
exports.InvestmentSchema = InvestmentSchema;
|
|
1376
|
-
exports.InvestmentsResponseSchema = InvestmentsResponseSchema;
|
|
1377
1385
|
exports.MFARequestSchema = MFARequestSchema;
|
|
1378
1386
|
exports.MFAResponseSchema = MFAResponseSchema;
|
|
1379
1387
|
exports.NetWorthAccountCreateSchema = NetWorthAccountCreateSchema;
|
|
@@ -1389,29 +1397,27 @@ exports.NetWorthSchema = NetWorthSchema;
|
|
|
1389
1397
|
exports.NotificationCreateSchemaAdmin = NotificationCreateSchemaAdmin;
|
|
1390
1398
|
exports.NotificationCreateSchemaUser = NotificationCreateSchemaUser;
|
|
1391
1399
|
exports.NotificationFrequencySchema = NotificationFrequencySchema;
|
|
1400
|
+
exports.NotificationPreferencesRowSchema = NotificationPreferencesRowSchema;
|
|
1392
1401
|
exports.NotificationPreferencesSchema = NotificationPreferencesSchema;
|
|
1393
1402
|
exports.NotificationPreferencesUpdateSchema = NotificationPreferencesUpdateSchema;
|
|
1403
|
+
exports.NotificationRowSchema = NotificationRowSchema;
|
|
1394
1404
|
exports.NotificationSchema = NotificationSchema;
|
|
1395
1405
|
exports.NotificationUpdateSchemaAdmin = NotificationUpdateSchemaAdmin;
|
|
1396
1406
|
exports.NotificationUpdateSchemaUser = NotificationUpdateSchemaUser;
|
|
1397
1407
|
exports.NotificationsResponseSchema = NotificationsResponseSchema;
|
|
1398
|
-
exports.OtherBalanceSchema = OtherBalanceSchema;
|
|
1399
1408
|
exports.PartnerCreateSchemaAdmin = PartnerCreateSchemaAdmin;
|
|
1400
1409
|
exports.PartnerCreateSchemaUser = PartnerCreateSchemaUser;
|
|
1401
1410
|
exports.PartnerDeleteSchema = PartnerDeleteSchema;
|
|
1411
|
+
exports.PartnerRowSchema = PartnerRowSchema;
|
|
1402
1412
|
exports.PartnerSchema = PartnerSchema;
|
|
1403
1413
|
exports.PartnerUpdateSchemaAdmin = PartnerUpdateSchemaAdmin;
|
|
1404
1414
|
exports.PartnerUpdateSchemaUser = PartnerUpdateSchemaUser;
|
|
1405
1415
|
exports.PartnersResponseSchema = PartnersResponseSchema;
|
|
1406
|
-
exports.
|
|
1416
|
+
exports.PayoffGoalRowSchema = PayoffGoalRowSchema;
|
|
1407
1417
|
exports.PayoffGoalsResponseSchema = PayoffGoalsResponseSchema;
|
|
1408
|
-
exports.PendingAccountDeleteSchema = PendingAccountDeleteSchema;
|
|
1409
|
-
exports.PendingAccountSchema = PendingAccountSchema;
|
|
1410
|
-
exports.PendingAccountsResponseSchema = PendingAccountsResponseSchema;
|
|
1411
|
-
exports.PreferredBalanceTypeSchema = PreferredBalanceTypeSchema;
|
|
1412
1418
|
exports.RecurrenceFrequencySchema = RecurrenceFrequencySchema;
|
|
1413
1419
|
exports.SPRING_CONFIG = SPRING_CONFIG;
|
|
1414
|
-
exports.
|
|
1420
|
+
exports.SavingsGoalRowSchema = SavingsGoalRowSchema;
|
|
1415
1421
|
exports.SavingsGoalsResponseSchema = SavingsGoalsResponseSchema;
|
|
1416
1422
|
exports.TagColorSchema = TagColorSchema;
|
|
1417
1423
|
exports.TagCreateSchemaAdmin = TagCreateSchemaAdmin;
|
|
@@ -1422,13 +1428,11 @@ exports.TagUsageDataPointSchema = TagUsageDataPointSchema;
|
|
|
1422
1428
|
exports.TagUsageReportSchema = TagUsageReportSchema;
|
|
1423
1429
|
exports.TagUsageStatSchema = TagUsageStatSchema;
|
|
1424
1430
|
exports.TagUsageStatsSchema = TagUsageStatsSchema;
|
|
1425
|
-
exports.TagsResponseSchema = TagsResponseSchema;
|
|
1426
1431
|
exports.TagsUpdateSchema = TagsUpdateSchema;
|
|
1427
1432
|
exports.TransactionCreateSchema = TransactionCreateSchema;
|
|
1428
1433
|
exports.TransactionCreateSchemaAdmin = TransactionCreateSchemaAdmin;
|
|
1429
1434
|
exports.TransactionCreateSchemaUser = TransactionCreateSchemaUser;
|
|
1430
1435
|
exports.TransactionDeleteSchema = TransactionDeleteSchema;
|
|
1431
|
-
exports.TransactionLinksSchema = TransactionLinksSchema;
|
|
1432
1436
|
exports.TransactionSchema = TransactionSchema;
|
|
1433
1437
|
exports.TransactionSearchParamsSchema = TransactionSearchParamsSchema;
|
|
1434
1438
|
exports.TransactionTagSchema = TransactionTagSchema;
|
|
@@ -1438,19 +1442,23 @@ exports.TransactionTaggingSplitItemSchema = TransactionTaggingSplitItemSchema;
|
|
|
1438
1442
|
exports.TransactionTaggingSplitSchema = TransactionTaggingSplitSchema;
|
|
1439
1443
|
exports.TransactionTypeSchema = TransactionTypeSchema;
|
|
1440
1444
|
exports.TransactionUpdateSchema = TransactionUpdateSchema;
|
|
1445
|
+
exports.TransactionWithTagsSchema = TransactionWithTagsSchema;
|
|
1441
1446
|
exports.TransactionsResponseSchema = TransactionsResponseSchema;
|
|
1442
1447
|
exports.UpdateCredentialsRequestSchema = UpdateCredentialsRequestSchema;
|
|
1443
1448
|
exports.UpdateCredentialsResponseSchema = UpdateCredentialsResponseSchema;
|
|
1444
1449
|
exports.UserCreateSchema = UserCreateSchema;
|
|
1445
1450
|
exports.UserCreateSchemaAdmin = UserCreateSchemaAdmin;
|
|
1446
1451
|
exports.UserCreateSchemaUser = UserCreateSchemaUser;
|
|
1452
|
+
exports.UserProfileRowSchema = UserProfileRowSchema;
|
|
1447
1453
|
exports.UserSchema = UserSchema;
|
|
1448
1454
|
exports.UserSexSchema = UserSexSchema;
|
|
1449
|
-
exports.
|
|
1455
|
+
exports.UserTagRowSchema = UserTagRowSchema;
|
|
1456
|
+
exports.UserTagsResponseSchema = UserTagsResponseSchema;
|
|
1450
1457
|
exports.UserUpdateSchema = UserUpdateSchema;
|
|
1451
1458
|
exports.UserUpdateSchemaAdmin = UserUpdateSchemaAdmin;
|
|
1452
1459
|
exports.UserUpdateSchemaUser = UserUpdateSchemaUser;
|
|
1453
1460
|
exports.arcVariants = arcVariants;
|
|
1461
|
+
exports.createSupabaseClient = createSupabaseClient;
|
|
1454
1462
|
exports.createTransition = createTransition;
|
|
1455
1463
|
exports.fadeVariants = fadeVariants;
|
|
1456
1464
|
exports.formatCurrency = formatCurrency;
|
|
@@ -1463,7 +1471,9 @@ exports.listContainerVariants = listContainerVariants;
|
|
|
1463
1471
|
exports.listItemVariants = listItemVariants;
|
|
1464
1472
|
exports.panelVariants = panelVariants;
|
|
1465
1473
|
exports.progressVariants = progressVariants;
|
|
1474
|
+
exports.supabase = supabase;
|
|
1466
1475
|
exports.textVariants = textVariants;
|
|
1467
1476
|
exports.useAppMode = useAppMode;
|
|
1477
|
+
exports.useAuth = useAuth;
|
|
1468
1478
|
//# sourceMappingURL=index.cjs.map
|
|
1469
1479
|
//# sourceMappingURL=index.cjs.map
|