fiftyone.geolocation 4.4.42 → 4.4.44

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/ci/options.json CHANGED
@@ -1,28 +1,4 @@
1
1
  [
2
- {
3
- "Name": "Ubuntu_Node_16",
4
- "Image": "ubuntu-20.04",
5
- "Language": "node",
6
- "LanguageVersion": "16.20.0",
7
- "RunPerformance": true,
8
- "PackageRequirement": true
9
- },
10
- {
11
- "Name": "Windows_Node_16",
12
- "Image": "windows-latest",
13
- "Language": "node",
14
- "LanguageVersion": "16.20.0",
15
- "RunPerformance": true,
16
- "PackageRequirement": true
17
- },
18
- {
19
- "Name": "macOS_Node_16",
20
- "Image": "macos-latest",
21
- "Language": "node",
22
- "LanguageVersion": "16.20.0",
23
- "RunPerformance": true,
24
- "PackageRequirement": true
25
- },
26
2
  {
27
3
  "Name": "Ubuntu_Node_18",
28
4
  "Image": "ubuntu-20.04",
@@ -55,7 +55,9 @@ let localResourceKey;
55
55
  try {
56
56
  localResourceKey = resourceKey;
57
57
  } catch (e) {
58
- if (e instanceof ReferenceError) {}
58
+ if (e instanceof ReferenceError) {
59
+ console.log(e);
60
+ }
59
61
  }
60
62
  // You need to create a resource key at https://configure.51degrees.com and
61
63
  // paste it into the code, replacing !!YOUR_RESOURCE_KEY!!.
@@ -63,7 +63,6 @@ const configFile = fs.readFileSync((process.env.directory || __dirname) +
63
63
  const config = JSON.parse(configFile);
64
64
  let resourceKeySet = true;
65
65
  let resourceKeySetFromFile = true;
66
-
67
66
  // Check if a resource key has been set in the config file.
68
67
  if (config.PipelineOptions.Elements[0].elementParameters.resourceKey
69
68
  .startsWith('!!')) {
@@ -73,7 +72,9 @@ if (config.PipelineOptions.Elements[0].elementParameters.resourceKey
73
72
  try {
74
73
  myResourceKey = resourceKey;
75
74
  } catch (e) {
76
- if (e instanceof ReferenceError) {}
75
+ if (e instanceof ReferenceError) {
76
+ console.log(e);
77
+ }
77
78
  }
78
79
 
79
80
  // If not, check the resource key environment variable.
@@ -1,23 +1,23 @@
1
- /* *********************************************************************
2
- * This Original Work is copyright of 51 Degrees Mobile Experts Limited.
3
- * Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
4
- * Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
5
- *
6
- * This Original Work is licensed under the European Union Public Licence
7
- * (EUPL) v.1.2 and is subject to its terms as set out below.
8
- *
9
- * If a copy of the EUPL was not distributed with this file, You can obtain
10
- * one at https://opensource.org/licenses/EUPL-1.2.
11
- *
12
- * The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
13
- * amended by the European Commission) shall be deemed incompatible for
14
- * the purposes of the Work and the provisions of the compatibility
15
- * clause in Article 5 of the EUPL shall not apply.
16
- *
17
- * If using the Work as, or as part of, a network application, by
18
- * including the attribution notice(s) required under Article 5 of the EUPL
19
- * in the end user terms of the application under an appropriate heading,
20
- * such notice(s) shall fulfill the requirements of that article.
1
+ /* *********************************************************************
2
+ * This Original Work is copyright of 51 Degrees Mobile Experts Limited.
3
+ * Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
4
+ * Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
5
+ *
6
+ * This Original Work is licensed under the European Union Public Licence
7
+ * (EUPL) v.1.2 and is subject to its terms as set out below.
8
+ *
9
+ * If a copy of the EUPL was not distributed with this file, You can obtain
10
+ * one at https://opensource.org/licenses/EUPL-1.2.
11
+ *
12
+ * The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
13
+ * amended by the European Commission) shall be deemed incompatible for
14
+ * the purposes of the Work and the provisions of the compatibility
15
+ * clause in Article 5 of the EUPL shall not apply.
16
+ *
17
+ * If using the Work as, or as part of, a network application, by
18
+ * including the attribution notice(s) required under Article 5 of the EUPL
19
+ * in the end user terms of the application under an appropriate heading,
20
+ * such notice(s) shall fulfill the requirements of that article.
21
21
  * ********************************************************************* */
22
22
 
23
23
  const fs = require('fs');
@@ -64,17 +64,19 @@ if (isAsync) {
64
64
  test('cloud getting started', async (done) => {
65
65
  setTimeout(done, 1000);
66
66
 
67
- testExample({ file: (__dirname) + '/gettingStarted.js' });
67
+ testExample({ file: path.resolve(__dirname, 'gettingStarted.js') });
68
68
  });
69
+
69
70
  test('combining services', async (done) => {
70
71
  setTimeout(done, 1000);
71
72
 
72
- testExample({ file: (__dirname) + '/combiningServices.js' });
73
+ testExample({ file: path.resolve(__dirname, 'combiningServices.js') });
73
74
  });
75
+
74
76
  test('configure from file', async (done) => {
75
77
  setTimeout(done, 1000);
76
78
 
77
- testExample({ file: (__dirname) + '/configureFromFile.js' });
79
+ testExample({ file: path.resolve(__dirname, 'configureFromFile.js') });
78
80
  });
79
81
  } else {
80
82
  // Skip if async is not available (e.g node 6)
@@ -104,7 +104,9 @@ let localResourceKey;
104
104
  try {
105
105
  localResourceKey = resourceKey;
106
106
  } catch (e) {
107
- if (e instanceof ReferenceError) {}
107
+ if (e instanceof ReferenceError) {
108
+ console.log(e);
109
+ }
108
110
  }
109
111
  // You need to create a resource key at https://configure.51degrees.com and
110
112
  // paste it into the code, replacing !!YOUR_RESOURCE_KEY!!.
@@ -1,23 +1,23 @@
1
- /* *********************************************************************
2
- * This Original Work is copyright of 51 Degrees Mobile Experts Limited.
3
- * Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
4
- * Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
5
- *
6
- * This Original Work is licensed under the European Union Public Licence
7
- * (EUPL) v.1.2 and is subject to its terms as set out below.
8
- *
9
- * If a copy of the EUPL was not distributed with this file, You can obtain
10
- * one at https://opensource.org/licenses/EUPL-1.2.
11
- *
12
- * The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
13
- * amended by the European Commission) shall be deemed incompatible for
14
- * the purposes of the Work and the provisions of the compatibility
15
- * clause in Article 5 of the EUPL shall not apply.
16
- *
17
- * If using the Work as, or as part of, a network application, by
18
- * including the attribution notice(s) required under Article 5 of the EUPL
19
- * in the end user terms of the application under an appropriate heading,
20
- * such notice(s) shall fulfill the requirements of that article.
1
+ /* *********************************************************************
2
+ * This Original Work is copyright of 51 Degrees Mobile Experts Limited.
3
+ * Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
4
+ * Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
5
+ *
6
+ * This Original Work is licensed under the European Union Public Licence
7
+ * (EUPL) v.1.2 and is subject to its terms as set out below.
8
+ *
9
+ * If a copy of the EUPL was not distributed with this file, You can obtain
10
+ * one at https://opensource.org/licenses/EUPL-1.2.
11
+ *
12
+ * The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
13
+ * amended by the European Commission) shall be deemed incompatible for
14
+ * the purposes of the Work and the provisions of the compatibility
15
+ * clause in Article 5 of the EUPL shall not apply.
16
+ *
17
+ * If using the Work as, or as part of, a network application, by
18
+ * including the attribution notice(s) required under Article 5 of the EUPL
19
+ * in the end user terms of the application under an appropriate heading,
20
+ * such notice(s) shall fulfill the requirements of that article.
21
21
  * ********************************************************************* */
22
22
 
23
23
  /**
@@ -100,16 +100,20 @@ if (myResourceKey.substring(0, 2) === '!!') {
100
100
  </p>
101
101
  <dl>
102
102
  <dt><strong>Country</strong></dt>
103
- <dv>` + (data && data.country && data.country.hasValue ? data.country.value
103
+ <dv>` + (data && data.country && data.country.hasValue
104
+ ? data.country.value
104
105
  : ('Unknown (' + (data && data.country ? data.country.noValueMessage : 'no data') + ')')) + `</dv>
105
106
  <dt><strong>State</strong></dt>
106
- <dv>` + (data && data.state && data.state.hasValue ? data.state.value
107
+ <dv>` + (data && data.state && data.state.hasValue
108
+ ? data.state.value
107
109
  : ('Unknown (' + (data && data.state ? data.state.noValueMessage : 'no data') + ')')) + `</dv>
108
110
  <dt><strong>County</strong></dt>
109
- <dv>` + (data && data.county && data.county.hasValue ? data.county.value
111
+ <dv>` + (data && data.county && data.county.hasValue
112
+ ? data.county.value
110
113
  : ('Unknown (' + (data && data.county ? data.county.noValueMessage : 'no data') + ')')) + `</dv>
111
114
  <dt><strong>Town/City</strong></dt>
112
- <dv>` + (data && data.town && data.town.hasValue ? data.town.value
115
+ <dv>` + (data && data.town && data.town.hasValue
116
+ ? data.town.value
113
117
  : ('Unknown (' + (data && data.town ? data.town.noValueMessage : 'no data') + ')')) + `</dv>
114
118
  </dl>
115
119
  <p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fiftyone.geolocation",
3
- "version": "4.4.42",
3
+ "version": "4.4.44",
4
4
  "description": "Perform reverse geocoding using longitude and latitude to populate postal addresses",
5
5
  "keywords": [
6
6
  "51Degrees",
@@ -29,11 +29,13 @@
29
29
  "devDependencies": {
30
30
  "@types/node": "^15.14.9",
31
31
  "eslint": "8.57.0",
32
- "eslint-config-standard": "^14.1.1",
33
- "eslint-plugin-import": "^2.28.1",
32
+ "eslint-config-standard": "^17.0.0",
33
+ "eslint-plugin-import": "^2.26.0",
34
+ "eslint-plugin-jsdoc": "^38.1.6",
34
35
  "eslint-plugin-node": "^11.1.0",
35
- "eslint-plugin-promise": "^4.3.1",
36
- "eslint-plugin-standard": "^4.1.0",
36
+ "eslint-plugin-promise": "^6.0.0",
37
+ "eslint-plugin-jest": "^23.13.2",
38
+ "eslint-plugin-n": "^15.0.0",
37
39
  "jest": "^27.5.1",
38
40
  "jest-expect-message": "^1.1.3",
39
41
  "jest-junit": "^9.0.0"
@@ -1,27 +1,28 @@
1
- /* *********************************************************************
2
- * This Original Work is copyright of 51 Degrees Mobile Experts Limited.
3
- * Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
4
- * Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
5
- *
6
- * This Original Work is licensed under the European Union Public Licence
7
- * (EUPL) v.1.2 and is subject to its terms as set out below.
8
- *
9
- * If a copy of the EUPL was not distributed with this file, You can obtain
10
- * one at https://opensource.org/licenses/EUPL-1.2.
11
- *
12
- * The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
13
- * amended by the European Commission) shall be deemed incompatible for
14
- * the purposes of the Work and the provisions of the compatibility
15
- * clause in Article 5 of the EUPL shall not apply.
16
- *
17
- * If using the Work as, or as part of, a network application, by
18
- * including the attribution notice(s) required under Article 5 of the EUPL
19
- * in the end user terms of the application under an appropriate heading,
20
- * such notice(s) shall fulfill the requirements of that article.
1
+ /* *********************************************************************
2
+ * This Original Work is copyright of 51 Degrees Mobile Experts Limited.
3
+ * Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
4
+ * Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
5
+ *
6
+ * This Original Work is licensed under the European Union Public Licence
7
+ * (EUPL) v.1.2 and is subject to its terms as set out below.
8
+ *
9
+ * If a copy of the EUPL was not distributed with this file, You can obtain
10
+ * one at https://opensource.org/licenses/EUPL-1.2.
11
+ *
12
+ * The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
13
+ * amended by the European Commission) shall be deemed incompatible for
14
+ * the purposes of the Work and the provisions of the compatibility
15
+ * clause in Article 5 of the EUPL shall not apply.
16
+ *
17
+ * If using the Work as, or as part of, a network application, by
18
+ * including the attribution notice(s) required under Article 5 of the EUPL
19
+ * in the end user terms of the application under an appropriate heading,
20
+ * such notice(s) shall fulfill the requirements of that article.
21
21
  * ********************************************************************* */
22
22
 
23
- const GeoLocation = require(__dirname +
24
- '/..');
23
+ const path = require('path');
24
+
25
+ const GeoLocation = require(path.resolve(__dirname, '..'));
25
26
  const myResourceKey = process.env.RESOURCE_KEY || '!!YOUR_RESOURCE_KEY!!';
26
27
 
27
28
  const TestLat = '51.4578261';