Socket
Socket
Sign inDemoInstall

@memberjunction/core

Package Overview
Dependencies
Maintainers
0
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 2.1.1 to 2.1.2

21

dist/generic/baseEntity.d.ts

@@ -7,2 +7,3 @@ import { EntityFieldInfo, EntityInfo, EntityFieldTSType, EntityPermissionType, RecordChange, ValidationResult, EntityRelationshipInfo } from './entityInfo';

import { Subscription } from 'rxjs';
import { z } from 'zod';
/**

@@ -147,3 +148,3 @@ * Represents a field in an instance of the BaseEntity class. This class is used to store the value of the field, dirty state, as well as other run-time information about the field. The class encapsulates the underlying field metadata and exposes some of the more commonly

*/
export declare abstract class BaseEntity {
export declare abstract class BaseEntity<T = unknown> {
private _EntityInfo;

@@ -258,2 +259,4 @@ private _Fields;

/**
* NOTE: Do not call this method directly. Use the {@link From} method instead
*
* Sets any number of values on the entity object from the object passed in. The properties of the object being passed in must either match the field name (in most cases) or the CodeName (which is only different from field name if field name has spaces in it)

@@ -266,2 +269,4 @@ * @param object

/**
* NOTE: Do not call this method directly. Use the {@link To} method instead
*
* Utility method to create an object and return it with properties in the newly created and returned object for each field in the entity object. This is useful for scenarios where you need to be able to persist the data

@@ -273,3 +278,3 @@ * in a format to send to a network call, save to a file or database, etc. This method will return an object with properties that match the field names of the entity object.

*/
GetAll(oldValues?: boolean, onlyDirtyFields?: boolean): {};
GetAll(oldValues?: boolean, onlyDirtyFields?: boolean): any;
/**

@@ -351,2 +356,3 @@ * This utility method calls GetDataObject() internally and formats the result as a JSON string. If you want to get the data as an object instead of a string, call GetDataObject() directly.

/**
*
* This method is meant to be used only in situations where you are sure that the data you are loading is current in the database. MAKE SURE YOU ARE PASSING IN ALL FIELDS.

@@ -396,3 +402,14 @@ * The Dirty flags and other internal state will assume what is loading from the data parameter you pass in is equivalent to what is in the database. Generally speaking, you should use Load() instead of this method. The main use case(s) where this makes sense are:

static GetRecordChanges(entityName: string, CompositeKey: CompositeKey): Promise<RecordChange[]>;
/**
* Strongly-typed wrapper for the {@link SetMany} method.
* @oaram data - the data to set on the entity object
* @param schema - the zod schema to validate the data against
*/
From<K extends z.AnyZodObject>(data: unknown, schema?: z.infer<K>): boolean;
/**
* Strongly-typed wrapper for the {@link GetAll} method
* @param schema - the zod schema to validate the data against
*/
To<K extends z.AnyZodObject>(schema?: K): z.infer<K> | null;
}
//# sourceMappingURL=baseEntity.d.ts.map

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

/**
* NOTE: Do not call this method directly. Use the {@link From} method instead
*
* Sets any number of values on the entity object from the object passed in. The properties of the object being passed in must either match the field name (in most cases) or the CodeName (which is only different from field name if field name has spaces in it)

@@ -494,2 +496,4 @@ * @param object

/**
* NOTE: Do not call this method directly. Use the {@link To} method instead
*
* Utility method to create an object and return it with properties in the newly created and returned object for each field in the entity object. This is useful for scenarios where you need to be able to persist the data

@@ -852,2 +856,3 @@ * in a format to send to a network call, save to a file or database, etc. This method will return an object with properties that match the field names of the entity object.

/**
*
* This method is meant to be used only in situations where you are sure that the data you are loading is current in the database. MAKE SURE YOU ARE PASSING IN ALL FIELDS.

@@ -983,2 +988,43 @@ * The Dirty flags and other internal state will assume what is loading from the data parameter you pass in is equivalent to what is in the database. Generally speaking, you should use Load() instead of this method. The main use case(s) where this makes sense are:

}
/**
* Strongly-typed wrapper for the {@link SetMany} method.
* @oaram data - the data to set on the entity object
* @param schema - the zod schema to validate the data against
*/
From(data, schema) {
this.init();
if (schema) {
const parseResult = schema.safeParse(data);
if (parseResult.success) {
this.SetMany(parseResult.data);
return true;
}
else {
(0, logging_1.LogError)(parseResult.error.flatten());
return false;
}
}
else {
this.SetMany(data);
return true;
}
}
/**
* Strongly-typed wrapper for the {@link GetAll} method
* @param schema - the zod schema to validate the data against
*/
To(schema) {
if (schema) {
const data = this.GetAll();
const parseResult = schema.safeParse(data);
if (parseResult.success) {
parseResult.data;
}
else {
(0, logging_1.LogError)(parseResult.error.flatten());
return null;
}
}
return this.GetAll();
}
}

@@ -985,0 +1031,0 @@ exports.BaseEntity = BaseEntity;

7

package.json
{
"name": "@memberjunction/core",
"version": "2.1.1",
"version": "2.1.2",
"description": "MemberJunction: Core Library including Metadata, Application, Entity Retrieval and Manipulation, and Utilities",

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

"dependencies": {
"@memberjunction/global": "2.1.1",
"rxjs": "^7.8.1"
"@memberjunction/global": "2.1.2",
"rxjs": "^7.8.1",
"zod": "^3.23.8"
}
}

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