Skip to content

Commit

Permalink
Merge pull request #158 from JupiterOne/int-10954-remove-unused-endpo…
Browse files Browse the repository at this point in the history
…ints

Remove unused ingestCommitRange and ingestEntities endpoints from client
  • Loading branch information
Nick-NCSU authored May 13, 2024
2 parents 4914a33 + 792b4fb commit 38685eb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 49 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
if: env.publish == 'true'
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
publish: ${{ env.publish }}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc
yarn
Expand Down
6 changes: 0 additions & 6 deletions src/index.new.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ describe('Core Index Tests', () => {
test('queryGraphQL', () => {
expect(j1).toHaveProperty('queryGraphQL');
});
test('ingestEntities', () => {
expect(j1).toHaveProperty('ingestEntities');
});
test('ingestCommitRange', () => {
expect(j1).toHaveProperty('ingestCommitRange');
});
test('mutateAlertRule', () => {
expect(j1).toHaveProperty('mutateAlertRule');
});
Expand Down
43 changes: 0 additions & 43 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,6 @@ export interface JupiterOneEntity {
properties: any;

Check warning on line 169 in src/index.ts

View workflow job for this annotation

GitHub Actions / test (18.x, ubuntu-latest)

Unexpected any. Specify a different type
}

export interface CommitRange {
account_uuid: string;
repo_uuid: string;
source: string;
destination: string;
}

export interface IngestionResults {
entities: object[];
}

export interface QueryResult {
id: string;
entity: object;
Expand Down Expand Up @@ -452,38 +441,6 @@ export class JupiterOneClient {
return res;
}

async ingestEntities(
integrationInstanceId: string,
entities: any[],
): Promise<IngestionResults> {
return fetch(this.apiUrl + '/integrations/ingest', {
method: 'POST',
body: JSON.stringify({ integrationInstanceId, entities }),
headers: {
'Content-Type': 'application/json',
...this.headers,
},
}).then((res: any) => res.json());
}

async ingestCommitRange(
integrationInstanceId: string,
commitRange: CommitRange,
): Promise<IngestionResults> {
return fetch(this.apiUrl + '/integrations/action', {
method: 'POST',
body: JSON.stringify({
integrationInstanceId,
action: { name: 'INGEST', commitRange },
}),
headers: {
'Content-Type': 'application/json',
...this.headers,
},
timeout: 10000,
}).then((res: any) => res.json());
}

async mutateAlertRule(rule: any, update: any) {

Check warning on line 444 in src/index.ts

View workflow job for this annotation

GitHub Actions / test (18.x, ubuntu-latest)

Unexpected any. Specify a different type

Check warning on line 444 in src/index.ts

View workflow job for this annotation

GitHub Actions / test (18.x, ubuntu-latest)

Unexpected any. Specify a different type
const inlineQuestion = !!rule.instance?.question;
let mutation;
Expand Down

0 comments on commit 38685eb

Please sign in to comment.