@cobre-npm/library-portal-core 0.51.0 → 0.53.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/README.md CHANGED
@@ -272,7 +272,7 @@ queryMovementStatuses({ lang: "en", type: "error" }) // error, failed, rejected
272
272
  `queryTransactionTypes`/`queryDocumentTypes`, no default field. `code`, `line`, `category`, `group` and
273
273
  `groupLabel` are filterable (equality only; a list matches any of its values). Filter by `group`, not
274
274
  `groupLabel` — the label is display text. Both are optional on the record: **a key that is present always filters**, so
275
- `groupLabel: undefined` matches the 19 rails that don't carry a group, not "no filter". An optional UI
275
+ `groupLabel: undefined` matches the rails that don't carry a group, not "no filter". An optional UI
276
276
  filter has to be spread in conditionally:
277
277
 
278
278
  ```ts
@@ -431,7 +431,7 @@ queryTransactionTypes({ lang: "en", category: "top_up" }) // col_top_up_credit
431
431
  listed under [`movements`](#movements)). Labels are usually "what you did · rail" (`Outgoing transfer ·
432
432
  SPEI`). Types that stand for a collapsed matrix row (`cbmm_*`, `internal_*`, `mex_*`, `col_debit`/`col_credit`, `misc_*`,
433
433
  `adjustment_*`, `col_cb_*`, the corridors, ramps and `stable_payout_*`, plus `transfer_credit`) add a
434
- "· débito" / "· crédito" (en "· debit" / "· credit") suffix; elsewhere the direction is in the verb
434
+ "· débito" / "· crédito" (en "· debit" / "· credit") suffix, except `offramp_treasury_credit`, whose label has none; elsewhere the direction is in the verb
435
435
  ("Outgoing transfer", "Incoming transfer"). `col_cb_*` keeps "Cobre Balance" in its label. `misc_*`,
436
436
  `internal_*` and `adjustment_*` have `line: "unclassified"`, and `misc_*` also `category: "unclassified"`.
437
437
  - **types query** (i18n `queryX()`): `queryTransactionTypes({ lang, ...filters })` — `lang` is **required inside
@@ -490,7 +490,7 @@ verified against its real DTO and entity, not against what any consumer had gues
490
490
 
491
491
  ```ts
492
492
  import {
493
- type ExportRequest, type ExportQueryConfig, type ExportQueryFilter, type ExportQuerySort,
493
+ type ExportRequest, type ExportQueryConfig, type ExportQueryFilter, type ExportFilterCondition, type ExportQuerySort,
494
494
  type ExportResponse, type ExportStatus, type ExportCreator, type ExportStatusState,
495
495
  EXPORT_FORMATS, type ExportFormat,
496
496
  EXPORT_QUERY_OPERATORS, type ExportQueryOperator,
@@ -502,10 +502,13 @@ import {
502
502
  `status`/`updated_at`/`export_path` in place as it processes. Both the exports list/status view in
503
503
  `portal` and any widget that creates exports read/write this one shape; keeping two hand-typed copies
504
504
  is what let each one drift from the real contract in its own way (see the two fixes below).
505
- - `EXPORT_QUERY_OPERATORS` is the engine's **real** allow-list (`eq`, `gt`, `lt`, `lte`, `gte`) — narrower
506
- than what a layout's catalog is allowed to declare (`between`, `in`, `like`, `neq` are valid catalog
505
+ - `EXPORT_QUERY_OPERATORS` is the engine's **real** allow-list (`eq`, `neq`, `gt`, `lt`, `lte`, `gte`) — narrower
506
+ than what a layout's catalog is allowed to declare (`between`, `in`, `like` are valid catalog
507
507
  entries the engine still rejects at request time). A consumer validating a filter before sending it
508
508
  needs the intersection of both, not just the catalog's.
509
+ - `ExportFilterCondition` is an `ExportQueryFilter` before its `type` is resolved
510
+ (`{ column: "state", operator: "neq", value: "pending_funds" }`). The type belongs to the layout's catalog,
511
+ so whoever reads the catalog fills it in and the column's type keeps one source of truth.
509
512
  - `ExportQuerySort` uses `field`; `ExportQueryFilter` uses `column` — not a typo, the engine's own DTOs
510
513
  name the two differently.
511
514
  - `column_aggregations` is a required `boolean` (apply aggregations or don't), not a per-column map — the
@@ -9,10 +9,11 @@ export type ExportFormat = typeof EXPORT_FORMATS[keyof typeof EXPORT_FORMATS];
9
9
  /**
10
10
  * The export engine's real allow-list (verified against util-platform-exports'
11
11
  * QueryOperator enum). A layout's catalog can declare more operators than this
12
- * ("between", "in", "like", "neq") — those are rejected by the engine at request time.
12
+ * ("between", "in", "like") — those are rejected by the engine at request time.
13
13
  */
14
14
  export declare const EXPORT_QUERY_OPERATORS: {
15
15
  readonly EQ: "eq";
16
+ readonly NEQ: "neq";
16
17
  readonly GT: "gt";
17
18
  readonly LT: "lt";
18
19
  readonly LTE: "lte";
@@ -25,10 +25,11 @@ exports.EXPORT_FORMATS = {
25
25
  /**
26
26
  * The export engine's real allow-list (verified against util-platform-exports'
27
27
  * QueryOperator enum). A layout's catalog can declare more operators than this
28
- * ("between", "in", "like", "neq") — those are rejected by the engine at request time.
28
+ * ("between", "in", "like") — those are rejected by the engine at request time.
29
29
  */
30
30
  exports.EXPORT_QUERY_OPERATORS = {
31
31
  EQ: "eq",
32
+ NEQ: "neq",
32
33
  GT: "gt",
33
34
  LT: "lt",
34
35
  LTE: "lte",
@@ -1,10 +1,12 @@
1
1
  import type { ExportQueryOperator } from "../index";
2
- export interface ExportQueryFilter {
2
+ export interface ExportFilterCondition {
3
3
  column: string;
4
- type: string;
5
4
  operator: ExportQueryOperator;
6
5
  value: string;
7
6
  }
7
+ export interface ExportQueryFilter extends ExportFilterCondition {
8
+ type: string;
9
+ }
8
10
  export interface ExportQuerySort {
9
11
  field: string;
10
12
  order: "asc" | "desc";
@@ -131,6 +131,16 @@ export declare const MOVEMENT_TYPES: {
131
131
  readonly line: "payout";
132
132
  readonly category: "payments";
133
133
  };
134
+ readonly swift: {
135
+ readonly code: "swift";
136
+ readonly line: "payout";
137
+ readonly category: "payments";
138
+ };
139
+ readonly sepa: {
140
+ readonly code: "sepa";
141
+ readonly line: "payout";
142
+ readonly category: "payments";
143
+ };
134
144
  };
135
145
  export type MovementType = keyof typeof MOVEMENT_TYPES;
136
146
  export type MovementTypeRecord = (typeof MOVEMENT_TYPES)[MovementType] & {
@@ -26,4 +26,6 @@ exports.MOVEMENT_TYPES = {
26
26
  stable_payout: { code: "stable_payout", line: "stable", category: "conversions", group: "stablecoin", groupLabel: "Stablecoin" },
27
27
  breb: { code: "breb", line: "payout", category: "payments" },
28
28
  global_pay_to_generic: { code: "global_pay_to_generic", line: "payout", category: "payments" },
29
+ swift: { code: "swift", line: "payout", category: "payments" },
30
+ sepa: { code: "sepa", line: "payout", category: "payments" },
29
31
  };
@@ -23,6 +23,8 @@
23
23
  "cross_border": "International",
24
24
  "stable_payout": "Stablecoin payment · Direct",
25
25
  "breb": "Instant payment · Bre-B",
26
- "global_pay_to_generic": "International payment"
26
+ "global_pay_to_generic": "International payment",
27
+ "swift": "International transfer · Swift",
28
+ "sepa": "International transfer · SEPA"
27
29
  }
28
30
  }
@@ -23,6 +23,8 @@
23
23
  "cross_border": "Internacional",
24
24
  "stable_payout": "Pago en stablecoin · Directo",
25
25
  "breb": "Pago instantáneo · Bre-B",
26
- "global_pay_to_generic": "Pago internacional"
26
+ "global_pay_to_generic": "Pago internacional",
27
+ "swift": "Transferencia internacional · Swift",
28
+ "sepa": "Transferencia internacional · SEPA"
27
29
  }
28
30
  }
@@ -14,7 +14,7 @@ export type MovementTypeQuery = CatalogQuery<MovementTypeRecord> & {
14
14
  * Filter by `group`, not `groupLabel` — the label is display text, not a stable filter key.
15
15
  *
16
16
  * `group` is optional on the record, so `group: undefined` is a present key like any other — it
17
- * matches the 19 records that don't carry a group, not "no filter". A UI filter fed from an optional
17
+ * matches the records that don't carry a group, not "no filter". A UI filter fed from an optional
18
18
  * ref has to be spread in conditionally: `{ lang, ...(group ? { group } : {}) }`.
19
19
  */
20
20
  export declare const queryMovementTypes: (query: MovementTypeQuery) => MovementTypeOption[];
@@ -23,7 +23,7 @@ exports.getMovementTypes = getMovementTypes;
23
23
  * Filter by `group`, not `groupLabel` — the label is display text, not a stable filter key.
24
24
  *
25
25
  * `group` is optional on the record, so `group: undefined` is a present key like any other — it
26
- * matches the 19 records that don't carry a group, not "no filter". A UI filter fed from an optional
26
+ * matches the records that don't carry a group, not "no filter". A UI filter fed from an optional
27
27
  * ref has to be spread in conditionally: `{ lang, ...(group ? { group } : {}) }`.
28
28
  */
29
29
  const queryMovementTypes = (query) => {
@@ -263,6 +263,30 @@ export declare const TRANSACTION_TYPES: {
263
263
  readonly line: "cbmm";
264
264
  readonly category: "collections";
265
265
  };
266
+ readonly global_rejected: {
267
+ readonly creditDebitType: "credit";
268
+ readonly code: "global_rejected";
269
+ readonly line: "cbmm";
270
+ readonly category: "collections";
271
+ };
272
+ readonly offramp_treasury_credit: {
273
+ readonly creditDebitType: "credit";
274
+ readonly code: "offramp_treasury_credit";
275
+ readonly line: "stable";
276
+ readonly category: "conversions";
277
+ };
278
+ readonly onramp_debit: {
279
+ readonly creditDebitType: "debit";
280
+ readonly code: "onramp_debit";
281
+ readonly line: "stable";
282
+ readonly category: "conversions";
283
+ };
284
+ readonly offramp_credit: {
285
+ readonly creditDebitType: "credit";
286
+ readonly code: "offramp_credit";
287
+ readonly line: "stable";
288
+ readonly category: "conversions";
289
+ };
266
290
  };
267
291
  export type TransactionType = keyof typeof TRANSACTION_TYPES;
268
292
  export type TransactionTypeRecord = (typeof TRANSACTION_TYPES)[TransactionType];
@@ -266,4 +266,28 @@ exports.TRANSACTION_TYPES = {
266
266
  line: "cbmm",
267
267
  category: "collections",
268
268
  },
269
+ global_rejected: {
270
+ creditDebitType: "credit",
271
+ code: "global_rejected",
272
+ line: "cbmm",
273
+ category: "collections",
274
+ },
275
+ offramp_treasury_credit: {
276
+ creditDebitType: "credit",
277
+ code: "offramp_treasury_credit",
278
+ line: "stable",
279
+ category: "conversions",
280
+ },
281
+ onramp_debit: {
282
+ creditDebitType: "debit",
283
+ code: "onramp_debit",
284
+ line: "stable",
285
+ category: "conversions",
286
+ },
287
+ offramp_credit: {
288
+ creditDebitType: "credit",
289
+ code: "offramp_credit",
290
+ line: "stable",
291
+ category: "conversions",
292
+ },
269
293
  };
@@ -43,6 +43,10 @@
43
43
  "stable_payout_debit": "Stablecoin payment · Direct · debit",
44
44
  "stable_payout_credit": "Stablecoin payment · Direct · credit",
45
45
  "global_pay_to_generic_debit": "International payment",
46
- "global_pay_to_generic_credit": "International payment return"
46
+ "global_pay_to_generic_credit": "International payment return",
47
+ "global_rejected": "Rejection · Global",
48
+ "offramp_treasury_credit": "Treasury conversion · Off-Ramp",
49
+ "onramp_debit": "Conversion to stablecoin · On-Ramp · debit",
50
+ "offramp_credit": "Conversion to local currency · Off-Ramp · credit"
47
51
  }
48
52
  }
@@ -43,6 +43,10 @@
43
43
  "stable_payout_debit": "Pago en stablecoin · Directo · débito",
44
44
  "stable_payout_credit": "Pago en stablecoin · Directo · crédito",
45
45
  "global_pay_to_generic_debit": "Pago internacional",
46
- "global_pay_to_generic_credit": "Retorno de pago internacional"
46
+ "global_pay_to_generic_credit": "Retorno de pago internacional",
47
+ "global_rejected": "Rechazo · Global",
48
+ "offramp_treasury_credit": "Conversión de tesorería · Off-Ramp",
49
+ "onramp_debit": "Conversión a stablecoin · On-Ramp · débito",
50
+ "offramp_credit": "Conversión a moneda local · Off-Ramp · crédito"
47
51
  }
48
52
  }
@@ -8,10 +8,11 @@ export const EXPORT_FORMATS = {
8
8
  /**
9
9
  * The export engine's real allow-list (verified against util-platform-exports'
10
10
  * QueryOperator enum). A layout's catalog can declare more operators than this
11
- * ("between", "in", "like", "neq") — those are rejected by the engine at request time.
11
+ * ("between", "in", "like") — those are rejected by the engine at request time.
12
12
  */
13
13
  export const EXPORT_QUERY_OPERATORS = {
14
14
  EQ: "eq",
15
+ NEQ: "neq",
15
16
  GT: "gt",
16
17
  LT: "lt",
17
18
  LTE: "lte",
@@ -23,4 +23,6 @@ export const MOVEMENT_TYPES = {
23
23
  stable_payout: { code: "stable_payout", line: "stable", category: "conversions", group: "stablecoin", groupLabel: "Stablecoin" },
24
24
  breb: { code: "breb", line: "payout", category: "payments" },
25
25
  global_pay_to_generic: { code: "global_pay_to_generic", line: "payout", category: "payments" },
26
+ swift: { code: "swift", line: "payout", category: "payments" },
27
+ sepa: { code: "sepa", line: "payout", category: "payments" },
26
28
  };
@@ -23,6 +23,8 @@
23
23
  "cross_border": "International",
24
24
  "stable_payout": "Stablecoin payment · Direct",
25
25
  "breb": "Instant payment · Bre-B",
26
- "global_pay_to_generic": "International payment"
26
+ "global_pay_to_generic": "International payment",
27
+ "swift": "International transfer · Swift",
28
+ "sepa": "International transfer · SEPA"
27
29
  }
28
30
  }
@@ -23,6 +23,8 @@
23
23
  "cross_border": "Internacional",
24
24
  "stable_payout": "Pago en stablecoin · Directo",
25
25
  "breb": "Pago instantáneo · Bre-B",
26
- "global_pay_to_generic": "Pago internacional"
26
+ "global_pay_to_generic": "Pago internacional",
27
+ "swift": "Transferencia internacional · Swift",
28
+ "sepa": "Transferencia internacional · SEPA"
27
29
  }
28
30
  }
@@ -16,7 +16,7 @@ export const getMovementTypes = (lang) => {
16
16
  * Filter by `group`, not `groupLabel` — the label is display text, not a stable filter key.
17
17
  *
18
18
  * `group` is optional on the record, so `group: undefined` is a present key like any other — it
19
- * matches the 19 records that don't carry a group, not "no filter". A UI filter fed from an optional
19
+ * matches the records that don't carry a group, not "no filter". A UI filter fed from an optional
20
20
  * ref has to be spread in conditionally: `{ lang, ...(group ? { group } : {}) }`.
21
21
  */
22
22
  export const queryMovementTypes = (query) => {
@@ -263,4 +263,28 @@ export const TRANSACTION_TYPES = {
263
263
  line: "cbmm",
264
264
  category: "collections",
265
265
  },
266
+ global_rejected: {
267
+ creditDebitType: "credit",
268
+ code: "global_rejected",
269
+ line: "cbmm",
270
+ category: "collections",
271
+ },
272
+ offramp_treasury_credit: {
273
+ creditDebitType: "credit",
274
+ code: "offramp_treasury_credit",
275
+ line: "stable",
276
+ category: "conversions",
277
+ },
278
+ onramp_debit: {
279
+ creditDebitType: "debit",
280
+ code: "onramp_debit",
281
+ line: "stable",
282
+ category: "conversions",
283
+ },
284
+ offramp_credit: {
285
+ creditDebitType: "credit",
286
+ code: "offramp_credit",
287
+ line: "stable",
288
+ category: "conversions",
289
+ },
266
290
  };
@@ -43,6 +43,10 @@
43
43
  "stable_payout_debit": "Stablecoin payment · Direct · debit",
44
44
  "stable_payout_credit": "Stablecoin payment · Direct · credit",
45
45
  "global_pay_to_generic_debit": "International payment",
46
- "global_pay_to_generic_credit": "International payment return"
46
+ "global_pay_to_generic_credit": "International payment return",
47
+ "global_rejected": "Rejection · Global",
48
+ "offramp_treasury_credit": "Treasury conversion · Off-Ramp",
49
+ "onramp_debit": "Conversion to stablecoin · On-Ramp · debit",
50
+ "offramp_credit": "Conversion to local currency · Off-Ramp · credit"
47
51
  }
48
52
  }
@@ -43,6 +43,10 @@
43
43
  "stable_payout_debit": "Pago en stablecoin · Directo · débito",
44
44
  "stable_payout_credit": "Pago en stablecoin · Directo · crédito",
45
45
  "global_pay_to_generic_debit": "Pago internacional",
46
- "global_pay_to_generic_credit": "Retorno de pago internacional"
46
+ "global_pay_to_generic_credit": "Retorno de pago internacional",
47
+ "global_rejected": "Rechazo · Global",
48
+ "offramp_treasury_credit": "Conversión de tesorería · Off-Ramp",
49
+ "onramp_debit": "Conversión a stablecoin · On-Ramp · débito",
50
+ "offramp_credit": "Conversión a moneda local · Off-Ramp · crédito"
47
51
  }
48
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cobre-npm/library-portal-core",
3
- "version": "0.51.0",
3
+ "version": "0.53.0",
4
4
  "description": "Shared configurations and resources for Portal MFEs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",