diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fc7a34..0a73d5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,3 @@ -# v1.6.0 (Wed Jul 24 2024) - -#### 🚀 Enhancement - -- Added ingestion of multiple cmdb classes [#54](https://github.com/JupiterOne/graph-servicenow/pull/54) ([@Gonzalo-Avalos-Ribas](https://github.com/Gonzalo-Avalos-Ribas)) - -#### Authors: 1 - -- Gonzalo Avalos Ribas ([@Gonzalo-Avalos-Ribas](https://github.com/Gonzalo-Avalos-Ribas)) - ---- - # v1.6.0 (Fri Jul 19 2024) #### 🚀 Enhancement diff --git a/package.json b/package.json index 4ab53b3..bf2231b 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,9 @@ }, "dependencies": { "@lifeomic/attempt": "^3.0.3", - "axios": "^0.27.2", - "to-json-schema": "^0.2.5" + "axios": "^1.7.2", + "to-json-schema": "^0.2.5", + "lodash": "~4.17.21" }, "auto": { "plugins": [ diff --git a/src/steps/cmdb/__snapshots__/converters.test.ts.snap b/src/steps/cmdb/__snapshots__/converters.test.ts.snap index 7259b0b..6ab8460 100644 --- a/src/steps/cmdb/__snapshots__/converters.test.ts.snap +++ b/src/steps/cmdb/__snapshots__/converters.test.ts.snap @@ -40,12 +40,12 @@ exports[`createCMDBEntity that properties are converted correctly 1`] = ` "fred", "george", ], - "test-u-custom-3": "custom 3", - "u-custom-1": "custom 1", - "u-custom-2": "", - "u-custom-boolean": true, - "u-custom-number": 234, - "u-custom-object": "{"a":"a","b":"b","c":123}", + "testUCustom3": "custom 3", + "uCustom1": "custom 1", + "uCustom2": "", + "uCustomBoolean": true, + "uCustomNumber": 234, + "uCustomObject": "{"a":"a","b":"b","c":123}", "updatedOn": 1586120952000, "warrantyExpiration": undefined, } diff --git a/src/steps/cmdb/converters.ts b/src/steps/cmdb/converters.ts index 15766e4..6ec13d5 100644 --- a/src/steps/cmdb/converters.ts +++ b/src/steps/cmdb/converters.ts @@ -6,6 +6,7 @@ import { import { Entities } from '../../constants'; import { CMDBItem } from '../../types'; import { skippedRawDataSource } from '../../util/graphObject'; +import { camelCase } from 'lodash'; export function createCMDBEntity( data: CMDBItem, @@ -16,7 +17,7 @@ export function createCMDBEntity( for (const [key, value] of Object.entries(data)) { //custom fields if (key.startsWith('u_') || key.includes('_u_')) { - const customFieldsKey = key.split('_').join('-'); + const customFieldsKey = camelCase(key); // Don't include undefined/null values if (value === undefined || value === null) { diff --git a/yarn.lock b/yarn.lock index 6770a22..ee4b77b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2897,7 +2897,7 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== -axios@^0.27.0, axios@^0.27.2: +axios@^0.27.0: version "0.27.2" resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== @@ -2905,6 +2905,15 @@ axios@^0.27.0, axios@^0.27.2: follow-redirects "^1.14.9" form-data "^4.0.0" +axios@^1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.2.tgz#b625db8a7051fbea61c35a3cbb3a1daa7b9c7621" + integrity sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + babel-jest@^29.6.2: version "29.6.2" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.2.tgz#cada0a59e07f5acaeb11cbae7e3ba92aec9c1126" @@ -4321,6 +4330,11 @@ follow-redirects@^1.14.9: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5" integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== +follow-redirects@^1.15.6: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + for-in@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -5743,7 +5757,7 @@ lodash.xor@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.xor/-/lodash.xor-4.5.0.tgz#4d48ed7e98095b0632582ba714d3ff8ae8fb1db6" integrity sha512-sVN2zimthq7aZ5sPGXnSz32rZPuqcparVW50chJQe+mzTYV+IsxSsl/2gnkWWE2Of7K3myBQBqtLKOUEHJKRsQ== -lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.5: +lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.5, lodash@~4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -6642,6 +6656,11 @@ proxy-addr@~2.0.5: forwarded "~0.1.2" ipaddr.js "1.9.1" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + psl@^1.1.28: version "1.9.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7"