triqai 0.1.2 → 0.1.4

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.
@@ -1,7 +1,7 @@
1
1
  openapi: 3.1.0
2
2
  info:
3
3
  title: Triqai Transaction Enrichment API
4
- version: 1.1.10
4
+ version: 1.4.50
5
5
  description: |
6
6
  The Triqai API provides transaction enrichment capabilities for financial applications.
7
7
 
@@ -24,7 +24,7 @@ info:
24
24
 
25
25
  ## Idempotency
26
26
 
27
- You can supply `Idempotency-Key` (or `X-Idempotency-Key`) to make retries safer.
27
+ You must supply `Idempotency-Key` (or `X-Idempotency-Key`) for enrichment requests so retries preserve billing and persistence identity.
28
28
  Keys must match `^[a-zA-Z0-9_-]{1,64}$`.
29
29
  Reusing a key returns `409`:
30
30
  - `state=completed`: request with this key already finished
@@ -109,17 +109,10 @@ paths:
109
109
  description: Enriches a transaction and returns structured transaction + entity data.
110
110
  operationId: enrichTransaction
111
111
  parameters:
112
- - name: force
113
- in: query
114
- required: false
115
- description: Bypass cached result when true.
116
- schema:
117
- type: boolean
118
- default: false
119
112
  - name: Idempotency-Key
120
113
  in: header
121
- required: false
122
- description: Optional idempotency key. `X-Idempotency-Key` is also accepted and must match when both are sent.
114
+ required: true
115
+ description: Required retry identity. `X-Idempotency-Key` is also accepted and must match when both are sent.
123
116
  schema:
124
117
  type: string
125
118
  minLength: 1
@@ -311,6 +304,93 @@ paths:
311
304
  '500':
312
305
  $ref: '#/components/responses/InternalError'
313
306
 
307
+ /v1/transactions/count:
308
+ get:
309
+ tags:
310
+ - Transactions
311
+ summary: Count transactions
312
+ description: |
313
+ Returns the total number of transactions for the authenticated organization.
314
+ Optionally filter by `afterDate` to count only transactions created on or after a given date.
315
+ operationId: countTransactions
316
+ parameters:
317
+ - name: afterDate
318
+ in: query
319
+ required: false
320
+ description: Only count transactions created on or after this ISO 8601 timestamp.
321
+ schema:
322
+ type: string
323
+ format: date-time
324
+ responses:
325
+ '200':
326
+ description: Transaction count
327
+ content:
328
+ application/json:
329
+ schema:
330
+ $ref: '#/components/schemas/TransactionCountResponse'
331
+ '401':
332
+ $ref: '#/components/responses/Unauthorized'
333
+ '403':
334
+ $ref: '#/components/responses/Forbidden'
335
+ '422':
336
+ $ref: '#/components/responses/ValidationError'
337
+ '429':
338
+ $ref: '#/components/responses/RateLimited'
339
+ '500':
340
+ $ref: '#/components/responses/InternalError'
341
+
342
+ /v1/transactions/batch:
343
+ delete:
344
+ tags:
345
+ - Transactions
346
+ summary: Batch delete transactions
347
+ description: |
348
+ Delete multiple transactions in a single request. Provide exactly **one** of:
349
+ - `all: true` — delete every transaction for the organization
350
+ - `afterDate` — delete all transactions created on or after the given ISO 8601 date
351
+ - `ids` — delete specific transactions by UUID (max 1000)
352
+
353
+ Associated KV cache entries and DLQ entries are purged after deletion.
354
+ operationId: batchDeleteTransactions
355
+ requestBody:
356
+ required: true
357
+ content:
358
+ application/json:
359
+ schema:
360
+ $ref: '#/components/schemas/BatchDeleteRequest'
361
+ examples:
362
+ delete_all:
363
+ summary: Delete all transactions
364
+ value:
365
+ all: true
366
+ delete_by_date:
367
+ summary: Delete transactions after a date
368
+ value:
369
+ afterDate: '2026-01-01T00:00:00Z'
370
+ delete_by_ids:
371
+ summary: Delete specific transactions
372
+ value:
373
+ ids:
374
+ - 'f353ca91-4fc5-49f2-9b9e-304f83d11914'
375
+ - 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
376
+ responses:
377
+ '200':
378
+ description: Batch deletion completed
379
+ content:
380
+ application/json:
381
+ schema:
382
+ $ref: '#/components/schemas/BatchDeleteResponse'
383
+ '401':
384
+ $ref: '#/components/responses/Unauthorized'
385
+ '403':
386
+ $ref: '#/components/responses/Forbidden'
387
+ '422':
388
+ $ref: '#/components/responses/ValidationError'
389
+ '429':
390
+ $ref: '#/components/responses/RateLimited'
391
+ '500':
392
+ $ref: '#/components/responses/InternalError'
393
+
314
394
  /v1/categories:
315
395
  get:
316
396
  tags:
@@ -887,7 +967,10 @@ components:
887
967
 
888
968
  PrefilledLocation:
889
969
  type: object
890
- description: Supply known location context to improve enrichment accuracy.
970
+ description: |
971
+ Supply known location context to improve enrichment accuracy.
972
+ When `coordinates` are provided and `cityName` is not set, the API resolves them to a
973
+ place name via reverse-geocoding and uses it as a location hint for AI title dissection.
891
974
  properties:
892
975
  cityName:
893
976
  type: string
@@ -897,7 +980,10 @@ components:
897
980
  description: Whether the transaction happened at a physical location.
898
981
  coordinates:
899
982
  type: object
900
- description: GPS coordinates of the transaction.
983
+ description: |
984
+ GPS coordinates of the transaction. When provided without `cityName`, coordinates are
985
+ reverse-geocoded to resolve a place name. If no location is detected from transaction
986
+ title text, the reverse-geocoded place becomes the fallback location.
901
987
  required:
902
988
  - lat
903
989
  - lng
@@ -965,22 +1051,8 @@ components:
965
1051
  maximum: 100
966
1052
  reasons:
967
1053
  type: array
968
- description: |
969
- Confidence explanation tags. This list is dynamic and may evolve over time.
970
1054
  items:
971
1055
  type: string
972
- description: |
973
- Non-exhaustive confidence reason tag.
974
- examples:
975
- - known_processor_match
976
- - results_contradict
977
- - ambiguous_entity
978
- - broad_merchant_name
979
- - venue_or_attraction
980
- - merchant_location_crosscheck_corrected
981
- - merchant_location_crosscheck_recovered
982
- - merchant_location_mismatch
983
- - geo_mismatch
984
1056
 
985
1057
  CategoryCode:
986
1058
  type: object
@@ -1028,31 +1100,6 @@ components:
1028
1100
  confidence:
1029
1101
  $ref: '#/components/schemas/ConfidenceWithReasons'
1030
1102
 
1031
- SubscriptionType:
1032
- type: string
1033
- enum:
1034
- - streaming
1035
- - software
1036
- - news
1037
- - fitness
1038
- - mobile
1039
- - gaming
1040
- - utilities
1041
- - other
1042
-
1043
- Subscription:
1044
- type: object
1045
- required:
1046
- - recurring
1047
- - type
1048
- properties:
1049
- recurring:
1050
- type: boolean
1051
- type:
1052
- oneOf:
1053
- - $ref: '#/components/schemas/SubscriptionType'
1054
- - type: 'null'
1055
-
1056
1103
  Coordinates:
1057
1104
  type: object
1058
1105
  required:
@@ -1096,6 +1143,58 @@ components:
1096
1143
  type: string
1097
1144
 
1098
1145
  MerchantData:
1146
+ type: object
1147
+ required:
1148
+ - id
1149
+ - name
1150
+ - alias
1151
+ - icon
1152
+ - color
1153
+ - website
1154
+ - domain
1155
+ properties:
1156
+ id:
1157
+ type: string
1158
+ format: uuid
1159
+ name:
1160
+ type: string
1161
+ alias:
1162
+ type: array
1163
+ items:
1164
+ type: string
1165
+ keywords:
1166
+ type: array
1167
+ description: Search keywords associated with this merchant. May be absent.
1168
+ items:
1169
+ type: string
1170
+ icon:
1171
+ oneOf:
1172
+ - type: string
1173
+ format: uri
1174
+ - type: 'null'
1175
+ description:
1176
+ type: string
1177
+ description: Brief description of the merchant. May be absent.
1178
+ color:
1179
+ oneOf:
1180
+ - type: string
1181
+ - type: 'null'
1182
+ website:
1183
+ oneOf:
1184
+ - type: string
1185
+ format: uri
1186
+ - type: 'null'
1187
+ domain:
1188
+ oneOf:
1189
+ - type: string
1190
+ - type: 'null'
1191
+ category:
1192
+ oneOf:
1193
+ - $ref: '#/components/schemas/CategoryStructure'
1194
+ - type: 'null'
1195
+ description: Merchant category classification. Present on `GET /v1/merchants/{id}` responses.
1196
+
1197
+ MerchantEntityData:
1099
1198
  type: object
1100
1199
  required:
1101
1200
  - id
@@ -1272,7 +1371,7 @@ components:
1272
1371
  $ref: '#/components/schemas/ConfidenceWithReasons'
1273
1372
  data:
1274
1373
  oneOf:
1275
- - $ref: '#/components/schemas/MerchantData'
1374
+ - $ref: '#/components/schemas/MerchantEntityData'
1276
1375
  - $ref: '#/components/schemas/LocationData'
1277
1376
  - $ref: '#/components/schemas/IntermediaryData'
1278
1377
  - $ref: '#/components/schemas/PersonData'
@@ -1281,13 +1380,10 @@ components:
1281
1380
  type: object
1282
1381
  required:
1283
1382
  - category
1284
- - subscription
1285
1383
  - confidence
1286
1384
  properties:
1287
1385
  category:
1288
1386
  $ref: '#/components/schemas/CategoryStructure'
1289
- subscription:
1290
- $ref: '#/components/schemas/Subscription'
1291
1387
  confidence:
1292
1388
  $ref: '#/components/schemas/ConfidenceWithReasons'
1293
1389
 
@@ -1480,6 +1576,80 @@ components:
1480
1576
  meta:
1481
1577
  $ref: '#/components/schemas/ResponseMeta'
1482
1578
 
1579
+ TransactionCountResponse:
1580
+ type: object
1581
+ required:
1582
+ - success
1583
+ - data
1584
+ - meta
1585
+ properties:
1586
+ success:
1587
+ type: boolean
1588
+ enum: [true]
1589
+ data:
1590
+ type: object
1591
+ required:
1592
+ - count
1593
+ properties:
1594
+ count:
1595
+ type: integer
1596
+ minimum: 0
1597
+ meta:
1598
+ $ref: '#/components/schemas/ResponseMeta'
1599
+
1600
+ BatchDeleteRequest:
1601
+ type: object
1602
+ description: |
1603
+ Provide exactly one of `all`, `afterDate`, or `ids`.
1604
+ oneOf:
1605
+ - required: [all]
1606
+ properties:
1607
+ all:
1608
+ type: boolean
1609
+ enum: [true]
1610
+ description: When `true`, deletes all transactions for the organization.
1611
+ - required: [afterDate]
1612
+ properties:
1613
+ afterDate:
1614
+ type: string
1615
+ format: date-time
1616
+ description: Delete all transactions created on or after this date.
1617
+ - required: [ids]
1618
+ properties:
1619
+ ids:
1620
+ type: array
1621
+ description: Delete specific transactions by UUID (max 1000).
1622
+ maxItems: 1000
1623
+ items:
1624
+ type: string
1625
+ format: uuid
1626
+
1627
+ BatchDeleteResponse:
1628
+ type: object
1629
+ required:
1630
+ - success
1631
+ - data
1632
+ - meta
1633
+ properties:
1634
+ success:
1635
+ type: boolean
1636
+ enum: [true]
1637
+ data:
1638
+ type: object
1639
+ required:
1640
+ - deleted
1641
+ - count
1642
+ properties:
1643
+ deleted:
1644
+ type: boolean
1645
+ enum: [true]
1646
+ count:
1647
+ type: integer
1648
+ minimum: 0
1649
+ description: Number of transactions deleted.
1650
+ meta:
1651
+ $ref: '#/components/schemas/ResponseMeta'
1652
+
1483
1653
  CategoryInfo:
1484
1654
  type: object
1485
1655
  required:
@@ -1629,9 +1799,6 @@ components:
1629
1799
  - transaction.category.tertiary.code.sic
1630
1800
  - transaction.category.tertiary.code.naics
1631
1801
  - transaction.category.confidence
1632
- - transaction.subscription
1633
- - transaction.subscription.recurring
1634
- - transaction.subscription.type
1635
1802
  - transaction.confidence
1636
1803
  - entities
1637
1804
  - entities.merchant
@@ -1669,6 +1836,7 @@ components:
1669
1836
  transaction_id:
1670
1837
  type: string
1671
1838
  format: uuid
1839
+ description: Transaction identifier returned as `meta.transactionId` by the enrichment response. This is not `meta.requestId`, and the transaction must still exist in the organization's activity history.
1672
1840
  description:
1673
1841
  type: string
1674
1842
  minLength: 1
@@ -1677,6 +1845,7 @@ components:
1677
1845
  type: array
1678
1846
  minItems: 1
1679
1847
  maxItems: 50
1848
+ description: Enrichment response field paths to report, such as `transaction.category.primary.name`.
1680
1849
  items:
1681
1850
  $ref: '#/components/schemas/EnrichmentFieldPath'
1682
1851
 
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "triqai",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Official TypeScript SDK for the Triqai Transaction Enrichment API",
5
5
  "author": "Triqai <hello@triqai.com>",
6
6
  "license": "MIT",
7
- "homepage": "https://github.com/triqai/typescript-sdk",
7
+ "homepage": "https://github.com/triqai/triqai/tree/main/packages/sdk-node",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git+https://github.com/triqai/typescript-sdk.git"
10
+ "url": "git+https://github.com/triqai/triqai.git",
11
+ "directory": "packages/sdk-node"
11
12
  },
12
13
  "bugs": {
13
- "url": "https://github.com/triqai/typescript-sdk/issues"
14
+ "url": "https://github.com/triqai/triqai/issues"
14
15
  },
15
16
  "keywords": [
16
17
  "triqai",
@@ -57,9 +58,11 @@
57
58
  "test:watch": "vitest",
58
59
  "typecheck": "tsc --noEmit",
59
60
  "generate": "node scripts/generate-types.mjs",
60
- "generate:from-api": "node scripts/generate-types.mjs --from-api",
61
- "prepublishOnly": "npm run typecheck && npm run test && npm run build",
62
- "lint": "tsc --noEmit"
61
+ "prepublishOnly": "bun run typecheck && bun run test:ci && bun run build",
62
+ "lint": "eslint .",
63
+ "test:ci": "vitest run && bun run test:package",
64
+ "test:package": "bun run build && node scripts/check-package.mjs",
65
+ "generate:check": "node scripts/generate-types.mjs --check"
63
66
  },
64
67
  "devDependencies": {
65
68
  "openapi-typescript": "^7.6.1",
@@ -67,5 +70,8 @@
67
70
  "typescript": "^5.7.0",
68
71
  "vitest": "^3.0.0",
69
72
  "yaml": "^2.7.0"
73
+ },
74
+ "installConfig": {
75
+ "hoistingLimits": "workspaces"
70
76
  }
71
77
  }