@futdevpro/fsm-dynamo 1.5.42 → 1.5.43
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/package.json +1 -1
- package/src/_collections/_tools/dynamo-regions.ts +4 -5
- package/src/_models/control-models/country-iso.ts +16 -0
- package/src/_models/control-models/subdivision-collection.ts +10 -0
- package/src/_models/control-models/subdivision-region-data.ts +49 -0
- package/src/_models/index.ts +8 -3
- package/src/_collections/_constants/country-iso.ts +0 -75
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futdevpro/fsm-dynamo",
|
|
3
|
-
"version": "01.05.
|
|
3
|
+
"version": "01.05.43",
|
|
4
4
|
"description": "Dynamic NodeTS (NodeJS-Typescript), MongoDB Backend System Framework by Future Development Ltd.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -4,9 +4,10 @@ import * as PhoneCodes from '../_constants/country-phone-codes.json';
|
|
|
4
4
|
import * as Subdivisions from '../_constants/country-sub-divisions-ISO-3166.json';
|
|
5
5
|
import { Region } from '../../_enums/region.enum';
|
|
6
6
|
import { Dynamo_Error } from '../../_models';
|
|
7
|
-
import { CountryISO, SubdivisionCollection } from '../_constants/country-iso';
|
|
8
7
|
import { CountryPhoneCode } from '../../_models/control-models/country-phone-code';
|
|
9
8
|
import { JSONListify } from './utilities';
|
|
9
|
+
import { CountryISO } from '../../_models/control-models/country-iso';
|
|
10
|
+
import { SubdivisionCollection } from '../../_models/control-models/subdivision-collection';
|
|
10
11
|
|
|
11
12
|
export class Dynamo_Regions {
|
|
12
13
|
|
|
@@ -17,12 +18,10 @@ export class Dynamo_Regions {
|
|
|
17
18
|
private static getAllCountryISO(): CountryISO[] {
|
|
18
19
|
return JSONListify(ISOs);
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
static getAllPhoneCodes(): CountryPhoneCode[] {
|
|
21
|
+
private static getAllPhoneCodes(): CountryPhoneCode[] {
|
|
22
22
|
return JSONListify(PhoneCodes);
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
static getSubdivisionCollection(): SubdivisionCollection {
|
|
24
|
+
private static getSubdivisionCollection(): SubdivisionCollection {
|
|
26
25
|
return Subdivisions as SubdivisionCollection;
|
|
27
26
|
}
|
|
28
27
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Region } from '../../_enums/region.enum';
|
|
2
|
+
import { SubRegion } from '../../_enums/sub-region.enum';
|
|
3
|
+
|
|
4
|
+
export interface CountryISO {
|
|
5
|
+
name: string;
|
|
6
|
+
iso2: string;
|
|
7
|
+
iso3: string;
|
|
8
|
+
countryCode: string;
|
|
9
|
+
fullIso: string;
|
|
10
|
+
region: Region;
|
|
11
|
+
regionCode: string;
|
|
12
|
+
subRegion: SubRegion;
|
|
13
|
+
subRegionCode: string;
|
|
14
|
+
subdivisionRegion: string;
|
|
15
|
+
subdivisionRegionCode: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { CountryISO } from './country-iso';
|
|
2
|
+
|
|
3
|
+
export interface SubdivisionRegionData extends CountryISO {
|
|
4
|
+
type?: SubdivisionRegionType;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export enum SubdivisionRegionType {
|
|
9
|
+
parish,
|
|
10
|
+
emirate,
|
|
11
|
+
province,
|
|
12
|
+
dependency,
|
|
13
|
+
county,
|
|
14
|
+
city,
|
|
15
|
+
region,
|
|
16
|
+
state,
|
|
17
|
+
territory,
|
|
18
|
+
autonomousRepublic,
|
|
19
|
+
municipate,
|
|
20
|
+
rayon,
|
|
21
|
+
division,
|
|
22
|
+
district,
|
|
23
|
+
governorate,
|
|
24
|
+
department,
|
|
25
|
+
specialMunicipality,
|
|
26
|
+
federalDistrict,
|
|
27
|
+
island,
|
|
28
|
+
town,
|
|
29
|
+
oblast,
|
|
30
|
+
commune,
|
|
31
|
+
prefecture,
|
|
32
|
+
economicPrefecture,
|
|
33
|
+
canton,
|
|
34
|
+
autonomousRegion,
|
|
35
|
+
specialAdministrativeRegion,
|
|
36
|
+
capitalDistrict,
|
|
37
|
+
geographicalRegion,
|
|
38
|
+
capitalCity,
|
|
39
|
+
ruralMunicipality,
|
|
40
|
+
urbanMunicipality,
|
|
41
|
+
autonomousCommunity,
|
|
42
|
+
autonomousCity,
|
|
43
|
+
administration,
|
|
44
|
+
regionalState,
|
|
45
|
+
metropolitanRegion,
|
|
46
|
+
overseasCollectivity,
|
|
47
|
+
// ... reduce specials // non-finished
|
|
48
|
+
}
|
|
49
|
+
|
package/src/_models/index.ts
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
// MODELS
|
|
3
3
|
// Control models
|
|
4
|
+
export * from './control-models/country-iso';
|
|
5
|
+
export * from './control-models/country-phone-code';
|
|
4
6
|
export * from './control-models/dynamo-daily-usage-data';
|
|
7
|
+
export * from './control-models/dynamo-error';
|
|
5
8
|
export * from './control-models/dynamo-nts-data-params';
|
|
6
9
|
export * from './control-models/dynamo-nts-data-property-params';
|
|
7
|
-
export * from './control-models/dynamo-
|
|
10
|
+
export * from './control-models/dynamo-nts-module-settings';
|
|
11
|
+
export * from './control-models/dynamo-poll';
|
|
8
12
|
export * from './control-models/dynamo-usage-action';
|
|
9
13
|
export * from './control-models/dynamo-usage-data';
|
|
10
|
-
export * from './control-models/dynamo-poll';
|
|
11
14
|
export * from './control-models/geo-ip-location';
|
|
12
15
|
export * from './control-models/location-coordinates';
|
|
13
|
-
export * from './control-models/
|
|
16
|
+
export * from './control-models/random-weight';
|
|
17
|
+
export * from './control-models/subdivision-collection';
|
|
18
|
+
export * from './control-models/subdivision-region-data';
|
|
14
19
|
// Data models
|
|
15
20
|
export * from './data-models/dynamo-custom-data';
|
|
16
21
|
export * from './data-models/dynamo-metadata';
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/* import ISOs from './county-codes-ISO-3166.json'; */
|
|
3
|
-
import { Region } from '../../_enums/region.enum';
|
|
4
|
-
import { SubRegion } from '../../_enums/sub-region.enum';
|
|
5
|
-
|
|
6
|
-
export interface CountryISO {
|
|
7
|
-
name: string;
|
|
8
|
-
iso2: string;
|
|
9
|
-
iso3: string;
|
|
10
|
-
countryCode: string;
|
|
11
|
-
fullIso: string;
|
|
12
|
-
region: Region;
|
|
13
|
-
regionCode: string;
|
|
14
|
-
subRegion: SubRegion;
|
|
15
|
-
subRegionCode: string;
|
|
16
|
-
subdivisionRegion: string;
|
|
17
|
-
subdivisionRegionCode: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface SubdivisionRegionData extends CountryISO {
|
|
21
|
-
type?: SubdivisionRegionType;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface SubdivisionCollection {
|
|
25
|
-
[iso2: string]: {
|
|
26
|
-
name: string;
|
|
27
|
-
divisions: {
|
|
28
|
-
[subDivisionCode: string]: string
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// https://en.wikipedia.org/wiki/ISO_3166-2
|
|
34
|
-
|
|
35
|
-
export enum SubdivisionRegionType {
|
|
36
|
-
parish,
|
|
37
|
-
emirate,
|
|
38
|
-
province,
|
|
39
|
-
dependency,
|
|
40
|
-
county,
|
|
41
|
-
city,
|
|
42
|
-
region,
|
|
43
|
-
state,
|
|
44
|
-
territory,
|
|
45
|
-
autonomousRepublic,
|
|
46
|
-
municipate,
|
|
47
|
-
rayon,
|
|
48
|
-
division,
|
|
49
|
-
district,
|
|
50
|
-
governorate,
|
|
51
|
-
department,
|
|
52
|
-
specialMunicipality,
|
|
53
|
-
federalDistrict,
|
|
54
|
-
island,
|
|
55
|
-
town,
|
|
56
|
-
oblast,
|
|
57
|
-
commune,
|
|
58
|
-
prefecture,
|
|
59
|
-
economicPrefecture,
|
|
60
|
-
canton,
|
|
61
|
-
autonomousRegion,
|
|
62
|
-
specialAdministrativeRegion,
|
|
63
|
-
capitalDistrict,
|
|
64
|
-
geographicalRegion,
|
|
65
|
-
capitalCity,
|
|
66
|
-
ruralMunicipality,
|
|
67
|
-
urbanMunicipality,
|
|
68
|
-
autonomousCommunity,
|
|
69
|
-
autonomousCity,
|
|
70
|
-
administration,
|
|
71
|
-
regionalState,
|
|
72
|
-
metropolitanRegion,
|
|
73
|
-
overseasCollectivity,
|
|
74
|
-
// ... reduce specials
|
|
75
|
-
}
|