fiftyone.pipeline.cloudrequestengine 4.5.22 → 4.5.24

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fiftyone.pipeline.cloudrequestengine",
3
- "version": "4.5.22",
3
+ "version": "4.5.24",
4
4
  "description": "Cloud request engine for the 51Degrees Pipeline API",
5
5
  "keywords": [
6
6
  "51degrees",
package/readme.md CHANGED
@@ -10,7 +10,7 @@ The 51Degrees Pipeline API is a generic web request intelligence and data proces
10
10
 
11
11
  This package uses the `engines` class created by the [`fiftyone.pipeline.engines`](/fiftyone.pipeline.engines#readme.md). It makes available:
12
12
 
13
- * A `Cloud Request Engine` which calls the 51Degrees cloud service to fetch properties and metadata about them based on a provided resource key. Get a resource key at https://configure.51degrees.com/?utm_source=github&utm_medium=readme&utm_campaign=pipeline-node&utm_content=fiftyone.pipeline.cloudrequestengine-readme.md&utm_term=this-package-fiftyone-pipeline-cloudrequestengine
13
+ * A `Cloud Request Engine` which calls the 51Degrees cloud service to fetch properties and metadata about them based on a provided resource key. A resource key with the free properties used by the tests can be created [here](https://configure.51degrees.com/Wkqxf3Bs?utm_source=github&utm_medium=readme&utm_campaign=pipeline-node&utm_content=fiftyone.pipeline.cloudrequestengine-readme.md&utm_term=this-package-fiftyone-pipeline-cloudrequestengine).
14
14
  * A `Cloud Engine` template which reads data from the Cloud Request Engine.
15
15
 
16
16
  It is used by the cloud versions of the following 51Degrees engines:
@@ -38,3 +38,7 @@ Then, navigate to the module directory and execute:
38
38
  npm test
39
39
  ```
40
40
 
41
+ The integration tests read the resource key from the aligned
42
+ `_51DEGREES_RESOURCE_KEY` environment variable first, then the legacy
43
+ `RESOURCE_KEY` variable.
44
+
@@ -36,7 +36,10 @@ const pipelineBuilderPath = path.resolve(__dirname, '..', '..', 'fiftyone.pipeli
36
36
  const CloudEngine = require(cloudEnginePath);
37
37
  const PipelineBuilder = require(pipelineBuilderPath);
38
38
 
39
- const myResourceKey = process.env.RESOURCE_KEY || '!!YOUR_RESOURCE_KEY!!';
39
+ // The aligned _51DEGREES_RESOURCE_KEY environment variable is checked
40
+ // first, then the legacy RESOURCE_KEY variable.
41
+ const myResourceKey = process.env['_51DEGREES_RESOURCE_KEY'] ||
42
+ process.env.RESOURCE_KEY || '!!YOUR_RESOURCE_KEY!!';
40
43
 
41
44
  /**
42
45
  * Verify that cloud engine returns isMobile property in response.
@@ -47,9 +50,10 @@ const myResourceKey = process.env.RESOURCE_KEY || '!!YOUR_RESOURCE_KEY!!';
47
50
  test('valid response', done => {
48
51
  if (myResourceKey === '!!YOUR_RESOURCE_KEY!!') {
49
52
  fail('You need to create a resource key at ' +
50
- 'https://configure.51degrees.com and paste it into the ' +
51
- 'code, replacing !!YOUR_RESOURCE_KEY!!. Please make sure ' +
52
- 'to include IsMobile property.');
53
+ 'https://configure.51degrees.com/Wkqxf3Bs and supply it in ' +
54
+ 'the _51DEGREES_RESOURCE_KEY environment variable, or paste ' +
55
+ 'it into the code replacing !!YOUR_RESOURCE_KEY!!. Please ' +
56
+ 'make sure to include the IsMobile property.');
53
57
  }
54
58
  const cloud = new CloudRequestEngine({
55
59
  resourceKey: myResourceKey,
@@ -80,9 +84,10 @@ test('valid response', done => {
80
84
  test('post with sequence evidence', done => {
81
85
  if (myResourceKey === '!!YOUR_RESOURCE_KEY!!') {
82
86
  fail('You need to create a resource key at ' +
83
- 'https://configure.51degrees.com and paste it into the ' +
84
- 'code, replacing !!YOUR_RESOURCE_KEY!!. Please make sure ' +
85
- 'to include IsMobile property.');
87
+ 'https://configure.51degrees.com/Wkqxf3Bs and supply it in ' +
88
+ 'the _51DEGREES_RESOURCE_KEY environment variable, or paste ' +
89
+ 'it into the code replacing !!YOUR_RESOURCE_KEY!!. Please ' +
90
+ 'make sure to include the IsMobile property.');
86
91
  }
87
92
 
88
93
  const cloud = new CloudRequestEngine({ resourceKey: myResourceKey });