@adobe/spacecat-shared-utils 1.14.0 → 1.14.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [@adobe/spacecat-shared-utils-v1.14.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.14.1...@adobe/spacecat-shared-utils-v1.14.2) (2024-03-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update external fixes ([#197](https://github.com/adobe/spacecat-shared/issues/197)) ([776c657](https://github.com/adobe/spacecat-shared/commit/776c657b3ebb2d5b2cd2379aed82d3b9a85ded51))
7
+
8
+ # [@adobe/spacecat-shared-utils-v1.14.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.14.0...@adobe/spacecat-shared-utils-v1.14.1) (2024-03-19)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * jsdoc for generateCSVFile and release ([#187](https://github.com/adobe/spacecat-shared/issues/187)) ([e8e30ed](https://github.com/adobe/spacecat-shared/commit/e8e30eddb0609370898e022d1f986cbc5db83e36))
14
+
1
15
  # [@adobe/spacecat-shared-utils-v1.14.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.13.2...@adobe/spacecat-shared-utils-v1.14.0) (2024-03-18)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-utils",
3
- "version": "1.14.0",
3
+ "version": "1.14.2",
4
4
  "description": "Shared modules of the Spacecat Services - utils",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -40,8 +40,8 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@adobe/fetch": "4.1.1",
43
- "@aws-sdk/client-s3": "3.535.0",
44
- "@aws-sdk/client-sqs": "3.535.0",
43
+ "@aws-sdk/client-s3": "3.540.0",
44
+ "@aws-sdk/client-sqs": "3.540.0",
45
45
  "@json2csv/plainjs": "7.0.6"
46
46
  },
47
47
  "peerDependencies": {
package/src/helpers.js CHANGED
@@ -58,10 +58,15 @@ export function isAuditsDisabled(site, organization, auditType) {
58
58
  }
59
59
 
60
60
  /**
61
- * Generates a CSV file from the provided json data.
62
- * @param {Array} data - Array of JSON objects to be converted to CSV.
63
- * @returns {Buffer} - The CSV formatted data as a buffer.
64
- */
61
+ * Generates a CSV file from the provided JSON data.
62
+ *
63
+ * Each key-value pair in the JSON objects
64
+ * corresponds to a column and its value in the CSV. The output is a UTF-8
65
+ * encoded Buffer that represents the CSV file content.
66
+ *
67
+ * @param {Object[]} data - An array of JSON objects to be converted into CSV format.
68
+ * @returns {Buffer} A Buffer containing the CSV formatted data, encoded in UTF-8.
69
+ */
65
70
  export function generateCSVFile(data) {
66
71
  const json2csvParser = new Parser();
67
72
  return Buffer.from(json2csvParser.parse(data), 'utf-8');
package/src/index.d.ts CHANGED
@@ -108,3 +108,15 @@ declare function composeAuditURL(url: string): Promise<string>;
108
108
  * @returns {boolean} - True if the audit(s) are disabled, otherwise false.
109
109
  */
110
110
  declare function isAuditsDisabled(site: object, organization: object, auditType?: string): boolean
111
+
112
+ /**
113
+ * Generates a CSV file from the provided JSON data.
114
+ *
115
+ * Each key-value pair in the JSON objects
116
+ * corresponds to a column and its value in the CSV. The output is a UTF-8
117
+ * encoded Buffer that represents the CSV file content.
118
+ *
119
+ * @param {Object[]} data - An array of JSON objects to be converted into CSV format.
120
+ * @returns {Buffer} A Buffer containing the CSV formatted data, encoded in UTF-8.
121
+ */
122
+ declare function generateCSVFile(data: object[]): Buffer;
package/src/index.js CHANGED
@@ -30,6 +30,7 @@ export {
30
30
  export {
31
31
  isAuditsDisabled,
32
32
  resolveSecretsName,
33
+ generateCSVFile,
33
34
  } from './helpers.js';
34
35
 
35
36
  export { sqsWrapper } from './sqs.js';