@memberjunction/archiving-action 6.2.0-edge.0 → 6.2.0-edge.2
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.
|
@@ -13,6 +13,6 @@ export declare class ArchiveDataAction extends BaseAction {
|
|
|
13
13
|
/**
|
|
14
14
|
* Extracts a parameter value by name (case-insensitive) from the action params.
|
|
15
15
|
*/
|
|
16
|
-
private
|
|
16
|
+
private getParamValue;
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=ArchiveDataAction.d.ts.map
|
|
@@ -18,7 +18,7 @@ import { ArchiveEngine } from '@memberjunction/archiving-engine';
|
|
|
18
18
|
*/
|
|
19
19
|
let ArchiveDataAction = class ArchiveDataAction extends BaseAction {
|
|
20
20
|
async InternalRunAction(params) {
|
|
21
|
-
const configId = this.
|
|
21
|
+
const configId = this.getParamValue(params, 'configurationid');
|
|
22
22
|
if (!configId) {
|
|
23
23
|
return {
|
|
24
24
|
Success: false,
|
|
@@ -57,7 +57,7 @@ let ArchiveDataAction = class ArchiveDataAction extends BaseAction {
|
|
|
57
57
|
/**
|
|
58
58
|
* Extracts a parameter value by name (case-insensitive) from the action params.
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
getParamValue(params, name) {
|
|
61
61
|
const lowerName = name.toLowerCase();
|
|
62
62
|
const param = params.Params.find(p => p.Name.toLowerCase() === lowerName);
|
|
63
63
|
return param?.Value != null ? String(param.Value) : undefined;
|
|
@@ -13,6 +13,6 @@ export declare class RestoreRecordAction extends BaseAction {
|
|
|
13
13
|
/**
|
|
14
14
|
* Extracts a parameter value by name (case-insensitive) from the action params.
|
|
15
15
|
*/
|
|
16
|
-
private
|
|
16
|
+
private getParamValue;
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=RestoreRecordAction.d.ts.map
|
|
@@ -18,7 +18,7 @@ import { ArchiveEngine } from '@memberjunction/archiving-engine';
|
|
|
18
18
|
*/
|
|
19
19
|
let RestoreRecordAction = class RestoreRecordAction extends BaseAction {
|
|
20
20
|
async InternalRunAction(params) {
|
|
21
|
-
const detailId = this.
|
|
21
|
+
const detailId = this.getParamValue(params, 'archiverundetailid');
|
|
22
22
|
if (!detailId) {
|
|
23
23
|
return {
|
|
24
24
|
Success: false,
|
|
@@ -56,7 +56,7 @@ let RestoreRecordAction = class RestoreRecordAction extends BaseAction {
|
|
|
56
56
|
/**
|
|
57
57
|
* Extracts a parameter value by name (case-insensitive) from the action params.
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
getParamValue(params, name) {
|
|
60
60
|
const lowerName = name.toLowerCase();
|
|
61
61
|
const param = params.Params.find(p => p.Name.toLowerCase() === lowerName);
|
|
62
62
|
return param?.Value != null ? String(param.Value) : undefined;
|
|
@@ -12,15 +12,15 @@ export declare class RunAllActiveArchivesAction extends BaseAction {
|
|
|
12
12
|
/**
|
|
13
13
|
* Queries the database for all active ArchiveConfiguration IDs.
|
|
14
14
|
*/
|
|
15
|
-
private
|
|
15
|
+
private loadActiveConfigurationIds;
|
|
16
16
|
/**
|
|
17
17
|
* Executes all configurations sequentially. Sequential execution prevents
|
|
18
18
|
* overwhelming the storage backend and database with concurrent archive runs.
|
|
19
19
|
*/
|
|
20
|
-
private
|
|
20
|
+
private executeAllConfigurations;
|
|
21
21
|
/**
|
|
22
22
|
* Aggregates individual run results into a single ActionResultSimple.
|
|
23
23
|
*/
|
|
24
|
-
private
|
|
24
|
+
private buildSummaryResult;
|
|
25
25
|
}
|
|
26
26
|
//# sourceMappingURL=RunAllActiveArchivesAction.d.ts.map
|
|
@@ -18,7 +18,7 @@ import { ArchiveEngine } from '@memberjunction/archiving-engine';
|
|
|
18
18
|
let RunAllActiveArchivesAction = class RunAllActiveArchivesAction extends BaseAction {
|
|
19
19
|
async InternalRunAction(params) {
|
|
20
20
|
try {
|
|
21
|
-
const configIds = await this.
|
|
21
|
+
const configIds = await this.loadActiveConfigurationIds(params);
|
|
22
22
|
if (configIds.length === 0) {
|
|
23
23
|
return {
|
|
24
24
|
Success: true,
|
|
@@ -27,8 +27,8 @@ let RunAllActiveArchivesAction = class RunAllActiveArchivesAction extends BaseAc
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
LogStatus(`RunAllActiveArchives: Found ${configIds.length} active configuration(s). Starting execution...`);
|
|
30
|
-
const results = await this.
|
|
31
|
-
return this.
|
|
30
|
+
const results = await this.executeAllConfigurations(configIds, params);
|
|
31
|
+
return this.buildSummaryResult(results);
|
|
32
32
|
}
|
|
33
33
|
catch (error) {
|
|
34
34
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -43,7 +43,7 @@ let RunAllActiveArchivesAction = class RunAllActiveArchivesAction extends BaseAc
|
|
|
43
43
|
/**
|
|
44
44
|
* Queries the database for all active ArchiveConfiguration IDs.
|
|
45
45
|
*/
|
|
46
|
-
async
|
|
46
|
+
async loadActiveConfigurationIds(params) {
|
|
47
47
|
const rv = new RunView();
|
|
48
48
|
const result = await rv.RunView({
|
|
49
49
|
EntityName: 'MJ: Archive Configurations',
|
|
@@ -60,7 +60,7 @@ let RunAllActiveArchivesAction = class RunAllActiveArchivesAction extends BaseAc
|
|
|
60
60
|
* Executes all configurations sequentially. Sequential execution prevents
|
|
61
61
|
* overwhelming the storage backend and database with concurrent archive runs.
|
|
62
62
|
*/
|
|
63
|
-
async
|
|
63
|
+
async executeAllConfigurations(configIds, params) {
|
|
64
64
|
const outcomes = [];
|
|
65
65
|
for (const configId of configIds) {
|
|
66
66
|
try {
|
|
@@ -91,7 +91,7 @@ let RunAllActiveArchivesAction = class RunAllActiveArchivesAction extends BaseAc
|
|
|
91
91
|
/**
|
|
92
92
|
* Aggregates individual run results into a single ActionResultSimple.
|
|
93
93
|
*/
|
|
94
|
-
|
|
94
|
+
buildSummaryResult(outcomes) {
|
|
95
95
|
const succeeded = outcomes.filter(o => o.Result.Success).length;
|
|
96
96
|
const failed = outcomes.length - succeeded;
|
|
97
97
|
const totalArchived = outcomes.reduce((sum, o) => sum + o.Result.ArchivedRecords, 0);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/archiving-action",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.2.0-edge.
|
|
4
|
+
"version": "6.2.0-edge.2",
|
|
5
5
|
"description": "Archive and restore actions for MemberJunction Archiving Engine",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"author": "MemberJunction.com",
|
|
12
12
|
"license": "BUSL-1.1",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@memberjunction/core": "6.2.0-edge.
|
|
15
|
-
"@memberjunction/global": "6.2.0-edge.
|
|
16
|
-
"@memberjunction/actions-base": "6.2.0-edge.
|
|
17
|
-
"@memberjunction/actions": "6.2.0-edge.
|
|
18
|
-
"@memberjunction/archiving-engine": "6.2.0-edge.
|
|
14
|
+
"@memberjunction/core": "6.2.0-edge.2",
|
|
15
|
+
"@memberjunction/global": "6.2.0-edge.2",
|
|
16
|
+
"@memberjunction/actions-base": "6.2.0-edge.2",
|
|
17
|
+
"@memberjunction/actions": "6.2.0-edge.2",
|
|
18
|
+
"@memberjunction/archiving-engine": "6.2.0-edge.2"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|