@jupiterone/integration-sdk-cli 6.20.0 → 6.21.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.
@@ -1 +1,2 @@
1
+ export declare function getDefaultQuestionFilePath(): string;
1
2
  export declare function validateQuestionFile(): import("commander").Command;
@@ -19,15 +19,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.validateQuestionFile = void 0;
22
+ exports.validateQuestionFile = exports.getDefaultQuestionFilePath = void 0;
23
23
  const commander_1 = require("commander");
24
24
  const log = __importStar(require("../log"));
25
25
  const managedQuestionFileValidator_1 = require("../questions/managedQuestionFileValidator");
26
26
  const integration_sdk_runtime_1 = require("@jupiterone/integration-sdk-runtime");
27
+ const path = __importStar(require("path"));
28
+ function getDefaultQuestionFilePath() {
29
+ return path.join(process.cwd(), './jupiterone/questions/questions.yaml');
30
+ }
31
+ exports.getDefaultQuestionFilePath = getDefaultQuestionFilePath;
27
32
  function validateQuestionFile() {
28
33
  return commander_1.createCommand('validate-question-file')
29
34
  .description('validates an integration questions file')
30
- .requiredOption('-p, --file-path <filePath>', 'absolute path to managed question file')
35
+ .requiredOption('-p, --file-path <filePath>', 'absolute path to managed question file', getDefaultQuestionFilePath())
31
36
  .option('-a, --jupiterone-account-id <jupiteroneAccountId>', 'J1 account ID used to validate J1QL queries')
32
37
  .option('-k, --jupiterone-api-key <jupiteroneApiKey>', 'J1 API key used to validate J1QL queries')
33
38
  .option('-d, --dry-run', 'skip making HTTP requests to validate J1QL queries')
@@ -1 +1 @@
1
- {"version":3,"file":"validate-question-file.js","sourceRoot":"","sources":["../../../src/commands/validate-question-file.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA0C;AAC1C,4CAA8B;AAE9B,4FAAwF;AACxF,iFAI6C;AAS7C,SAAgB,oBAAoB;IAClC,OAAO,yBAAa,CAAC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C;YACF,OAAO,EAAE,mBAAmB;YAC5B,WAAW,EAAE,gBAAgB;SAC9B,CAAC,CAAC;KACJ;IAED,IAAI;QACF,MAAM,0DAA2B,CAAC;YAChC,QAAQ;YACR,SAAS;SACV,CAAC,CAAC;KACJ;IAAC,OAAO,GAAG,EAAE;QACZ,GAAG,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;QACvD,MAAM,GAAG,CAAC;KACX;IAED,GAAG,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;AAC5D,CAAC"}
@@ -1372,8 +1372,8 @@
1372
1372
  "affectsGlobalScope": false
1373
1373
  },
1374
1374
  "../src/commands/validate-question-file.ts": {
1375
- "version": "5ce91db26acfce642156d0483e4b59efde57e50cb6c07ca750ac37885dccc58b",
1376
- "signature": "caba87047fc4a4679b7324addfb809f227daf842bb9f45e8686d084f03898dda",
1375
+ "version": "67605713b2583315c45336c2050f2090a9e21d69a2b951122d1e1f9f1cf44152",
1376
+ "signature": "b237124af9124a47b76ee4b091f374406854261c4e235dd6af1d863abf6740cf",
1377
1377
  "affectsGlobalScope": false
1378
1378
  },
1379
1379
  "../src/commands/index.ts": {
@@ -4023,6 +4023,7 @@
4023
4023
  "../src/commands/validate-question-file.ts": [
4024
4024
  "../../../node_modules/@types/graceful-fs/index.d.ts",
4025
4025
  "../../../node_modules/@types/node/fs.d.ts",
4026
+ "../../../node_modules/@types/node/path.d.ts",
4026
4027
  "../../../node_modules/@types/node/ts3.2/fs.d.ts",
4027
4028
  "../../../node_modules/@types/node/ts3.2/util.d.ts",
4028
4029
  "../../../node_modules/@types/node/util.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupiterone/integration-sdk-cli",
3
- "version": "6.20.0",
3
+ "version": "6.21.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",
@@ -22,7 +22,7 @@
22
22
  "prepack": "yarn build:dist"
23
23
  },
24
24
  "dependencies": {
25
- "@jupiterone/integration-sdk-runtime": "^6.20.0",
25
+ "@jupiterone/integration-sdk-runtime": "^6.21.0",
26
26
  "commander": "^5.0.0",
27
27
  "globby": "^11.0.0",
28
28
  "js-yaml": "^4.1.0",
@@ -34,7 +34,7 @@
34
34
  "vis": "^4.21.0-EOL"
35
35
  },
36
36
  "devDependencies": {
37
- "@jupiterone/integration-sdk-private-test-utils": "^6.20.0",
37
+ "@jupiterone/integration-sdk-private-test-utils": "^6.21.0",
38
38
  "@pollyjs/adapter-node-http": "^4.0.4",
39
39
  "@pollyjs/core": "^4.0.4",
40
40
  "@pollyjs/persister-fs": "^4.0.4",
@@ -48,5 +48,5 @@
48
48
  "memfs": "^3.2.0",
49
49
  "uuid": "^8.2.0"
50
50
  },
51
- "gitHead": "bdb35c07ee26f8d65037f5968c6895e1dce56351"
51
+ "gitHead": "ab626f6b32950e50ddcd19a05ff6318cda2e5a2e"
52
52
  }
@@ -1,5 +1,6 @@
1
1
  import * as path from 'path';
2
2
  import { createCli } from '../..';
3
+ import { getDefaultQuestionFilePath } from '../../commands';
3
4
 
4
5
  describe('j1-integration validate-question-file --dry-run', () => {
5
6
  test('should validate a provided question file', async () => {
@@ -13,3 +14,11 @@ describe('j1-integration validate-question-file --dry-run', () => {
13
14
  ]);
14
15
  });
15
16
  });
17
+
18
+ describe('#getDefaultQuestionFilePath', () => {
19
+ test('should return expected directory', () => {
20
+ expect(getDefaultQuestionFilePath()).toEqual(
21
+ path.join(process.cwd(), './jupiterone/questions/questions.yaml'),
22
+ );
23
+ });
24
+ });
@@ -7,6 +7,7 @@ import {
7
7
  createApiClient,
8
8
  getApiBaseUrl,
9
9
  } from '@jupiterone/integration-sdk-runtime';
10
+ import * as path from 'path';
10
11
 
11
12
  interface ValidateQuestionFileCommandArgs extends TypesCommandArgs {
12
13
  filePath: string;
@@ -15,12 +16,17 @@ interface ValidateQuestionFileCommandArgs extends TypesCommandArgs {
15
16
  dryRun?: boolean;
16
17
  }
17
18
 
19
+ export function getDefaultQuestionFilePath() {
20
+ return path.join(process.cwd(), './jupiterone/questions/questions.yaml');
21
+ }
22
+
18
23
  export function validateQuestionFile() {
19
24
  return createCommand('validate-question-file')
20
25
  .description('validates an integration questions file')
21
26
  .requiredOption(
22
27
  '-p, --file-path <filePath>',
23
28
  'absolute path to managed question file',
29
+ getDefaultQuestionFilePath(),
24
30
  )
25
31
  .option(
26
32
  '-a, --jupiterone-account-id <jupiteroneAccountId>',