@cobre-npm/library-portal-core 0.25.0 → 0.26.1

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
@@ -43,6 +43,7 @@ import { getCountries } from "@cobre-npm/library-portal-core/countries"
43
43
  | `@cobre-npm/library-portal-core/currencies` | Currencies |
44
44
  | `@cobre-npm/library-portal-core/transactions` | Transaction interfaces |
45
45
  | `@cobre-npm/library-portal-core/search` | Search / aggregation interfaces |
46
+ | `@cobre-npm/library-portal-core/trustedSessions` | Trusted session (OTP elevation window) interfaces |
46
47
  | `@cobre-npm/library-portal-core/lang` | Supported locales (`Locale`, defaults) |
47
48
  | `@cobre-npm/library-portal-core` (root) | ⚠️ **Legacy / deprecated** — see [below](#legacy-code--and-its-deprecation) |
48
49
 
@@ -246,15 +247,19 @@ Object.values(getCurrencies()).filter(c => c.type === "fiat") // the consumer
246
247
 
247
248
  No `lang`: the `label` is fixed (a display code, the same in any language).
248
249
 
249
- ### `transactions` / `search`
250
+ ### `transactions` / `search` / `trustedSessions`
250
251
 
251
252
  Interfaces only (pure types):
252
253
 
253
254
  ```ts
254
255
  import type { Transaction, EnrichedTransaction } from "@cobre-npm/library-portal-core/transactions"
255
256
  import type { SearchRequest, SearchResponse, SearchFilter } from "@cobre-npm/library-portal-core/search"
257
+ import type { TrustedSessionStatus } from "@cobre-npm/library-portal-core/trustedSessions"
256
258
  ```
257
259
 
260
+ `TrustedSessionStatus` is the contract of `/trusted-sessions`: the OTP elevation window that lets a
261
+ caller stop attaching an `otp_token` per request while the window is active.
262
+
258
263
  ---
259
264
 
260
265
  ## i18n / languages
@@ -18,7 +18,7 @@
18
18
  "np": "Natural person",
19
19
  "le": "Legal entity",
20
20
  "mm_return": "SPEI return",
21
- "generic": "Generic - Business",
22
- "generic_np": "Generic - Natural person"
21
+ "generic": "Banking - Business",
22
+ "generic_np": "Banking - Individual"
23
23
  }
24
24
  }
@@ -18,7 +18,7 @@
18
18
  "np": "Persona natural",
19
19
  "le": "Persona jurídica",
20
20
  "mm_return": "Retorno SPEI",
21
- "generic": "Genérica - Empresa",
22
- "generic_np": "Genérica - Persona natural"
21
+ "generic": "Bancaria - Empresa",
22
+ "generic_np": "Bancaria - Individual"
23
23
  }
24
24
  }
@@ -18,7 +18,7 @@
18
18
  "np": "Natural person",
19
19
  "le": "Legal entity",
20
20
  "mm_return": "SPEI return",
21
- "generic": "Generic - Business",
22
- "generic_np": "Generic - Natural person"
21
+ "generic": "Banking - Business",
22
+ "generic_np": "Banking - Individual"
23
23
  }
24
24
  }
@@ -18,7 +18,7 @@
18
18
  "np": "Persona natural",
19
19
  "le": "Persona jurídica",
20
20
  "mm_return": "Retorno SPEI",
21
- "generic": "Genérica - Empresa",
22
- "generic_np": "Genérica - Persona natural"
21
+ "generic": "Bancaria - Empresa",
22
+ "generic_np": "Bancaria - Individual"
23
23
  }
24
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"country-iso.utils.d.ts","sourceRoot":"","sources":["../../../../src/countries/iso/utils/country-iso.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAG9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAM3C,eAAO,MAAM,iBAAiB,GAAI,MAAM,UAAU,KAAG,OAAyC,CAAA;AAE9F,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAEnE,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,MAAM,CAAC,UAAU,EAAE,gBAAgB,CASjF,CAAA;AAED,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,KAAG,kBAAkB,EAUxE,CAAA"}
1
+ {"version":3,"file":"country-iso.utils.d.ts","sourceRoot":"","sources":["../../../../src/countries/iso/utils/country-iso.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAG9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAM3C,eAAO,MAAM,iBAAiB,GAAI,MAAM,UAAU,KAAG,OAAyC,CAAA;AAE9F,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAEnE,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,MAAM,CAAC,UAAU,EAAE,gBAAgB,CASjF,CAAA;AAED,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,KAAG,kBAAkB,EAsBxE,CAAA"}
@@ -22,13 +22,24 @@ const getCountriesISO = (lang) => {
22
22
  exports.getCountriesISO = getCountriesISO;
23
23
  const getIndicativesWithCodes = (lang) => {
24
24
  const locale = locales[lang];
25
- return Object.values(catalog_1.COUNTRIES_ISO).map((record, index) => ({
26
- id: index + 1,
27
- code: record.indicative,
28
- geo: (0, exports.hasCountryISOFlag)(record.code) ? record.code : "",
29
- country: locale.countriesISO[record.code],
30
- isoCode: record.isoCode,
31
- }));
25
+ const seenDialCodes = new Set();
26
+ const indicatives = [];
27
+ /* A few countries share a dial code (e.g. usa/can both "+1"). Only the first one encountered is
28
+ kept, so a phone-indicative picker never shows two rows for the same code. Catalog order puts
29
+ usa ahead of can, so usa wins. */
30
+ for (const record of Object.values(catalog_1.COUNTRIES_ISO)) {
31
+ if (seenDialCodes.has(record.indicative))
32
+ continue;
33
+ seenDialCodes.add(record.indicative);
34
+ indicatives.push({
35
+ id: indicatives.length + 1,
36
+ code: record.indicative,
37
+ geo: (0, exports.hasCountryISOFlag)(record.code) ? record.code : "",
38
+ country: locale.countriesISO[record.code],
39
+ isoCode: record.isoCode,
40
+ });
41
+ }
42
+ return indicatives;
32
43
  };
33
44
  exports.getIndicativesWithCodes = getIndicativesWithCodes;
34
45
  //# sourceMappingURL=country-iso.utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"country-iso.utils.js","sourceRoot":"","sources":["../../../../src/countries/iso/utils/country-iso.utils.ts"],"names":[],"mappings":";;;;;;AAAA,wCAA0C;AAE1C,iEAAyC;AACzC,yEAAgD;AAGhD,MAAM,OAAO,GAAuC,EAAE,EAAE,EAAE,iBAAQ,EAAE,QAAQ,EAAE,qBAAW,EAAE,CAAA;AAE3F,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAa,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;AAEhE,MAAM,iBAAiB,GAAG,CAAC,IAAgB,EAAW,EAAE,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAAjF,QAAA,iBAAiB,qBAAgE;AAYvF,MAAM,eAAe,GAAG,CAAC,IAAY,EAAwC,EAAE;IACpF,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,MAAM,GAAG,EAA0C,CAAA;IAEzD,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,uBAAa,CAAC,EAAE,CAAC;QAClD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,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@ -0,0 +1,2 @@
1
+ export * from "./interfaces/response.interface";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/trustedSessions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAA"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./interfaces/response.interface"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/trustedSessions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAA+C"}
@@ -0,0 +1,6 @@
1
+ export interface TrustedSessionStatus {
2
+ active: boolean;
3
+ valid_until?: number;
4
+ expires_in?: number;
5
+ }
6
+ //# sourceMappingURL=response.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.interface.d.ts","sourceRoot":"","sources":["../../../src/trustedSessions/interfaces/response.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.interface.js","sourceRoot":"","sources":["../../../src/trustedSessions/interfaces/response.interface.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cobre-npm/library-portal-core",
3
- "version": "0.25.0",
3
+ "version": "0.26.1",
4
4
  "description": "Shared configurations and resources for Portal MFEs",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -41,6 +41,10 @@
41
41
  "types": "./dist/search/index.d.ts",
42
42
  "default": "./dist/search/index.js"
43
43
  },
44
+ "./trustedSessions": {
45
+ "types": "./dist/trustedSessions/index.d.ts",
46
+ "default": "./dist/trustedSessions/index.js"
47
+ },
44
48
  "./lang": {
45
49
  "types": "./dist/lang/index.d.ts",
46
50
  "default": "./dist/lang/index.js"