@jupiterone/integration-sdk-cli 12.1.0 → 12.2.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupiterone/integration-sdk-cli",
3
- "version": "12.1.0",
3
+ "version": "12.2.0",
4
4
  "description": "The SDK for developing JupiterOne integrations",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -25,8 +25,8 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@jupiterone/data-model": "^0.54.0",
28
- "@jupiterone/integration-sdk-core": "^12.1.0",
29
- "@jupiterone/integration-sdk-runtime": "^12.1.0",
28
+ "@jupiterone/integration-sdk-core": "^12.2.0",
29
+ "@jupiterone/integration-sdk-runtime": "^12.2.0",
30
30
  "chalk": "^4",
31
31
  "commander": "^9.4.0",
32
32
  "fs-extra": "^10.1.0",
@@ -43,7 +43,7 @@
43
43
  "url-exists": "^1.0.3"
44
44
  },
45
45
  "devDependencies": {
46
- "@jupiterone/integration-sdk-private-test-utils": "^12.1.0",
46
+ "@jupiterone/integration-sdk-private-test-utils": "^12.2.0",
47
47
  "@pollyjs/adapter-node-http": "^6.0.5",
48
48
  "@pollyjs/core": "^6.0.5",
49
49
  "@pollyjs/persister-fs": "^6.0.5",
@@ -56,5 +56,5 @@
56
56
  "neo-forgery": "^2.0.0",
57
57
  "vis": "^4.21.0-EOL"
58
58
  },
59
- "gitHead": "6f1fbc96e463d7d940fdc515d627fb48afb4267d"
59
+ "gitHead": "6f25f9c404afa7c8375e2b7e31763f8b420d9ffc"
60
60
  }
@@ -35,12 +35,15 @@
35
35
  "prepush": "yarn format:check && yarn lint && yarn type-check && jest --changedSince main",
36
36
  "postversion": "cp package.json ./dist/package.json"
37
37
  },
38
+ "dependencies": {
39
+ "@jupiterone/integration-sdk-http-client": "^12.0.0"
40
+ },
38
41
  "peerDependencies": {
39
42
  "@jupiterone/integration-sdk-core": "^12.0.0"
40
43
  },
41
44
  "devDependencies": {
42
45
  "@jupiterone/integration-sdk-core": "^12.0.0",
43
46
  "@jupiterone/integration-sdk-dev-tools": "^12.0.0",
44
- "@jupiterone/integration-sdk-testing": "^12.0.0",
47
+ "@jupiterone/integration-sdk-testing": "^12.0.0"
45
48
  }
46
49
  }
@@ -1,4 +1,6 @@
1
+ import { BaseAPIClient } from '@jupiterone/integration-sdk-http-client';
1
2
  import { IntegrationConfig } from './config';
3
+ import { IntegrationLogger } from '@jupiterone/integration-sdk-core';
2
4
 
3
5
  export type ResourceIteratee<T> = (each: T) => Promise<void> | void;
4
6
 
@@ -10,14 +12,25 @@ export type ResourceIteratee<T> = (each: T) => Promise<void> | void;
10
12
  * place to handle error responses and implement common patterns for iterating
11
13
  * resources.
12
14
  */
13
- export class APIClient {
14
- constructor(readonly config: IntegrationConfig) { }
15
+ export class APIClient extends BaseAPIClient {
16
+ constructor(readonly config: IntegrationConfig, readonly logger: IntegrationLogger) {
17
+ super({
18
+ baseUrl: 'https://example.com/api',
19
+ logger,
20
+ });
21
+ }
22
+
23
+ getAuthorizationHeaders() {
24
+ return {
25
+ Authorization: `Bearer ${this.config.apiKey}`,
26
+ };
27
+ }
15
28
 
16
29
  public async verifyAuthentication(): Promise<void> {
17
30
  return Promise.resolve();
18
31
  }
19
32
  }
20
33
 
21
- export function createAPIClient(config: IntegrationConfig): APIClient {
22
- return new APIClient(config);
34
+ export function createAPIClient(config: IntegrationConfig, logger: IntegrationLogger): APIClient {
35
+ return new APIClient(config, logger);
23
36
  }