@tramvai/module-common 5.53.111 → 5.53.114
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isTramvaiAction, ACTION_PARAMETERS } from '@tramvai/core';
|
|
2
2
|
import { PageActionsAbortError, isPageActionsAbortError, isSilentError, ExecutionAbortError, makeErrorSilent } from '@tinkoff/errors';
|
|
3
3
|
import { actionServerStateEvent } from './actionTramvaiReducer.es.js';
|
|
4
4
|
import { generateDeferredResolve, generateDeferredReject } from './deferred/clientScriptsUtils.es.js';
|
|
@@ -21,12 +21,17 @@ class ActionPageRunner {
|
|
|
21
21
|
}
|
|
22
22
|
// TODO stopRunAtError нужен только для редиректов на стороне сервера в экшенах. И нужно пересмотреть реализацию редиректов
|
|
23
23
|
runActions(actions, stopRunAtError = () => false) {
|
|
24
|
+
const actionNames = actions.map((action) => {
|
|
25
|
+
const parameters = isTramvaiAction(action) ? action : action[ACTION_PARAMETERS];
|
|
26
|
+
const actionName = parameters?.name ?? 'unknown';
|
|
27
|
+
return actionName;
|
|
28
|
+
});
|
|
24
29
|
return this.deps.executionContextManager.withContext(this.deps.commandLineExecutionContext(), { name: 'pageActions', values: { pageActions: true } }, (executionContext, abortController) => {
|
|
25
30
|
return new Promise((resolve, reject) => {
|
|
26
31
|
const timeoutMarker = setTimeout(() => {
|
|
27
32
|
const unfinishedActions = [];
|
|
28
33
|
this.deps.actionExecution.execution.forEach((value, key) => {
|
|
29
|
-
if (value.status === 'pending') {
|
|
34
|
+
if (actionNames.includes(key) && value.status === 'pending') {
|
|
30
35
|
unfinishedActions.push(key);
|
|
31
36
|
}
|
|
32
37
|
});
|
|
@@ -48,8 +53,8 @@ You can find more detailed information from "action-execution-error" logs, and f
|
|
|
48
53
|
const result = {};
|
|
49
54
|
// TODO: dehydrate only actions on first level as inner actions are running on client despite their execution on server
|
|
50
55
|
this.deps.actionExecution.execution.forEach((value, key) => {
|
|
51
|
-
//
|
|
52
|
-
if (value.status === 'success') {
|
|
56
|
+
// get completed actions values, others will be executed on client
|
|
57
|
+
if (actionNames.includes(key) && value.status === 'success') {
|
|
53
58
|
result[key] = value;
|
|
54
59
|
}
|
|
55
60
|
});
|
|
@@ -25,12 +25,17 @@ class ActionPageRunner {
|
|
|
25
25
|
}
|
|
26
26
|
// TODO stopRunAtError нужен только для редиректов на стороне сервера в экшенах. И нужно пересмотреть реализацию редиректов
|
|
27
27
|
runActions(actions, stopRunAtError = () => false) {
|
|
28
|
+
const actionNames = actions.map((action) => {
|
|
29
|
+
const parameters = core.isTramvaiAction(action) ? action : action[core.ACTION_PARAMETERS];
|
|
30
|
+
const actionName = parameters?.name ?? 'unknown';
|
|
31
|
+
return actionName;
|
|
32
|
+
});
|
|
28
33
|
return this.deps.executionContextManager.withContext(this.deps.commandLineExecutionContext(), { name: 'pageActions', values: { pageActions: true } }, (executionContext, abortController) => {
|
|
29
34
|
return new Promise((resolve, reject) => {
|
|
30
35
|
const timeoutMarker = setTimeout(() => {
|
|
31
36
|
const unfinishedActions = [];
|
|
32
37
|
this.deps.actionExecution.execution.forEach((value, key) => {
|
|
33
|
-
if (value.status === 'pending') {
|
|
38
|
+
if (actionNames.includes(key) && value.status === 'pending') {
|
|
34
39
|
unfinishedActions.push(key);
|
|
35
40
|
}
|
|
36
41
|
});
|
|
@@ -52,8 +57,8 @@ You can find more detailed information from "action-execution-error" logs, and f
|
|
|
52
57
|
const result = {};
|
|
53
58
|
// TODO: dehydrate only actions on first level as inner actions are running on client despite their execution on server
|
|
54
59
|
this.deps.actionExecution.execution.forEach((value, key) => {
|
|
55
|
-
//
|
|
56
|
-
if (value.status === 'success') {
|
|
60
|
+
// get completed actions values, others will be executed on client
|
|
61
|
+
if (actionNames.includes(key) && value.status === 'success') {
|
|
57
62
|
result[key] = value;
|
|
58
63
|
}
|
|
59
64
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-common",
|
|
3
|
-
"version": "5.53.
|
|
3
|
+
"version": "5.53.114",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -31,35 +31,35 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@akashbabu/lfu-cache": "1.0.2",
|
|
34
|
-
"@tinkoff/errors": "0.6.
|
|
35
|
-
"@tinkoff/hook-runner": "0.7.
|
|
34
|
+
"@tinkoff/errors": "0.6.7",
|
|
35
|
+
"@tinkoff/hook-runner": "0.7.8",
|
|
36
36
|
"@tinkoff/lru-cache-nano": "^7.9.0",
|
|
37
|
-
"@tinkoff/pubsub": "0.8.
|
|
38
|
-
"@tinkoff/url": "0.11.
|
|
39
|
-
"@tramvai/experiments": "5.53.
|
|
40
|
-
"@tramvai/module-cookie": "5.53.
|
|
41
|
-
"@tramvai/module-environment": "5.53.
|
|
42
|
-
"@tramvai/module-log": "5.53.
|
|
43
|
-
"@tramvai/safe-strings": "0.8.
|
|
44
|
-
"@tramvai/tokens-child-app": "5.53.
|
|
45
|
-
"@tramvai/tokens-common": "5.53.
|
|
46
|
-
"@tramvai/tokens-core-private": "5.53.
|
|
47
|
-
"@tramvai/tokens-metrics": "5.53.
|
|
48
|
-
"@tramvai/tokens-render": "5.53.
|
|
49
|
-
"@tramvai/tokens-router": "5.53.
|
|
50
|
-
"@tramvai/tokens-server-private": "5.53.
|
|
51
|
-
"@tramvai/types-actions-state-context": "5.53.
|
|
37
|
+
"@tinkoff/pubsub": "0.8.6",
|
|
38
|
+
"@tinkoff/url": "0.11.7",
|
|
39
|
+
"@tramvai/experiments": "5.53.114",
|
|
40
|
+
"@tramvai/module-cookie": "5.53.114",
|
|
41
|
+
"@tramvai/module-environment": "5.53.114",
|
|
42
|
+
"@tramvai/module-log": "5.53.114",
|
|
43
|
+
"@tramvai/safe-strings": "0.8.8",
|
|
44
|
+
"@tramvai/tokens-child-app": "5.53.114",
|
|
45
|
+
"@tramvai/tokens-common": "5.53.114",
|
|
46
|
+
"@tramvai/tokens-core-private": "5.53.114",
|
|
47
|
+
"@tramvai/tokens-metrics": "5.53.114",
|
|
48
|
+
"@tramvai/tokens-render": "5.53.114",
|
|
49
|
+
"@tramvai/tokens-router": "5.53.114",
|
|
50
|
+
"@tramvai/tokens-server-private": "5.53.114",
|
|
51
|
+
"@tramvai/types-actions-state-context": "5.53.114",
|
|
52
52
|
"hoist-non-react-statics": "^3.3.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@tinkoff/dippy": "0.11.
|
|
55
|
+
"@tinkoff/dippy": "0.11.11",
|
|
56
56
|
"@tinkoff/utils": "^2.1.2",
|
|
57
|
-
"@tramvai/cli": "5.53.
|
|
58
|
-
"@tramvai/core": "5.53.
|
|
59
|
-
"@tramvai/papi": "5.53.
|
|
60
|
-
"@tramvai/react": "5.53.
|
|
61
|
-
"@tramvai/state": "5.53.
|
|
62
|
-
"@tramvai/tokens-server": "5.53.
|
|
57
|
+
"@tramvai/cli": "5.53.114",
|
|
58
|
+
"@tramvai/core": "5.53.114",
|
|
59
|
+
"@tramvai/papi": "5.53.114",
|
|
60
|
+
"@tramvai/react": "5.53.114",
|
|
61
|
+
"@tramvai/state": "5.53.114",
|
|
62
|
+
"@tramvai/tokens-server": "5.53.114",
|
|
63
63
|
"react": ">=16.14.0",
|
|
64
64
|
"tslib": "^2.4.0"
|
|
65
65
|
},
|