@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 CHANGED
@@ -1,8 +1,8 @@
1
1
  # API Games SDK Core Package
2
2
 
3
3
  ![](https://img.shields.io/badge/build-passing-brightgreen)
4
- [![Codacy Badge](https://app.codacy.com/project/badge/Grade/c5081d4fa5a84849b05e1a9b54d2b93f)](https://www.codacy.com/gh/apigames-public/sdk-core/dashboard?utm_source=github.com&utm_medium=referral&utm_content=apigames-public/sdk-core&utm_campaign=Badge_Grade)
5
- [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/c5081d4fa5a84849b05e1a9b54d2b93f)](https://www.codacy.com/gh/apigames-public/sdk-core/dashboard?utm_source=github.com&utm_medium=referral&utm_content=apigames-public/sdk-core&utm_campaign=Badge_Coverage)
4
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/8c3c5f94c0ac457ab23170cd9fca50f9)](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
+ [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/8c3c5f94c0ac457ab23170cd9fca50f9)](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
  ![](https://img.shields.io/npm/v/@apigames/sdk-core)
7
7
  ![](https://img.shields.io/badge/license-MIT-blue)
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
- protected UpdateAttributes(value: any): void;
16
- protected UpdateRelationships(value: any): void;
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,3 @@
1
+ import { GeospatialPoint } from '../interfaces';
2
+ export declare function LoadDateTime(value: string): Date;
3
+ export declare function LoadGeospatialPoint(value: any): GeospatialPoint;
@@ -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
@@ -1,3 +1,4 @@
1
1
  export * from './interfaces';
2
2
  export * from './exceptions';
3
3
  export * from './classes';
4
+ export * from './helpers';
package/lib/index.js CHANGED
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./interfaces"), exports);
18
18
  __exportStar(require("./exceptions"), exports);
19
19
  __exportStar(require("./classes"), exports);
20
+ __exportStar(require("./helpers"), exports);
@@ -38,4 +38,6 @@ export interface IResourceObject {
38
38
  LoadData(value: any): IResourceObject;
39
39
  Delete(): Promise<void>;
40
40
  Save(): Promise<void>;
41
+ UpdateAttributes(value: any): void;
42
+ UpdateRelationships(value: any): void;
41
43
  }
@@ -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
- if ((0, json_1.isDefined)(value))
8
- return new Date(value);
9
- return undefined;
8
+ return (0, helpers_1.LoadDateTime)(value);
10
9
  }
11
10
  static LoadGeospatialPoint(value) {
12
- if ((0, json_1.isDefined)(value) && (0, json_1.hasProperty)(value, 'longitude') && (0, json_1.isNumber)(value.longitude)
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.2",
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.1",
37
- "@apigames/rest-client": "22.1.2",
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.11.0",
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.3",
55
- "typescript": "4.6.2"
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-public/sdk-core.git"
60
+ "url": "git+https://github.com/apigames-core/sdk-core.git"
61
61
  },
62
62
  "bugs": {
63
- "url": "https://github.com/apigames-public/sdk-core/issues"
63
+ "url": "https://github.com/apigames-core/sdk-core/issues"
64
64
  },
65
- "homepage": "https://github.com/apigames-public/sdk-core#readme"
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 {} \;
@@ -1,7 +0,0 @@
1
- export CODACY_API_TOKEN=zLmkgxu0V5R3qEbGrbbm
2
- export CODACY_ORGANIZATION_PROVIDER=gh
3
- export CODACY_USERNAME=apigames-public
4
- export CODACY_PROJECT_NAME=sdk-core
5
-
6
- bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage/clover.xml
7
-