@jupiterone/integration-sdk-core 8.1.3 → 8.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.
@@ -1,7 +1,7 @@
1
1
  import { IntegrationInstanceConfig } from './instance';
2
2
  import { GetStepStartStatesFunction, Step } from './step';
3
3
  import { InvocationValidationFunction } from './validation';
4
- import { ExecutionContext, IntegrationExecutionContext, StepExecutionContext, IntegrationStepExecutionContext } from './context';
4
+ import { ExecutionContext, IntegrationExecutionContext, StepExecutionContext, IntegrationStepExecutionContext, IntegrationExecutionConfig } from './context';
5
5
  import { Entity } from './entity';
6
6
  /**
7
7
  * Normalization transform for tracking keys in an integration. Allows
@@ -14,12 +14,16 @@ import { Entity } from './entity';
14
14
  */
15
15
  export declare type KeyNormalizationFunction = (_key: string) => string;
16
16
  export declare type BeforeAddEntityHookFunction<TExecutionContext extends ExecutionContext> = (context: TExecutionContext, entity: Entity) => Entity;
17
+ export declare type LoadExecutionConfigFunction<TInstanceConfig extends IntegrationInstanceConfig = IntegrationInstanceConfig, TExecutionConfig extends IntegrationExecutionConfig = IntegrationExecutionConfig> = (options: {
18
+ config: TInstanceConfig;
19
+ }) => TExecutionConfig;
17
20
  export interface InvocationConfig<TExecutionContext extends ExecutionContext, TStepExecutionContext extends StepExecutionContext> {
18
21
  validateInvocation?: InvocationValidationFunction<TExecutionContext>;
19
22
  getStepStartStates?: GetStepStartStatesFunction<TExecutionContext>;
20
23
  integrationSteps: Step<TStepExecutionContext>[];
21
24
  normalizeGraphObjectKey?: KeyNormalizationFunction;
22
25
  beforeAddEntity?: BeforeAddEntityHookFunction<TExecutionContext>;
26
+ loadExecutionConfig?: LoadExecutionConfigFunction;
23
27
  /**
24
28
  * An optional array of identifiers used to execute dependency
25
29
  * graphs in a specific order. These values should match the
@@ -14,19 +14,37 @@ export interface ExecutionContext {
14
14
  logger: IntegrationLogger;
15
15
  executionHistory: ExecutionHistory;
16
16
  }
17
+ /**
18
+ * A configuration object constructed by an integration just before the
19
+ * integration is executed. This is distinct from the
20
+ * `IntegrationInstanceConfig`, containing dynamic values perhaps calculated
21
+ * based on the instance config.
22
+ */
23
+ export declare type IntegrationExecutionConfig = object;
17
24
  /**
18
25
  * @param TConfig the integration specific type of the `instance.config`
19
26
  * property
20
27
  */
21
- export declare type IntegrationExecutionContext<TConfig extends IntegrationInstanceConfig = IntegrationInstanceConfig> = ExecutionContext & {
28
+ export declare type IntegrationLoadExecutionConfigContext<TConfig extends IntegrationInstanceConfig> = ExecutionContext & {
22
29
  instance: IntegrationInstance<TConfig>;
23
30
  };
31
+ /**
32
+ * @param TConfig the integration specific type of the `instance.config`
33
+ * property
34
+ * @param TExecutionConfig the configuration type produced by the
35
+ * integration's optional `loadExecutionConfig` function
36
+ */
37
+ export declare type IntegrationExecutionContext<TConfig extends IntegrationInstanceConfig = IntegrationInstanceConfig, TExecutionConfig extends IntegrationExecutionConfig = IntegrationExecutionConfig> = IntegrationLoadExecutionConfigContext<TConfig> & {
38
+ executionConfig: TExecutionConfig;
39
+ };
24
40
  export declare type StepExecutionContext = ExecutionContext & {
25
41
  jobState: JobState;
26
42
  };
27
43
  /**
28
44
  * @param TConfig the integration specific type of the `instance.config`
29
45
  * property
46
+ * @param TExecutionConfig the configuration type produced by the
47
+ * integration's optional `loadExecutionConfig` function
30
48
  */
31
- export interface IntegrationStepExecutionContext<TConfig extends IntegrationInstanceConfig = IntegrationInstanceConfig> extends IntegrationExecutionContext<TConfig>, StepExecutionContext {
49
+ export interface IntegrationStepExecutionContext<TConfig extends IntegrationInstanceConfig = IntegrationInstanceConfig, TExecutionConfig extends IntegrationExecutionConfig = IntegrationExecutionConfig> extends IntegrationExecutionContext<TConfig, TExecutionConfig>, StepExecutionContext {
32
50
  }
@@ -572,8 +572,8 @@
572
572
  "affectsGlobalScope": false
573
573
  },
574
574
  "../src/types/context.ts": {
575
- "version": "bc21346b9de5efe7e8cd464300d683eb9217e1449a76bfbccffd97af56f2579b",
576
- "signature": "8e3ac2a6307f130147aad76654298fd0fa55f67c253c5f1d0ff1c491269cee09",
575
+ "version": "11560d1b1144f46e3ec5937ae34c5ae75a4559225350443bd0060b42abac6a25",
576
+ "signature": "e773b60c789844210fb71a9d1128a32e00ebb439a1754f83f6d03a528c506b56",
577
577
  "affectsGlobalScope": false
578
578
  },
579
579
  "../src/types/persistedObject.ts": {
@@ -602,8 +602,8 @@
602
602
  "affectsGlobalScope": false
603
603
  },
604
604
  "../src/types/config.ts": {
605
- "version": "83cde32a7aefa7568de6d77fba63ee5b1d8b388c03b62eea9aa3053dea3c510e",
606
- "signature": "5c3127adee065bf7b37a65f629b88f53231dcd0d74af03877cf2f9e26cc74f3c",
605
+ "version": "e24c96c68acb773f7f7dcffcf9ace5b7feb15d2bed00772df404e3fde5f649eb",
606
+ "signature": "56f9040d9d5b5c31f5ee297052d578da43f0df72844f0c45a8db29173832e4d4",
607
607
  "affectsGlobalScope": false
608
608
  },
609
609
  "../src/types/partialDatasets.ts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupiterone/integration-sdk-core",
3
- "version": "8.1.3",
3
+ "version": "8.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",
@@ -30,5 +30,5 @@
30
30
  "devDependencies": {
31
31
  "@types/lodash": "^4.14.168"
32
32
  },
33
- "gitHead": "3f6a4c09f1091768419d230a9d23dbec04df2fdb"
33
+ "gitHead": "7531882f83d9ac9107f101c64e1b1e042c3bcd72"
34
34
  }