@kanda-libs/ks-component-ts 0.2.421 → 0.2.423
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.d.ts +12862 -12763
- package/dist/index.esm.js +4 -4
- package/dist/index.esm.js.map +3 -3
- package/package.json +1 -1
- package/src/generated/components/schemas/SearchIndex.ts +7 -1
- package/src/generated/components/schemas/Transaction.ts +41 -0
- package/src/generated/components/schemas/index.ts +1 -0
- package/src/generated/operations/deleteTransaction.ts +29 -0
- package/src/generated/operations/getTransaction.ts +29 -0
- package/src/generated/operations/getTransactions.ts +25 -0
- package/src/generated/operations/index.ts +65 -0
- package/src/generated/operations/postTransaction.ts +24 -0
- package/src/generated/operations/putTransaction.ts +35 -0
- package/src/generated/widget/index.tsx +66194 -65885
package/package.json
CHANGED
|
@@ -5,6 +5,12 @@ export const SearchIndex = t.union([
|
|
|
5
5
|
t.literal("credit"),
|
|
6
6
|
t.literal("enterprise"),
|
|
7
7
|
t.literal("job"),
|
|
8
|
+
t.literal("transaction"),
|
|
8
9
|
]);
|
|
9
10
|
|
|
10
|
-
export type SearchIndex =
|
|
11
|
+
export type SearchIndex =
|
|
12
|
+
| "company"
|
|
13
|
+
| "credit"
|
|
14
|
+
| "enterprise"
|
|
15
|
+
| "job"
|
|
16
|
+
| "transaction";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import { FinanceProvider } from "./FinanceProvider";
|
|
3
|
+
import { Metadata } from "./Metadata";
|
|
4
|
+
import { Pence } from "./Pence";
|
|
5
|
+
|
|
6
|
+
export const Transaction = t.intersection([
|
|
7
|
+
t.type({
|
|
8
|
+
id: t.string,
|
|
9
|
+
lender: FinanceProvider,
|
|
10
|
+
xid: t.string,
|
|
11
|
+
payout_type: t.union([
|
|
12
|
+
t.literal("paid_to_kanda"),
|
|
13
|
+
t.literal("paid_from_kanda"),
|
|
14
|
+
]),
|
|
15
|
+
payout_date: t.string,
|
|
16
|
+
amount: Pence,
|
|
17
|
+
vat: Pence,
|
|
18
|
+
fee: Pence,
|
|
19
|
+
}),
|
|
20
|
+
t.partial({
|
|
21
|
+
xref: t.string,
|
|
22
|
+
account_name: t.string,
|
|
23
|
+
note: t.string,
|
|
24
|
+
metadata: Metadata,
|
|
25
|
+
}),
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
export interface Transaction {
|
|
29
|
+
id: string;
|
|
30
|
+
lender: FinanceProvider;
|
|
31
|
+
xid: string;
|
|
32
|
+
xref?: string;
|
|
33
|
+
account_name?: string;
|
|
34
|
+
payout_type: "paid_to_kanda" | "paid_from_kanda";
|
|
35
|
+
payout_date: string;
|
|
36
|
+
amount: Pence;
|
|
37
|
+
vat: Pence;
|
|
38
|
+
fee: Pence;
|
|
39
|
+
note?: string;
|
|
40
|
+
metadata?: Metadata;
|
|
41
|
+
}
|
|
@@ -117,6 +117,7 @@ export * from "./TradeFilter";
|
|
|
117
117
|
export * from "./TradeSummary";
|
|
118
118
|
export * from "./TradeType";
|
|
119
119
|
export * from "./Training";
|
|
120
|
+
export * from "./Transaction";
|
|
120
121
|
export * from "./UserEvent";
|
|
121
122
|
export * from "./UserType";
|
|
122
123
|
export * from "./UTM";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RequestFunction } from "@openapi-io-ts/runtime";
|
|
2
|
+
import * as schemas from "../components/schemas";
|
|
3
|
+
|
|
4
|
+
export type DeleteTransactionRequestParameters = {
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const deleteTransactionOperation = {
|
|
9
|
+
path: "/api/transaction/{id}",
|
|
10
|
+
method: "delete",
|
|
11
|
+
responses: {
|
|
12
|
+
"200": { _tag: "JsonResponse", decoder: schemas.Transaction },
|
|
13
|
+
default: { _tag: "JsonResponse", decoder: schemas.Error },
|
|
14
|
+
},
|
|
15
|
+
parameters: [
|
|
16
|
+
{
|
|
17
|
+
_tag: "FormParameter",
|
|
18
|
+
explode: false,
|
|
19
|
+
in: "path",
|
|
20
|
+
name: "id",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
requestDefaultHeaders: { Accept: "application/json" },
|
|
24
|
+
} as const;
|
|
25
|
+
|
|
26
|
+
export type DeleteTransactionRequestFunction = RequestFunction<
|
|
27
|
+
{ params: DeleteTransactionRequestParameters },
|
|
28
|
+
schemas.Transaction
|
|
29
|
+
>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RequestFunction } from "@openapi-io-ts/runtime";
|
|
2
|
+
import * as schemas from "../components/schemas";
|
|
3
|
+
|
|
4
|
+
export type GetTransactionRequestParameters = {
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const getTransactionOperation = {
|
|
9
|
+
path: "/api/transaction/{id}",
|
|
10
|
+
method: "get",
|
|
11
|
+
responses: {
|
|
12
|
+
"200": { _tag: "JsonResponse", decoder: schemas.Transaction },
|
|
13
|
+
default: { _tag: "JsonResponse", decoder: schemas.Error },
|
|
14
|
+
},
|
|
15
|
+
parameters: [
|
|
16
|
+
{
|
|
17
|
+
_tag: "FormParameter",
|
|
18
|
+
explode: false,
|
|
19
|
+
in: "path",
|
|
20
|
+
name: "id",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
requestDefaultHeaders: { Accept: "application/json" },
|
|
24
|
+
} as const;
|
|
25
|
+
|
|
26
|
+
export type GetTransactionRequestFunction = RequestFunction<
|
|
27
|
+
{ params: GetTransactionRequestParameters },
|
|
28
|
+
schemas.Transaction
|
|
29
|
+
>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RequestFunction } from "@openapi-io-ts/runtime";
|
|
2
|
+
import * as t from "io-ts";
|
|
3
|
+
import * as parameters from "../components/parameters";
|
|
4
|
+
import * as schemas from "../components/schemas";
|
|
5
|
+
|
|
6
|
+
export type GetTransactionsRequestParameters = {
|
|
7
|
+
format?: "reduced" | "full";
|
|
8
|
+
q?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const getTransactionsOperation = {
|
|
12
|
+
path: "/api/transaction",
|
|
13
|
+
method: "get",
|
|
14
|
+
responses: {
|
|
15
|
+
"200": { _tag: "JsonResponse", decoder: t.array(schemas.Transaction) },
|
|
16
|
+
default: { _tag: "JsonResponse", decoder: schemas.Error },
|
|
17
|
+
},
|
|
18
|
+
parameters: [parameters.format, parameters.q],
|
|
19
|
+
requestDefaultHeaders: { Accept: "application/json" },
|
|
20
|
+
} as const;
|
|
21
|
+
|
|
22
|
+
export type GetTransactionsRequestFunction = RequestFunction<
|
|
23
|
+
{ params: GetTransactionsRequestParameters },
|
|
24
|
+
Array<schemas.Transaction>
|
|
25
|
+
>;
|
|
@@ -97,6 +97,10 @@ import {
|
|
|
97
97
|
deleteTrainingOperation,
|
|
98
98
|
DeleteTrainingRequestFunction,
|
|
99
99
|
} from "./deleteTraining";
|
|
100
|
+
import {
|
|
101
|
+
deleteTransactionOperation,
|
|
102
|
+
DeleteTransactionRequestFunction,
|
|
103
|
+
} from "./deleteTransaction";
|
|
100
104
|
import {
|
|
101
105
|
directorCompanyOperation,
|
|
102
106
|
DirectorCompanyRequestFunction,
|
|
@@ -193,6 +197,14 @@ import {
|
|
|
193
197
|
getTrainingsOperation,
|
|
194
198
|
GetTrainingsRequestFunction,
|
|
195
199
|
} from "./getTrainings";
|
|
200
|
+
import {
|
|
201
|
+
getTransactionOperation,
|
|
202
|
+
GetTransactionRequestFunction,
|
|
203
|
+
} from "./getTransaction";
|
|
204
|
+
import {
|
|
205
|
+
getTransactionsOperation,
|
|
206
|
+
GetTransactionsRequestFunction,
|
|
207
|
+
} from "./getTransactions";
|
|
196
208
|
import {
|
|
197
209
|
importFcaApprovedOperation,
|
|
198
210
|
ImportFcaApprovedRequestFunction,
|
|
@@ -390,6 +402,10 @@ import {
|
|
|
390
402
|
postTrainingOperation,
|
|
391
403
|
PostTrainingRequestFunction,
|
|
392
404
|
} from "./postTraining";
|
|
405
|
+
import {
|
|
406
|
+
postTransactionOperation,
|
|
407
|
+
PostTransactionRequestFunction,
|
|
408
|
+
} from "./postTransaction";
|
|
393
409
|
import {
|
|
394
410
|
providerCheckWebhookOperation,
|
|
395
411
|
ProviderCheckWebhookRequestFunction,
|
|
@@ -427,6 +443,10 @@ import {
|
|
|
427
443
|
putTrainingOperation,
|
|
428
444
|
PutTrainingRequestFunction,
|
|
429
445
|
} from "./putTraining";
|
|
446
|
+
import {
|
|
447
|
+
putTransactionOperation,
|
|
448
|
+
PutTransactionRequestFunction,
|
|
449
|
+
} from "./putTransaction";
|
|
430
450
|
import {
|
|
431
451
|
quoteCreditOperation,
|
|
432
452
|
QuoteCreditRequestFunction,
|
|
@@ -615,6 +635,11 @@ export const operations: Operations = {
|
|
|
615
635
|
putMonitor: putMonitorOperation,
|
|
616
636
|
deleteMonitor: deleteMonitorOperation,
|
|
617
637
|
postMonitorFlag: postMonitorFlagOperation,
|
|
638
|
+
getTransactions: getTransactionsOperation,
|
|
639
|
+
postTransaction: postTransactionOperation,
|
|
640
|
+
getTransaction: getTransactionOperation,
|
|
641
|
+
putTransaction: putTransactionOperation,
|
|
642
|
+
deleteTransaction: deleteTransactionOperation,
|
|
618
643
|
providerCheckWebhook: providerCheckWebhookOperation,
|
|
619
644
|
providerWebhook: providerWebhookOperation,
|
|
620
645
|
actionAdhoc: actionAdhocOperation,
|
|
@@ -776,6 +801,11 @@ export interface OperationRequestFunctionMap {
|
|
|
776
801
|
putMonitor: PutMonitorRequestFunction;
|
|
777
802
|
deleteMonitor: DeleteMonitorRequestFunction;
|
|
778
803
|
postMonitorFlag: PostMonitorFlagRequestFunction;
|
|
804
|
+
getTransactions: GetTransactionsRequestFunction;
|
|
805
|
+
postTransaction: PostTransactionRequestFunction;
|
|
806
|
+
getTransaction: GetTransactionRequestFunction;
|
|
807
|
+
putTransaction: PutTransactionRequestFunction;
|
|
808
|
+
deleteTransaction: DeleteTransactionRequestFunction;
|
|
779
809
|
providerCheckWebhook: ProviderCheckWebhookRequestFunction;
|
|
780
810
|
providerWebhook: ProviderWebhookRequestFunction;
|
|
781
811
|
actionAdhoc: ActionAdhocRequestFunction;
|
|
@@ -1134,6 +1164,26 @@ export const requestFunctionsBuilder = (
|
|
|
1134
1164
|
operations.postMonitorFlag,
|
|
1135
1165
|
requestAdapter
|
|
1136
1166
|
),
|
|
1167
|
+
getTransactions: requestFunctionBuilder(
|
|
1168
|
+
operations.getTransactions,
|
|
1169
|
+
requestAdapter
|
|
1170
|
+
),
|
|
1171
|
+
postTransaction: requestFunctionBuilder(
|
|
1172
|
+
operations.postTransaction,
|
|
1173
|
+
requestAdapter
|
|
1174
|
+
),
|
|
1175
|
+
getTransaction: requestFunctionBuilder(
|
|
1176
|
+
operations.getTransaction,
|
|
1177
|
+
requestAdapter
|
|
1178
|
+
),
|
|
1179
|
+
putTransaction: requestFunctionBuilder(
|
|
1180
|
+
operations.putTransaction,
|
|
1181
|
+
requestAdapter
|
|
1182
|
+
),
|
|
1183
|
+
deleteTransaction: requestFunctionBuilder(
|
|
1184
|
+
operations.deleteTransaction,
|
|
1185
|
+
requestAdapter
|
|
1186
|
+
),
|
|
1137
1187
|
providerCheckWebhook: requestFunctionBuilder(
|
|
1138
1188
|
operations.providerCheckWebhook,
|
|
1139
1189
|
requestAdapter
|
|
@@ -1472,6 +1522,16 @@ export const monitorServiceBuilder = (
|
|
|
1472
1522
|
postMonitorFlag: requestFunctions.postMonitorFlag,
|
|
1473
1523
|
});
|
|
1474
1524
|
|
|
1525
|
+
export const transactionServiceBuilder = (
|
|
1526
|
+
requestFunctions: OperationRequestFunctionMap
|
|
1527
|
+
) => ({
|
|
1528
|
+
getTransactions: requestFunctions.getTransactions,
|
|
1529
|
+
postTransaction: requestFunctions.postTransaction,
|
|
1530
|
+
getTransaction: requestFunctions.getTransaction,
|
|
1531
|
+
putTransaction: requestFunctions.putTransaction,
|
|
1532
|
+
deleteTransaction: requestFunctions.deleteTransaction,
|
|
1533
|
+
});
|
|
1534
|
+
|
|
1475
1535
|
export const webhookServiceBuilder = (
|
|
1476
1536
|
requestFunctions: OperationRequestFunctionMap
|
|
1477
1537
|
) => ({
|
|
@@ -1651,6 +1711,11 @@ export interface Operations {
|
|
|
1651
1711
|
putMonitor: typeof putMonitorOperation;
|
|
1652
1712
|
deleteMonitor: typeof deleteMonitorOperation;
|
|
1653
1713
|
postMonitorFlag: typeof postMonitorFlagOperation;
|
|
1714
|
+
getTransactions: typeof getTransactionsOperation;
|
|
1715
|
+
postTransaction: typeof postTransactionOperation;
|
|
1716
|
+
getTransaction: typeof getTransactionOperation;
|
|
1717
|
+
putTransaction: typeof putTransactionOperation;
|
|
1718
|
+
deleteTransaction: typeof deleteTransactionOperation;
|
|
1654
1719
|
providerCheckWebhook: typeof providerCheckWebhookOperation;
|
|
1655
1720
|
providerWebhook: typeof providerWebhookOperation;
|
|
1656
1721
|
actionAdhoc: typeof actionAdhocOperation;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { RequestFunction } from "@openapi-io-ts/runtime";
|
|
2
|
+
import * as schemas from "../components/schemas";
|
|
3
|
+
|
|
4
|
+
export const postTransactionOperation = {
|
|
5
|
+
path: "/api/transaction",
|
|
6
|
+
method: "post",
|
|
7
|
+
responses: {
|
|
8
|
+
"200": { _tag: "JsonResponse", decoder: schemas.Transaction },
|
|
9
|
+
default: { _tag: "JsonResponse", decoder: schemas.Error },
|
|
10
|
+
},
|
|
11
|
+
parameters: [],
|
|
12
|
+
requestDefaultHeaders: {
|
|
13
|
+
"Content-Type": "application/json",
|
|
14
|
+
Accept: "application/json",
|
|
15
|
+
},
|
|
16
|
+
body: {
|
|
17
|
+
_tag: "JsonBody",
|
|
18
|
+
},
|
|
19
|
+
} as const;
|
|
20
|
+
|
|
21
|
+
export type PostTransactionRequestFunction = RequestFunction<
|
|
22
|
+
{ body: schemas.Transaction },
|
|
23
|
+
schemas.Transaction
|
|
24
|
+
>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { RequestFunction } from "@openapi-io-ts/runtime";
|
|
2
|
+
import * as schemas from "../components/schemas";
|
|
3
|
+
|
|
4
|
+
export type PutTransactionRequestParameters = {
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const putTransactionOperation = {
|
|
9
|
+
path: "/api/transaction/{id}",
|
|
10
|
+
method: "put",
|
|
11
|
+
responses: {
|
|
12
|
+
"200": { _tag: "JsonResponse", decoder: schemas.Transaction },
|
|
13
|
+
default: { _tag: "JsonResponse", decoder: schemas.Error },
|
|
14
|
+
},
|
|
15
|
+
parameters: [
|
|
16
|
+
{
|
|
17
|
+
_tag: "FormParameter",
|
|
18
|
+
explode: false,
|
|
19
|
+
in: "path",
|
|
20
|
+
name: "id",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
requestDefaultHeaders: {
|
|
24
|
+
"Content-Type": "application/json",
|
|
25
|
+
Accept: "application/json",
|
|
26
|
+
},
|
|
27
|
+
body: {
|
|
28
|
+
_tag: "JsonBody",
|
|
29
|
+
},
|
|
30
|
+
} as const;
|
|
31
|
+
|
|
32
|
+
export type PutTransactionRequestFunction = RequestFunction<
|
|
33
|
+
{ params: PutTransactionRequestParameters; body: schemas.Transaction },
|
|
34
|
+
schemas.Transaction
|
|
35
|
+
>;
|