@thisisagile/easy 8.0.0 → 8.2.5

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.
@@ -0,0 +1,251 @@
1
+ {
2
+ "AF": "Afghanistan",
3
+ "AX": "\u00c5land Islands",
4
+ "AL": "Albania",
5
+ "DZ": "Algeria",
6
+ "AS": "American Samoa",
7
+ "AD": "Andorra",
8
+ "AO": "Angola",
9
+ "AI": "Anguilla",
10
+ "AQ": "Antarctica",
11
+ "AG": "Antigua & Barbuda",
12
+ "AR": "Argentina",
13
+ "AM": "Armenia",
14
+ "AW": "Aruba",
15
+ "AU": "Australia",
16
+ "AT": "Austria",
17
+ "AZ": "Azerbaijan",
18
+ "BS": "Bahamas",
19
+ "BH": "Bahrain",
20
+ "BD": "Bangladesh",
21
+ "BB": "Barbados",
22
+ "BY": "Belarus",
23
+ "BE": "Belgium",
24
+ "BZ": "Belize",
25
+ "BJ": "Benin",
26
+ "BM": "Bermuda",
27
+ "BT": "Bhutan",
28
+ "BO": "Bolivia",
29
+ "BA": "Bosnia & Herzegovina",
30
+ "BW": "Botswana",
31
+ "BV": "Bouvet Island",
32
+ "BR": "Brazil",
33
+ "IO": "British Indian Ocean Territory",
34
+ "VG": "British Virgin Islands",
35
+ "BN": "Brunei",
36
+ "BG": "Bulgaria",
37
+ "BF": "Burkina Faso",
38
+ "BI": "Burundi",
39
+ "KH": "Cambodia",
40
+ "CM": "Cameroon",
41
+ "CA": "Canada",
42
+ "CV": "Cape Verde",
43
+ "BQ": "Caribbean Netherlands",
44
+ "KY": "Cayman Islands",
45
+ "CF": "Central African Republic",
46
+ "TD": "Chad",
47
+ "CL": "Chile",
48
+ "CN": "China",
49
+ "CX": "Christmas Island",
50
+ "CC": "Cocos (Keeling) Islands",
51
+ "CO": "Colombia",
52
+ "KM": "Comoros",
53
+ "CG": "Congo - Brazzaville",
54
+ "CD": "Congo - Kinshasa",
55
+ "CK": "Cook Islands",
56
+ "CR": "Costa Rica",
57
+ "CI": "C\u00f4te d\u2019Ivoire",
58
+ "HR": "Croatia",
59
+ "CU": "Cuba",
60
+ "CW": "Cura\u00e7ao",
61
+ "CY": "Cyprus",
62
+ "CZ": "Czechia",
63
+ "DK": "Denmark",
64
+ "DJ": "Djibouti",
65
+ "DM": "Dominica",
66
+ "DO": "Dominican Republic",
67
+ "EC": "Ecuador",
68
+ "EG": "Egypt",
69
+ "SV": "El Salvador",
70
+ "GQ": "Equatorial Guinea",
71
+ "ER": "Eritrea",
72
+ "EE": "Estonia",
73
+ "SZ": "Eswatini",
74
+ "ET": "Ethiopia",
75
+ "FK": "Falkland Islands",
76
+ "FO": "Faroe Islands",
77
+ "FJ": "Fiji",
78
+ "FI": "Finland",
79
+ "FR": "France",
80
+ "GF": "French Guiana",
81
+ "PF": "French Polynesia",
82
+ "TF": "French Southern Territories",
83
+ "GA": "Gabon",
84
+ "GM": "Gambia",
85
+ "GE": "Georgia",
86
+ "DE": "Germany",
87
+ "GH": "Ghana",
88
+ "GI": "Gibraltar",
89
+ "GR": "Greece",
90
+ "GL": "Greenland",
91
+ "GD": "Grenada",
92
+ "GP": "Guadeloupe",
93
+ "GU": "Guam",
94
+ "GT": "Guatemala",
95
+ "GG": "Guernsey",
96
+ "GN": "Guinea",
97
+ "GW": "Guinea-Bissau",
98
+ "GY": "Guyana",
99
+ "HT": "Haiti",
100
+ "HM": "Heard & McDonald Islands",
101
+ "HN": "Honduras",
102
+ "HK": "Hong Kong SAR China",
103
+ "HU": "Hungary",
104
+ "IS": "Iceland",
105
+ "IN": "India",
106
+ "ID": "Indonesia",
107
+ "IR": "Iran",
108
+ "IQ": "Iraq",
109
+ "IE": "Ireland",
110
+ "IM": "Isle of Man",
111
+ "IL": "Israel",
112
+ "IT": "Italy",
113
+ "JM": "Jamaica",
114
+ "JP": "Japan",
115
+ "JE": "Jersey",
116
+ "JO": "Jordan",
117
+ "KZ": "Kazakhstan",
118
+ "KE": "Kenya",
119
+ "KI": "Kiribati",
120
+ "KW": "Kuwait",
121
+ "KG": "Kyrgyzstan",
122
+ "LA": "Laos",
123
+ "LV": "Latvia",
124
+ "LB": "Lebanon",
125
+ "LS": "Lesotho",
126
+ "LR": "Liberia",
127
+ "LY": "Libya",
128
+ "LI": "Liechtenstein",
129
+ "LT": "Lithuania",
130
+ "LU": "Luxembourg",
131
+ "MO": "Macao SAR China",
132
+ "MG": "Madagascar",
133
+ "MW": "Malawi",
134
+ "MY": "Malaysia",
135
+ "MV": "Maldives",
136
+ "ML": "Mali",
137
+ "MT": "Malta",
138
+ "MH": "Marshall Islands",
139
+ "MQ": "Martinique",
140
+ "MR": "Mauritania",
141
+ "MU": "Mauritius",
142
+ "YT": "Mayotte",
143
+ "MX": "Mexico",
144
+ "FM": "Micronesia",
145
+ "MD": "Moldova",
146
+ "MC": "Monaco",
147
+ "MN": "Mongolia",
148
+ "ME": "Montenegro",
149
+ "MS": "Montserrat",
150
+ "MA": "Morocco",
151
+ "MZ": "Mozambique",
152
+ "MM": "Myanmar (Burma)",
153
+ "NA": "Namibia",
154
+ "NR": "Nauru",
155
+ "NP": "Nepal",
156
+ "NL": "Netherlands",
157
+ "NC": "New Caledonia",
158
+ "NZ": "New Zealand",
159
+ "NI": "Nicaragua",
160
+ "NE": "Niger",
161
+ "NG": "Nigeria",
162
+ "NU": "Niue",
163
+ "NF": "Norfolk Island",
164
+ "KP": "North Korea",
165
+ "MK": "North Macedonia",
166
+ "MP": "Northern Mariana Islands",
167
+ "NO": "Norway",
168
+ "OM": "Oman",
169
+ "PK": "Pakistan",
170
+ "PW": "Palau",
171
+ "PS": "Palestinian Territories",
172
+ "PA": "Panama",
173
+ "PG": "Papua New Guinea",
174
+ "PY": "Paraguay",
175
+ "PE": "Peru",
176
+ "PH": "Philippines",
177
+ "PN": "Pitcairn Islands",
178
+ "PL": "Poland",
179
+ "PT": "Portugal",
180
+ "PR": "Puerto Rico",
181
+ "QA": "Qatar",
182
+ "RE": "R\u00e9union",
183
+ "RO": "Romania",
184
+ "RU": "Russia",
185
+ "RW": "Rwanda",
186
+ "WS": "Samoa",
187
+ "SM": "San Marino",
188
+ "ST": "S\u00e3o Tom\u00e9 & Pr\u00edncipe",
189
+ "SA": "Saudi Arabia",
190
+ "SN": "Senegal",
191
+ "RS": "Serbia",
192
+ "SC": "Seychelles",
193
+ "SL": "Sierra Leone",
194
+ "SG": "Singapore",
195
+ "SX": "Sint Maarten",
196
+ "SK": "Slovakia",
197
+ "SI": "Slovenia",
198
+ "SB": "Solomon Islands",
199
+ "SO": "Somalia",
200
+ "ZA": "South Africa",
201
+ "GS": "South Georgia & South Sandwich Islands",
202
+ "KR": "South Korea",
203
+ "SS": "South Sudan",
204
+ "ES": "Spain",
205
+ "LK": "Sri Lanka",
206
+ "BL": "St. Barth\u00e9lemy",
207
+ "SH": "St. Helena",
208
+ "KN": "St. Kitts & Nevis",
209
+ "LC": "St. Lucia",
210
+ "MF": "St. Martin",
211
+ "PM": "St. Pierre & Miquelon",
212
+ "VC": "St. Vincent & Grenadines",
213
+ "SD": "Sudan",
214
+ "SR": "Suriname",
215
+ "SJ": "Svalbard & Jan Mayen",
216
+ "SE": "Sweden",
217
+ "CH": "Switzerland",
218
+ "SY": "Syria",
219
+ "TW": "Taiwan",
220
+ "TJ": "Tajikistan",
221
+ "TZ": "Tanzania",
222
+ "TH": "Thailand",
223
+ "TL": "Timor-Leste",
224
+ "TG": "Togo",
225
+ "TK": "Tokelau",
226
+ "TO": "Tonga",
227
+ "TT": "Trinidad & Tobago",
228
+ "TN": "Tunisia",
229
+ "TR": "Turkey",
230
+ "TM": "Turkmenistan",
231
+ "TC": "Turks & Caicos Islands",
232
+ "TV": "Tuvalu",
233
+ "UM": "U.S. Outlying Islands",
234
+ "VI": "U.S. Virgin Islands",
235
+ "UG": "Uganda",
236
+ "UA": "Ukraine",
237
+ "AE": "United Arab Emirates",
238
+ "GB": "United Kingdom",
239
+ "US": "United States",
240
+ "UY": "Uruguay",
241
+ "UZ": "Uzbekistan",
242
+ "VU": "Vanuatu",
243
+ "VA": "Vatican City",
244
+ "VE": "Venezuela",
245
+ "VN": "Vietnam",
246
+ "WF": "Wallis & Futuna",
247
+ "EH": "Western Sahara",
248
+ "YE": "Yemen",
249
+ "ZM": "Zambia",
250
+ "ZW": "Zimbabwe"
251
+ }
@@ -1,2 +1,3 @@
1
+ export * from './Country';
1
2
  export * from './Currency';
2
3
  export * from './Locale';
@@ -42,4 +42,9 @@ export class RequestOptions extends Enum {
42
42
  bearer = (jwt: Text): this => {
43
43
  return isNotEmpty(jwt) ? this.authorization(`Bearer ${jwt}`) : this;
44
44
  };
45
+
46
+ basic = (username: Text, password: Text): this => {
47
+ const basicAuth = Buffer.from(`${username}:${password}`, 'utf8').toString('base64');
48
+ return this.authorization(`Basic ${basicAuth}`);
49
+ };
45
50
  }
package/src/types/Enum.ts CHANGED
@@ -24,14 +24,14 @@ export abstract class Enum implements Validatable {
24
24
  return (
25
25
  meta(this)
26
26
  .values<E>()
27
- .first((e: unknown) => isEnum(e) && e.id === id) ?? ofGet(alt)
27
+ .first((e: unknown) => isEnum(e) && e.equals(id)) ?? ofGet(alt)
28
28
  );
29
29
  }
30
30
 
31
31
  static byIds<T extends Enum>(ids?: Id[]): List<T> {
32
32
  return meta(this)
33
33
  .values<T>()
34
- .filter((e: unknown) => isEnum(e) && ids?.includes(e.id));
34
+ .filter((e: unknown) => isEnum(e) && ids?.some(i => e.equals(i)));
35
35
  }
36
36
 
37
37
  static filter<E extends Enum>(p: (value: E, index: number, array: E[]) => unknown, params?: unknown): List<E> {
package/src/types/Text.ts CHANGED
@@ -81,6 +81,8 @@ export class ToText implements Text {
81
81
 
82
82
  is = (...others: unknown[]): boolean => others.some(o => this.toString() === text(o).toString());
83
83
 
84
+ equals = this.is;
85
+
84
86
  get isEmpty(): boolean {
85
87
  return isEmpty(this.toString());
86
88
  }