Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #55 from JupiterOne/custom-fields
Browse files Browse the repository at this point in the history
Custom Field Casing
  • Loading branch information
VDubber authored Jul 24, 2024
2 parents 29bfd84 + 4a1dde8 commit ef2d9eb
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 23 deletions.
12 changes: 0 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
12 changes: 6 additions & 6 deletions src/steps/cmdb/__snapshots__/converters.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
3 changes: 2 additions & 1 deletion src/steps/cmdb/converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) {
Expand Down
23 changes: 21 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2897,14 +2897,23 @@ 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==
dependencies:
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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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==
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit ef2d9eb

Please sign in to comment.