@apigames/sdk-core 22.1.2 → 22.1.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.
- package/README.md +2 -2
- package/lib/classes/resource.object.d.ts +2 -2
- package/lib/helpers/index.d.ts +3 -0
- package/lib/helpers/index.js +21 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/interfaces/resource.object.d.ts +2 -0
- package/lib/interfaces/resource.object.js +3 -10
- package/package.json +9 -9
- package/fixEOL.sh +0 -8
- package/publishCodeCoverage.sh +0 -7
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# API Games SDK Core Package
|
|
2
2
|
|
|
3
3
|

|
|
4
|
-
[](https://www.codacy.com/gh/apigames-core/sdk-core/dashboard?utm_source=github.com&utm_medium=referral&utm_content=apigames-core/sdk-core&utm_campaign=Badge_Grade)
|
|
5
|
+
[](https://www.codacy.com/gh/apigames-core/sdk-core/dashboard?utm_source=github.com&utm_medium=referral&utm_content=apigames-core/sdk-core&utm_campaign=Badge_Coverage)
|
|
6
6
|

|
|
7
7
|

|
|
8
8
|
|
|
@@ -12,8 +12,8 @@ export default class ResourceObject implements IResourceObject {
|
|
|
12
12
|
protected EndpointContentType(): string;
|
|
13
13
|
protected LoadAttributes(value: any): void;
|
|
14
14
|
protected LoadRelationships(value: any): void;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
UpdateAttributes(value: any): void;
|
|
16
|
+
UpdateRelationships(value: any): void;
|
|
17
17
|
LoadData(value: any): IResourceObject;
|
|
18
18
|
protected GetInsertPayload(): any;
|
|
19
19
|
protected GetUpdatePayload(): any;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoadGeospatialPoint = exports.LoadDateTime = void 0;
|
|
4
|
+
const json_1 = require("@apigames/json");
|
|
5
|
+
const interfaces_1 = require("../interfaces");
|
|
6
|
+
function LoadDateTime(value) {
|
|
7
|
+
if ((0, json_1.isDefined)(value))
|
|
8
|
+
return new Date(value);
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
exports.LoadDateTime = LoadDateTime;
|
|
12
|
+
function LoadGeospatialPoint(value) {
|
|
13
|
+
if ((0, json_1.isDefined)(value) && (0, json_1.hasProperty)(value, 'longitude') && (0, json_1.isNumber)(value.longitude)
|
|
14
|
+
&& (0, json_1.hasProperty)(value, 'latitude') && (0, json_1.isNumber)(value.latitude)) {
|
|
15
|
+
const geospatialPoint = new interfaces_1.GeospatialPoint();
|
|
16
|
+
geospatialPoint.LoadData(value);
|
|
17
|
+
return geospatialPoint;
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
exports.LoadGeospatialPoint = LoadGeospatialPoint;
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -2,20 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ResourceObjectRelationshipBase = exports.GeospatialPoint = exports.ResourceObjectAttributeBase = void 0;
|
|
4
4
|
const json_1 = require("@apigames/json");
|
|
5
|
+
const helpers_1 = require("../helpers");
|
|
5
6
|
class ResourceObjectAttributeBase {
|
|
6
7
|
static LoadDateTime(value) {
|
|
7
|
-
|
|
8
|
-
return new Date(value);
|
|
9
|
-
return undefined;
|
|
8
|
+
return (0, helpers_1.LoadDateTime)(value);
|
|
10
9
|
}
|
|
11
10
|
static LoadGeospatialPoint(value) {
|
|
12
|
-
|
|
13
|
-
&& (0, json_1.hasProperty)(value, 'latitude') && (0, json_1.isNumber)(value.latitude)) {
|
|
14
|
-
const geospatialPoint = new GeospatialPoint();
|
|
15
|
-
geospatialPoint.LoadData(value);
|
|
16
|
-
return geospatialPoint;
|
|
17
|
-
}
|
|
18
|
-
return undefined;
|
|
11
|
+
return (0, helpers_1.LoadGeospatialPoint)(value);
|
|
19
12
|
}
|
|
20
13
|
}
|
|
21
14
|
exports.ResourceObjectAttributeBase = ResourceObjectAttributeBase;
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"description": "API Games SDK Core",
|
|
15
15
|
"license": "MIT",
|
|
16
|
-
"version": "22.1.
|
|
16
|
+
"version": "22.1.5",
|
|
17
17
|
"main": "lib/index.js",
|
|
18
18
|
"types": "lib/index.d.ts",
|
|
19
19
|
"scripts": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"test:watch": "jest --watch"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@apigames/json": "22.1.
|
|
37
|
-
"@apigames/rest-client": "22.1.
|
|
36
|
+
"@apigames/json": "22.1.2",
|
|
37
|
+
"@apigames/rest-client": "22.1.3",
|
|
38
38
|
"object-hash": "2.2.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -44,23 +44,23 @@
|
|
|
44
44
|
"@types/node": "14.18.12",
|
|
45
45
|
"@typescript-eslint/eslint-plugin": "5.16.0",
|
|
46
46
|
"@typescript-eslint/parser": "5.16.0",
|
|
47
|
-
"eslint": "8.
|
|
47
|
+
"eslint": "8.12.0",
|
|
48
48
|
"eslint-config-airbnb": "19.0.4",
|
|
49
49
|
"eslint-plugin-import": "2.25.4",
|
|
50
50
|
"eslint-plugin-jsx-a11y": "6.5.1",
|
|
51
51
|
"eslint-plugin-react": "7.29.4",
|
|
52
52
|
"eslint-plugin-react-hooks": "4.3.0",
|
|
53
53
|
"jest": "27.5.1",
|
|
54
|
-
"ts-jest": "27.1.
|
|
55
|
-
"typescript": "4.6.
|
|
54
|
+
"ts-jest": "27.1.4",
|
|
55
|
+
"typescript": "4.6.3"
|
|
56
56
|
},
|
|
57
57
|
"eslintConfig": {},
|
|
58
58
|
"repository": {
|
|
59
59
|
"type": "git",
|
|
60
|
-
"url": "git+https://github.com/apigames-
|
|
60
|
+
"url": "git+https://github.com/apigames-core/sdk-core.git"
|
|
61
61
|
},
|
|
62
62
|
"bugs": {
|
|
63
|
-
"url": "https://github.com/apigames-
|
|
63
|
+
"url": "https://github.com/apigames-core/sdk-core/issues"
|
|
64
64
|
},
|
|
65
|
-
"homepage": "https://github.com/apigames-
|
|
65
|
+
"homepage": "https://github.com/apigames-core/sdk-core#readme"
|
|
66
66
|
}
|
package/fixEOL.sh
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
find src -name "*.js" -type f -exec dos2unix {} \;
|
|
2
|
-
find src -name "*.jsx" -type f -exec dos2unix {} \;
|
|
3
|
-
find src -name "*.ts" -type f -exec dos2unix {} \;
|
|
4
|
-
find src -name "*.tsx" -type f -exec dos2unix {} \;
|
|
5
|
-
find tests -name "*.js" -type f -exec dos2unix {} \;
|
|
6
|
-
find tests -name "*.jsx" -type f -exec dos2unix {} \;
|
|
7
|
-
find tests -name "*.ts" -type f -exec dos2unix {} \;
|
|
8
|
-
find tests -name "*.tsx" -type f -exec dos2unix {} \;
|
package/publishCodeCoverage.sh
DELETED