@memberjunction/actions 3.4.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +416 -0
- package/dist/entity-actions/EntityActionEngine.js +5 -9
- package/dist/entity-actions/EntityActionEngine.js.map +1 -1
- package/dist/entity-actions/EntityActionInvocationTypes.js +32 -36
- package/dist/entity-actions/EntityActionInvocationTypes.js.map +1 -1
- package/dist/generic/ActionEngine.js +13 -17
- package/dist/generic/ActionEngine.js.map +1 -1
- package/dist/generic/BaseAction.js +1 -5
- package/dist/generic/BaseAction.js.map +1 -1
- package/dist/generic/BaseActionFilter.js +1 -5
- package/dist/generic/BaseActionFilter.js.map +1 -1
- package/dist/generic/BaseOAuthAction.d.ts +1 -1
- package/dist/generic/BaseOAuthAction.js +6 -10
- package/dist/generic/BaseOAuthAction.js.map +1 -1
- package/dist/generic/OAuth2Manager.js +1 -5
- package/dist/generic/OAuth2Manager.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +7 -23
- package/dist/index.js.map +1 -1
- package/package.json +13 -12
- package/readme.md +321 -429
package/README.md
ADDED
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
# @memberjunction/actions
|
|
2
|
+
|
|
3
|
+
Server-side action execution engine for MemberJunction. This package provides the runtime infrastructure for executing actions — including input validation, filter evaluation, ClassFactory-based action dispatch, execution logging, OAuth token management, and entity-bound action invocation. It is intended for server-side use only.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @memberjunction/actions
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
The Actions Engine sits between external consumers (AI agents, workflows, APIs) and the actual action implementations registered via `@RegisterClass`. It handles the full execution lifecycle: validating inputs, running pre-execution filters, dispatching to the correct `BaseAction` subclass via ClassFactory, and logging results.
|
|
14
|
+
|
|
15
|
+
The package contains two subsystems:
|
|
16
|
+
|
|
17
|
+
- **Generic Action Engine** — Executes standalone actions with validation, filtering, and logging
|
|
18
|
+
- **Entity Action Engine** — Executes actions bound to entity records, supporting CRUD lifecycle hooks, list/view batch operations, and record validation
|
|
19
|
+
|
|
20
|
+
```mermaid
|
|
21
|
+
flowchart TD
|
|
22
|
+
subgraph Consumers["External Consumers"]
|
|
23
|
+
Agent["AI Agents"]
|
|
24
|
+
WF["Workflows"]
|
|
25
|
+
API["GraphQL API"]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
subgraph Engine["@memberjunction/actions"]
|
|
29
|
+
AES["ActionEngineServer"]
|
|
30
|
+
EAES["EntityActionEngineServer"]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
subgraph Pipeline["Execution Pipeline"]
|
|
34
|
+
Validate["Validate Inputs"]
|
|
35
|
+
Filter["Run Filters"]
|
|
36
|
+
Dispatch["ClassFactory Dispatch"]
|
|
37
|
+
Log["Execution Logging"]
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
subgraph Actions["Registered Actions"]
|
|
41
|
+
BA["BaseAction Subclasses"]
|
|
42
|
+
OAuth["BaseOAuthAction Subclasses"]
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
Consumers --> Engine
|
|
46
|
+
AES --> Validate --> Filter --> Dispatch --> Log
|
|
47
|
+
Dispatch --> BA
|
|
48
|
+
Dispatch --> OAuth
|
|
49
|
+
EAES --> AES
|
|
50
|
+
|
|
51
|
+
style Consumers fill:#2d6a9f,stroke:#1a4971,color:#fff
|
|
52
|
+
style Engine fill:#7c5295,stroke:#563a6b,color:#fff
|
|
53
|
+
style Pipeline fill:#2d8659,stroke:#1a5c3a,color:#fff
|
|
54
|
+
style Actions fill:#b8762f,stroke:#8a5722,color:#fff
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Key Features
|
|
58
|
+
|
|
59
|
+
- **Action Execution Pipeline** — Validates inputs, evaluates filters, dispatches via ClassFactory, and logs all executions
|
|
60
|
+
- **ClassFactory Dispatch** — Looks up `BaseAction` subclasses by `DriverClass` or action name at runtime
|
|
61
|
+
- **Pre-Execution Filters** — `BaseActionFilter` subclasses can gate whether an action should run
|
|
62
|
+
- **Execution Logging** — Automatic start/end logging to `Action Execution Logs` entity with params and result codes
|
|
63
|
+
- **OAuth Token Management** — `BaseOAuthAction` provides token lifecycle (refresh, retry on auth failure, persistence)
|
|
64
|
+
- **OAuth2Manager** — Standalone OAuth2 client supporting authorization code, client credentials, and refresh token flows
|
|
65
|
+
- **Entity Action Invocation** — Bind actions to entity CRUD lifecycle events (BeforeCreate, AfterUpdate, etc.)
|
|
66
|
+
- **Batch Entity Actions** — Run actions against Lists or Views of records with consolidated results
|
|
67
|
+
- **Script Evaluation** — Entity action params support runtime script evaluation with entity context
|
|
68
|
+
|
|
69
|
+
## Usage
|
|
70
|
+
|
|
71
|
+
### Running a Standalone Action
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { ActionEngineServer } from '@memberjunction/actions';
|
|
75
|
+
|
|
76
|
+
// Configure the engine (typically done once at startup)
|
|
77
|
+
await ActionEngineServer.Instance.Config(false, contextUser);
|
|
78
|
+
|
|
79
|
+
// Find the action by name
|
|
80
|
+
const action = ActionEngineServer.Instance.Actions.find(a => a.Name === 'Send Email');
|
|
81
|
+
|
|
82
|
+
// Execute it
|
|
83
|
+
const result = await ActionEngineServer.Instance.RunAction({
|
|
84
|
+
Action: action,
|
|
85
|
+
ContextUser: contextUser,
|
|
86
|
+
Params: [
|
|
87
|
+
{ Name: 'to', Value: 'user@example.com', Type: 'Input' },
|
|
88
|
+
{ Name: 'subject', Value: 'Hello', Type: 'Input' },
|
|
89
|
+
{ Name: 'body', Value: 'Message content', Type: 'Input' }
|
|
90
|
+
],
|
|
91
|
+
Filters: []
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
if (result.Success) {
|
|
95
|
+
console.log('Action completed:', result.Message);
|
|
96
|
+
} else {
|
|
97
|
+
console.error('Action failed:', result.Message);
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Creating a Custom Action
|
|
102
|
+
|
|
103
|
+
All actions extend `BaseAction` and implement `InternalRunAction`. Register them with `@RegisterClass` so the engine can discover them via ClassFactory:
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
107
|
+
import { BaseAction } from '@memberjunction/actions';
|
|
108
|
+
import { RunActionParams, ActionResultSimple } from '@memberjunction/actions-base';
|
|
109
|
+
|
|
110
|
+
@RegisterClass(BaseAction, 'My Custom Action')
|
|
111
|
+
export class MyCustomAction extends BaseAction {
|
|
112
|
+
protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
|
|
113
|
+
const inputValue = params.Params.find(p => p.Name === 'input')?.Value;
|
|
114
|
+
|
|
115
|
+
// Your action logic here
|
|
116
|
+
const result = await this.doWork(inputValue);
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
Success: true,
|
|
120
|
+
ResultCode: 'SUCCESS',
|
|
121
|
+
Message: `Processed: ${result}`
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
private async doWork(input: string): Promise<string> {
|
|
126
|
+
// Delegate to service classes for real logic
|
|
127
|
+
return `Done with ${input}`;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Creating an OAuth-Authenticated Action
|
|
133
|
+
|
|
134
|
+
For actions that need to call external APIs with OAuth2 credentials:
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
138
|
+
import { BaseOAuthAction } from '@memberjunction/actions';
|
|
139
|
+
import { RunActionParams, ActionResultSimple } from '@memberjunction/actions-base';
|
|
140
|
+
|
|
141
|
+
@RegisterClass(BaseAction, 'Fetch External Data')
|
|
142
|
+
export class FetchExternalDataAction extends BaseOAuthAction {
|
|
143
|
+
protected async refreshAccessToken(): Promise<void> {
|
|
144
|
+
// Platform-specific token refresh logic
|
|
145
|
+
const response = await fetch('https://api.example.com/oauth/token', {
|
|
146
|
+
method: 'POST',
|
|
147
|
+
body: new URLSearchParams({
|
|
148
|
+
grant_type: 'refresh_token',
|
|
149
|
+
refresh_token: this.getRefreshToken(),
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
const data = await response.json();
|
|
153
|
+
await this.updateStoredTokens(data.access_token, data.refresh_token, data.expires_in);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
protected async InternalRunAction(params: RunActionParams): Promise<ActionResultSimple> {
|
|
157
|
+
const companyIntegrationId = params.Params.find(
|
|
158
|
+
p => p.Name === 'CompanyIntegrationID'
|
|
159
|
+
)?.Value as string;
|
|
160
|
+
|
|
161
|
+
// Initialize OAuth (loads tokens, refreshes if expired)
|
|
162
|
+
if (!await this.initializeOAuth(companyIntegrationId)) {
|
|
163
|
+
return this.handleOAuthError(new Error('OAuth initialization failed'));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Make authenticated request with automatic retry on 401
|
|
167
|
+
const data = await this.makeAuthenticatedRequest(async (token) => {
|
|
168
|
+
const res = await fetch('https://api.example.com/data', {
|
|
169
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
170
|
+
});
|
|
171
|
+
return res.json();
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
return { Success: true, ResultCode: 'SUCCESS', Message: JSON.stringify(data) };
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Using OAuth2Manager Directly
|
|
180
|
+
|
|
181
|
+
For standalone OAuth2 token management outside the action framework:
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
import { OAuth2Manager } from '@memberjunction/actions';
|
|
185
|
+
|
|
186
|
+
const oauth = new OAuth2Manager({
|
|
187
|
+
clientId: 'your-client-id',
|
|
188
|
+
clientSecret: 'your-client-secret',
|
|
189
|
+
tokenEndpoint: 'https://api.example.com/oauth/token',
|
|
190
|
+
scopes: ['read', 'write'],
|
|
191
|
+
onTokenUpdate: async (tokens) => {
|
|
192
|
+
// Persist tokens to your storage
|
|
193
|
+
await saveTokens(tokens);
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
// Get a valid token (auto-refreshes if expired)
|
|
198
|
+
const token = await oauth.getAccessToken();
|
|
199
|
+
|
|
200
|
+
// Or use client credentials flow
|
|
201
|
+
const tokenData = await oauth.getClientCredentialsToken();
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Architecture
|
|
205
|
+
|
|
206
|
+
### Action Execution Pipeline
|
|
207
|
+
|
|
208
|
+
The `ActionEngineServer.RunAction()` method follows this sequence:
|
|
209
|
+
|
|
210
|
+
```mermaid
|
|
211
|
+
sequenceDiagram
|
|
212
|
+
participant Caller
|
|
213
|
+
participant Engine as ActionEngineServer
|
|
214
|
+
participant Filter as BaseActionFilter
|
|
215
|
+
participant CF as ClassFactory
|
|
216
|
+
participant Action as BaseAction Subclass
|
|
217
|
+
participant Log as Execution Log
|
|
218
|
+
|
|
219
|
+
Caller->>Engine: RunAction(params)
|
|
220
|
+
Engine->>Engine: ValidateInputs(params)
|
|
221
|
+
alt Validation fails
|
|
222
|
+
Engine->>Log: StartAndEndActionLog()
|
|
223
|
+
Engine-->>Caller: {Success: false}
|
|
224
|
+
end
|
|
225
|
+
Engine->>Filter: RunFilters(params)
|
|
226
|
+
alt Filters block execution
|
|
227
|
+
Engine->>Log: StartAndEndActionLog()
|
|
228
|
+
Engine-->>Caller: {Success: true, "Filters blocked"}
|
|
229
|
+
end
|
|
230
|
+
Engine->>Log: StartActionLog()
|
|
231
|
+
Engine->>CF: CreateInstance(BaseAction, driverClass)
|
|
232
|
+
CF-->>Engine: action instance
|
|
233
|
+
Engine->>Action: Run(params)
|
|
234
|
+
Action->>Action: InternalRunAction(params)
|
|
235
|
+
Action-->>Engine: ActionResultSimple
|
|
236
|
+
Engine->>Log: EndActionLog()
|
|
237
|
+
Engine-->>Caller: ActionResult
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Entity Action Invocation
|
|
241
|
+
|
|
242
|
+
Entity actions are bound to entity lifecycle events. The `EntityActionEngineServer` delegates to invocation-type-specific handlers via ClassFactory:
|
|
243
|
+
|
|
244
|
+
```mermaid
|
|
245
|
+
classDiagram
|
|
246
|
+
class EntityActionInvocationBase {
|
|
247
|
+
<<abstract>>
|
|
248
|
+
+InvokeAction(params) EntityActionResult
|
|
249
|
+
+MapParams(params, entityActionParams, entity) ActionParam[]
|
|
250
|
+
+SafeEvalScript(id, script, entity) any
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
class SingleRecord {
|
|
254
|
+
+InvokeAction(params) EntityActionResult
|
|
255
|
+
+ValidateParams(params) boolean
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
class MultipleRecords {
|
|
259
|
+
+InvokeAction(params) EntityActionResult
|
|
260
|
+
#GetRecordList() BaseEntity[]
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
class Validate {
|
|
264
|
+
+InvokeAction(params) EntityActionResult
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
EntityActionInvocationBase <|-- SingleRecord
|
|
268
|
+
EntityActionInvocationBase <|-- MultipleRecords
|
|
269
|
+
SingleRecord <|-- Validate
|
|
270
|
+
|
|
271
|
+
note for SingleRecord "Registered for: Read, BeforeCreate,\nBeforeUpdate, BeforeDelete, AfterCreate,\nAfterUpdate, AfterDelete, SingleRecord"
|
|
272
|
+
note for MultipleRecords "Registered for: List, View"
|
|
273
|
+
note for Validate "Registered for: Validate"
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Class Hierarchy
|
|
277
|
+
|
|
278
|
+
```mermaid
|
|
279
|
+
classDiagram
|
|
280
|
+
class BaseAction {
|
|
281
|
+
<<abstract>>
|
|
282
|
+
+Run(params) ActionResultSimple
|
|
283
|
+
#InternalRunAction(params)* ActionResultSimple
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
class BaseOAuthAction {
|
|
287
|
+
<<abstract>>
|
|
288
|
+
#initializeOAuth(id) boolean
|
|
289
|
+
#getAccessToken() string
|
|
290
|
+
#makeAuthenticatedRequest(fn) T
|
|
291
|
+
#refreshAccessToken()* void
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
class BaseActionFilter {
|
|
295
|
+
<<abstract>>
|
|
296
|
+
+Run(params, filter) boolean
|
|
297
|
+
#InternalRun(params, filter)* boolean
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
class ActionEngineServer {
|
|
301
|
+
+RunAction(params) ActionResult
|
|
302
|
+
#ValidateInputs(params) boolean
|
|
303
|
+
#RunFilters(params) boolean
|
|
304
|
+
#InternalRunAction(params) ActionResult
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
class EntityActionEngineServer {
|
|
308
|
+
+RunEntityAction(params) EntityActionResult
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
class OAuth2Manager {
|
|
312
|
+
+getAccessToken() string
|
|
313
|
+
+getAuthorizationUrl() string
|
|
314
|
+
+exchangeAuthorizationCode(code) OAuth2TokenData
|
|
315
|
+
+getClientCredentialsToken() OAuth2TokenData
|
|
316
|
+
+refreshAccessToken() OAuth2TokenData
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
BaseAction <|-- BaseOAuthAction
|
|
320
|
+
ActionEngineServer --> BaseAction : dispatches to
|
|
321
|
+
ActionEngineServer --> BaseActionFilter : evaluates
|
|
322
|
+
EntityActionEngineServer --> ActionEngineServer : delegates to
|
|
323
|
+
BaseOAuthAction --> OAuth2Manager : can use
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## API Reference
|
|
327
|
+
|
|
328
|
+
### ActionEngineServer
|
|
329
|
+
|
|
330
|
+
Singleton engine that executes actions. Access via `ActionEngineServer.Instance`.
|
|
331
|
+
|
|
332
|
+
| Method | Description |
|
|
333
|
+
|--------|-------------|
|
|
334
|
+
| `Config(forceRefresh, contextUser)` | Initialize/refresh the engine's action and filter metadata |
|
|
335
|
+
| `RunAction(params)` | Execute an action through the full pipeline (validate, filter, dispatch, log) |
|
|
336
|
+
|
|
337
|
+
### BaseAction
|
|
338
|
+
|
|
339
|
+
Abstract base class for all action implementations.
|
|
340
|
+
|
|
341
|
+
| Method | Description |
|
|
342
|
+
|--------|-------------|
|
|
343
|
+
| `Run(params)` | Public entry point — calls `InternalRunAction` |
|
|
344
|
+
| `InternalRunAction(params)` | **Abstract** — implement your action logic here |
|
|
345
|
+
|
|
346
|
+
### BaseOAuthAction
|
|
347
|
+
|
|
348
|
+
Abstract base for actions requiring OAuth authentication. Extends `BaseAction`.
|
|
349
|
+
|
|
350
|
+
| Method | Description |
|
|
351
|
+
|--------|-------------|
|
|
352
|
+
| `initializeOAuth(companyIntegrationId)` | Load integration, check/refresh tokens |
|
|
353
|
+
| `getAccessToken()` | Get the current access token |
|
|
354
|
+
| `makeAuthenticatedRequest(fn)` | Execute a request with automatic retry on 401/403 |
|
|
355
|
+
| `refreshAccessToken()` | **Abstract** — implement platform-specific token refresh |
|
|
356
|
+
| `updateStoredTokens(access, refresh?, expiresIn?)` | Persist new tokens to the Company Integration entity |
|
|
357
|
+
| `handleOAuthError(error)` | Return a standardized error result for OAuth failures |
|
|
358
|
+
|
|
359
|
+
### BaseActionFilter
|
|
360
|
+
|
|
361
|
+
Abstract base for pre-execution filters.
|
|
362
|
+
|
|
363
|
+
| Method | Description |
|
|
364
|
+
|--------|-------------|
|
|
365
|
+
| `Run(params, filter)` | Public entry point — calls `InternalRun` |
|
|
366
|
+
| `InternalRun(params, filter)` | **Abstract** — implement filter logic, return `true` to allow execution |
|
|
367
|
+
|
|
368
|
+
### EntityActionEngineServer
|
|
369
|
+
|
|
370
|
+
Singleton engine for entity-bound actions. Access via `EntityActionEngineServer.Instance`.
|
|
371
|
+
|
|
372
|
+
| Method | Description |
|
|
373
|
+
|--------|-------------|
|
|
374
|
+
| `RunEntityAction(params)` | Execute an entity action, dispatching to the correct invocation type handler |
|
|
375
|
+
|
|
376
|
+
### OAuth2Manager
|
|
377
|
+
|
|
378
|
+
Standalone OAuth2 token manager supporting multiple grant types.
|
|
379
|
+
|
|
380
|
+
| Method | Description |
|
|
381
|
+
|--------|-------------|
|
|
382
|
+
| `getAccessToken()` | Get a valid token, auto-refreshing if needed (thread-safe) |
|
|
383
|
+
| `getAuthorizationUrl(state?)` | Build the authorization URL for auth code flow |
|
|
384
|
+
| `exchangeAuthorizationCode(code)` | Exchange an auth code for tokens |
|
|
385
|
+
| `getClientCredentialsToken()` | Obtain tokens via client credentials flow |
|
|
386
|
+
| `refreshAccessToken()` | Refresh using the stored refresh token |
|
|
387
|
+
| `setTokens(access, refresh?, expiresIn?)` | Set tokens obtained externally |
|
|
388
|
+
| `isTokenValid()` | Check if current token is valid (with buffer) |
|
|
389
|
+
|
|
390
|
+
## Dependencies
|
|
391
|
+
|
|
392
|
+
This package depends on:
|
|
393
|
+
|
|
394
|
+
- [@memberjunction/global](../../MJGlobal/README.md) — ClassFactory and `@RegisterClass` decorator
|
|
395
|
+
- [@memberjunction/core](../../MJCore/README.md) — `Metadata`, `RunView`, `BaseEntity`, logging utilities
|
|
396
|
+
- [@memberjunction/actions-base](../Base/README.md) — Shared types (`ActionEngineBase`, `RunActionParams`, `ActionResult`, etc.)
|
|
397
|
+
- [@memberjunction/core-entities](../../MJCoreEntities/README.md) — Generated entity classes (`ActionExecutionLogEntity`, `ActionFilterEntity`, etc.)
|
|
398
|
+
- [@memberjunction/ai](../../AI/Core/README.md) — AI model integration
|
|
399
|
+
- [@memberjunction/ai-core-plus](../../AI/CorePlus/README.md) — Extended AI utilities
|
|
400
|
+
- [@memberjunction/aiengine](../../AI/Engine/README.md) — AI engine orchestration
|
|
401
|
+
- [@memberjunction/ai-prompts](../../AI/Prompts/README.md) — AI prompt execution
|
|
402
|
+
|
|
403
|
+
## Related Packages
|
|
404
|
+
|
|
405
|
+
- [@memberjunction/actions-base](../Base/README.md) — Shared types and base classes used by both client and server
|
|
406
|
+
- [CoreActions](../CoreActions/) — Built-in action implementations (Create Record, generated actions, etc.)
|
|
407
|
+
- [ScheduledActions](../ScheduledActions/) — Scheduled action execution support
|
|
408
|
+
- [ApolloEnrichment](../ApolloEnrichment/) — Apollo data enrichment actions
|
|
409
|
+
- [ContentAutotag](../ContentAutotag/) — Content auto-tagging actions
|
|
410
|
+
- [CodeExecution](../CodeExecution/) — Dynamic code execution actions
|
|
411
|
+
|
|
412
|
+
For the Actions system philosophy and development guide, see the [Actions CLAUDE.md](../CLAUDE.md).
|
|
413
|
+
|
|
414
|
+
## Contributing
|
|
415
|
+
|
|
416
|
+
See the [MemberJunction Contributing Guide](../../../CONTRIBUTING.md) for development setup and guidelines.
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const global_1 = require("@memberjunction/global");
|
|
5
|
-
const EntityActionInvocationTypes_1 = require("./EntityActionInvocationTypes");
|
|
6
|
-
const actions_base_1 = require("@memberjunction/actions-base");
|
|
1
|
+
import { MJGlobal } from "@memberjunction/global";
|
|
2
|
+
import { EntityActionInvocationBase } from "./EntityActionInvocationTypes.js";
|
|
3
|
+
import { EntityActionEngineBase } from "@memberjunction/actions-base";
|
|
7
4
|
/**
|
|
8
5
|
* The purpose of this class is to handle the invocation of actions for entities in all of the supported invocation contexts.
|
|
9
6
|
*/
|
|
10
|
-
class EntityActionEngineServer extends
|
|
7
|
+
export class EntityActionEngineServer extends EntityActionEngineBase {
|
|
11
8
|
static get Instance() {
|
|
12
9
|
return super.Instance;
|
|
13
10
|
}
|
|
@@ -28,12 +25,11 @@ class EntityActionEngineServer extends actions_base_1.EntityActionEngineBase {
|
|
|
28
25
|
if (!params.InvocationType)
|
|
29
26
|
throw new Error('Invalid invocation type provided');
|
|
30
27
|
// now we have the invocation type, use the name as the key for ClassFactory create instance to get what we need
|
|
31
|
-
const invocationInstance =
|
|
28
|
+
const invocationInstance = MJGlobal.Instance.ClassFactory.CreateInstance(EntityActionInvocationBase, params.InvocationType.Name);
|
|
32
29
|
if (!invocationInstance)
|
|
33
30
|
throw new Error('Error creating instance of invocation type');
|
|
34
31
|
// now we have the instance, invoke the action
|
|
35
32
|
return invocationInstance.InvokeAction(params);
|
|
36
33
|
}
|
|
37
34
|
}
|
|
38
|
-
exports.EntityActionEngineServer = EntityActionEngineServer;
|
|
39
35
|
//# sourceMappingURL=EntityActionEngine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityActionEngine.js","sourceRoot":"","sources":["../../src/entity-actions/EntityActionEngine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EntityActionEngine.js","sourceRoot":"","sources":["../../src/entity-actions/EntityActionEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAoD,MAAM,8BAA8B,CAAC;AAExH;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,sBAAsB;IACzD,MAAM,KAAK,QAAQ;QACtB,OAAiC,KAAK,CAAC,QAAQ,CAAC;IACpD,CAAC;IAGD;;;;OAIG;IACI,KAAK,CAAC,eAAe,CAAC,MAAoC;QAC7D;;;;WAIG;QACH,IAAI,CAAC,MAAM,CAAC,YAAY;YACpB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAE/D,wDAAwD;QACxD,IAAI,CAAC,MAAM,CAAC,cAAc;YACtB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAExD,gHAAgH;QAChH,MAAM,kBAAkB,GAAG,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,cAAc,CAA6B,0BAA0B,EAAE,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC7J,IAAI,CAAC,kBAAkB;YACnB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAElE,8CAA8C;QAC9C,OAAO,kBAAkB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;CACJ"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const global_1 = require("@memberjunction/global");
|
|
11
|
-
const ActionEngine_1 = require("../generic/ActionEngine");
|
|
7
|
+
import { MJGlobal, RegisterClass, SafeJSONParse } from "@memberjunction/global";
|
|
8
|
+
import { ActionEngineServer } from "../generic/ActionEngine.js";
|
|
12
9
|
/**
|
|
13
10
|
* Base class for invocation of any entity action invocation type
|
|
14
11
|
*/
|
|
15
|
-
class EntityActionInvocationBase {
|
|
12
|
+
export class EntityActionInvocationBase {
|
|
16
13
|
constructor() {
|
|
17
14
|
this._scriptCache = new Map();
|
|
18
15
|
}
|
|
@@ -49,7 +46,7 @@ class EntityActionInvocationBase {
|
|
|
49
46
|
case 'Static':
|
|
50
47
|
// value could be a scalar or could be JSON. if JSON, we need to parse it so attempt to parse it and if we get a non-null value
|
|
51
48
|
// back then we use that, otherwise we use the original value
|
|
52
|
-
const jsonValue =
|
|
49
|
+
const jsonValue = SafeJSONParse(eap.Value);
|
|
53
50
|
if (jsonValue)
|
|
54
51
|
value = jsonValue;
|
|
55
52
|
else
|
|
@@ -105,7 +102,6 @@ class EntityActionInvocationBase {
|
|
|
105
102
|
}
|
|
106
103
|
}
|
|
107
104
|
}
|
|
108
|
-
exports.EntityActionInvocationBase = EntityActionInvocationBase;
|
|
109
105
|
/**
|
|
110
106
|
* Base class for invocation of any entity action invocation type that is single record oriented
|
|
111
107
|
*/
|
|
@@ -122,15 +118,15 @@ let EntityActionInvocationSingleRecord = class EntityActionInvocationSingleRecor
|
|
|
122
118
|
if (this.ValidateParams(params)) {
|
|
123
119
|
// now do the work
|
|
124
120
|
// get the class that is derived from BaseAction for the Action Name
|
|
125
|
-
await
|
|
121
|
+
await ActionEngineServer.Instance.Config(false, params.ContextUser);
|
|
126
122
|
// prepare the variables for the action
|
|
127
|
-
const action =
|
|
123
|
+
const action = ActionEngineServer.Instance.Actions.find(a => a.ID === params.EntityAction.ActionID);
|
|
128
124
|
const internalParams = await this.MapParams(action.Params, params.EntityAction.Params, params.EntityObject);
|
|
129
125
|
const filters = params.EntityAction.Filters.map(f => {
|
|
130
|
-
const filter =
|
|
126
|
+
const filter = ActionEngineServer.Instance.ActionFilters.find(fi => fi.ID === f.ActionFilterID);
|
|
131
127
|
return filter;
|
|
132
128
|
});
|
|
133
|
-
const result = await
|
|
129
|
+
const result = await ActionEngineServer.Instance.RunAction({
|
|
134
130
|
Action: action,
|
|
135
131
|
ContextUser: params.ContextUser,
|
|
136
132
|
Filters: filters,
|
|
@@ -142,17 +138,17 @@ let EntityActionInvocationSingleRecord = class EntityActionInvocationSingleRecor
|
|
|
142
138
|
return null;
|
|
143
139
|
}
|
|
144
140
|
};
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
(0, global_1.RegisterClass)(EntityActionInvocationBase, 'SingleRecord')
|
|
141
|
+
EntityActionInvocationSingleRecord = __decorate([
|
|
142
|
+
RegisterClass(EntityActionInvocationBase, 'Read'),
|
|
143
|
+
RegisterClass(EntityActionInvocationBase, 'BeforeCreate'),
|
|
144
|
+
RegisterClass(EntityActionInvocationBase, 'BeforeUpdate'),
|
|
145
|
+
RegisterClass(EntityActionInvocationBase, 'BeforeDelete'),
|
|
146
|
+
RegisterClass(EntityActionInvocationBase, 'AfterCreate'),
|
|
147
|
+
RegisterClass(EntityActionInvocationBase, 'AfterUpdate'),
|
|
148
|
+
RegisterClass(EntityActionInvocationBase, 'AfterDelete'),
|
|
149
|
+
RegisterClass(EntityActionInvocationBase, 'SingleRecord')
|
|
155
150
|
], EntityActionInvocationSingleRecord);
|
|
151
|
+
export { EntityActionInvocationSingleRecord };
|
|
156
152
|
/**
|
|
157
153
|
* Base class for invocation of any entity action invocation type that is multiple-record oriented. Handles
|
|
158
154
|
* getting the list of records from the provided parameters (either ListID or ViewID), getting the actual records
|
|
@@ -180,11 +176,11 @@ let EntityActionInvocationMultipleRecords = class EntityActionInvocationMultiple
|
|
|
180
176
|
if (this.ValidateParams(params)) {
|
|
181
177
|
// now do the work
|
|
182
178
|
// get the class that is derived from BaseAction for the Action Name
|
|
183
|
-
await
|
|
179
|
+
await ActionEngineServer.Instance.Config(false, params.ContextUser);
|
|
184
180
|
// prepare the variables for the action
|
|
185
|
-
const action =
|
|
181
|
+
const action = ActionEngineServer.Instance.Actions.find(a => a.ID === params.EntityAction.ActionID);
|
|
186
182
|
// get the priority sub-class for the SingleRecord invocation type that we need now
|
|
187
|
-
const invocationInstance =
|
|
183
|
+
const invocationInstance = MJGlobal.Instance.ClassFactory.CreateInstance(EntityActionInvocationBase, 'SingleRecord'); // get the single record class
|
|
188
184
|
if (!invocationInstance)
|
|
189
185
|
throw new Error('Error creating instance of invocation type');
|
|
190
186
|
// now, we loop through the list of records and invoke the action for each one
|
|
@@ -211,11 +207,11 @@ let EntityActionInvocationMultipleRecords = class EntityActionInvocationMultiple
|
|
|
211
207
|
return [];
|
|
212
208
|
}
|
|
213
209
|
};
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
(0, global_1.RegisterClass)(EntityActionInvocationBase, 'View')
|
|
210
|
+
EntityActionInvocationMultipleRecords = __decorate([
|
|
211
|
+
RegisterClass(EntityActionInvocationBase, 'List'),
|
|
212
|
+
RegisterClass(EntityActionInvocationBase, 'View')
|
|
218
213
|
], EntityActionInvocationMultipleRecords);
|
|
214
|
+
export { EntityActionInvocationMultipleRecords };
|
|
219
215
|
/**
|
|
220
216
|
* This class handles the invocation type of Validate and uses Entity Actions to validate a record and provide the results back to the caller
|
|
221
217
|
*/
|
|
@@ -224,14 +220,14 @@ let EntityActionInvocationValidate = class EntityActionInvocationValidate extend
|
|
|
224
220
|
// for this type of invocation we need to validate that the EntityObject is not null
|
|
225
221
|
if (this.ValidateParams(params)) {
|
|
226
222
|
// make sure the action engine is good to go, the below won't do anything if it was already configured
|
|
227
|
-
await
|
|
228
|
-
const action =
|
|
223
|
+
await ActionEngineServer.Instance.Config(false, params.ContextUser);
|
|
224
|
+
const action = ActionEngineServer.Instance.Actions.find(a => a.ID === params.EntityAction.ActionID);
|
|
229
225
|
const internalParams = await this.MapParams(action.Params, params.EntityAction.Params, params.EntityObject);
|
|
230
|
-
const result = await
|
|
226
|
+
const result = await ActionEngineServer.Instance.RunAction({
|
|
231
227
|
Action: action,
|
|
232
228
|
ContextUser: params.ContextUser,
|
|
233
229
|
Filters: params.EntityAction.Filters.map(f => {
|
|
234
|
-
const filter =
|
|
230
|
+
const filter = ActionEngineServer.Instance.ActionFilters.find(fi => fi.ID === f.ActionFilterID);
|
|
235
231
|
return filter;
|
|
236
232
|
}),
|
|
237
233
|
Params: internalParams
|
|
@@ -242,8 +238,8 @@ let EntityActionInvocationValidate = class EntityActionInvocationValidate extend
|
|
|
242
238
|
return null;
|
|
243
239
|
}
|
|
244
240
|
};
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
(0, global_1.RegisterClass)(EntityActionInvocationBase, 'Validate')
|
|
241
|
+
EntityActionInvocationValidate = __decorate([
|
|
242
|
+
RegisterClass(EntityActionInvocationBase, 'Validate')
|
|
248
243
|
], EntityActionInvocationValidate);
|
|
244
|
+
export { EntityActionInvocationValidate };
|
|
249
245
|
//# sourceMappingURL=EntityActionInvocationTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityActionInvocationTypes.js","sourceRoot":"","sources":["../../src/entity-actions/EntityActionInvocationTypes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EntityActionInvocationTypes.js","sourceRoot":"","sources":["../../src/entity-actions/EntityActionInvocationTypes.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIhF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAgB,0BAA0B;IAAhD;QAoEY,iBAAY,GAA0B,IAAI,GAAG,EAAoB,CAAC;IAmC9E,CAAC;IApGG;;;;OAIG;IACI,eAAe,CAAC,SAA8B,EAAE,SAAwE;QAC3H,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IACpG,CAAC;IAEM,mCAAmC,CAAC,MAAoB;QAC3D,OAAO;YACH,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;SAC5B,CAAA;IACL,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,SAAS,CAAC,MAA2B,EAAE,kBAA6C,EAAE,YAAwB;QACvH,MAAM,YAAY,GAAkB,EAAE,CAAC;QACvC,KAAK,M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