@memberjunction/scheduling-base-types 4.0.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.
Files changed (2) hide show
  1. package/README.md +105 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,105 @@
1
+ # @memberjunction/scheduling-base-types
2
+
3
+ Core type definitions for MemberJunction's scheduled jobs system. This lightweight package provides interfaces and type aliases used throughout the scheduling stack, with no heavy dependencies.
4
+
5
+ ## Architecture
6
+
7
+ ```mermaid
8
+ graph TD
9
+ A["@memberjunction/scheduling-base-types<br/>(Types Only)"]
10
+ B["@memberjunction/scheduling-engine-base<br/>(Metadata Cache)"] --> A
11
+ C["@memberjunction/scheduling-engine<br/>(Execution)"] --> A
12
+ D["@memberjunction/scheduling-actions<br/>(Agentic Tools)"] --> A
13
+
14
+ style A fill:#2d6a9f,stroke:#1a4971,color:#fff
15
+ style B fill:#2d8659,stroke:#1a5c3a,color:#fff
16
+ style C fill:#7c5295,stroke:#563a6b,color:#fff
17
+ style D fill:#b8762f,stroke:#8a5722,color:#fff
18
+ ```
19
+
20
+ ## Overview
21
+
22
+ This package defines the shared type contracts used across the entire scheduling subsystem. It is designed to be imported anywhere (client or server) without pulling in execution logic or heavy framework dependencies.
23
+
24
+ **Exported types:**
25
+
26
+ - **ScheduledJobResult**: Result returned by a scheduled job execution, including success/failure, error messages, and job-type-specific details
27
+ - **ScheduledJobConfiguration**: Base interface for job-specific configuration JSON
28
+ - **AgentJobConfiguration**: Configuration for AI Agent scheduled jobs (AgentID, ConversationID, etc.)
29
+ - **ActionJobConfiguration**: Configuration for Action scheduled jobs (ActionID, Params, etc.)
30
+ - **NotificationContent**: Structure for job notification messages (Subject, Body, Priority)
31
+ - **ScheduledJobRunStatus**: Union type for run statuses (`Running`, `Completed`, `Failed`, `Cancelled`, `Timeout`)
32
+ - **ScheduledJobStatus**: Union type for schedule statuses (`Pending`, `Active`, `Paused`, `Disabled`, `Expired`)
33
+ - **NotificationChannel**: Union type for notification delivery (`Email`, `InApp`)
34
+
35
+ ## Installation
36
+
37
+ ```bash
38
+ npm install @memberjunction/scheduling-base-types
39
+ ```
40
+
41
+ ## Usage
42
+
43
+ ```typescript
44
+ import {
45
+ ScheduledJobResult,
46
+ AgentJobConfiguration,
47
+ ActionJobConfiguration,
48
+ ScheduledJobRunStatus,
49
+ NotificationContent
50
+ } from '@memberjunction/scheduling-base-types';
51
+
52
+ // Job result from execution
53
+ const result: ScheduledJobResult = {
54
+ Success: true,
55
+ Details: {
56
+ AgentRunID: 'run-guid',
57
+ TokensUsed: 1500,
58
+ Cost: 0.023
59
+ }
60
+ };
61
+
62
+ // Agent job configuration
63
+ const agentConfig: AgentJobConfiguration = {
64
+ AgentID: 'agent-guid',
65
+ InitialMessage: 'Generate daily report',
66
+ ConfigurationID: 'config-guid'
67
+ };
68
+
69
+ // Action job configuration
70
+ const actionConfig: ActionJobConfiguration = {
71
+ ActionID: 'action-guid',
72
+ Params: [
73
+ { ActionParamID: 'param-1', ValueType: 'Static', Value: '42' },
74
+ { ActionParamID: 'param-2', ValueType: 'SQL Statement', Value: 'SELECT TOP 1 ID FROM Users' }
75
+ ]
76
+ };
77
+ ```
78
+
79
+ ## Type Reference
80
+
81
+ ### ScheduledJobResult
82
+
83
+ | Property | Type | Description |
84
+ |----------|------|-------------|
85
+ | `Success` | boolean | Whether the job completed successfully |
86
+ | `ErrorMessage` | string (optional) | Error message if the job failed |
87
+ | `Details` | Record (optional) | Job-type-specific execution details |
88
+
89
+ ### Status Types
90
+
91
+ | Type | Values |
92
+ |------|--------|
93
+ | `ScheduledJobRunStatus` | `Running`, `Completed`, `Failed`, `Cancelled`, `Timeout` |
94
+ | `ScheduledJobStatus` | `Pending`, `Active`, `Paused`, `Disabled`, `Expired` |
95
+ | `NotificationChannel` | `Email`, `InApp` |
96
+
97
+ ## Dependencies
98
+
99
+ | Package | Purpose |
100
+ |---------|---------|
101
+ | `@memberjunction/global` | MJGlobal shared utilities |
102
+
103
+ ## License
104
+
105
+ ISC
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@memberjunction/scheduling-base-types",
3
3
  "type": "module",
4
- "version": "4.0.0",
4
+ "version": "4.1.0",
5
5
  "description": "MemberJunction: Scheduling Base Types - core type definitions for the scheduled jobs system, usable anywhere without heavy dependencies",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "author": "MemberJunction.com",
16
16
  "license": "ISC",
17
17
  "dependencies": {
18
- "@memberjunction/global": "4.0.0"
18
+ "@memberjunction/global": "4.1.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/node": "24.10.11",