@jupiterone/integration-sdk-cli 11.8.0 → 12.0.1-alpha.2

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": "11.8.0",
3
+ "version": "12.0.1-alpha.2+6492b01",
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": "^11.8.0",
29
- "@jupiterone/integration-sdk-runtime": "^11.8.0",
28
+ "@jupiterone/integration-sdk-core": "^12.0.1-alpha.2+6492b01",
29
+ "@jupiterone/integration-sdk-runtime": "^12.0.1-alpha.2+6492b01",
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": "^11.8.0",
46
+ "@jupiterone/integration-sdk-private-test-utils": "^12.0.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": "f1c33a3033fabef92015238f3e092ec2accc083f"
59
+ "gitHead": "6492b018b9cde226ac8e5cdcf7594e8d27aa183b"
60
60
  }
@@ -125,6 +125,9 @@ describe('collect', () => {
125
125
  partialTypes: [],
126
126
  encounteredTypes: ['test_account'],
127
127
  status: StepResultStatus.CACHED,
128
+ startTime: expect.any(Number),
129
+ endTime: expect.any(Number),
130
+ duration: expect.any(Number),
128
131
  },
129
132
  {
130
133
  id: 'fetch-groups',
@@ -134,6 +137,9 @@ describe('collect', () => {
134
137
  partialTypes: [],
135
138
  encounteredTypes: [],
136
139
  status: StepResultStatus.SUCCESS,
140
+ startTime: expect.any(Number),
141
+ endTime: expect.any(Number),
142
+ duration: expect.any(Number),
137
143
  },
138
144
  {
139
145
  id: 'fetch-users',
@@ -166,6 +172,9 @@ describe('collect', () => {
166
172
  partialTypes: [],
167
173
  encounteredTypes: [],
168
174
  status: StepResultStatus.SUCCESS,
175
+ startTime: expect.any(Number),
176
+ endTime: expect.any(Number),
177
+ duration: expect.any(Number),
169
178
  },
170
179
  {
171
180
  id: 'fetch-groups',
@@ -175,6 +184,9 @@ describe('collect', () => {
175
184
  partialTypes: [],
176
185
  encounteredTypes: [],
177
186
  status: StepResultStatus.SUCCESS,
187
+ startTime: expect.any(Number),
188
+ endTime: expect.any(Number),
189
+ duration: expect.any(Number),
178
190
  },
179
191
  {
180
192
  id: 'fetch-users',
@@ -183,6 +195,9 @@ describe('collect', () => {
183
195
  partialTypes: [],
184
196
  encounteredTypes: [],
185
197
  status: StepResultStatus.SUCCESS,
198
+ startTime: expect.any(Number),
199
+ endTime: expect.any(Number),
200
+ duration: expect.any(Number),
186
201
  },
187
202
  ],
188
203
  metadata: {
@@ -212,6 +227,9 @@ describe('collect', () => {
212
227
  partialTypes: [],
213
228
  encounteredTypes: [],
214
229
  status: StepResultStatus.FAILURE,
230
+ startTime: expect.any(Number),
231
+ endTime: expect.any(Number),
232
+ duration: expect.any(Number),
215
233
  },
216
234
  ],
217
235
  metadata: {
@@ -240,6 +258,9 @@ describe('collect', () => {
240
258
  partialTypes: [],
241
259
  encounteredTypes: ['my_user'],
242
260
  status: StepResultStatus.SUCCESS,
261
+ startTime: expect.any(Number),
262
+ endTime: expect.any(Number),
263
+ duration: expect.any(Number),
243
264
  },
244
265
  ],
245
266
  metadata: {
@@ -288,6 +309,9 @@ describe('collect', () => {
288
309
  partialTypes: [],
289
310
  encounteredTypes: [],
290
311
  status: StepResultStatus.SUCCESS,
312
+ startTime: expect.any(Number),
313
+ endTime: expect.any(Number),
314
+ duration: expect.any(Number),
291
315
  },
292
316
  ],
293
317
  metadata: {
@@ -319,6 +343,9 @@ describe('collect', () => {
319
343
  partialTypes: [],
320
344
  encounteredTypes: [],
321
345
  status: StepResultStatus.SUCCESS,
346
+ startTime: expect.any(Number),
347
+ endTime: expect.any(Number),
348
+ duration: expect.any(Number),
322
349
  },
323
350
  {
324
351
  id: 'fetch-groups',
@@ -336,6 +363,9 @@ describe('collect', () => {
336
363
  partialTypes: [],
337
364
  encounteredTypes: [],
338
365
  status: StepResultStatus.SUCCESS,
366
+ startTime: expect.any(Number),
367
+ endTime: expect.any(Number),
368
+ duration: expect.any(Number),
339
369
  },
340
370
  ],
341
371
  metadata: {
@@ -369,6 +399,9 @@ describe('collect', () => {
369
399
  partialTypes: [],
370
400
  encounteredTypes: [],
371
401
  status: StepResultStatus.SUCCESS,
402
+ startTime: expect.any(Number),
403
+ endTime: expect.any(Number),
404
+ duration: expect.any(Number),
372
405
  },
373
406
  {
374
407
  id: 'fetch-groups',
@@ -386,6 +419,9 @@ describe('collect', () => {
386
419
  partialTypes: [],
387
420
  encounteredTypes: [],
388
421
  status: StepResultStatus.SUCCESS,
422
+ startTime: expect.any(Number),
423
+ endTime: expect.any(Number),
424
+ duration: expect.any(Number),
389
425
  },
390
426
  ],
391
427
  metadata: {
@@ -416,6 +452,9 @@ describe('collect', () => {
416
452
  partialTypes: [],
417
453
  encounteredTypes: [],
418
454
  status: StepResultStatus.SUCCESS,
455
+ startTime: expect.any(Number),
456
+ endTime: expect.any(Number),
457
+ duration: expect.any(Number),
419
458
  },
420
459
  {
421
460
  id: 'fetch-groups',
@@ -425,6 +464,9 @@ describe('collect', () => {
425
464
  partialTypes: [],
426
465
  encounteredTypes: [],
427
466
  status: StepResultStatus.SUCCESS,
467
+ startTime: expect.any(Number),
468
+ endTime: expect.any(Number),
469
+ duration: expect.any(Number),
428
470
  },
429
471
  {
430
472
  id: 'fetch-users',
@@ -90,10 +90,17 @@ function newIntegration(plop: NodePlopAPI) {
90
90
  return [];
91
91
  }
92
92
 
93
+ // @jupiterone/graph-foo -> graph-foo
94
+ // graph-foo -> graph-foo
95
+ const directoryName = path.join(
96
+ process.cwd(),
97
+ path.basename(data.packageName),
98
+ );
99
+
93
100
  const actions: any[] = [];
94
101
  actions.push({
95
102
  type: 'addMany',
96
- destination: '.',
103
+ destination: directoryName,
97
104
  base: path.join(__dirname, '/template'),
98
105
  templateFiles: path.join(__dirname + '/template/**'),
99
106
  globOptions: { dot: true },
@@ -104,7 +111,10 @@ function newIntegration(plop: NodePlopAPI) {
104
111
  for (const step of data.steps) {
105
112
  actions.push({
106
113
  type: 'add',
107
- path: path.normalize(`src/steps/${kebabCase(step.name)}/index.ts`),
114
+ path: path.join(
115
+ directoryName,
116
+ path.normalize(`src/steps/${kebabCase(step.name)}/index.ts`),
117
+ ),
108
118
  templateFile: path.join(__dirname, 'stepTemplate/index.ts.hbs'),
109
119
  data: step,
110
120
  force: true,
@@ -113,19 +123,19 @@ function newIntegration(plop: NodePlopAPI) {
113
123
 
114
124
  actions.push({
115
125
  type: 'yarnInstall',
116
- path: '.',
126
+ path: directoryName,
117
127
  verbose: true,
118
128
  });
119
129
 
120
130
  actions.push({
121
131
  type: 'yarnFormat',
122
- path: '.',
132
+ path: directoryName,
123
133
  verbose: true,
124
134
  });
125
135
 
126
136
  actions.push({
127
137
  type: 'yarnLint',
128
- path: '.',
138
+ path: directoryName,
129
139
  verbose: true,
130
140
  });
131
141
 
@@ -27,27 +27,3 @@ jobs:
27
27
 
28
28
  - name: Run build
29
29
  run: yarn build
30
-
31
- # Publishing is done in a separate job to allow
32
- # for all matrix builds to complete.
33
- BuildRelease:
34
- needs: test
35
- runs-on: ubuntu-latest
36
- if: github.ref == 'refs/heads/main'
37
- name: Checkout Code
38
- steps:
39
- - name: Check out repo
40
- uses: actions/checkout@v3
41
- with:
42
- fetch-depth: 0
43
- token: $\{{ secrets.AUTO_GITHUB_PAT_TOKEN }}
44
- - name: Setup Node
45
- uses: actions/setup-node@v3
46
- with:
47
- node-version: 18.x
48
- cache: yarn
49
- - name: Build and Release
50
- uses: jupiterone/action-npm-build-release@v1
51
- with:
52
- npm_auth_token: $\{{ secrets.NPM_AUTH_TOKEN }}
53
- gh_token: $\{{ secrets.AUTO_GITHUB_PAT_TOKEN }}
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "{{packageName}}",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "description": "{{packageDescription}}",
5
5
  "license": "MPL-2.0",
6
- "main": "src/index.js",
7
- "types": "src/index.d.ts",
6
+ "main": "dist/src/index.js",
7
+ "types": "dist/src/index.d.ts",
8
8
  "files": [
9
9
  "src",
10
10
  "jupiterone"
@@ -13,7 +13,7 @@
13
13
  "access": "public"
14
14
  },
15
15
  "engines": {
16
- "node": ">=18.0.0 <19.x"
16
+ "node": ">=18.0.0 <20.x"
17
17
  },
18
18
  "scripts": {
19
19
  "start": "j1-integration collect",
@@ -36,28 +36,11 @@
36
36
  "postversion": "cp package.json ./dist/package.json"
37
37
  },
38
38
  "peerDependencies": {
39
- "@jupiterone/integration-sdk-core": "^10.5.0"
39
+ "@jupiterone/integration-sdk-core": "^12.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@jupiterone/integration-sdk-core": "^10.5.0",
43
- "@jupiterone/integration-sdk-dev-tools": "^10.5.0",
44
- "@jupiterone/integration-sdk-testing": "^10.5.0",
45
- "auto": "^10.36.5"
46
- },
47
- "auto": {
48
- "plugins": [
49
- [
50
- "npm",
51
- {
52
- "setRcToken": false,
53
- "publishFolder": "./dist"
54
- }
55
- ],
56
- "released"
57
- ],
58
- "onlyPublishWithReleaseLabel": true,
59
- "shipit": {
60
- "prerelease": false
61
- }
42
+ "@jupiterone/integration-sdk-core": "^12.0.0",
43
+ "@jupiterone/integration-sdk-dev-tools": "^12.0.0",
44
+ "@jupiterone/integration-sdk-testing": "^12.0.0",
62
45
  }
63
46
  }
@@ -1,69 +0,0 @@
1
- # For most projects, this workflow file will not need changing; you simply need
2
- # to commit it to your repository.
3
- #
4
- # You may wish to alter this file to override the set of languages analyzed,
5
- # or to provide custom queries or build logic.
6
- #
7
- # ******** NOTE ********
8
- # We have attempted to detect the languages in your repository. Please check
9
- # the `language` matrix defined below to confirm you have the correct set of
10
- # supported CodeQL languages.
11
- #
12
- name: 'CodeQL'
13
-
14
- on:
15
- push:
16
- branches: ['main']
17
- pull_request:
18
- # The branches below must be a subset of the branches above
19
- branches: ['main']
20
-
21
- jobs:
22
- analyze:
23
- name: Analyze
24
- runs-on: ubuntu-latest
25
- permissions:
26
- actions: read
27
- contents: read
28
- security-events: write
29
-
30
- strategy:
31
- fail-fast: false
32
- matrix:
33
- language: ['javascript']
34
- # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
35
- # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
36
-
37
- steps:
38
- - name: Checkout repository
39
- uses: actions/checkout@v3
40
-
41
- # Initializes the CodeQL tools for scanning.
42
- - name: Initialize CodeQL
43
- uses: github/codeql-action/init@v2
44
- with:
45
- languages: $\{{ matrix.language }}
46
- # If you wish to specify custom queries, you can do so here or in a config file.
47
- # By default, queries listed here will override any specified in a config file.
48
- # Prefix the list here with "+" to use these queries and those in the config file.
49
-
50
- # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
51
- queries: security-extended,security-and-quality
52
-
53
- # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54
- # If this step fails, then you should remove it and run the build manually (see below)
55
- - name: Autobuild
56
- uses: github/codeql-action/autobuild@v2
57
-
58
- # ℹ️ Command-line programs to run using the OS shell.
59
- # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
60
-
61
- # If the Autobuild fails above, remove it and uncomment the following three lines.
62
- # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
63
-
64
- # - run: |
65
- # echo "Run, Build Application using script"
66
- # ./location_of_script_within_repo/buildscript.sh
67
-
68
- - name: Perform CodeQL Analysis
69
- uses: github/codeql-action/analyze@v2
@@ -1,36 +0,0 @@
1
- name: J1 Integration deployment
2
-
3
- on:
4
- release:
5
- types:
6
- - published
7
-
8
- jobs:
9
- j1-integration-deployment:
10
- runs-on: ubuntu-latest
11
- steps:
12
- - name: Get integration name
13
- id: get-integration-name
14
- uses: actions/github-script@0.9.0
15
- with:
16
- script: |
17
- const repositoryName = context.payload.repository.name
18
- const integrationName = repositoryName.replace("graph-", "")
19
- core.setOutput('integrationName', integrationName)
20
- - name: Get version number
21
- id: get-version-number
22
- uses: actions/github-script@0.9.0
23
- with:
24
- script: |
25
- const tagName = context.payload.release.tag_name
26
- const versionNumber = tagName.replace("v", "")
27
- core.setOutput('versionNumber', versionNumber)
28
- - name: Bump integration deployment version
29
- uses: JupiterOne/integration-github-actions/create-integration-deployment@v1
30
- with:
31
- integrationName:
32
- $\{{ steps.get-integration-name.outputs.integrationName }}
33
- releaseNotes: $\{{ github.event.release.body }}
34
- version: $\{{ steps.get-version-number.outputs.versionNumber }}
35
- githubToken: $\{{ secrets.AUTO_GITHUB_PAT_TOKEN }}
36
- npmAuthToken: $\{{ secrets.NPM_AUTH_TOKEN }}
@@ -1,90 +0,0 @@
1
- name: 'Peril'
2
-
3
- on:
4
- pull_request:
5
-
6
- env:
7
- TRANSPONDER_DOCKER_IMAGE: 081157560428.dkr.ecr.us-east-1.amazonaws.com/transponder:1
8
- SECURITY_SCAN_IMAGE: ghcr.io/jupiterone/security-scan:latest
9
-
10
- jobs:
11
- Peril:
12
- name: Peril
13
- permissions:
14
- id-token: write
15
- contents: read
16
- packages: read
17
- runs-on: ubuntu-latest
18
-
19
- steps:
20
- - name: Checkout
21
- uses: actions/checkout@v3
22
-
23
- - name: Setup Node
24
- uses: actions/setup-node@v1
25
- with:
26
- node-version: 18.x
27
-
28
- - name: Run build
29
- run: yarn install
30
-
31
- - name: Get Variables
32
- id: get-vars
33
- run: |
34
- if [[ "${GITHUB_REF}" == 'ref/head/main' && "${GITHUB_EVENT_NAME}" == 'push' ]];
35
- then
36
- echo ::set-output name=aws-oidc-role::arn:aws:iam::081157560428:role/github-main-role
37
- else
38
- echo ::set-output name=aws-oidc-role::arn:aws:iam::081157560428:role/github-pull-request-role
39
- fi
40
-
41
- - name: Configure aws credentials
42
- uses: aws-actions/configure-aws-credentials@v1
43
- with:
44
- role-to-assume: $\{{ steps.get-vars.outputs.aws-oidc-role }}
45
- role-session-name: pr-role-session
46
- aws-region: us-east-1
47
-
48
- - name: ECR login
49
- uses: aws-actions/amazon-ecr-login@v1
50
- id: amazon-ecr-login
51
-
52
- - name: Login to GHCR
53
- uses: docker/login-action@v2
54
- with:
55
- registry: ghcr.io
56
- username: $\{{ github.actor }}
57
- password: $\{{ secrets.PACKAGE_TOKEN }}
58
-
59
- - name: Pull security-scan
60
- run: |
61
- docker pull $SECURITY_SCAN_IMAGE
62
-
63
- - name: Run security-scan
64
- run: |
65
- docker run \
66
- --user root \
67
- -v /var/run/docker.sock:/var/run/docker.sock \
68
- -v `pwd`:`pwd` \
69
- -e AWS_ACCESS_KEY_ID=$\{{ env.AWS_ACCESS_KEY_ID }} \
70
- -e AWS_SECRET_ACCESS_KEY=$\{{ env.AWS_SECRET_ACCESS_KEY }} \
71
- -e AWS_SESSION_TOKEN=$\{{ env.AWS_SESSION_TOKEN }} \
72
- -e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
73
- -e GITHUB_REF_NAME=$GITHUB_REF_NAME \
74
- -e GITHUB_RUN_NUMBER=$GITHUB_RUN_NUMBER \
75
- -e GITHUB_SERVER_URL=$GITHUB_SERVER_URL \
76
- -e GITHUB_RUN_ID=$GITHUB_RUN_ID \
77
- -e MODE=ci \
78
- -w `pwd` $SECURITY_SCAN_IMAGE
79
-
80
- - name: Pull transponder
81
- run: |
82
- docker pull $TRANSPONDER_DOCKER_IMAGE
83
-
84
- - name: Run transponder
85
- run: |
86
- docker run --rm -v `pwd`:`pwd` -w `pwd` \
87
- -e J1_API_KEY=$\{{ secrets.J1_API_KEY_TRANSPONDER }} \
88
- -e J1_API_DOMAIN=$\{{ secrets.J1_API_DOMAIN_TRANSPONDER }} \
89
- -e J1_ACCOUNT_ID=$\{{ secrets.J1_ACCOUNT_ID_TRANSPONDER }} \
90
- $TRANSPONDER_DOCKER_IMAGE
@@ -1,69 +0,0 @@
1
- # For most projects, this workflow file will not need changing; you simply need
2
- # to commit it to your repository.
3
- #
4
- # You may wish to alter this file to override the set of languages analyzed,
5
- # or to provide custom queries or build logic.
6
- #
7
- # ******** NOTE ********
8
- # We have attempted to detect the languages in your repository. Please check
9
- # the `language` matrix defined below to confirm you have the correct set of
10
- # supported CodeQL languages.
11
- #
12
- name: 'CodeQL'
13
-
14
- on:
15
- push:
16
- branches: ['main']
17
- pull_request:
18
- # The branches below must be a subset of the branches above
19
- branches: ['main']
20
-
21
- jobs:
22
- analyze:
23
- name: Analyze
24
- runs-on: ubuntu-latest
25
- permissions:
26
- actions: read
27
- contents: read
28
- security-events: write
29
-
30
- strategy:
31
- fail-fast: false
32
- matrix:
33
- language: ['javascript']
34
- # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
35
- # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
36
-
37
- steps:
38
- - name: Checkout repository
39
- uses: actions/checkout@v3
40
-
41
- # Initializes the CodeQL tools for scanning.
42
- - name: Initialize CodeQL
43
- uses: github/codeql-action/init@v2
44
- with:
45
- languages: $\{{ matrix.language }}
46
- # If you wish to specify custom queries, you can do so here or in a config file.
47
- # By default, queries listed here will override any specified in a config file.
48
- # Prefix the list here with "+" to use these queries and those in the config file.
49
-
50
- # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
51
- queries: security-extended,security-and-quality
52
-
53
- # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54
- # If this step fails, then you should remove it and run the build manually (see below)
55
- - name: Autobuild
56
- uses: github/codeql-action/autobuild@v2
57
-
58
- # ℹ️ Command-line programs to run using the OS shell.
59
- # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
60
-
61
- # If the Autobuild fails above, remove it and uncomment the following three lines.
62
- # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
63
-
64
- # - run: |
65
- # echo "Run, Build Application using script"
66
- # ./location_of_script_within_repo/buildscript.sh
67
-
68
- - name: Perform CodeQL Analysis
69
- uses: github/codeql-action/analyze@v2
@@ -1,36 +0,0 @@
1
- name: J1 Integration deployment
2
-
3
- on:
4
- release:
5
- types:
6
- - published
7
-
8
- jobs:
9
- j1-integration-deployment:
10
- runs-on: ubuntu-latest
11
- steps:
12
- - name: Get integration name
13
- id: get-integration-name
14
- uses: actions/github-script@0.9.0
15
- with:
16
- script: |
17
- const repositoryName = context.payload.repository.name
18
- const integrationName = repositoryName.replace("graph-", "")
19
- core.setOutput('integrationName', integrationName)
20
- - name: Get version number
21
- id: get-version-number
22
- uses: actions/github-script@0.9.0
23
- with:
24
- script: |
25
- const tagName = context.payload.release.tag_name
26
- const versionNumber = tagName.replace("v", "")
27
- core.setOutput('versionNumber', versionNumber)
28
- - name: Bump integration deployment version
29
- uses: JupiterOne/integration-github-actions/create-integration-deployment@v1
30
- with:
31
- integrationName:
32
- $\{{ steps.get-integration-name.outputs.integrationName }}
33
- releaseNotes: $\{{ github.event.release.body }}
34
- version: $\{{ steps.get-version-number.outputs.versionNumber }}
35
- githubToken: $\{{ secrets.AUTO_GITHUB_PAT_TOKEN }}
36
- npmAuthToken: $\{{ secrets.NPM_AUTH_TOKEN }}