fiftyone.devicedetection.shared 4.4.127 → 4.4.129

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.
@@ -1,27 +1,33 @@
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
  class DataExtension {
24
- // Helper function to read property values from flowData
24
+ /**
25
+ * Helper function to read property values from flowData
26
+ *
27
+ * @param {object} elementData Element data
28
+ * @param {string} propertyName Property name
29
+ * @returns {string} result string, either property value or error
30
+ * */
25
31
  static getValueHelper (elementData, propertyName) {
26
32
  try {
27
33
  const property = elementData[propertyName];
@@ -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 CLOUD_REQUEST_ENGINE_NAME = 'cloudRequestEngine';
@@ -25,6 +25,13 @@ const CLOUD_REQUEST_ENGINE_NAME = 'cloudRequestEngine';
25
25
  const ONPREMISE_DEVICE_ENGINE = 'deviceDetectionOnPremise';
26
26
 
27
27
  class OptionsExtension {
28
+ /**
29
+ * Get element by name
30
+ *
31
+ * @param {object} options Options
32
+ * @param {string} elementName Element name
33
+ * @returns {object} Element
34
+ */
28
35
  static getElement (options, elementName) {
29
36
  if (options.PipelineOptions) {
30
37
  if (options.PipelineOptions.Elements) {
@@ -38,6 +45,12 @@ class OptionsExtension {
38
45
  }
39
46
  }
40
47
 
48
+ /**
49
+ * Get Datafile path
50
+ *
51
+ * @param {object} options Options
52
+ * @returns {string} Datafile path
53
+ */
41
54
  static getDataFilePath (options) {
42
55
  const cloudRequestElement = this.getElement(options, ONPREMISE_DEVICE_ENGINE);
43
56
  if (cloudRequestElement &&
@@ -47,6 +60,12 @@ class OptionsExtension {
47
60
  }
48
61
  }
49
62
 
63
+ /**
64
+ * Set Datafile path
65
+ *
66
+ * @param {object} options Options
67
+ * @param {string} newDataFilePath New Datafile path
68
+ */
50
69
  static setDataFilePath (options, newDataFilePath) {
51
70
  const cloudRequestElement = this.getElement(options, ONPREMISE_DEVICE_ENGINE);
52
71
  if (cloudRequestElement) {
@@ -58,6 +77,12 @@ class OptionsExtension {
58
77
  }
59
78
  }
60
79
 
80
+ /**
81
+ * Update Element path
82
+ *
83
+ * @param {object} options Options
84
+ * @param {string} appendDir New element path
85
+ */
61
86
  static updateElementPath (options, appendDir) {
62
87
  if (options.PipelineOptions) {
63
88
  if (options.PipelineOptions.Elements) {
@@ -71,6 +96,12 @@ class OptionsExtension {
71
96
  }
72
97
  }
73
98
 
99
+ /**
100
+ * Get resource Key
101
+ *
102
+ * @param {object} options Options
103
+ * @returns {string} Resource key
104
+ */
74
105
  static getResourceKey (options) {
75
106
  const cloudRequestElement = this.getElement(options, CLOUD_REQUEST_ENGINE_NAME);
76
107
  if (cloudRequestElement &&
@@ -80,6 +111,12 @@ class OptionsExtension {
80
111
  }
81
112
  }
82
113
 
114
+ /**
115
+ * Set resource key
116
+ *
117
+ * @param {object} options Options
118
+ * @param {string} resourceKey New resource key
119
+ */
83
120
  static setResourceKey (options, resourceKey) {
84
121
  const cloudRequestElement = this.getElement(options, CLOUD_REQUEST_ENGINE_NAME);
85
122
  if (cloudRequestElement) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fiftyone.devicedetection.shared",
3
- "version": "4.4.127",
3
+ "version": "4.4.129",
4
4
  "description": "Shared functionality for implementing device detection engine for the 51Degrees Pipeline API",
5
5
  "keywords": [
6
6
  "51degrees",