Skip to content

Commit

Permalink
Merge branch 'main' into add_event_code
Browse files Browse the repository at this point in the history
  • Loading branch information
civan committed Sep 19, 2023
2 parents 01cd8c2 + 2da7049 commit 7485b2a
Show file tree
Hide file tree
Showing 41 changed files with 261 additions and 272 deletions.
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,39 @@ and this project adheres to

## Unreleased

## 10.5.3 - 2023-09-18

- Use the same logger for all logs created via the `j1-integration run` command
to improve formatting consistency
- Update internal `err` log serializer

## 10.5.2 - 2023-09-14

- Improvements to integration graph generator

## 10.5.0 - 2023-09-12

- Add `error_unexpected_error` to IntegrationErrorEventName

## 10.4.0 - 2023-09-11

- Revert change in 10.1.0 due to system health issues

## 10.3.0 - 2023-09-07

- Update `jest.js` config to remove deprecated option.
- Add `--noPretty` option to cli to disable pretty printing of logs locally.

## 10.2.0 - 2023-09-01

- Allow user to override `AlphaOptions` in `createApiClient`

## 10.1.0 - 2023-08-28

- 'InMemoryGraphObjectStore' no longer stores a set amount of entities or
relationships, rather it works by measuring size in bytes of graph objects by
default.

## 10.0.0 - 2023-08-03

- Bump TypeScript, ESLint, and Prettier to next major versions. Integration
Expand Down
8 changes: 8 additions & 0 deletions docs/integrations/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,10 @@ ex: `j1-integration collect --step step-fetch-users --cache-path ./my-cache`

Disables schema validation.

###### Option `--noPretty`

Disables pretty printing of logs and collected data.

#### Command `j1-integration sync`

Validates data collected by the `collect` command and uploads it to JupiterOne.
Expand Down Expand Up @@ -1558,6 +1562,10 @@ Cannot be used with the `--development` flag.
ex:
`yarn j1-integration sync --integrationInstanceId <integration instance id> --api-base-url <api base url>`

###### Option `--noPretty`

Disables pretty printing of logs.

#### Command `j1-integration run`

The `j1-integration run` command combines the functionality of the `collect` and
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"packages/integration-sdk-*",
"packages/cli"
],
"version": "10.1.0"
"version": "10.5.3"
}
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jupiterone/cli",
"version": "10.1.0",
"version": "10.5.3",
"description": "The JupiterOne cli",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand All @@ -24,8 +24,8 @@
"test": "jest"
},
"dependencies": {
"@jupiterone/integration-sdk-core": "^10.1.0",
"@jupiterone/integration-sdk-runtime": "^10.1.0",
"@jupiterone/integration-sdk-core": "^10.5.3",
"@jupiterone/integration-sdk-runtime": "^10.5.3",
"@lifeomic/attempt": "^3.0.3",
"commander": "^5.0.0",
"globby": "^11.0.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/integration-sdk-benchmark/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jupiterone/integration-sdk-benchmark",
"version": "10.1.0",
"version": "10.5.3",
"private": true,
"description": "SDK benchmarking scripts",
"main": "./src/index.js",
Expand All @@ -15,8 +15,8 @@
"benchmark": "for file in ./src/benchmarks/*; do yarn prebenchmark && node $file; done"
},
"dependencies": {
"@jupiterone/integration-sdk-core": "^10.1.0",
"@jupiterone/integration-sdk-runtime": "^10.1.0",
"@jupiterone/integration-sdk-core": "^10.5.3",
"@jupiterone/integration-sdk-runtime": "^10.5.3",
"benchmark": "^2.1.4"
}
}
15 changes: 12 additions & 3 deletions packages/integration-sdk-cli/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# @jupiterone/integration-sdk-cli

_NOTE:_ This project is currently under development and the API interface is not
stable. Use at your own risk.

This package exposes a CLI tool that assists with executing integrations
locally.

## Integration graph generator

Create a git repository for your integration graph with
`graph-(integrationName)` name and execute the following command inside it:

```
npx @jupiterone/integration-sdk-cli generate
```

You will be prompted with some questions and the graph code will be generated so
you can start development.

## Installation

```
Expand Down
8 changes: 4 additions & 4 deletions packages/integration-sdk-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jupiterone/integration-sdk-cli",
"version": "10.1.0",
"version": "10.5.3",
"description": "The SDK for developing JupiterOne integrations",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand All @@ -25,8 +25,8 @@
},
"dependencies": {
"@jupiterone/data-model": "^0.54.0",
"@jupiterone/integration-sdk-core": "^10.1.0",
"@jupiterone/integration-sdk-runtime": "^10.1.0",
"@jupiterone/integration-sdk-core": "^10.5.3",
"@jupiterone/integration-sdk-runtime": "^10.5.3",
"chalk": "^4",
"commander": "^9.4.0",
"fs-extra": "^10.1.0",
Expand All @@ -44,7 +44,7 @@
"vis": "^4.21.0-EOL"
},
"devDependencies": {
"@jupiterone/integration-sdk-private-test-utils": "^10.1.0",
"@jupiterone/integration-sdk-private-test-utils": "^10.5.3",
"@pollyjs/adapter-node-http": "^6.0.5",
"@pollyjs/core": "^6.0.5",
"@pollyjs/persister-fs": "^6.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import { Polly } from '@pollyjs/core';
import NodeHttpAdapter from '@pollyjs/adapter-node-http';
import FSPersister from '@pollyjs/persister-fs';
import { loadProjectStructure } from '@jupiterone/integration-sdk-private-test-utils';
import { SynchronizationJobStatus } from '@jupiterone/integration-sdk-core';
import { generateSynchronizationJob } from './util/synchronization';
import { createCli } from '../index';
import { setupSynchronizerApi } from './util/synchronization';
import * as log from '../log';
import { createTestPolly } from './util/recording';

jest.mock('../log');
Expand Down Expand Up @@ -37,17 +35,20 @@ test('aborts synchronization job if an error occurs', async () => {

setupSynchronizerApi({ polly, job, baseUrl: 'https://api.us.jupiterone.io' });

let calledAbort = false;
polly.server
.post(
`https://api.us.jupiterone.io/persister/synchronization/jobs/${job.id}/abort`,
)
.intercept((req, res) => {
calledAbort = true;
});
await createCli().parseAsync([
'node',
'j1-integration',
'run',
'--integrationInstanceId',
'test',
]);

expect(log.displaySynchronizationResults).toHaveBeenCalledTimes(1);
expect(log.displaySynchronizationResults).toHaveBeenCalledWith({
...job,
status: SynchronizationJobStatus.ABORTED,
});
expect(calledAbort).toBe(true);
});
Loading

0 comments on commit 7485b2a

Please sign in to comment.