@memberjunction/scheduling-actions 2.107.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/dist/BaseJobAction.d.ts +99 -0
- package/dist/BaseJobAction.d.ts.map +1 -0
- package/dist/BaseJobAction.js +217 -0
- package/dist/BaseJobAction.js.map +1 -0
- package/dist/CreateJobAction.d.ts +45 -0
- package/dist/CreateJobAction.d.ts.map +1 -0
- package/dist/CreateJobAction.js +153 -0
- package/dist/CreateJobAction.js.map +1 -0
- package/dist/DeleteJobAction.d.ts +36 -0
- package/dist/DeleteJobAction.d.ts.map +1 -0
- package/dist/DeleteJobAction.js +103 -0
- package/dist/DeleteJobAction.js.map +1 -0
- package/dist/ExecuteJobNowAction.d.ts +36 -0
- package/dist/ExecuteJobNowAction.d.ts.map +1 -0
- package/dist/ExecuteJobNowAction.js +111 -0
- package/dist/ExecuteJobNowAction.js.map +1 -0
- package/dist/GetJobStatisticsAction.d.ts +38 -0
- package/dist/GetJobStatisticsAction.d.ts.map +1 -0
- package/dist/GetJobStatisticsAction.js +162 -0
- package/dist/GetJobStatisticsAction.js.map +1 -0
- package/dist/QueryJobsAction.d.ts +43 -0
- package/dist/QueryJobsAction.d.ts.map +1 -0
- package/dist/QueryJobsAction.js +125 -0
- package/dist/QueryJobsAction.js.map +1 -0
- package/dist/UpdateJobAction.d.ts +45 -0
- package/dist/UpdateJobAction.d.ts.map +1 -0
- package/dist/UpdateJobAction.js +152 -0
- package/dist/UpdateJobAction.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/package.json +29 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { BaseAction } from '@memberjunction/actions';
|
|
2
|
+
import { ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
3
|
+
import { UserInfo } from '@memberjunction/core';
|
|
4
|
+
import { ScheduledJobEntity } from '@memberjunction/core-entities';
|
|
5
|
+
/**
|
|
6
|
+
* Base class for all Scheduled Job-related actions.
|
|
7
|
+
* Provides common functionality for job operations including validation,
|
|
8
|
+
* filtering, and entity loading.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class BaseJobAction extends BaseAction {
|
|
11
|
+
/**
|
|
12
|
+
* Validate cron expression format
|
|
13
|
+
*
|
|
14
|
+
* @param cronExpression - The cron expression to validate
|
|
15
|
+
* @returns Object with valid flag and optional error message
|
|
16
|
+
*/
|
|
17
|
+
protected validateCronExpression(cronExpression: string): {
|
|
18
|
+
valid: boolean;
|
|
19
|
+
error?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Load a scheduled job entity by ID with error handling
|
|
23
|
+
*
|
|
24
|
+
* @param jobId - The ID of the job to load
|
|
25
|
+
* @param contextUser - The user context for the operation
|
|
26
|
+
* @returns Object with either the loaded job or an error result
|
|
27
|
+
*/
|
|
28
|
+
protected loadJob(jobId: string, contextUser: UserInfo): Promise<{
|
|
29
|
+
job?: ScheduledJobEntity;
|
|
30
|
+
error?: ActionResultSimple;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Validate job status value
|
|
34
|
+
*
|
|
35
|
+
* @param status - The status value to validate
|
|
36
|
+
* @returns True if the status is valid
|
|
37
|
+
*/
|
|
38
|
+
protected isValidStatus(status: string): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Build filter expression for job queries
|
|
41
|
+
*
|
|
42
|
+
* @param filters - Object containing optional filter criteria
|
|
43
|
+
* @returns SQL WHERE clause string
|
|
44
|
+
*/
|
|
45
|
+
protected buildJobFilter(filters: {
|
|
46
|
+
status?: string;
|
|
47
|
+
jobTypeId?: string;
|
|
48
|
+
isActive?: boolean;
|
|
49
|
+
createdAfter?: Date;
|
|
50
|
+
createdBefore?: Date;
|
|
51
|
+
}): string;
|
|
52
|
+
/**
|
|
53
|
+
* Get parameter value by name (case-insensitive)
|
|
54
|
+
*
|
|
55
|
+
* @param params - The action parameters
|
|
56
|
+
* @param name - Parameter name to find
|
|
57
|
+
* @returns The parameter value or undefined
|
|
58
|
+
*/
|
|
59
|
+
protected getParamValue(params: RunActionParams, name: string): string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Get numeric parameter with default value
|
|
62
|
+
*
|
|
63
|
+
* @param params - The action parameters
|
|
64
|
+
* @param name - Parameter name to find
|
|
65
|
+
* @param defaultValue - Default value if parameter is missing or invalid
|
|
66
|
+
* @returns The numeric parameter value or default
|
|
67
|
+
*/
|
|
68
|
+
protected getNumericParam(params: RunActionParams, name: string, defaultValue: number): number;
|
|
69
|
+
/**
|
|
70
|
+
* Get boolean parameter with default value
|
|
71
|
+
*
|
|
72
|
+
* @param params - The action parameters
|
|
73
|
+
* @param name - Parameter name to find
|
|
74
|
+
* @param defaultValue - Default value if parameter is missing
|
|
75
|
+
* @returns The boolean parameter value or default
|
|
76
|
+
*/
|
|
77
|
+
protected getBooleanParam(params: RunActionParams, name: string, defaultValue: boolean): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Get date parameter
|
|
80
|
+
*
|
|
81
|
+
* @param params - The action parameters
|
|
82
|
+
* @param name - Parameter name to find
|
|
83
|
+
* @returns The date value or undefined
|
|
84
|
+
*/
|
|
85
|
+
protected getDateParam(params: RunActionParams, name: string): Date | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Add an output parameter to the result
|
|
88
|
+
*
|
|
89
|
+
* @param params - The action parameters
|
|
90
|
+
* @param name - Output parameter name
|
|
91
|
+
* @param value - Output parameter value
|
|
92
|
+
*/
|
|
93
|
+
protected addOutputParam(params: RunActionParams, name: string, value: unknown): void;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Loader function to prevent tree shaking
|
|
97
|
+
*/
|
|
98
|
+
export declare function LoadBaseJobAction(): void;
|
|
99
|
+
//# sourceMappingURL=BaseJobAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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GAAG,MAAM;IAS9F;;;;;;;OAOG;IACH,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO;IAYhG;;;;;;OAMG;IACH,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAS/E;;;;;;OAMG;IACH,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;CAOxF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,SAEhC"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
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;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
+
if (mod && mod.__esModule) return mod;
|
|
26
|
+
var result = {};
|
|
27
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
+
__setModuleDefault(result, mod);
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.LoadBaseJobAction = exports.BaseJobAction = void 0;
|
|
33
|
+
const actions_1 = require("@memberjunction/actions");
|
|
34
|
+
const global_1 = require("@memberjunction/global");
|
|
35
|
+
const core_1 = require("@memberjunction/core");
|
|
36
|
+
const cronParser = __importStar(require("cron-parser"));
|
|
37
|
+
/**
|
|
38
|
+
* Base class for all Scheduled Job-related actions.
|
|
39
|
+
* Provides common functionality for job operations including validation,
|
|
40
|
+
* filtering, and entity loading.
|
|
41
|
+
*/
|
|
42
|
+
let BaseJobAction = class BaseJobAction extends actions_1.BaseAction {
|
|
43
|
+
/**
|
|
44
|
+
* Validate cron expression format
|
|
45
|
+
*
|
|
46
|
+
* @param cronExpression - The cron expression to validate
|
|
47
|
+
* @returns Object with valid flag and optional error message
|
|
48
|
+
*/
|
|
49
|
+
validateCronExpression(cronExpression) {
|
|
50
|
+
if (!cronExpression || cronExpression.trim().length === 0) {
|
|
51
|
+
return {
|
|
52
|
+
valid: false,
|
|
53
|
+
error: 'Cron expression cannot be empty'
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
cronParser.parseExpression(cronExpression);
|
|
58
|
+
return { valid: true };
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
return {
|
|
62
|
+
valid: false,
|
|
63
|
+
error: `Invalid cron expression: ${error instanceof Error ? error.message : String(error)}`
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Load a scheduled job entity by ID with error handling
|
|
69
|
+
*
|
|
70
|
+
* @param jobId - The ID of the job to load
|
|
71
|
+
* @param contextUser - The user context for the operation
|
|
72
|
+
* @returns Object with either the loaded job or an error result
|
|
73
|
+
*/
|
|
74
|
+
async loadJob(jobId, contextUser) {
|
|
75
|
+
if (!jobId) {
|
|
76
|
+
return {
|
|
77
|
+
error: {
|
|
78
|
+
Success: false,
|
|
79
|
+
ResultCode: 'VALIDATION_ERROR',
|
|
80
|
+
Message: 'JobID parameter is required'
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const md = new core_1.Metadata();
|
|
85
|
+
const job = await md.GetEntityObject('MJ: Scheduled Jobs', contextUser);
|
|
86
|
+
const loadResult = await job.Load(jobId);
|
|
87
|
+
if (!loadResult) {
|
|
88
|
+
return {
|
|
89
|
+
error: {
|
|
90
|
+
Success: false,
|
|
91
|
+
ResultCode: 'NOT_FOUND',
|
|
92
|
+
Message: `Scheduled job with ID ${jobId} not found`
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return { job };
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Validate job status value
|
|
100
|
+
*
|
|
101
|
+
* @param status - The status value to validate
|
|
102
|
+
* @returns True if the status is valid
|
|
103
|
+
*/
|
|
104
|
+
isValidStatus(status) {
|
|
105
|
+
const validStatuses = ['Active', 'Disabled', 'Expired', 'Paused', 'Pending'];
|
|
106
|
+
return validStatuses.includes(status);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Build filter expression for job queries
|
|
110
|
+
*
|
|
111
|
+
* @param filters - Object containing optional filter criteria
|
|
112
|
+
* @returns SQL WHERE clause string
|
|
113
|
+
*/
|
|
114
|
+
buildJobFilter(filters) {
|
|
115
|
+
const conditions = [];
|
|
116
|
+
if (filters.status) {
|
|
117
|
+
conditions.push(`Status = '${filters.status}'`);
|
|
118
|
+
}
|
|
119
|
+
if (filters.jobTypeId) {
|
|
120
|
+
conditions.push(`JobTypeID = '${filters.jobTypeId}'`);
|
|
121
|
+
}
|
|
122
|
+
if (filters.createdAfter) {
|
|
123
|
+
conditions.push(`__mj_CreatedAt >= '${filters.createdAfter.toISOString()}'`);
|
|
124
|
+
}
|
|
125
|
+
if (filters.createdBefore) {
|
|
126
|
+
conditions.push(`__mj_CreatedAt <= '${filters.createdBefore.toISOString()}'`);
|
|
127
|
+
}
|
|
128
|
+
return conditions.join(' AND ');
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Get parameter value by name (case-insensitive)
|
|
132
|
+
*
|
|
133
|
+
* @param params - The action parameters
|
|
134
|
+
* @param name - Parameter name to find
|
|
135
|
+
* @returns The parameter value or undefined
|
|
136
|
+
*/
|
|
137
|
+
getParamValue(params, name) {
|
|
138
|
+
const param = params.Params.find(p => p.Name.toLowerCase() === name.toLowerCase());
|
|
139
|
+
return param?.Value;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get numeric parameter with default value
|
|
143
|
+
*
|
|
144
|
+
* @param params - The action parameters
|
|
145
|
+
* @param name - Parameter name to find
|
|
146
|
+
* @param defaultValue - Default value if parameter is missing or invalid
|
|
147
|
+
* @returns The numeric parameter value or default
|
|
148
|
+
*/
|
|
149
|
+
getNumericParam(params, name, defaultValue) {
|
|
150
|
+
const value = this.getParamValue(params, name);
|
|
151
|
+
if (value === undefined || value === null) {
|
|
152
|
+
return defaultValue;
|
|
153
|
+
}
|
|
154
|
+
const num = Number(value);
|
|
155
|
+
return isNaN(num) ? defaultValue : num;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Get boolean parameter with default value
|
|
159
|
+
*
|
|
160
|
+
* @param params - The action parameters
|
|
161
|
+
* @param name - Parameter name to find
|
|
162
|
+
* @param defaultValue - Default value if parameter is missing
|
|
163
|
+
* @returns The boolean parameter value or default
|
|
164
|
+
*/
|
|
165
|
+
getBooleanParam(params, name, defaultValue) {
|
|
166
|
+
const value = this.getParamValue(params, name);
|
|
167
|
+
if (value === undefined || value === null) {
|
|
168
|
+
return defaultValue;
|
|
169
|
+
}
|
|
170
|
+
if (typeof value === 'boolean') {
|
|
171
|
+
return value;
|
|
172
|
+
}
|
|
173
|
+
const strValue = String(value).toLowerCase();
|
|
174
|
+
return strValue === 'true' || strValue === '1' || strValue === 'yes';
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Get date parameter
|
|
178
|
+
*
|
|
179
|
+
* @param params - The action parameters
|
|
180
|
+
* @param name - Parameter name to find
|
|
181
|
+
* @returns The date value or undefined
|
|
182
|
+
*/
|
|
183
|
+
getDateParam(params, name) {
|
|
184
|
+
const value = this.getParamValue(params, name);
|
|
185
|
+
if (!value) {
|
|
186
|
+
return undefined;
|
|
187
|
+
}
|
|
188
|
+
const date = new Date(value);
|
|
189
|
+
return isNaN(date.getTime()) ? undefined : date;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Add an output parameter to the result
|
|
193
|
+
*
|
|
194
|
+
* @param params - The action parameters
|
|
195
|
+
* @param name - Output parameter name
|
|
196
|
+
* @param value - Output parameter value
|
|
197
|
+
*/
|
|
198
|
+
addOutputParam(params, name, value) {
|
|
199
|
+
params.Params.push({
|
|
200
|
+
Name: name,
|
|
201
|
+
Value: value,
|
|
202
|
+
Type: 'Output'
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
exports.BaseJobAction = BaseJobAction;
|
|
207
|
+
exports.BaseJobAction = BaseJobAction = __decorate([
|
|
208
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, 'Base Job Action')
|
|
209
|
+
], BaseJobAction);
|
|
210
|
+
/**
|
|
211
|
+
* Loader function to prevent tree shaking
|
|
212
|
+
*/
|
|
213
|
+
function LoadBaseJobAction() {
|
|
214
|
+
// Stub function - ensures class is included in bundle
|
|
215
|
+
}
|
|
216
|
+
exports.LoadBaseJobAction = LoadBaseJobAction;
|
|
217
|
+
//# sourceMappingURL=BaseJobAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseJobAction.js","sourceRoot":"","sources":["../src/BaseJobAction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAqD;AAErD,mDAAuD;AACvD,+CAAmE;AAEnE,wDAA0C;AAE1C;;;;GAIG;AAEI,IAAe,aAAa,GAA5B,MAAe,aAAc,SAAQ,oBAAU;IAClD;;;;;OAKG;IACO,sBAAsB,CAAC,cAAsB;QACnD,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxD,OAAO;gBACH,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,iCAAiC;aAC3C,CAAC;QACN,CAAC;QAED,IAAI,CAAC;YACD,UAAU,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;YAC3C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO;gBACH,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,4BAA4B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;aAC9F,CAAC;QACN,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACO,KAAK,CAAC,OAAO,CACnB,KAAa,EACb,WAAqB;QAErB,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,OAAO;gBACH,KAAK,EAAE;oBACH,OAAO,EAAE,KAAK;oBACd,UAAU,EAAE,kBAAkB;oBAC9B,OAAO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OAAO,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,GAAG,IAAI,QAAQ,KAAK,KAAK,CAAC;IACzE,CAAC;IAED;;;;;;OAMG;IACO,YAAY,CAAC,MAAuB,EAAE,IAAY;QACxD,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;IACpD,CAAC;IAED;;;;;;OAMG;IACO,cAAc,CAAC,MAAuB,EAAE,IAAY,EAAE,KAAc;QAC1E,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,QAAQ;SACjB,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AA7LqB,sCAAa;wBAAb,aAAa;IADlC,IAAA,sBAAa,EAAC,oBAAU,EAAE,iBAAiB,CAAC;GACvB,aAAa,CA6LlC;AAED;;GAEG;AACH,SAAgB,iBAAiB;IAC7B,sDAAsD;AAC1D,CAAC;AAFD,8CAEC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
2
|
+
import { BaseJobAction } from './BaseJobAction';
|
|
3
|
+
/**
|
|
4
|
+
* Create Scheduled Job action.
|
|
5
|
+
* Creates a new scheduled job with the specified configuration.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* await RunAction({
|
|
10
|
+
* ActionName: 'Create Scheduled Job',
|
|
11
|
+
* Params: [
|
|
12
|
+
* { Name: 'Name', Value: 'Daily Data Sync' },
|
|
13
|
+
* { Name: 'JobTypeID', Value: 'F3C4A5B6-...' },
|
|
14
|
+
* { Name: 'CronExpression', Value: '0 0 * * *' },
|
|
15
|
+
* { Name: 'IsActive', Value: 'true' }
|
|
16
|
+
* ]
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class CreateScheduledJobAction extends BaseJobAction {
|
|
21
|
+
/**
|
|
22
|
+
* Creates a new scheduled job record
|
|
23
|
+
*
|
|
24
|
+
* @param params - The action parameters containing:
|
|
25
|
+
* - Name (required): Job name
|
|
26
|
+
* - JobTypeID (required): ID of the job type
|
|
27
|
+
* - CronExpression (required): Cron schedule expression
|
|
28
|
+
* - IsActive (optional): Whether job is active (default: true)
|
|
29
|
+
* - Status (optional): Job status (default: Active)
|
|
30
|
+
* - IntervalMinutes (optional): Polling interval in minutes
|
|
31
|
+
* - IntervalDays (optional): Polling interval in days
|
|
32
|
+
* - Description (optional): Job description
|
|
33
|
+
*
|
|
34
|
+
* @returns ActionResultSimple with:
|
|
35
|
+
* - Success: true if job was created successfully
|
|
36
|
+
* - ResultCode: SUCCESS, VALIDATION_ERROR, or FAILED
|
|
37
|
+
* - Params: Output parameter 'JobID' contains the ID of the created job
|
|
38
|
+
*/
|
|
39
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Loader function to prevent tree shaking
|
|
43
|
+
*/
|
|
44
|
+
export declare function LoadCreateScheduledJobAction(): void;
|
|
45
|
+
//# sourceMappingURL=CreateJobAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateJobAction.d.ts","sourceRoot":"","sources":["../src/CreateJobAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAKnF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,wBAAyB,SAAQ,aAAa;IACvD;;;;;;;;;;;;;;;;;OAiBG;cACa,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAyG1F;AAED;;GAEG;AACH,wBAAgB,4BAA4B,SAE3C"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.LoadCreateScheduledJobAction = exports.CreateScheduledJobAction = void 0;
|
|
10
|
+
const global_1 = require("@memberjunction/global");
|
|
11
|
+
const actions_1 = require("@memberjunction/actions");
|
|
12
|
+
const core_1 = require("@memberjunction/core");
|
|
13
|
+
const BaseJobAction_1 = require("./BaseJobAction");
|
|
14
|
+
/**
|
|
15
|
+
* Create Scheduled Job action.
|
|
16
|
+
* Creates a new scheduled job with the specified configuration.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* await RunAction({
|
|
21
|
+
* ActionName: 'Create Scheduled Job',
|
|
22
|
+
* Params: [
|
|
23
|
+
* { Name: 'Name', Value: 'Daily Data Sync' },
|
|
24
|
+
* { Name: 'JobTypeID', Value: 'F3C4A5B6-...' },
|
|
25
|
+
* { Name: 'CronExpression', Value: '0 0 * * *' },
|
|
26
|
+
* { Name: 'IsActive', Value: 'true' }
|
|
27
|
+
* ]
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
let CreateScheduledJobAction = class CreateScheduledJobAction extends BaseJobAction_1.BaseJobAction {
|
|
32
|
+
/**
|
|
33
|
+
* Creates a new scheduled job record
|
|
34
|
+
*
|
|
35
|
+
* @param params - The action parameters containing:
|
|
36
|
+
* - Name (required): Job name
|
|
37
|
+
* - JobTypeID (required): ID of the job type
|
|
38
|
+
* - CronExpression (required): Cron schedule expression
|
|
39
|
+
* - IsActive (optional): Whether job is active (default: true)
|
|
40
|
+
* - Status (optional): Job status (default: Active)
|
|
41
|
+
* - IntervalMinutes (optional): Polling interval in minutes
|
|
42
|
+
* - IntervalDays (optional): Polling interval in days
|
|
43
|
+
* - Description (optional): Job description
|
|
44
|
+
*
|
|
45
|
+
* @returns ActionResultSimple with:
|
|
46
|
+
* - Success: true if job was created successfully
|
|
47
|
+
* - ResultCode: SUCCESS, VALIDATION_ERROR, or FAILED
|
|
48
|
+
* - Params: Output parameter 'JobID' contains the ID of the created job
|
|
49
|
+
*/
|
|
50
|
+
async InternalRunAction(params) {
|
|
51
|
+
try {
|
|
52
|
+
// Extract required parameters
|
|
53
|
+
const name = this.getParamValue(params, 'Name');
|
|
54
|
+
const jobTypeId = this.getParamValue(params, 'JobTypeID');
|
|
55
|
+
const cronExpression = this.getParamValue(params, 'CronExpression');
|
|
56
|
+
// Validate required parameters
|
|
57
|
+
if (!name) {
|
|
58
|
+
return {
|
|
59
|
+
Success: false,
|
|
60
|
+
ResultCode: 'VALIDATION_ERROR',
|
|
61
|
+
Message: 'Name parameter is required'
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
if (!jobTypeId) {
|
|
65
|
+
return {
|
|
66
|
+
Success: false,
|
|
67
|
+
ResultCode: 'VALIDATION_ERROR',
|
|
68
|
+
Message: 'JobTypeID parameter is required'
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (!cronExpression) {
|
|
72
|
+
return {
|
|
73
|
+
Success: false,
|
|
74
|
+
ResultCode: 'VALIDATION_ERROR',
|
|
75
|
+
Message: 'CronExpression parameter is required'
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
// Validate cron expression
|
|
79
|
+
const cronValidation = this.validateCronExpression(cronExpression);
|
|
80
|
+
if (!cronValidation.valid) {
|
|
81
|
+
return {
|
|
82
|
+
Success: false,
|
|
83
|
+
ResultCode: 'VALIDATION_ERROR',
|
|
84
|
+
Message: cronValidation.error || 'Invalid cron expression'
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
// Extract optional parameters
|
|
88
|
+
const isActive = this.getBooleanParam(params, 'IsActive', true);
|
|
89
|
+
const status = this.getParamValue(params, 'Status') || 'Active';
|
|
90
|
+
const intervalMinutes = this.getNumericParam(params, 'IntervalMinutes', 0);
|
|
91
|
+
const intervalDays = this.getNumericParam(params, 'IntervalDays', 0);
|
|
92
|
+
const description = this.getParamValue(params, 'Description');
|
|
93
|
+
// Validate status
|
|
94
|
+
if (!this.isValidStatus(status)) {
|
|
95
|
+
return {
|
|
96
|
+
Success: false,
|
|
97
|
+
ResultCode: 'VALIDATION_ERROR',
|
|
98
|
+
Message: `Invalid status: ${status}. Valid values are: Active, Disabled`
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
// Create entity object
|
|
102
|
+
const md = new core_1.Metadata();
|
|
103
|
+
const job = await md.GetEntityObject('MJ: Scheduled Jobs', params.ContextUser);
|
|
104
|
+
// Set required fields
|
|
105
|
+
job.NewRecord();
|
|
106
|
+
job.Name = name;
|
|
107
|
+
job.JobTypeID = jobTypeId;
|
|
108
|
+
job.CronExpression = cronExpression;
|
|
109
|
+
job.Status = status;
|
|
110
|
+
// Set optional fields - timezone defaults to UTC
|
|
111
|
+
job.Timezone = 'UTC';
|
|
112
|
+
if (description) {
|
|
113
|
+
job.Description = description;
|
|
114
|
+
}
|
|
115
|
+
// Save the record
|
|
116
|
+
const saveResult = await job.Save();
|
|
117
|
+
if (!saveResult) {
|
|
118
|
+
return {
|
|
119
|
+
Success: false,
|
|
120
|
+
ResultCode: 'FAILED',
|
|
121
|
+
Message: `Failed to create scheduled job: ${job.LatestResult?.Message || 'Unknown error'}`
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
// Return the created job ID
|
|
125
|
+
this.addOutputParam(params, 'JobID', job.ID);
|
|
126
|
+
return {
|
|
127
|
+
Success: true,
|
|
128
|
+
ResultCode: 'SUCCESS',
|
|
129
|
+
Message: `Created scheduled job '${name}' with ID: ${job.ID}`,
|
|
130
|
+
Params: params.Params
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
return {
|
|
135
|
+
Success: false,
|
|
136
|
+
ResultCode: 'FAILED',
|
|
137
|
+
Message: `Error creating scheduled job: ${error instanceof Error ? error.message : String(error)}`
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
exports.CreateScheduledJobAction = CreateScheduledJobAction;
|
|
143
|
+
exports.CreateScheduledJobAction = CreateScheduledJobAction = __decorate([
|
|
144
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, 'Create Scheduled Job')
|
|
145
|
+
], CreateScheduledJobAction);
|
|
146
|
+
/**
|
|
147
|
+
* Loader function to prevent tree shaking
|
|
148
|
+
*/
|
|
149
|
+
function LoadCreateScheduledJobAction() {
|
|
150
|
+
// Stub function - ensures class is included in bundle
|
|
151
|
+
}
|
|
152
|
+
exports.LoadCreateScheduledJobAction = LoadCreateScheduledJobAction;
|
|
153
|
+
//# sourceMappingURL=CreateJobAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateJobAction.js","sourceRoot":"","sources":["../src/CreateJobAction.ts"],"names":[],"mappings":";;;;;;;;;AACA,mDAAuD;AACvD,qDAAqD;AACrD,+CAAgD;AAEhD,mDAAgD;AAEhD;;;;;;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U,EAAE,CAAC;gBACd,OAAO;oBACH,OAAO,EAAE,KAAK;oBACd,UAAU,EAAE,QAAQ;oBACpB,OAAO,EAAE,mCAAmC,GAAG,CAAC,YAAY,EAAE,OAAO,IAAI,eAAe,EAAE;iBAC7F,CAAC;YACN,CAAC;YAED,4BAA4B;YAC5B,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;YAE7C,OAAO;gBACH,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,SAAS;gBACrB,OAAO,EAAE,0BAA0B,IAAI,cAAc,GAAG,CAAC,EAAE,EAAE;gBAC7D,MAAM,EAAE,MAAM,CAAC,MAAM;aACxB,CAAC;QAEN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO;gBACH,OAAO,EAAE,KAAK;gBACd,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE,iCAAiC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;aACrG,CAAC;QACN,CAAC;IACL,CAAC;CACJ,CAAA;AA5HY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,sBAAa,EAAC,oBAAU,EAAE,sBAAsB,CAAC;GACrC,wBAAwB,CA4HpC;AAED;;GAEG;AACH,SAAgB,4BAA4B;IACxC,sDAAsD;AAC1D,CAAC;AAFD,oEAEC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
2
|
+
import { BaseJobAction } from './BaseJobAction';
|
|
3
|
+
/**
|
|
4
|
+
* Delete Scheduled Job action.
|
|
5
|
+
* Deletes an existing scheduled job from the system.
|
|
6
|
+
* Will fail if the job has related records that prevent deletion.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* await RunAction({
|
|
11
|
+
* ActionName: 'Delete Scheduled Job',
|
|
12
|
+
* Params: [
|
|
13
|
+
* { Name: 'JobID', Value: 'F3C4A5B6-...' }
|
|
14
|
+
* ]
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class DeleteScheduledJobAction extends BaseJobAction {
|
|
19
|
+
/**
|
|
20
|
+
* Deletes a scheduled job record
|
|
21
|
+
*
|
|
22
|
+
* @param params - The action parameters containing:
|
|
23
|
+
* - JobID (required): ID of the job to delete
|
|
24
|
+
*
|
|
25
|
+
* @returns ActionResultSimple with:
|
|
26
|
+
* - Success: true if job was deleted successfully
|
|
27
|
+
* - ResultCode: SUCCESS, VALIDATION_ERROR, NOT_FOUND, REFERENCE_CONSTRAINT, or FAILED
|
|
28
|
+
* - Message: Description of the result
|
|
29
|
+
*/
|
|
30
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Loader function to prevent tree shaking
|
|
34
|
+
*/
|
|
35
|
+
export declare function LoadDeleteScheduledJobAction(): void;
|
|
36
|
+
//# sourceMappingURL=DeleteJobAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeleteJobAction.d.ts","sourceRoot":"","sources":["../src/DeleteJobAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGnF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,qBACa,wBAAyB,SAAQ,aAAa;IACvD;;;;;;;;;;OAUG;cACa,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA2D1F;AAED;;GAEG;AACH,wBAAgB,4BAA4B,SAE3C"}
|