@cobre-npm/library-portal-core 0.63.0 → 0.65.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
@@ -706,11 +706,14 @@ import {
706
706
  import {
707
707
  getFinancialInstitutions, queryFinancialInstitutions,
708
708
  type FinancialInstitution, type FinancialInstitutionGeo,
709
- type FinancialInstitutionOption, type FinancialInstitutionQuery,
709
+ type FinancialInstitutionCatalog, type FinancialInstitutionOption, type FinancialInstitutionQuery,
710
+ type FinancialInstitutionScope,
710
711
  } from "@cobre-npm/library-portal-core/financialInstitutions"
711
712
 
712
713
  getFinancialInstitutions("en").pr_col_1007 // { code: "pr_col_1007", rawCode: "1007", geo: "col", label: "Bancolombia" }
713
714
  queryFinancialInstitutions({ lang: "en", geo: "col" }) // FinancialInstitutionOption[] → every COL institution
715
+ queryFinancialInstitutions({ lang: "en", geo: "col", scope: "checkout" }) // → only the COL ones the checkout offers
716
+ getFinancialInstitutions("en")[`pr_col_${bankCode}`]?.label ?? bankCode // bankCode: string from an API payload, no cast
714
717
  ```
715
718
 
716
719
  - **institutions** (i18n): `getFinancialInstitutions(lang)`; each record carries `code`, `rawCode`, `geo`
@@ -720,10 +723,18 @@ queryFinancialInstitutions({ lang: "en", geo: "col" }) // FinancialInstitutionOp
720
723
  `pr_<geo>_<rawCode>` (a test enforces it). One entry per financial institution, so there is no
721
724
  repeat-by-geo the way `accounts/types` needs one.
722
725
  - `queryFinancialInstitutions({ lang, ... })` returns the same catalog as a **list**, narrowed by
723
- `code`/`rawCode`/`geo` — same matching rules as [`queryAccountStatuses`](#accounts): `lang` is required (i18n
726
+ `code`/`rawCode`/`geo`/`scope` — same matching rules as [`queryAccountStatuses`](#accounts): `lang` is required (i18n
724
727
  domain, no default) and lives inside the query object, and **a key that is present always filters** —
725
728
  `queryFinancialInstitutions({ lang: "en" })` returns everything, `queryFinancialInstitutions({ lang:
726
729
  "en", geo: "col" })` returns only Colombia's institutions.
730
+ - `scope` (`"checkout"`, optional on the record) marks the subset of institutions the checkout offers for PSE.
731
+ Unlike `scope` in `currencies` it has **no default**: leaving it out returns the whole catalog, and
732
+ `scope: "checkout"` narrows it. An institution without `scope` is not offered in the checkout.
733
+ - `getFinancialInstitutions(lang)` is also indexable by a plain `string`, for codes that arrive from a payload
734
+ (`pr_<geo>_<rawCode>` built from a bare bank code): a known code stays non-optional, any other
735
+ string reads as `FinancialInstitutionOption | undefined`, so an unknown code is handled with `?.` and no cast.
736
+ The catch is `Object.values(getFinancialInstitutions(lang))`, which is then typed
737
+ `(FinancialInstitutionOption | undefined)[]`: for a list use `queryFinancialInstitutions`.
727
738
  - Bank names have no real translation between `en` and `es-mex`: `es-mex` keeps the name as published by
728
739
  the source (accented characters included, e.g. `"Banco de Bogotá"`), `en` is the same string with
729
740
  special Spanish characters stripped (`"Banco de Bogota"`) rather than left untranslated with accents.
@@ -1,24 +1,29 @@
1
1
  export type FinancialInstitutionGeo = "col" | "mex";
2
+ export type FinancialInstitutionScope = "checkout";
2
3
  export declare const FINANCIAL_INSTITUTIONS: {
3
4
  readonly pr_col_1558: {
4
5
  readonly code: "pr_col_1558";
5
6
  readonly rawCode: "1558";
6
7
  readonly geo: "col";
8
+ readonly scope: "checkout";
7
9
  };
8
10
  readonly pr_col_1059: {
9
11
  readonly code: "pr_col_1059";
10
12
  readonly rawCode: "1059";
11
13
  readonly geo: "col";
14
+ readonly scope: "checkout";
12
15
  };
13
16
  readonly pr_col_1040: {
14
17
  readonly code: "pr_col_1040";
15
18
  readonly rawCode: "1040";
16
19
  readonly geo: "col";
20
+ readonly scope: "checkout";
17
21
  };
18
22
  readonly pr_col_1052: {
19
23
  readonly code: "pr_col_1052";
20
24
  readonly rawCode: "1052";
21
25
  readonly geo: "col";
26
+ readonly scope: "checkout";
22
27
  };
23
28
  readonly pr_col_1805: {
24
29
  readonly code: "pr_col_1805";
@@ -29,6 +34,7 @@ export declare const FINANCIAL_INSTITUTIONS: {
29
34
  readonly code: "pr_col_1032";
30
35
  readonly rawCode: "1032";
31
36
  readonly geo: "col";
37
+ readonly scope: "checkout";
32
38
  };
33
39
  readonly pr_col_1819: {
34
40
  readonly code: "pr_col_1819";
@@ -39,66 +45,79 @@ export declare const FINANCIAL_INSTITUTIONS: {
39
45
  readonly code: "pr_col_1066";
40
46
  readonly rawCode: "1066";
41
47
  readonly geo: "col";
48
+ readonly scope: "checkout";
42
49
  };
43
50
  readonly pr_col_1001: {
44
51
  readonly code: "pr_col_1001";
45
52
  readonly rawCode: "1001";
46
53
  readonly geo: "col";
54
+ readonly scope: "checkout";
47
55
  };
48
56
  readonly pr_col_1023: {
49
57
  readonly code: "pr_col_1023";
50
58
  readonly rawCode: "1023";
51
59
  readonly geo: "col";
60
+ readonly scope: "checkout";
52
61
  };
53
62
  readonly pr_col_1062: {
54
63
  readonly code: "pr_col_1062";
55
64
  readonly rawCode: "1062";
56
65
  readonly geo: "col";
66
+ readonly scope: "checkout";
57
67
  };
58
68
  readonly pr_col_1063: {
59
69
  readonly code: "pr_col_1063";
60
70
  readonly rawCode: "1063";
61
71
  readonly geo: "col";
72
+ readonly scope: "checkout";
62
73
  };
63
74
  readonly pr_col_1012: {
64
75
  readonly code: "pr_col_1012";
65
76
  readonly rawCode: "1012";
66
77
  readonly geo: "col";
78
+ readonly scope: "checkout";
67
79
  };
68
80
  readonly pr_col_1006: {
69
81
  readonly code: "pr_col_1006";
70
82
  readonly rawCode: "1006";
71
83
  readonly geo: "col";
84
+ readonly scope: "checkout";
72
85
  };
73
86
  readonly pr_col_1047: {
74
87
  readonly code: "pr_col_1047";
75
88
  readonly rawCode: "1047";
76
89
  readonly geo: "col";
90
+ readonly scope: "checkout";
77
91
  };
78
92
  readonly pr_col_1060: {
79
93
  readonly code: "pr_col_1060";
80
94
  readonly rawCode: "1060";
81
95
  readonly geo: "col";
96
+ readonly scope: "checkout";
82
97
  };
83
98
  readonly pr_col_1002: {
84
99
  readonly code: "pr_col_1002";
85
100
  readonly rawCode: "1002";
86
101
  readonly geo: "col";
102
+ readonly scope: "checkout";
87
103
  };
88
104
  readonly pr_col_1065: {
89
105
  readonly code: "pr_col_1065";
90
106
  readonly rawCode: "1065";
91
107
  readonly geo: "col";
108
+ readonly scope: "checkout";
92
109
  };
93
110
  readonly pr_col_1069: {
94
111
  readonly code: "pr_col_1069";
95
112
  readonly rawCode: "1069";
96
113
  readonly geo: "col";
114
+ readonly scope: "checkout";
97
115
  };
98
116
  readonly pr_col_1303: {
99
117
  readonly code: "pr_col_1303";
100
118
  readonly rawCode: "1303";
101
119
  readonly geo: "col";
120
+ readonly scope: "checkout";
102
121
  };
103
122
  readonly pr_col_1053: {
104
123
  readonly code: "pr_col_1053";
@@ -114,16 +133,19 @@ export declare const FINANCIAL_INSTITUTIONS: {
114
133
  readonly code: "pr_col_1007";
115
134
  readonly rawCode: "1007";
116
135
  readonly geo: "col";
136
+ readonly scope: "checkout";
117
137
  };
118
138
  readonly pr_col_1061: {
119
139
  readonly code: "pr_col_1061";
120
140
  readonly rawCode: "1061";
121
141
  readonly geo: "col";
142
+ readonly scope: "checkout";
122
143
  };
123
144
  readonly pr_col_1013: {
124
145
  readonly code: "pr_col_1013";
125
146
  readonly rawCode: "1013";
126
147
  readonly geo: "col";
148
+ readonly scope: "checkout";
127
149
  };
128
150
  readonly pr_col_1042: {
129
151
  readonly code: "pr_col_1042";
@@ -134,31 +156,37 @@ export declare const FINANCIAL_INSTITUTIONS: {
134
156
  readonly code: "pr_col_1808";
135
157
  readonly rawCode: "1808";
136
158
  readonly geo: "col";
159
+ readonly scope: "checkout";
137
160
  };
138
161
  readonly pr_col_1283: {
139
162
  readonly code: "pr_col_1283";
140
163
  readonly rawCode: "1283";
141
164
  readonly geo: "col";
165
+ readonly scope: "checkout";
142
166
  };
143
167
  readonly pr_col_1009: {
144
168
  readonly code: "pr_col_1009";
145
169
  readonly rawCode: "1009";
146
170
  readonly geo: "col";
171
+ readonly scope: "checkout";
147
172
  };
148
173
  readonly pr_col_1812: {
149
174
  readonly code: "pr_col_1812";
150
175
  readonly rawCode: "1812";
151
176
  readonly geo: "col";
177
+ readonly scope: "checkout";
152
178
  };
153
179
  readonly pr_col_1370: {
154
180
  readonly code: "pr_col_1370";
155
181
  readonly rawCode: "1370";
156
182
  readonly geo: "col";
183
+ readonly scope: "checkout";
157
184
  };
158
185
  readonly pr_col_1292: {
159
186
  readonly code: "pr_col_1292";
160
187
  readonly rawCode: "1292";
161
188
  readonly geo: "col";
189
+ readonly scope: "checkout";
162
190
  };
163
191
  readonly pr_col_1291: {
164
192
  readonly code: "pr_col_1291";
@@ -169,61 +197,73 @@ export declare const FINANCIAL_INSTITUTIONS: {
169
197
  readonly code: "pr_col_1289";
170
198
  readonly rawCode: "1289";
171
199
  readonly geo: "col";
200
+ readonly scope: "checkout";
172
201
  };
173
202
  readonly pr_col_1816: {
174
203
  readonly code: "pr_col_1816";
175
204
  readonly rawCode: "1816";
176
205
  readonly geo: "col";
206
+ readonly scope: "checkout";
177
207
  };
178
208
  readonly pr_col_1097: {
179
209
  readonly code: "pr_col_1097";
180
210
  readonly rawCode: "1097";
181
211
  readonly geo: "col";
212
+ readonly scope: "checkout";
182
213
  };
183
214
  readonly pr_col_1551: {
184
215
  readonly code: "pr_col_1551";
185
216
  readonly rawCode: "1551";
186
217
  readonly geo: "col";
218
+ readonly scope: "checkout";
187
219
  };
188
220
  readonly pr_col_1051: {
189
221
  readonly code: "pr_col_1051";
190
222
  readonly rawCode: "1051";
191
223
  readonly geo: "col";
224
+ readonly scope: "checkout";
192
225
  };
193
226
  readonly pr_col_1802: {
194
227
  readonly code: "pr_col_1802";
195
228
  readonly rawCode: "1802";
196
229
  readonly geo: "col";
230
+ readonly scope: "checkout";
197
231
  };
198
232
  readonly pr_col_1121: {
199
233
  readonly code: "pr_col_1121";
200
234
  readonly rawCode: "1121";
201
235
  readonly geo: "col";
236
+ readonly scope: "checkout";
202
237
  };
203
238
  readonly pr_col_1814: {
204
239
  readonly code: "pr_col_1814";
205
240
  readonly rawCode: "1814";
206
241
  readonly geo: "col";
242
+ readonly scope: "checkout";
207
243
  };
208
244
  readonly pr_col_1637: {
209
245
  readonly code: "pr_col_1637";
210
246
  readonly rawCode: "1637";
211
247
  readonly geo: "col";
248
+ readonly scope: "checkout";
212
249
  };
213
250
  readonly pr_col_1071: {
214
251
  readonly code: "pr_col_1071";
215
252
  readonly rawCode: "1071";
216
253
  readonly geo: "col";
254
+ readonly scope: "checkout";
217
255
  };
218
256
  readonly pr_col_1286: {
219
257
  readonly code: "pr_col_1286";
220
258
  readonly rawCode: "1286";
221
259
  readonly geo: "col";
260
+ readonly scope: "checkout";
222
261
  };
223
262
  readonly pr_col_1070: {
224
263
  readonly code: "pr_col_1070";
225
264
  readonly rawCode: "1070";
226
265
  readonly geo: "col";
266
+ readonly scope: "checkout";
227
267
  };
228
268
  readonly pr_col_1067: {
229
269
  readonly code: "pr_col_1067";
@@ -234,16 +274,19 @@ export declare const FINANCIAL_INSTITUTIONS: {
234
274
  readonly code: "pr_col_1801";
235
275
  readonly rawCode: "1801";
236
276
  readonly geo: "col";
277
+ readonly scope: "checkout";
237
278
  };
238
279
  readonly pr_col_1507: {
239
280
  readonly code: "pr_col_1507";
240
281
  readonly rawCode: "1507";
241
282
  readonly geo: "col";
283
+ readonly scope: "checkout";
242
284
  };
243
285
  readonly pr_col_1809: {
244
286
  readonly code: "pr_col_1809";
245
287
  readonly rawCode: "1809";
246
288
  readonly geo: "col";
289
+ readonly scope: "checkout";
247
290
  };
248
291
  readonly pr_col_1560: {
249
292
  readonly code: "pr_col_1560";
@@ -254,11 +297,13 @@ export declare const FINANCIAL_INSTITUTIONS: {
254
297
  readonly code: "pr_col_1803";
255
298
  readonly rawCode: "1803";
256
299
  readonly geo: "col";
300
+ readonly scope: "checkout";
257
301
  };
258
302
  readonly pr_col_1811: {
259
303
  readonly code: "pr_col_1811";
260
304
  readonly rawCode: "1811";
261
305
  readonly geo: "col";
306
+ readonly scope: "checkout";
262
307
  };
263
308
  readonly pr_col_1813: {
264
309
  readonly code: "pr_col_1813";
@@ -269,11 +314,13 @@ export declare const FINANCIAL_INSTITUTIONS: {
269
314
  readonly code: "pr_col_1019";
270
315
  readonly rawCode: "1019";
271
316
  readonly geo: "col";
317
+ readonly scope: "checkout";
272
318
  };
273
319
  readonly pr_col_1804: {
274
320
  readonly code: "pr_col_1804";
275
321
  readonly rawCode: "1804";
276
322
  readonly geo: "col";
323
+ readonly scope: "checkout";
277
324
  };
278
325
  readonly pr_mex_40133: {
279
326
  readonly code: "pr_mex_40133";
@@ -757,4 +804,6 @@ export declare const FINANCIAL_INSTITUTIONS: {
757
804
  };
758
805
  };
759
806
  export type FinancialInstitution = keyof typeof FINANCIAL_INSTITUTIONS;
760
- export type FinancialInstitutionRecord = (typeof FINANCIAL_INSTITUTIONS)[FinancialInstitution];
807
+ export type FinancialInstitutionRecord = (typeof FINANCIAL_INSTITUTIONS)[FinancialInstitution] & {
808
+ readonly scope?: FinancialInstitutionScope;
809
+ };
@@ -2,61 +2,61 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FINANCIAL_INSTITUTIONS = void 0;
4
4
  exports.FINANCIAL_INSTITUTIONS = {
5
- pr_col_1558: { code: "pr_col_1558", rawCode: "1558", geo: "col" },
6
- pr_col_1059: { code: "pr_col_1059", rawCode: "1059", geo: "col" },
7
- pr_col_1040: { code: "pr_col_1040", rawCode: "1040", geo: "col" },
8
- pr_col_1052: { code: "pr_col_1052", rawCode: "1052", geo: "col" },
5
+ pr_col_1558: { code: "pr_col_1558", rawCode: "1558", geo: "col", scope: "checkout" },
6
+ pr_col_1059: { code: "pr_col_1059", rawCode: "1059", geo: "col", scope: "checkout" },
7
+ pr_col_1040: { code: "pr_col_1040", rawCode: "1040", geo: "col", scope: "checkout" },
8
+ pr_col_1052: { code: "pr_col_1052", rawCode: "1052", geo: "col", scope: "checkout" },
9
9
  pr_col_1805: { code: "pr_col_1805", rawCode: "1805", geo: "col" },
10
- pr_col_1032: { code: "pr_col_1032", rawCode: "1032", geo: "col" },
10
+ pr_col_1032: { code: "pr_col_1032", rawCode: "1032", geo: "col", scope: "checkout" },
11
11
  pr_col_1819: { code: "pr_col_1819", rawCode: "1819", geo: "col" },
12
- pr_col_1066: { code: "pr_col_1066", rawCode: "1066", geo: "col" },
13
- pr_col_1001: { code: "pr_col_1001", rawCode: "1001", geo: "col" },
14
- pr_col_1023: { code: "pr_col_1023", rawCode: "1023", geo: "col" },
15
- pr_col_1062: { code: "pr_col_1062", rawCode: "1062", geo: "col" },
16
- pr_col_1063: { code: "pr_col_1063", rawCode: "1063", geo: "col" },
17
- pr_col_1012: { code: "pr_col_1012", rawCode: "1012", geo: "col" },
18
- pr_col_1006: { code: "pr_col_1006", rawCode: "1006", geo: "col" },
19
- pr_col_1047: { code: "pr_col_1047", rawCode: "1047", geo: "col" },
20
- pr_col_1060: { code: "pr_col_1060", rawCode: "1060", geo: "col" },
21
- pr_col_1002: { code: "pr_col_1002", rawCode: "1002", geo: "col" },
22
- pr_col_1065: { code: "pr_col_1065", rawCode: "1065", geo: "col" },
23
- pr_col_1069: { code: "pr_col_1069", rawCode: "1069", geo: "col" },
24
- pr_col_1303: { code: "pr_col_1303", rawCode: "1303", geo: "col" },
12
+ pr_col_1066: { code: "pr_col_1066", rawCode: "1066", geo: "col", scope: "checkout" },
13
+ pr_col_1001: { code: "pr_col_1001", rawCode: "1001", geo: "col", scope: "checkout" },
14
+ pr_col_1023: { code: "pr_col_1023", rawCode: "1023", geo: "col", scope: "checkout" },
15
+ pr_col_1062: { code: "pr_col_1062", rawCode: "1062", geo: "col", scope: "checkout" },
16
+ pr_col_1063: { code: "pr_col_1063", rawCode: "1063", geo: "col", scope: "checkout" },
17
+ pr_col_1012: { code: "pr_col_1012", rawCode: "1012", geo: "col", scope: "checkout" },
18
+ pr_col_1006: { code: "pr_col_1006", rawCode: "1006", geo: "col", scope: "checkout" },
19
+ pr_col_1047: { code: "pr_col_1047", rawCode: "1047", geo: "col", scope: "checkout" },
20
+ pr_col_1060: { code: "pr_col_1060", rawCode: "1060", geo: "col", scope: "checkout" },
21
+ pr_col_1002: { code: "pr_col_1002", rawCode: "1002", geo: "col", scope: "checkout" },
22
+ pr_col_1065: { code: "pr_col_1065", rawCode: "1065", geo: "col", scope: "checkout" },
23
+ pr_col_1069: { code: "pr_col_1069", rawCode: "1069", geo: "col", scope: "checkout" },
24
+ pr_col_1303: { code: "pr_col_1303", rawCode: "1303", geo: "col", scope: "checkout" },
25
25
  pr_col_1053: { code: "pr_col_1053", rawCode: "1053", geo: "col" },
26
26
  pr_col_1031: { code: "pr_col_1031", rawCode: "1031", geo: "col" },
27
- pr_col_1007: { code: "pr_col_1007", rawCode: "1007", geo: "col" },
28
- pr_col_1061: { code: "pr_col_1061", rawCode: "1061", geo: "col" },
29
- pr_col_1013: { code: "pr_col_1013", rawCode: "1013", geo: "col" },
27
+ pr_col_1007: { code: "pr_col_1007", rawCode: "1007", geo: "col", scope: "checkout" },
28
+ pr_col_1061: { code: "pr_col_1061", rawCode: "1061", geo: "col", scope: "checkout" },
29
+ pr_col_1013: { code: "pr_col_1013", rawCode: "1013", geo: "col", scope: "checkout" },
30
30
  pr_col_1042: { code: "pr_col_1042", rawCode: "1042", geo: "col" },
31
- pr_col_1808: { code: "pr_col_1808", rawCode: "1808", geo: "col" },
32
- pr_col_1283: { code: "pr_col_1283", rawCode: "1283", geo: "col" },
33
- pr_col_1009: { code: "pr_col_1009", rawCode: "1009", geo: "col" },
34
- pr_col_1812: { code: "pr_col_1812", rawCode: "1812", geo: "col" },
35
- pr_col_1370: { code: "pr_col_1370", rawCode: "1370", geo: "col" },
36
- pr_col_1292: { code: "pr_col_1292", rawCode: "1292", geo: "col" },
31
+ pr_col_1808: { code: "pr_col_1808", rawCode: "1808", geo: "col", scope: "checkout" },
32
+ pr_col_1283: { code: "pr_col_1283", rawCode: "1283", geo: "col", scope: "checkout" },
33
+ pr_col_1009: { code: "pr_col_1009", rawCode: "1009", geo: "col", scope: "checkout" },
34
+ pr_col_1812: { code: "pr_col_1812", rawCode: "1812", geo: "col", scope: "checkout" },
35
+ pr_col_1370: { code: "pr_col_1370", rawCode: "1370", geo: "col", scope: "checkout" },
36
+ pr_col_1292: { code: "pr_col_1292", rawCode: "1292", geo: "col", scope: "checkout" },
37
37
  pr_col_1291: { code: "pr_col_1291", rawCode: "1291", geo: "col" },
38
- pr_col_1289: { code: "pr_col_1289", rawCode: "1289", geo: "col" },
39
- pr_col_1816: { code: "pr_col_1816", rawCode: "1816", geo: "col" },
40
- pr_col_1097: { code: "pr_col_1097", rawCode: "1097", geo: "col" },
41
- pr_col_1551: { code: "pr_col_1551", rawCode: "1551", geo: "col" },
42
- pr_col_1051: { code: "pr_col_1051", rawCode: "1051", geo: "col" },
43
- pr_col_1802: { code: "pr_col_1802", rawCode: "1802", geo: "col" },
44
- pr_col_1121: { code: "pr_col_1121", rawCode: "1121", geo: "col" },
45
- pr_col_1814: { code: "pr_col_1814", rawCode: "1814", geo: "col" },
46
- pr_col_1637: { code: "pr_col_1637", rawCode: "1637", geo: "col" },
47
- pr_col_1071: { code: "pr_col_1071", rawCode: "1071", geo: "col" },
48
- pr_col_1286: { code: "pr_col_1286", rawCode: "1286", geo: "col" },
49
- pr_col_1070: { code: "pr_col_1070", rawCode: "1070", geo: "col" },
38
+ pr_col_1289: { code: "pr_col_1289", rawCode: "1289", geo: "col", scope: "checkout" },
39
+ pr_col_1816: { code: "pr_col_1816", rawCode: "1816", geo: "col", scope: "checkout" },
40
+ pr_col_1097: { code: "pr_col_1097", rawCode: "1097", geo: "col", scope: "checkout" },
41
+ pr_col_1551: { code: "pr_col_1551", rawCode: "1551", geo: "col", scope: "checkout" },
42
+ pr_col_1051: { code: "pr_col_1051", rawCode: "1051", geo: "col", scope: "checkout" },
43
+ pr_col_1802: { code: "pr_col_1802", rawCode: "1802", geo: "col", scope: "checkout" },
44
+ pr_col_1121: { code: "pr_col_1121", rawCode: "1121", geo: "col", scope: "checkout" },
45
+ pr_col_1814: { code: "pr_col_1814", rawCode: "1814", geo: "col", scope: "checkout" },
46
+ pr_col_1637: { code: "pr_col_1637", rawCode: "1637", geo: "col", scope: "checkout" },
47
+ pr_col_1071: { code: "pr_col_1071", rawCode: "1071", geo: "col", scope: "checkout" },
48
+ pr_col_1286: { code: "pr_col_1286", rawCode: "1286", geo: "col", scope: "checkout" },
49
+ pr_col_1070: { code: "pr_col_1070", rawCode: "1070", geo: "col", scope: "checkout" },
50
50
  pr_col_1067: { code: "pr_col_1067", rawCode: "1067", geo: "col" },
51
- pr_col_1801: { code: "pr_col_1801", rawCode: "1801", geo: "col" },
52
- pr_col_1507: { code: "pr_col_1507", rawCode: "1507", geo: "col" },
53
- pr_col_1809: { code: "pr_col_1809", rawCode: "1809", geo: "col" },
51
+ pr_col_1801: { code: "pr_col_1801", rawCode: "1801", geo: "col", scope: "checkout" },
52
+ pr_col_1507: { code: "pr_col_1507", rawCode: "1507", geo: "col", scope: "checkout" },
53
+ pr_col_1809: { code: "pr_col_1809", rawCode: "1809", geo: "col", scope: "checkout" },
54
54
  pr_col_1560: { code: "pr_col_1560", rawCode: "1560", geo: "col" },
55
- pr_col_1803: { code: "pr_col_1803", rawCode: "1803", geo: "col" },
56
- pr_col_1811: { code: "pr_col_1811", rawCode: "1811", geo: "col" },
55
+ pr_col_1803: { code: "pr_col_1803", rawCode: "1803", geo: "col", scope: "checkout" },
56
+ pr_col_1811: { code: "pr_col_1811", rawCode: "1811", geo: "col", scope: "checkout" },
57
57
  pr_col_1813: { code: "pr_col_1813", rawCode: "1813", geo: "col" },
58
- pr_col_1019: { code: "pr_col_1019", rawCode: "1019", geo: "col" },
59
- pr_col_1804: { code: "pr_col_1804", rawCode: "1804", geo: "col" },
58
+ pr_col_1019: { code: "pr_col_1019", rawCode: "1019", geo: "col", scope: "checkout" },
59
+ pr_col_1804: { code: "pr_col_1804", rawCode: "1804", geo: "col", scope: "checkout" },
60
60
  pr_mex_40133: { code: "pr_mex_40133", rawCode: "40133", geo: "mex" },
61
61
  pr_mex_40062: { code: "pr_mex_40062", rawCode: "40062", geo: "mex" },
62
62
  pr_mex_90721: { code: "pr_mex_90721", rawCode: "90721", geo: "mex" },
@@ -1,2 +1,2 @@
1
- export type { FinancialInstitution, FinancialInstitutionGeo } from "./catalog";
1
+ export type { FinancialInstitution, FinancialInstitutionGeo, FinancialInstitutionScope } from "./catalog";
2
2
  export * from "./utils/financial-institution.utils";
@@ -4,11 +4,18 @@ import type { CatalogQuery } from "../../utils/catalog-query.utils";
4
4
  export type FinancialInstitutionOption = FinancialInstitutionRecord & {
5
5
  label: string;
6
6
  };
7
+ /**
8
+ * The catalog by code. Indexed by a plain string (e.g. a code from an API payload) instead of a known code,
9
+ * the lookup is `FinancialInstitutionOption | undefined`, so an unknown code needs no cast to be handled.
10
+ */
11
+ export interface FinancialInstitutionCatalog extends Record<FinancialInstitution, FinancialInstitutionOption> {
12
+ [code: string]: FinancialInstitutionOption | undefined;
13
+ }
7
14
  /**
8
15
  * The catalog indexed by code (same shape as FINANCIAL_INSTITUTIONS), each record enriched
9
- * with its label for the given language. Access by code directly, or Object.values for a list.
16
+ * with its label for the given language. Access by code directly; for a list use `queryFinancialInstitutions`.
10
17
  */
11
- export declare const getFinancialInstitutions: (lang: Locale) => Record<FinancialInstitution, FinancialInstitutionOption>;
18
+ export declare const getFinancialInstitutions: (lang: Locale) => FinancialInstitutionCatalog;
12
19
  /** `lang` is required (i18n domain, no default) and travels inside the query object, never positional. */
13
20
  export type FinancialInstitutionQuery = CatalogQuery<FinancialInstitutionRecord> & {
14
21
  lang: Locale;
@@ -9,11 +9,8 @@ const en_json_1 = __importDefault(require("../locales/en.json"));
9
9
  const es_mex_json_1 = __importDefault(require("../locales/es-mex.json"));
10
10
  const catalog_query_utils_1 = require("../../utils/catalog-query.utils");
11
11
  const locales = { en: en_json_1.default, "es-mex": es_mex_json_1.default };
12
- /**
13
- * The catalog indexed by code (same shape as FINANCIAL_INSTITUTIONS), each record enriched
14
- * with its label for the given language. Access by code directly, or Object.values for a list.
15
- */
16
- const getFinancialInstitutions = (lang) => {
12
+ // Built with the strict type so `queryFinancialInstitutions` lists it without the string index signature.
13
+ const buildFinancialInstitutions = (lang) => {
17
14
  const locale = locales[lang];
18
15
  const result = {};
19
16
  for (const record of Object.values(catalog_1.FINANCIAL_INSTITUTIONS)) {
@@ -21,11 +18,15 @@ const getFinancialInstitutions = (lang) => {
21
18
  }
22
19
  return result;
23
20
  };
21
+ /**
22
+ * The catalog indexed by code (same shape as FINANCIAL_INSTITUTIONS), each record enriched
23
+ * with its label for the given language. Access by code directly; for a list use `queryFinancialInstitutions`.
24
+ */
25
+ const getFinancialInstitutions = (lang) => buildFinancialInstitutions(lang);
24
26
  exports.getFinancialInstitutions = getFinancialInstitutions;
25
27
  /** The catalog as a list, narrowed by the query — see `matchesQuery` for the matching rules. */
26
28
  const queryFinancialInstitutions = (query) => {
27
29
  const { lang, ...criteria } = query;
28
- const institutions = (0, exports.getFinancialInstitutions)(lang);
29
- return Object.values(institutions).filter(institution => (0, catalog_query_utils_1.matchesQuery)(institution, criteria));
30
+ return Object.values(buildFinancialInstitutions(lang)).filter(institution => (0, catalog_query_utils_1.matchesQuery)(institution, criteria));
30
31
  };
31
32
  exports.queryFinancialInstitutions = queryFinancialInstitutions;
@@ -1,59 +1,59 @@
1
1
  export const FINANCIAL_INSTITUTIONS = {
2
- pr_col_1558: { code: "pr_col_1558", rawCode: "1558", geo: "col" },
3
- pr_col_1059: { code: "pr_col_1059", rawCode: "1059", geo: "col" },
4
- pr_col_1040: { code: "pr_col_1040", rawCode: "1040", geo: "col" },
5
- pr_col_1052: { code: "pr_col_1052", rawCode: "1052", geo: "col" },
2
+ pr_col_1558: { code: "pr_col_1558", rawCode: "1558", geo: "col", scope: "checkout" },
3
+ pr_col_1059: { code: "pr_col_1059", rawCode: "1059", geo: "col", scope: "checkout" },
4
+ pr_col_1040: { code: "pr_col_1040", rawCode: "1040", geo: "col", scope: "checkout" },
5
+ pr_col_1052: { code: "pr_col_1052", rawCode: "1052", geo: "col", scope: "checkout" },
6
6
  pr_col_1805: { code: "pr_col_1805", rawCode: "1805", geo: "col" },
7
- pr_col_1032: { code: "pr_col_1032", rawCode: "1032", geo: "col" },
7
+ pr_col_1032: { code: "pr_col_1032", rawCode: "1032", geo: "col", scope: "checkout" },
8
8
  pr_col_1819: { code: "pr_col_1819", rawCode: "1819", geo: "col" },
9
- pr_col_1066: { code: "pr_col_1066", rawCode: "1066", geo: "col" },
10
- pr_col_1001: { code: "pr_col_1001", rawCode: "1001", geo: "col" },
11
- pr_col_1023: { code: "pr_col_1023", rawCode: "1023", geo: "col" },
12
- pr_col_1062: { code: "pr_col_1062", rawCode: "1062", geo: "col" },
13
- pr_col_1063: { code: "pr_col_1063", rawCode: "1063", geo: "col" },
14
- pr_col_1012: { code: "pr_col_1012", rawCode: "1012", geo: "col" },
15
- pr_col_1006: { code: "pr_col_1006", rawCode: "1006", geo: "col" },
16
- pr_col_1047: { code: "pr_col_1047", rawCode: "1047", geo: "col" },
17
- pr_col_1060: { code: "pr_col_1060", rawCode: "1060", geo: "col" },
18
- pr_col_1002: { code: "pr_col_1002", rawCode: "1002", geo: "col" },
19
- pr_col_1065: { code: "pr_col_1065", rawCode: "1065", geo: "col" },
20
- pr_col_1069: { code: "pr_col_1069", rawCode: "1069", geo: "col" },
21
- pr_col_1303: { code: "pr_col_1303", rawCode: "1303", geo: "col" },
9
+ pr_col_1066: { code: "pr_col_1066", rawCode: "1066", geo: "col", scope: "checkout" },
10
+ pr_col_1001: { code: "pr_col_1001", rawCode: "1001", geo: "col", scope: "checkout" },
11
+ pr_col_1023: { code: "pr_col_1023", rawCode: "1023", geo: "col", scope: "checkout" },
12
+ pr_col_1062: { code: "pr_col_1062", rawCode: "1062", geo: "col", scope: "checkout" },
13
+ pr_col_1063: { code: "pr_col_1063", rawCode: "1063", geo: "col", scope: "checkout" },
14
+ pr_col_1012: { code: "pr_col_1012", rawCode: "1012", geo: "col", scope: "checkout" },
15
+ pr_col_1006: { code: "pr_col_1006", rawCode: "1006", geo: "col", scope: "checkout" },
16
+ pr_col_1047: { code: "pr_col_1047", rawCode: "1047", geo: "col", scope: "checkout" },
17
+ pr_col_1060: { code: "pr_col_1060", rawCode: "1060", geo: "col", scope: "checkout" },
18
+ pr_col_1002: { code: "pr_col_1002", rawCode: "1002", geo: "col", scope: "checkout" },
19
+ pr_col_1065: { code: "pr_col_1065", rawCode: "1065", geo: "col", scope: "checkout" },
20
+ pr_col_1069: { code: "pr_col_1069", rawCode: "1069", geo: "col", scope: "checkout" },
21
+ pr_col_1303: { code: "pr_col_1303", rawCode: "1303", geo: "col", scope: "checkout" },
22
22
  pr_col_1053: { code: "pr_col_1053", rawCode: "1053", geo: "col" },
23
23
  pr_col_1031: { code: "pr_col_1031", rawCode: "1031", geo: "col" },
24
- pr_col_1007: { code: "pr_col_1007", rawCode: "1007", geo: "col" },
25
- pr_col_1061: { code: "pr_col_1061", rawCode: "1061", geo: "col" },
26
- pr_col_1013: { code: "pr_col_1013", rawCode: "1013", geo: "col" },
24
+ pr_col_1007: { code: "pr_col_1007", rawCode: "1007", geo: "col", scope: "checkout" },
25
+ pr_col_1061: { code: "pr_col_1061", rawCode: "1061", geo: "col", scope: "checkout" },
26
+ pr_col_1013: { code: "pr_col_1013", rawCode: "1013", geo: "col", scope: "checkout" },
27
27
  pr_col_1042: { code: "pr_col_1042", rawCode: "1042", geo: "col" },
28
- pr_col_1808: { code: "pr_col_1808", rawCode: "1808", geo: "col" },
29
- pr_col_1283: { code: "pr_col_1283", rawCode: "1283", geo: "col" },
30
- pr_col_1009: { code: "pr_col_1009", rawCode: "1009", geo: "col" },
31
- pr_col_1812: { code: "pr_col_1812", rawCode: "1812", geo: "col" },
32
- pr_col_1370: { code: "pr_col_1370", rawCode: "1370", geo: "col" },
33
- pr_col_1292: { code: "pr_col_1292", rawCode: "1292", geo: "col" },
28
+ pr_col_1808: { code: "pr_col_1808", rawCode: "1808", geo: "col", scope: "checkout" },
29
+ pr_col_1283: { code: "pr_col_1283", rawCode: "1283", geo: "col", scope: "checkout" },
30
+ pr_col_1009: { code: "pr_col_1009", rawCode: "1009", geo: "col", scope: "checkout" },
31
+ pr_col_1812: { code: "pr_col_1812", rawCode: "1812", geo: "col", scope: "checkout" },
32
+ pr_col_1370: { code: "pr_col_1370", rawCode: "1370", geo: "col", scope: "checkout" },
33
+ pr_col_1292: { code: "pr_col_1292", rawCode: "1292", geo: "col", scope: "checkout" },
34
34
  pr_col_1291: { code: "pr_col_1291", rawCode: "1291", geo: "col" },
35
- pr_col_1289: { code: "pr_col_1289", rawCode: "1289", geo: "col" },
36
- pr_col_1816: { code: "pr_col_1816", rawCode: "1816", geo: "col" },
37
- pr_col_1097: { code: "pr_col_1097", rawCode: "1097", geo: "col" },
38
- pr_col_1551: { code: "pr_col_1551", rawCode: "1551", geo: "col" },
39
- pr_col_1051: { code: "pr_col_1051", rawCode: "1051", geo: "col" },
40
- pr_col_1802: { code: "pr_col_1802", rawCode: "1802", geo: "col" },
41
- pr_col_1121: { code: "pr_col_1121", rawCode: "1121", geo: "col" },
42
- pr_col_1814: { code: "pr_col_1814", rawCode: "1814", geo: "col" },
43
- pr_col_1637: { code: "pr_col_1637", rawCode: "1637", geo: "col" },
44
- pr_col_1071: { code: "pr_col_1071", rawCode: "1071", geo: "col" },
45
- pr_col_1286: { code: "pr_col_1286", rawCode: "1286", geo: "col" },
46
- pr_col_1070: { code: "pr_col_1070", rawCode: "1070", geo: "col" },
35
+ pr_col_1289: { code: "pr_col_1289", rawCode: "1289", geo: "col", scope: "checkout" },
36
+ pr_col_1816: { code: "pr_col_1816", rawCode: "1816", geo: "col", scope: "checkout" },
37
+ pr_col_1097: { code: "pr_col_1097", rawCode: "1097", geo: "col", scope: "checkout" },
38
+ pr_col_1551: { code: "pr_col_1551", rawCode: "1551", geo: "col", scope: "checkout" },
39
+ pr_col_1051: { code: "pr_col_1051", rawCode: "1051", geo: "col", scope: "checkout" },
40
+ pr_col_1802: { code: "pr_col_1802", rawCode: "1802", geo: "col", scope: "checkout" },
41
+ pr_col_1121: { code: "pr_col_1121", rawCode: "1121", geo: "col", scope: "checkout" },
42
+ pr_col_1814: { code: "pr_col_1814", rawCode: "1814", geo: "col", scope: "checkout" },
43
+ pr_col_1637: { code: "pr_col_1637", rawCode: "1637", geo: "col", scope: "checkout" },
44
+ pr_col_1071: { code: "pr_col_1071", rawCode: "1071", geo: "col", scope: "checkout" },
45
+ pr_col_1286: { code: "pr_col_1286", rawCode: "1286", geo: "col", scope: "checkout" },
46
+ pr_col_1070: { code: "pr_col_1070", rawCode: "1070", geo: "col", scope: "checkout" },
47
47
  pr_col_1067: { code: "pr_col_1067", rawCode: "1067", geo: "col" },
48
- pr_col_1801: { code: "pr_col_1801", rawCode: "1801", geo: "col" },
49
- pr_col_1507: { code: "pr_col_1507", rawCode: "1507", geo: "col" },
50
- pr_col_1809: { code: "pr_col_1809", rawCode: "1809", geo: "col" },
48
+ pr_col_1801: { code: "pr_col_1801", rawCode: "1801", geo: "col", scope: "checkout" },
49
+ pr_col_1507: { code: "pr_col_1507", rawCode: "1507", geo: "col", scope: "checkout" },
50
+ pr_col_1809: { code: "pr_col_1809", rawCode: "1809", geo: "col", scope: "checkout" },
51
51
  pr_col_1560: { code: "pr_col_1560", rawCode: "1560", geo: "col" },
52
- pr_col_1803: { code: "pr_col_1803", rawCode: "1803", geo: "col" },
53
- pr_col_1811: { code: "pr_col_1811", rawCode: "1811", geo: "col" },
52
+ pr_col_1803: { code: "pr_col_1803", rawCode: "1803", geo: "col", scope: "checkout" },
53
+ pr_col_1811: { code: "pr_col_1811", rawCode: "1811", geo: "col", scope: "checkout" },
54
54
  pr_col_1813: { code: "pr_col_1813", rawCode: "1813", geo: "col" },
55
- pr_col_1019: { code: "pr_col_1019", rawCode: "1019", geo: "col" },
56
- pr_col_1804: { code: "pr_col_1804", rawCode: "1804", geo: "col" },
55
+ pr_col_1019: { code: "pr_col_1019", rawCode: "1019", geo: "col", scope: "checkout" },
56
+ pr_col_1804: { code: "pr_col_1804", rawCode: "1804", geo: "col", scope: "checkout" },
57
57
  pr_mex_40133: { code: "pr_mex_40133", rawCode: "40133", geo: "mex" },
58
58
  pr_mex_40062: { code: "pr_mex_40062", rawCode: "40062", geo: "mex" },
59
59
  pr_mex_90721: { code: "pr_mex_90721", rawCode: "90721", geo: "mex" },
@@ -3,11 +3,8 @@ import enLocale from "../locales/en.json";
3
3
  import esMexLocale from "../locales/es-mex.json";
4
4
  import { matchesQuery } from "../../utils/catalog-query.utils";
5
5
  const locales = { en: enLocale, "es-mex": esMexLocale };
6
- /**
7
- * The catalog indexed by code (same shape as FINANCIAL_INSTITUTIONS), each record enriched
8
- * with its label for the given language. Access by code directly, or Object.values for a list.
9
- */
10
- export const getFinancialInstitutions = (lang) => {
6
+ // Built with the strict type so `queryFinancialInstitutions` lists it without the string index signature.
7
+ const buildFinancialInstitutions = (lang) => {
11
8
  const locale = locales[lang];
12
9
  const result = {};
13
10
  for (const record of Object.values(FINANCIAL_INSTITUTIONS)) {
@@ -15,9 +12,13 @@ export const getFinancialInstitutions = (lang) => {
15
12
  }
16
13
  return result;
17
14
  };
15
+ /**
16
+ * The catalog indexed by code (same shape as FINANCIAL_INSTITUTIONS), each record enriched
17
+ * with its label for the given language. Access by code directly; for a list use `queryFinancialInstitutions`.
18
+ */
19
+ export const getFinancialInstitutions = (lang) => buildFinancialInstitutions(lang);
18
20
  /** The catalog as a list, narrowed by the query — see `matchesQuery` for the matching rules. */
19
21
  export const queryFinancialInstitutions = (query) => {
20
22
  const { lang, ...criteria } = query;
21
- const institutions = getFinancialInstitutions(lang);
22
- return Object.values(institutions).filter(institution => matchesQuery(institution, criteria));
23
+ return Object.values(buildFinancialInstitutions(lang)).filter(institution => matchesQuery(institution, criteria));
23
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cobre-npm/library-portal-core",
3
- "version": "0.63.0",
3
+ "version": "0.65.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",