@hosterai/types 0.0.23 → 0.0.24

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,6 @@
1
+ import { CountryDto } from '../dtos/country.dto';
2
+ import { CountryEnum } from '../enums/country.enum';
3
+ export declare function getCountryData(code: CountryEnum): CountryDto;
4
+ export declare function getAllCountriesData(): CountryDto[];
5
+ export declare function getEuropeanCountriesData(): Record<CountryEnum, CountryDto>;
6
+ export declare function getEurozoneCountriesData(): Record<CountryEnum, CountryDto>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCountryData = getCountryData;
4
+ exports.getAllCountriesData = getAllCountriesData;
5
+ exports.getEuropeanCountriesData = getEuropeanCountriesData;
6
+ exports.getEurozoneCountriesData = getEurozoneCountriesData;
7
+ const country_enum_1 = require("../enums/country.enum");
8
+ function getCountryData(code) {
9
+ return country_enum_1.COUNTRY_DATA[code];
10
+ }
11
+ function getAllCountriesData() {
12
+ return Object.values(country_enum_1.COUNTRY_DATA)
13
+ .slice()
14
+ .sort((a, b) => a.name.localeCompare(b.name));
15
+ }
16
+ function getEuropeanCountriesData() {
17
+ return Object.fromEntries(Object.entries(country_enum_1.COUNTRY_DATA).filter(([, country]) => country.isEurope));
18
+ }
19
+ function getEurozoneCountriesData() {
20
+ return Object.fromEntries(Object.entries(country_enum_1.COUNTRY_DATA).filter(([code]) => country_enum_1.EUROZONE_COUNTRIES.has(code)));
21
+ }
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export * from './dtos/attachment.dto';
4
4
  export * from './dtos/base-response.dto';
5
5
  export * from './dtos/client-data.dto';
6
6
  export * from './dtos/company-data.dto';
7
+ export * from './dtos/country.dto';
7
8
  export * from './dtos/error-response.dto';
8
9
  export * from './dtos/field.dto';
9
10
  export * from './dtos/field-option.dto';
@@ -63,6 +64,7 @@ export * from './enums/open-method.enum';
63
64
  export * from './enums/response-status.enum';
64
65
  export * from './enums/roles.enum';
65
66
  export * from './enums/setup-status.enum';
67
+ export * from './helpers/country.helper';
66
68
  export * from './validators/action-validator';
67
69
  export * from './validators/admin-panel-more-actions.validator';
68
70
  export * from './validators/admin-panel-tabs.validator';
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ __exportStar(require("./dtos/attachment.dto"), exports);
22
22
  __exportStar(require("./dtos/base-response.dto"), exports);
23
23
  __exportStar(require("./dtos/client-data.dto"), exports);
24
24
  __exportStar(require("./dtos/company-data.dto"), exports);
25
+ __exportStar(require("./dtos/country.dto"), exports);
25
26
  __exportStar(require("./dtos/error-response.dto"), exports);
26
27
  __exportStar(require("./dtos/field.dto"), exports);
27
28
  __exportStar(require("./dtos/field-option.dto"), exports);
@@ -88,6 +89,8 @@ __exportStar(require("./enums/open-method.enum"), exports);
88
89
  __exportStar(require("./enums/response-status.enum"), exports);
89
90
  __exportStar(require("./enums/roles.enum"), exports);
90
91
  __exportStar(require("./enums/setup-status.enum"), exports);
92
+ // Helpers
93
+ __exportStar(require("./helpers/country.helper"), exports);
91
94
  // Validators
92
95
  __exportStar(require("./validators/action-validator"), exports);
93
96
  __exportStar(require("./validators/admin-panel-more-actions.validator"), exports);
@@ -1,4 +1,21 @@
1
1
  export declare const ComponentsSchemas: {
2
+ readonly CountryDto: {
3
+ readonly properties: {
4
+ readonly name: {
5
+ readonly minLength: 1;
6
+ readonly type: "string";
7
+ };
8
+ readonly code: {
9
+ readonly enum: readonly ["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "KH", "CM", "CA", "CV", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SZ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT"];
10
+ readonly type: "string";
11
+ };
12
+ readonly isEurope: {
13
+ readonly type: "boolean";
14
+ };
15
+ };
16
+ readonly type: "object";
17
+ readonly required: readonly ["name", "code"];
18
+ };
2
19
  readonly TabDto: {
3
20
  readonly properties: {
4
21
  readonly label: {
@@ -2,6 +2,276 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ComponentsSchemas = void 0;
4
4
  exports.ComponentsSchemas = {
5
+ "CountryDto": {
6
+ "properties": {
7
+ "name": {
8
+ "minLength": 1,
9
+ "type": "string"
10
+ },
11
+ "code": {
12
+ "enum": [
13
+ "AF",
14
+ "AX",
15
+ "AL",
16
+ "DZ",
17
+ "AS",
18
+ "AD",
19
+ "AO",
20
+ "AI",
21
+ "AQ",
22
+ "AG",
23
+ "AR",
24
+ "AM",
25
+ "AW",
26
+ "AU",
27
+ "AT",
28
+ "AZ",
29
+ "BS",
30
+ "BH",
31
+ "BD",
32
+ "BB",
33
+ "BY",
34
+ "BE",
35
+ "BZ",
36
+ "BJ",
37
+ "BM",
38
+ "BT",
39
+ "BO",
40
+ "BQ",
41
+ "BA",
42
+ "BW",
43
+ "BV",
44
+ "BR",
45
+ "IO",
46
+ "BN",
47
+ "BG",
48
+ "BF",
49
+ "BI",
50
+ "KH",
51
+ "CM",
52
+ "CA",
53
+ "CV",
54
+ "KY",
55
+ "CF",
56
+ "TD",
57
+ "CL",
58
+ "CN",
59
+ "CX",
60
+ "CC",
61
+ "CO",
62
+ "KM",
63
+ "CG",
64
+ "CD",
65
+ "CK",
66
+ "CR",
67
+ "CI",
68
+ "HR",
69
+ "CU",
70
+ "CW",
71
+ "CY",
72
+ "CZ",
73
+ "DK",
74
+ "DJ",
75
+ "DM",
76
+ "DO",
77
+ "EC",
78
+ "EG",
79
+ "SV",
80
+ "GQ",
81
+ "ER",
82
+ "EE",
83
+ "ET",
84
+ "FK",
85
+ "FO",
86
+ "FJ",
87
+ "FI",
88
+ "FR",
89
+ "GF",
90
+ "PF",
91
+ "TF",
92
+ "GA",
93
+ "GM",
94
+ "GE",
95
+ "DE",
96
+ "GH",
97
+ "GI",
98
+ "GR",
99
+ "GL",
100
+ "GD",
101
+ "GP",
102
+ "GU",
103
+ "GT",
104
+ "GG",
105
+ "GN",
106
+ "GW",
107
+ "GY",
108
+ "HT",
109
+ "HM",
110
+ "VA",
111
+ "HN",
112
+ "HK",
113
+ "HU",
114
+ "IS",
115
+ "IN",
116
+ "ID",
117
+ "IR",
118
+ "IQ",
119
+ "IE",
120
+ "IM",
121
+ "IL",
122
+ "IT",
123
+ "JM",
124
+ "JP",
125
+ "JE",
126
+ "JO",
127
+ "KZ",
128
+ "KE",
129
+ "KI",
130
+ "KP",
131
+ "KR",
132
+ "KW",
133
+ "KG",
134
+ "LA",
135
+ "LV",
136
+ "LB",
137
+ "LS",
138
+ "LR",
139
+ "LY",
140
+ "LI",
141
+ "LT",
142
+ "LU",
143
+ "MO",
144
+ "MK",
145
+ "MG",
146
+ "MW",
147
+ "MY",
148
+ "MV",
149
+ "ML",
150
+ "MT",
151
+ "MH",
152
+ "MQ",
153
+ "MR",
154
+ "MU",
155
+ "TN",
156
+ "TR",
157
+ "TM",
158
+ "TC",
159
+ "TV",
160
+ "UG",
161
+ "UA",
162
+ "AE",
163
+ "GB",
164
+ "US",
165
+ "UM",
166
+ "UY",
167
+ "UZ",
168
+ "VU",
169
+ "VE",
170
+ "VN",
171
+ "VG",
172
+ "VI",
173
+ "WF",
174
+ "EH",
175
+ "YE",
176
+ "ZM",
177
+ "ZW",
178
+ "YT",
179
+ "MX",
180
+ "FM",
181
+ "MD",
182
+ "MC",
183
+ "MN",
184
+ "ME",
185
+ "MS",
186
+ "MA",
187
+ "MZ",
188
+ "MM",
189
+ "NA",
190
+ "NR",
191
+ "NP",
192
+ "NL",
193
+ "NC",
194
+ "NZ",
195
+ "NI",
196
+ "NE",
197
+ "NG",
198
+ "NU",
199
+ "NF",
200
+ "MP",
201
+ "NO",
202
+ "OM",
203
+ "PK",
204
+ "PW",
205
+ "PS",
206
+ "PA",
207
+ "PG",
208
+ "PY",
209
+ "PE",
210
+ "PH",
211
+ "PN",
212
+ "PL",
213
+ "PT",
214
+ "PR",
215
+ "QA",
216
+ "RE",
217
+ "RO",
218
+ "RU",
219
+ "RW",
220
+ "BL",
221
+ "SH",
222
+ "KN",
223
+ "LC",
224
+ "MF",
225
+ "PM",
226
+ "VC",
227
+ "WS",
228
+ "SM",
229
+ "ST",
230
+ "SA",
231
+ "SN",
232
+ "RS",
233
+ "SC",
234
+ "SL",
235
+ "SG",
236
+ "SX",
237
+ "SK",
238
+ "SI",
239
+ "SB",
240
+ "SO",
241
+ "ZA",
242
+ "GS",
243
+ "SS",
244
+ "ES",
245
+ "LK",
246
+ "SD",
247
+ "SR",
248
+ "SJ",
249
+ "SZ",
250
+ "SE",
251
+ "CH",
252
+ "SY",
253
+ "TW",
254
+ "TJ",
255
+ "TZ",
256
+ "TH",
257
+ "TL",
258
+ "TG",
259
+ "TK",
260
+ "TO",
261
+ "TT"
262
+ ],
263
+ "type": "string"
264
+ },
265
+ "isEurope": {
266
+ "type": "boolean"
267
+ }
268
+ },
269
+ "type": "object",
270
+ "required": [
271
+ "name",
272
+ "code"
273
+ ]
274
+ },
5
275
  "TabDto": {
6
276
  "properties": {
7
277
  "label": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hosterai/types",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {