@tramvai/module-common 5.50.0 → 5.53.78
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/__migrations__/1-als-rename-module.js +12 -23
- package/lib/actions/ActionModule.browser.js +14 -3
- package/lib/actions/ActionModule.es.js +14 -3
- package/lib/actions/ActionModule.js +12 -1
- package/lib/actions/actionChecker.browser.js +9 -3
- package/lib/actions/actionChecker.es.js +9 -3
- package/lib/actions/actionChecker.js +9 -3
- package/lib/actions/actionExecution.browser.js +49 -3
- package/lib/actions/actionExecution.d.ts +4 -2
- package/lib/actions/actionExecution.es.js +49 -3
- package/lib/actions/actionExecution.js +49 -3
- package/lib/actions/actionPageRunner.browser.browser.js +15 -10
- package/lib/actions/actionPageRunner.es.js +27 -17
- package/lib/actions/actionPageRunner.js +26 -16
- package/lib/actions/actionRegistry.browser.js +1 -0
- package/lib/actions/actionRegistry.es.js +1 -0
- package/lib/actions/actionRegistry.js +1 -0
- package/lib/async-local-storage/server.es.js +11 -1
- package/lib/async-local-storage/server.js +11 -1
- package/lib/bundleManager/bundleManager.browser.js +2 -0
- package/lib/bundleManager/bundleManager.es.js +2 -0
- package/lib/bundleManager/bundleManager.js +2 -0
- package/lib/cache/cacheWithMetricsProxy.es.js +3 -0
- package/lib/cache/cacheWithMetricsProxy.js +3 -0
- package/lib/command/commandLineRunner.new.browser.js +18 -10
- package/lib/command/commandLineRunner.new.es.js +18 -10
- package/lib/command/commandLineRunner.new.js +17 -9
- package/lib/componentRegistry/componentRegistry.browser.js +1 -0
- package/lib/componentRegistry/componentRegistry.es.js +1 -0
- package/lib/componentRegistry/componentRegistry.js +1 -0
- package/lib/createConsumerContext/createConsumerContext.browser.js +42 -38
- package/lib/createConsumerContext/createConsumerContext.es.js +42 -38
- package/lib/createConsumerContext/createConsumerContext.js +42 -38
- package/lib/requestManager/requestManager.browser.js +3 -0
- package/lib/requestManager/requestManager.es.js +3 -0
- package/lib/requestManager/requestManager.js +3 -0
- package/lib/responseManager/responseManager.browser.js +4 -0
- package/lib/responseManager/responseManager.es.js +4 -0
- package/lib/responseManager/responseManager.js +4 -0
- package/package.json +23 -23
|
@@ -2,45 +2,49 @@ import { convertAction } from '@tramvai/state';
|
|
|
2
2
|
import { ACTION_EXECUTION_TOKEN } from '@tramvai/tokens-common';
|
|
3
3
|
|
|
4
4
|
class ConsumerContext {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
this.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return typeof createActionOrType === 'function'
|
|
23
|
-
? (...args) => this.dispatch(createActionOrType(...args), options)
|
|
24
|
-
: (payload) => this.dispatch(createActionOrType, payload);
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated
|
|
28
|
-
*/
|
|
29
|
-
this.getStore = (store) => {
|
|
30
|
-
return this.dispatcher.getStore(store);
|
|
31
|
-
};
|
|
32
|
-
this.dehydrate = () => ({
|
|
33
|
-
dispatcher: this.dispatcher.dehydrate(),
|
|
5
|
+
di;
|
|
6
|
+
pubsub;
|
|
7
|
+
dispatcher;
|
|
8
|
+
store;
|
|
9
|
+
/* Side Effects */
|
|
10
|
+
executeAction = (action, payload) => {
|
|
11
|
+
return this.di.get(ACTION_EXECUTION_TOKEN).run(action, payload);
|
|
12
|
+
};
|
|
13
|
+
/* State manager */
|
|
14
|
+
dispatch = (actionOrNameEvent, payload) => {
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
try {
|
|
17
|
+
resolve(this.store.dispatch(convertAction(actionOrNameEvent, payload)));
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
reject(err);
|
|
21
|
+
}
|
|
34
22
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
23
|
+
};
|
|
24
|
+
dispatchWith = (createActionOrType, options) => {
|
|
25
|
+
return typeof createActionOrType === 'function'
|
|
26
|
+
? (...args) => this.dispatch(createActionOrType(...args), options)
|
|
27
|
+
: (payload) => this.dispatch(createActionOrType, payload);
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated
|
|
31
|
+
*/
|
|
32
|
+
getStore = (store) => {
|
|
33
|
+
return this.dispatcher.getStore(store);
|
|
34
|
+
};
|
|
35
|
+
dehydrate = () => ({
|
|
36
|
+
dispatcher: this.dispatcher.dehydrate(),
|
|
37
|
+
});
|
|
38
|
+
getState = (...args) => {
|
|
39
|
+
return this.store.getState(args[0]);
|
|
40
|
+
};
|
|
41
|
+
subscribe = (...args) => {
|
|
42
|
+
return this.store.subscribe(args[0], args[1]);
|
|
43
|
+
};
|
|
44
|
+
hasStore = (store) => this.dispatcher.hasStore(store);
|
|
45
|
+
registerStore = (store) => this.dispatcher.registerStore(store);
|
|
46
|
+
unregisterStore = (store) => this.dispatcher.unregisterStore(store);
|
|
47
|
+
constructor({ di, dispatcherContext, pubsub, store }) {
|
|
44
48
|
this.store = store;
|
|
45
49
|
// @ts-expect-error
|
|
46
50
|
this.dispatcher = dispatcherContext;
|
|
@@ -6,45 +6,49 @@ var state = require('@tramvai/state');
|
|
|
6
6
|
var tokensCommon = require('@tramvai/tokens-common');
|
|
7
7
|
|
|
8
8
|
class ConsumerContext {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return typeof createActionOrType === 'function'
|
|
27
|
-
? (...args) => this.dispatch(createActionOrType(...args), options)
|
|
28
|
-
: (payload) => this.dispatch(createActionOrType, payload);
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated
|
|
32
|
-
*/
|
|
33
|
-
this.getStore = (store) => {
|
|
34
|
-
return this.dispatcher.getStore(store);
|
|
35
|
-
};
|
|
36
|
-
this.dehydrate = () => ({
|
|
37
|
-
dispatcher: this.dispatcher.dehydrate(),
|
|
9
|
+
di;
|
|
10
|
+
pubsub;
|
|
11
|
+
dispatcher;
|
|
12
|
+
store;
|
|
13
|
+
/* Side Effects */
|
|
14
|
+
executeAction = (action, payload) => {
|
|
15
|
+
return this.di.get(tokensCommon.ACTION_EXECUTION_TOKEN).run(action, payload);
|
|
16
|
+
};
|
|
17
|
+
/* State manager */
|
|
18
|
+
dispatch = (actionOrNameEvent, payload) => {
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
try {
|
|
21
|
+
resolve(this.store.dispatch(state.convertAction(actionOrNameEvent, payload)));
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
reject(err);
|
|
25
|
+
}
|
|
38
26
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
27
|
+
};
|
|
28
|
+
dispatchWith = (createActionOrType, options) => {
|
|
29
|
+
return typeof createActionOrType === 'function'
|
|
30
|
+
? (...args) => this.dispatch(createActionOrType(...args), options)
|
|
31
|
+
: (payload) => this.dispatch(createActionOrType, payload);
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated
|
|
35
|
+
*/
|
|
36
|
+
getStore = (store) => {
|
|
37
|
+
return this.dispatcher.getStore(store);
|
|
38
|
+
};
|
|
39
|
+
dehydrate = () => ({
|
|
40
|
+
dispatcher: this.dispatcher.dehydrate(),
|
|
41
|
+
});
|
|
42
|
+
getState = (...args) => {
|
|
43
|
+
return this.store.getState(args[0]);
|
|
44
|
+
};
|
|
45
|
+
subscribe = (...args) => {
|
|
46
|
+
return this.store.subscribe(args[0], args[1]);
|
|
47
|
+
};
|
|
48
|
+
hasStore = (store) => this.dispatcher.hasStore(store);
|
|
49
|
+
registerStore = (store) => this.dispatcher.registerStore(store);
|
|
50
|
+
unregisterStore = (store) => this.dispatcher.unregisterStore(store);
|
|
51
|
+
constructor({ di, dispatcherContext, pubsub, store }) {
|
|
48
52
|
this.store = store;
|
|
49
53
|
// @ts-expect-error
|
|
50
54
|
this.dispatcher = dispatcherContext;
|
|
@@ -11,6 +11,10 @@ var isEmpty__default = /*#__PURE__*/_interopDefaultLegacy(isEmpty);
|
|
|
11
11
|
var values__default = /*#__PURE__*/_interopDefaultLegacy(values);
|
|
12
12
|
|
|
13
13
|
class ResponseManager {
|
|
14
|
+
body;
|
|
15
|
+
headers;
|
|
16
|
+
cookies;
|
|
17
|
+
status;
|
|
14
18
|
constructor() {
|
|
15
19
|
this.body = '';
|
|
16
20
|
this.headers = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-common",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.53.78",
|
|
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.3",
|
|
35
|
+
"@tinkoff/hook-runner": "0.7.4",
|
|
36
36
|
"@tinkoff/lru-cache-nano": "^7.9.0",
|
|
37
37
|
"@tinkoff/pubsub": "0.8.2",
|
|
38
|
-
"@tinkoff/url": "0.11.
|
|
39
|
-
"@tramvai/experiments": "5.
|
|
40
|
-
"@tramvai/module-cookie": "5.
|
|
41
|
-
"@tramvai/module-environment": "5.
|
|
42
|
-
"@tramvai/module-log": "5.
|
|
38
|
+
"@tinkoff/url": "0.11.3",
|
|
39
|
+
"@tramvai/experiments": "5.53.78",
|
|
40
|
+
"@tramvai/module-cookie": "5.53.78",
|
|
41
|
+
"@tramvai/module-environment": "5.53.78",
|
|
42
|
+
"@tramvai/module-log": "5.53.78",
|
|
43
43
|
"@tramvai/safe-strings": "0.8.4",
|
|
44
|
-
"@tramvai/tokens-child-app": "5.
|
|
45
|
-
"@tramvai/tokens-common": "5.
|
|
46
|
-
"@tramvai/tokens-core-private": "5.
|
|
47
|
-
"@tramvai/tokens-metrics": "5.
|
|
48
|
-
"@tramvai/tokens-render": "5.
|
|
49
|
-
"@tramvai/tokens-router": "5.
|
|
50
|
-
"@tramvai/tokens-server-private": "5.
|
|
51
|
-
"@tramvai/types-actions-state-context": "5.
|
|
44
|
+
"@tramvai/tokens-child-app": "5.53.78",
|
|
45
|
+
"@tramvai/tokens-common": "5.53.78",
|
|
46
|
+
"@tramvai/tokens-core-private": "5.53.78",
|
|
47
|
+
"@tramvai/tokens-metrics": "5.53.78",
|
|
48
|
+
"@tramvai/tokens-render": "5.53.78",
|
|
49
|
+
"@tramvai/tokens-router": "5.53.78",
|
|
50
|
+
"@tramvai/tokens-server-private": "5.53.78",
|
|
51
|
+
"@tramvai/types-actions-state-context": "5.53.78",
|
|
52
52
|
"hoist-non-react-statics": "^3.3.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@tinkoff/dippy": "0.11.
|
|
55
|
+
"@tinkoff/dippy": "0.11.5",
|
|
56
56
|
"@tinkoff/utils": "^2.1.2",
|
|
57
|
-
"@tramvai/cli": "5.
|
|
58
|
-
"@tramvai/core": "5.
|
|
59
|
-
"@tramvai/papi": "5.
|
|
60
|
-
"@tramvai/react": "5.
|
|
61
|
-
"@tramvai/state": "5.
|
|
62
|
-
"@tramvai/tokens-server": "5.
|
|
57
|
+
"@tramvai/cli": "5.53.78",
|
|
58
|
+
"@tramvai/core": "5.53.78",
|
|
59
|
+
"@tramvai/papi": "5.53.78",
|
|
60
|
+
"@tramvai/react": "5.53.78",
|
|
61
|
+
"@tramvai/state": "5.53.78",
|
|
62
|
+
"@tramvai/tokens-server": "5.53.78",
|
|
63
63
|
"react": ">=16.14.0",
|
|
64
64
|
"tslib": "^2.4.0"
|
|
65
65
|
},
|