triqai 0.2.7 → 0.3.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/CHANGELOG.md +25 -0
- package/README.md +48 -3
- package/dist/index.cjs +73 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +216 -23
- package/dist/index.d.ts +216 -23
- package/dist/index.js +73 -16
- package/dist/index.js.map +1 -1
- package/openapi-public.yaml +233 -28
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -135,10 +135,18 @@ type components = {
|
|
|
135
135
|
/** @enum {boolean} */
|
|
136
136
|
success: true;
|
|
137
137
|
};
|
|
138
|
+
/**
|
|
139
|
+
* @description Category path from the most specific category up to its top-level category.
|
|
140
|
+
* For example, a parking payment has `primary` Parking, `secondary` Vehicle Services
|
|
141
|
+
* and `tertiary` Transportation.
|
|
142
|
+
*/
|
|
138
143
|
CategoryStructure: {
|
|
139
144
|
confidence: components["schemas"]["ConfidenceWithReasons"];
|
|
145
|
+
/** @description The most specific category assigned. */
|
|
140
146
|
primary: components["schemas"]["Category"];
|
|
147
|
+
/** @description Parent of `primary`, or `null` when `primary` is a top-level category. */
|
|
141
148
|
secondary: components["schemas"]["Category"] | null;
|
|
149
|
+
/** @description Parent of `secondary`, or `null` when the category is fewer than three levels deep. */
|
|
142
150
|
tertiary: components["schemas"]["Category"] | null;
|
|
143
151
|
};
|
|
144
152
|
ClientDisconnectedErrorResponse: {
|
|
@@ -176,6 +184,11 @@ type components = {
|
|
|
176
184
|
/** @enum {string} */
|
|
177
185
|
code: "DUPLICATE_REQUEST";
|
|
178
186
|
details: {
|
|
187
|
+
/**
|
|
188
|
+
* @description Present when the key was already used for a different request (`state=completed`). The stored result is not returned.
|
|
189
|
+
* @enum {string}
|
|
190
|
+
*/
|
|
191
|
+
reason?: "payload_mismatch";
|
|
179
192
|
requestId: string;
|
|
180
193
|
retryAfterSeconds?: number;
|
|
181
194
|
/** @enum {string} */
|
|
@@ -229,10 +242,12 @@ type components = {
|
|
|
229
242
|
};
|
|
230
243
|
/**
|
|
231
244
|
* @description Optional enrichment controls. Use `filters` to skip specific entity types,
|
|
232
|
-
*
|
|
245
|
+
* pre-fill known entity data to improve accuracy and reduce latency, or set
|
|
246
|
+
* `p2p` when you already know whether the payment went to a person.
|
|
233
247
|
*
|
|
234
248
|
* **Mutual exclusivity:** a filter flag (e.g. `noMerchant`) cannot be combined with
|
|
235
|
-
* pre-filled data for the same entity type
|
|
249
|
+
* pre-filled data for the same entity type, and `p2p: true` cannot be combined with
|
|
250
|
+
* pre-filled `merchant` data.
|
|
236
251
|
*/
|
|
237
252
|
EnrichRequestOptions: {
|
|
238
253
|
filters?: components["schemas"]["EnrichmentFilterOptions"];
|
|
@@ -240,7 +255,21 @@ type components = {
|
|
|
240
255
|
intermediaries?: components["schemas"]["PrefilledIntermediary"][];
|
|
241
256
|
location?: components["schemas"]["PrefilledLocation"];
|
|
242
257
|
merchant?: components["schemas"]["PrefilledMerchant"];
|
|
243
|
-
|
|
258
|
+
/**
|
|
259
|
+
* @description Whether the transaction is a person-to-person transfer, when you know it from the
|
|
260
|
+
* payment rail (for example an account transfer to a payee, or a card payment).
|
|
261
|
+
*
|
|
262
|
+
* - `true`: the counterparty is a private person. No merchant is returned; the
|
|
263
|
+
* response has a `person` entity when the title names the person, and the
|
|
264
|
+
* `Peer to Peer` category.
|
|
265
|
+
* - `false`: the counterparty is a business or organization. No `person` entity
|
|
266
|
+
* and never the `Peer to Peer` category.
|
|
267
|
+
* - Omitted: Triqai decides from the title and web evidence.
|
|
268
|
+
*
|
|
269
|
+
* Requests with different `p2p` values are cached separately.
|
|
270
|
+
*/
|
|
271
|
+
p2p?: boolean;
|
|
272
|
+
} & (unknown & unknown & unknown & unknown);
|
|
244
273
|
EnrichSuccessResponse: {
|
|
245
274
|
data: components["schemas"]["EnrichmentData"];
|
|
246
275
|
meta: components["schemas"]["EnrichMeta"];
|
|
@@ -248,9 +277,18 @@ type components = {
|
|
|
248
277
|
/** @enum {boolean} */
|
|
249
278
|
success: true;
|
|
250
279
|
};
|
|
251
|
-
|
|
280
|
+
/** @description An entity linked to the transaction. `type` selects the shape of `data`. */
|
|
281
|
+
EntityResult: components["schemas"]["MerchantEntityResult"] | components["schemas"]["LocationEntityResult"] | components["schemas"]["IntermediaryEntityResult"] | components["schemas"]["PersonEntityResult"];
|
|
282
|
+
EntityResultBase: {
|
|
252
283
|
confidence: components["schemas"]["ConfidenceWithReasons"];
|
|
253
|
-
|
|
284
|
+
/**
|
|
285
|
+
* @description Short AI-written explanation of why this entity was linked to the transaction.
|
|
286
|
+
* Use it for display or debugging only: the wording varies, so don't parse it.
|
|
287
|
+
* Optional and never `null`. It's returned when a stored explanation exists, for
|
|
288
|
+
* example on `GET /v1/transactions`, `GET /v1/transactions/{id}` and enrichment
|
|
289
|
+
* results reused from an earlier request, and omitted otherwise.
|
|
290
|
+
*/
|
|
291
|
+
reasoning?: string;
|
|
254
292
|
role: string;
|
|
255
293
|
/** @enum {string} */
|
|
256
294
|
type: "merchant" | "location" | "intermediary" | "person";
|
|
@@ -294,6 +332,25 @@ type components = {
|
|
|
294
332
|
name: string;
|
|
295
333
|
website: string | null;
|
|
296
334
|
};
|
|
335
|
+
IntermediaryEntityData: components["schemas"]["IntermediaryData"] & {
|
|
336
|
+
/**
|
|
337
|
+
* @description Category of a recognized platform, such as a food delivery app. Returned for
|
|
338
|
+
* those platforms on `GET /v1/transactions` and `GET /v1/transactions/{id}`;
|
|
339
|
+
* enrichment responses may omit it. Absent for other intermediaries.
|
|
340
|
+
*/
|
|
341
|
+
category?: components["schemas"]["CategoryStructure"];
|
|
342
|
+
};
|
|
343
|
+
IntermediaryEntityResult: components["schemas"]["EntityResultBase"] & {
|
|
344
|
+
data: components["schemas"]["IntermediaryEntityData"];
|
|
345
|
+
/** @enum {string} */
|
|
346
|
+
type: "intermediary";
|
|
347
|
+
} & {
|
|
348
|
+
/**
|
|
349
|
+
* @description discriminator enum property added by openapi-typescript
|
|
350
|
+
* @enum {string}
|
|
351
|
+
*/
|
|
352
|
+
type: "intermediary";
|
|
353
|
+
};
|
|
297
354
|
IntermediaryRecord: components["schemas"]["IntermediaryData"] & {
|
|
298
355
|
role: string;
|
|
299
356
|
};
|
|
@@ -352,6 +409,17 @@ type components = {
|
|
|
352
409
|
/** @description Location-specific website URL. May be absent. */
|
|
353
410
|
website?: string | null;
|
|
354
411
|
};
|
|
412
|
+
LocationEntityResult: components["schemas"]["EntityResultBase"] & {
|
|
413
|
+
data: components["schemas"]["LocationData"];
|
|
414
|
+
/** @enum {string} */
|
|
415
|
+
type: "location";
|
|
416
|
+
} & {
|
|
417
|
+
/**
|
|
418
|
+
* @description discriminator enum property added by openapi-typescript
|
|
419
|
+
* @enum {string}
|
|
420
|
+
*/
|
|
421
|
+
type: "location";
|
|
422
|
+
};
|
|
355
423
|
LocationRating: {
|
|
356
424
|
average: number;
|
|
357
425
|
count: number;
|
|
@@ -395,6 +463,17 @@ type components = {
|
|
|
395
463
|
name: string;
|
|
396
464
|
website: string | null;
|
|
397
465
|
};
|
|
466
|
+
MerchantEntityResult: components["schemas"]["EntityResultBase"] & {
|
|
467
|
+
data: components["schemas"]["MerchantEntityData"];
|
|
468
|
+
/** @enum {string} */
|
|
469
|
+
type: "merchant";
|
|
470
|
+
} & {
|
|
471
|
+
/**
|
|
472
|
+
* @description discriminator enum property added by openapi-typescript
|
|
473
|
+
* @enum {string}
|
|
474
|
+
*/
|
|
475
|
+
type: "merchant";
|
|
476
|
+
};
|
|
398
477
|
MerchantResponse: {
|
|
399
478
|
data: {
|
|
400
479
|
merchant: components["schemas"]["MerchantData"];
|
|
@@ -412,6 +491,17 @@ type components = {
|
|
|
412
491
|
PersonData: {
|
|
413
492
|
displayName: string;
|
|
414
493
|
};
|
|
494
|
+
PersonEntityResult: components["schemas"]["EntityResultBase"] & {
|
|
495
|
+
data: components["schemas"]["PersonData"];
|
|
496
|
+
/** @enum {string} */
|
|
497
|
+
type: "person";
|
|
498
|
+
} & {
|
|
499
|
+
/**
|
|
500
|
+
* @description discriminator enum property added by openapi-typescript
|
|
501
|
+
* @enum {string}
|
|
502
|
+
*/
|
|
503
|
+
type: "person";
|
|
504
|
+
};
|
|
415
505
|
/**
|
|
416
506
|
* @description Supply known intermediary (payment processor) data.
|
|
417
507
|
* When `id` is provided, the intermediary is resolved by primary key (returns 422 if not found).
|
|
@@ -642,7 +732,12 @@ type components = {
|
|
|
642
732
|
"application/json": components["schemas"]["ErrorResponse"];
|
|
643
733
|
};
|
|
644
734
|
};
|
|
645
|
-
/**
|
|
735
|
+
/**
|
|
736
|
+
* @description Rate limit exceeded. Organization limits send the `X-RateLimit-*` headers.
|
|
737
|
+
* Requests with a missing or malformed API key, and repeated API key lookups from
|
|
738
|
+
* one IP address, have separate limits whose 429s send only `Retry-After`, without
|
|
739
|
+
* any `X-RateLimit-*` header.
|
|
740
|
+
*/
|
|
646
741
|
RateLimited: {
|
|
647
742
|
headers: {
|
|
648
743
|
/** @description Seconds until retry is allowed */
|
|
@@ -651,13 +746,20 @@ type components = {
|
|
|
651
746
|
"X-RateLimit-Concurrency-Limit"?: number;
|
|
652
747
|
/** @description Remaining concurrent request slots */
|
|
653
748
|
"X-RateLimit-Concurrency-Remaining"?: number;
|
|
654
|
-
/**
|
|
749
|
+
/**
|
|
750
|
+
* @description Limit named by `X-RateLimit-Scope`. For `rps`, the sustained requests per second.
|
|
751
|
+
* For `concurrency`, the maximum concurrent in-flight requests.
|
|
752
|
+
*/
|
|
655
753
|
"X-RateLimit-Limit"?: number;
|
|
656
|
-
/**
|
|
754
|
+
/**
|
|
755
|
+
* @description Remaining capacity for the limit named by `X-RateLimit-Scope`. For `rps`, the
|
|
756
|
+
* token-bucket requests left (0 when throttled). For `concurrency`, the free
|
|
757
|
+
* concurrent request slots.
|
|
758
|
+
*/
|
|
657
759
|
"X-RateLimit-Remaining"?: number;
|
|
658
|
-
/** @description
|
|
760
|
+
/** @description Time when the limit named by `X-RateLimit-Scope` is expected to admit a new request. */
|
|
659
761
|
"X-RateLimit-Reset"?: string;
|
|
660
|
-
/** @description
|
|
762
|
+
/** @description Limit that rejected the request. */
|
|
661
763
|
"X-RateLimit-Scope"?: "rps" | "concurrency";
|
|
662
764
|
[name: string]: unknown;
|
|
663
765
|
};
|
|
@@ -679,7 +781,10 @@ type components = {
|
|
|
679
781
|
"application/json": components["schemas"]["ErrorResponse"];
|
|
680
782
|
};
|
|
681
783
|
};
|
|
682
|
-
/**
|
|
784
|
+
/**
|
|
785
|
+
* @description Service temporarily unavailable, for example when authentication or the rate-limit
|
|
786
|
+
* and credit check can't complete. Retry after `Retry-After` seconds.
|
|
787
|
+
*/
|
|
683
788
|
ServiceUnavailable: {
|
|
684
789
|
headers: {
|
|
685
790
|
/** @description Seconds until retry is allowed */
|
|
@@ -713,7 +818,10 @@ type components = {
|
|
|
713
818
|
"application/json": components["schemas"]["ErrorResponse"];
|
|
714
819
|
};
|
|
715
820
|
};
|
|
716
|
-
/**
|
|
821
|
+
/**
|
|
822
|
+
* @description Request validation failed. Every endpoint returns this for a malformed `Idempotency-Key`
|
|
823
|
+
* or `X-Idempotency-Key` header, or when both headers are sent with different values.
|
|
824
|
+
*/
|
|
717
825
|
ValidationError: {
|
|
718
826
|
headers: {
|
|
719
827
|
[name: string]: unknown;
|
|
@@ -770,6 +878,7 @@ interface operations {
|
|
|
770
878
|
"application/json": components["schemas"]["HealthResponse"];
|
|
771
879
|
};
|
|
772
880
|
};
|
|
881
|
+
422: components["responses"]["ValidationError"];
|
|
773
882
|
};
|
|
774
883
|
};
|
|
775
884
|
getHealth: {
|
|
@@ -790,6 +899,7 @@ interface operations {
|
|
|
790
899
|
"application/json": components["schemas"]["HealthResponse"];
|
|
791
900
|
};
|
|
792
901
|
};
|
|
902
|
+
422: components["responses"]["ValidationError"];
|
|
793
903
|
};
|
|
794
904
|
};
|
|
795
905
|
getApiInfo: {
|
|
@@ -812,6 +922,10 @@ interface operations {
|
|
|
812
922
|
};
|
|
813
923
|
401: components["responses"]["Unauthorized"];
|
|
814
924
|
403: components["responses"]["Forbidden"];
|
|
925
|
+
422: components["responses"]["ValidationError"];
|
|
926
|
+
429: components["responses"]["RateLimited"];
|
|
927
|
+
500: components["responses"]["InternalError"];
|
|
928
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
815
929
|
};
|
|
816
930
|
};
|
|
817
931
|
searchBanks: {
|
|
@@ -850,6 +964,7 @@ interface operations {
|
|
|
850
964
|
422: components["responses"]["ValidationError"];
|
|
851
965
|
429: components["responses"]["RateLimited"];
|
|
852
966
|
500: components["responses"]["InternalError"];
|
|
967
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
853
968
|
};
|
|
854
969
|
};
|
|
855
970
|
getBank: {
|
|
@@ -878,6 +993,7 @@ interface operations {
|
|
|
878
993
|
422: components["responses"]["ValidationError"];
|
|
879
994
|
429: components["responses"]["RateLimited"];
|
|
880
995
|
500: components["responses"]["InternalError"];
|
|
996
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
881
997
|
};
|
|
882
998
|
};
|
|
883
999
|
listCategories: {
|
|
@@ -900,8 +1016,10 @@ interface operations {
|
|
|
900
1016
|
};
|
|
901
1017
|
401: components["responses"]["Unauthorized"];
|
|
902
1018
|
403: components["responses"]["Forbidden"];
|
|
1019
|
+
422: components["responses"]["ValidationError"];
|
|
903
1020
|
429: components["responses"]["RateLimited"];
|
|
904
1021
|
500: components["responses"]["InternalError"];
|
|
1022
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
905
1023
|
};
|
|
906
1024
|
};
|
|
907
1025
|
getIntermediary: {
|
|
@@ -930,6 +1048,7 @@ interface operations {
|
|
|
930
1048
|
422: components["responses"]["ValidationError"];
|
|
931
1049
|
429: components["responses"]["RateLimited"];
|
|
932
1050
|
500: components["responses"]["InternalError"];
|
|
1051
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
933
1052
|
};
|
|
934
1053
|
};
|
|
935
1054
|
getLocation: {
|
|
@@ -958,6 +1077,7 @@ interface operations {
|
|
|
958
1077
|
422: components["responses"]["ValidationError"];
|
|
959
1078
|
429: components["responses"]["RateLimited"];
|
|
960
1079
|
500: components["responses"]["InternalError"];
|
|
1080
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
961
1081
|
};
|
|
962
1082
|
};
|
|
963
1083
|
getMerchant: {
|
|
@@ -986,12 +1106,15 @@ interface operations {
|
|
|
986
1106
|
422: components["responses"]["ValidationError"];
|
|
987
1107
|
429: components["responses"]["RateLimited"];
|
|
988
1108
|
500: components["responses"]["InternalError"];
|
|
1109
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
989
1110
|
};
|
|
990
1111
|
};
|
|
991
1112
|
listIssueReports: {
|
|
992
1113
|
parameters: {
|
|
993
1114
|
query?: {
|
|
1115
|
+
/** @description Page number, at most 10000. Values below 1 are treated as 1. */
|
|
994
1116
|
page?: number;
|
|
1117
|
+
/** @description Page size, at most 100. Larger values are capped at 100 instead of being rejected, and values below 1 are treated as 1. */
|
|
995
1118
|
size?: number;
|
|
996
1119
|
status?: components["schemas"]["IssueReportStatus"];
|
|
997
1120
|
transaction_id?: string;
|
|
@@ -1016,6 +1139,7 @@ interface operations {
|
|
|
1016
1139
|
422: components["responses"]["ValidationError"];
|
|
1017
1140
|
429: components["responses"]["RateLimited"];
|
|
1018
1141
|
500: components["responses"]["InternalError"];
|
|
1142
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
1019
1143
|
};
|
|
1020
1144
|
};
|
|
1021
1145
|
createIssueReport: {
|
|
@@ -1025,6 +1149,7 @@ interface operations {
|
|
|
1025
1149
|
path?: never;
|
|
1026
1150
|
cookie?: never;
|
|
1027
1151
|
};
|
|
1152
|
+
/** @description The request body must not exceed 32,768 bytes. */
|
|
1028
1153
|
requestBody: {
|
|
1029
1154
|
content: {
|
|
1030
1155
|
"application/json": components["schemas"]["ReportIssueRequest"];
|
|
@@ -1046,6 +1171,7 @@ interface operations {
|
|
|
1046
1171
|
422: components["responses"]["ValidationError"];
|
|
1047
1172
|
429: components["responses"]["RateLimited"];
|
|
1048
1173
|
500: components["responses"]["InternalError"];
|
|
1174
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
1049
1175
|
};
|
|
1050
1176
|
};
|
|
1051
1177
|
getIssueReport: {
|
|
@@ -1074,16 +1200,18 @@ interface operations {
|
|
|
1074
1200
|
422: components["responses"]["ValidationError"];
|
|
1075
1201
|
429: components["responses"]["RateLimited"];
|
|
1076
1202
|
500: components["responses"]["InternalError"];
|
|
1203
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
1077
1204
|
};
|
|
1078
1205
|
};
|
|
1079
1206
|
listTransactions: {
|
|
1080
1207
|
parameters: {
|
|
1081
1208
|
query?: {
|
|
1082
|
-
/** @description Inclusive upper bound (ISO 8601 timestamp) */
|
|
1209
|
+
/** @description Inclusive upper bound (ISO 8601 date or timestamp between 0001-01-01 and 9999-12-31 UTC). */
|
|
1083
1210
|
endDate?: string;
|
|
1211
|
+
/** @description Page number, at most 10000. */
|
|
1084
1212
|
page?: number;
|
|
1085
1213
|
size?: number;
|
|
1086
|
-
/** @description Inclusive lower bound (ISO 8601 timestamp) */
|
|
1214
|
+
/** @description Inclusive lower bound (ISO 8601 date or timestamp between 0001-01-01 and 9999-12-31 UTC). */
|
|
1087
1215
|
startDate?: string;
|
|
1088
1216
|
};
|
|
1089
1217
|
header?: never;
|
|
@@ -1106,6 +1234,7 @@ interface operations {
|
|
|
1106
1234
|
422: components["responses"]["ValidationError"];
|
|
1107
1235
|
429: components["responses"]["RateLimited"];
|
|
1108
1236
|
500: components["responses"]["InternalError"];
|
|
1237
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
1109
1238
|
};
|
|
1110
1239
|
};
|
|
1111
1240
|
getTransaction: {
|
|
@@ -1134,6 +1263,7 @@ interface operations {
|
|
|
1134
1263
|
422: components["responses"]["ValidationError"];
|
|
1135
1264
|
429: components["responses"]["RateLimited"];
|
|
1136
1265
|
500: components["responses"]["InternalError"];
|
|
1266
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
1137
1267
|
};
|
|
1138
1268
|
};
|
|
1139
1269
|
deleteTransaction: {
|
|
@@ -1198,7 +1328,7 @@ interface operations {
|
|
|
1198
1328
|
countTransactions: {
|
|
1199
1329
|
parameters: {
|
|
1200
1330
|
query?: {
|
|
1201
|
-
/** @description Only count transactions created on or after this ISO 8601 timestamp. */
|
|
1331
|
+
/** @description Only count transactions created on or after this ISO 8601 date or timestamp (between 0001-01-01 and 9999-12-31 UTC). */
|
|
1202
1332
|
afterDate?: string;
|
|
1203
1333
|
};
|
|
1204
1334
|
header?: never;
|
|
@@ -1221,14 +1351,15 @@ interface operations {
|
|
|
1221
1351
|
422: components["responses"]["ValidationError"];
|
|
1222
1352
|
429: components["responses"]["RateLimited"];
|
|
1223
1353
|
500: components["responses"]["InternalError"];
|
|
1354
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
1224
1355
|
};
|
|
1225
1356
|
};
|
|
1226
1357
|
enrichTransaction: {
|
|
1227
1358
|
parameters: {
|
|
1228
1359
|
query?: never;
|
|
1229
|
-
header
|
|
1230
|
-
/** @description
|
|
1231
|
-
"Idempotency-Key"
|
|
1360
|
+
header?: {
|
|
1361
|
+
/** @description Optional. One key per bank transaction, used only for that request. A retry of the same request with this key returns the stored result without a charge; a different request with it returns `409` with `details.reason=payload_mismatch`. Without a key, every request is a new, charged enrichment. `X-Idempotency-Key` is also accepted and must match when both are sent. */
|
|
1362
|
+
"Idempotency-Key"?: string;
|
|
1232
1363
|
};
|
|
1233
1364
|
path?: never;
|
|
1234
1365
|
cookie?: never;
|
|
@@ -1303,6 +1434,9 @@ type TransactionPagination = components["schemas"]["TransactionPagination"];
|
|
|
1303
1434
|
type TransactionListResponse = components["schemas"]["TransactionListResponse"];
|
|
1304
1435
|
type TransactionDetailResponse = components["schemas"]["TransactionDetailResponse"];
|
|
1305
1436
|
type DeleteTransactionResponse = components["schemas"]["DeleteTransactionResponse"];
|
|
1437
|
+
type TransactionCountResponse = components["schemas"]["TransactionCountResponse"];
|
|
1438
|
+
type BatchDeleteRequest = components["schemas"]["BatchDeleteRequest"];
|
|
1439
|
+
type BatchDeleteResponse = components["schemas"]["BatchDeleteResponse"];
|
|
1306
1440
|
type CategoryStructure = components["schemas"]["CategoryStructure"];
|
|
1307
1441
|
type Category = components["schemas"]["Category"];
|
|
1308
1442
|
type CategoryCode = components["schemas"]["CategoryCode"];
|
|
@@ -1383,7 +1517,12 @@ interface RateLimitInfo {
|
|
|
1383
1517
|
retryAfter?: number;
|
|
1384
1518
|
}
|
|
1385
1519
|
interface EnrichOptions {
|
|
1386
|
-
/**
|
|
1520
|
+
/**
|
|
1521
|
+
* @deprecated Has no effect. The API never supported a cache bypass: the
|
|
1522
|
+
* public contract defines no `force` parameter and no endpoint reads one.
|
|
1523
|
+
* The SDK no longer sends it. The option remains only so existing code
|
|
1524
|
+
* still compiles, and may be removed in a future major version.
|
|
1525
|
+
*/
|
|
1387
1526
|
force?: boolean;
|
|
1388
1527
|
/** Defaults to a UUID per enrich call, reused across automatic retries. Supply a stable key to retry across calls. Must match ^[a-zA-Z0-9_-]{1,64}$. */
|
|
1389
1528
|
idempotencyKey?: string;
|
|
@@ -1396,6 +1535,17 @@ interface ListTransactionsParams {
|
|
|
1396
1535
|
/** Inclusive upper bound (ISO 8601 timestamp or Date). */
|
|
1397
1536
|
endDate?: string | Date;
|
|
1398
1537
|
}
|
|
1538
|
+
interface CountTransactionsParams {
|
|
1539
|
+
/** Count only transactions created on or after this ISO 8601 timestamp or Date. */
|
|
1540
|
+
afterDate?: string | Date;
|
|
1541
|
+
}
|
|
1542
|
+
/**
|
|
1543
|
+
* Exactly one of `{ all: true }`, `{ afterDate }`, or `{ ids }` (at most 1000 UUIDs).
|
|
1544
|
+
* `afterDate` also accepts a Date.
|
|
1545
|
+
*/
|
|
1546
|
+
type BatchDeleteTransactionsParams = BatchDeleteRequest | {
|
|
1547
|
+
afterDate: Date;
|
|
1548
|
+
};
|
|
1399
1549
|
interface ListIssueReportsParams {
|
|
1400
1550
|
page?: number;
|
|
1401
1551
|
size?: number;
|
|
@@ -1423,7 +1573,7 @@ declare class HttpClient {
|
|
|
1423
1573
|
constructor(apiKey: string, config?: TriqaiConfig);
|
|
1424
1574
|
get<T>(path: string, query?: Record<string, unknown>): Promise<HttpResponse<T>>;
|
|
1425
1575
|
post<T>(path: string, body?: unknown): Promise<HttpResponse<T>>;
|
|
1426
|
-
delete<T>(path: string): Promise<HttpResponse<T>>;
|
|
1576
|
+
delete<T>(path: string, body?: unknown): Promise<HttpResponse<T>>;
|
|
1427
1577
|
private request;
|
|
1428
1578
|
/**
|
|
1429
1579
|
* Variant that injects custom headers (used by resources for Idempotency-Key etc.).
|
|
@@ -1619,7 +1769,7 @@ declare class Transactions {
|
|
|
1619
1769
|
* Enrich a transaction with merchant, category, location, and entity data.
|
|
1620
1770
|
*
|
|
1621
1771
|
* @param request - The transaction to enrich (title, country, type, and optional options).
|
|
1622
|
-
* @param options - Optional enrichment controls (
|
|
1772
|
+
* @param options - Optional enrichment controls (idempotency key).
|
|
1623
1773
|
* @returns The enriched transaction data.
|
|
1624
1774
|
*
|
|
1625
1775
|
* @example
|
|
@@ -1651,6 +1801,18 @@ declare class Transactions {
|
|
|
1651
1801
|
* ```
|
|
1652
1802
|
*/
|
|
1653
1803
|
list(params?: ListTransactionsParams): Promise<Page<EnrichedTransaction>>;
|
|
1804
|
+
/**
|
|
1805
|
+
* Count your organization's transactions.
|
|
1806
|
+
*
|
|
1807
|
+
* @param params - Optional `afterDate` to count only transactions created on or after it.
|
|
1808
|
+
* @returns The number of matching transactions.
|
|
1809
|
+
*
|
|
1810
|
+
* @example
|
|
1811
|
+
* ```ts
|
|
1812
|
+
* const { count } = await triqai.transactions.count({ afterDate: "2026-01-01T00:00:00Z" });
|
|
1813
|
+
* ```
|
|
1814
|
+
*/
|
|
1815
|
+
count(params?: CountTransactionsParams): Promise<TransactionCountResponse["data"]>;
|
|
1654
1816
|
/**
|
|
1655
1817
|
* Get a single transaction by ID.
|
|
1656
1818
|
*
|
|
@@ -1668,6 +1830,26 @@ declare class Transactions {
|
|
|
1668
1830
|
deleted: true;
|
|
1669
1831
|
transactionId: string;
|
|
1670
1832
|
}>;
|
|
1833
|
+
/**
|
|
1834
|
+
* Delete many transactions in one request.
|
|
1835
|
+
*
|
|
1836
|
+
* Pass exactly one of `all: true` (every transaction in your organization),
|
|
1837
|
+
* `afterDate` (transactions created on or after it), or `ids` (at most 1000
|
|
1838
|
+
* UUIDs). The API rejects any other combination with a 422 `ValidationError`.
|
|
1839
|
+
* A 503 means cleanup is incomplete; like other DELETE requests, it is retried
|
|
1840
|
+
* automatically, and `count` then covers only the final attempt.
|
|
1841
|
+
*
|
|
1842
|
+
* @param request - The single selection mode.
|
|
1843
|
+
* @returns Confirmation with the number of transactions deleted.
|
|
1844
|
+
*
|
|
1845
|
+
* @example
|
|
1846
|
+
* ```ts
|
|
1847
|
+
* const { count } = await triqai.transactions.batchDelete({
|
|
1848
|
+
* ids: ["550e8400-e29b-41d4-a716-446655440000"],
|
|
1849
|
+
* });
|
|
1850
|
+
* ```
|
|
1851
|
+
*/
|
|
1852
|
+
batchDelete(request: BatchDeleteTransactionsParams): Promise<BatchDeleteResponse["data"]>;
|
|
1671
1853
|
}
|
|
1672
1854
|
|
|
1673
1855
|
/**
|
|
@@ -1687,7 +1869,7 @@ declare class Transactions {
|
|
|
1687
1869
|
* ```
|
|
1688
1870
|
*/
|
|
1689
1871
|
declare class Triqai {
|
|
1690
|
-
/** Enrich, list, get, and delete transactions. */
|
|
1872
|
+
/** Enrich, list, count, get, and delete transactions. */
|
|
1691
1873
|
readonly transactions: Transactions;
|
|
1692
1874
|
/** List the full category taxonomy. */
|
|
1693
1875
|
readonly categories: Categories;
|
|
@@ -1813,14 +1995,25 @@ declare class ClientDisconnectedError extends TriqaiError {
|
|
|
1813
1995
|
}
|
|
1814
1996
|
declare class DuplicateRequestError extends TriqaiError {
|
|
1815
1997
|
readonly state: "in_progress" | "completed" | undefined;
|
|
1998
|
+
/** `payload_mismatch` when the key was already used for a different request. */
|
|
1999
|
+
readonly reason: string | undefined;
|
|
1816
2000
|
readonly duplicateRequestId: string | undefined;
|
|
1817
2001
|
readonly retryAfter: number | undefined;
|
|
1818
2002
|
constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2] & {
|
|
1819
2003
|
state?: "in_progress" | "completed";
|
|
2004
|
+
reason?: string;
|
|
1820
2005
|
duplicateRequestId?: string;
|
|
1821
2006
|
retryAfter?: number;
|
|
1822
2007
|
});
|
|
1823
2008
|
}
|
|
2009
|
+
/**
|
|
2010
|
+
* The enrichment cannot be stored because the transaction's data was erased
|
|
2011
|
+
* or the organization is inactive. Terminal: the SDK never retries it, and
|
|
2012
|
+
* callers should not either.
|
|
2013
|
+
*/
|
|
2014
|
+
declare class GoneError extends TriqaiError {
|
|
2015
|
+
constructor(message: string, opts?: ConstructorParameters<typeof TriqaiError>[2]);
|
|
2016
|
+
}
|
|
1824
2017
|
declare class RateLimitError extends TriqaiError {
|
|
1825
2018
|
readonly rateLimitInfo: RateLimitInfo;
|
|
1826
2019
|
constructor(message: string, rateLimitInfo: RateLimitInfo, opts?: ConstructorParameters<typeof TriqaiError>[2]);
|
|
@@ -1842,4 +2035,4 @@ declare class TimeoutError extends TriqaiError {
|
|
|
1842
2035
|
constructor(message: string);
|
|
1843
2036
|
}
|
|
1844
2037
|
|
|
1845
|
-
export { type ApiInfoResponse, AuthenticationError, AuthorizationError, type BankData, type BankResponse, type BankSearchParams, type BankSearchResponse, type Category, type CategoryCode, type CategoryInfo, type CategoryListResponse, type CategoryStructure, ClientDisconnectedError, type ClientDisconnectedErrorResponse, type ConfidenceWithReasons, ConnectionError, type Coordinates, type CreateIssueReportParams, type DeleteTransactionResponse, DuplicateRequestError, type DuplicateRequestErrorResponse, type EnrichMeta, type EnrichOptions, type EnrichRequest, type EnrichRequestOptions, type EnrichSuccessResponse, type EnrichedTransaction, type EnrichmentData, type EnrichmentErrorCode, type EnrichmentFieldPath, type EnrichmentFilterOptions, type EntityResult, type ErrorObject, type ErrorResponse, GatewayTimeoutError, type HealthResponse, type HttpResponse, InsufficientCreditsError, type IntermediaryData, type IntermediaryRecord, type IntermediaryResponse, InternalServerError, type IssueReport, type IssueReportListResponse, type IssueReportResponse, type IssueReportStatus, type ListIssueReportsParams, type ListTransactionsParams, type LocationData, type LocationRating, type LocationResponse, type MerchantData, type MerchantResponse, NotFoundError, Page, type PageInfo, type PaginationMeta, type PersonData, type PrefilledIntermediary, type PrefilledLocation, type PrefilledMerchant, RateLimitError, type RateLimitInfo, type RawErrorObject, type RawResponseMeta, type ReportIssueRequest, type RequestInfo, type ResponseInfo, type ResponseMeta, ServiceUnavailableError, type StructuredAddress, TimeoutError, type TransactionData, type TransactionDetailResponse, type TransactionListResponse, type TransactionPagination, type TransactionRecord, type TransactionType, Triqai, type TriqaiConfig, TriqaiError, ValidationError, Triqai as default };
|
|
2038
|
+
export { type ApiInfoResponse, AuthenticationError, AuthorizationError, type BankData, type BankResponse, type BankSearchParams, type BankSearchResponse, type BatchDeleteRequest, type BatchDeleteResponse, type BatchDeleteTransactionsParams, type Category, type CategoryCode, type CategoryInfo, type CategoryListResponse, type CategoryStructure, ClientDisconnectedError, type ClientDisconnectedErrorResponse, type ConfidenceWithReasons, ConnectionError, type Coordinates, type CountTransactionsParams, type CreateIssueReportParams, type DeleteTransactionResponse, DuplicateRequestError, type DuplicateRequestErrorResponse, type EnrichMeta, type EnrichOptions, type EnrichRequest, type EnrichRequestOptions, type EnrichSuccessResponse, type EnrichedTransaction, type EnrichmentData, type EnrichmentErrorCode, type EnrichmentFieldPath, type EnrichmentFilterOptions, type EntityResult, type ErrorObject, type ErrorResponse, GatewayTimeoutError, GoneError, type HealthResponse, type HttpResponse, InsufficientCreditsError, type IntermediaryData, type IntermediaryRecord, type IntermediaryResponse, InternalServerError, type IssueReport, type IssueReportListResponse, type IssueReportResponse, type IssueReportStatus, type ListIssueReportsParams, type ListTransactionsParams, type LocationData, type LocationRating, type LocationResponse, type MerchantData, type MerchantResponse, NotFoundError, Page, type PageInfo, type PaginationMeta, type PersonData, type PrefilledIntermediary, type PrefilledLocation, type PrefilledMerchant, RateLimitError, type RateLimitInfo, type RawErrorObject, type RawResponseMeta, type ReportIssueRequest, type RequestInfo, type ResponseInfo, type ResponseMeta, ServiceUnavailableError, type StructuredAddress, TimeoutError, type TransactionCountResponse, type TransactionData, type TransactionDetailResponse, type TransactionListResponse, type TransactionPagination, type TransactionRecord, type TransactionType, Triqai, type TriqaiConfig, TriqaiError, ValidationError, Triqai as default };
|