@tuturuuu/internal-api 0.0.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/ai-memory.d.ts +76 -0
  2. package/dist/ai-memory.d.ts.map +1 -0
  3. package/dist/ai-memory.js +59 -0
  4. package/dist/ai.d.ts +67 -3
  5. package/dist/ai.d.ts.map +1 -1
  6. package/dist/ai.js +121 -0
  7. package/dist/auth.d.ts +143 -1
  8. package/dist/auth.d.ts.map +1 -1
  9. package/dist/auth.js +143 -0
  10. package/dist/calendar.d.ts +60 -1
  11. package/dist/calendar.d.ts.map +1 -1
  12. package/dist/calendar.js +27 -0
  13. package/dist/chat-conversations.d.ts +81 -0
  14. package/dist/chat-conversations.d.ts.map +1 -0
  15. package/dist/chat-conversations.js +384 -0
  16. package/dist/chat-internal.d.ts +11 -0
  17. package/dist/chat-internal.d.ts.map +1 -0
  18. package/dist/chat-internal.js +39 -0
  19. package/dist/chat-legacy.d.ts +23 -0
  20. package/dist/chat-legacy.d.ts.map +1 -0
  21. package/dist/chat-legacy.js +68 -0
  22. package/dist/chat-types.d.ts +262 -0
  23. package/dist/chat-types.d.ts.map +1 -0
  24. package/dist/chat-types.js +2 -0
  25. package/dist/chat.d.ts +3 -45
  26. package/dist/chat.d.ts.map +1 -1
  27. package/dist/chat.js +17 -65
  28. package/dist/client.d.ts +5 -0
  29. package/dist/client.d.ts.map +1 -1
  30. package/dist/client.js +109 -8
  31. package/dist/education.d.ts +288 -2
  32. package/dist/education.d.ts.map +1 -1
  33. package/dist/education.js +176 -0
  34. package/dist/external-project-team.d.ts +51 -0
  35. package/dist/external-project-team.d.ts.map +1 -0
  36. package/dist/external-project-team.js +137 -0
  37. package/dist/external-projects.d.ts +89 -9
  38. package/dist/external-projects.d.ts.map +1 -1
  39. package/dist/external-projects.js +80 -31
  40. package/dist/finance.d.ts +491 -3
  41. package/dist/finance.d.ts.map +1 -1
  42. package/dist/finance.js +611 -1
  43. package/dist/hive.d.ts +739 -0
  44. package/dist/hive.d.ts.map +1 -0
  45. package/dist/hive.js +333 -0
  46. package/dist/index.d.ts +33 -19
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +361 -8
  49. package/dist/infrastructure.d.ts +1085 -1
  50. package/dist/infrastructure.d.ts.map +1 -1
  51. package/dist/infrastructure.js +652 -0
  52. package/dist/inventory.d.ts +355 -0
  53. package/dist/inventory.d.ts.map +1 -0
  54. package/dist/inventory.js +268 -0
  55. package/dist/mail.d.ts +125 -0
  56. package/dist/mail.d.ts.map +1 -1
  57. package/dist/mail.js +112 -1
  58. package/dist/meet.d.ts +54 -0
  59. package/dist/meet.d.ts.map +1 -0
  60. package/dist/meet.js +37 -0
  61. package/dist/mind.d.ts +55 -0
  62. package/dist/mind.d.ts.map +1 -0
  63. package/dist/mind.js +84 -0
  64. package/dist/posts.d.ts +33 -0
  65. package/dist/posts.d.ts.map +1 -1
  66. package/dist/posts.js +42 -0
  67. package/dist/promotions.d.ts +54 -0
  68. package/dist/promotions.d.ts.map +1 -1
  69. package/dist/promotions.js +52 -0
  70. package/dist/settings.d.ts +28 -1
  71. package/dist/settings.d.ts.map +1 -1
  72. package/dist/settings.js +68 -0
  73. package/dist/storage.d.ts +33 -21
  74. package/dist/storage.d.ts.map +1 -1
  75. package/dist/storage.js +53 -32
  76. package/dist/tasks-scheduling.d.ts +29 -0
  77. package/dist/tasks-scheduling.d.ts.map +1 -1
  78. package/dist/tasks-scheduling.js +20 -0
  79. package/dist/tasks.d.ts +239 -4
  80. package/dist/tasks.d.ts.map +1 -1
  81. package/dist/tasks.js +213 -0
  82. package/dist/teach.d.ts +130 -0
  83. package/dist/teach.d.ts.map +1 -0
  84. package/dist/teach.js +110 -0
  85. package/dist/topic-announcements.d.ts +235 -0
  86. package/dist/topic-announcements.d.ts.map +1 -0
  87. package/dist/topic-announcements.js +182 -0
  88. package/dist/tulearn.d.ts +223 -0
  89. package/dist/tulearn.d.ts.map +1 -0
  90. package/dist/tulearn.js +97 -0
  91. package/dist/tutoring.d.ts +152 -0
  92. package/dist/tutoring.d.ts.map +1 -0
  93. package/dist/tutoring.js +58 -0
  94. package/dist/user-group-activity.d.ts +54 -0
  95. package/dist/user-group-activity.d.ts.map +1 -0
  96. package/dist/user-group-activity.js +11 -0
  97. package/dist/user-groups.d.ts +35 -0
  98. package/dist/user-groups.d.ts.map +1 -0
  99. package/dist/user-groups.js +84 -0
  100. package/dist/users.d.ts +101 -1
  101. package/dist/users.d.ts.map +1 -1
  102. package/dist/users.js +178 -0
  103. package/dist/workspace-config-ids.d.ts +9 -0
  104. package/dist/workspace-config-ids.d.ts.map +1 -0
  105. package/dist/workspace-config-ids.js +11 -0
  106. package/dist/workspace-configs.d.ts +1 -7
  107. package/dist/workspace-configs.d.ts.map +1 -1
  108. package/dist/workspace-configs.js +14 -10
  109. package/dist/workspace-user-audit.d.ts +1 -0
  110. package/dist/workspace-user-audit.d.ts.map +1 -1
  111. package/dist/workspaces.d.ts +57 -0
  112. package/dist/workspaces.d.ts.map +1 -1
  113. package/dist/workspaces.js +58 -1
  114. package/package.json +65 -7
package/dist/finance.js CHANGED
@@ -2,17 +2,72 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.listWallets = listWallets;
4
4
  exports.getWallet = getWallet;
5
+ exports.createWallet = createWallet;
6
+ exports.updateWallet = updateWallet;
7
+ exports.deleteWallet = deleteWallet;
8
+ exports.getWalletCreditSummary = getWalletCreditSummary;
9
+ exports.listWalletRoleAccess = listWalletRoleAccess;
10
+ exports.addWalletRoleAccess = addWalletRoleAccess;
11
+ exports.updateWalletRoleAccess = updateWalletRoleAccess;
12
+ exports.removeWalletRoleAccess = removeWalletRoleAccess;
13
+ exports.getWalletInterestSummary = getWalletInterestSummary;
14
+ exports.createWalletInterestConfig = createWalletInterestConfig;
15
+ exports.updateWalletInterestConfig = updateWalletInterestConfig;
16
+ exports.deleteWalletInterestConfig = deleteWalletInterestConfig;
17
+ exports.createWalletInterestRate = createWalletInterestRate;
5
18
  exports.listBudgets = listBudgets;
6
19
  exports.getBudgetStatus = getBudgetStatus;
7
20
  exports.createBudget = createBudget;
8
21
  exports.updateBudget = updateBudget;
9
22
  exports.deleteBudget = deleteBudget;
23
+ exports.listFinanceInvoices = listFinanceInvoices;
24
+ exports.createFinanceInvoice = createFinanceInvoice;
25
+ exports.getInvoiceAnalytics = getInvoiceAnalytics;
26
+ exports.createSubscriptionFinanceInvoice = createSubscriptionFinanceInvoice;
27
+ exports.updateFinanceInvoice = updateFinanceInvoice;
28
+ exports.deleteInvoice = deleteInvoice;
29
+ exports.listPendingFinanceInvoices = listPendingFinanceInvoices;
30
+ exports.getPendingFinanceInvoicesCurrentMonthCount = getPendingFinanceInvoicesCurrentMonthCount;
31
+ exports.getSubscriptionInvoiceContext = getSubscriptionInvoiceContext;
32
+ exports.listDebtLoans = listDebtLoans;
33
+ exports.getDebtLoanSummary = getDebtLoanSummary;
34
+ exports.getDebtLoan = getDebtLoan;
35
+ exports.createDebtLoan = createDebtLoan;
36
+ exports.updateDebtLoan = updateDebtLoan;
37
+ exports.deleteDebtLoan = deleteDebtLoan;
10
38
  exports.listTransactionCategories = listTransactionCategories;
39
+ exports.getTransactionCategory = getTransactionCategory;
40
+ exports.createTransactionCategory = createTransactionCategory;
41
+ exports.updateTransactionCategory = updateTransactionCategory;
42
+ exports.deleteTransactionCategory = deleteTransactionCategory;
43
+ exports.listTransactions = listTransactions;
44
+ exports.getTransaction = getTransaction;
45
+ exports.createTransaction = createTransaction;
46
+ exports.updateTransaction = updateTransaction;
47
+ exports.deleteTransaction = deleteTransaction;
48
+ exports.createTransfer = createTransfer;
49
+ exports.updateTransfer = updateTransfer;
50
+ exports.listTransactionTags = listTransactionTags;
51
+ exports.listTransactionTagLinks = listTransactionTagLinks;
52
+ exports.listTransactionTagStats = listTransactionTagStats;
53
+ exports.createTransactionTag = createTransactionTag;
54
+ exports.updateTransactionTag = updateTransactionTag;
55
+ exports.deleteTransactionTag = deleteTransactionTag;
56
+ exports.listFinanceFilterUsers = listFinanceFilterUsers;
57
+ exports.listTransactionExportRows = listTransactionExportRows;
58
+ exports.importMoneyLoverTransactions = importMoneyLoverTransactions;
11
59
  exports.listRecurringTransactions = listRecurringTransactions;
12
60
  exports.listUpcomingRecurringTransactions = listUpcomingRecurringTransactions;
13
61
  exports.createRecurringTransaction = createRecurringTransaction;
14
62
  exports.updateRecurringTransaction = updateRecurringTransaction;
15
63
  exports.deleteRecurringTransaction = deleteRecurringTransaction;
64
+ exports.getFinanceOverviewMetrics = getFinanceOverviewMetrics;
65
+ exports.listFinanceDailyIncomeExpense = listFinanceDailyIncomeExpense;
66
+ exports.listFinanceMonthlyIncomeExpense = listFinanceMonthlyIncomeExpense;
67
+ exports.listFinanceIncomeExpenseSummary = listFinanceIncomeExpenseSummary;
68
+ exports.getFinanceBalanceAtDate = getFinanceBalanceAtDate;
69
+ exports.listFinanceBalanceTrend = listFinanceBalanceTrend;
70
+ exports.listFinanceCategoryBreakdown = listFinanceCategoryBreakdown;
16
71
  exports.getTransactionStats = getTransactionStats;
17
72
  exports.getCategoryBreakdown = getCategoryBreakdown;
18
73
  exports.getSpendingTrends = getSpendingTrends;
@@ -25,10 +80,126 @@ async function listWallets(workspaceId, options) {
25
80
  }
26
81
  async function getWallet(workspaceId, walletId, options) {
27
82
  const client = (0, client_1.getInternalApiClient)(options);
28
- return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}`, {
83
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}`, {
29
84
  cache: 'no-store',
30
85
  });
31
86
  }
87
+ async function createWallet(workspaceId, payload, options) {
88
+ const client = (0, client_1.getInternalApiClient)(options);
89
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets`, {
90
+ method: 'POST',
91
+ headers: {
92
+ 'Content-Type': 'application/json',
93
+ },
94
+ body: JSON.stringify(payload),
95
+ cache: 'no-store',
96
+ });
97
+ }
98
+ async function updateWallet(workspaceId, walletId, payload, options) {
99
+ const client = (0, client_1.getInternalApiClient)(options);
100
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}`, {
101
+ method: 'PUT',
102
+ headers: {
103
+ 'Content-Type': 'application/json',
104
+ },
105
+ body: JSON.stringify(payload),
106
+ cache: 'no-store',
107
+ });
108
+ }
109
+ async function deleteWallet(workspaceId, walletId, options) {
110
+ const client = (0, client_1.getInternalApiClient)(options);
111
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}`, {
112
+ method: 'DELETE',
113
+ cache: 'no-store',
114
+ });
115
+ }
116
+ async function getWalletCreditSummary(workspaceId, walletId, options) {
117
+ const client = (0, client_1.getInternalApiClient)(options);
118
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/credit-summary`, {
119
+ cache: 'no-store',
120
+ });
121
+ }
122
+ async function listWalletRoleAccess(workspaceId, walletId, options) {
123
+ const client = (0, client_1.getInternalApiClient)(options);
124
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/roles`, {
125
+ cache: 'no-store',
126
+ });
127
+ }
128
+ async function addWalletRoleAccess(workspaceId, walletId, payload, options) {
129
+ const client = (0, client_1.getInternalApiClient)(options);
130
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/roles`, {
131
+ body: JSON.stringify(payload),
132
+ cache: 'no-store',
133
+ headers: {
134
+ 'Content-Type': 'application/json',
135
+ },
136
+ method: 'POST',
137
+ });
138
+ }
139
+ async function updateWalletRoleAccess(workspaceId, walletId, roleId, payload, options) {
140
+ const client = (0, client_1.getInternalApiClient)(options);
141
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/roles/${(0, client_1.encodePathSegment)(roleId)}`, {
142
+ body: JSON.stringify(payload),
143
+ cache: 'no-store',
144
+ headers: {
145
+ 'Content-Type': 'application/json',
146
+ },
147
+ method: 'PUT',
148
+ });
149
+ }
150
+ async function removeWalletRoleAccess(workspaceId, walletId, roleId, options) {
151
+ const client = (0, client_1.getInternalApiClient)(options);
152
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/roles/${(0, client_1.encodePathSegment)(roleId)}`, {
153
+ cache: 'no-store',
154
+ method: 'DELETE',
155
+ });
156
+ }
157
+ async function getWalletInterestSummary(workspaceId, walletId, options) {
158
+ const client = (0, client_1.getInternalApiClient)(options);
159
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/interest`, {
160
+ cache: 'no-store',
161
+ });
162
+ }
163
+ async function createWalletInterestConfig(workspaceId, walletId, payload, options) {
164
+ const client = (0, client_1.getInternalApiClient)(options);
165
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/interest`, {
166
+ body: JSON.stringify(payload),
167
+ cache: 'no-store',
168
+ headers: {
169
+ 'Content-Type': 'application/json',
170
+ },
171
+ method: 'POST',
172
+ });
173
+ }
174
+ async function updateWalletInterestConfig(workspaceId, walletId, payload, options) {
175
+ const client = (0, client_1.getInternalApiClient)(options);
176
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/interest/config`, {
177
+ body: JSON.stringify(payload),
178
+ cache: 'no-store',
179
+ headers: {
180
+ 'Content-Type': 'application/json',
181
+ },
182
+ method: 'PUT',
183
+ });
184
+ }
185
+ async function deleteWalletInterestConfig(workspaceId, walletId, options) {
186
+ const client = (0, client_1.getInternalApiClient)(options);
187
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/interest/config`, {
188
+ cache: 'no-store',
189
+ method: 'DELETE',
190
+ });
191
+ }
192
+ async function createWalletInterestRate(workspaceId, walletId, payload, options) {
193
+ const client = (0, client_1.getInternalApiClient)(options);
194
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/interest/rates`, {
195
+ body: JSON.stringify(payload),
196
+ cache: 'no-store',
197
+ headers: {
198
+ 'Content-Type': 'application/json',
199
+ },
200
+ method: 'POST',
201
+ });
202
+ }
32
203
  async function listBudgets(workspaceId, options) {
33
204
  const client = (0, client_1.getInternalApiClient)(options);
34
205
  return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/budgets`, {
@@ -41,6 +212,100 @@ async function getBudgetStatus(workspaceId, options) {
41
212
  cache: 'no-store',
42
213
  });
43
214
  }
215
+ function appendFinanceArrayParam(searchParams, key, value) {
216
+ if (!value) {
217
+ return;
218
+ }
219
+ const values = Array.isArray(value) ? value : [value];
220
+ for (const entry of values) {
221
+ if (entry) {
222
+ searchParams.append(key, entry);
223
+ }
224
+ }
225
+ }
226
+ function buildTransactionExportSearchParams(query) {
227
+ const searchParams = new URLSearchParams();
228
+ if (query.q)
229
+ searchParams.set('q', query.q);
230
+ if (query.page)
231
+ searchParams.set('page', query.page);
232
+ if (query.pageSize)
233
+ searchParams.set('pageSize', query.pageSize);
234
+ if (query.transactionType) {
235
+ searchParams.set('transactionType', query.transactionType);
236
+ }
237
+ if (query.start)
238
+ searchParams.set('start', query.start);
239
+ if (query.end)
240
+ searchParams.set('end', query.end);
241
+ appendFinanceArrayParam(searchParams, 'userIds', query.userIds);
242
+ appendFinanceArrayParam(searchParams, 'categoryIds', query.categoryIds);
243
+ appendFinanceArrayParam(searchParams, 'walletIds', query.walletIds);
244
+ appendFinanceArrayParam(searchParams, 'tagIds', query.tagIds);
245
+ const queryString = searchParams.toString();
246
+ return queryString ? `?${queryString}` : '';
247
+ }
248
+ function buildFinanceInvoicesSearchParams(query) {
249
+ const searchParams = new URLSearchParams();
250
+ if (query.q)
251
+ searchParams.set('q', query.q);
252
+ if (query.page)
253
+ searchParams.set('page', String(query.page));
254
+ if (query.pageSize)
255
+ searchParams.set('pageSize', String(query.pageSize));
256
+ if (query.start)
257
+ searchParams.set('start', query.start);
258
+ if (query.end)
259
+ searchParams.set('end', query.end);
260
+ appendFinanceArrayParam(searchParams, 'userIds', query.userIds);
261
+ appendFinanceArrayParam(searchParams, 'customerIds', query.customerIds);
262
+ appendFinanceArrayParam(searchParams, 'walletIds', query.walletIds);
263
+ const queryString = searchParams.toString();
264
+ return queryString ? `?${queryString}` : '';
265
+ }
266
+ function buildInvoiceAnalyticsSearchParams(query) {
267
+ const searchParams = new URLSearchParams();
268
+ appendFinanceArrayParam(searchParams, 'walletIds', query.walletIds);
269
+ appendFinanceArrayParam(searchParams, 'userIds', query.userIds);
270
+ if (query.startDate)
271
+ searchParams.set('start', query.startDate);
272
+ if (query.endDate)
273
+ searchParams.set('end', query.endDate);
274
+ if (query.granularity)
275
+ searchParams.set('granularity', query.granularity);
276
+ if (query.weekStartsOn !== undefined) {
277
+ searchParams.set('weekStartsOn', String(query.weekStartsOn));
278
+ }
279
+ const queryString = searchParams.toString();
280
+ return queryString ? `?${queryString}` : '';
281
+ }
282
+ function buildPendingFinanceInvoicesSearchParams(query) {
283
+ const searchParams = new URLSearchParams();
284
+ if (query.page)
285
+ searchParams.set('page', String(query.page));
286
+ if (query.pageSize)
287
+ searchParams.set('pageSize', String(query.pageSize));
288
+ if (query.q)
289
+ searchParams.set('q', query.q);
290
+ if (query.groupByUser !== undefined) {
291
+ searchParams.set('groupByUser', String(query.groupByUser));
292
+ }
293
+ if (query.currentMonthOnly !== undefined) {
294
+ searchParams.set('currentMonthOnly', String(query.currentMonthOnly));
295
+ }
296
+ appendFinanceArrayParam(searchParams, 'userIds', query.userIds);
297
+ const queryString = searchParams.toString();
298
+ return queryString ? `?${queryString}` : '';
299
+ }
300
+ function buildSubscriptionInvoiceContextSearchParams(query) {
301
+ const searchParams = new URLSearchParams({
302
+ month: query.month,
303
+ userId: query.userId,
304
+ });
305
+ appendFinanceArrayParam(searchParams, 'groupIds', query.groupIds);
306
+ const queryString = searchParams.toString();
307
+ return queryString ? `?${queryString}` : '';
308
+ }
44
309
  async function createBudget(workspaceId, payload, options) {
45
310
  const client = (0, client_1.getInternalApiClient)(options);
46
311
  return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/budgets`, {
@@ -70,12 +335,304 @@ async function deleteBudget(workspaceId, budgetId, options) {
70
335
  cache: 'no-store',
71
336
  });
72
337
  }
338
+ async function listFinanceInvoices(workspaceId, query = {}, options) {
339
+ const client = (0, client_1.getInternalApiClient)(options);
340
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices${buildFinanceInvoicesSearchParams(query)}`, {
341
+ cache: 'no-store',
342
+ });
343
+ }
344
+ async function createFinanceInvoice(workspaceId, payload, options) {
345
+ const client = (0, client_1.getInternalApiClient)(options);
346
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices`, {
347
+ body: JSON.stringify(payload),
348
+ cache: 'no-store',
349
+ headers: {
350
+ 'Content-Type': 'application/json',
351
+ },
352
+ method: 'POST',
353
+ });
354
+ }
355
+ async function getInvoiceAnalytics(workspaceId, query = {}, options) {
356
+ const client = (0, client_1.getInternalApiClient)(options);
357
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices/analytics${buildInvoiceAnalyticsSearchParams(query)}`, {
358
+ cache: 'no-store',
359
+ });
360
+ }
361
+ async function createSubscriptionFinanceInvoice(workspaceId, payload, options) {
362
+ const client = (0, client_1.getInternalApiClient)(options);
363
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices/subscription`, {
364
+ body: JSON.stringify(payload),
365
+ cache: 'no-store',
366
+ headers: {
367
+ 'Content-Type': 'application/json',
368
+ },
369
+ method: 'POST',
370
+ });
371
+ }
372
+ async function updateFinanceInvoice(workspaceId, invoiceId, payload, options) {
373
+ const client = (0, client_1.getInternalApiClient)(options);
374
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices/${(0, client_1.encodePathSegment)(invoiceId)}`, {
375
+ body: JSON.stringify(payload),
376
+ cache: 'no-store',
377
+ headers: {
378
+ 'Content-Type': 'application/json',
379
+ },
380
+ method: 'PUT',
381
+ });
382
+ }
383
+ async function deleteInvoice(workspaceId, invoiceId, options) {
384
+ const client = (0, client_1.getInternalApiClient)(options);
385
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices/${(0, client_1.encodePathSegment)(invoiceId)}`, {
386
+ method: 'DELETE',
387
+ cache: 'no-store',
388
+ });
389
+ }
390
+ async function listPendingFinanceInvoices(workspaceId, query = {}, options) {
391
+ const client = (0, client_1.getInternalApiClient)(options);
392
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices/pending${buildPendingFinanceInvoicesSearchParams(query)}`, {
393
+ cache: 'no-store',
394
+ });
395
+ }
396
+ async function getPendingFinanceInvoicesCurrentMonthCount(workspaceId, query = {}, options) {
397
+ const client = (0, client_1.getInternalApiClient)(options);
398
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices/pending${buildPendingFinanceInvoicesSearchParams({
399
+ ...query,
400
+ currentMonthOnly: true,
401
+ })}`, {
402
+ cache: 'no-store',
403
+ });
404
+ }
405
+ async function getSubscriptionInvoiceContext(workspaceId, query, options) {
406
+ const client = (0, client_1.getInternalApiClient)(options);
407
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices/subscription/context${buildSubscriptionInvoiceContextSearchParams(query)}`, {
408
+ cache: 'no-store',
409
+ });
410
+ }
411
+ async function listDebtLoans(workspaceId, query = {}, options) {
412
+ const client = (0, client_1.getInternalApiClient)(options);
413
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/debts`, {
414
+ query,
415
+ cache: 'no-store',
416
+ });
417
+ }
418
+ async function getDebtLoanSummary(workspaceId, options) {
419
+ const client = (0, client_1.getInternalApiClient)(options);
420
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/debts/summary`, {
421
+ cache: 'no-store',
422
+ });
423
+ }
424
+ async function getDebtLoan(workspaceId, debtLoanId, options) {
425
+ const client = (0, client_1.getInternalApiClient)(options);
426
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/debts/${(0, client_1.encodePathSegment)(debtLoanId)}`, {
427
+ cache: 'no-store',
428
+ });
429
+ }
430
+ async function createDebtLoan(workspaceId, payload, options) {
431
+ const client = (0, client_1.getInternalApiClient)(options);
432
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/debts`, {
433
+ method: 'POST',
434
+ headers: {
435
+ 'Content-Type': 'application/json',
436
+ },
437
+ body: JSON.stringify(payload),
438
+ cache: 'no-store',
439
+ });
440
+ }
441
+ async function updateDebtLoan(workspaceId, debtLoanId, payload, options) {
442
+ const client = (0, client_1.getInternalApiClient)(options);
443
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/debts/${(0, client_1.encodePathSegment)(debtLoanId)}`, {
444
+ method: 'PUT',
445
+ headers: {
446
+ 'Content-Type': 'application/json',
447
+ },
448
+ body: JSON.stringify(payload),
449
+ cache: 'no-store',
450
+ });
451
+ }
452
+ async function deleteDebtLoan(workspaceId, debtLoanId, options) {
453
+ const client = (0, client_1.getInternalApiClient)(options);
454
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/debts/${(0, client_1.encodePathSegment)(debtLoanId)}`, {
455
+ method: 'DELETE',
456
+ cache: 'no-store',
457
+ });
458
+ }
73
459
  async function listTransactionCategories(workspaceId, options) {
74
460
  const client = (0, client_1.getInternalApiClient)(options);
75
461
  return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/categories`, {
76
462
  cache: 'no-store',
77
463
  });
78
464
  }
465
+ async function getTransactionCategory(workspaceId, categoryId, options) {
466
+ const client = (0, client_1.getInternalApiClient)(options);
467
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/categories/${(0, client_1.encodePathSegment)(categoryId)}`, {
468
+ cache: 'no-store',
469
+ });
470
+ }
471
+ async function createTransactionCategory(workspaceId, payload, options) {
472
+ const client = (0, client_1.getInternalApiClient)(options);
473
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/categories`, {
474
+ method: 'POST',
475
+ headers: {
476
+ 'Content-Type': 'application/json',
477
+ },
478
+ body: JSON.stringify(payload),
479
+ cache: 'no-store',
480
+ });
481
+ }
482
+ async function updateTransactionCategory(workspaceId, categoryId, payload, options) {
483
+ const client = (0, client_1.getInternalApiClient)(options);
484
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/categories/${(0, client_1.encodePathSegment)(categoryId)}`, {
485
+ method: 'PUT',
486
+ headers: {
487
+ 'Content-Type': 'application/json',
488
+ },
489
+ body: JSON.stringify(payload),
490
+ cache: 'no-store',
491
+ });
492
+ }
493
+ async function deleteTransactionCategory(workspaceId, categoryId, options) {
494
+ const client = (0, client_1.getInternalApiClient)(options);
495
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/categories/${(0, client_1.encodePathSegment)(categoryId)}`, {
496
+ method: 'DELETE',
497
+ cache: 'no-store',
498
+ });
499
+ }
500
+ async function listTransactions(workspaceId, query = {}, options) {
501
+ const client = (0, client_1.getInternalApiClient)(options);
502
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions`, {
503
+ query,
504
+ cache: 'no-store',
505
+ });
506
+ }
507
+ async function getTransaction(workspaceId, transactionId, options) {
508
+ const client = (0, client_1.getInternalApiClient)(options);
509
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/${(0, client_1.encodePathSegment)(transactionId)}`, {
510
+ cache: 'no-store',
511
+ });
512
+ }
513
+ async function createTransaction(workspaceId, payload, options) {
514
+ const client = (0, client_1.getInternalApiClient)(options);
515
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions`, {
516
+ method: 'POST',
517
+ headers: {
518
+ 'Content-Type': 'application/json',
519
+ },
520
+ body: JSON.stringify(payload),
521
+ cache: 'no-store',
522
+ });
523
+ }
524
+ async function updateTransaction(workspaceId, transactionId, payload, options) {
525
+ const client = (0, client_1.getInternalApiClient)(options);
526
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/${(0, client_1.encodePathSegment)(transactionId)}`, {
527
+ method: 'PUT',
528
+ headers: {
529
+ 'Content-Type': 'application/json',
530
+ },
531
+ body: JSON.stringify(payload),
532
+ cache: 'no-store',
533
+ });
534
+ }
535
+ async function deleteTransaction(workspaceId, transactionId, options) {
536
+ const client = (0, client_1.getInternalApiClient)(options);
537
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/${(0, client_1.encodePathSegment)(transactionId)}`, {
538
+ method: 'DELETE',
539
+ cache: 'no-store',
540
+ });
541
+ }
542
+ async function createTransfer(workspaceId, payload, options) {
543
+ const client = (0, client_1.getInternalApiClient)(options);
544
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transfers`, {
545
+ method: 'POST',
546
+ headers: {
547
+ 'Content-Type': 'application/json',
548
+ },
549
+ body: JSON.stringify(payload),
550
+ cache: 'no-store',
551
+ });
552
+ }
553
+ async function updateTransfer(workspaceId, payload, options) {
554
+ const client = (0, client_1.getInternalApiClient)(options);
555
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transfers`, {
556
+ method: 'PUT',
557
+ headers: {
558
+ 'Content-Type': 'application/json',
559
+ },
560
+ body: JSON.stringify(payload),
561
+ cache: 'no-store',
562
+ });
563
+ }
564
+ async function listTransactionTags(workspaceId, options) {
565
+ const client = (0, client_1.getInternalApiClient)(options);
566
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tags`, {
567
+ cache: 'no-store',
568
+ });
569
+ }
570
+ async function listTransactionTagLinks(workspaceId, transactionId, options) {
571
+ const client = (0, client_1.getInternalApiClient)(options);
572
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/${(0, client_1.encodePathSegment)(transactionId)}/tags`, {
573
+ cache: 'no-store',
574
+ });
575
+ }
576
+ async function listTransactionTagStats(workspaceId, options) {
577
+ const client = (0, client_1.getInternalApiClient)(options);
578
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tags/stats`, {
579
+ cache: 'no-store',
580
+ });
581
+ }
582
+ async function createTransactionTag(workspaceId, payload, options) {
583
+ const client = (0, client_1.getInternalApiClient)(options);
584
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tags`, {
585
+ method: 'POST',
586
+ headers: {
587
+ 'Content-Type': 'application/json',
588
+ },
589
+ body: JSON.stringify(payload),
590
+ cache: 'no-store',
591
+ });
592
+ }
593
+ async function updateTransactionTag(workspaceId, tagId, payload, options) {
594
+ const client = (0, client_1.getInternalApiClient)(options);
595
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tags/${(0, client_1.encodePathSegment)(tagId)}`, {
596
+ method: 'PUT',
597
+ headers: {
598
+ 'Content-Type': 'application/json',
599
+ },
600
+ body: JSON.stringify(payload),
601
+ cache: 'no-store',
602
+ });
603
+ }
604
+ async function deleteTransactionTag(workspaceId, tagId, options) {
605
+ const client = (0, client_1.getInternalApiClient)(options);
606
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tags/${(0, client_1.encodePathSegment)(tagId)}`, {
607
+ method: 'DELETE',
608
+ cache: 'no-store',
609
+ });
610
+ }
611
+ async function listFinanceFilterUsers(workspaceId, query = {}, options) {
612
+ const client = (0, client_1.getInternalApiClient)(options);
613
+ const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/filter-users`, {
614
+ query,
615
+ cache: 'no-store',
616
+ });
617
+ return payload.users ?? [];
618
+ }
619
+ async function listTransactionExportRows(workspaceId, query = {}, options) {
620
+ const client = (0, client_1.getInternalApiClient)(options);
621
+ const queryString = buildTransactionExportSearchParams(query);
622
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/export${queryString}`, {
623
+ cache: 'no-store',
624
+ });
625
+ }
626
+ async function importMoneyLoverTransactions(workspaceId, transactions, options) {
627
+ const client = (0, client_1.getInternalApiClient)(options);
628
+ const formData = new FormData();
629
+ formData.append('transactions', JSON.stringify(transactions));
630
+ return client.fetch(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/import/money-lover`, {
631
+ body: formData,
632
+ cache: 'no-store',
633
+ method: 'POST',
634
+ });
635
+ }
79
636
  async function listRecurringTransactions(workspaceId, options) {
80
637
  const client = (0, client_1.getInternalApiClient)(options);
81
638
  const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/recurring-transactions`, {
@@ -120,6 +677,59 @@ async function deleteRecurringTransaction(workspaceId, recurringTransactionId, o
120
677
  cache: 'no-store',
121
678
  });
122
679
  }
680
+ async function getFinanceOverviewMetrics(workspaceId, query = {}, options) {
681
+ const client = (0, client_1.getInternalApiClient)(options);
682
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/overview`, {
683
+ query,
684
+ cache: 'no-store',
685
+ });
686
+ }
687
+ async function listFinanceDailyIncomeExpense(workspaceId, query = {}, options) {
688
+ const client = (0, client_1.getInternalApiClient)(options);
689
+ const payload = await client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/charts/daily`, {
690
+ query,
691
+ cache: 'no-store',
692
+ });
693
+ return payload.data ?? [];
694
+ }
695
+ async function listFinanceMonthlyIncomeExpense(workspaceId, query = {}, options) {
696
+ const client = (0, client_1.getInternalApiClient)(options);
697
+ const payload = await client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/charts/monthly`, {
698
+ query,
699
+ cache: 'no-store',
700
+ });
701
+ return payload.data ?? [];
702
+ }
703
+ async function listFinanceIncomeExpenseSummary(workspaceId, query, options) {
704
+ const client = (0, client_1.getInternalApiClient)(options);
705
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/charts/income-expense-summary`, {
706
+ query,
707
+ cache: 'no-store',
708
+ });
709
+ }
710
+ async function getFinanceBalanceAtDate(workspaceId, query, options) {
711
+ const client = (0, client_1.getInternalApiClient)(options);
712
+ return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/charts/balance`, {
713
+ query,
714
+ cache: 'no-store',
715
+ });
716
+ }
717
+ async function listFinanceBalanceTrend(workspaceId, query = {}, options) {
718
+ const client = (0, client_1.getInternalApiClient)(options);
719
+ const payload = await client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/charts/balance-trend`, {
720
+ query,
721
+ cache: 'no-store',
722
+ });
723
+ return payload.data ?? [];
724
+ }
725
+ async function listFinanceCategoryBreakdown(workspaceId, query = {}, options) {
726
+ const client = (0, client_1.getInternalApiClient)(options);
727
+ const payload = await client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/charts/categories`, {
728
+ query,
729
+ cache: 'no-store',
730
+ });
731
+ return payload.data ?? [];
732
+ }
123
733
  async function getTransactionStats(workspaceId, query, options) {
124
734
  const client = (0, client_1.getInternalApiClient)(options);
125
735
  return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/stats`, {