@futdevpro/fsm-dynamo 1.8.5 → 1.9.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/.eslintrc.json +9 -6
- package/lib/_constants/error-defaults.const.d.ts +2 -2
- package/lib/_constants/error-defaults.const.d.ts.map +1 -1
- package/lib/_constants/error-defaults.const.js +2 -2
- package/lib/_constants/error-defaults.const.js.map +1 -1
- package/lib/_constants/module-settings/custom-data-module-settings.const.d.ts +6 -2
- package/lib/_constants/module-settings/custom-data-module-settings.const.d.ts.map +1 -1
- package/lib/_constants/module-settings/custom-data-module-settings.const.js +9 -4
- package/lib/_constants/module-settings/custom-data-module-settings.const.js.map +1 -1
- package/lib/_constants/module-settings/test-module-settings.const.d.ts +8 -2
- package/lib/_constants/module-settings/test-module-settings.const.d.ts.map +1 -1
- package/lib/_constants/module-settings/test-module-settings.const.js +13 -8
- package/lib/_constants/module-settings/test-module-settings.const.js.map +1 -1
- package/lib/_constants/module-settings/usage-module-settings.const.d.ts +8 -2
- package/lib/_constants/module-settings/usage-module-settings.const.d.ts.map +1 -1
- package/lib/_constants/module-settings/usage-module-settings.const.js +13 -6
- package/lib/_constants/module-settings/usage-module-settings.const.js.map +1 -1
- package/lib/_enums/basic-property-type.enum.d.ts +1 -1
- package/lib/_enums/basic-property-type.enum.d.ts.map +1 -1
- package/lib/_enums/basic-property-type.enum.js +9 -9
- package/lib/_enums/basic-property-type.enum.js.map +1 -1
- package/lib/_enums/data-model-type.enum.d.ts +1 -1
- package/lib/_enums/data-model-type.enum.d.ts.map +1 -1
- package/lib/_enums/data-model-type.enum.js +7 -7
- package/lib/_enums/data-model-type.enum.js.map +1 -1
- package/lib/_enums/day-of-week.enum.d.ts +4 -4
- package/lib/_enums/day-of-week.enum.d.ts.map +1 -1
- package/lib/_enums/day-of-week.enum.js +21 -21
- package/lib/_enums/day-of-week.enum.js.map +1 -1
- package/lib/_enums/error-level.enum.d.ts +1 -1
- package/lib/_enums/error-level.enum.d.ts.map +1 -1
- package/lib/_enums/error-level.enum.js +13 -13
- package/lib/_enums/error-level.enum.js.map +1 -1
- package/lib/_enums/log-style.enum.d.ts +1 -1
- package/lib/_enums/log-style.enum.d.ts.map +1 -1
- package/lib/_enums/log-style.enum.js +27 -27
- package/lib/_enums/log-style.enum.js.map +1 -1
- package/lib/_enums/month.enum.d.ts +1 -1
- package/lib/_enums/month.enum.d.ts.map +1 -1
- package/lib/_enums/month.enum.js +16 -16
- package/lib/_enums/month.enum.js.map +1 -1
- package/lib/_enums/region.enum.d.ts +1 -1
- package/lib/_enums/region.enum.d.ts.map +1 -1
- package/lib/_enums/region.enum.js +9 -9
- package/lib/_enums/region.enum.js.map +1 -1
- package/lib/_enums/relative-date.enum.d.ts +1 -1
- package/lib/_enums/relative-date.enum.d.ts.map +1 -1
- package/lib/_enums/relative-date.enum.js +10 -10
- package/lib/_enums/relative-date.enum.js.map +1 -1
- package/lib/_enums/sub-region.enum.d.ts +1 -1
- package/lib/_enums/sub-region.enum.d.ts.map +1 -1
- package/lib/_enums/sub-region.enum.js +21 -21
- package/lib/_enums/sub-region.enum.js.map +1 -1
- package/lib/_enums/subdivision-region-type.enum.d.ts +1 -1
- package/lib/_enums/subdivision-region-type.enum.d.ts.map +1 -1
- package/lib/_enums/subdivision-region-type.enum.js +42 -42
- package/lib/_enums/subdivision-region-type.enum.js.map +1 -1
- package/lib/_models/control-models/daily-usage-data.control-model.d.ts +5 -5
- package/lib/_models/control-models/daily-usage-data.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/daily-usage-data.control-model.js +3 -3
- package/lib/_models/control-models/daily-usage-data.control-model.js.map +1 -1
- package/lib/_models/control-models/data-model-params.control-model.d.ts +13 -13
- package/lib/_models/control-models/data-model-params.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/data-model-params.control-model.js +7 -7
- package/lib/_models/control-models/data-model-params.control-model.js.map +1 -1
- package/lib/_models/control-models/data-property-params.control-model.d.ts +9 -9
- package/lib/_models/control-models/data-property-params.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/data-property-params.control-model.js +10 -10
- package/lib/_models/control-models/data-property-params.control-model.js.map +1 -1
- package/lib/_models/control-models/error.control-model.d.ts +15 -15
- package/lib/_models/control-models/error.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/error.control-model.js +18 -18
- package/lib/_models/control-models/error.control-model.js.map +1 -1
- package/lib/_models/control-models/error.control-model.spec.js +34 -34
- package/lib/_models/control-models/error.control-model.spec.js.map +1 -1
- package/lib/_models/control-models/poll.control-model.d.ts +2 -2
- package/lib/_models/control-models/poll.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/poll.control-model.js +8 -8
- package/lib/_models/control-models/poll.control-model.js.map +1 -1
- package/lib/_models/control-models/range-value.control-model.d.ts +20 -20
- package/lib/_models/control-models/range-value.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/range-value.control-model.js +15 -15
- package/lib/_models/control-models/range-value.control-model.js.map +1 -1
- package/lib/_models/control-models/usage-action.control-model.d.ts +3 -3
- package/lib/_models/control-models/usage-action.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/usage-action.control-model.js +3 -3
- package/lib/_models/control-models/usage-action.control-model.js.map +1 -1
- package/lib/_models/control-models/usage-data.control-model.d.ts +6 -6
- package/lib/_models/control-models/usage-data.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/usage-data.control-model.js +3 -3
- package/lib/_models/control-models/usage-data.control-model.js.map +1 -1
- package/lib/_models/data-models/custom-data.data-model.d.ts +7 -7
- package/lib/_models/data-models/custom-data.data-model.d.ts.map +1 -1
- package/lib/_models/data-models/custom-data.data-model.js +4 -4
- package/lib/_models/data-models/custom-data.data-model.js.map +1 -1
- package/lib/_models/data-models/metadata.data-model.d.ts +5 -5
- package/lib/_models/data-models/metadata.data-model.d.ts.map +1 -1
- package/lib/_models/data-models/metadata.data-model.js +3 -3
- package/lib/_models/data-models/metadata.data-model.js.map +1 -1
- package/lib/_models/data-models/usage-session.data-model.d.ts +10 -10
- package/lib/_models/data-models/usage-session.data-model.d.ts.map +1 -1
- package/lib/_models/data-models/usage-session.data-model.js +4 -4
- package/lib/_models/data-models/usage-session.data-model.js.map +1 -1
- package/lib/_models/interfaces/error-defaults.interface.d.ts +1 -1
- package/lib/_models/interfaces/error-defaults.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/country-division.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/country-division.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/country-iso.interface.d.ts +7 -7
- package/lib/_models/interfaces/location/country-iso.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/country-phone-code.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/country-phone-code.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/division-collection.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/division-collection.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/division-region-data.interface.d.ts +4 -4
- package/lib/_models/interfaces/location/division-region-data.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/geo-ip-location.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/geo-ip-location.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/location-coordinates.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/location-coordinates.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/paged.interace.d.ts +1 -1
- package/lib/_models/interfaces/paged.interace.d.ts.map +1 -1
- package/lib/_models/interfaces/random-weight.interface.d.ts +1 -1
- package/lib/_models/interfaces/random-weight.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/route-settings.interface.d.ts +4 -4
- package/lib/_models/interfaces/route-settings.interface.d.ts.map +1 -1
- package/lib/_utils/array.util.d.ts +4 -4
- package/lib/_utils/array.util.d.ts.map +1 -1
- package/lib/_utils/array.util.js +3 -3
- package/lib/_utils/array.util.js.map +1 -1
- package/lib/_utils/array.util.spec.js +5 -5
- package/lib/_utils/array.util.spec.js.map +1 -1
- package/lib/_utils/box-bounds.util.d.ts +12 -12
- package/lib/_utils/box-bounds.util.d.ts.map +1 -1
- package/lib/_utils/box-bounds.util.js +7 -7
- package/lib/_utils/box-bounds.util.js.map +1 -1
- package/lib/_utils/index.d.ts +0 -1
- package/lib/_utils/index.d.ts.map +1 -1
- package/lib/_utils/index.js +0 -1
- package/lib/_utils/index.js.map +1 -1
- package/lib/_utils/location.util.d.ts +4 -4
- package/lib/_utils/location.util.d.ts.map +1 -1
- package/lib/_utils/location.util.js +9 -9
- package/lib/_utils/location.util.js.map +1 -1
- package/lib/_utils/log.util.d.ts +17 -17
- package/lib/_utils/log.util.d.ts.map +1 -1
- package/lib/_utils/log.util.js +25 -25
- package/lib/_utils/log.util.js.map +1 -1
- package/lib/_utils/math.util.d.ts +1 -1
- package/lib/_utils/math.util.d.ts.map +1 -1
- package/lib/_utils/math.util.js +3 -3
- package/lib/_utils/math.util.js.map +1 -1
- package/lib/_utils/random.util.d.ts +5 -5
- package/lib/_utils/random.util.d.ts.map +1 -1
- package/lib/_utils/random.util.js +3 -3
- package/lib/_utils/random.util.js.map +1 -1
- package/lib/_utils/regex/password-regex.util.d.ts +2 -2
- package/lib/_utils/regex/password-regex.util.d.ts.map +1 -1
- package/lib/_utils/regex/password-regex.util.js +7 -7
- package/lib/_utils/regex/password-regex.util.js.map +1 -1
- package/lib/_utils/regex/username-regex.util.d.ts +1 -1
- package/lib/_utils/regex/username-regex.util.d.ts.map +1 -1
- package/lib/_utils/regex/username-regex.util.js +3 -3
- package/lib/_utils/regex/username-regex.util.js.map +1 -1
- package/lib/_utils/regex.util.d.ts +1 -1
- package/lib/_utils/regex.util.d.ts.map +1 -1
- package/lib/_utils/regex.util.js +2 -2
- package/lib/_utils/regex.util.js.map +1 -1
- package/lib/_utils/regions.util.d.ts +12 -12
- package/lib/_utils/regions.util.d.ts.map +1 -1
- package/lib/_utils/regions.util.js +13 -13
- package/lib/_utils/regions.util.js.map +1 -1
- package/lib/_utils/round-list.util.d.ts +2 -2
- package/lib/_utils/round-list.util.d.ts.map +1 -1
- package/lib/_utils/round-list.util.js +3 -3
- package/lib/_utils/round-list.util.js.map +1 -1
- package/lib/_utils/shared.static-service.d.ts +2 -2
- package/lib/_utils/shared.static-service.d.ts.map +1 -1
- package/lib/_utils/shared.static-service.js +8 -8
- package/lib/_utils/shared.static-service.js.map +1 -1
- package/lib/_utils/time.util.d.ts +16 -16
- package/lib/_utils/time.util.d.ts.map +1 -1
- package/lib/_utils/time.util.js +29 -29
- package/lib/_utils/time.util.js.map +1 -1
- package/lib/_utils/trigonometry.util.d.ts +4 -4
- package/lib/_utils/trigonometry.util.d.ts.map +1 -1
- package/lib/_utils/trigonometry.util.js +3 -3
- package/lib/_utils/trigonometry.util.js.map +1 -1
- package/lib/_utils/type-cloning-facility.util.d.ts +4 -4
- package/lib/_utils/type-cloning-facility.util.d.ts.map +1 -1
- package/lib/_utils/type-cloning-facility.util.js +3 -3
- package/lib/_utils/type-cloning-facility.util.js.map +1 -1
- package/lib/_utils/utilities.util.d.ts +25 -25
- package/lib/_utils/utilities.util.d.ts.map +1 -1
- package/lib/_utils/utilities.util.js +34 -34
- package/lib/_utils/utilities.util.js.map +1 -1
- package/lib/_utils/vector2.util.d.ts +36 -36
- package/lib/_utils/vector2.util.d.ts.map +1 -1
- package/lib/_utils/vector2.util.js +37 -37
- package/lib/_utils/vector2.util.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +157 -160
- package/src/_constants/error-defaults.const.ts +2 -2
- package/src/_constants/module-settings/custom-data-module-settings.const.ts +9 -4
- package/src/_constants/module-settings/test-module-settings.const.ts +13 -8
- package/src/_constants/module-settings/usage-module-settings.const.ts +13 -6
- package/src/_enums/basic-property-type.enum.ts +1 -1
- package/src/_enums/data-model-type.enum.ts +1 -1
- package/src/_enums/day-of-week.enum.ts +11 -11
- package/src/_enums/error-level.enum.ts +1 -1
- package/src/_enums/log-style.enum.ts +1 -1
- package/src/_enums/month.enum.ts +1 -1
- package/src/_enums/region.enum.ts +1 -1
- package/src/_enums/relative-date.enum.ts +1 -1
- package/src/_enums/sub-region.enum.ts +1 -1
- package/src/_enums/subdivision-region-type.enum.ts +1 -1
- package/src/_models/control-models/daily-usage-data.control-model.ts +5 -5
- package/src/_models/control-models/data-model-params.control-model.ts +15 -15
- package/src/_models/control-models/data-property-params.control-model.ts +15 -15
- package/src/_models/control-models/error.control-model.spec.ts +69 -69
- package/src/_models/control-models/error.control-model.ts +80 -80
- package/src/_models/control-models/poll.control-model.ts +8 -8
- package/src/_models/control-models/range-value.control-model.ts +58 -58
- package/src/_models/control-models/usage-action.control-model.ts +3 -3
- package/src/_models/control-models/usage-data.control-model.ts +6 -6
- package/src/_models/data-models/custom-data.data-model.ts +13 -12
- package/src/_models/data-models/metadata.data-model.ts +5 -5
- package/src/_models/data-models/usage-session.data-model.ts +11 -11
- package/src/_models/interfaces/error-defaults.interface.ts +1 -1
- package/src/_models/interfaces/location/country-division.interface.ts +1 -1
- package/src/_models/interfaces/location/country-iso.interface.ts +7 -7
- package/src/_models/interfaces/location/country-phone-code.interface.ts +1 -1
- package/src/_models/interfaces/location/division-collection.interface.ts +1 -1
- package/src/_models/interfaces/location/division-region-data.interface.ts +4 -4
- package/src/_models/interfaces/location/geo-ip-location.interface.ts +1 -1
- package/src/_models/interfaces/location/location-coordinates.interface.ts +1 -1
- package/src/_models/interfaces/paged.interace.ts +1 -1
- package/src/_models/interfaces/random-weight.interface.ts +1 -1
- package/src/_models/interfaces/route-settings.interface.ts +4 -4
- package/src/_utils/array.util.spec.ts +7 -7
- package/src/_utils/array.util.ts +4 -4
- package/src/_utils/box-bounds.util.ts +19 -19
- package/src/_utils/index.ts +0 -1
- package/src/_utils/location.util.ts +13 -13
- package/src/_utils/log.util.ts +36 -36
- package/src/_utils/math.util.ts +1 -1
- package/src/_utils/random.util.ts +9 -5
- package/src/_utils/regex/password-regex.util.ts +5 -5
- package/src/_utils/regex/username-regex.util.ts +2 -2
- package/src/_utils/regex.util.ts +1 -1
- package/src/_utils/regions.util.ts +33 -33
- package/src/_utils/round-list.util.ts +2 -2
- package/src/_utils/shared.static-service.ts +8 -8
- package/src/_utils/time.util.ts +40 -40
- package/src/_utils/trigonometry.util.ts +4 -4
- package/src/_utils/type-cloning-facility.util.ts +4 -4
- package/src/_utils/utilities.util.ts +31 -27
- package/src/_utils/vector2.util.ts +67 -67
- package/lib/_utils/metadata.util.d.ts +0 -2
- package/lib/_utils/metadata.util.d.ts.map +0 -1
- package/lib/_utils/metadata.util.js +0 -32
- package/lib/_utils/metadata.util.js.map +0 -1
- package/src/_utils/metadata.util.ts +0 -31
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { DynamoFM_DataModel_Params } from '../control-models/data-model-params.control-model';
|
|
3
|
+
import { DynamoFM_Metadata } from './metadata.data-model';
|
|
4
4
|
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export class
|
|
5
|
+
export type DFM_CustomData = DynamoFM_CustomData;
|
|
6
|
+
export type DFM_CustomD = DynamoFM_CustomData;
|
|
7
|
+
export class DynamoFM_CustomData<T = any> extends DynamoFM_Metadata {
|
|
8
8
|
data?: T;
|
|
9
9
|
|
|
10
10
|
constructor(
|
|
11
|
-
set?:
|
|
11
|
+
set?: DynamoFM_CustomData<T>
|
|
12
12
|
) {
|
|
13
13
|
super(set);
|
|
14
14
|
|
|
@@ -18,10 +18,11 @@ export class Dynamo_CustomData<T = any> extends Dynamo_Metadata {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
export const DynamoFM_customDataModel_params: DynamoFM_DataModel_Params =
|
|
22
|
+
new DynamoFM_DataModel_Params({
|
|
23
|
+
dataName: 'customData',
|
|
24
|
+
properties: [
|
|
25
|
+
{ key: 'data', type: 'string', required: true },
|
|
26
|
+
]
|
|
27
|
+
});
|
|
27
28
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export class
|
|
2
|
+
export type DFM_Metadata = DynamoFM_Metadata;
|
|
3
|
+
export type DFM_MetaD = DynamoFM_Metadata;
|
|
4
|
+
export class DynamoFM_Metadata {
|
|
5
5
|
_id?: string;
|
|
6
6
|
|
|
7
7
|
__created?: Date;
|
|
@@ -11,7 +11,7 @@ export class Dynamo_Metadata {
|
|
|
11
11
|
__v?: number;
|
|
12
12
|
|
|
13
13
|
constructor(
|
|
14
|
-
set?:
|
|
14
|
+
set?: DynamoFM_Metadata,
|
|
15
15
|
init?: {
|
|
16
16
|
id?: string,
|
|
17
17
|
issuer: string,
|
|
@@ -57,7 +57,7 @@ export class Dynamo_Metadata {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
static updateMetadata?<T extends
|
|
60
|
+
static updateMetadata?<T extends DynamoFM_Metadata>(data: T, issuer: string, id?: string): T {
|
|
61
61
|
if (!data) {
|
|
62
62
|
return data;
|
|
63
63
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { DynamoFM_Metadata } from './metadata.data-model';
|
|
3
|
+
import { DynamoFM_UsageData } from '../control-models/usage-data.control-model';
|
|
4
|
+
import { DynamoFM_DataModel_Params } from '../control-models/data-model-params.control-model';
|
|
5
|
+
import { DynamoFM_GeoIpLocation } from '../interfaces/location/geo-ip-location.interface';
|
|
6
6
|
|
|
7
|
-
export type
|
|
8
|
-
export class
|
|
7
|
+
export type DFM_UsageSession = DynamoFM_UsageSession;
|
|
8
|
+
export class DynamoFM_UsageSession extends DynamoFM_Metadata {
|
|
9
9
|
date?: string;
|
|
10
10
|
sessionStart?: Date;
|
|
11
11
|
sessionEnd?: Date;
|
|
12
12
|
address?: string;
|
|
13
13
|
issuer?: string;
|
|
14
|
-
locationData?:
|
|
14
|
+
locationData?: DynamoFM_GeoIpLocation;
|
|
15
15
|
|
|
16
|
-
usageData?:
|
|
16
|
+
usageData?: DynamoFM_UsageData[] = [];
|
|
17
17
|
totalSessionTime?: number;
|
|
18
18
|
loggedInAs?: string;
|
|
19
19
|
|
|
20
20
|
constructor(
|
|
21
|
-
set?:
|
|
21
|
+
set?: DynamoFM_UsageSession
|
|
22
22
|
) {
|
|
23
23
|
super(set);
|
|
24
24
|
|
|
@@ -32,8 +32,8 @@ export class Dynamo_UsageSession extends Dynamo_Metadata {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export const
|
|
36
|
-
new
|
|
35
|
+
export const DynamoFM_usageSessionModel_params: DynamoFM_DataModel_Params =
|
|
36
|
+
new DynamoFM_DataModel_Params({
|
|
37
37
|
dataName: 'usageSession',
|
|
38
38
|
properties: [
|
|
39
39
|
{ key: 'date', type: 'string',
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { DynamoFM_Region } from '../../../_enums/region.enum';
|
|
4
|
+
import { DynamoFM_SubRegion } from '../../../_enums/sub-region.enum';
|
|
5
|
+
import { DynamoFM_CountryDivision } from './country-division.interface';
|
|
6
6
|
|
|
7
|
-
export interface
|
|
7
|
+
export interface DynamoFM_CountryISO {
|
|
8
8
|
name: string;
|
|
9
9
|
iso2: string;
|
|
10
10
|
iso3: string;
|
|
11
11
|
countryCode: string;
|
|
12
12
|
fullIso: string;
|
|
13
|
-
region:
|
|
13
|
+
region: DynamoFM_Region;
|
|
14
14
|
regionCode: string;
|
|
15
|
-
subRegion:
|
|
15
|
+
subRegion: DynamoFM_SubRegion;
|
|
16
16
|
subRegionCode: string;
|
|
17
17
|
subdivisionRegion: string;
|
|
18
18
|
subdivisionRegionCode: string;
|
|
19
19
|
phoneCode?: string;
|
|
20
|
-
divisions?:
|
|
20
|
+
divisions?: DynamoFM_CountryDivision[];
|
|
21
21
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DynamoFM_SubdivisionRegionType } from '../../../_enums/subdivision-region-type.enum';
|
|
2
|
+
import { DynamoFM_CountryISO } from './country-iso.interface';
|
|
3
3
|
|
|
4
|
-
export interface
|
|
5
|
-
type?:
|
|
4
|
+
export interface DynamoFM_SubdivisionRegionData extends DynamoFM_CountryISO {
|
|
5
|
+
type?: DynamoFM_SubdivisionRegionType;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export interface
|
|
2
|
+
export type DFM_RouteSettings<T> = DynamoFM_Route_Settings<T>;
|
|
3
|
+
export type DFM_RouteS<T> = DynamoFM_Route_Settings<T>;
|
|
4
|
+
export interface DynamoFM_Route_Settings<T> {
|
|
5
5
|
mainRoute: string;
|
|
6
6
|
|
|
7
7
|
endPoints: {
|
|
8
|
-
[
|
|
8
|
+
[key in T as string]: string
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { DynamoFM_Array } from './array.util';
|
|
4
|
+
import { DynamoFM_delay } from './utilities.util';
|
|
5
5
|
|
|
6
|
-
describe('
|
|
6
|
+
describe('DynamoFM_Array', (): void => {
|
|
7
7
|
|
|
8
8
|
describe('asyncForEach', (): void => {
|
|
9
9
|
it('should call the function for each element in the list', async (): Promise<void> => {
|
|
10
10
|
const list = [1, 2, 3];
|
|
11
11
|
const result = [];
|
|
12
12
|
const func = async (e, i): Promise<void> => {
|
|
13
|
-
await
|
|
13
|
+
await DynamoFM_delay(30);
|
|
14
14
|
result.push(e);
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
await
|
|
17
|
+
await DynamoFM_Array.asyncForEach(list, func);
|
|
18
18
|
|
|
19
19
|
expect(result).toEqual(list);
|
|
20
20
|
});
|
|
@@ -25,12 +25,12 @@ describe('Dynamo_Array', (): void => {
|
|
|
25
25
|
const list = [1, 2, 3];
|
|
26
26
|
|
|
27
27
|
const func = async (e, i): Promise<number> => {
|
|
28
|
-
await
|
|
28
|
+
await DynamoFM_delay(30);
|
|
29
29
|
|
|
30
30
|
return e * 2;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
const result = await
|
|
33
|
+
const result = await DynamoFM_Array.asyncMap(list, func);
|
|
34
34
|
|
|
35
35
|
expect(result).toEqual([2, 4, 6]);
|
|
36
36
|
});
|
package/src/_utils/array.util.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DynamoFM_Paged } from '../_models/interfaces/paged.interace';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
export type
|
|
5
|
-
export class
|
|
4
|
+
export type DFM_Array = DynamoFM_Array;
|
|
5
|
+
export class DynamoFM_Array {
|
|
6
6
|
|
|
7
7
|
static async asyncForEach<T>(
|
|
8
8
|
list: T[],
|
|
@@ -71,7 +71,7 @@ export class Dynamo_Array {
|
|
|
71
71
|
return array.slice(pageIndex * pageSize, (pageIndex + 1) * pageSize);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
static paged<T>(array: T[], pageIndex: number, pageSize: number):
|
|
74
|
+
static paged<T>(array: T[], pageIndex: number, pageSize: number): DynamoFM_Paged<T> {
|
|
75
75
|
return {
|
|
76
76
|
pageIndex,
|
|
77
77
|
pageSize,
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { DynamoFM_Vector2 } from './vector2.util';
|
|
4
4
|
|
|
5
|
-
export class
|
|
6
|
-
private _pos:
|
|
7
|
-
set pos(value:
|
|
5
|
+
export class DynamoFM_BoxBounds {
|
|
6
|
+
private _pos: DynamoFM_Vector2;
|
|
7
|
+
set pos(value: DynamoFM_Vector2) {
|
|
8
8
|
this._pos = value;
|
|
9
9
|
|
|
10
10
|
this.calcCenter();
|
|
11
11
|
}
|
|
12
|
-
get pos():
|
|
12
|
+
get pos(): DynamoFM_Vector2 {
|
|
13
13
|
return this._pos;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
private _size:
|
|
17
|
-
set size(value:
|
|
16
|
+
private _size: DynamoFM_Vector2;
|
|
17
|
+
set size(value: DynamoFM_Vector2) {
|
|
18
18
|
this._size = value;
|
|
19
19
|
|
|
20
20
|
this.calcCenter();
|
|
21
21
|
}
|
|
22
|
-
get size():
|
|
22
|
+
get size(): DynamoFM_Vector2 {
|
|
23
23
|
return this._size;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
private _center:
|
|
27
|
-
get center():
|
|
26
|
+
private _center: DynamoFM_Vector2;
|
|
27
|
+
get center(): DynamoFM_Vector2 {
|
|
28
28
|
return this._center;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
constructor(
|
|
32
|
-
position:
|
|
33
|
-
size:
|
|
32
|
+
position: DynamoFM_Vector2 = new DynamoFM_Vector2(),
|
|
33
|
+
size: DynamoFM_Vector2 = new DynamoFM_Vector2()
|
|
34
34
|
) {
|
|
35
35
|
this._pos = position;
|
|
36
36
|
this._size = size;
|
|
@@ -42,7 +42,7 @@ export class Dynamo_BoxBounds {
|
|
|
42
42
|
return true;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
newValues?(position:
|
|
45
|
+
newValues?(position: DynamoFM_Vector2, size: DynamoFM_Vector2): void {
|
|
46
46
|
if (position === undefined) {
|
|
47
47
|
throw new Error('new position is undefined!');
|
|
48
48
|
}
|
|
@@ -57,20 +57,20 @@ export class Dynamo_BoxBounds {
|
|
|
57
57
|
this.calcCenter();
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
static bounds(box:
|
|
60
|
+
static bounds(box: DynamoFM_BoxBounds, position: DynamoFM_Vector2): boolean {
|
|
61
61
|
return box.pos.x <= position.x && position.x <= box.pos.x + box.size.x &&
|
|
62
62
|
box.pos.y <= position.y && position.y <= box.pos.y + box.size.y;
|
|
63
63
|
}
|
|
64
|
-
bounds?(position:
|
|
65
|
-
return
|
|
64
|
+
bounds?(position: DynamoFM_Vector2): boolean {
|
|
65
|
+
return DynamoFM_BoxBounds.bounds(this, position);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
private calcCenter?(): void {
|
|
69
|
-
this._center =
|
|
69
|
+
this._center = DynamoFM_Vector2.plus(this.pos, DynamoFM_Vector2.divide(this.size, 2));
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
clone?():
|
|
73
|
-
return new
|
|
72
|
+
clone?(): DynamoFM_BoxBounds {
|
|
73
|
+
return new DynamoFM_BoxBounds(this.pos.clone(), this.size.clone());
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
package/src/_utils/index.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { DynamoFM_Error } from '../_models/control-models/error.control-model';
|
|
3
|
+
import { DynamoFM_Trigonometry } from './trigonometry.util';
|
|
4
|
+
import { DynamoFM_LocationCoordinates } from '../_models/interfaces/location/location-coordinates.interface';
|
|
5
5
|
|
|
6
|
-
export type
|
|
7
|
-
export class
|
|
6
|
+
export type DFM_Location = DynamoFM_Location;
|
|
7
|
+
export class DynamoFM_Location {
|
|
8
8
|
|
|
9
9
|
static getDistanceInKilometres(
|
|
10
|
-
from:
|
|
11
|
-
to:
|
|
10
|
+
from: DynamoFM_LocationCoordinates,
|
|
11
|
+
to: DynamoFM_LocationCoordinates
|
|
12
12
|
): number {
|
|
13
13
|
|
|
14
14
|
const R = 6371; // kilometres
|
|
15
|
-
const φ1 =
|
|
16
|
-
const φ2 =
|
|
17
|
-
const Δφ =
|
|
18
|
-
const Δλ =
|
|
15
|
+
const φ1 = DynamoFM_Trigonometry.angleToRadians(from.latitude);
|
|
16
|
+
const φ2 = DynamoFM_Trigonometry.angleToRadians(to.latitude);
|
|
17
|
+
const Δφ = DynamoFM_Trigonometry.angleToRadians(to.latitude - from.latitude);
|
|
18
|
+
const Δλ = DynamoFM_Trigonometry.angleToRadians(to.longitude - from.longitude);
|
|
19
19
|
|
|
20
20
|
const a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +
|
|
21
21
|
Math.cos(φ1) * Math.cos(φ2) *
|
|
@@ -34,9 +34,9 @@ export class Dynamo_Location {
|
|
|
34
34
|
return distanceInKm / 110.574;
|
|
35
35
|
} else {
|
|
36
36
|
if (latitude) {
|
|
37
|
-
return distanceInKm / (Math.cos(
|
|
37
|
+
return distanceInKm / (Math.cos(DynamoFM_Trigonometry.angleToRadians(latitude)) * 111.320);
|
|
38
38
|
} else {
|
|
39
|
-
throw new
|
|
39
|
+
throw new DynamoFM_Error({
|
|
40
40
|
status: 417,
|
|
41
41
|
errorCode: 'FSM-DSS-505',
|
|
42
42
|
addECToUserMsg: true,
|
package/src/_utils/log.util.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { DynamoFM_LogStyle } from '../_enums/log-style.enum';
|
|
3
3
|
|
|
4
|
-
/* export class D_Log implements
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
4
|
+
/* export class D_Log implements DynamoFM_Log {}; */
|
|
5
|
+
export type DynamoFM_L = DynamoFM_Log;
|
|
6
|
+
export type DFM_Log = DynamoFM_Log;
|
|
7
|
+
export type DFM_L = DynamoFM_Log;
|
|
8
8
|
|
|
9
|
-
export class
|
|
9
|
+
export class DynamoFM_Log {
|
|
10
10
|
|
|
11
|
-
static setStyle(styles:
|
|
11
|
+
static setStyle(styles: DynamoFM_LogStyle[]): void {
|
|
12
12
|
let styleSets = '';
|
|
13
13
|
|
|
14
|
-
styles.forEach((style:
|
|
14
|
+
styles.forEach((style: DynamoFM_LogStyle): void => {
|
|
15
15
|
styleSets += style;
|
|
16
16
|
});
|
|
17
17
|
console.log(styleSets);
|
|
18
18
|
}
|
|
19
19
|
static resetStyle(): void {
|
|
20
|
-
console.log(
|
|
20
|
+
console.log(DynamoFM_LogStyle.reset);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
static addStyle(input: string, styles:
|
|
23
|
+
static addStyle(input: string, styles: DynamoFM_LogStyle[], dontReset?: boolean): string {
|
|
24
24
|
let result = '';
|
|
25
25
|
|
|
26
|
-
styles.forEach((style:
|
|
26
|
+
styles.forEach((style: DynamoFM_LogStyle): void => {
|
|
27
27
|
result += style;
|
|
28
28
|
});
|
|
29
29
|
result += input;
|
|
30
30
|
|
|
31
31
|
if (!dontReset) {
|
|
32
|
-
result +=
|
|
32
|
+
result += DynamoFM_LogStyle.reset;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
return result;
|
|
@@ -38,17 +38,17 @@ export class Dynamo_Log {
|
|
|
38
38
|
static success(message: string, ...optionalParams: any[]): void {
|
|
39
39
|
if (0 < optionalParams.length) {
|
|
40
40
|
console.log(
|
|
41
|
-
`${
|
|
42
|
-
...optionalParams,
|
|
41
|
+
`${DynamoFM_LogStyle.green}${DynamoFM_LogStyle.bright}${message}`,
|
|
42
|
+
...optionalParams, DynamoFM_LogStyle.reset
|
|
43
43
|
);
|
|
44
44
|
} else {
|
|
45
45
|
console.log(
|
|
46
|
-
`${
|
|
46
|
+
`${DynamoFM_LogStyle.green}${DynamoFM_LogStyle.bright}${message}${DynamoFM_LogStyle.reset}`
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* @deprecated use
|
|
51
|
+
* @deprecated use DynamoFM_Log.success instead
|
|
52
52
|
*/
|
|
53
53
|
static logSuccess(message: string, ...optionalParams: any[]): void {
|
|
54
54
|
this.success(message, ...optionalParams);
|
|
@@ -57,17 +57,17 @@ export class Dynamo_Log {
|
|
|
57
57
|
static error(message: string, ...optionalParams: any[]): void {
|
|
58
58
|
if (0 < optionalParams.length) {
|
|
59
59
|
console.error(
|
|
60
|
-
`${
|
|
61
|
-
...optionalParams,
|
|
60
|
+
`${DynamoFM_LogStyle.red}${DynamoFM_LogStyle.bright}${message}`,
|
|
61
|
+
...optionalParams, DynamoFM_LogStyle.reset
|
|
62
62
|
);
|
|
63
63
|
} else {
|
|
64
64
|
console.error(
|
|
65
|
-
`${
|
|
65
|
+
`${DynamoFM_LogStyle.red}${DynamoFM_LogStyle.bright}${message}${DynamoFM_LogStyle.reset}`
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
* @deprecated use
|
|
70
|
+
* @deprecated use DynamoFM_Log.error instead
|
|
71
71
|
*/
|
|
72
72
|
static logError(message: string, ...optionalParams: any[]): void {
|
|
73
73
|
this.error(message, ...optionalParams);
|
|
@@ -76,23 +76,23 @@ export class Dynamo_Log {
|
|
|
76
76
|
static warn(message: string, ...optionalParams: any[]): void {
|
|
77
77
|
if (0 < optionalParams.length) {
|
|
78
78
|
console.warn(
|
|
79
|
-
`${
|
|
80
|
-
...optionalParams,
|
|
79
|
+
`${DynamoFM_LogStyle.yellow}${DynamoFM_LogStyle.bright}${message}`,
|
|
80
|
+
...optionalParams, DynamoFM_LogStyle.reset
|
|
81
81
|
);
|
|
82
82
|
} else {
|
|
83
83
|
console.warn(
|
|
84
|
-
`${
|
|
84
|
+
`${DynamoFM_LogStyle.yellow}${DynamoFM_LogStyle.bright}${message}${DynamoFM_LogStyle.reset}`
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
|
-
* @deprecated use
|
|
89
|
+
* @deprecated use DynamoFM_Log.warn instead
|
|
90
90
|
*/
|
|
91
91
|
static warning(message: string, ...optionalParams: any[]): void {
|
|
92
92
|
this.warn(message, ...optionalParams);
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
|
-
* @deprecated use
|
|
95
|
+
* @deprecated use DynamoFM_Log.warn instead
|
|
96
96
|
*/
|
|
97
97
|
static logWarning(message: string, ...optionalParams: any[]): void {
|
|
98
98
|
this.warn(message, ...optionalParams);
|
|
@@ -109,12 +109,12 @@ export class Dynamo_Log {
|
|
|
109
109
|
static highlighted(message: string, ...optionalParams: any[]): void {
|
|
110
110
|
if (0 < optionalParams.length) {
|
|
111
111
|
console.log(
|
|
112
|
-
`${
|
|
113
|
-
...optionalParams,
|
|
112
|
+
`${DynamoFM_LogStyle.white}${DynamoFM_LogStyle.bright}${message}`,
|
|
113
|
+
...optionalParams, DynamoFM_LogStyle.reset
|
|
114
114
|
);
|
|
115
115
|
} else {
|
|
116
116
|
console.log(
|
|
117
|
-
`${
|
|
117
|
+
`${DynamoFM_LogStyle.white}${DynamoFM_LogStyle.bright}${message}${DynamoFM_LogStyle.reset}`
|
|
118
118
|
);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -123,7 +123,7 @@ export class Dynamo_Log {
|
|
|
123
123
|
this.log(message, ...optionalParams);
|
|
124
124
|
this.log('\n' + this.h_solid + '\n\n');
|
|
125
125
|
}
|
|
126
|
-
static test =
|
|
126
|
+
static test = DynamoFM_Log.testLog;
|
|
127
127
|
|
|
128
128
|
static highlightedLog(message: string, ...optionalParams: any[]): void {
|
|
129
129
|
this.log('\n\n' + this.h_before);
|
|
@@ -134,7 +134,7 @@ export class Dynamo_Log {
|
|
|
134
134
|
this.log(' ' + this.h_after);
|
|
135
135
|
this.log(this.h_after + '\n\n');
|
|
136
136
|
}
|
|
137
|
-
static H_log =
|
|
137
|
+
static H_log = DynamoFM_Log.highlightedLog;
|
|
138
138
|
|
|
139
139
|
static testInfo(message: string, ...optionalParams: any[]): void {
|
|
140
140
|
this.info('\n\n' + this.h_solid + '\n');
|
|
@@ -151,7 +151,7 @@ export class Dynamo_Log {
|
|
|
151
151
|
this.info(' ' + this.h_after);
|
|
152
152
|
this.info(this.h_after + '\n\n');
|
|
153
153
|
}
|
|
154
|
-
static H_info =
|
|
154
|
+
static H_info = DynamoFM_Log.highlightedInfo;
|
|
155
155
|
|
|
156
156
|
static testError(message: string, ...optionalParams: any[]): void {
|
|
157
157
|
this.error('\n\n' + this.h_solid + '\n');
|
|
@@ -168,7 +168,7 @@ export class Dynamo_Log {
|
|
|
168
168
|
this.error(' ' + this.h_after);
|
|
169
169
|
this.error(this.h_after + '\n\n');
|
|
170
170
|
}
|
|
171
|
-
static H_error =
|
|
171
|
+
static H_error = DynamoFM_Log.highlightedError;
|
|
172
172
|
|
|
173
173
|
static testWarn(message: string, ...optionalParams: any[]): void {
|
|
174
174
|
this.warn('\n\n' + this.h_solid + '\n');
|
|
@@ -185,7 +185,7 @@ export class Dynamo_Log {
|
|
|
185
185
|
this.warn(' ' + this.h_after);
|
|
186
186
|
this.warn(this.h_after + '\n\n');
|
|
187
187
|
}
|
|
188
|
-
static H_warn =
|
|
188
|
+
static H_warn = DynamoFM_Log.highlightedWarn;
|
|
189
189
|
|
|
190
190
|
static testSuccess(message: string, ...optionalParams: any[]): void {
|
|
191
191
|
this.success('\n\n' + this.h_solid + '\n');
|
|
@@ -202,7 +202,7 @@ export class Dynamo_Log {
|
|
|
202
202
|
this.success(' ' + this.h_after);
|
|
203
203
|
this.success(this.h_after + '\n\n');
|
|
204
204
|
}
|
|
205
|
-
static H_success =
|
|
205
|
+
static H_success = DynamoFM_Log.highlightedSuccess;
|
|
206
206
|
|
|
207
207
|
// eslint-disable-next-line max-len
|
|
208
208
|
private static h_solid: string = '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||';
|
|
@@ -212,8 +212,8 @@ export class Dynamo_Log {
|
|
|
212
212
|
private static h_after: string = '/////////////////////////////////////////////////////////////////////////////';
|
|
213
213
|
|
|
214
214
|
static removeLogStyles(message: string): string {
|
|
215
|
-
for (const styleKey of Object(
|
|
216
|
-
message = message.replace(new RegExp(
|
|
215
|
+
for (const styleKey of Object(DynamoFM_LogStyle)) {
|
|
216
|
+
message = message.replace(new RegExp(DynamoFM_LogStyle[styleKey], 'g'), '');
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
return message;
|