@jupiterone/integration-sdk-core
Advanced tools
Comparing version 3.3.0 to 3.4.0
@@ -71,8 +71,16 @@ "use strict"; | ||
} | ||
/** | ||
* Generates an entity `_key` value from the source data when possible or throws | ||
* an error. It is expected that this won't be called when a `_key` is | ||
* explicitly assigned. | ||
* | ||
* @param data any source data object | ||
* @throws IntegrationError when there is no suitable value | ||
*/ | ||
function generateEntityKey(data) { | ||
const id = data.providerId || data.id; | ||
if (!id) { | ||
if (typeof id !== 'string') { | ||
throw new errors_1.IntegrationError({ | ||
code: 'INVALID_INPUT_TO_GENERATE_ENTITY_KEY', | ||
message: 'Entity key generation requires one of data.{providerId,id}', | ||
message: `Entity key generation requires one of data.{providerId,id} as type string, received ${JSON.stringify(id)}`, | ||
}); | ||
@@ -79,0 +87,0 @@ } |
import { PersistedObject } from './persistedObject'; | ||
export declare type PrimitiveEntity = EntityCoreProperties & PrimitiveEntityAdditionalProperties; | ||
declare type PrimitiveEntityAdditionalProperties = Record<string, PrimitiveEntityPropertyValue> & { | ||
declare type EntityIdProperty = { | ||
/** | ||
* The natural identifier of the entity as provided by the data source API. | ||
* Many APIs answer resources that each have an `id` property that should be | ||
* transferred to this entity property. | ||
* | ||
* Many APIs answer resources having a property representing the identity of | ||
* the resource within the data source system. This value should be | ||
* transferred to the entity's `id` property. | ||
* | ||
* In some cases an entity is known to a number of systems. The integrations | ||
* that do not own the entity will use mapped relationships and provide the | ||
* `id` value the data source maintains for the resource. The mapper will | ||
* merge the values into a single Array. | ||
* | ||
* An identity value that is maintained as a number must be converted to a | ||
* string. It is advisable to store the value in an additional property, such | ||
* as `<resource>Id`, where `<resource>` reflects the type of resource | ||
* represented by the entity (i.e. `domainId`, `userId`, etc.) | ||
*/ | ||
id?: string; | ||
id?: string | string[]; | ||
}; | ||
declare type PrimitiveEntityAdditionalProperties = Record<string, PrimitiveEntityPropertyValue> & EntityIdProperty; | ||
declare type PrimitiveEntityPropertyValue = Array<string | number | boolean> | string | string[] | number | number[] | boolean | undefined | null; | ||
@@ -16,10 +29,3 @@ export declare type Entity = EntityCoreProperties & RawDataTracking & EntityAdditionalProperties; | ||
} | ||
declare type EntityAdditionalProperties = Record<string, EntityPropertyValue> & { | ||
/** | ||
* The natural identifier of the entity as provided by the data source API. | ||
* Many APIs answer resources that each have an `id` property that should be | ||
* transferred to this entity property. | ||
*/ | ||
id?: string; | ||
}; | ||
declare type EntityAdditionalProperties = Record<string, EntityPropertyValue> & EntityIdProperty; | ||
declare type EntityPropertyValue = PrimitiveEntityPropertyValue | EntityRawData[]; | ||
@@ -26,0 +32,0 @@ export interface RawDataTracking { |
{ | ||
"name": "@jupiterone/integration-sdk-core", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "The SDK for developing JupiterOne integrations", | ||
@@ -26,3 +26,3 @@ "main": "dist/src/index.js", | ||
"dependencies": { | ||
"@jupiterone/data-model": "^0.10.0", | ||
"@jupiterone/data-model": "^0.12.0", | ||
"lodash": "^4.17.15", | ||
@@ -34,3 +34,3 @@ "uuid": "^7.0.3" | ||
}, | ||
"gitHead": "07a959556ad0c9db4dee7718dffc4472de0ee098" | ||
"gitHead": "1b3e749f87b46000915800480ae20d70515fe8b4" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
360021
2246
+ Added@jupiterone/data-model@0.12.0(transitive)
- Removed@jupiterone/data-model@0.10.0(transitive)