Socket
Socket
Sign inDemoInstall

@memberjunction/core

Package Overview
Dependencies
Maintainers
4
Versions
213
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 1.3.3 to 1.4.0

14

dist/generic/applicationInfo.d.ts
import { BaseInfo } from './baseInfo';
import { EntityInfo } from './entityInfo';
import { IMetadataProvider } from './interfaces';
export declare class ApplicationSettingInfo extends BaseInfo {
ApplicationName: string;
Name: string;
Value: string;
Comments: string;
CreatedAt: Date;
UpdatedAt: Date;
constructor(initData?: any);
}
export declare class ApplicationEntityInfo extends BaseInfo {

@@ -20,2 +29,5 @@ ApplicationName: string;

}
/**
* Information about an application
*/
export declare class ApplicationInfo extends BaseInfo {

@@ -26,4 +38,6 @@ Name: string;

get ApplicationEntities(): ApplicationEntityInfo[];
private _ApplicationSettings;
get ApplicationSettings(): ApplicationSettingInfo[];
constructor(md: IMetadataProvider, initData?: any);
}
//# sourceMappingURL=applicationInfo.d.ts.map

25

dist/generic/applicationInfo.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApplicationInfo = exports.ApplicationEntityInfo = void 0;
exports.ApplicationInfo = exports.ApplicationEntityInfo = exports.ApplicationSettingInfo = void 0;
const baseInfo_1 = require("./baseInfo");
class ApplicationSettingInfo extends baseInfo_1.BaseInfo {
constructor(initData = null) {
super();
this.ApplicationName = null;
this.Name = null;
this.Value = null;
this.Comments = null;
this.CreatedAt = null;
this.UpdatedAt = null;
this.copyInitData(initData);
}
}
exports.ApplicationSettingInfo = ApplicationSettingInfo;
class ApplicationEntityInfo extends baseInfo_1.BaseInfo {

@@ -29,2 +42,5 @@ get EntityInfo() {

exports.ApplicationEntityInfo = ApplicationEntityInfo;
/**
* Information about an application
*/
class ApplicationInfo extends baseInfo_1.BaseInfo {

@@ -34,2 +50,5 @@ get ApplicationEntities() {

}
get ApplicationSettings() {
return this._ApplicationSettings;
}
constructor(md, initData = null) {

@@ -40,2 +59,3 @@ super();

this._ApplicationEntities = [];
this._ApplicationSettings = [];
this.copyInitData(initData);

@@ -56,2 +76,5 @@ if (initData) {

}
let as = initData.ApplicationSettings || initData._ApplicationSettings;
if (as)
this._ApplicationSettings = as.map(s => new ApplicationSettingInfo(s));
}

@@ -58,0 +81,0 @@ }

@@ -281,2 +281,49 @@ import { BaseInfo } from "./baseInfo";

/**
* Entity Document Type Info object has information about the document types that exist across all entities. When Entity Documents are created they are associated with a document type.
*/
export declare class EntityDocumentTypeInfo extends BaseInfo {
Name: string;
Description: string;
CreatedAt: Date;
UpdatedAt: Date;
constructor(initData?: any);
}
/**
* Entity Behavior Type Info object has information about the behavior types that can be applied to an entity
*/
export declare class EntityBehaviorTypeInfo extends BaseInfo {
Name: string;
Description: string;
CreatedAt: Date;
UpdatedAt: Date;
constructor(initData?: any);
}
/**
* Contains information about a specific behavior that has been applied to an entity
*/
export declare class EntityBehaviorInfo extends BaseInfo {
EntityID: number;
BehaviorTypeID: number;
Description: string;
RegenerateCode: boolean;
Code: string;
CodeExplanation: string;
CodeGenerated: boolean;
CreatedAt: Date;
UpdatedAt: Date;
constructor(initData?: any);
}
/**
* Settings allow you to store key/value pairs of information that can be used to configure the behavior of the entity.
*/
export declare class EntitySettingInfo extends BaseInfo {
EntityID: number;
Name: string;
Value: string;
Comments: string;
CreatedAt: Date;
UpdatedAt: Date;
constructor(initData?: any);
}
/**
* Metadata about an entity

@@ -341,2 +388,4 @@ */

private _Permissions;
private _Behaviors;
private _Settings;
_hasIdField: boolean;

@@ -361,2 +410,4 @@ _virtualCount: number;

get Permissions(): EntityPermissionInfo[];
get Behaviors(): EntityBehaviorInfo[];
get Settings(): EntitySettingInfo[];
/**

@@ -363,0 +414,0 @@ * Returns the EntityField object for the Field that has IsNameField set to true. If multiple fields have IsNameField on, the function will return the first field (by sequence) that matches.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RecordMergeResult = exports.RecordMergeDetailResult = exports.RecordMergeRequest = exports.RecordDependency = exports.EntityDependency = exports.ValidationResult = exports.ValidationErrorInfo = exports.ValidationErrorType = exports.EntityInfo = exports.KeyValuePair = exports.CodeNameFromString = exports.EntityFieldInfo = exports.GeneratedFormSectionType = exports.EntityFieldValueInfo = exports.EntityFieldValueListType = exports.EntityFieldGraphQLType = exports.EntityFieldTSType = exports.EntityPermissionInfo = exports.EntityUserPermissionInfo = exports.EntityPermissionType = exports.EntityRelationshipInfo = exports.RecordChange = exports.RecordChangeStatus = void 0;
exports.RecordMergeResult = exports.RecordMergeDetailResult = exports.RecordMergeRequest = exports.RecordDependency = exports.EntityDependency = exports.ValidationResult = exports.ValidationErrorInfo = exports.ValidationErrorType = exports.EntityInfo = exports.EntitySettingInfo = exports.EntityBehaviorInfo = exports.EntityBehaviorTypeInfo = exports.EntityDocumentTypeInfo = exports.KeyValuePair = exports.CodeNameFromString = exports.EntityFieldInfo = exports.GeneratedFormSectionType = exports.EntityFieldValueInfo = exports.EntityFieldValueListType = exports.EntityFieldGraphQLType = exports.EntityFieldTSType = exports.EntityPermissionInfo = exports.EntityUserPermissionInfo = exports.EntityPermissionType = exports.EntityRelationshipInfo = exports.RecordChange = exports.RecordChangeStatus = void 0;
const baseInfo_1 = require("./baseInfo");

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

/**
* Entity Document Type Info object has information about the document types that exist across all entities. When Entity Documents are created they are associated with a document type.
*/
class EntityDocumentTypeInfo extends baseInfo_1.BaseInfo {
constructor(initData = null) {
super();
this.Name = null;
this.Description = null;
this.CreatedAt = null;
this.UpdatedAt = null;
this.copyInitData(initData);
}
}
exports.EntityDocumentTypeInfo = EntityDocumentTypeInfo;
/**
* Entity Behavior Type Info object has information about the behavior types that can be applied to an entity
*/
class EntityBehaviorTypeInfo extends baseInfo_1.BaseInfo {
constructor(initData = null) {
super();
this.Name = null;
this.Description = null;
this.CreatedAt = null;
this.UpdatedAt = null;
this.copyInitData(initData);
}
}
exports.EntityBehaviorTypeInfo = EntityBehaviorTypeInfo;
/**
* Contains information about a specific behavior that has been applied to an entity
*/
class EntityBehaviorInfo extends baseInfo_1.BaseInfo {
constructor(initData = null) {
super();
this.EntityID = null;
this.BehaviorTypeID = null;
this.Description = null;
this.RegenerateCode = null;
this.Code = null;
this.CodeExplanation = null;
this.CodeGenerated = null;
this.CreatedAt = null;
this.UpdatedAt = null;
this.copyInitData(initData);
}
}
exports.EntityBehaviorInfo = EntityBehaviorInfo;
/**
* Settings allow you to store key/value pairs of information that can be used to configure the behavior of the entity.
*/
class EntitySettingInfo extends baseInfo_1.BaseInfo {
constructor(initData = null) {
super();
this.EntityID = null;
this.Name = null;
this.Value = null;
this.Comments = null;
this.CreatedAt = null;
this.UpdatedAt = null;
this.copyInitData(initData);
}
}
exports.EntitySettingInfo = EntitySettingInfo;
/**
* Metadata about an entity

@@ -462,2 +525,8 @@ */

}
get Behaviors() {
return this._Behaviors;
}
get Settings() {
return this._Settings;
}
/**

@@ -729,2 +798,14 @@ * Returns the EntityField object for the Field that has IsNameField set to true. If multiple fields have IsNameField on, the function will return the first field (by sequence) that matches.

}
// copy the Entity Behaviors
this._Behaviors = [];
const eb = initData.EntityBehaviors || initData._Behaviors;
if (eb) {
eb.map((b) => this._Behaviors.push(new EntityBehaviorInfo(b)));
}
// copy the Entity settings
this._Settings = [];
const es = initData.EntitySettings || initData._Settings;
if (es) {
es.map((s) => this._Settings.push(new EntitySettingInfo(s)));
}
// copy the Related Entities

@@ -731,0 +812,0 @@ this._RelatedEntities = [];

10

dist/generic/providerBase.d.ts
import { BaseEntity } from "./baseEntity";
import { EntityDependency, EntityInfo, RecordDependency, RecordMergeRequest, RecordMergeResult } from "./entityInfo";
import { EntityBehaviorTypeInfo, EntityDependency, EntityDocumentTypeInfo, EntityInfo, RecordDependency, RecordMergeRequest, RecordMergeResult } from "./entityInfo";
import { IMetadataProvider, ProviderConfigDataBase, MetadataInfo, CompositeKey, ILocalStorageProvider, DatasetResultType, DatasetStatusResultType, DatasetItemFilterType, EntityRecordNameInput, EntityRecordNameResult, ProviderType, PotentialDuplicateRequest, PotentialDuplicateResponse } from "./interfaces";

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

AllQueryPermissions: QueryPermissionInfo[];
AllEntityDocumentTypes: EntityDocumentTypeInfo[];
AllEntityBehaviorTypes: EntityBehaviorTypeInfo[];
};

@@ -37,2 +39,4 @@ export declare abstract class ProviderBase implements IMetadataProvider {

private _queryPermissions;
private _entityBehaviorTypes;
private _entityDocumentTypes;
private _refresh;

@@ -52,3 +56,3 @@ /******** ABSTRACT SECTION ****************************************************************** */

protected abstract GetCurrentUser(): Promise<UserInfo>;
protected PostProcessEntityMetadata(entities: any[], fields: any[], fieldValues: any[], permissions: any[], relationships: any[]): any[];
protected PostProcessEntityMetadata(entities: any[], fields: any[], fieldValues: any[], permissions: any[], relationships: any[], behaviors: any[], settings: any[]): any[];
get ConfigData(): ProviderConfigDataBase;

@@ -188,2 +192,4 @@ get Entities(): EntityInfo[];

private static localStorageQueryPermissionsKey;
private static localStorageEntityBehaviorTypesKey;
private static localStorageEntityDocumentTypesKey;
private static localStorageKeys;

@@ -190,0 +196,0 @@ SaveLocalMetadataToStorage(): Promise<void>;

@@ -24,2 +24,4 @@ "use strict";

this._queryPermissions = [];
this._entityBehaviorTypes = [];
this._entityDocumentTypes = [];
this._refresh = false;

@@ -99,6 +101,7 @@ }

// update the entities to include the fields, permissions and relationships
allMetadata.AllEntities = this.PostProcessEntityMetadata(allMetadata.Entities, allMetadata.EntityFields, allMetadata.EntityFieldValues, allMetadata.EntityPermissions, allMetadata.EntityRelationships);
// update the applications to include applicationentities
allMetadata.AllEntities = this.PostProcessEntityMetadata(allMetadata.Entities, allMetadata.EntityFields, allMetadata.EntityFieldValues, allMetadata.EntityPermissions, allMetadata.EntityRelationships, allMetadata.EntityBehaviors, allMetadata.EntitySettings);
// update the applications to include applicationentities/ApplicationSettings
allMetadata.AllApplications = allMetadata.Applications.map((a) => {
a.ApplicationEntities = allMetadata.ApplicationEntities.filter((ae) => ae.ApplicationName.trim().toLowerCase() === a.Name.trim().toLowerCase());
a.ApplicationSettings = allMetadata.ApplicationSettings.filter((as) => as.ApplicationName.trim().toLowerCase() === a.Name.trim().toLowerCase());
return new applicationInfo_1.ApplicationInfo(this, a);

@@ -117,3 +120,5 @@ });

AllQueryPermissions: allMetadata.QueryPermissions ? allMetadata.QueryPermissions.map((qp) => new queryInfo_1.QueryPermissionInfo(qp)) : [],
AllQueryCategories: allMetadata.QueryCategories ? allMetadata.QueryCategories.map((qc) => new queryInfo_1.QueryCategoryInfo(qc)) : []
AllQueryCategories: allMetadata.QueryCategories ? allMetadata.QueryCategories.map((qc) => new queryInfo_1.QueryCategoryInfo(qc)) : [],
AllEntityBehaviorTypes: allMetadata.EntityBehaviorTypes ? allMetadata.EntityBehaviorTypes.map((eb) => new entityInfo_1.EntityBehaviorTypeInfo(eb)) : [],
AllEntityDocumentTypes: allMetadata.EntityDocumentTypes ? allMetadata.EntityDocumentTypes.map((ed) => new entityInfo_1.EntityDocumentTypeInfo(ed)) : []
};

@@ -129,3 +134,3 @@ }

}
PostProcessEntityMetadata(entities, fields, fieldValues, permissions, relationships) {
PostProcessEntityMetadata(entities, fields, fieldValues, permissions, relationships, behaviors, settings) {
const result = [];

@@ -141,2 +146,4 @@ if (fieldValues && fieldValues.length > 0)

e.EntityRelationships = relationships.filter(r => r.EntityID === e.ID);
e.EntityBehaviors = behaviors.filter(b => b.EntityID === e.ID);
e.EntitySettings = settings.filter(s => s.EntityID === e.ID);
result.push(new entityInfo_1.EntityInfo(e));

@@ -540,2 +547,8 @@ }

}
if (res.AllEntityBehaviorTypes) {
this._entityBehaviorTypes = res.AllEntityBehaviorTypes.map(ebt => new entityInfo_1.EntityBehaviorTypeInfo(ebt));
}
if (res.AllEntityDocumentTypes) {
this._entityDocumentTypes = res.AllEntityDocumentTypes.map(edt => new entityInfo_1.EntityDocumentTypeInfo(edt));
}
if (res.CurrentUser)

@@ -561,2 +574,4 @@ this._currentUser = new securityInfo_1.UserInfo(this, res.CurrentUser);

const qp = JSON.parse(await ls.getItem(_a.localStorageQueryPermissionsKey));
const ebt = JSON.parse(await ls.getItem(_a.localStorageEntityBehaviorTypesKey));
const edt = JSON.parse(await ls.getItem(_a.localStorageEntityDocumentTypesKey));
this.UpdateLocalMetadata({

@@ -573,3 +588,5 @@ AllEntities: e,

AllQueryFields: qf,
AllQueryPermissions: qp
AllQueryPermissions: qp,
AllEntityBehaviorTypes: ebt,
AllEntityDocumentTypes: edt
});

@@ -599,2 +616,4 @@ }

await ls.setItem(_a.localStorageQueryPermissionsKey, JSON.stringify(this._queryPermissions));
await ls.setItem(_a.localStorageEntityBehaviorTypesKey, JSON.stringify(this._entityBehaviorTypes));
await ls.setItem(_a.localStorageEntityDocumentTypesKey, JSON.stringify(this._entityDocumentTypes));
}

@@ -636,2 +655,4 @@ }

ProviderBase.localStorageQueryPermissionsKey = _a.localStorageRootKey + '_QueryPermissions';
ProviderBase.localStorageEntityBehaviorTypesKey = _a.localStorageRootKey + '_EntityBehaviorTypes';
ProviderBase.localStorageEntityDocumentTypesKey = _a.localStorageRootKey + '_EntityDocumentTypes';
ProviderBase.localStorageKeys = [

@@ -649,4 +670,6 @@ _a.localStorageTimestampsKey,

_a.localStorageQueryFieldsKey,
_a.localStorageQueryPermissionsKey
_a.localStorageQueryPermissionsKey,
_a.localStorageEntityBehaviorTypesKey,
_a.localStorageEntityDocumentTypesKey
];
//# sourceMappingURL=providerBase.js.map
{
"name": "@memberjunction/core",
"version": "1.3.3",
"version": "1.4.0",
"description": "MemberJunction: Core Library including Metadata, Application, Entity Retrieval and Manipulation, and Utilities",

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

"dependencies": {
"@memberjunction/global": "~1.3.3"
"@memberjunction/global": "~1.4.0"
}
}

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