@jupiterone/integration-sdk-dev-tools
Advanced tools
Changelog
[8.4.0] - 2022-02-16
Added .toMatchStepMetadata
jest matcher. This matcher complements the
executeStepWithDependencies
utility. Usage:
const stepResult = await executeStepWithDependencies({
stepId: Steps.FETCH_USERS.id,
invocationConfig,
instanceConfig,
});
expect(stepResult).toMatchStepMetadata({
stepId: Steps.FETCH_USERS.id,
invocationConfig,
});
Updated jest matchers in the following way:
_type
argument to .toMatchGraphObjectSchema
matcher_type
and _class
arguments to
.toMatchDirectRelationshipSchema
matcherThis enables developers to simply pass the StepEntityMetadata
and
StepRelationshipMetadata
interfaces to these matchers. Usage:
expect(collectedEntities).toMatchGraphObjectSchema(Entities.USER);
expect(collectedRelationships).toMatchDirectRelationshipSchema(
Relationships.ACCOUNT_HAS_USER,
);
Added optional schema
property to StepGraphObjectMetadata
. This allows
developers to provide the property schema to expect on entities,
relationships, and mapped relationships. This serves two uses:
j1-integration document
command could automatically produce consumer
documentation about the properties that an entity / relationship is
expected to haveAdded executeStepWithDependencies
utility to
@jupiterone/integration-sdk-testing
package. This allows developers to test
specific integration steps in isolation, while assuring that all of its
dependencies have indeed executed. Usage:
const { collectedEntities, collectedRelationships, collectedData } =
await executeStepWithDependencies({
stepId: Steps.FETCH_USERS.id,
invocationConfig,
instanceConfig,
});
expect(collectedEntities.length).toBeGreaterThan(0);
expect(collectedEnities).toMatchGraphObjectSchema({
_class: Entities.USER._class,
schema: Entities.USER.schema,
});
// ... additional expectations
Added MockJobState.collectedData
to capture data that has been collected in
the job state. Usage:
const jobState = createMockJobState({
setData: { existingKey: 'existing-value' },
});
await executeStepThatAddsAccountEntity();
expect(jobState.collectedData).toEqual({
ACCOUNT_ENTITY: {
_type: 'account',
_class: 'Account',
_key: 'account1',
},
});
expect(jobState.collectedData.existingKey).toBeUndefined();
Changelog
[8.3.2] - 2022-02-09
Changelog
[8.3.0] - 2022-02-03
@jupiterone/data-model
to add state
property to Host
entity classChangelog
[8.2.1] - 2022-01-25
Updated the error message within the sdk-core to reference support email instead of the support.jupiterone.io site.
Changelog
[8.2.0] - 2022-01-12
Added the loadExecutionConfig
lifecycle method to the InvocationConfig
interface. loadExecutionConfig
loads shared configuration assets, such as
shared API credentials. Example:
import { fromTemporaryCredentials } from '@aws-sdk/credential-providers';
/**
* The AWS integration uses shared `fromTemporaryCredentials` across all of
* its clients.
*/
export function loadExecutionConfig({
config: { roleArn: string, externalId: string },
}) {
return {
credentials: fromTemporaryCredentials({
params: {
RoleArn: config.roleArn,
ExternalId: config.externalId,
RoleSessionName: `juptierone-${uuid()}`,
},
}),
};
}
Changelog
[8.1.3] - 2022-01-11
@jupiterone/data-model
to expose RelationshipClass.SENDS
Changelog
[8.1.2] - 2022-01-04
@jupiterone/data-model
to remove warning messages for User
and
Person
entitiesChangelog
[8.1.1] - 2022-01-04
j1-integration neo4j
command was calling
toString()
on undefined properties in some casesChangelog
[8.1.0] - 2021-12-17
@jupiterone/data-model
to expose RelationshipClass.HOSTS
and
RelationshipClass.LOGS