@jupiterone/integration-sdk-cli 12.8.1 → 13.0.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.
Files changed (154) hide show
  1. package/dist/src/bocchi/actions/steps.d.ts +4 -0
  2. package/dist/src/bocchi/actions/steps.js +20 -0
  3. package/dist/src/bocchi/actions/steps.js.map +1 -0
  4. package/dist/src/bocchi/bocchi.d.ts +1 -0
  5. package/dist/src/bocchi/bocchi.js +260 -0
  6. package/dist/src/bocchi/bocchi.js.map +1 -0
  7. package/dist/src/bocchi/templates/partials/directRelationships.hbs +26 -0
  8. package/dist/src/bocchi/templates/partials/mappedRelationships.hbs +36 -0
  9. package/dist/src/bocchi/templates/partials/stepMap.hbs +47 -0
  10. package/dist/src/bocchi/templates/steps/child-singleton.ts.hbs +47 -0
  11. package/dist/src/bocchi/templates/steps/fetch-child-entities.ts.hbs +58 -0
  12. package/dist/src/bocchi/templates/steps/fetch-entities.ts.hbs +47 -0
  13. package/dist/src/bocchi/templates/steps/index.test.ts.hbs +41 -0
  14. package/dist/src/bocchi/templates/steps/singleton.ts.hbs +45 -0
  15. package/dist/src/bocchi/templates/steps/spec.ts.hbs +73 -0
  16. package/dist/src/bocchi/templates/top-level/.env.example.hbs +3 -0
  17. package/dist/src/bocchi/templates/top-level/.eslintignore.hbs +1 -0
  18. package/dist/src/bocchi/templates/top-level/.eslintrc.hbs +6 -0
  19. package/dist/src/bocchi/templates/top-level/.github/workflows/build.yml.hbs +29 -0
  20. package/dist/src/bocchi/templates/top-level/.github/workflows/questions.yml.hbs +40 -0
  21. package/dist/src/bocchi/templates/top-level/.gitignore.hbs +8 -0
  22. package/dist/src/bocchi/templates/top-level/.node-version.hbs +1 -0
  23. package/dist/src/bocchi/templates/top-level/.prettierignore.hbs +6 -0
  24. package/dist/src/bocchi/templates/top-level/CHANGELOG.md.hbs +9 -0
  25. package/dist/src/bocchi/templates/top-level/CODEOWNERS.hbs +3 -0
  26. package/dist/src/bocchi/templates/top-level/Dockerfile.hbs +25 -0
  27. package/dist/src/bocchi/templates/top-level/LICENSE.hbs +373 -0
  28. package/dist/src/bocchi/templates/top-level/README.md.hbs +114 -0
  29. package/dist/src/bocchi/templates/top-level/docs/development.md.hbs +28 -0
  30. package/dist/src/bocchi/templates/top-level/docs/jupiterone.md.hbs +1 -0
  31. package/dist/src/bocchi/templates/top-level/docs/spec/index.ts.hbs +14 -0
  32. package/dist/src/bocchi/templates/top-level/husky.config.js.hbs +1 -0
  33. package/dist/src/bocchi/templates/top-level/jest.config.js.hbs +1 -0
  34. package/dist/src/bocchi/templates/top-level/jupiterone/questions/questions.yaml.hbs +16 -0
  35. package/dist/src/bocchi/templates/top-level/lint-staged.config.js.hbs +1 -0
  36. package/dist/src/bocchi/templates/top-level/package.json.hbs +49 -0
  37. package/dist/src/bocchi/templates/top-level/prettier.config.js.hbs +1 -0
  38. package/dist/src/bocchi/templates/top-level/src/client.ts.hbs +116 -0
  39. package/dist/src/bocchi/templates/top-level/src/config.ts.hbs +41 -0
  40. package/dist/src/bocchi/templates/top-level/src/index.test.ts.hbs +6 -0
  41. package/dist/src/bocchi/templates/top-level/src/index.ts.hbs +14 -0
  42. package/dist/src/bocchi/templates/top-level/src/steps/constants.ts.hbs +60 -0
  43. package/dist/src/bocchi/templates/top-level/src/steps/converters.ts.hbs +37 -0
  44. package/dist/src/bocchi/templates/top-level/src/steps/index.ts.hbs +13 -0
  45. package/dist/src/bocchi/templates/top-level/src/steps/types.ts.hbs +6 -0
  46. package/dist/src/bocchi/templates/top-level/test/README.md.hbs +5 -0
  47. package/dist/src/bocchi/templates/top-level/test/config.ts.hbs +30 -0
  48. package/dist/src/bocchi/templates/top-level/test/recording.ts.hbs +74 -0
  49. package/dist/src/bocchi/templates/top-level/tsconfig.dist.json.hbs +13 -0
  50. package/dist/src/bocchi/templates/top-level/tsconfig.json.hbs +7 -0
  51. package/dist/src/bocchi/utils/types.d.ts +98 -0
  52. package/dist/src/bocchi/utils/types.js +10 -0
  53. package/dist/src/bocchi/utils/types.js.map +1 -0
  54. package/dist/src/commands/bocchi.d.ts +1 -0
  55. package/dist/src/commands/bocchi.js +29 -0
  56. package/dist/src/commands/bocchi.js.map +1 -0
  57. package/dist/src/commands/collect.js.map +1 -1
  58. package/dist/src/commands/diff.js.map +1 -1
  59. package/dist/src/commands/document.js.map +1 -1
  60. package/dist/src/commands/generate-ingestion-sources-config.js.map +1 -1
  61. package/dist/src/commands/generate-integration-graph-schema.js.map +1 -1
  62. package/dist/src/commands/index.d.ts +1 -0
  63. package/dist/src/commands/index.js +1 -0
  64. package/dist/src/commands/index.js.map +1 -1
  65. package/dist/src/commands/options.js.map +1 -1
  66. package/dist/src/commands/run.js.map +1 -1
  67. package/dist/src/commands/validate-question-file.js.map +1 -1
  68. package/dist/src/commands/visualize-types.js.map +1 -1
  69. package/dist/src/config.js.map +1 -1
  70. package/dist/src/generator/actions.d.ts +2 -1
  71. package/dist/src/generator/actions.js +5 -1
  72. package/dist/src/generator/actions.js.map +1 -1
  73. package/dist/src/generator/entitiesFlow.js.map +1 -1
  74. package/dist/src/generator/newIntegration.js.map +1 -1
  75. package/dist/src/generator/relationshipsFlow.js.map +1 -1
  76. package/dist/src/generator/stepsFlow.js.map +1 -1
  77. package/dist/src/generator/util.js.map +1 -1
  78. package/dist/src/index.js +2 -1
  79. package/dist/src/index.js.map +1 -1
  80. package/dist/src/log.js.map +1 -1
  81. package/dist/src/neo4j/neo4jGraphStore.js.map +1 -1
  82. package/dist/src/neo4j/neo4jUtilities.js.map +1 -1
  83. package/dist/src/neo4j/uploadToNeo4j.js.map +1 -1
  84. package/dist/src/neo4j/wipeNeo4j.js.map +1 -1
  85. package/dist/src/questions/managedQuestionFileValidator.js.map +1 -1
  86. package/dist/src/services/queryLanguage.js.map +1 -1
  87. package/dist/src/troubleshoot/utils.js.map +1 -1
  88. package/dist/src/utils/generateVisHTML.js.map +1 -1
  89. package/dist/src/utils/getSortedJupiterOneTypes.js.map +1 -1
  90. package/dist/src/visualization/createMappedRelationshipNodesAndEdges.js.map +1 -1
  91. package/dist/src/visualization/generateDependencyVisualization.js.map +1 -1
  92. package/dist/src/visualization/generateVisualization.js.map +1 -1
  93. package/dist/src/visualization/retrieveIntegrationData.js.map +1 -1
  94. package/dist/src/visualization/utils.js.map +1 -1
  95. package/dist/tsconfig.dist.tsbuildinfo +1 -1
  96. package/package.json +7 -6
  97. package/src/bocchi/README.md +95 -0
  98. package/src/bocchi/actions/steps.ts +17 -0
  99. package/src/bocchi/bocchi.ts +311 -0
  100. package/src/bocchi/docs/template/README.md +140 -0
  101. package/src/bocchi/docs/template/authentication.md +100 -0
  102. package/src/bocchi/docs/template/examples/example.json +127 -0
  103. package/src/bocchi/docs/template/examples/signalSciences.json +128 -0
  104. package/src/bocchi/docs/template/steps.md +656 -0
  105. package/src/bocchi/templates/partials/directRelationships.hbs +26 -0
  106. package/src/bocchi/templates/partials/mappedRelationships.hbs +36 -0
  107. package/src/bocchi/templates/partials/stepMap.hbs +47 -0
  108. package/src/bocchi/templates/steps/child-singleton.ts.hbs +47 -0
  109. package/src/bocchi/templates/steps/fetch-child-entities.ts.hbs +58 -0
  110. package/src/bocchi/templates/steps/fetch-entities.ts.hbs +47 -0
  111. package/src/bocchi/templates/steps/index.test.ts.hbs +41 -0
  112. package/src/bocchi/templates/steps/singleton.ts.hbs +45 -0
  113. package/src/bocchi/templates/steps/spec.ts.hbs +73 -0
  114. package/src/bocchi/templates/top-level/.env.example.hbs +3 -0
  115. package/src/bocchi/templates/top-level/.eslintignore.hbs +1 -0
  116. package/src/bocchi/templates/top-level/.eslintrc.hbs +6 -0
  117. package/src/bocchi/templates/top-level/.github/workflows/build.yml.hbs +29 -0
  118. package/src/bocchi/templates/top-level/.github/workflows/questions.yml.hbs +40 -0
  119. package/src/bocchi/templates/top-level/.gitignore.hbs +8 -0
  120. package/src/bocchi/templates/top-level/.node-version.hbs +1 -0
  121. package/src/bocchi/templates/top-level/.prettierignore.hbs +6 -0
  122. package/src/bocchi/templates/top-level/CHANGELOG.md.hbs +9 -0
  123. package/src/bocchi/templates/top-level/CODEOWNERS.hbs +3 -0
  124. package/src/bocchi/templates/top-level/Dockerfile.hbs +25 -0
  125. package/src/bocchi/templates/top-level/LICENSE.hbs +373 -0
  126. package/src/bocchi/templates/top-level/README.md.hbs +114 -0
  127. package/src/bocchi/templates/top-level/docs/development.md.hbs +28 -0
  128. package/src/bocchi/templates/top-level/docs/jupiterone.md.hbs +1 -0
  129. package/src/bocchi/templates/top-level/docs/spec/index.ts.hbs +14 -0
  130. package/src/bocchi/templates/top-level/husky.config.js.hbs +1 -0
  131. package/src/bocchi/templates/top-level/jest.config.js.hbs +1 -0
  132. package/src/bocchi/templates/top-level/jupiterone/questions/questions.yaml.hbs +16 -0
  133. package/src/bocchi/templates/top-level/lint-staged.config.js.hbs +1 -0
  134. package/src/bocchi/templates/top-level/package.json.hbs +49 -0
  135. package/src/bocchi/templates/top-level/prettier.config.js.hbs +1 -0
  136. package/src/bocchi/templates/top-level/src/client.ts.hbs +116 -0
  137. package/src/bocchi/templates/top-level/src/config.ts.hbs +41 -0
  138. package/src/bocchi/templates/top-level/src/index.test.ts.hbs +6 -0
  139. package/src/bocchi/templates/top-level/src/index.ts.hbs +14 -0
  140. package/src/bocchi/templates/top-level/src/steps/constants.ts.hbs +60 -0
  141. package/src/bocchi/templates/top-level/src/steps/converters.ts.hbs +37 -0
  142. package/src/bocchi/templates/top-level/src/steps/index.ts.hbs +13 -0
  143. package/src/bocchi/templates/top-level/src/steps/types.ts.hbs +6 -0
  144. package/src/bocchi/templates/top-level/test/README.md.hbs +5 -0
  145. package/src/bocchi/templates/top-level/test/config.ts.hbs +30 -0
  146. package/src/bocchi/templates/top-level/test/recording.ts.hbs +74 -0
  147. package/src/bocchi/templates/top-level/tsconfig.dist.json.hbs +13 -0
  148. package/src/bocchi/templates/top-level/tsconfig.json.hbs +7 -0
  149. package/src/bocchi/utils/types.ts +106 -0
  150. package/src/commands/bocchi.ts +28 -0
  151. package/src/commands/generate-ingestion-sources-config.ts +4 -5
  152. package/src/commands/index.ts +1 -0
  153. package/src/generator/actions.ts +13 -1
  154. package/src/index.ts +3 -1
@@ -0,0 +1,47 @@
1
+ {
2
+ id: Steps.{{constantCase id}},
3
+ name: '{{name}}',
4
+ entities: [Entities.{{constantCase entity.name}}],
5
+ relationships: [
6
+ {{#if parentAssociation}}
7
+ Relationships.{{#with (getStepByType parentAssociation.parentEntityType)}}{{constantCase entity.name}}{{/with}}_{{constantCase parentAssociation.relationshipClass}}_{{constantCase entity.name}},
8
+ {{/if}}
9
+ ],
10
+ dependsOn: [
11
+ {{#each dependsOn}}
12
+ Steps.{{constantCase this}},
13
+ {{/each}}
14
+ ],
15
+ executionHandler: {{camelCase id}},
16
+ },
17
+ {{#if directRelationships}}
18
+ {{#with (getDirectRelationships this)}}
19
+ {{#each this}}
20
+ {
21
+ id: Steps.BUILD_{{constantCase sourceStep.entity.name}}_{{constantCase targetStep.entity.name}}_RELATIONSHIPS,
22
+ name: 'Build {{sourceStep.entity.name}} {{targetStep.entity.name}} Relationships',
23
+ entities: [],
24
+ relationships: [
25
+ Relationships.{{constantCase sourceStep.entity.name}}_{{constantCase relationshipClass}}_{{constantCase targetStep.entity.name}},
26
+ ],
27
+ dependsOn: [
28
+ Steps.{{constantCase sourceStep.id}},
29
+ Steps.{{constantCase targetStep.id}},
30
+ ],
31
+ executionHandler: build{{pascalCase sourceStep.entity.name}}{{pascalCase relationshipClass}}{{pascalCase targetStep.entity.name}}Relationships,
32
+ },
33
+ {{/each}}
34
+ {{/with}}
35
+ {{/if}}
36
+ {{#if mappedRelationships}}
37
+ {
38
+ id: Steps.BUILD_{{constantCase entity.name}}_MAPPED_RELATIONSHIPS,
39
+ name: 'Build {{entity.name}} Mapped Relationships',
40
+ entities: [],
41
+ relationships: [],
42
+ dependsOn: [
43
+ Steps.{{constantCase id}},
44
+ ],
45
+ executionHandler: build{{pascalCase entity.name}}MappedRelationships,
46
+ },
47
+ {{/if}}
@@ -0,0 +1,47 @@
1
+ {{#with step}}
2
+ import {
3
+ IntegrationStep,
4
+ IntegrationStepExecutionContext,
5
+ RelationshipClass,
6
+ {{#if directRelationships}}
7
+ createDirectRelationship,
8
+ {{/if}}
9
+ {{#if mappedRelationships}}
10
+ PrimitiveEntity,
11
+ RelationshipDirection,
12
+ createMappedRelationship,
13
+ {{/if}}
14
+ } from '@jupiterone/integration-sdk-core';
15
+
16
+ import { IntegrationConfig } from '../../config';
17
+ import {
18
+ Steps,
19
+ Entities,
20
+ Relationships,
21
+ } from '../constants';
22
+ {{#if request}}import { createAPIClient } from '../../client';{{/if}}
23
+ import { create{{pascalCase entity.name}}Entity } from '../converters';
24
+
25
+ export const {{camelCase entity.name}}Steps: IntegrationStep<IntegrationConfig>[] = [
26
+ {{> stepMap }}
27
+ ];
28
+
29
+ export async function {{camelCase id}}({
30
+ jobState,
31
+ instance,
32
+ logger
33
+ }: IntegrationStepExecutionContext<IntegrationConfig>) {
34
+ const client = createAPIClient(instance.config, logger);
35
+
36
+ await jobState.iterateEntities(
37
+ { _type: '{{ parentAssociation.parentEntityType }}' },
38
+ async (parentEntity) => {
39
+ const data = await client.get{{pascalCase entity.name}}(parentEntity);
40
+ await jobState.addEntity(create{{pascalCase entity.name}}Entity(data));
41
+ }
42
+ );
43
+ }
44
+
45
+ {{> directRelationships}}
46
+ {{> mappedRelationships}}
47
+ {{/with}}
@@ -0,0 +1,58 @@
1
+ {{#with step}}
2
+ import {
3
+ createDirectRelationship,
4
+ IntegrationStep,
5
+ IntegrationStepExecutionContext,
6
+ RelationshipClass,
7
+ {{#if directRelationships}}
8
+ createDirectRelationship,
9
+ {{/if}}
10
+ {{#if mappedRelationships}}
11
+ PrimitiveEntity,
12
+ RelationshipDirection,
13
+ createMappedRelationship,
14
+ {{/if}}
15
+ } from '@jupiterone/integration-sdk-core';
16
+
17
+ import { IntegrationConfig } from '../../config';
18
+ import {
19
+ Steps,
20
+ Entities,
21
+ Relationships,
22
+ } from '../constants';
23
+ import { createAPIClient } from '../../client';
24
+ import { create{{pascalCase entity.name}}Entity } from '../converters';
25
+
26
+ export const {{camelCase entity.name}}Steps: IntegrationStep<IntegrationConfig>[] = [
27
+ {{> stepMap }}
28
+ ];
29
+
30
+ export async function {{camelCase id}}({
31
+ instance,
32
+ jobState,
33
+ logger
34
+ }: IntegrationStepExecutionContext<IntegrationConfig>): Promise<void> {
35
+ const client = createAPIClient(instance.config, logger);
36
+
37
+ await jobState.iterateEntities(
38
+ { _type: '{{ parentAssociation.parentEntityType }}' },
39
+ async (parentEntity) => {
40
+ await client.iterate{{pascalCase entity.name}}s(
41
+ parentEntity,
42
+ async (data) => {
43
+ const entity = await jobState.addEntity(create{{pascalCase entity.name}}Entity(data));
44
+
45
+ await jobState.addRelationship(createDirectRelationship({
46
+ from: parentEntity,
47
+ _class: RelationshipClass.{{ parentAssociation.relationshipClass }},
48
+ to: entity,
49
+ }));
50
+ },
51
+ );
52
+ }
53
+ );
54
+ }
55
+
56
+ {{> directRelationships}}
57
+ {{> mappedRelationships}}
58
+ {{/with}}
@@ -0,0 +1,47 @@
1
+ {{#with step}}
2
+ import {
3
+ IntegrationStep,
4
+ IntegrationStepExecutionContext,
5
+ {{#if directRelationships}}
6
+ RelationshipClass,
7
+ createDirectRelationship,
8
+ {{/if}}
9
+ {{#if mappedRelationships}}
10
+ PrimitiveEntity,
11
+ RelationshipDirection,
12
+ createMappedRelationship,
13
+ {{/if}}
14
+ } from '@jupiterone/integration-sdk-core';
15
+
16
+ import { IntegrationConfig } from '../../config';
17
+ import {
18
+ Steps,
19
+ Entities,
20
+ {{#if directRelationships}}
21
+ Relationships,
22
+ {{/if}}
23
+ } from '../constants';
24
+ import { createAPIClient } from '../../client';
25
+ import { create{{pascalCase entity.name}}Entity } from '../converters';
26
+
27
+ export const {{camelCase entity.name}}Steps: IntegrationStep<IntegrationConfig>[] = [
28
+ {{> stepMap }}
29
+ ];
30
+
31
+ export async function {{camelCase id}}({
32
+ instance,
33
+ jobState,
34
+ logger
35
+ }: IntegrationStepExecutionContext<IntegrationConfig>): Promise<void> {
36
+ const client = createAPIClient(instance.config, logger);
37
+
38
+ await client.iterate{{pascalCase entity.name}}s(
39
+ async (data) => {
40
+ await jobState.addEntity(create{{pascalCase entity.name}}Entity(data));
41
+ },
42
+ );
43
+ }
44
+
45
+ {{> directRelationships}}
46
+ {{> mappedRelationships}}
47
+ {{/with}}
@@ -0,0 +1,41 @@
1
+ {{#with step}}
2
+ import { executeStepWithDependencies } from '@jupiterone/integration-sdk-testing';
3
+
4
+ import { buildStepTestConfigForStep } from '../../../test/config';
5
+ import { Recording, setupProjectRecording } from '../../../test/recording';
6
+ import { Steps } from '../constants';
7
+
8
+ let recording: Recording;
9
+ afterEach(async () => {
10
+ await recording.stop();
11
+ });
12
+
13
+ test('{{kebabCase id}}', async () => {
14
+ recording = setupProjectRecording({
15
+ directory: __dirname,
16
+ name: '{{kebabCase id}}',
17
+ });
18
+
19
+ const stepConfig = buildStepTestConfigForStep(Steps.{{constantCase id}});
20
+ const stepResult = await executeStepWithDependencies(stepConfig);
21
+ expect(stepResult).toMatchStepMetadata(stepConfig);
22
+ });
23
+
24
+ {{#if directRelationships}}
25
+ {{#with (getDirectRelationships this)}}
26
+ {{#each this}}
27
+ test('build-{{kebabCase sourceStep.entity.name}}-{{kebabCase targetStep.entity.name}}-relationships', async () => {
28
+ recording = setupProjectRecording({
29
+ directory: __dirname,
30
+ name: 'build-{{kebabCase sourceStep.entity.name}}-{{kebabCase targetStep.entity.name}}-relationships',
31
+ });
32
+
33
+ const stepConfig = buildStepTestConfigForStep(Steps.BUILD_{{constantCase sourceStep.entity.name}}_{{constantCase targetStep.entity.name}}_RELATIONSHIPS);
34
+ const stepResult = await executeStepWithDependencies(stepConfig);
35
+ expect(stepResult).toMatchStepMetadata(stepConfig);
36
+ });
37
+
38
+ {{/each}}
39
+ {{/with}}
40
+ {{/if}}
41
+ {{/with}}
@@ -0,0 +1,45 @@
1
+ {{#with step}}
2
+ import {
3
+ IntegrationStep,
4
+ IntegrationStepExecutionContext,
5
+ {{#if directRelationships}}
6
+ RelationshipClass,
7
+ createDirectRelationship,
8
+ {{/if}}
9
+ {{#if mappedRelationships}}
10
+ PrimitiveEntity,
11
+ RelationshipDirection,
12
+ createMappedRelationship,
13
+ {{/if}}
14
+ } from '@jupiterone/integration-sdk-core';
15
+
16
+ import { IntegrationConfig } from '../../config';
17
+ import {
18
+ Steps,
19
+ Entities,
20
+ {{#if directRelationships}}
21
+ Relationships,
22
+ {{/if}}
23
+ } from '../constants';
24
+ {{#if request}}import { createAPIClient } from '../../client';{{/if}}
25
+ import { create{{pascalCase entity.name}}Entity } from '../converters';
26
+
27
+ export const {{camelCase entity.name}}Steps: IntegrationStep<IntegrationConfig>[] = [
28
+ {{> stepMap }}
29
+ ];
30
+
31
+ export async function {{camelCase id}}({
32
+ jobState,
33
+ instance,
34
+ }: IntegrationStepExecutionContext<IntegrationConfig>) {
35
+ {{#if request}}
36
+ const client = createAPIClient(instance.config);
37
+
38
+ const data = await client.get{{camelCase entity.name}}();
39
+ {{/if}}
40
+ await jobState.addEntity(create{{pascalCase entity.name}}Entity({{#if request}}data{{/if}}));
41
+ }
42
+
43
+ {{> directRelationships}}
44
+ {{> mappedRelationships}}
45
+ {{/with}}
@@ -0,0 +1,73 @@
1
+ {{#with step}}
2
+ import {
3
+ RelationshipClass,
4
+ StepSpec,
5
+ } from '@jupiterone/integration-sdk-core';
6
+ import { IntegrationConfig } from '../../../src/config';
7
+
8
+ export const {{camelCase entity.name}}Spec: StepSpec<IntegrationConfig>[] = [
9
+ {
10
+ id: '{{kebabCase id}}',
11
+ name: '{{name}}',
12
+ entities: [
13
+ {
14
+ resourceName: '{{entity.name}}',
15
+ _type: '{{entity._type}}',
16
+ _class: ['{{entity._class}}'],
17
+ }
18
+ ],
19
+ relationships: [
20
+ {{#if parentAssociation}}
21
+ {
22
+ sourceType: '{{parentAssociation.parentEntityType}}',
23
+ _class: RelationshipClass.{{constantCase parentAssociation.relationshipClass}},
24
+ targetType: '{{entity._type}}',
25
+ _type: '{{getRelationshipType parentAssociation.relationshipClass parentAssociation.parentEntityType entity._type}}',
26
+ },
27
+ {{/if}}
28
+ ],
29
+ dependsOn: [
30
+ {{#each dependsOn}}
31
+ '{{this}}',
32
+ {{/each}}
33
+ ],
34
+ implemented: true,
35
+ },
36
+ {{#if directRelationships}}
37
+ {{#with (getDirectRelationships this)}}
38
+ {{#each this}}
39
+ {
40
+ id: 'build-{{kebabCase sourceStep.entity.name}}-{{kebabCase targetStep.entity.name}}-relationships',
41
+ name: 'Build {{sourceStep.entity.name}} {{targetStep.entity.name}} Relationships',
42
+ entities: [],
43
+ relationships: [
44
+ {
45
+ sourceType: '{{sourceStep.entity._type}}',
46
+ _class: RelationshipClass.{{constantCase relationshipClass}},
47
+ targetType: '{{targetStep.entity._type}}',
48
+ _type: '{{getRelationshipType relationshipClass sourceStep.entity._type targetStep.entity._type}}',
49
+ }
50
+ ],
51
+ dependsOn: [
52
+ '{{sourceStep.id}}',
53
+ '{{targetStep.id}}',
54
+ ],
55
+ implemented: true,
56
+ },
57
+ {{/each}}
58
+ {{/with}}
59
+ {{/if}}
60
+ {{#if mappedRelationships}}
61
+ {
62
+ id: 'build-{{kebabCase entity.name}}-mapped-relationships',
63
+ name: 'Build {{entity.name}} Mapped Relationships',
64
+ entities: [],
65
+ relationships: [],
66
+ dependsOn: [
67
+ '{{id}}',
68
+ ],
69
+ implemented: true,
70
+ },
71
+ {{/if}}
72
+ ];
73
+ {{/with}}
@@ -0,0 +1,3 @@
1
+ {{#each template.instanceConfigFields}}
2
+ {{constantCase @key}}=
3
+ {{/each}}
@@ -0,0 +1,6 @@
1
+ {
2
+ "root": true,
3
+ "extends": [
4
+ "./node_modules/@jupiterone/integration-sdk-dev-tools/config/eslint.json"
5
+ ]
6
+ }
@@ -0,0 +1,29 @@
1
+ name: Build
2
+ on:
3
+ pull_request:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Check out code repository source code
13
+ uses: actions/checkout@v3
14
+
15
+ - id: setup-node
16
+ name: Setup Node
17
+ uses: actions/setup-node@v3
18
+ with:
19
+ node-version: 18.x
20
+ cache: yarn
21
+
22
+ - name: Install dependencies
23
+ run: yarn --frozen-lockfile
24
+
25
+ - name: Run tests
26
+ run: yarn test:ci
27
+
28
+ - name: Run build
29
+ run: yarn build
@@ -0,0 +1,40 @@
1
+ name: Questions
2
+ on: [pull_request_target]
3
+
4
+ jobs:
5
+ validate:
6
+ runs-on: ubuntu-latest
7
+
8
+ steps:
9
+ - name: Check out `main` branch
10
+ uses: actions/checkout@v3
11
+ with:
12
+ path: source
13
+
14
+ - name: Check out target branch questions
15
+ uses: actions/checkout@v3
16
+ with:
17
+ ref: $\{{github.event.pull_request.head.ref}}
18
+ repository: $\{{github.event.pull_request.head.repo.full_name}}
19
+ path: target
20
+
21
+ - id: setup-node
22
+ name: Setup Node
23
+ uses: actions/setup-node@v3
24
+ with:
25
+ node-version: 18.x
26
+
27
+ - name: Install dependencies for `main` branch
28
+ run: yarn install --cwd source --frozen-lockfile
29
+
30
+ - name: Validate questions on target branch
31
+ env:
32
+ MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID:
33
+ $\{{ secrets.MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID }}
34
+ MANAGED_QUESTIONS_JUPITERONE_API_KEY:
35
+ $\{{ secrets.MANAGED_QUESTIONS_JUPITERONE_API_KEY }}
36
+ run:
37
+ yarn --cwd source j1-integration validate-question-file -a
38
+ --frozen-lockfile $MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID -k
39
+ $MANAGED_QUESTIONS_JUPITERONE_API_KEY -p
40
+ ../target/jupiterone/questions/questions.yaml
@@ -0,0 +1,8 @@
1
+ node_modules/
2
+ dist/
3
+ .j1-integration/
4
+ .j1-integration-cache/
5
+ .env
6
+ .eslintcache
7
+ tsconfig.tsbuildinfo
8
+ .npmrc
@@ -0,0 +1,6 @@
1
+ dist
2
+ coverage/
3
+ .j1-integration
4
+ .j1-integration-cache
5
+ .gitleaks.yml
6
+ CHANGELOG.md
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to
7
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
+
9
+ ## [Unreleased]
@@ -0,0 +1,3 @@
1
+ * @jupiterone/integrations
2
+
3
+ CODEOWNERS @jupiterone/security
@@ -0,0 +1,25 @@
1
+ FROM node:18-bullseye-slim as builder
2
+
3
+ ENV JUPITERONE_INTEGRATION_DIR=/opt/jupiterone/integration
4
+
5
+ COPY package.json yarn.lock tsconfig.dist.json tsconfig.json LICENSE ${JUPITERONE_INTEGRATION_DIR}/
6
+ COPY src/ ${JUPITERONE_INTEGRATION_DIR}/src
7
+ WORKDIR ${JUPITERONE_INTEGRATION_DIR}
8
+ RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/api/lists/*
9
+ RUN yarn install
10
+ RUN yarn build:docker
11
+
12
+
13
+ FROM node:18-bullseye-slim
14
+ ENV JUPITERONE_INTEGRATION_DIR=/opt/jupiterone/integration
15
+ COPY --from=builder --chown=node:node ${JUPITERONE_INTEGRATION_DIR}/dist ${JUPITERONE_INTEGRATION_DIR}
16
+ COPY --from=builder --chown=node:node ${JUPITERONE_INTEGRATION_DIR}/yarn.lock ${JUPITERONE_INTEGRATION_DIR}
17
+ COPY scripts/ ${JUPITERONE_INTEGRATION_DIR}/scripts
18
+ WORKDIR ${JUPITERONE_INTEGRATION_DIR}
19
+ RUN apt-get update && apt-get install -y python3
20
+ RUN yarn install --production --fronzen-lockfile --cache-folder ./ycache && yarn global add --cache-folder ./ycache @jupiterone/integration-sdk-cli && rm -rf ./ycache && chown -R node:node /opt/jupiterone
21
+ RUN export PATH="$(yarn global bin):$PATH"
22
+
23
+ USER node
24
+
25
+ CMD ["sh", "scripts/execute.sh"]