cozy-client 46.10.1 → 47.0.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/types/types.d.ts CHANGED
@@ -1608,4 +1608,40 @@ export type InstanceInfo = {
1608
1608
  */
1609
1609
  diskUsage: DiskUsage;
1610
1610
  };
1611
+ export type CountryISO = {
1612
+ /**
1613
+ * - ISO 3166-1 alpha-2
1614
+ */
1615
+ code2: string;
1616
+ /**
1617
+ * - ISO 3166-1 alpha-3
1618
+ */
1619
+ code3: string;
1620
+ /**
1621
+ * - ISO 3166-1 numeric
1622
+ */
1623
+ number: string;
1624
+ };
1625
+ export type Country = {
1626
+ /**
1627
+ * - ISO 3166-1 alpha-2
1628
+ */
1629
+ code2: string;
1630
+ /**
1631
+ * - ISO 3166-1 alpha-3
1632
+ */
1633
+ code3: string;
1634
+ /**
1635
+ * - ISO 3166-1 numeric
1636
+ */
1637
+ number: string;
1638
+ /**
1639
+ * - Country name
1640
+ */
1641
+ name: string;
1642
+ /**
1643
+ * - Nationality name
1644
+ */
1645
+ nationality: string;
1646
+ };
1611
1647
  import { QueryDefinition } from "./queries/dsl";
@@ -1,18 +0,0 @@
1
- import { checkCountryCode } from './countries'
2
-
3
- describe('checkCountryCode', () => {
4
- it('should return true for valid country codes', () => {
5
- expect(checkCountryCode('FR')).toBe(true)
6
- expect(checkCountryCode('fr')).toBe(true)
7
- expect(checkCountryCode('FRA')).toBe(true)
8
- expect(checkCountryCode('fra')).toBe(true)
9
- expect(checkCountryCode('US')).toBe(true)
10
- expect(checkCountryCode('us')).toBe(true)
11
- })
12
-
13
- it('should return false for invalid country codes', () => {
14
- expect(checkCountryCode(undefined)).toBe(false)
15
- expect(checkCountryCode(null)).toBe(false)
16
- expect(checkCountryCode('')).toBe(false)
17
- })
18
- })
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getEmojiByCountry = void 0;
7
- var emojiCountry = {
8
- fr: '🇫🇷'
9
- };
10
- /**
11
- * @param {string} country - fr, en, etc
12
- * @param {Function} t - Translation function
13
- * @returns {string} - Emoji of country
14
- */
15
-
16
- var getEmojiByCountry = function getEmojiByCountry(country, t) {
17
- if (country === 'stranger') return t('country.stranger');
18
- return emojiCountry[country];
19
- };
20
-
21
- exports.getEmojiByCountry = getEmojiByCountry;
@@ -1,26 +0,0 @@
1
- import { getEmojiByCountry } from './emojiCountry'
2
-
3
- describe('getEmojiByCountry', () => {
4
- const mockT = jest.fn(key => key)
5
- it('should return fr flag', () => {
6
- const res = getEmojiByCountry('fr', mockT)
7
-
8
- expect(res).toBe('🇫🇷')
9
- })
10
- it('should return "stranger" string (key: country.stranger)', () => {
11
- const mockT = jest.fn(key => key)
12
- const res = getEmojiByCountry('stranger', mockT)
13
-
14
- expect(res).toBe('country.stranger')
15
- })
16
- it('should return "undefined" if the country is not "fr"', () => {
17
- const res = getEmojiByCountry('en', mockT)
18
-
19
- expect(res).toBe(undefined)
20
- })
21
- it('should return "undefined" if the country is undefined', () => {
22
- const res = getEmojiByCountry(undefined, mockT)
23
-
24
- expect(res).toBe(undefined)
25
- })
26
- })
@@ -1,33 +0,0 @@
1
- /**
2
- * @typedef {Object} CountryISO
3
- * @property {string} code2 - ISO 3166-1 alpha-2
4
- * @property {string} code3 - ISO 3166-1 alpha-3
5
- * @property {string} name - Country name
6
- * @property {string} number - ISO 3166-1 numeric
7
- */
8
- /**
9
- * List of countries with their ISO codes
10
- *
11
- * @constant
12
- * @type {CountryISO[]}
13
- */
14
- export const COUNTRIES_ISO: CountryISO[];
15
- export function checkCountryCode(code: string): boolean;
16
- export type CountryISO = {
17
- /**
18
- * - ISO 3166-1 alpha-2
19
- */
20
- code2: string;
21
- /**
22
- * - ISO 3166-1 alpha-3
23
- */
24
- code3: string;
25
- /**
26
- * - Country name
27
- */
28
- name: string;
29
- /**
30
- * - ISO 3166-1 numeric
31
- */
32
- number: string;
33
- };