@friggframework/core 2.0.0--canary.517.559ad7e.0 → 2.0.0--canary.517.beaf080.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/admin-scripts/repositories/admin-script-execution-repository-interface.js +2 -1
- package/admin-scripts/repositories/admin-script-execution-repository-mongo.js +2 -1
- package/admin-scripts/repositories/admin-script-execution-repository-postgres.js +4 -1
- package/application/commands/admin-script-commands.js +3 -1
- package/package.json +5 -5
|
@@ -34,10 +34,11 @@ class AdminScriptExecutionRepositoryInterface {
|
|
|
34
34
|
* @param {string} [params.context.audit.apiKeyName] - Name of API key used
|
|
35
35
|
* @param {string} [params.context.audit.apiKeyLast4] - Last 4 chars of API key
|
|
36
36
|
* @param {string} [params.context.audit.ipAddress] - IP address of requester
|
|
37
|
+
* @param {string|number} [params.parentExecutionId] - ID of the execution that queued this one; persisted to the parentExecutionId column (self-FK) for the parent/child hierarchy
|
|
37
38
|
* @returns {Promise<Object>} The created process record
|
|
38
39
|
* @abstract
|
|
39
40
|
*/
|
|
40
|
-
async createExecution({ name, type, context }) {
|
|
41
|
+
async createExecution({ name, type, context, parentExecutionId }) {
|
|
41
42
|
throw new Error('Method createExecution must be implemented by subclass');
|
|
42
43
|
}
|
|
43
44
|
|
|
@@ -27,12 +27,13 @@ class AdminScriptExecutionRepositoryMongo extends AdminScriptExecutionRepository
|
|
|
27
27
|
* @param {Object} [params.context] - Context data
|
|
28
28
|
* @returns {Promise<Object>} The created process record
|
|
29
29
|
*/
|
|
30
|
-
async createExecution({ name, type, context = {} }) {
|
|
30
|
+
async createExecution({ name, type, context = {}, parentExecutionId }) {
|
|
31
31
|
const data = {
|
|
32
32
|
name,
|
|
33
33
|
type,
|
|
34
34
|
context,
|
|
35
35
|
results: { logs: [] },
|
|
36
|
+
...(parentExecutionId != null && { parentExecutionId }),
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
const process = await this.prisma.adminScriptExecution.create({
|
|
@@ -59,12 +59,15 @@ class AdminScriptExecutionRepositoryPostgres extends AdminScriptExecutionReposit
|
|
|
59
59
|
* @param {Object} [params.context] - Context data
|
|
60
60
|
* @returns {Promise<Object>} The created process record with string ID
|
|
61
61
|
*/
|
|
62
|
-
async createExecution({ name, type, context = {} }) {
|
|
62
|
+
async createExecution({ name, type, context = {}, parentExecutionId }) {
|
|
63
63
|
const data = {
|
|
64
64
|
name,
|
|
65
65
|
type,
|
|
66
66
|
context,
|
|
67
67
|
results: { logs: [] },
|
|
68
|
+
...(parentExecutionId != null && {
|
|
69
|
+
parentExecutionId: this._convertId(parentExecutionId),
|
|
70
|
+
}),
|
|
68
71
|
};
|
|
69
72
|
|
|
70
73
|
const process = await this.prisma.adminScriptExecution.create({
|
|
@@ -77,13 +77,15 @@ function createAdminScriptCommands() {
|
|
|
77
77
|
const process = await adminScriptExecutionRepository.createExecution({
|
|
78
78
|
name: scriptName,
|
|
79
79
|
type: 'ADMIN_SCRIPT',
|
|
80
|
+
// Persisted to the parentExecutionId column (self-FK), not the
|
|
81
|
+
// context blob, so the parent/child hierarchy is queryable.
|
|
82
|
+
parentExecutionId,
|
|
80
83
|
context: {
|
|
81
84
|
scriptVersion,
|
|
82
85
|
trigger,
|
|
83
86
|
mode: mode || 'async',
|
|
84
87
|
input,
|
|
85
88
|
audit,
|
|
86
|
-
...(parentExecutionId && { parentExecutionId }),
|
|
87
89
|
},
|
|
88
90
|
});
|
|
89
91
|
return process;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.517.
|
|
4
|
+
"version": "2.0.0--canary.517.beaf080.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
|
|
7
7
|
"@aws-sdk/client-kms": "^3.588.0",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@friggframework/eslint-config": "2.0.0--canary.517.
|
|
42
|
-
"@friggframework/prettier-config": "2.0.0--canary.517.
|
|
43
|
-
"@friggframework/test": "2.0.0--canary.517.
|
|
41
|
+
"@friggframework/eslint-config": "2.0.0--canary.517.beaf080.0",
|
|
42
|
+
"@friggframework/prettier-config": "2.0.0--canary.517.beaf080.0",
|
|
43
|
+
"@friggframework/test": "2.0.0--canary.517.beaf080.0",
|
|
44
44
|
"@prisma/client": "^6.19.3",
|
|
45
45
|
"@types/lodash": "4.17.15",
|
|
46
46
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "beaf080b1337695f52525105e87e02c38d29b490"
|
|
84
84
|
}
|