fiftyone.devicedetection.cloud 4.4.132 → 4.4.133

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/readme.md +32 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fiftyone.devicedetection.cloud",
3
- "version": "4.4.132",
3
+ "version": "4.4.133",
4
4
  "description": "Device detection cloud services for the 51Degrees Pipeline API",
5
5
  "keywords": [
6
6
  "51degrees",
package/readme.md CHANGED
@@ -13,33 +13,54 @@ The device detection cloud engine makes use of the 51Degrees cloud API. As such
13
13
 
14
14
  This package requires the following additional packages:
15
15
 
16
- - **fiftyone.devicedetection.shared** - A Node.js module which contains shared functionality to build cloud and on-premise engines.
16
+ - [**fiftyone.devicedetection.shared**](/fiftyone.devicedetection.shared#readme) - A Node.js module which contains shared functionality to build cloud and on-premise engines.
17
17
 
18
18
  ### Installation
19
19
 
20
20
  Using NPM call:
21
21
 
22
- `npm install fiftyone.devicedetection.cloud`
22
+ ```
23
+ npm install fiftyone.devicedetection.cloud
24
+ ```
23
25
 
24
26
  ### Examples
25
27
 
26
- - **configureFromFile.js** - This example shows how to configure a pipeline from a configuration file using the pipelinebuilder's buildFromConfigurationFile method.
27
- - **failureToMatch.js** - This example shows how the hasValue function can help make sure that meaningful values are returned when checking properties returned from the device detection engine. It also illustrates how the "allowUnmatched" parameters can be used to alter these results.
28
- - **gettingStarted.js** - Getting started example of using the 51Degrees device detection 'Hash' algorithm to determine whether a given User-Agent corresponds to a mobile device or not.
29
- - **metaData.js** - This example shows how to get properties from a pipeline's processed flowData based on their metadata, the getProperties() method and also additional meta data properties on device detection data.
30
- - **webIntegration.js** - This example demonstrates the evidence.addFromRequest() method and client side JavaScript overrides by creating a web server, serving JavaScript created by the device detection engine and bundled together by a special JavaScript bundler engine. This JavaScript is then used on the client side to save a cookie so that when the device detection engine next processes the request (using the addFromRequest() method) it has a more accurate reading for properties set on the client side.
28
+ For details of how to run the examples, please refer to [run examples](/run_examples.md).
29
+ The tables below describe the examples that are available.
30
+
31
+ | Example | Description |
32
+ |----------------------------------------|-------------|
33
+ | [configurator-console](/fiftyone.devicedetection.cloud/examples/cloud/configurator-console) | Shows how to call the cloud with the created key and how to access the values of the selected properties.|
34
+ | [gettingstarted-console](/fiftyone.devicedetection.cloud/examples/cloud/gettingstarted-console) | How to use the 51Degrees Cloud service to determine details about a device based on its User-Agent and User-Agent Client Hints HTTP header values. |
35
+ | [gettingstarted-web](/fiftyone.devicedetection.cloud/examples/cloud/gettingstarted-web) | How to use the 51Degrees Cloud service to determine details about a device as part of a simple web server. |
36
+ | [metadata-console](/fiftyone.devicedetection.cloud/examples/cloud/metadata-console) | How to access the meta-data that relates to the device detection algorithm. |
37
+ | [nativemodellookup-console](/fiftyone.devicedetection.cloud/examples/cloud/nativemodellookup-console) | How to get device details based on a given 'native model name' using the 51Degrees cloud service. |
38
+ | [taclookup-console](/fiftyone.devicedetection.cloud/examples/cloud/taclookup-console) | How to get device details based on a given TAC (Type Allocation Code) using the 51Degrees cloud service. |
39
+ | [useragentclienthints-web](/fiftyone.devicedetection.cloud/examples/cloud/useragentclienthints-web) | This is now deprecated. Kept for testing purposes. Please see **gettingstarted-web** instead.
40
+
31
41
 
32
42
  ## Tests
33
43
 
34
44
  In this repository, there are tests for the examples.
35
45
  You will need to install jest to run them:
36
46
 
37
- `npm install jest --global`
47
+ ```
48
+ npm install jest --global
49
+ ```
38
50
 
39
51
  You will also need to install any required packages for the examples in the **Examples** section.
40
52
 
41
- You need to obtain a 51Degrees cloud resource key from the [51Degrees Cloud Configurator](https://configure.51degrees.com/) and assign it to the environment variable `RESOURCE_KEY` in your test environment.
53
+ Add a 51Degrees cloud resource key in the fiftyone.devicedetection/package.json file for cloud tests. You can obtain a resource key from the [51Degrees Cloud Configurator](https://configure.51degrees.com/) and assign it to the environment variable `RESOURCE_KEY` in your test environment.
54
+
55
+ There are other environment variables that you will also need to set in your test environment before running all tests:
56
+ - `TEST_SUPER_RESOURCE_KEY`: This key contains all `SetHeader*` properties.
57
+ - `TEST_PLATFORM_RESOURCE_KEY`: This key contains only the `SetHeaderPlatform*` property but no other `SetHeader` properties.
58
+ - `TEST_HARDWARE_RESOURCE_KEY`: This key contains only the `SetHeaderHardware*` property but no other `SetHeader` properties.
59
+ - `TEST_BROWSER_RESOURCE_KEY`: This key contains only the `SetHeaderBrowser*` property but no other `SetHeader` properties.
60
+ - `TEST_NO_SETHEADER_RESOURCE_KEY`: This key contains no `SetHeader` properties.
42
61
 
43
- To run the tests, navigate to the module directory and execute:
62
+ To run the tests, execute the following command in the root directory or a sub-module directory:
44
63
 
45
- `npm test`
64
+ ```
65
+ npm test
66
+ ```