Socket
Socket
Sign inDemoInstall

@jupiterone/integration-sdk-core

Package Overview
Dependencies
Maintainers
1
Versions
268
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jupiterone/integration-sdk-core - npm Package Compare versions

Comparing version 13.0.0 to 13.1.0

15

dist/src/data/converters.js

@@ -6,3 +6,9 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.truncateEntityPropertyValue = exports.sha256 = exports.parseTimePropertyValue = exports.getTime = exports.convertNameValuePairs = exports.convertProperties = exports.parseStringPropertyValue = void 0;
exports.parseStringPropertyValue = parseStringPropertyValue;
exports.convertProperties = convertProperties;
exports.convertNameValuePairs = convertNameValuePairs;
exports.getTime = getTime;
exports.parseTimePropertyValue = parseTimePropertyValue;
exports.sha256 = sha256;
exports.truncateEntityPropertyValue = truncateEntityPropertyValue;
const crypto_1 = require("crypto");

@@ -32,3 +38,2 @@ const camelCase_1 = __importDefault(require("lodash/camelCase"));

}
exports.parseStringPropertyValue = parseStringPropertyValue;
const TIME_PROPERTY_NAMES = /^\w+((T|_t)ime|(O|_o)n|(A|_a)t|(D|_d)ate)$/;

@@ -105,3 +110,2 @@ function isTimeProperty(property) {

}
exports.convertProperties = convertProperties;
function convertNameValuePairs(data, options = {}) {

@@ -122,3 +126,2 @@ const obj = {};

}
exports.convertNameValuePairs = convertNameValuePairs;
/**

@@ -131,3 +134,2 @@ * @deprecated

}
exports.getTime = getTime;
function parseTimePropertyValue(time, sourcePrecision) {

@@ -158,3 +160,2 @@ if (time) {

}
exports.parseTimePropertyValue = parseTimePropertyValue;
/**

@@ -170,3 +171,2 @@ * @description calculates the base64 sha256 hash of the stringified object

}
exports.sha256 = sha256;
/**

@@ -188,3 +188,2 @@ * At the time of writing this, 4096 is the maximum value described in the

}
exports.truncateEntityPropertyValue = truncateEntityPropertyValue;
//# sourceMappingURL=converters.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.schemaWhitelistedPropertyNames = exports.schemaWhitelists = exports.createIntegrationEntity = void 0;
exports.schemaWhitelists = void 0;
exports.createIntegrationEntity = createIntegrationEntity;
exports.schemaWhitelistedPropertyNames = schemaWhitelistedPropertyNames;
const data_model_1 = require("@jupiterone/data-model");

@@ -39,3 +41,2 @@ const integration_sdk_entity_validator_1 = require("@jupiterone/integration-sdk-entity-validator");

}
exports.createIntegrationEntity = createIntegrationEntity;
function generateEntity({ source, assign, tagProperties, }) {

@@ -143,3 +144,2 @@ const _rawData = [];

}
exports.schemaWhitelistedPropertyNames = schemaWhitelistedPropertyNames;
function schemaPropertyNames(schema) {

@@ -146,0 +146,0 @@ const names = [];

@@ -1,3 +0,3 @@

import { Static, TObject, TRef } from '@sinclair/typebox';
import { StepEntityMetadata } from '../types';
import { Static, TObject, TRef, TSchema } from '@sinclair/typebox';
import { GraphObjectSchema, StepEntityMetadata } from '../types';
interface CreateIntegrationHelpersOptions<IntegrationName extends string, SchemaKey extends string, ClassSchemaMap extends Record<SchemaKey, TObject>> {

@@ -7,7 +7,7 @@ integrationName: IntegrationName;

}
export declare const createIntegrationHelpers: <IntegrationName extends string, SchemaKey extends string, ClassSchemaMap extends Record<SchemaKey, TObject<import("@sinclair/typebox").TProperties>>>({ integrationName, classSchemaMap, }: CreateIntegrationHelpersOptions<IntegrationName, SchemaKey, ClassSchemaMap>) => {
export declare const createIntegrationHelpers: <IntegrationName extends string, SchemaKey extends string, ClassSchemaMap extends Record<SchemaKey, TObject>>({ integrationName, classSchemaMap, }: CreateIntegrationHelpersOptions<IntegrationName, SchemaKey, ClassSchemaMap>) => {
createEntityType: <EntityName extends string>(entityName: EntityName) => `${IntegrationName}_${EntityName}`;
createEntityMetadata: <ResourceName extends string, Class extends keyof ClassSchemaMap & string, EntityType extends string, Schema extends TObject<import("@sinclair/typebox").TProperties>>({ resourceName, _class, _type, description, schema, ...entityMetadata }: Omit<StepEntityMetadata, 'schema'> & {
createEntityMetadata: <Class extends keyof ClassSchemaMap & string, ResourceName extends string, EntityType extends string, Schema extends TObject>({ resourceName, _class, _type, description, schema, ...entityMetadata }: Omit<StepEntityMetadata, "schema"> & {
resourceName: ResourceName;
_class: [Class, ...Class[]];
_class: [Class];
_type: EntityType;

@@ -17,12 +17,15 @@ description: string;

}) => readonly [{
partial?: boolean | undefined;
indexMetadata?: import("../types").GraphObjectIndexMetadata | undefined;
_class: (string | string[]) & [Class, ...Class[]];
partial?: boolean;
indexMetadata?: import("../types").GraphObjectIndexMetadata;
_class: (string | string[]) & [Class];
_type: EntityType;
resourceName: ResourceName;
schema: import("@sinclair/typebox").TIntersect<[TRef<ClassSchemaMap[Class]>, ...TRef<ClassSchemaMap[Class]>[], import("@sinclair/typebox").TIntersect<[TObject<{
schema: import("@sinclair/typebox").TIntersect<[TRef<ClassSchemaMap[Class]>, import("@sinclair/typebox").TIntersect<[TObject<{
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
_type: import("@sinclair/typebox").TLiteral<EntityType>;
}>, Schema]>]>;
}, (entityData: Omit<Omit<Static<ClassSchemaMap[Class], unknown[] & []>, "displayName"> & {
}, (entityData: Omit<Omit<Static<ClassSchemaMap[Class], unknown[] & []> & {
_class: [];
_type: EntityType;
} & Static<Schema, unknown[] & []>, "displayName"> & {
displayName?: string | undefined;

@@ -34,6 +37,29 @@ }, "_class" | "_type"> & Omit<Omit<{

displayName?: string | undefined;
}, "_class" | "_type">) => Omit<Static<ClassSchemaMap[Class], unknown[] & []>, "displayName"> & {
}, "_class" | "_type">) => Omit<Static<ClassSchemaMap[Class], unknown[] & []> & {
_class: [];
_type: EntityType;
} & Static<Schema, unknown[] & []>, "displayName"> & {
displayName?: string | undefined;
}];
createMultiClassEntityMetadata: <ClassSchema extends [TSchema, ...TSchema[]], EntitySchema extends TSchema>({ resourceName, _class, _type, description, schema, ...entityMetadata }: Omit<StepEntityMetadata, "schema" | "_class"> & {
resourceName: string;
_class: ClassSchema;
_type: string;
description: string;
schema: EntitySchema;
}) => readonly [{
partial?: boolean;
indexMetadata?: import("../types").GraphObjectIndexMetadata;
_class: string[];
_type: string;
resourceName: string;
schema: GraphObjectSchema;
}, (entityData: Omit<Static<import("@sinclair/typebox").Intersect<[...ClassSchema, TObject<{
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<string>[]>;
_type: import("@sinclair/typebox").TLiteral<string>;
}>, EntitySchema]>>, "_class" | "_type">) => Static<import("@sinclair/typebox").Intersect<[...ClassSchema, TObject<{
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<string>[]>;
_type: import("@sinclair/typebox").TLiteral<string>;
}>, EntitySchema]>>];
};
export {};

@@ -7,2 +7,28 @@ "use strict";

const createEntityType = (entityName) => `${integrationName}_${entityName}`;
const createMultiClassEntityMetadata = ({ resourceName, _class, _type, description, schema, ...entityMetadata }) => {
const classRefs = _class.map((c) => typebox_1.Type.Ref(c));
const requiredProps = typebox_1.Type.Object({
_class: typebox_1.Type.Tuple(_class.map((classSchema) => typebox_1.Type.Literal(classSchema.$id.replace('#', '')))),
_type: typebox_1.Type.Literal(_type),
});
const jsonSchemaParts = [...classRefs, requiredProps, schema];
const schemaMetadata = { $id: `#${_type}`, description };
const entitySchema = typebox_1.Type.Intersect([..._class, requiredProps, schema]);
const jsonSchema = typebox_1.Type.Intersect(jsonSchemaParts, schemaMetadata);
const createEntityData = (entityData) =>
// @ts-expect-error to-inifity-and-beyond
({
...entityData,
_class: _class.map((classSchema) => classSchema.$id.replace('#', '')),
_type,
});
const stepEntityMetadata = {
_class: _class.map((classSchema) => classSchema.$id.replace('#', '')),
_type,
resourceName,
schema: typebox_1.Type.Strict(jsonSchema),
...entityMetadata,
};
return [stepEntityMetadata, createEntityData];
};
const createEntityMetadata = ({ resourceName, _class, _type, description, schema, ...entityMetadata }) => {

@@ -37,5 +63,9 @@ const classSchemaRefs = _class.map((className) => typebox_1.Type.Ref(classSchemaMap[className]));

};
return { createEntityType, createEntityMetadata };
return {
createEntityType,
createEntityMetadata,
createMultiClassEntityMetadata,
};
};
exports.createIntegrationHelpers = createIntegrationHelpers;
//# sourceMappingURL=createIntegrationHelpers.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateRelationshipKey = exports.generateRelationshipType = exports.createMappedRelationship = exports.createDirectRelationship = void 0;
exports.createDirectRelationship = createDirectRelationship;
exports.createMappedRelationship = createMappedRelationship;
exports.generateRelationshipType = generateRelationshipType;
exports.generateRelationshipKey = generateRelationshipKey;
const errors_1 = require("../errors");

@@ -41,3 +44,2 @@ const types_1 = require("../types");

}
exports.createDirectRelationship = createDirectRelationship;
/**

@@ -73,3 +75,2 @@ * Create a mapped `IntegrationRelationship`.

}
exports.createMappedRelationship = createMappedRelationship;
function createMappedRelationshipLiteral(options) {

@@ -181,3 +182,2 @@ const mapping = options._mapping;

}
exports.generateRelationshipType = generateRelationshipType;
/**

@@ -200,3 +200,2 @@ * Relationship `_key` can be generated from the `_key`s of related entities.

}
exports.generateRelationshipKey = generateRelationshipKey;
//# sourceMappingURL=createIntegrationRelationship.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isIpv4 = exports.isPublicIp = exports.isLoopback = exports.isInternet = exports.isHost = void 0;
exports.isHost = isHost;
exports.isInternet = isInternet;
exports.isLoopback = isLoopback;
exports.isPublicIp = isPublicIp;
exports.isIpv4 = isIpv4;
function isHost(ipAddress) {

@@ -8,19 +12,14 @@ return ((ipAddress.includes(':') && ipAddress.endsWith('/128')) ||

}
exports.isHost = isHost;
function isInternet(ipAddress) {
return ipAddress.startsWith('0.0.0.0') || ipAddress === '::/0';
}
exports.isInternet = isInternet;
function isLoopback(ipAddress) {
return ipAddress.startsWith('127.0.0.1') || ipAddress === '::1/128';
}
exports.isLoopback = isLoopback;
function isPublicIp(ipAddress) {
return !ipAddress.match(/(^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)/);
}
exports.isPublicIp = isPublicIp;
function isIpv4(ipAddress) {
return !!ipAddress.match(/^(?:[0-9]{1,3}\.){3}[0-9]{1,3}(?:\/[0-9]{1,2})?$/);
}
exports.isIpv4 = isIpv4;
//# sourceMappingURL=ip.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateRawData = exports.setRawData = exports.getRawData = void 0;
exports.getRawData = getRawData;
exports.setRawData = setRawData;
exports.validateRawData = validateRawData;
const errors_1 = require("../errors");

@@ -22,3 +24,2 @@ /**

}
exports.getRawData = getRawData;
/**

@@ -41,3 +42,2 @@ * Associate raw `data` with the `trackingEntity`.

}
exports.setRawData = setRawData;
/**

@@ -65,3 +65,2 @@ * Validates collection of raw data, throwing an error when invalid.

}
exports.validateRawData = validateRawData;
//# sourceMappingURL=rawData.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assignTags = void 0;
exports.assignTags = assignTags;
const converters_1 = require("./converters");

@@ -60,3 +60,2 @@ /**

}
exports.assignTags = assignTags;
function assignTagMap(entity, tagMap, assignProperties) {

@@ -63,0 +62,0 @@ const tags = [];

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.shouldReportErrorToOperator = exports.isProviderRetriesExceededError = exports.isProviderAuthError = exports.isUserConfigError = exports.IntegrationProviderRetriesExceededError = exports.IntegrationProviderAuthorizationError = exports.IntegrationProviderAuthenticationError = exports.IntegrationProviderAPIError = exports.IntegrationValidationError = exports.IntegrationMissingKeyError = exports.IntegrationDuplicateKeyError = exports.UnaccountedStepStartStatesError = exports.StepStartStateUnknownStepIdsError = exports.IntegrationConfigLoadError = exports.IntegrationLocalConfigFieldTypeMismatchError = exports.UploadError = exports.IntegrationLocalConfigFieldMissingError = exports.IntegrationError = exports.UNEXPECTED_ERROR_REASON = exports.UNEXPECTED_ERROR_CODE = void 0;
exports.IntegrationProviderRetriesExceededError = exports.IntegrationProviderAuthorizationError = exports.IntegrationProviderAuthenticationError = exports.IntegrationProviderAPIError = exports.IntegrationValidationError = exports.IntegrationMissingKeyError = exports.IntegrationDuplicateKeyError = exports.UnaccountedStepStartStatesError = exports.StepStartStateUnknownStepIdsError = exports.IntegrationConfigLoadError = exports.IntegrationLocalConfigFieldTypeMismatchError = exports.UploadError = exports.IntegrationLocalConfigFieldMissingError = exports.IntegrationError = exports.UNEXPECTED_ERROR_REASON = exports.UNEXPECTED_ERROR_CODE = void 0;
exports.isUserConfigError = isUserConfigError;
exports.isProviderAuthError = isProviderAuthError;
exports.isProviderRetriesExceededError = isProviderRetriesExceededError;
exports.shouldReportErrorToOperator = shouldReportErrorToOperator;
exports.UNEXPECTED_ERROR_CODE = 'UNEXPECTED_ERROR';

@@ -259,3 +263,2 @@ exports.UNEXPECTED_ERROR_REASON = 'Unexpected error occurred executing integration! Please contact us in Slack, or alternatively email us at support@jupiterone.com if the problem continues to occur.';

}
exports.isUserConfigError = isUserConfigError;
function isProviderAuthError(err) {

@@ -265,7 +268,5 @@ return (err instanceof IntegrationProviderAuthorizationError ||

}
exports.isProviderAuthError = isProviderAuthError;
function isProviderRetriesExceededError(err) {
return err instanceof IntegrationProviderRetriesExceededError;
}
exports.isProviderRetriesExceededError = isProviderRetriesExceededError;
function shouldReportErrorToOperator(err) {

@@ -276,3 +277,2 @@ return (!isUserConfigError(err) &&

}
exports.shouldReportErrorToOperator = shouldReportErrorToOperator;
//# sourceMappingURL=errors.js.map
{
"name": "@jupiterone/integration-sdk-core",
"version": "13.0.0",
"version": "13.1.0",
"description": "The SDK for developing JupiterOne integrations",

@@ -27,3 +27,3 @@ "main": "dist/src/index.js",

"@jupiterone/data-model": "^0.61.3",
"@jupiterone/integration-sdk-entity-validator": "^13.0.0",
"@jupiterone/integration-sdk-entity-validator": "^13.1.0",
"@sinclair/typebox": "^0.32.30",

@@ -35,3 +35,3 @@ "lodash": "^4.17.21"

},
"gitHead": "787c4b95bee4222a5d58889e2407c3008143c0e1"
"gitHead": "74818985ff0c1fc0329f11458d164dd377338095"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc