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 +1 -1
- package/readme.md +5 -1
- package/tests/integration.test.js +12 -7
package/package.json
CHANGED
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.
|
|
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
|
-
|
|
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
|
|
51
|
-
'
|
|
52
|
-
'
|
|
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
|
|
84
|
-
'
|
|
85
|
-
'
|
|
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 });
|