@tramvai/module-common 5.49.1 → 5.53.74

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.
Files changed (40) hide show
  1. package/__migrations__/1-als-rename-module.js +12 -23
  2. package/lib/actions/ActionModule.browser.js +14 -3
  3. package/lib/actions/ActionModule.es.js +14 -3
  4. package/lib/actions/ActionModule.js +12 -1
  5. package/lib/actions/actionChecker.browser.js +9 -3
  6. package/lib/actions/actionChecker.es.js +9 -3
  7. package/lib/actions/actionChecker.js +9 -3
  8. package/lib/actions/actionExecution.browser.js +49 -3
  9. package/lib/actions/actionExecution.d.ts +4 -2
  10. package/lib/actions/actionExecution.es.js +49 -3
  11. package/lib/actions/actionExecution.js +49 -3
  12. package/lib/actions/actionPageRunner.browser.browser.js +15 -10
  13. package/lib/actions/actionPageRunner.es.js +27 -17
  14. package/lib/actions/actionPageRunner.js +26 -16
  15. package/lib/actions/actionRegistry.browser.js +1 -0
  16. package/lib/actions/actionRegistry.es.js +1 -0
  17. package/lib/actions/actionRegistry.js +1 -0
  18. package/lib/async-local-storage/server.es.js +11 -1
  19. package/lib/async-local-storage/server.js +11 -1
  20. package/lib/bundleManager/bundleManager.browser.js +2 -0
  21. package/lib/bundleManager/bundleManager.es.js +2 -0
  22. package/lib/bundleManager/bundleManager.js +2 -0
  23. package/lib/cache/cacheWithMetricsProxy.es.js +3 -0
  24. package/lib/cache/cacheWithMetricsProxy.js +3 -0
  25. package/lib/command/commandLineRunner.new.browser.js +18 -10
  26. package/lib/command/commandLineRunner.new.es.js +18 -10
  27. package/lib/command/commandLineRunner.new.js +17 -9
  28. package/lib/componentRegistry/componentRegistry.browser.js +1 -0
  29. package/lib/componentRegistry/componentRegistry.es.js +1 -0
  30. package/lib/componentRegistry/componentRegistry.js +1 -0
  31. package/lib/createConsumerContext/createConsumerContext.browser.js +42 -38
  32. package/lib/createConsumerContext/createConsumerContext.es.js +42 -38
  33. package/lib/createConsumerContext/createConsumerContext.js +42 -38
  34. package/lib/requestManager/requestManager.browser.js +3 -0
  35. package/lib/requestManager/requestManager.es.js +3 -0
  36. package/lib/requestManager/requestManager.js +3 -0
  37. package/lib/responseManager/responseManager.browser.js +4 -0
  38. package/lib/responseManager/responseManager.es.js +4 -0
  39. package/lib/responseManager/responseManager.js +4 -0
  40. package/package.json +27 -27
@@ -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
- constructor({ di, dispatcherContext, pubsub, store }) {
6
- /* Side Effects */
7
- this.executeAction = (action, payload) => {
8
- return this.di.get(ACTION_EXECUTION_TOKEN).run(action, payload);
9
- };
10
- /* State manager */
11
- this.dispatch = (actionOrNameEvent, payload) => {
12
- return new Promise((resolve, reject) => {
13
- try {
14
- resolve(this.store.dispatch(convertAction(actionOrNameEvent, payload)));
15
- }
16
- catch (err) {
17
- reject(err);
18
- }
19
- });
20
- };
21
- this.dispatchWith = (createActionOrType, options) => {
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
- this.getState = (...args) => {
36
- return this.store.getState(args[0]);
37
- };
38
- this.subscribe = (...args) => {
39
- return this.store.subscribe(args[0], args[1]);
40
- };
41
- this.hasStore = (store) => this.dispatcher.hasStore(store);
42
- this.registerStore = (store) => this.dispatcher.registerStore(store);
43
- this.unregisterStore = (store) => this.dispatcher.unregisterStore(store);
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
- constructor({ di, dispatcherContext, pubsub, store }) {
10
- /* Side Effects */
11
- this.executeAction = (action, payload) => {
12
- return this.di.get(tokensCommon.ACTION_EXECUTION_TOKEN).run(action, payload);
13
- };
14
- /* State manager */
15
- this.dispatch = (actionOrNameEvent, payload) => {
16
- return new Promise((resolve, reject) => {
17
- try {
18
- resolve(this.store.dispatch(state.convertAction(actionOrNameEvent, payload)));
19
- }
20
- catch (err) {
21
- reject(err);
22
- }
23
- });
24
- };
25
- this.dispatchWith = (createActionOrType, options) => {
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
- this.getState = (...args) => {
40
- return this.store.getState(args[0]);
41
- };
42
- this.subscribe = (...args) => {
43
- return this.store.subscribe(args[0], args[1]);
44
- };
45
- this.hasStore = (store) => this.dispatcher.hasStore(store);
46
- this.registerStore = (store) => this.dispatcher.registerStore(store);
47
- this.unregisterStore = (store) => this.dispatcher.unregisterStore(store);
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;
@@ -1,6 +1,9 @@
1
1
  import { format, parse } from '@tinkoff/url';
2
2
 
3
3
  class RequestManager {
4
+ request;
5
+ url;
6
+ parsedUrl;
4
7
  constructor({ request }) {
5
8
  this.request = request || {};
6
9
  if (typeof window === 'undefined') {
@@ -1,6 +1,9 @@
1
1
  import { format, parse } from '@tinkoff/url';
2
2
 
3
3
  class RequestManager {
4
+ request;
5
+ url;
6
+ parsedUrl;
4
7
  constructor({ request }) {
5
8
  this.request = request || {};
6
9
  if (typeof window === 'undefined') {
@@ -5,6 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var url = require('@tinkoff/url');
6
6
 
7
7
  class RequestManager {
8
+ request;
9
+ url;
10
+ parsedUrl;
8
11
  constructor({ request }) {
9
12
  this.request = request || {};
10
13
  if (typeof window === 'undefined') {
@@ -2,6 +2,10 @@ import isEmpty from '@tinkoff/utils/is/empty';
2
2
  import values from '@tinkoff/utils/object/values';
3
3
 
4
4
  class ResponseManager {
5
+ body;
6
+ headers;
7
+ cookies;
8
+ status;
5
9
  constructor() {
6
10
  this.body = '';
7
11
  this.headers = {};
@@ -2,6 +2,10 @@ import isEmpty from '@tinkoff/utils/is/empty';
2
2
  import values from '@tinkoff/utils/object/values';
3
3
 
4
4
  class ResponseManager {
5
+ body;
6
+ headers;
7
+ cookies;
8
+ status;
5
9
  constructor() {
6
10
  this.body = '';
7
11
  this.headers = {};
@@ -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.49.1",
3
+ "version": "5.53.74",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -11,14 +11,14 @@
11
11
  "browser": {
12
12
  "./lib/actions/actionPageRunner.js": "./lib/actions/actionPageRunner.browser.js",
13
13
  "./lib/actions/deferred/providers.js": "./lib/actions/deferred/providers.browser.js",
14
- "./lib/cache/serverProviders.js": "./lib/cache/clientProviders.js",
14
+ "./lib/async-local-storage/server.js": "./lib/async-local-storage/browser.js",
15
15
  "./lib/cache/cacheFactory.js": "./lib/cache/cacheFactory.browser.js",
16
+ "./lib/cache/serverProviders.js": "./lib/cache/clientProviders.js",
17
+ "./lib/child-app/serverProviders.js": "./lib/child-app/clientProviders.js",
16
18
  "./lib/index.es.js": "./lib/index.browser.js",
17
19
  "./lib/providers/serverProviders.js": "./lib/providers/clientProviders.js",
18
- "./lib/child-app/serverProviders.js": "./lib/child-app/clientProviders.js",
19
20
  "./lib/requestManager/RequestManagerModule.js": "./lib/requestManager/RequestManagerModule.browser.js",
20
- "./lib/responseManager/ResponseManagerModule.js": "./lib/responseManager/ResponseManagerModule.browser.js",
21
- "./lib/async-local-storage/server.js": "./lib/async-local-storage/browser.js"
21
+ "./lib/responseManager/ResponseManagerModule.js": "./lib/responseManager/ResponseManagerModule.browser.js"
22
22
  },
23
23
  "sideEffects": false,
24
24
  "repository": {
@@ -31,35 +31,35 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@akashbabu/lfu-cache": "1.0.2",
34
- "@tinkoff/errors": "0.6.2",
35
- "@tinkoff/hook-runner": "0.7.3",
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.2",
39
- "@tramvai/experiments": "5.49.1",
40
- "@tramvai/module-cookie": "5.49.1",
41
- "@tramvai/module-environment": "5.49.1",
42
- "@tramvai/module-log": "5.49.1",
38
+ "@tinkoff/url": "0.11.3",
39
+ "@tramvai/experiments": "5.53.74",
40
+ "@tramvai/module-cookie": "5.53.74",
41
+ "@tramvai/module-environment": "5.53.74",
42
+ "@tramvai/module-log": "5.53.74",
43
43
  "@tramvai/safe-strings": "0.8.4",
44
- "@tramvai/tokens-child-app": "5.49.1",
45
- "@tramvai/tokens-common": "5.49.1",
46
- "@tramvai/tokens-core-private": "5.49.1",
47
- "@tramvai/tokens-metrics": "5.49.1",
48
- "@tramvai/tokens-render": "5.49.1",
49
- "@tramvai/tokens-router": "5.49.1",
50
- "@tramvai/tokens-server-private": "5.49.1",
51
- "@tramvai/types-actions-state-context": "5.49.1",
44
+ "@tramvai/tokens-child-app": "5.53.74",
45
+ "@tramvai/tokens-common": "5.53.74",
46
+ "@tramvai/tokens-core-private": "5.53.74",
47
+ "@tramvai/tokens-metrics": "5.53.74",
48
+ "@tramvai/tokens-render": "5.53.74",
49
+ "@tramvai/tokens-router": "5.53.74",
50
+ "@tramvai/tokens-server-private": "5.53.74",
51
+ "@tramvai/types-actions-state-context": "5.53.74",
52
52
  "hoist-non-react-statics": "^3.3.1"
53
53
  },
54
54
  "peerDependencies": {
55
- "@tinkoff/dippy": "0.11.4",
55
+ "@tinkoff/dippy": "0.11.5",
56
56
  "@tinkoff/utils": "^2.1.2",
57
- "@tramvai/cli": "5.49.1",
58
- "@tramvai/core": "5.49.1",
59
- "@tramvai/papi": "5.49.1",
60
- "@tramvai/react": "5.49.1",
61
- "@tramvai/state": "5.49.1",
62
- "@tramvai/tokens-server": "5.49.1",
57
+ "@tramvai/cli": "5.53.74",
58
+ "@tramvai/core": "5.53.74",
59
+ "@tramvai/papi": "5.53.74",
60
+ "@tramvai/react": "5.53.74",
61
+ "@tramvai/state": "5.53.74",
62
+ "@tramvai/tokens-server": "5.53.74",
63
63
  "react": ">=16.14.0",
64
64
  "tslib": "^2.4.0"
65
65
  },