1.2.0 • Published 10 days ago

@memberjunction/core v1.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
10 days ago

@memberjunction/core

The @memberjunction/core library provides a comprehensive interface for accessing and managing metadata within MemberJunction, along with facilities for working with entities, applications, and various other aspects central to the MemberJunction ecosystem. This library primarily exports a Metadata class which acts as the gateway to many functionalities.

Installation

npm install @memberjunction/core

```markdown
## Usage

### Importing the Library

```javascript
import { Metadata } from '@memberjunction/core';

Working with the Metadata Class

The Metadata class is a crucial part of this library, providing access to a wide array of metadata, instantiating derived classes of BaseEntity for record access and manipulation, and more.

Instantiating the Metadata Class

const md = new Metadata();

Refreshing Cached Metadata

await md.Refresh();

Getting Applications, Entities, and Other Info

const applications = md.Applications;
const entities = md.Entities;
const currentUser = md.CurrentUser;
// ... and so on for other properties

Helper Functions

// Get Entity ID from name
const entityId = md.EntityIDFromName('EntityName');

// Get Entity name from ID
const entityName = md.EntityNameFromID(1);

// ... and other helper functions as defined in the class

Working with Datasets

// Example: Getting a dataset by name
const dataset = await md.GetDatasetByName('DatasetName');

This is a brief overview of how to interact with the Metadata class. The methods and properties provided by the Metadata class serve as a bridge to access and manage data in a structured and coherent manner within the MemberJunction ecosystem.

RunView and RunViewParams

The @memberjunction/core library also provides a mechanism for running either a stored or dynamic view through the RunView class. The parameters for running these views are specified through the RunViewParams type.

Importing Necessary Classes and Types

import { RunView, RunViewParams } from '@memberjunction/core';

Using RunViewParams

RunViewParams is a type that helps in specifying the parameters required to run a view. The fields in RunViewParams allow you to specify whether you want to run a stored or dynamic view, and provide additional filters, sorting, and other options. Here's an example of how you might create a RunViewParams object:

const params: RunViewParams = {
    ViewName: 'MyView',
    ExtraFilter: 'Age > 25',
    OrderBy: 'LastName ASC',
    Fields: ['FirstName', 'LastName'],
    UserSearchString: 'Smith'
    // ... other optional properties as needed
};

Using the RunView Class

The RunView class provides a method to run a view based on the provided parameters.

Instantiating the RunView Class

const rv = new RunView();

Running a View

const result = await rv.RunView(params);

In this example, params is an object of type RunViewParams which contains the information necessary to run the view. The RunView method will return a Promise<RunViewResult> which will contain the result of running the view.

1.2.0

10 days ago

1.1.1

13 days ago

1.1.0

14 days ago

1.1.3

13 days ago

1.1.2

13 days ago

1.0.11

15 days ago

1.0.9

26 days ago

1.0.8

27 days ago

1.0.7

28 days ago

1.0.8-next.6

27 days ago

1.0.8-next.5

27 days ago

1.0.8-next.4

27 days ago

1.0.8-next.3

28 days ago

1.0.8-next.2

28 days ago

1.0.8-next.1

28 days ago

1.0.8-next.0

28 days ago

1.0.7-next.0

28 days ago

1.0.8-beta.0

27 days ago

1.0.2

1 month ago

1.0.6

1 month ago

1.0.4

1 month ago

1.0.3

1 month ago

1.0.1

1 month ago

1.0.0

1 month ago

0.9.187

1 month ago

0.9.186

1 month ago

0.9.188

1 month ago

0.9.185

1 month ago

0.9.184

1 month ago

0.9.183

1 month ago

0.9.178

1 month ago

0.9.182

1 month ago

0.9.181

1 month ago

0.9.180

1 month ago

0.9.176

2 months ago

0.9.175

2 months ago

0.9.174

2 months ago

0.9.177

2 months ago

0.9.172

2 months ago

0.9.171

2 months ago

0.9.169

2 months ago

0.9.168

2 months ago

0.9.167

2 months ago

0.9.166

2 months ago

0.9.165

2 months ago

0.9.154

2 months ago

0.9.155

2 months ago

0.9.164

2 months ago

0.9.163

2 months ago

0.9.162

2 months ago

0.9.158

2 months ago

0.9.157

2 months ago

0.9.159

2 months ago

0.9.153

2 months ago

0.9.152

2 months ago

0.9.150

3 months ago

0.9.151

2 months ago

0.9.149

3 months ago

0.9.148

3 months ago

0.9.147

3 months ago

0.9.146

3 months ago

0.9.145

3 months ago

0.9.143

3 months ago

0.9.144

3 months ago

0.9.142

3 months ago

0.9.141

3 months ago

0.9.134

3 months ago

0.9.128

3 months ago

0.9.114

4 months ago

0.9.116

4 months ago

0.9.115

4 months ago

0.9.110

4 months ago

0.9.112

4 months ago

0.9.111

4 months ago

0.9.107

4 months ago

0.9.106

4 months ago

0.9.109

4 months ago

0.9.108

4 months ago

0.9.103

4 months ago

0.9.105

4 months ago

0.9.104

4 months ago

0.9.113

4 months ago

0.9.96

4 months ago

0.9.97

4 months ago

0.9.98

4 months ago

0.9.99

4 months ago

0.9.92

4 months ago

0.9.93

4 months ago

0.9.94

4 months ago

0.9.95

4 months ago

0.9.90

4 months ago

0.9.91

4 months ago

0.9.89

4 months ago

0.9.88

4 months ago

0.9.87

4 months ago

0.9.85

5 months ago

0.9.86

5 months ago

0.9.81

5 months ago

0.9.82

5 months ago

0.9.83

5 months ago

0.9.84

5 months ago

0.9.80

5 months ago

0.9.79

5 months ago

0.9.78

5 months ago

0.9.77

5 months ago

0.9.75

5 months ago

0.9.76

5 months ago

0.9.74

5 months ago

0.9.73

5 months ago

0.9.72

5 months ago

0.9.71

5 months ago

0.9.70

5 months ago

0.9.69

6 months ago

0.9.68

6 months ago

0.9.67

6 months ago

0.9.65

6 months ago

0.9.64

6 months ago

0.9.63

6 months ago

0.9.62

6 months ago

0.9.61

6 months ago

0.9.60

6 months ago

0.9.59

6 months ago

0.9.58

7 months ago

0.9.57

7 months ago

0.9.56

7 months ago

0.9.55

7 months ago

0.9.54

7 months ago

0.9.53

7 months ago

0.9.52

7 months ago

0.9.50

7 months ago

0.9.49

7 months ago

0.9.48

7 months ago

0.9.47

7 months ago

0.9.46

7 months ago

0.9.45

7 months ago

0.9.44

7 months ago

0.9.43

7 months ago

0.9.42

7 months ago

0.9.41

7 months ago

0.9.40

7 months ago

0.9.39

7 months ago

0.9.38

7 months ago

0.9.37

7 months ago

0.9.36

7 months ago

0.9.35

7 months ago

0.9.34

7 months ago

0.9.33

7 months ago

0.9.32

7 months ago

0.9.31

7 months ago

0.9.30

7 months ago

0.9.29

7 months ago

0.9.28

7 months ago

0.9.27

7 months ago

0.9.26

7 months ago

0.9.25

7 months ago

0.9.24

7 months ago

0.9.23

7 months ago

0.9.22

7 months ago

0.9.21

7 months ago

0.9.20

7 months ago

0.9.19

7 months ago

0.9.18

7 months ago

0.9.17

7 months ago

0.9.16

7 months ago

0.9.15

7 months ago

0.9.14

7 months ago

0.9.13

7 months ago

0.9.12

7 months ago

0.9.10

7 months ago

0.9.9

7 months ago

0.9.8

7 months ago

0.9.7

7 months ago

0.9.6

7 months ago

0.9.5

7 months ago

0.9.4

8 months ago

0.9.3

8 months ago

0.9.1

8 months ago

0.9.0

8 months ago