@tramvai/module-common 2.111.1 → 2.117.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/lib/actions/actionExecution.browser.js +3 -4
- package/lib/actions/actionExecution.es.js +3 -4
- package/lib/actions/actionExecution.js +3 -4
- package/lib/actions/actionPageRunner.browser.browser.js +2 -1
- package/lib/actions/actionPageRunner.es.js +2 -1
- package/lib/actions/actionPageRunner.js +2 -1
- package/package.json +17 -17
|
@@ -8,7 +8,6 @@ import { actionType } from './constants.browser.js';
|
|
|
8
8
|
import { actionTramvaiReducer } from './actionTramvaiReducer.browser.js';
|
|
9
9
|
|
|
10
10
|
const EMPTY_DEPS = {};
|
|
11
|
-
const DEFAULT_PAYLOAD = {};
|
|
12
11
|
const getParameters = (action) => action[ACTION_PARAMETERS];
|
|
13
12
|
class ActionExecution {
|
|
14
13
|
constructor({ store, context, di, executionContextManager, actionConditionals, transformAction, }) {
|
|
@@ -27,9 +26,9 @@ class ActionExecution {
|
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
async runInContext(executionContext, action, ...params) {
|
|
30
|
-
var _a
|
|
29
|
+
var _a;
|
|
31
30
|
let parameters;
|
|
32
|
-
const payload =
|
|
31
|
+
const payload = params[0];
|
|
33
32
|
// TODO: replace type with pure context usage
|
|
34
33
|
const type = (executionContext === null || executionContext === void 0 ? void 0 : executionContext.values.pageActions) === true ? actionType.global : actionType.local;
|
|
35
34
|
// TODO: remove else branch after migration to new declareAction
|
|
@@ -48,7 +47,7 @@ class ActionExecution {
|
|
|
48
47
|
switch (parameters.conditionsFailResult) {
|
|
49
48
|
case 'reject':
|
|
50
49
|
return Promise.reject(new ConditionFailError({
|
|
51
|
-
conditionName: (
|
|
50
|
+
conditionName: (_a = executionState.forbiddenBy) !== null && _a !== void 0 ? _a : 'unknown',
|
|
52
51
|
targetName: parameters.name,
|
|
53
52
|
}));
|
|
54
53
|
default:
|
|
@@ -8,7 +8,6 @@ import { actionType } from './constants.es.js';
|
|
|
8
8
|
import { actionTramvaiReducer } from './actionTramvaiReducer.es.js';
|
|
9
9
|
|
|
10
10
|
const EMPTY_DEPS = {};
|
|
11
|
-
const DEFAULT_PAYLOAD = {};
|
|
12
11
|
const getParameters = (action) => action[ACTION_PARAMETERS];
|
|
13
12
|
class ActionExecution {
|
|
14
13
|
constructor({ store, context, di, executionContextManager, actionConditionals, transformAction, }) {
|
|
@@ -27,9 +26,9 @@ class ActionExecution {
|
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
async runInContext(executionContext, action, ...params) {
|
|
30
|
-
var _a
|
|
29
|
+
var _a;
|
|
31
30
|
let parameters;
|
|
32
|
-
const payload =
|
|
31
|
+
const payload = params[0];
|
|
33
32
|
// TODO: replace type with pure context usage
|
|
34
33
|
const type = (executionContext === null || executionContext === void 0 ? void 0 : executionContext.values.pageActions) === true ? actionType.global : actionType.local;
|
|
35
34
|
// TODO: remove else branch after migration to new declareAction
|
|
@@ -48,7 +47,7 @@ class ActionExecution {
|
|
|
48
47
|
switch (parameters.conditionsFailResult) {
|
|
49
48
|
case 'reject':
|
|
50
49
|
return Promise.reject(new ConditionFailError({
|
|
51
|
-
conditionName: (
|
|
50
|
+
conditionName: (_a = executionState.forbiddenBy) !== null && _a !== void 0 ? _a : 'unknown',
|
|
52
51
|
targetName: parameters.name,
|
|
53
52
|
}));
|
|
54
53
|
default:
|
|
@@ -18,7 +18,6 @@ var identity__default = /*#__PURE__*/_interopDefaultLegacy(identity);
|
|
|
18
18
|
var objectMap__default = /*#__PURE__*/_interopDefaultLegacy(objectMap);
|
|
19
19
|
|
|
20
20
|
const EMPTY_DEPS = {};
|
|
21
|
-
const DEFAULT_PAYLOAD = {};
|
|
22
21
|
const getParameters = (action) => action[core.ACTION_PARAMETERS];
|
|
23
22
|
class ActionExecution {
|
|
24
23
|
constructor({ store, context, di, executionContextManager, actionConditionals, transformAction, }) {
|
|
@@ -37,9 +36,9 @@ class ActionExecution {
|
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
async runInContext(executionContext, action, ...params) {
|
|
40
|
-
var _a
|
|
39
|
+
var _a;
|
|
41
40
|
let parameters;
|
|
42
|
-
const payload =
|
|
41
|
+
const payload = params[0];
|
|
43
42
|
// TODO: replace type with pure context usage
|
|
44
43
|
const type = (executionContext === null || executionContext === void 0 ? void 0 : executionContext.values.pageActions) === true ? constants.actionType.global : constants.actionType.local;
|
|
45
44
|
// TODO: remove else branch after migration to new declareAction
|
|
@@ -58,7 +57,7 @@ class ActionExecution {
|
|
|
58
57
|
switch (parameters.conditionsFailResult) {
|
|
59
58
|
case 'reject':
|
|
60
59
|
return Promise.reject(new errors.ConditionFailError({
|
|
61
|
-
conditionName: (
|
|
60
|
+
conditionName: (_a = executionState.forbiddenBy) !== null && _a !== void 0 ? _a : 'unknown',
|
|
62
61
|
targetName: parameters.name,
|
|
63
62
|
}));
|
|
64
63
|
default:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isSilentError } from '@tinkoff/errors';
|
|
2
2
|
import { isTramvaiAction, ACTION_PARAMETERS } from '@tramvai/core';
|
|
3
3
|
|
|
4
|
+
const DEFAULT_PAYLOAD = {};
|
|
4
5
|
class ActionPageRunner {
|
|
5
6
|
constructor(deps) {
|
|
6
7
|
this.deps = deps;
|
|
@@ -10,7 +11,7 @@ class ActionPageRunner {
|
|
|
10
11
|
return this.deps.executionContextManager.withContext(this.deps.commandLineExecutionContext(), { name: 'pageActions', values: { pageActions: true } }, async (executionContext) => {
|
|
11
12
|
const actionMapper = (action) => {
|
|
12
13
|
return Promise.resolve()
|
|
13
|
-
.then(() => this.deps.actionExecution.runInContext(executionContext, action))
|
|
14
|
+
.then(() => this.deps.actionExecution.runInContext(executionContext, action, DEFAULT_PAYLOAD))
|
|
14
15
|
.catch((error) => {
|
|
15
16
|
var _a;
|
|
16
17
|
if (!isSilentError(error)) {
|
|
@@ -2,6 +2,7 @@ import { isTramvaiAction, ACTION_PARAMETERS } from '@tramvai/core';
|
|
|
2
2
|
import { isSilentError } from '@tinkoff/errors';
|
|
3
3
|
import { actionServerStateEvent } from './actionTramvaiReducer.es.js';
|
|
4
4
|
|
|
5
|
+
const DEFAULT_PAYLOAD = {};
|
|
5
6
|
class ActionPageRunner {
|
|
6
7
|
constructor(deps) {
|
|
7
8
|
this.deps = deps;
|
|
@@ -32,7 +33,7 @@ class ActionPageRunner {
|
|
|
32
33
|
};
|
|
33
34
|
const actionMapper = (action) => {
|
|
34
35
|
return Promise.resolve()
|
|
35
|
-
.then(() => this.deps.actionExecution.runInContext(executionContext, action))
|
|
36
|
+
.then(() => this.deps.actionExecution.runInContext(executionContext, action, DEFAULT_PAYLOAD))
|
|
36
37
|
.catch((error) => {
|
|
37
38
|
var _a;
|
|
38
39
|
const isCriticalError = stopRunAtError(error);
|
|
@@ -6,6 +6,7 @@ var core = require('@tramvai/core');
|
|
|
6
6
|
var errors = require('@tinkoff/errors');
|
|
7
7
|
var actionTramvaiReducer = require('./actionTramvaiReducer.js');
|
|
8
8
|
|
|
9
|
+
const DEFAULT_PAYLOAD = {};
|
|
9
10
|
class ActionPageRunner {
|
|
10
11
|
constructor(deps) {
|
|
11
12
|
this.deps = deps;
|
|
@@ -36,7 +37,7 @@ class ActionPageRunner {
|
|
|
36
37
|
};
|
|
37
38
|
const actionMapper = (action) => {
|
|
38
39
|
return Promise.resolve()
|
|
39
|
-
.then(() => this.deps.actionExecution.runInContext(executionContext, action))
|
|
40
|
+
.then(() => this.deps.actionExecution.runInContext(executionContext, action, DEFAULT_PAYLOAD))
|
|
40
41
|
.catch((error) => {
|
|
41
42
|
var _a;
|
|
42
43
|
const isCriticalError = stopRunAtError(error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.117.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -32,28 +32,28 @@
|
|
|
32
32
|
"@tinkoff/lru-cache-nano": "^7.8.1",
|
|
33
33
|
"@tinkoff/pubsub": "0.5.7",
|
|
34
34
|
"@tinkoff/url": "0.8.6",
|
|
35
|
-
"@tramvai/experiments": "2.
|
|
36
|
-
"@tramvai/module-cookie": "2.
|
|
37
|
-
"@tramvai/module-environment": "2.
|
|
38
|
-
"@tramvai/module-log": "2.
|
|
39
|
-
"@tramvai/tokens-child-app": "2.
|
|
40
|
-
"@tramvai/tokens-core-private": "2.
|
|
41
|
-
"@tramvai/tokens-common": "2.
|
|
42
|
-
"@tramvai/tokens-render": "2.
|
|
43
|
-
"@tramvai/tokens-server-private": "2.
|
|
44
|
-
"@tramvai/types-actions-state-context": "2.
|
|
35
|
+
"@tramvai/experiments": "2.117.0",
|
|
36
|
+
"@tramvai/module-cookie": "2.117.0",
|
|
37
|
+
"@tramvai/module-environment": "2.117.0",
|
|
38
|
+
"@tramvai/module-log": "2.117.0",
|
|
39
|
+
"@tramvai/tokens-child-app": "2.117.0",
|
|
40
|
+
"@tramvai/tokens-core-private": "2.117.0",
|
|
41
|
+
"@tramvai/tokens-common": "2.117.0",
|
|
42
|
+
"@tramvai/tokens-render": "2.117.0",
|
|
43
|
+
"@tramvai/tokens-server-private": "2.117.0",
|
|
44
|
+
"@tramvai/types-actions-state-context": "2.117.0",
|
|
45
45
|
"hoist-non-react-statics": "^3.3.1",
|
|
46
46
|
"node-abort-controller": "^3.0.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@tinkoff/dippy": "0.8.15",
|
|
50
50
|
"@tinkoff/utils": "^2.1.2",
|
|
51
|
-
"@tramvai/cli": "2.
|
|
52
|
-
"@tramvai/core": "2.
|
|
53
|
-
"@tramvai/papi": "2.
|
|
54
|
-
"@tramvai/react": "2.
|
|
55
|
-
"@tramvai/state": "2.
|
|
56
|
-
"@tramvai/tokens-server": "2.
|
|
51
|
+
"@tramvai/cli": "2.117.0",
|
|
52
|
+
"@tramvai/core": "2.117.0",
|
|
53
|
+
"@tramvai/papi": "2.117.0",
|
|
54
|
+
"@tramvai/react": "2.117.0",
|
|
55
|
+
"@tramvai/state": "2.117.0",
|
|
56
|
+
"@tramvai/tokens-server": "2.117.0",
|
|
57
57
|
"react": ">=16.14.0",
|
|
58
58
|
"tslib": "^2.4.0"
|
|
59
59
|
},
|