@3sixty/data-processing-converters 0.20.0-next.0 → 0.20.0-next.1

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 +1 @@
1
- {"version":3,"file":"jsonConverterConnector.js","sourceRoot":"","sources":["../../../src/converters/jsonConverterConnector.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG1E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAClC;;OAEG;IACI,MAAM,CAAU,SAAS,GAAW,MAAM,CAAC;IAElD;;OAEG;IACI,MAAM,CAAU,UAAU,4BAA4C;IAE7E;;;OAGG;IACI,SAAS;QACf,OAAO,sBAAsB,CAAC,UAAU,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,OAAO,CAAC,IAAgB;QACpC,MAAM,CAAC,UAAU,CAAC,sBAAsB,CAAC,UAAU,UAAgB,IAAI,CAAC,CAAC;QAEzE,IAAI,SAAS,GAAG,EAAE,CAAC;QAEnB,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC;gBACJ,MAAM,UAAU,GAAG,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBAC/C,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACpC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,MAAM,IAAI,YAAY,CAAC,sBAAsB,CAAC,UAAU,EAAE,eAAe,EAAE;oBAC1E,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO;iBAC3C,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,OAAO,SAAS,CAAC;IAClB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseError, Converter, GeneralError, Guards } from \"@3sixty/core\";\nimport type { IDataConverterConnector } from \"@3sixty/data-processing-models\";\nimport { nameof } from \"@3sixty/nameof\";\nimport { MimeTypes } from \"@3sixty/web\";\n\n/**\n * Class for converting data to JSON from bytes.\n */\nexport class JsonConverterConnector implements IDataConverterConnector {\n\t/**\n\t * The namespace supported by the data converter connector.\n\t */\n\tpublic static readonly NAMESPACE: string = \"json\";\n\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<JsonConverterConnector>();\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn JsonConverterConnector.CLASS_NAME;\n\t}\n\n\t/**\n\t * Returns the MIME types that this connector can convert.\n\t * @returns The supported MIME type strings.\n\t */\n\tpublic mimeTypes(): string[] {\n\t\treturn [MimeTypes.Json, MimeTypes.JsonLd];\n\t}\n\n\t/**\n\t * Converts the binary data to a structured object by parsing it as JSON.\n\t * @param data The binary data to convert.\n\t * @returns The parsed JSON object.\n\t * @throws GeneralError if the data cannot be parsed as valid JSON.\n\t */\n\tpublic async convert(data: Uint8Array): Promise<unknown> {\n\t\tGuards.uint8Array(JsonConverterConnector.CLASS_NAME, nameof(data), data);\n\n\t\tlet converted = {};\n\n\t\tif (data.length > 0) {\n\t\t\ttry {\n\t\t\t\tconst jsonString = Converter.bytesToUtf8(data);\n\t\t\t\tconverted = JSON.parse(jsonString);\n\t\t\t} catch (error) {\n\t\t\t\tthrow new GeneralError(JsonConverterConnector.CLASS_NAME, \"invalidFormat\", {\n\t\t\t\t\tfailure: BaseError.fromError(error).message\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn converted;\n\t}\n}\n"]}
1
+ {"version":3,"file":"jsonConverterConnector.js","sources":["../../../src/converters/jsonConverterConnector.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG1E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAClC;;OAEG;IACI,MAAM,CAAU,SAAS,GAAW,MAAM,CAAC;IAElD;;OAEG;IACI,MAAM,CAAU,UAAU,GAAW,wBAAwB,CAAC;IAErE;;;OAGG;IACI,SAAS;QACf,OAAO,sBAAsB,CAAC,UAAU,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,OAAO,CAAC,IAAgB;QACpC,MAAM,CAAC,UAAU,CAAC,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAEnE,IAAI,SAAS,GAAG,EAAE,CAAC;QAEnB,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC;gBACJ,MAAM,UAAU,GAAG,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBAC/C,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACpC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,MAAM,IAAI,YAAY,CAAC,sBAAsB,CAAC,UAAU,EAAE,eAAe,EAAE;oBAC1E,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO;iBAC3C,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,OAAO,SAAS,CAAC;IAClB,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseError, Converter, GeneralError, Guards } from \"@3sixty/core\";\nimport type { IDataConverterConnector } from \"@3sixty/data-processing-models\";\n\nimport { MimeTypes } from \"@3sixty/web\";\n\n/**\n * Class for converting data to JSON from bytes.\n */\nexport class JsonConverterConnector implements IDataConverterConnector {\n\t/**\n\t * The namespace supported by the data converter connector.\n\t */\n\tpublic static readonly NAMESPACE: string = \"json\";\n\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = \"JsonConverterConnector\";\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn JsonConverterConnector.CLASS_NAME;\n\t}\n\n\t/**\n\t * Returns the MIME types that this connector can convert.\n\t * @returns The supported MIME type strings.\n\t */\n\tpublic mimeTypes(): string[] {\n\t\treturn [MimeTypes.Json, MimeTypes.JsonLd];\n\t}\n\n\t/**\n\t * Converts the binary data to a structured object by parsing it as JSON.\n\t * @param data The binary data to convert.\n\t * @returns The parsed JSON object.\n\t * @throws GeneralError if the data cannot be parsed as valid JSON.\n\t */\n\tpublic async convert(data: Uint8Array): Promise<unknown> {\n\t\tGuards.uint8Array(JsonConverterConnector.CLASS_NAME, \"data\", data);\n\n\t\tlet converted = {};\n\n\t\tif (data.length > 0) {\n\t\t\ttry {\n\t\t\t\tconst jsonString = Converter.bytesToUtf8(data);\n\t\t\t\tconverted = JSON.parse(jsonString);\n\t\t\t} catch (error) {\n\t\t\t\tthrow new GeneralError(JsonConverterConnector.CLASS_NAME, \"invalidFormat\", {\n\t\t\t\t\tfailure: BaseError.fromError(error).message\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn converted;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"xmlConverterConnector.js","sourceRoot":"","sources":["../../../src/converters/xmlConverterConnector.ts"],"names":[],"mappings":"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CAAC;iBACjE,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,OAAO,SAAS,CAAC;IAClB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseError, GeneralError, Guards } from \"@3sixty/core\";\nimport type { IDataConverterConnector } from \"@3sixty/data-processing-models\";\nimport { nameof } from \"@3sixty/nameof\";\nimport { MimeTypes } from \"@3sixty/web\";\nimport xml2js from \"xml2js\";\n\n/**\n * Class for converting data to XML from bytes.\n */\nexport class XmlConverterConnector implements IDataConverterConnector {\n\t/**\n\t * The namespace supported by the data converter connector.\n\t */\n\tpublic static readonly NAMESPACE: string = \"xml\";\n\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<XmlConverterConnector>();\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn XmlConverterConnector.CLASS_NAME;\n\t}\n\n\t/**\n\t * Returns the MIME types that this connector can convert.\n\t * @returns The supported MIME type strings.\n\t */\n\tpublic mimeTypes(): string[] {\n\t\treturn [MimeTypes.Xml];\n\t}\n\n\t/**\n\t * Converts the binary data to a structured object by parsing it as XML.\n\t * @param data The binary data to convert.\n\t * @returns The parsed object representation of the XML.\n\t * @throws GeneralError if the data cannot be parsed as valid XML.\n\t */\n\tpublic async convert(data: Uint8Array): Promise<unknown> {\n\t\tGuards.uint8Array(XmlConverterConnector.CLASS_NAME, nameof(data), data);\n\n\t\tlet converted = {};\n\n\t\tif (data.length > 0) {\n\t\t\ttry {\n\t\t\t\tconst xmlParser = new xml2js.Parser({\n\t\t\t\t\texplicitArray: false,\n\t\t\t\t\texplicitRoot: true\n\t\t\t\t});\n\n\t\t\t\tconst result = await xmlParser.parseStringPromise(Buffer.from(data));\n\n\t\t\t\tconverted = result ?? {};\n\t\t\t} catch (error) {\n\t\t\t\tthrow new GeneralError(XmlConverterConnector.CLASS_NAME, \"invalidFormat\", {\n\t\t\t\t\tfailure: BaseError.fromError(error).message.split(\"\\n\").join(\" \")\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn converted;\n\t}\n}\n"]}
1
+ {"version":3,"file":"xmlConverterConnector.js","sources":["../../../src/converters/xmlConverterConnector.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG/D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B;;GAEG;AACH,MAAM,OAAO,qBAAqB;IACjC;;OAEG;IACI,MAAM,CAAU,SAAS,GAAW,KAAK,CAAC;IAEjD;;OAEG;IACI,MAAM,CAAU,UAAU,GAAW,uBAAuB,CAAC;IAEpE;;;OAGG;IACI,SAAS;QACf,OAAO,qBAAqB,CAAC,UAAU,CAAC;IACzC,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,OAAO,CAAC,IAAgB;QACpC,MAAM,CAAC,UAAU,CAAC,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAElE,IAAI,SAAS,GAAG,EAAE,CAAC;QAEnB,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC;gBACJ,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC;oBACnC,aAAa,EAAE,KAAK;oBACpB,YAAY,EAAE,IAAI;iBAClB,CAAC,CAAC;gBAEH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;gBAErE,SAAS,GAAG,MAAM,IAAI,EAAE,CAAC;YAC1B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,MAAM,IAAI,YAAY,CAAC,qBAAqB,CAAC,UAAU,EAAE,eAAe,EAAE;oBACzE,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;iBACjE,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,OAAO,SAAS,CAAC;IAClB,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseError, GeneralError, Guards } from \"@3sixty/core\";\nimport type { IDataConverterConnector } from \"@3sixty/data-processing-models\";\n\nimport { MimeTypes } from \"@3sixty/web\";\nimport xml2js from \"xml2js\";\n\n/**\n * Class for converting data to XML from bytes.\n */\nexport class XmlConverterConnector implements IDataConverterConnector {\n\t/**\n\t * The namespace supported by the data converter connector.\n\t */\n\tpublic static readonly NAMESPACE: string = \"xml\";\n\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = \"XmlConverterConnector\";\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn XmlConverterConnector.CLASS_NAME;\n\t}\n\n\t/**\n\t * Returns the MIME types that this connector can convert.\n\t * @returns The supported MIME type strings.\n\t */\n\tpublic mimeTypes(): string[] {\n\t\treturn [MimeTypes.Xml];\n\t}\n\n\t/**\n\t * Converts the binary data to a structured object by parsing it as XML.\n\t * @param data The binary data to convert.\n\t * @returns The parsed object representation of the XML.\n\t * @throws GeneralError if the data cannot be parsed as valid XML.\n\t */\n\tpublic async convert(data: Uint8Array): Promise<unknown> {\n\t\tGuards.uint8Array(XmlConverterConnector.CLASS_NAME, \"data\", data);\n\n\t\tlet converted = {};\n\n\t\tif (data.length > 0) {\n\t\t\ttry {\n\t\t\t\tconst xmlParser = new xml2js.Parser({\n\t\t\t\t\texplicitArray: false,\n\t\t\t\t\texplicitRoot: true\n\t\t\t\t});\n\n\t\t\t\tconst result = await xmlParser.parseStringPromise(Buffer.from(data));\n\n\t\t\t\tconverted = result ?? {};\n\t\t\t} catch (error) {\n\t\t\t\tthrow new GeneralError(XmlConverterConnector.CLASS_NAME, \"invalidFormat\", {\n\t\t\t\t\tfailure: BaseError.fromError(error).message.split(\"\\n\").join(\" \")\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn converted;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./converters/jsonConverterConnector.js\";\nexport * from \"./converters/xmlConverterConnector.js\";\n"]}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./converters/jsonConverterConnector.js\";\nexport * from \"./converters/xmlConverterConnector.js\";\n"]}
package/docs/changelog.md CHANGED
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ ## [0.20.0-next.1](https://github.com/3sixtyglobal/data-processing/compare/data-processing-converters-v0.20.0-next.0...data-processing-converters-v0.20.0-next.1) (2026-10-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * publish packages under the [@3sixty](https://github.com/3sixty) namespace ([e62a15f](https://github.com/3sixtyglobal/data-processing/commit/e62a15f0f619ee7161c1f881a10a2d7db48dbc4d))
9
+ * updated ts compile ([ba5bfb7](https://github.com/3sixtyglobal/data-processing/commit/ba5bfb7ce9fa96b17952fe0074192e73ccb4b1d6))
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * The following workspace dependencies were updated
15
+ * dependencies
16
+ * @3sixty/data-processing-models bumped from 0.20.0-next.0 to 0.20.0-next.1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3sixty/data-processing-converters",
3
- "version": "0.20.0-next.0",
3
+ "version": "0.20.0-next.1",
4
4
  "description": "Connector implementations that convert source data into canonical processing formats",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@3sixty/core": "next",
18
- "@3sixty/data-processing-models": "0.20.0-next.0",
18
+ "@3sixty/data-processing-models": "0.20.0-next.1",
19
19
  "@3sixty/nameof": "next",
20
20
  "@3sixty/web": "next",
21
21
  "xml2js": "0.6.2"