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.
- package/package.json +1 -1
- package/readme.md +32 -11
package/package.json
CHANGED
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
|
-
|
|
22
|
+
```
|
|
23
|
+
npm install fiftyone.devicedetection.cloud
|
|
24
|
+
```
|
|
23
25
|
|
|
24
26
|
### Examples
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
62
|
+
To run the tests, execute the following command in the root directory or a sub-module directory:
|
|
44
63
|
|
|
45
|
-
|
|
64
|
+
```
|
|
65
|
+
npm test
|
|
66
|
+
```
|