@jupiterone/integration-sdk-cli 10.5.1 → 10.5.3

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.
Files changed (27) hide show
  1. package/README.md +12 -3
  2. package/dist/src/commands/run.js +9 -32
  3. package/dist/src/commands/run.js.map +1 -1
  4. package/dist/src/generator/template/.github/workflows/build.yml.hbs +3 -3
  5. package/dist/src/generator/template/.github/workflows/codeql-analysis.yml.hbs +1 -1
  6. package/dist/src/generator/template/.github/workflows/integration-deployment.yml.hbs +5 -5
  7. package/dist/src/generator/template/.github/workflows/peril.yml.hbs +9 -9
  8. package/dist/src/generator/template/.github/workflows/questions.yml.hbs +4 -4
  9. package/dist/src/generator/template/package.json.hbs +4 -4
  10. package/dist/src/generator/template/src/config.ts.hbs +3 -4
  11. package/dist/src/generator/template/src/steps/constants.ts.hbs +6 -8
  12. package/dist/src/neo4j/neo4jGraphStore.js +5 -2
  13. package/dist/src/neo4j/neo4jGraphStore.js.map +1 -1
  14. package/dist/tsconfig.dist.tsbuildinfo +1 -1
  15. package/package.json +5 -5
  16. package/src/__tests__/cli-run-failure.test.ts +9 -8
  17. package/src/__tests__/cli-run.test.ts +22 -140
  18. package/src/__tests__/util/synchronization.ts +8 -2
  19. package/src/commands/run.ts +18 -13
  20. package/src/generator/template/.github/workflows/build.yml.hbs +3 -3
  21. package/src/generator/template/.github/workflows/codeql-analysis.yml.hbs +1 -1
  22. package/src/generator/template/.github/workflows/integration-deployment.yml.hbs +5 -5
  23. package/src/generator/template/.github/workflows/peril.yml.hbs +9 -9
  24. package/src/generator/template/.github/workflows/questions.yml.hbs +4 -4
  25. package/src/generator/template/package.json.hbs +4 -4
  26. package/src/generator/template/src/config.ts.hbs +3 -4
  27. package/src/generator/template/src/steps/constants.ts.hbs +6 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupiterone/integration-sdk-cli",
3
- "version": "10.5.1",
3
+ "version": "10.5.3",
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": "^10.5.1",
29
- "@jupiterone/integration-sdk-runtime": "^10.5.1",
28
+ "@jupiterone/integration-sdk-core": "^10.5.3",
29
+ "@jupiterone/integration-sdk-runtime": "^10.5.3",
30
30
  "chalk": "^4",
31
31
  "commander": "^9.4.0",
32
32
  "fs-extra": "^10.1.0",
@@ -44,7 +44,7 @@
44
44
  "vis": "^4.21.0-EOL"
45
45
  },
46
46
  "devDependencies": {
47
- "@jupiterone/integration-sdk-private-test-utils": "^10.5.1",
47
+ "@jupiterone/integration-sdk-private-test-utils": "^10.5.3",
48
48
  "@pollyjs/adapter-node-http": "^6.0.5",
49
49
  "@pollyjs/core": "^6.0.5",
50
50
  "@pollyjs/persister-fs": "^6.0.5",
@@ -56,5 +56,5 @@
56
56
  "memfs": "^3.2.0",
57
57
  "neo-forgery": "^2.0.0"
58
58
  },
59
- "gitHead": "406470a2527bbf21bebbee2bea92ec225e9a4cc0"
59
+ "gitHead": "2da70497bf162ac93aac6538ae426f348b582fbd"
60
60
  }
@@ -2,11 +2,9 @@ import { Polly } from '@pollyjs/core';
2
2
  import NodeHttpAdapter from '@pollyjs/adapter-node-http';
3
3
  import FSPersister from '@pollyjs/persister-fs';
4
4
  import { loadProjectStructure } from '@jupiterone/integration-sdk-private-test-utils';
5
- import { SynchronizationJobStatus } from '@jupiterone/integration-sdk-core';
6
5
  import { generateSynchronizationJob } from './util/synchronization';
7
6
  import { createCli } from '../index';
8
7
  import { setupSynchronizerApi } from './util/synchronization';
9
- import * as log from '../log';
10
8
  import { createTestPolly } from './util/recording';
11
9
 
12
10
  jest.mock('../log');
@@ -37,6 +35,14 @@ test('aborts synchronization job if an error occurs', async () => {
37
35
 
38
36
  setupSynchronizerApi({ polly, job, baseUrl: 'https://api.us.jupiterone.io' });
39
37
 
38
+ let calledAbort = false;
39
+ polly.server
40
+ .post(
41
+ `https://api.us.jupiterone.io/persister/synchronization/jobs/${job.id}/abort`,
42
+ )
43
+ .intercept((req, res) => {
44
+ calledAbort = true;
45
+ });
40
46
  await createCli().parseAsync([
41
47
  'node',
42
48
  'j1-integration',
@@ -44,10 +50,5 @@ test('aborts synchronization job if an error occurs', async () => {
44
50
  '--integrationInstanceId',
45
51
  'test',
46
52
  ]);
47
-
48
- expect(log.displaySynchronizationResults).toHaveBeenCalledTimes(1);
49
- expect(log.displaySynchronizationResults).toHaveBeenCalledWith({
50
- ...job,
51
- status: SynchronizationJobStatus.ABORTED,
52
- });
53
+ expect(calledAbort).toBe(true);
53
54
  });
@@ -10,12 +10,6 @@ import {
10
10
  setupSynchronizerApi,
11
11
  } from './util/synchronization';
12
12
 
13
- import {
14
- StepResultStatus,
15
- SynchronizationJobStatus,
16
- } from '@jupiterone/integration-sdk-core';
17
-
18
- import * as log from '../log';
19
13
  import { createTestPolly } from './util/recording';
20
14
 
21
15
  jest.mock('../log');
@@ -80,92 +74,19 @@ test('disables graph object schema validation', async () => {
80
74
  expect(process.env.ENABLE_GRAPH_OBJECT_SCHEMA_VALIDATION).toBeUndefined();
81
75
  });
82
76
 
83
- test('step should fail if enableSchemaValidation = true', async () => {
84
- loadProjectStructure('instanceWithNonValidatingSteps');
85
- const job = generateSynchronizationJob();
86
-
87
- setupSynchronizerApi({
88
- polly,
89
- job,
90
- baseUrl: 'https://api.us.jupiterone.io',
91
- });
92
-
93
- await createCli().parseAsync([
94
- 'node',
95
- 'j1-integration',
96
- 'run',
97
- '--integrationInstanceId',
98
- 'test',
99
- ]);
100
-
101
- expect(log.displaySynchronizationResults).toHaveBeenCalledTimes(1);
102
-
103
- expect(log.displayExecutionResults).toHaveBeenCalledTimes(1);
104
- expect(log.displayExecutionResults).toHaveBeenCalledWith({
105
- integrationStepResults: [
106
- {
107
- id: 'fetch-users',
108
- name: 'Fetch Users',
109
- declaredTypes: ['my_user'],
110
- partialTypes: [],
111
- encounteredTypes: [],
112
- status: StepResultStatus.FAILURE,
113
- },
114
- ],
115
- metadata: {
116
- partialDatasets: {
117
- types: ['my_user'],
118
- },
119
- },
120
- });
121
- });
122
-
123
- test('step should pass if enableSchemaValidation = false', async () => {
124
- loadProjectStructure('instanceWithNonValidatingSteps');
125
- const job = generateSynchronizationJob();
126
-
127
- setupSynchronizerApi({
128
- polly,
129
- job,
130
- baseUrl: 'https://api.us.jupiterone.io',
131
- });
132
-
133
- await createCli().parseAsync([
134
- 'node',
135
- 'j1-integration',
136
- 'run',
137
- '--integrationInstanceId',
138
- 'test',
139
- '--disable-schema-validation',
140
- ]);
141
-
142
- expect(log.displaySynchronizationResults).toHaveBeenCalledTimes(1);
143
-
144
- expect(log.displayExecutionResults).toHaveBeenCalledTimes(1);
145
- expect(log.displayExecutionResults).toHaveBeenCalledWith({
146
- integrationStepResults: [
147
- {
148
- id: 'fetch-users',
149
- name: 'Fetch Users',
150
- declaredTypes: ['my_user'],
151
- partialTypes: [],
152
- encounteredTypes: ['my_user'],
153
- status: StepResultStatus.SUCCESS,
154
- },
155
- ],
156
- metadata: {
157
- partialDatasets: {
158
- types: [],
159
- },
160
- },
161
- });
162
- });
163
-
164
77
  test('executes integration and performs upload', async () => {
165
78
  const job = generateSynchronizationJob();
166
79
 
167
80
  setupSynchronizerApi({ polly, job, baseUrl: 'https://api.us.jupiterone.io' });
168
81
 
82
+ let calledFinalize = false;
83
+ polly.server
84
+ .post(
85
+ `https://api.us.jupiterone.io/persister/synchronization/jobs/${job.id}/finalize`,
86
+ )
87
+ .intercept((req, res) => {
88
+ calledFinalize = true;
89
+ });
169
90
  await createCli().parseAsync([
170
91
  'node',
171
92
  'j1-integration',
@@ -174,43 +95,7 @@ test('executes integration and performs upload', async () => {
174
95
  'test',
175
96
  ]);
176
97
 
177
- expect(log.displayExecutionResults).toHaveBeenCalledTimes(1);
178
- expect(log.displayExecutionResults).toHaveBeenCalledWith({
179
- integrationStepResults: [
180
- {
181
- id: 'fetch-accounts',
182
- name: 'Fetch Accounts',
183
- declaredTypes: ['my_account'],
184
- partialTypes: [],
185
- encounteredTypes: ['my_account'],
186
- status: StepResultStatus.SUCCESS,
187
- },
188
- {
189
- id: 'fetch-users',
190
- name: 'Fetch Users',
191
- declaredTypes: ['my_user', 'my_account_has_user'],
192
- partialTypes: [],
193
- encounteredTypes: ['my_user', 'my_account_has_user'],
194
- status: StepResultStatus.SUCCESS,
195
- },
196
- ],
197
- metadata: {
198
- partialDatasets: {
199
- types: [],
200
- },
201
- },
202
- });
203
-
204
- expect(log.displaySynchronizationResults).toHaveBeenCalledTimes(1);
205
- expect(log.displaySynchronizationResults).toHaveBeenCalledWith({
206
- ...job,
207
- status: SynchronizationJobStatus.FINALIZE_PENDING,
208
- // These are the expected number of entities and relationships
209
- // collected when executing the
210
- // 'typeScriptIntegrationProject' fixture
211
- numEntitiesUploaded: 2,
212
- numRelationshipsUploaded: 1,
213
- });
98
+ expect(calledFinalize).toBe(true);
214
99
  });
215
100
 
216
101
  test('executes integration and skips finalization with skip-finalize', async () => {
@@ -222,6 +107,15 @@ test('executes integration and skips finalization with skip-finalize', async ()
222
107
  baseUrl: 'https://api.us.jupiterone.io',
223
108
  });
224
109
 
110
+ let calledFinalize = false;
111
+ polly.server
112
+ .post(
113
+ `https://api.us.jupiterone.io/persister/synchronization/jobs/${job.id}/finalize`,
114
+ )
115
+ .intercept((req, res) => {
116
+ calledFinalize = true;
117
+ });
118
+
225
119
  await createCli().parseAsync([
226
120
  'node',
227
121
  'j1-integration',
@@ -230,19 +124,7 @@ test('executes integration and skips finalization with skip-finalize', async ()
230
124
  'test',
231
125
  '--skip-finalize',
232
126
  ]);
233
-
234
- expect(log.displayExecutionResults).toHaveBeenCalledTimes(1);
235
-
236
- expect(log.displaySynchronizationResults).toHaveBeenCalledTimes(1);
237
- expect(log.displaySynchronizationResults).toHaveBeenCalledWith({
238
- ...job,
239
- status: SynchronizationJobStatus.AWAITING_UPLOADS,
240
- // These are the expected number of entities and relationships
241
- // collected when executing the
242
- // 'typeScriptIntegrationProject' fixture
243
- numEntitiesUploaded: 2,
244
- numRelationshipsUploaded: 1,
245
- });
127
+ expect(calledFinalize).toBe(false);
246
128
  });
247
129
 
248
130
  test('does not publish events for source "api" since there is no integrationJobId', async () => {
@@ -256,7 +138,9 @@ test('does not publish events for source "api" since there is no integrationJobI
256
138
 
257
139
  let eventsPublished = false;
258
140
  polly.server
259
- .post(`https://example.com/persister/synchronization/jobs/${job.id}/events`)
141
+ .post(
142
+ `https://api.us.jupiterone.io/persister/synchronization/jobs/${job.id}/events`,
143
+ )
260
144
  .intercept((req, res) => {
261
145
  eventsPublished = true;
262
146
  });
@@ -272,8 +156,6 @@ test('does not publish events for source "api" since there is no integrationJobI
272
156
  ]);
273
157
 
274
158
  expect(eventsPublished).toBe(false);
275
- expect(log.displayExecutionResults).toHaveBeenCalledTimes(1);
276
- expect(log.displaySynchronizationResults).toHaveBeenCalledTimes(1);
277
159
  });
278
160
 
279
161
  test('should use JUPITERONE_API_KEY value in Authorization request header', async () => {
@@ -97,8 +97,14 @@ export function generateSynchronizationJob(
97
97
  id: 'test',
98
98
  source: options?.source || 'integration-managed',
99
99
  scope: options?.scope,
100
- integrationJobId: options?.integrationJobId || 'test-job-id',
101
- integrationInstanceId: options?.integrationInstanceId || 'test-instance-id',
100
+ integrationJobId:
101
+ options?.source === 'api'
102
+ ? undefined
103
+ : options?.integrationJobId || 'test-job-id',
104
+ integrationInstanceId:
105
+ options?.source === 'api'
106
+ ? undefined
107
+ : options?.integrationInstanceId || 'test-instance-id',
102
108
  status: SynchronizationJobStatus.AWAITING_UPLOADS,
103
109
  startTimestamp: Date.now(),
104
110
  numEntitiesUploaded: 0,
@@ -17,7 +17,6 @@ import {
17
17
  import { createPersisterApiStepGraphObjectDataUploader } from '@jupiterone/integration-sdk-runtime/dist/src/execution/uploader';
18
18
 
19
19
  import { loadConfig } from '../config';
20
- import * as log from '../log';
21
20
  import {
22
21
  addApiClientOptionsToCommand,
23
22
  addLoggingOptions,
@@ -52,15 +51,19 @@ export function run(): Command {
52
51
 
53
52
  const clientApiOptions = getApiClientOptions(actionCommand.opts());
54
53
  const apiClient = createApiClient(clientApiOptions);
55
- log.debug(
56
- `Configured JupiterOne API client. (apiBaseUrl: '${clientApiOptions.apiBaseUrl}', account: ${clientApiOptions.account})`,
57
- );
58
54
 
59
55
  let logger = createIntegrationLogger({
60
56
  name: 'local',
61
57
  pretty: !options.noPretty,
62
58
  });
63
59
 
60
+ logger.info(
61
+ {
62
+ apiBaseUrl: clientApiOptions.apiBaseUrl,
63
+ },
64
+ `Configured JupiterOne API Client`,
65
+ );
66
+
64
67
  const synchronizationContext = await initiateSynchronization({
65
68
  logger,
66
69
  apiClient,
@@ -116,20 +119,23 @@ export function run(): Command {
116
119
 
117
120
  await eventPublishingQueue.onIdle();
118
121
 
119
- log.displayExecutionResults(executionResults);
120
-
121
122
  if (options.skipFinalize) {
122
- log.info(
123
+ logger.info(
123
124
  'Skipping synchronization finalization. Job will remain in "AWAITING_UPLOADS" state.',
124
125
  );
125
- const jobStatus = await synchronizationStatus(synchronizationContext);
126
- log.displaySynchronizationResults(jobStatus);
126
+ const synchronizationJob = await synchronizationStatus(
127
+ synchronizationContext,
128
+ );
129
+ logger.info({ synchronizationJob }, 'Synchronization job status.');
127
130
  } else {
128
- const synchronizationResult = await finalizeSynchronization({
131
+ const synchronizationJob = await finalizeSynchronization({
129
132
  ...synchronizationContext,
130
133
  partialDatasets: executionResults.metadata.partialDatasets,
131
134
  });
132
- log.displaySynchronizationResults(synchronizationResult);
135
+ logger.info(
136
+ { synchronizationJob },
137
+ 'Synchronization finalization result.',
138
+ );
133
139
  }
134
140
  } catch (err) {
135
141
  await eventPublishingQueue.onIdle();
@@ -144,8 +150,7 @@ export function run(): Command {
144
150
  ...synchronizationContext,
145
151
  reason: err.message,
146
152
  });
147
-
148
- log.displaySynchronizationResults(abortResult);
153
+ logger.error({ abortResult }, 'Synchronization job abort result.');
149
154
  } finally {
150
155
  logger.publishMetric({
151
156
  name: 'duration-total',
@@ -40,7 +40,7 @@ jobs:
40
40
  uses: actions/checkout@v3
41
41
  with:
42
42
  fetch-depth: 0
43
- token: ${{ secrets.AUTO_GITHUB_PAT_TOKEN }}
43
+ token: $\{{ secrets.AUTO_GITHUB_PAT_TOKEN }}
44
44
  - name: Setup Node
45
45
  uses: actions/setup-node@v3
46
46
  with:
@@ -49,5 +49,5 @@ jobs:
49
49
  - name: Build and Release
50
50
  uses: jupiterone/action-npm-build-release@v1
51
51
  with:
52
- npm_auth_token: ${{ secrets.NPM_AUTH_TOKEN }}
53
- gh_token: ${{ secrets.AUTO_GITHUB_PAT_TOKEN }}
52
+ npm_auth_token: $\{{ secrets.NPM_AUTH_TOKEN }}
53
+ gh_token: $\{{ secrets.AUTO_GITHUB_PAT_TOKEN }}
@@ -42,7 +42,7 @@ jobs:
42
42
  - name: Initialize CodeQL
43
43
  uses: github/codeql-action/init@v2
44
44
  with:
45
- languages: ${{ matrix.language }}
45
+ languages: $\{{ matrix.language }}
46
46
  # If you wish to specify custom queries, you can do so here or in a config file.
47
47
  # By default, queries listed here will override any specified in a config file.
48
48
  # Prefix the list here with "+" to use these queries and those in the config file.
@@ -29,8 +29,8 @@ jobs:
29
29
  uses: JupiterOne/integration-github-actions/create-integration-deployment@v1
30
30
  with:
31
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 }}
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 }}
@@ -41,7 +41,7 @@ jobs:
41
41
  - name: Configure aws credentials
42
42
  uses: aws-actions/configure-aws-credentials@v1
43
43
  with:
44
- role-to-assume: ${{ steps.get-vars.outputs.aws-oidc-role }}
44
+ role-to-assume: $\{{ steps.get-vars.outputs.aws-oidc-role }}
45
45
  role-session-name: pr-role-session
46
46
  aws-region: us-east-1
47
47
 
@@ -53,8 +53,8 @@ jobs:
53
53
  uses: docker/login-action@v2
54
54
  with:
55
55
  registry: ghcr.io
56
- username: ${{ github.actor }}
57
- password: ${{ secrets.PACKAGE_TOKEN }}
56
+ username: $\{{ github.actor }}
57
+ password: $\{{ secrets.PACKAGE_TOKEN }}
58
58
 
59
59
  - name: Pull security-scan
60
60
  run: |
@@ -66,9 +66,9 @@ jobs:
66
66
  --user root \
67
67
  -v /var/run/docker.sock:/var/run/docker.sock \
68
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 }} \
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
72
  -e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
73
73
  -e GITHUB_REF_NAME=$GITHUB_REF_NAME \
74
74
  -e GITHUB_RUN_NUMBER=$GITHUB_RUN_NUMBER \
@@ -84,7 +84,7 @@ jobs:
84
84
  - name: Run transponder
85
85
  run: |
86
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 }} \
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
90
  $TRANSPONDER_DOCKER_IMAGE
@@ -14,8 +14,8 @@ jobs:
14
14
  - name: Check out target branch questions
15
15
  uses: actions/checkout@v3
16
16
  with:
17
- ref: ${{github.event.pull_request.head.ref}}
18
- repository: ${{github.event.pull_request.head.repo.full_name}}
17
+ ref: $\{{github.event.pull_request.head.ref}}
18
+ repository: $\{{github.event.pull_request.head.repo.full_name}}
19
19
  path: target
20
20
 
21
21
  - id: setup-node
@@ -30,9 +30,9 @@ jobs:
30
30
  - name: Validate questions on target branch
31
31
  env:
32
32
  MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID:
33
- ${{ secrets.MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID }}
33
+ $\{{ secrets.MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID }}
34
34
  MANAGED_QUESTIONS_JUPITERONE_API_KEY:
35
- ${{ secrets.MANAGED_QUESTIONS_JUPITERONE_API_KEY }}
35
+ $\{{ secrets.MANAGED_QUESTIONS_JUPITERONE_API_KEY }}
36
36
  run:
37
37
  yarn --cwd source j1-integration validate-question-file -a
38
38
  --frozen-lockfile $MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID -k
@@ -36,12 +36,12 @@
36
36
  "postversion": "cp package.json ./dist/package.json"
37
37
  },
38
38
  "peerDependencies": {
39
- "@jupiterone/integration-sdk-core": "^9.0.0"
39
+ "@jupiterone/integration-sdk-core": "^10.5.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@jupiterone/integration-sdk-core": "^9.0.0",
43
- "@jupiterone/integration-sdk-dev-tools": "^9.0.0",
44
- "@jupiterone/integration-sdk-testing": "^9.0.0",
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
45
  "auto": "^10.36.5"
46
46
  },
47
47
  "auto": {
@@ -2,20 +2,19 @@ import {
2
2
  IntegrationExecutionContext,
3
3
  {{#if configFields}}IntegrationValidationError,{{/if}}
4
4
  IntegrationInstanceConfigFieldMap,
5
- IntegrationInstanceConfig,
6
5
  } from '@jupiterone/integration-sdk-core';
7
6
  import { createAPIClient } from './client';
8
7
 
9
- export const instanceConfigFields: IntegrationInstanceConfigFieldMap = {
8
+ export const instanceConfigFields = {
10
9
  {{#each configFields}}
11
10
  {{camelCase field}}: {
12
11
  type: '{{type}}',
13
12
  mask: {{mask}}
14
13
  },
15
14
  {{/each}}
16
- };
15
+ } satisfies IntegrationInstanceConfigFieldMap;
17
16
 
18
- export interface IntegrationConfig extends IntegrationInstanceConfig {
17
+ export interface IntegrationConfig {
19
18
  {{#each configFields}}
20
19
  {{camelCase field}}: {{ type }};
21
20
  {{/each}}
@@ -4,14 +4,13 @@ import {
4
4
  StepRelationshipMetadata,
5
5
  } from '@jupiterone/integration-sdk-core';
6
6
 
7
- export const Steps: Record<{{#unless steps}}string{{/unless}}{{#each steps}}'{{constantCase name}}'{{#unless @last}}|{{/unless}}{{/each}}, string> = {
7
+ export const Steps = {
8
8
  {{#each steps}}
9
9
  {{constantCase name}}: '{{kebabCase name}}',
10
10
  {{/each}}
11
- };
11
+ } satisfies Record<string, string>;
12
12
 
13
- export const Entities: Record<{{#unless entities}}string{{/unless}}{{#each entities}}'{{constantCase resourceName}}'{{#unless @last}}|{{/unless}}{{/each}}
14
- , StepEntityMetadata > = {
13
+ export const Entities = {
15
14
  {{#each entities}}
16
15
  {{constantCase resourceName}}: {
17
16
  resourceName: '{{resourceName}}',
@@ -19,10 +18,9 @@ export const Entities: Record<{{#unless entities}}string{{/unless}}{{#each entit
19
18
  _class: [{{#each _class}}'{{this}}'{{#unless @last}},{{/unless}}{{/each}}],
20
19
  },
21
20
  {{/each}}
22
- };
21
+ } satisfies Record<string, StepEntityMetadata>;
23
22
 
24
- export const Relationships: Record<{{#unless relationships}}string{{/unless}}{{#each relationships}}'{{constantCase (generateRelationshipName this)}}'{{#unless @last}}|{{/unless}}{{/each}},
25
- StepRelationshipMetadata> = {
23
+ export const Relationships = {
26
24
  {{#each relationships}}
27
25
  {{constantCase (generateRelationshipName this)}}: {
28
26
  sourceType: Entities.{{ constantCase from.resourceName }}._type,
@@ -31,4 +29,4 @@ StepRelationshipMetadata> = {
31
29
  _class: RelationshipClass.{{_class}},
32
30
  },
33
31
  {{/each}}
34
- };
32
+ } satisfies Record<string, StepRelationshipMetadata>;