@tuturuuu/internal-api 0.15.0 → 0.17.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.
- package/dist/ai.d.ts +1 -0
- package/dist/ai.d.ts.map +1 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +7 -0
- package/dist/client.d.ts +17 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +178 -0
- package/dist/education.d.ts +1 -1
- package/dist/education.d.ts.map +1 -1
- package/dist/education.js +44 -44
- package/dist/external-app-drive.d.ts +51 -0
- package/dist/external-app-drive.d.ts.map +1 -0
- package/dist/external-app-drive.js +72 -0
- package/dist/external-projects.d.ts +3 -42
- package/dist/external-projects.d.ts.map +1 -1
- package/dist/finance.d.ts.map +1 -1
- package/dist/finance.js +75 -75
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -16
- package/dist/infrastructure/types.d.ts +1 -1
- package/dist/infrastructure/types.d.ts.map +1 -1
- package/dist/inventory.d.ts +50 -0
- package/dist/inventory.d.ts.map +1 -1
- package/dist/inventory.js +8 -0
- package/dist/mail-types.d.ts +288 -0
- package/dist/mail-types.d.ts.map +1 -0
- package/dist/mail-types.js +2 -0
- package/dist/mail.d.ts +58 -110
- package/dist/mail.d.ts.map +1 -1
- package/dist/mail.js +229 -0
- package/dist/meetings.d.ts +26 -0
- package/dist/meetings.d.ts.map +1 -0
- package/dist/meetings.js +77 -0
- package/dist/pay.d.ts +64 -0
- package/dist/pay.d.ts.map +1 -0
- package/dist/pay.js +75 -0
- package/dist/tasks.d.ts +10 -2
- package/dist/tasks.d.ts.map +1 -1
- package/dist/teach.d.ts +122 -2
- package/dist/teach.d.ts.map +1 -1
- package/dist/teach.js +76 -21
- package/dist/tulearn.d.ts +3 -1
- package/dist/tulearn.d.ts.map +1 -1
- package/dist/tulearn.js +19 -18
- package/dist/users.d.ts +21 -0
- package/dist/users.d.ts.map +1 -1
- package/dist/users.js +18 -0
- package/package.json +10 -5
package/dist/finance.js
CHANGED
|
@@ -89,7 +89,7 @@ async function listWallets(workspaceId, options) {
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
async function listInfiniteWallets(workspaceId, query = {}, options) {
|
|
92
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
92
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
93
93
|
const apiQuery = {
|
|
94
94
|
limit: query.limit,
|
|
95
95
|
offset: query.offset,
|
|
@@ -101,7 +101,7 @@ async function listInfiniteWallets(workspaceId, query = {}, options) {
|
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
async function getWallet(workspaceId, walletId, options) {
|
|
104
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
104
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
105
105
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}`, {
|
|
106
106
|
cache: 'no-store',
|
|
107
107
|
});
|
|
@@ -118,7 +118,7 @@ async function createWallet(workspaceId, payload, options) {
|
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
async function updateWallet(workspaceId, walletId, payload, options) {
|
|
121
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
121
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
122
122
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}`, {
|
|
123
123
|
method: 'PUT',
|
|
124
124
|
headers: {
|
|
@@ -129,21 +129,21 @@ async function updateWallet(workspaceId, walletId, payload, options) {
|
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
async function deleteWallet(workspaceId, walletId, options) {
|
|
132
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
132
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
133
133
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}`, {
|
|
134
134
|
method: 'DELETE',
|
|
135
135
|
cache: 'no-store',
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
async function listWalletCheckpoints(workspaceId, walletId, query, options) {
|
|
139
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
139
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
140
140
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/checkpoints`, {
|
|
141
141
|
cache: 'no-store',
|
|
142
142
|
query,
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
145
|
async function createWalletCheckpoint(workspaceId, walletId, payload, options) {
|
|
146
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
146
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
147
147
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/checkpoints`, {
|
|
148
148
|
body: JSON.stringify(payload),
|
|
149
149
|
cache: 'no-store',
|
|
@@ -154,7 +154,7 @@ async function createWalletCheckpoint(workspaceId, walletId, payload, options) {
|
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
async function updateWalletCheckpoint(workspaceId, walletId, checkpointId, payload, options) {
|
|
157
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
157
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
158
158
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/checkpoints/${(0, client_1.encodePathSegment)(checkpointId)}`, {
|
|
159
159
|
body: JSON.stringify(payload),
|
|
160
160
|
cache: 'no-store',
|
|
@@ -165,27 +165,27 @@ async function updateWalletCheckpoint(workspaceId, walletId, checkpointId, paylo
|
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
async function deleteWalletCheckpoint(workspaceId, walletId, checkpointId, options) {
|
|
168
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
168
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
169
169
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/checkpoints/${(0, client_1.encodePathSegment)(checkpointId)}`, {
|
|
170
170
|
cache: 'no-store',
|
|
171
171
|
method: 'DELETE',
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
async function getWalletCheckpointSummary(workspaceId, options) {
|
|
175
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
175
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
176
176
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/checkpoints`, {
|
|
177
177
|
cache: 'no-store',
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
async function getWalletCheckpointHistory(workspaceId, query, options) {
|
|
181
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
181
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
182
182
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/checkpoints/history`, {
|
|
183
183
|
cache: 'no-store',
|
|
184
184
|
query,
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
187
|
async function createWalletCheckpointReconciliation(workspaceId, walletId, checkpointId, payload, options) {
|
|
188
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
188
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
189
189
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/checkpoints/${(0, client_1.encodePathSegment)(checkpointId)}/reconcile`, {
|
|
190
190
|
body: JSON.stringify(payload),
|
|
191
191
|
cache: 'no-store',
|
|
@@ -196,7 +196,7 @@ async function createWalletCheckpointReconciliation(workspaceId, walletId, check
|
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
198
|
async function createWalletCheckpointBatch(workspaceId, payload, options) {
|
|
199
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
199
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
200
200
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/checkpoints`, {
|
|
201
201
|
body: JSON.stringify(payload),
|
|
202
202
|
cache: 'no-store',
|
|
@@ -207,7 +207,7 @@ async function createWalletCheckpointBatch(workspaceId, payload, options) {
|
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
209
|
async function getWalletCreditSummary(workspaceId, walletId, options) {
|
|
210
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
210
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
211
211
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/credit-summary`, {
|
|
212
212
|
cache: 'no-store',
|
|
213
213
|
});
|
|
@@ -248,13 +248,13 @@ async function removeWalletRoleAccess(workspaceId, walletId, roleId, options) {
|
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
async function getWalletInterestSummary(workspaceId, walletId, options) {
|
|
251
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
251
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
252
252
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/interest`, {
|
|
253
253
|
cache: 'no-store',
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
256
|
async function createWalletInterestConfig(workspaceId, walletId, payload, options) {
|
|
257
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
257
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
258
258
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/interest`, {
|
|
259
259
|
body: JSON.stringify(payload),
|
|
260
260
|
cache: 'no-store',
|
|
@@ -265,7 +265,7 @@ async function createWalletInterestConfig(workspaceId, walletId, payload, option
|
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
267
|
async function updateWalletInterestConfig(workspaceId, walletId, payload, options) {
|
|
268
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
268
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
269
269
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/interest/config`, {
|
|
270
270
|
body: JSON.stringify(payload),
|
|
271
271
|
cache: 'no-store',
|
|
@@ -276,14 +276,14 @@ async function updateWalletInterestConfig(workspaceId, walletId, payload, option
|
|
|
276
276
|
});
|
|
277
277
|
}
|
|
278
278
|
async function deleteWalletInterestConfig(workspaceId, walletId, options) {
|
|
279
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
279
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
280
280
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/interest/config`, {
|
|
281
281
|
cache: 'no-store',
|
|
282
282
|
method: 'DELETE',
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
285
|
async function createWalletInterestRate(workspaceId, walletId, payload, options) {
|
|
286
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
286
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
287
287
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/wallets/${(0, client_1.encodePathSegment)(walletId)}/interest/rates`, {
|
|
288
288
|
body: JSON.stringify(payload),
|
|
289
289
|
cache: 'no-store',
|
|
@@ -294,13 +294,13 @@ async function createWalletInterestRate(workspaceId, walletId, payload, options)
|
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
296
|
async function listBudgets(workspaceId, options) {
|
|
297
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
297
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
298
298
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/budgets`, {
|
|
299
299
|
cache: 'no-store',
|
|
300
300
|
});
|
|
301
301
|
}
|
|
302
302
|
async function getBudgetStatus(workspaceId, options) {
|
|
303
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
303
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
304
304
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/budgets/status`, {
|
|
305
305
|
cache: 'no-store',
|
|
306
306
|
});
|
|
@@ -403,7 +403,7 @@ function buildSubscriptionInvoiceContextSearchParams(query) {
|
|
|
403
403
|
return queryString ? `?${queryString}` : '';
|
|
404
404
|
}
|
|
405
405
|
async function createBudget(workspaceId, payload, options) {
|
|
406
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
406
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
407
407
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/budgets`, {
|
|
408
408
|
method: 'POST',
|
|
409
409
|
headers: {
|
|
@@ -414,7 +414,7 @@ async function createBudget(workspaceId, payload, options) {
|
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
416
|
async function updateBudget(workspaceId, budgetId, payload, options) {
|
|
417
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
417
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
418
418
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/budgets/${(0, client_1.encodePathSegment)(budgetId)}`, {
|
|
419
419
|
method: 'PATCH',
|
|
420
420
|
headers: {
|
|
@@ -425,20 +425,20 @@ async function updateBudget(workspaceId, budgetId, payload, options) {
|
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
427
|
async function deleteBudget(workspaceId, budgetId, options) {
|
|
428
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
428
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
429
429
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/budgets/${(0, client_1.encodePathSegment)(budgetId)}`, {
|
|
430
430
|
method: 'DELETE',
|
|
431
431
|
cache: 'no-store',
|
|
432
432
|
});
|
|
433
433
|
}
|
|
434
434
|
async function listFinanceInvoices(workspaceId, query = {}, options) {
|
|
435
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
435
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
436
436
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices${buildFinanceInvoicesSearchParams(query)}`, {
|
|
437
437
|
cache: 'no-store',
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
440
|
async function createFinanceInvoice(workspaceId, payload, options) {
|
|
441
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
441
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
442
442
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices`, {
|
|
443
443
|
body: JSON.stringify(payload),
|
|
444
444
|
cache: 'no-store',
|
|
@@ -449,13 +449,13 @@ async function createFinanceInvoice(workspaceId, payload, options) {
|
|
|
449
449
|
});
|
|
450
450
|
}
|
|
451
451
|
async function getInvoiceAnalytics(workspaceId, query = {}, options) {
|
|
452
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
452
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
453
453
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices/analytics${buildInvoiceAnalyticsSearchParams(query)}`, {
|
|
454
454
|
cache: 'no-store',
|
|
455
455
|
});
|
|
456
456
|
}
|
|
457
457
|
async function createSubscriptionFinanceInvoice(workspaceId, payload, options) {
|
|
458
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
458
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
459
459
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices/subscription`, {
|
|
460
460
|
body: JSON.stringify(payload),
|
|
461
461
|
cache: 'no-store',
|
|
@@ -466,7 +466,7 @@ async function createSubscriptionFinanceInvoice(workspaceId, payload, options) {
|
|
|
466
466
|
});
|
|
467
467
|
}
|
|
468
468
|
async function updateFinanceInvoice(workspaceId, invoiceId, payload, options) {
|
|
469
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
469
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
470
470
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices/${(0, client_1.encodePathSegment)(invoiceId)}`, {
|
|
471
471
|
body: JSON.stringify(payload),
|
|
472
472
|
cache: 'no-store',
|
|
@@ -477,20 +477,20 @@ async function updateFinanceInvoice(workspaceId, invoiceId, payload, options) {
|
|
|
477
477
|
});
|
|
478
478
|
}
|
|
479
479
|
async function deleteInvoice(workspaceId, invoiceId, options) {
|
|
480
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
480
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
481
481
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices/${(0, client_1.encodePathSegment)(invoiceId)}`, {
|
|
482
482
|
method: 'DELETE',
|
|
483
483
|
cache: 'no-store',
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
async function listPendingFinanceInvoices(workspaceId, query = {}, options) {
|
|
487
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
487
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
488
488
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices/pending${buildPendingFinanceInvoicesSearchParams(query)}`, {
|
|
489
489
|
cache: 'no-store',
|
|
490
490
|
});
|
|
491
491
|
}
|
|
492
492
|
async function getPendingFinanceInvoicesCurrentMonthCount(workspaceId, query = {}, options) {
|
|
493
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
493
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
494
494
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices/pending${buildPendingFinanceInvoicesSearchParams({
|
|
495
495
|
...query,
|
|
496
496
|
currentMonthOnly: true,
|
|
@@ -499,32 +499,32 @@ async function getPendingFinanceInvoicesCurrentMonthCount(workspaceId, query = {
|
|
|
499
499
|
});
|
|
500
500
|
}
|
|
501
501
|
async function getSubscriptionInvoiceContext(workspaceId, query, options) {
|
|
502
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
502
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
503
503
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/invoices/subscription/context${buildSubscriptionInvoiceContextSearchParams(query)}`, {
|
|
504
504
|
cache: 'no-store',
|
|
505
505
|
});
|
|
506
506
|
}
|
|
507
507
|
async function listDebtLoans(workspaceId, query = {}, options) {
|
|
508
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
508
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
509
509
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/debts`, {
|
|
510
510
|
query,
|
|
511
511
|
cache: 'no-store',
|
|
512
512
|
});
|
|
513
513
|
}
|
|
514
514
|
async function getDebtLoanSummary(workspaceId, options) {
|
|
515
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
515
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
516
516
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/debts/summary`, {
|
|
517
517
|
cache: 'no-store',
|
|
518
518
|
});
|
|
519
519
|
}
|
|
520
520
|
async function getDebtLoan(workspaceId, debtLoanId, options) {
|
|
521
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
521
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
522
522
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/debts/${(0, client_1.encodePathSegment)(debtLoanId)}`, {
|
|
523
523
|
cache: 'no-store',
|
|
524
524
|
});
|
|
525
525
|
}
|
|
526
526
|
async function createDebtLoan(workspaceId, payload, options) {
|
|
527
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
527
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
528
528
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/debts`, {
|
|
529
529
|
method: 'POST',
|
|
530
530
|
headers: {
|
|
@@ -535,7 +535,7 @@ async function createDebtLoan(workspaceId, payload, options) {
|
|
|
535
535
|
});
|
|
536
536
|
}
|
|
537
537
|
async function updateDebtLoan(workspaceId, debtLoanId, payload, options) {
|
|
538
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
538
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
539
539
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/debts/${(0, client_1.encodePathSegment)(debtLoanId)}`, {
|
|
540
540
|
method: 'PUT',
|
|
541
541
|
headers: {
|
|
@@ -546,26 +546,26 @@ async function updateDebtLoan(workspaceId, debtLoanId, payload, options) {
|
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
548
|
async function deleteDebtLoan(workspaceId, debtLoanId, options) {
|
|
549
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
549
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
550
550
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/debts/${(0, client_1.encodePathSegment)(debtLoanId)}`, {
|
|
551
551
|
method: 'DELETE',
|
|
552
552
|
cache: 'no-store',
|
|
553
553
|
});
|
|
554
554
|
}
|
|
555
555
|
async function listTransactionCategories(workspaceId, options) {
|
|
556
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
556
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
557
557
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/categories`, {
|
|
558
558
|
cache: 'no-store',
|
|
559
559
|
});
|
|
560
560
|
}
|
|
561
561
|
async function getTransactionCategory(workspaceId, categoryId, options) {
|
|
562
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
562
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
563
563
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/categories/${(0, client_1.encodePathSegment)(categoryId)}`, {
|
|
564
564
|
cache: 'no-store',
|
|
565
565
|
});
|
|
566
566
|
}
|
|
567
567
|
async function createTransactionCategory(workspaceId, payload, options) {
|
|
568
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
568
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
569
569
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/categories`, {
|
|
570
570
|
method: 'POST',
|
|
571
571
|
headers: {
|
|
@@ -576,7 +576,7 @@ async function createTransactionCategory(workspaceId, payload, options) {
|
|
|
576
576
|
});
|
|
577
577
|
}
|
|
578
578
|
async function updateTransactionCategory(workspaceId, categoryId, payload, options) {
|
|
579
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
579
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
580
580
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/categories/${(0, client_1.encodePathSegment)(categoryId)}`, {
|
|
581
581
|
method: 'PUT',
|
|
582
582
|
headers: {
|
|
@@ -587,27 +587,27 @@ async function updateTransactionCategory(workspaceId, categoryId, payload, optio
|
|
|
587
587
|
});
|
|
588
588
|
}
|
|
589
589
|
async function deleteTransactionCategory(workspaceId, categoryId, options) {
|
|
590
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
590
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
591
591
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/categories/${(0, client_1.encodePathSegment)(categoryId)}`, {
|
|
592
592
|
method: 'DELETE',
|
|
593
593
|
cache: 'no-store',
|
|
594
594
|
});
|
|
595
595
|
}
|
|
596
596
|
async function listTransactions(workspaceId, query = {}, options) {
|
|
597
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
597
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
598
598
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions`, {
|
|
599
599
|
query,
|
|
600
600
|
cache: 'no-store',
|
|
601
601
|
});
|
|
602
602
|
}
|
|
603
603
|
async function getTransaction(workspaceId, transactionId, options) {
|
|
604
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
604
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
605
605
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/${(0, client_1.encodePathSegment)(transactionId)}`, {
|
|
606
606
|
cache: 'no-store',
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
609
|
async function createTransaction(workspaceId, payload, options) {
|
|
610
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
610
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
611
611
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions`, {
|
|
612
612
|
method: 'POST',
|
|
613
613
|
headers: {
|
|
@@ -618,7 +618,7 @@ async function createTransaction(workspaceId, payload, options) {
|
|
|
618
618
|
});
|
|
619
619
|
}
|
|
620
620
|
async function updateTransaction(workspaceId, transactionId, payload, options) {
|
|
621
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
621
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
622
622
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/${(0, client_1.encodePathSegment)(transactionId)}`, {
|
|
623
623
|
method: 'PUT',
|
|
624
624
|
headers: {
|
|
@@ -629,14 +629,14 @@ async function updateTransaction(workspaceId, transactionId, payload, options) {
|
|
|
629
629
|
});
|
|
630
630
|
}
|
|
631
631
|
async function deleteTransaction(workspaceId, transactionId, options) {
|
|
632
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
632
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
633
633
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/${(0, client_1.encodePathSegment)(transactionId)}`, {
|
|
634
634
|
method: 'DELETE',
|
|
635
635
|
cache: 'no-store',
|
|
636
636
|
});
|
|
637
637
|
}
|
|
638
638
|
async function createTransfer(workspaceId, payload, options) {
|
|
639
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
639
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
640
640
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transfers`, {
|
|
641
641
|
method: 'POST',
|
|
642
642
|
headers: {
|
|
@@ -647,7 +647,7 @@ async function createTransfer(workspaceId, payload, options) {
|
|
|
647
647
|
});
|
|
648
648
|
}
|
|
649
649
|
async function updateTransfer(workspaceId, payload, options) {
|
|
650
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
650
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
651
651
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transfers`, {
|
|
652
652
|
method: 'PUT',
|
|
653
653
|
headers: {
|
|
@@ -658,7 +658,7 @@ async function updateTransfer(workspaceId, payload, options) {
|
|
|
658
658
|
});
|
|
659
659
|
}
|
|
660
660
|
async function migrateTransfer(workspaceId, payload, options) {
|
|
661
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
661
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
662
662
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transfers`, {
|
|
663
663
|
method: 'PATCH',
|
|
664
664
|
headers: {
|
|
@@ -669,25 +669,25 @@ async function migrateTransfer(workspaceId, payload, options) {
|
|
|
669
669
|
});
|
|
670
670
|
}
|
|
671
671
|
async function listTransactionTags(workspaceId, options) {
|
|
672
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
672
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
673
673
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tags`, {
|
|
674
674
|
cache: 'no-store',
|
|
675
675
|
});
|
|
676
676
|
}
|
|
677
677
|
async function listTransactionTagLinks(workspaceId, transactionId, options) {
|
|
678
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
678
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
679
679
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/${(0, client_1.encodePathSegment)(transactionId)}/tags`, {
|
|
680
680
|
cache: 'no-store',
|
|
681
681
|
});
|
|
682
682
|
}
|
|
683
683
|
async function listTransactionTagStats(workspaceId, options) {
|
|
684
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
684
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
685
685
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tags/stats`, {
|
|
686
686
|
cache: 'no-store',
|
|
687
687
|
});
|
|
688
688
|
}
|
|
689
689
|
async function createTransactionTag(workspaceId, payload, options) {
|
|
690
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
690
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
691
691
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tags`, {
|
|
692
692
|
method: 'POST',
|
|
693
693
|
headers: {
|
|
@@ -698,7 +698,7 @@ async function createTransactionTag(workspaceId, payload, options) {
|
|
|
698
698
|
});
|
|
699
699
|
}
|
|
700
700
|
async function updateTransactionTag(workspaceId, tagId, payload, options) {
|
|
701
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
701
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
702
702
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tags/${(0, client_1.encodePathSegment)(tagId)}`, {
|
|
703
703
|
method: 'PUT',
|
|
704
704
|
headers: {
|
|
@@ -709,14 +709,14 @@ async function updateTransactionTag(workspaceId, tagId, payload, options) {
|
|
|
709
709
|
});
|
|
710
710
|
}
|
|
711
711
|
async function deleteTransactionTag(workspaceId, tagId, options) {
|
|
712
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
712
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
713
713
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tags/${(0, client_1.encodePathSegment)(tagId)}`, {
|
|
714
714
|
method: 'DELETE',
|
|
715
715
|
cache: 'no-store',
|
|
716
716
|
});
|
|
717
717
|
}
|
|
718
718
|
async function listFinanceFilterUsers(workspaceId, query = {}, options) {
|
|
719
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
719
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
720
720
|
const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/filter-users`, {
|
|
721
721
|
query,
|
|
722
722
|
cache: 'no-store',
|
|
@@ -724,14 +724,14 @@ async function listFinanceFilterUsers(workspaceId, query = {}, options) {
|
|
|
724
724
|
return payload.users ?? [];
|
|
725
725
|
}
|
|
726
726
|
async function listTransactionExportRows(workspaceId, query = {}, options) {
|
|
727
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
727
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
728
728
|
const queryString = buildTransactionExportSearchParams(query);
|
|
729
729
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/export${queryString}`, {
|
|
730
730
|
cache: 'no-store',
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
733
|
async function importMoneyLoverTransactions(workspaceId, transactions, options) {
|
|
734
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
734
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
735
735
|
const formData = new FormData();
|
|
736
736
|
formData.append('transactions', JSON.stringify(transactions));
|
|
737
737
|
return client.fetch(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/import/money-lover`, {
|
|
@@ -741,14 +741,14 @@ async function importMoneyLoverTransactions(workspaceId, transactions, options)
|
|
|
741
741
|
});
|
|
742
742
|
}
|
|
743
743
|
async function listRecurringTransactions(workspaceId, options) {
|
|
744
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
744
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
745
745
|
const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/recurring-transactions`, {
|
|
746
746
|
cache: 'no-store',
|
|
747
747
|
});
|
|
748
748
|
return payload.recurringTransactions ?? [];
|
|
749
749
|
}
|
|
750
750
|
async function listUpcomingRecurringTransactions(workspaceId, query, options) {
|
|
751
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
751
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
752
752
|
const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/recurring-transactions/upcoming`, {
|
|
753
753
|
query,
|
|
754
754
|
cache: 'no-store',
|
|
@@ -756,7 +756,7 @@ async function listUpcomingRecurringTransactions(workspaceId, query, options) {
|
|
|
756
756
|
return payload.upcomingTransactions ?? [];
|
|
757
757
|
}
|
|
758
758
|
async function createRecurringTransaction(workspaceId, payload, options) {
|
|
759
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
759
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
760
760
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/recurring-transactions`, {
|
|
761
761
|
method: 'POST',
|
|
762
762
|
headers: {
|
|
@@ -767,7 +767,7 @@ async function createRecurringTransaction(workspaceId, payload, options) {
|
|
|
767
767
|
});
|
|
768
768
|
}
|
|
769
769
|
async function updateRecurringTransaction(workspaceId, recurringTransactionId, payload, options) {
|
|
770
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
770
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
771
771
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/recurring-transactions/${(0, client_1.encodePathSegment)(recurringTransactionId)}`, {
|
|
772
772
|
method: 'PUT',
|
|
773
773
|
headers: {
|
|
@@ -778,21 +778,21 @@ async function updateRecurringTransaction(workspaceId, recurringTransactionId, p
|
|
|
778
778
|
});
|
|
779
779
|
}
|
|
780
780
|
async function deleteRecurringTransaction(workspaceId, recurringTransactionId, options) {
|
|
781
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
781
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
782
782
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/recurring-transactions/${(0, client_1.encodePathSegment)(recurringTransactionId)}`, {
|
|
783
783
|
method: 'DELETE',
|
|
784
784
|
cache: 'no-store',
|
|
785
785
|
});
|
|
786
786
|
}
|
|
787
787
|
async function getFinanceOverviewMetrics(workspaceId, query = {}, options) {
|
|
788
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
788
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
789
789
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/overview`, {
|
|
790
790
|
query,
|
|
791
791
|
cache: 'no-store',
|
|
792
792
|
});
|
|
793
793
|
}
|
|
794
794
|
async function listFinanceDailyIncomeExpense(workspaceId, query = {}, options) {
|
|
795
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
795
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
796
796
|
const payload = await client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/charts/daily`, {
|
|
797
797
|
query,
|
|
798
798
|
cache: 'no-store',
|
|
@@ -800,7 +800,7 @@ async function listFinanceDailyIncomeExpense(workspaceId, query = {}, options) {
|
|
|
800
800
|
return payload.data ?? [];
|
|
801
801
|
}
|
|
802
802
|
async function listFinanceMonthlyIncomeExpense(workspaceId, query = {}, options) {
|
|
803
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
803
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
804
804
|
const payload = await client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/charts/monthly`, {
|
|
805
805
|
query,
|
|
806
806
|
cache: 'no-store',
|
|
@@ -808,21 +808,21 @@ async function listFinanceMonthlyIncomeExpense(workspaceId, query = {}, options)
|
|
|
808
808
|
return payload.data ?? [];
|
|
809
809
|
}
|
|
810
810
|
async function listFinanceIncomeExpenseSummary(workspaceId, query, options) {
|
|
811
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
811
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
812
812
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/charts/income-expense-summary`, {
|
|
813
813
|
query,
|
|
814
814
|
cache: 'no-store',
|
|
815
815
|
});
|
|
816
816
|
}
|
|
817
817
|
async function getFinanceBalanceAtDate(workspaceId, query, options) {
|
|
818
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
818
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
819
819
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/charts/balance`, {
|
|
820
820
|
query,
|
|
821
821
|
cache: 'no-store',
|
|
822
822
|
});
|
|
823
823
|
}
|
|
824
824
|
async function listFinanceBalanceTrend(workspaceId, query = {}, options) {
|
|
825
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
825
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
826
826
|
const payload = await client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/charts/balance-trend`, {
|
|
827
827
|
query,
|
|
828
828
|
cache: 'no-store',
|
|
@@ -830,7 +830,7 @@ async function listFinanceBalanceTrend(workspaceId, query = {}, options) {
|
|
|
830
830
|
return payload.data ?? [];
|
|
831
831
|
}
|
|
832
832
|
async function listFinanceCategoryBreakdown(workspaceId, query = {}, options) {
|
|
833
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
833
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
834
834
|
const payload = await client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/finance/charts/categories`, {
|
|
835
835
|
query,
|
|
836
836
|
cache: 'no-store',
|
|
@@ -838,21 +838,21 @@ async function listFinanceCategoryBreakdown(workspaceId, query = {}, options) {
|
|
|
838
838
|
return payload.data ?? [];
|
|
839
839
|
}
|
|
840
840
|
async function getTransactionStats(workspaceId, query, options) {
|
|
841
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
841
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
842
842
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/stats`, {
|
|
843
843
|
query,
|
|
844
844
|
cache: 'no-store',
|
|
845
845
|
});
|
|
846
846
|
}
|
|
847
847
|
async function getCategoryBreakdown(workspaceId, query, options) {
|
|
848
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
848
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
849
849
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/category-breakdown`, {
|
|
850
850
|
query,
|
|
851
851
|
cache: 'no-store',
|
|
852
852
|
});
|
|
853
853
|
}
|
|
854
854
|
async function getSpendingTrends(workspaceId, query, options) {
|
|
855
|
-
const client = (0, client_1.getInternalApiClient)(options);
|
|
855
|
+
const client = (0, client_1.getInternalApiClient)((0, client_1.withFinanceApiBaseUrl)(options));
|
|
856
856
|
return client.json(`/api/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/transactions/spending-trends`, {
|
|
857
857
|
query,
|
|
858
858
|
cache: 'no-store',
|