Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@memberjunction/core

Package Overview
Dependencies
Maintainers
3
Versions
223
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@memberjunction/core - npm Package Compare versions

Comparing version 0.9.48 to 0.9.49

10

dist/generic/entityInfo.d.ts

@@ -352,1 +352,11 @@ import { BaseInfo } from "./baseInfo";

}
export declare class EntityDependency {
EntityName: string;
RelatedEntityName: string;
FieldName: string;
}
export declare class RecordDependency {
EntityName: string;
RecordID: number;
EntityDependency: EntityDependency;
}

8

dist/generic/entityInfo.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValidationResult = exports.ValidationErrorInfo = exports.ValidationErrorType = exports.EntityInfo = exports.EntityFieldInfo = exports.GeneratedFormSectionType = exports.EntityFieldValueInfo = exports.EntityFieldValueListType = exports.EntityFieldTSType = exports.EntityPermissionInfo = exports.EntityUserPermissionInfo = exports.EntityPermissionType = exports.EntityRelationshipInfo = exports.RecordChange = exports.RecordChangeStatus = void 0;
exports.RecordDependency = exports.EntityDependency = exports.ValidationResult = exports.ValidationErrorInfo = exports.ValidationErrorType = exports.EntityInfo = exports.EntityFieldInfo = exports.GeneratedFormSectionType = exports.EntityFieldValueInfo = exports.EntityFieldValueListType = exports.EntityFieldTSType = exports.EntityPermissionInfo = exports.EntityUserPermissionInfo = exports.EntityPermissionType = exports.EntityRelationshipInfo = exports.RecordChange = exports.RecordChangeStatus = void 0;
const baseInfo_1 = require("./baseInfo");

@@ -658,2 +658,8 @@ const metadata_1 = require("./metadata");

exports.ValidationResult = ValidationResult;
class EntityDependency {
}
exports.EntityDependency = EntityDependency;
class RecordDependency {
}
exports.RecordDependency = RecordDependency;
//# sourceMappingURL=entityInfo.js.map
import { BaseEntity } from "./baseEntity";
import { EntityInfo, RecordChange } from "./entityInfo";
import { EntityDependency, EntityInfo, RecordChange, RecordDependency } from "./entityInfo";
import { ApplicationInfo } from "./applicationInfo";

@@ -70,2 +70,17 @@ import { RunViewParams } from "../views/runView";

/**
* Returns a list of dependencies - records that are linked to the specified Entity/RecordID combination. A dependency is as defined by the relationships in the database. The MemberJunction metadata that is used
* for this simply reflects the foreign key relationships that exist in the database. The CodeGen tool is what detects all of the relationships and generates the metadata that is used by MemberJunction. The metadata in question
* is within the EntityField table and specifically the RelatedEntity and RelatedEntityField columns. In turn, this method uses that metadata and queries the database to determine the dependencies. To get the list of entity dependencies
* you can use the utility method GetEntityDependencies(), which doesn't check for dependencies on a specific record, but rather gets the metadata in one shot that can be used for dependency checking.
* @param entityName the name of the entity to check
* @param recordId the recordId to check
*/
GetRecordDependencies(entityName: string, recordId: number): Promise<RecordDependency[]>;
/**
* Returns a list of entity dependencies, basically metadata that tells you the links to this entity from all other entities.
* @param entityName
* @returns
*/
GetEntityDependencies(entityName: string): Promise<EntityDependency[]>;
/**
* Returns the Name of the specific recordId for a given entityName. This is done by

@@ -72,0 +87,0 @@ * looking for the IsNameField within the EntityFields collection for a given entity.

import { DatasetItemFilterType, DatasetResultType, DatasetStatusResultType, EntityRecordNameInput, EntityRecordNameResult, ILocalStorageProvider, IMetadataProvider } from "./interfaces";
import { EntityInfo } from "./entityInfo";
import { EntityDependency, EntityInfo, RecordDependency } from "./entityInfo";
import { ApplicationInfo } from "./applicationInfo";

@@ -58,2 +58,17 @@ import { BaseEntity } from "./baseEntity";

/**
* Returns a list of dependencies - records that are linked to the specified Entity/RecordID combination. A dependency is as defined by the relationships in the database. The MemberJunction metadata that is used
* for this simply reflects the foreign key relationships that exist in the database. The CodeGen tool is what detects all of the relationships and generates the metadata that is used by MemberJunction. The metadata in question
* is within the EntityField table and specifically the RelatedEntity and RelatedEntityField columns. In turn, this method uses that metadata and queries the database to determine the dependencies. To get the list of entity dependencies
* you can use the utility method GetEntityDependencies(), which doesn't check for dependencies on a specific record, but rather gets the metadata in one shot that can be used for dependency checking.
* @param entityName the name of the entity to check
* @param recordId the recordId to check
*/
GetRecordDependencies(entityName: string, recordId: number): Promise<RecordDependency[]>;
/**
* Returns a list of entity dependencies, basically metadata that tells you the links to this entity from all other entities.
* @param entityName
* @returns
*/
GetEntityDependencies(entityName: string): Promise<EntityDependency[]>;
/**
* Returns a newly created instance of a sub-class of BaseEntity. The subclass depends on the class registrations for the

@@ -60,0 +75,0 @@ * requested entity. The class registrations are managed by the MJGlobal ClassFactory component.

@@ -97,2 +97,21 @@ "use strict";

/**
* Returns a list of dependencies - records that are linked to the specified Entity/RecordID combination. A dependency is as defined by the relationships in the database. The MemberJunction metadata that is used
* for this simply reflects the foreign key relationships that exist in the database. The CodeGen tool is what detects all of the relationships and generates the metadata that is used by MemberJunction. The metadata in question
* is within the EntityField table and specifically the RelatedEntity and RelatedEntityField columns. In turn, this method uses that metadata and queries the database to determine the dependencies. To get the list of entity dependencies
* you can use the utility method GetEntityDependencies(), which doesn't check for dependencies on a specific record, but rather gets the metadata in one shot that can be used for dependency checking.
* @param entityName the name of the entity to check
* @param recordId the recordId to check
*/
async GetRecordDependencies(entityName, recordId) {
return await Metadata.Provider.GetRecordDependencies(entityName, recordId);
}
/**
* Returns a list of entity dependencies, basically metadata that tells you the links to this entity from all other entities.
* @param entityName
* @returns
*/
async GetEntityDependencies(entityName) {
return await Metadata.Provider.GetEntityDependencies(entityName);
}
/**
* Returns a newly created instance of a sub-class of BaseEntity. The subclass depends on the class registrations for the

@@ -99,0 +118,0 @@ * requested entity. The class registrations are managed by the MJGlobal ClassFactory component.

import { BaseEntity } from "./baseEntity";
import { EntityInfo } from "./entityInfo";
import { EntityDependency, EntityInfo, RecordDependency } from "./entityInfo";
import { IMetadataProvider, ProviderConfigDataBase, MetadataInfo, ILocalStorageProvider, DatasetResultType, DatasetStatusResultType, DatasetItemFilterType, EntityRecordNameInput, EntityRecordNameResult } from "./interfaces";

@@ -54,2 +54,17 @@ import { ApplicationInfo } from "../generic/applicationInfo";

/**
* Returns a list of dependencies - records that are linked to the specified Entity/RecordID combination. A dependency is as defined by the relationships in the database. The MemberJunction metadata that is used
* for this simply reflects the foreign key relationships that exist in the database. The CodeGen tool is what detects all of the relationships and generates the metadata that is used by MemberJunction. The metadata in question
* is within the EntityField table and specifically the RelatedEntity and RelatedEntityField columns. In turn, this method uses that metadata and queries the database to determine the dependencies. To get the list of entity dependencies
* you can use the utility method GetEntityDependencies(), which doesn't check for dependencies on a specific record, but rather gets the metadata in one shot that can be used for dependency checking.
* @param entityName the name of the entity to check
* @param recordId the recordId to check
*/
abstract GetRecordDependencies(entityName: string, recordId: number): Promise<RecordDependency[]>;
/**
* Returns a list of entity dependencies, basically metadata that tells you the links to this entity from all other entities.
* @param entityName
* @returns
*/
GetEntityDependencies(entityName: string): Promise<EntityDependency[]>;
/**
* Always retrieves data from the server - this method does NOT check cache. To use cached local values if available, call GetAndCacheDatasetByName() instead

@@ -56,0 +71,0 @@ * @param datasetName

@@ -202,2 +202,31 @@ "use strict";

/**
* Returns a list of entity dependencies, basically metadata that tells you the links to this entity from all other entities.
* @param entityName
* @returns
*/
async GetEntityDependencies(entityName) {
// using our metadata, find all of the foreign keys that point to this entity
// go through each entity and find all the fields that have a RelatedEntity = entityName
try {
const eName = entityName.trim().toLowerCase();
const result = [];
for (let re of this.Entities) {
const relatedFields = re.Fields.filter(f => f.RelatedEntity.trim().toLowerCase() === eName);
// we now have all the fields, so let's create the EntityDependency objects
relatedFields.map(f => {
result.push({
EntityName: entityName,
RelatedEntityName: re.Name,
FieldName: f.Name
});
});
}
return result;
}
catch (e) {
(0, logging_1.LogError)(e);
throw e;
}
}
/**
* Gets a database by name, if required, and caches it in a format available to the client (e.g. IndexedDB, LocalStorage, File, etc). The cache method is Provider specific

@@ -204,0 +233,0 @@ * If itemFilters are provided, the combination of datasetName and the filters are used to determine a match in the cache

26

dist/index.d.ts

@@ -1,14 +0,14 @@

export { Metadata } from "./generic/metadata";
export { BaseInfo } from "./generic/baseInfo";
export { RunView, RunViewParams } from "./views/runView";
export { RunReport, RunReportParams } from "./generic/runReport";
export { RunViewResult, IEntityDataProvider, IMetadataProvider, IRunViewProvider, ProviderConfigDataBase, MetadataInfo, EntityDataProviderType, ILocalStorageProvider, EntitySaveOptions, DatasetResultType, DatasetItemFilterType, DatasetItemResultType, DatasetStatusEntityUpdateDateType, DatasetStatusResultType, EntityRecordNameInput, EntityRecordNameResult, IRunReportProvider, RunReportResult } from "./generic/interfaces";
export { BaseEntity, EntityField, DataObjectParams, DataObjectRelatedEntityParam, BaseEntityAIActionParams } from "./generic/baseEntity";
export { ApplicationInfo, ApplicationEntityInfo } from "./generic/applicationInfo";
export { ProviderBase, AllMetadata } from "./generic/providerBase";
export { EntityInfo, ValidationErrorInfo, ValidationErrorType, ValidationResult, GeneratedFormSectionType, EntityFieldInfo, EntityPermissionInfo, EntityRelationshipInfo, EntityFieldTSType, EntityUserPermissionInfo, EntityPermissionType, RecordChange, RecordChangeStatus } from "./generic/entityInfo";
export { UserInfo, RoleInfo, UserRoleInfo, RowLevelSecurityFilterInfo, AuthorizationInfo, AuditLogTypeInfo } from "./generic/securityInfo";
export { TransactionGroupBase, TransactionItem, TransactionResult } from "./generic/transactionGroup";
export { FormatValue, TypeScriptTypeFromSQLType, SQLMaxLength, SQLFullType, CommonStopWords, StripStopWords } from "./generic/util";
export { LogError, LogStatus, SetProductionStatus, GetProductionStatus } from "./generic/logging";
export * from "./generic/metadata";
export * from "./generic/baseInfo";
export * from "./views/runView";
export * from "./generic/runReport";
export * from "./generic/interfaces";
export * from "./generic/baseEntity";
export * from "./generic/applicationInfo";
export * from "./generic/providerBase";
export * from "./generic/entityInfo";
export * from "./generic/securityInfo";
export * from "./generic/transactionGroup";
export * from "./generic/util";
export * from "./generic/logging";
export declare function SetProvider(provider: any): void;
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetProductionStatus = exports.SetProductionStatus = exports.LogStatus = exports.LogError = exports.StripStopWords = exports.CommonStopWords = exports.SQLFullType = exports.SQLMaxLength = exports.TypeScriptTypeFromSQLType = exports.FormatValue = exports.TransactionResult = exports.TransactionItem = exports.TransactionGroupBase = exports.AuditLogTypeInfo = exports.AuthorizationInfo = exports.RowLevelSecurityFilterInfo = exports.UserRoleInfo = exports.RoleInfo = exports.UserInfo = exports.RecordChangeStatus = exports.RecordChange = exports.EntityPermissionType = exports.EntityUserPermissionInfo = exports.EntityFieldTSType = exports.EntityRelationshipInfo = exports.EntityPermissionInfo = exports.EntityFieldInfo = exports.GeneratedFormSectionType = exports.ValidationResult = exports.ValidationErrorType = exports.ValidationErrorInfo = exports.EntityInfo = exports.ProviderBase = exports.ApplicationEntityInfo = exports.ApplicationInfo = exports.BaseEntityAIActionParams = exports.DataObjectRelatedEntityParam = exports.DataObjectParams = exports.EntityField = exports.BaseEntity = exports.EntityRecordNameResult = exports.EntityRecordNameInput = exports.EntitySaveOptions = exports.EntityDataProviderType = exports.MetadataInfo = exports.ProviderConfigDataBase = exports.RunReport = exports.RunView = exports.BaseInfo = exports.Metadata = void 0;
exports.SetProvider = void 0;

@@ -9,65 +22,15 @@ const baseEntity_1 = require("./generic/baseEntity");

const runView_1 = require("./views/runView");
var metadata_2 = require("./generic/metadata");
Object.defineProperty(exports, "Metadata", { enumerable: true, get: function () { return metadata_2.Metadata; } });
var baseInfo_1 = require("./generic/baseInfo");
Object.defineProperty(exports, "BaseInfo", { enumerable: true, get: function () { return baseInfo_1.BaseInfo; } });
var runView_2 = require("./views/runView");
Object.defineProperty(exports, "RunView", { enumerable: true, get: function () { return runView_2.RunView; } });
var runReport_2 = require("./generic/runReport");
Object.defineProperty(exports, "RunReport", { enumerable: true, get: function () { return runReport_2.RunReport; } });
var interfaces_1 = require("./generic/interfaces");
Object.defineProperty(exports, "ProviderConfigDataBase", { enumerable: true, get: function () { return interfaces_1.ProviderConfigDataBase; } });
Object.defineProperty(exports, "MetadataInfo", { enumerable: true, get: function () { return interfaces_1.MetadataInfo; } });
Object.defineProperty(exports, "EntityDataProviderType", { enumerable: true, get: function () { return interfaces_1.EntityDataProviderType; } });
Object.defineProperty(exports, "EntitySaveOptions", { enumerable: true, get: function () { return interfaces_1.EntitySaveOptions; } });
Object.defineProperty(exports, "EntityRecordNameInput", { enumerable: true, get: function () { return interfaces_1.EntityRecordNameInput; } });
Object.defineProperty(exports, "EntityRecordNameResult", { enumerable: true, get: function () { return interfaces_1.EntityRecordNameResult; } });
var baseEntity_2 = require("./generic/baseEntity");
Object.defineProperty(exports, "BaseEntity", { enumerable: true, get: function () { return baseEntity_2.BaseEntity; } });
Object.defineProperty(exports, "EntityField", { enumerable: true, get: function () { return baseEntity_2.EntityField; } });
Object.defineProperty(exports, "DataObjectParams", { enumerable: true, get: function () { return baseEntity_2.DataObjectParams; } });
Object.defineProperty(exports, "DataObjectRelatedEntityParam", { enumerable: true, get: function () { return baseEntity_2.DataObjectRelatedEntityParam; } });
Object.defineProperty(exports, "BaseEntityAIActionParams", { enumerable: true, get: function () { return baseEntity_2.BaseEntityAIActionParams; } });
var applicationInfo_1 = require("./generic/applicationInfo");
Object.defineProperty(exports, "ApplicationInfo", { enumerable: true, get: function () { return applicationInfo_1.ApplicationInfo; } });
Object.defineProperty(exports, "ApplicationEntityInfo", { enumerable: true, get: function () { return applicationInfo_1.ApplicationEntityInfo; } });
var providerBase_1 = require("./generic/providerBase");
Object.defineProperty(exports, "ProviderBase", { enumerable: true, get: function () { return providerBase_1.ProviderBase; } });
var entityInfo_1 = require("./generic/entityInfo");
Object.defineProperty(exports, "EntityInfo", { enumerable: true, get: function () { return entityInfo_1.EntityInfo; } });
Object.defineProperty(exports, "ValidationErrorInfo", { enumerable: true, get: function () { return entityInfo_1.ValidationErrorInfo; } });
Object.defineProperty(exports, "ValidationErrorType", { enumerable: true, get: function () { return entityInfo_1.ValidationErrorType; } });
Object.defineProperty(exports, "ValidationResult", { enumerable: true, get: function () { return entityInfo_1.ValidationResult; } });
Object.defineProperty(exports, "GeneratedFormSectionType", { enumerable: true, get: function () { return entityInfo_1.GeneratedFormSectionType; } });
Object.defineProperty(exports, "EntityFieldInfo", { enumerable: true, get: function () { return entityInfo_1.EntityFieldInfo; } });
Object.defineProperty(exports, "EntityPermissionInfo", { enumerable: true, get: function () { return entityInfo_1.EntityPermissionInfo; } });
Object.defineProperty(exports, "EntityRelationshipInfo", { enumerable: true, get: function () { return entityInfo_1.EntityRelationshipInfo; } });
Object.defineProperty(exports, "EntityFieldTSType", { enumerable: true, get: function () { return entityInfo_1.EntityFieldTSType; } });
Object.defineProperty(exports, "EntityUserPermissionInfo", { enumerable: true, get: function () { return entityInfo_1.EntityUserPermissionInfo; } });
Object.defineProperty(exports, "EntityPermissionType", { enumerable: true, get: function () { return entityInfo_1.EntityPermissionType; } });
Object.defineProperty(exports, "RecordChange", { enumerable: true, get: function () { return entityInfo_1.RecordChange; } });
Object.defineProperty(exports, "RecordChangeStatus", { enumerable: true, get: function () { return entityInfo_1.RecordChangeStatus; } });
var securityInfo_1 = require("./generic/securityInfo");
Object.defineProperty(exports, "UserInfo", { enumerable: true, get: function () { return securityInfo_1.UserInfo; } });
Object.defineProperty(exports, "RoleInfo", { enumerable: true, get: function () { return securityInfo_1.RoleInfo; } });
Object.defineProperty(exports, "UserRoleInfo", { enumerable: true, get: function () { return securityInfo_1.UserRoleInfo; } });
Object.defineProperty(exports, "RowLevelSecurityFilterInfo", { enumerable: true, get: function () { return securityInfo_1.RowLevelSecurityFilterInfo; } });
Object.defineProperty(exports, "AuthorizationInfo", { enumerable: true, get: function () { return securityInfo_1.AuthorizationInfo; } });
Object.defineProperty(exports, "AuditLogTypeInfo", { enumerable: true, get: function () { return securityInfo_1.AuditLogTypeInfo; } });
var transactionGroup_1 = require("./generic/transactionGroup");
Object.defineProperty(exports, "TransactionGroupBase", { enumerable: true, get: function () { return transactionGroup_1.TransactionGroupBase; } });
Object.defineProperty(exports, "TransactionItem", { enumerable: true, get: function () { return transactionGroup_1.TransactionItem; } });
Object.defineProperty(exports, "TransactionResult", { enumerable: true, get: function () { return transactionGroup_1.TransactionResult; } });
var util_1 = require("./generic/util");
Object.defineProperty(exports, "FormatValue", { enumerable: true, get: function () { return util_1.FormatValue; } });
Object.defineProperty(exports, "TypeScriptTypeFromSQLType", { enumerable: true, get: function () { return util_1.TypeScriptTypeFromSQLType; } });
Object.defineProperty(exports, "SQLMaxLength", { enumerable: true, get: function () { return util_1.SQLMaxLength; } });
Object.defineProperty(exports, "SQLFullType", { enumerable: true, get: function () { return util_1.SQLFullType; } });
Object.defineProperty(exports, "CommonStopWords", { enumerable: true, get: function () { return util_1.CommonStopWords; } });
Object.defineProperty(exports, "StripStopWords", { enumerable: true, get: function () { return util_1.StripStopWords; } });
var logging_1 = require("./generic/logging");
Object.defineProperty(exports, "LogError", { enumerable: true, get: function () { return logging_1.LogError; } });
Object.defineProperty(exports, "LogStatus", { enumerable: true, get: function () { return logging_1.LogStatus; } });
Object.defineProperty(exports, "SetProductionStatus", { enumerable: true, get: function () { return logging_1.SetProductionStatus; } });
Object.defineProperty(exports, "GetProductionStatus", { enumerable: true, get: function () { return logging_1.GetProductionStatus; } });
__exportStar(require("./generic/metadata"), exports);
__exportStar(require("./generic/baseInfo"), exports);
__exportStar(require("./views/runView"), exports);
__exportStar(require("./generic/runReport"), exports);
__exportStar(require("./generic/interfaces"), exports);
__exportStar(require("./generic/baseEntity"), exports);
__exportStar(require("./generic/applicationInfo"), exports);
__exportStar(require("./generic/providerBase"), exports);
__exportStar(require("./generic/entityInfo"), exports);
__exportStar(require("./generic/securityInfo"), exports);
__exportStar(require("./generic/transactionGroup"), exports);
__exportStar(require("./generic/util"), exports);
__exportStar(require("./generic/logging"), exports);
function SetProvider(provider) {

@@ -74,0 +37,0 @@ metadata_1.Metadata.Provider = provider;

{
"name": "@memberjunction/core",
"version": "0.9.48",
"version": "0.9.49",
"description": "MemberJunction: Core Library including Metadata, Application, Entity Retrieval and Manipulation, and Utilities",

@@ -22,4 +22,4 @@ "main": "dist/index.js",

"dependencies": {
"@memberjunction/global": "^0.9.50"
"@memberjunction/global": "^0.9.51"
}
}

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