@tramvai/tokens-common 2.70.0 → 2.72.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/action.es.js +26 -0
- package/lib/action.js +33 -0
- package/lib/bundle.es.js +17 -0
- package/lib/bundle.js +22 -0
- package/lib/cache.es.js +21 -0
- package/lib/cache.js +27 -0
- package/lib/componentRegistry.es.js +11 -0
- package/lib/componentRegistry.js +15 -0
- package/lib/context.es.js +9 -0
- package/lib/context.js +13 -0
- package/lib/env.es.js +10 -0
- package/lib/env.js +15 -0
- package/lib/execution.es.js +7 -0
- package/lib/execution.js +13 -0
- package/lib/hook.es.js +9 -0
- package/lib/hook.js +13 -0
- package/lib/index.es.js +13 -162
- package/lib/index.js +46 -191
- package/lib/logger.es.js +14 -0
- package/lib/logger.js +19 -0
- package/lib/pubsub.es.js +19 -0
- package/lib/pubsub.js +25 -0
- package/lib/requestManager.es.js +10 -0
- package/lib/requestManager.js +14 -0
- package/lib/responseManager.es.js +10 -0
- package/lib/responseManager.js +14 -0
- package/lib/state.es.js +35 -0
- package/lib/state.js +44 -0
- package/package.json +9 -10
package/lib/action.es.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createToken } from '@tinkoff/dippy';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* Registry for storing actions based on their type
|
|
6
|
+
*/
|
|
7
|
+
const ACTION_REGISTRY_TOKEN = createToken('actionRegistry');
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* Instance that executes actions
|
|
11
|
+
*/
|
|
12
|
+
const ACTION_EXECUTION_TOKEN = createToken('actionExecution');
|
|
13
|
+
/**
|
|
14
|
+
* @description
|
|
15
|
+
* Instance that executes actions on navigations
|
|
16
|
+
*/
|
|
17
|
+
const ACTION_PAGE_RUNNER_TOKEN = createToken('actionPageRunner');
|
|
18
|
+
/**
|
|
19
|
+
* @description
|
|
20
|
+
* Conditions that specify should action be executing or not
|
|
21
|
+
*/
|
|
22
|
+
const ACTION_CONDITIONALS = createToken('actionConditionals', {
|
|
23
|
+
multi: true,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { ACTION_CONDITIONALS, ACTION_EXECUTION_TOKEN, ACTION_PAGE_RUNNER_TOKEN, ACTION_REGISTRY_TOKEN };
|
package/lib/action.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dippy = require('@tinkoff/dippy');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* Registry for storing actions based on their type
|
|
10
|
+
*/
|
|
11
|
+
const ACTION_REGISTRY_TOKEN = dippy.createToken('actionRegistry');
|
|
12
|
+
/**
|
|
13
|
+
* @description
|
|
14
|
+
* Instance that executes actions
|
|
15
|
+
*/
|
|
16
|
+
const ACTION_EXECUTION_TOKEN = dippy.createToken('actionExecution');
|
|
17
|
+
/**
|
|
18
|
+
* @description
|
|
19
|
+
* Instance that executes actions on navigations
|
|
20
|
+
*/
|
|
21
|
+
const ACTION_PAGE_RUNNER_TOKEN = dippy.createToken('actionPageRunner');
|
|
22
|
+
/**
|
|
23
|
+
* @description
|
|
24
|
+
* Conditions that specify should action be executing or not
|
|
25
|
+
*/
|
|
26
|
+
const ACTION_CONDITIONALS = dippy.createToken('actionConditionals', {
|
|
27
|
+
multi: true,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
exports.ACTION_CONDITIONALS = ACTION_CONDITIONALS;
|
|
31
|
+
exports.ACTION_EXECUTION_TOKEN = ACTION_EXECUTION_TOKEN;
|
|
32
|
+
exports.ACTION_PAGE_RUNNER_TOKEN = ACTION_PAGE_RUNNER_TOKEN;
|
|
33
|
+
exports.ACTION_REGISTRY_TOKEN = ACTION_REGISTRY_TOKEN;
|
package/lib/bundle.es.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createToken } from '@tinkoff/dippy';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* Bundle Storage. When getting bundle additionally adds actions and components from bundle to according storages
|
|
6
|
+
*/
|
|
7
|
+
const BUNDLE_MANAGER_TOKEN = createToken('bundleManager');
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* Provides additional bundles to the app.
|
|
11
|
+
* Important! This token doesn't overrides already existing bundles.
|
|
12
|
+
*/
|
|
13
|
+
const ADDITIONAL_BUNDLE_TOKEN = createToken('additional bundle', {
|
|
14
|
+
multi: true,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export { ADDITIONAL_BUNDLE_TOKEN, BUNDLE_MANAGER_TOKEN };
|
package/lib/bundle.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dippy = require('@tinkoff/dippy');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* Bundle Storage. When getting bundle additionally adds actions and components from bundle to according storages
|
|
10
|
+
*/
|
|
11
|
+
const BUNDLE_MANAGER_TOKEN = dippy.createToken('bundleManager');
|
|
12
|
+
/**
|
|
13
|
+
* @description
|
|
14
|
+
* Provides additional bundles to the app.
|
|
15
|
+
* Important! This token doesn't overrides already existing bundles.
|
|
16
|
+
*/
|
|
17
|
+
const ADDITIONAL_BUNDLE_TOKEN = dippy.createToken('additional bundle', {
|
|
18
|
+
multi: true,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
exports.ADDITIONAL_BUNDLE_TOKEN = ADDITIONAL_BUNDLE_TOKEN;
|
|
22
|
+
exports.BUNDLE_MANAGER_TOKEN = BUNDLE_MANAGER_TOKEN;
|
package/lib/cache.es.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createToken } from '@tinkoff/dippy';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* Function for creating a new cache
|
|
6
|
+
*
|
|
7
|
+
* *Note*: currently only memory cache with `@tinkoff/lru-cache-nano` is supported
|
|
8
|
+
*/
|
|
9
|
+
const CREATE_CACHE_TOKEN = createToken('createCache');
|
|
10
|
+
/**
|
|
11
|
+
* @description
|
|
12
|
+
* Function that us called on force cache clean up in the app
|
|
13
|
+
*/
|
|
14
|
+
const REGISTER_CLEAR_CACHE_TOKEN = createToken('registerClearCache', { multi: true });
|
|
15
|
+
/**
|
|
16
|
+
* @description
|
|
17
|
+
* Force cleaning up all caches in the app
|
|
18
|
+
*/
|
|
19
|
+
const CLEAR_CACHE_TOKEN = createToken('clearCache');
|
|
20
|
+
|
|
21
|
+
export { CLEAR_CACHE_TOKEN, CREATE_CACHE_TOKEN, REGISTER_CLEAR_CACHE_TOKEN };
|
package/lib/cache.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dippy = require('@tinkoff/dippy');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* Function for creating a new cache
|
|
10
|
+
*
|
|
11
|
+
* *Note*: currently only memory cache with `@tinkoff/lru-cache-nano` is supported
|
|
12
|
+
*/
|
|
13
|
+
const CREATE_CACHE_TOKEN = dippy.createToken('createCache');
|
|
14
|
+
/**
|
|
15
|
+
* @description
|
|
16
|
+
* Function that us called on force cache clean up in the app
|
|
17
|
+
*/
|
|
18
|
+
const REGISTER_CLEAR_CACHE_TOKEN = dippy.createToken('registerClearCache', { multi: true });
|
|
19
|
+
/**
|
|
20
|
+
* @description
|
|
21
|
+
* Force cleaning up all caches in the app
|
|
22
|
+
*/
|
|
23
|
+
const CLEAR_CACHE_TOKEN = dippy.createToken('clearCache');
|
|
24
|
+
|
|
25
|
+
exports.CLEAR_CACHE_TOKEN = CLEAR_CACHE_TOKEN;
|
|
26
|
+
exports.CREATE_CACHE_TOKEN = CREATE_CACHE_TOKEN;
|
|
27
|
+
exports.REGISTER_CLEAR_CACHE_TOKEN = REGISTER_CLEAR_CACHE_TOKEN;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createToken } from '@tinkoff/dippy';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* React components storage.
|
|
6
|
+
* Components in the repository are divided into groups, e.g. you can specify a bundle or a page component as a group key.
|
|
7
|
+
* The entity also allows you to get static component parameters through the `getComponentParam` method (will not work with `lazy` components)
|
|
8
|
+
*/
|
|
9
|
+
const COMPONENT_REGISTRY_TOKEN = createToken('componentRegistry');
|
|
10
|
+
|
|
11
|
+
export { COMPONENT_REGISTRY_TOKEN };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dippy = require('@tinkoff/dippy');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* React components storage.
|
|
10
|
+
* Components in the repository are divided into groups, e.g. you can specify a bundle or a page component as a group key.
|
|
11
|
+
* The entity also allows you to get static component parameters through the `getComponentParam` method (will not work with `lazy` components)
|
|
12
|
+
*/
|
|
13
|
+
const COMPONENT_REGISTRY_TOKEN = dippy.createToken('componentRegistry');
|
|
14
|
+
|
|
15
|
+
exports.COMPONENT_REGISTRY_TOKEN = COMPONENT_REGISTRY_TOKEN;
|
package/lib/context.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dippy = require('@tinkoff/dippy');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* Context implementation
|
|
10
|
+
*/
|
|
11
|
+
const CONTEXT_TOKEN = dippy.createToken('context');
|
|
12
|
+
|
|
13
|
+
exports.CONTEXT_TOKEN = CONTEXT_TOKEN;
|
package/lib/env.es.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createToken } from '@tinkoff/dippy';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* Instance that used for managing env data on the server and on the client
|
|
6
|
+
*/
|
|
7
|
+
const ENV_MANAGER_TOKEN = createToken('environmentManager');
|
|
8
|
+
const ENV_USED_TOKEN = createToken('envUsed', { multi: true });
|
|
9
|
+
|
|
10
|
+
export { ENV_MANAGER_TOKEN, ENV_USED_TOKEN };
|
package/lib/env.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dippy = require('@tinkoff/dippy');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* Instance that used for managing env data on the server and on the client
|
|
10
|
+
*/
|
|
11
|
+
const ENV_MANAGER_TOKEN = dippy.createToken('environmentManager');
|
|
12
|
+
const ENV_USED_TOKEN = dippy.createToken('envUsed', { multi: true });
|
|
13
|
+
|
|
14
|
+
exports.ENV_MANAGER_TOKEN = ENV_MANAGER_TOKEN;
|
|
15
|
+
exports.ENV_USED_TOKEN = ENV_USED_TOKEN;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createToken } from '@tinkoff/dippy';
|
|
2
|
+
|
|
3
|
+
const EXECUTION_CONTEXT_MANAGER_TOKEN = createToken('common ExecutionContextManager');
|
|
4
|
+
const ROOT_EXECUTION_CONTEXT_TOKEN = createToken('common rootExecutionContext');
|
|
5
|
+
const COMMAND_LINE_EXECUTION_CONTEXT_TOKEN = createToken('common commandLineExecutionContext');
|
|
6
|
+
|
|
7
|
+
export { COMMAND_LINE_EXECUTION_CONTEXT_TOKEN, EXECUTION_CONTEXT_MANAGER_TOKEN, ROOT_EXECUTION_CONTEXT_TOKEN };
|
package/lib/execution.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dippy = require('@tinkoff/dippy');
|
|
6
|
+
|
|
7
|
+
const EXECUTION_CONTEXT_MANAGER_TOKEN = dippy.createToken('common ExecutionContextManager');
|
|
8
|
+
const ROOT_EXECUTION_CONTEXT_TOKEN = dippy.createToken('common rootExecutionContext');
|
|
9
|
+
const COMMAND_LINE_EXECUTION_CONTEXT_TOKEN = dippy.createToken('common commandLineExecutionContext');
|
|
10
|
+
|
|
11
|
+
exports.COMMAND_LINE_EXECUTION_CONTEXT_TOKEN = COMMAND_LINE_EXECUTION_CONTEXT_TOKEN;
|
|
12
|
+
exports.EXECUTION_CONTEXT_MANAGER_TOKEN = EXECUTION_CONTEXT_MANAGER_TOKEN;
|
|
13
|
+
exports.ROOT_EXECUTION_CONTEXT_TOKEN = ROOT_EXECUTION_CONTEXT_TOKEN;
|
package/lib/hook.es.js
ADDED
package/lib/hook.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dippy = require('@tinkoff/dippy');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* [Hooks documentation](https://tramvai.dev/docs/references/libs/hooks)
|
|
10
|
+
*/
|
|
11
|
+
const HOOK_TOKEN = dippy.createToken('hooks');
|
|
12
|
+
|
|
13
|
+
exports.HOOK_TOKEN = HOOK_TOKEN;
|
package/lib/index.es.js
CHANGED
|
@@ -1,162 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
multi: true,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @description
|
|
19
|
-
* Context implementation
|
|
20
|
-
*/
|
|
21
|
-
const CONTEXT_TOKEN = createToken('context');
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @description
|
|
25
|
-
* Registry for storing actions based on their type
|
|
26
|
-
*/
|
|
27
|
-
const ACTION_REGISTRY_TOKEN = createToken('actionRegistry');
|
|
28
|
-
/**
|
|
29
|
-
* @description
|
|
30
|
-
* Instance that executes actions
|
|
31
|
-
*/
|
|
32
|
-
const ACTION_EXECUTION_TOKEN = createToken('actionExecution');
|
|
33
|
-
/**
|
|
34
|
-
* @description
|
|
35
|
-
* Instance that executes actions on navigations
|
|
36
|
-
*/
|
|
37
|
-
const ACTION_PAGE_RUNNER_TOKEN = createToken('actionPageRunner');
|
|
38
|
-
/**
|
|
39
|
-
* @description
|
|
40
|
-
* Conditions that specify should action be executing or not
|
|
41
|
-
*/
|
|
42
|
-
const ACTION_CONDITIONALS = createToken('actionConditionals', {
|
|
43
|
-
multi: true,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @description
|
|
48
|
-
* [Hooks documentation](https://tramvai.dev/docs/references/libs/hooks)
|
|
49
|
-
*/
|
|
50
|
-
const HOOK_TOKEN = createToken('hooks');
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @description
|
|
54
|
-
* Factory for creating pubsub instances
|
|
55
|
-
*/
|
|
56
|
-
const PUBSUB_FACTORY_TOKEN = createToken('pubsubFactory');
|
|
57
|
-
/**
|
|
58
|
-
* @description
|
|
59
|
-
* Singleton pubsub instance
|
|
60
|
-
*/
|
|
61
|
-
const PUBSUB_TOKEN = createToken('pubsub');
|
|
62
|
-
/**
|
|
63
|
-
* @description
|
|
64
|
-
* Request pubsub instance that is created for every client
|
|
65
|
-
*/
|
|
66
|
-
const ROOT_PUBSUB_TOKEN = createToken('rootPubsub');
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @description
|
|
70
|
-
* Function for creating a new cache
|
|
71
|
-
*
|
|
72
|
-
* *Note*: currently only memory cache with `@tinkoff/lru-cache-nano` is supported
|
|
73
|
-
*/
|
|
74
|
-
const CREATE_CACHE_TOKEN = createToken('createCache');
|
|
75
|
-
/**
|
|
76
|
-
* @description
|
|
77
|
-
* Function that us called on force cache clean up in the app
|
|
78
|
-
*/
|
|
79
|
-
const REGISTER_CLEAR_CACHE_TOKEN = createToken('registerClearCache', { multi: true });
|
|
80
|
-
/**
|
|
81
|
-
* @description
|
|
82
|
-
* Force cleaning up all caches in the app
|
|
83
|
-
*/
|
|
84
|
-
const CLEAR_CACHE_TOKEN = createToken('clearCache');
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @description
|
|
88
|
-
* React components storage.
|
|
89
|
-
* Components in the repository are divided into groups, e.g. you can specify a bundle or a page component as a group key.
|
|
90
|
-
* The entity also allows you to get static component parameters through the `getComponentParam` method (will not work with `lazy` components)
|
|
91
|
-
*/
|
|
92
|
-
const COMPONENT_REGISTRY_TOKEN = createToken('componentRegistry');
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* @description
|
|
96
|
-
* dispatcher implementation
|
|
97
|
-
* Реализация dispatcher
|
|
98
|
-
*/
|
|
99
|
-
const DISPATCHER_TOKEN = createToken('dispatcher');
|
|
100
|
-
/**
|
|
101
|
-
* @description
|
|
102
|
-
* dispatcher context implementation
|
|
103
|
-
*/
|
|
104
|
-
const DISPATCHER_CONTEXT_TOKEN = createToken('dispatcherContext');
|
|
105
|
-
/**
|
|
106
|
-
* @description
|
|
107
|
-
* Token for adding stores that were created with createReducer
|
|
108
|
-
*/
|
|
109
|
-
const COMBINE_REDUCERS = createToken('combineReducers', { multi: true });
|
|
110
|
-
/**
|
|
111
|
-
* @description
|
|
112
|
-
* Common app store
|
|
113
|
-
*/
|
|
114
|
-
const STORE_TOKEN = createToken('store');
|
|
115
|
-
/**
|
|
116
|
-
* @description
|
|
117
|
-
* Custom middlewares for working with store state
|
|
118
|
-
*/
|
|
119
|
-
const STORE_MIDDLEWARE = createToken('storeMiddleware', { multi: true });
|
|
120
|
-
/**
|
|
121
|
-
* @description
|
|
122
|
-
* Начальное состояние для клиента
|
|
123
|
-
*/
|
|
124
|
-
const INITIAL_APP_STATE_TOKEN = createToken('initialAppState');
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* @description
|
|
128
|
-
* Logger implementation
|
|
129
|
-
*/
|
|
130
|
-
const LOGGER_TOKEN = createToken('logger');
|
|
131
|
-
/**
|
|
132
|
-
* @description
|
|
133
|
-
* Hook to be able to modify logger on initialization
|
|
134
|
-
*/
|
|
135
|
-
const LOGGER_INIT_HOOK = createToken('loggerHook');
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* @description
|
|
139
|
-
* Instance for managing client requests (request headers, query-parameters, cookies etc).
|
|
140
|
-
* Mostly used on server, but has partial functional for browser for simplification build isomorphic app
|
|
141
|
-
*/
|
|
142
|
-
const REQUEST_MANAGER_TOKEN = createToken('requestManager');
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* @description
|
|
146
|
-
* Instance for managing client response (response headers, cookies, response body).
|
|
147
|
-
* Mostly used on server, but has partial functional for browser for simplification build isomorphic app
|
|
148
|
-
*/
|
|
149
|
-
const RESPONSE_MANAGER_TOKEN = createToken('responseManager');
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* @description
|
|
153
|
-
* Instance that used for managing env data on the server and on the client
|
|
154
|
-
*/
|
|
155
|
-
const ENV_MANAGER_TOKEN = createToken('environmentManager');
|
|
156
|
-
const ENV_USED_TOKEN = createToken('envUsed', { multi: true });
|
|
157
|
-
|
|
158
|
-
const EXECUTION_CONTEXT_MANAGER_TOKEN = createToken('common ExecutionContextManager');
|
|
159
|
-
const ROOT_EXECUTION_CONTEXT_TOKEN = createToken('common rootExecutionContext');
|
|
160
|
-
const COMMAND_LINE_EXECUTION_CONTEXT_TOKEN = createToken('common commandLineExecutionContext');
|
|
161
|
-
|
|
162
|
-
export { ACTION_CONDITIONALS, ACTION_EXECUTION_TOKEN, ACTION_PAGE_RUNNER_TOKEN, ACTION_REGISTRY_TOKEN, ADDITIONAL_BUNDLE_TOKEN, BUNDLE_MANAGER_TOKEN, CLEAR_CACHE_TOKEN, COMBINE_REDUCERS, COMMAND_LINE_EXECUTION_CONTEXT_TOKEN, COMPONENT_REGISTRY_TOKEN, CONTEXT_TOKEN, CREATE_CACHE_TOKEN, DISPATCHER_CONTEXT_TOKEN, DISPATCHER_TOKEN, ENV_MANAGER_TOKEN, ENV_USED_TOKEN, EXECUTION_CONTEXT_MANAGER_TOKEN, HOOK_TOKEN, INITIAL_APP_STATE_TOKEN, LOGGER_INIT_HOOK, LOGGER_TOKEN, PUBSUB_FACTORY_TOKEN, PUBSUB_TOKEN, REGISTER_CLEAR_CACHE_TOKEN, REQUEST_MANAGER_TOKEN, RESPONSE_MANAGER_TOKEN, ROOT_EXECUTION_CONTEXT_TOKEN, ROOT_PUBSUB_TOKEN, STORE_MIDDLEWARE, STORE_TOKEN };
|
|
1
|
+
export { ADDITIONAL_BUNDLE_TOKEN, BUNDLE_MANAGER_TOKEN } from './bundle.es.js';
|
|
2
|
+
export { CONTEXT_TOKEN } from './context.es.js';
|
|
3
|
+
export { ACTION_CONDITIONALS, ACTION_EXECUTION_TOKEN, ACTION_PAGE_RUNNER_TOKEN, ACTION_REGISTRY_TOKEN } from './action.es.js';
|
|
4
|
+
export { HOOK_TOKEN } from './hook.es.js';
|
|
5
|
+
export { PUBSUB_FACTORY_TOKEN, PUBSUB_TOKEN, ROOT_PUBSUB_TOKEN } from './pubsub.es.js';
|
|
6
|
+
export { CLEAR_CACHE_TOKEN, CREATE_CACHE_TOKEN, REGISTER_CLEAR_CACHE_TOKEN } from './cache.es.js';
|
|
7
|
+
export { COMPONENT_REGISTRY_TOKEN } from './componentRegistry.es.js';
|
|
8
|
+
export { COMBINE_REDUCERS, DISPATCHER_CONTEXT_TOKEN, DISPATCHER_TOKEN, INITIAL_APP_STATE_TOKEN, STORE_MIDDLEWARE, STORE_TOKEN } from './state.es.js';
|
|
9
|
+
export { LOGGER_INIT_HOOK, LOGGER_TOKEN } from './logger.es.js';
|
|
10
|
+
export { REQUEST_MANAGER_TOKEN } from './requestManager.es.js';
|
|
11
|
+
export { RESPONSE_MANAGER_TOKEN } from './responseManager.es.js';
|
|
12
|
+
export { ENV_MANAGER_TOKEN, ENV_USED_TOKEN } from './env.es.js';
|
|
13
|
+
export { COMMAND_LINE_EXECUTION_CONTEXT_TOKEN, EXECUTION_CONTEXT_MANAGER_TOKEN, ROOT_EXECUTION_CONTEXT_TOKEN } from './execution.es.js';
|
package/lib/index.js
CHANGED
|
@@ -2,194 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
* @description
|
|
52
|
-
* [Hooks documentation](https://tramvai.dev/docs/references/libs/hooks)
|
|
53
|
-
*/
|
|
54
|
-
const HOOK_TOKEN = dippy.createToken('hooks');
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* @description
|
|
58
|
-
* Factory for creating pubsub instances
|
|
59
|
-
*/
|
|
60
|
-
const PUBSUB_FACTORY_TOKEN = dippy.createToken('pubsubFactory');
|
|
61
|
-
/**
|
|
62
|
-
* @description
|
|
63
|
-
* Singleton pubsub instance
|
|
64
|
-
*/
|
|
65
|
-
const PUBSUB_TOKEN = dippy.createToken('pubsub');
|
|
66
|
-
/**
|
|
67
|
-
* @description
|
|
68
|
-
* Request pubsub instance that is created for every client
|
|
69
|
-
*/
|
|
70
|
-
const ROOT_PUBSUB_TOKEN = dippy.createToken('rootPubsub');
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* @description
|
|
74
|
-
* Function for creating a new cache
|
|
75
|
-
*
|
|
76
|
-
* *Note*: currently only memory cache with `@tinkoff/lru-cache-nano` is supported
|
|
77
|
-
*/
|
|
78
|
-
const CREATE_CACHE_TOKEN = dippy.createToken('createCache');
|
|
79
|
-
/**
|
|
80
|
-
* @description
|
|
81
|
-
* Function that us called on force cache clean up in the app
|
|
82
|
-
*/
|
|
83
|
-
const REGISTER_CLEAR_CACHE_TOKEN = dippy.createToken('registerClearCache', { multi: true });
|
|
84
|
-
/**
|
|
85
|
-
* @description
|
|
86
|
-
* Force cleaning up all caches in the app
|
|
87
|
-
*/
|
|
88
|
-
const CLEAR_CACHE_TOKEN = dippy.createToken('clearCache');
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* @description
|
|
92
|
-
* React components storage.
|
|
93
|
-
* Components in the repository are divided into groups, e.g. you can specify a bundle or a page component as a group key.
|
|
94
|
-
* The entity also allows you to get static component parameters through the `getComponentParam` method (will not work with `lazy` components)
|
|
95
|
-
*/
|
|
96
|
-
const COMPONENT_REGISTRY_TOKEN = dippy.createToken('componentRegistry');
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @description
|
|
100
|
-
* dispatcher implementation
|
|
101
|
-
* Реализация dispatcher
|
|
102
|
-
*/
|
|
103
|
-
const DISPATCHER_TOKEN = dippy.createToken('dispatcher');
|
|
104
|
-
/**
|
|
105
|
-
* @description
|
|
106
|
-
* dispatcher context implementation
|
|
107
|
-
*/
|
|
108
|
-
const DISPATCHER_CONTEXT_TOKEN = dippy.createToken('dispatcherContext');
|
|
109
|
-
/**
|
|
110
|
-
* @description
|
|
111
|
-
* Token for adding stores that were created with createReducer
|
|
112
|
-
*/
|
|
113
|
-
const COMBINE_REDUCERS = dippy.createToken('combineReducers', { multi: true });
|
|
114
|
-
/**
|
|
115
|
-
* @description
|
|
116
|
-
* Common app store
|
|
117
|
-
*/
|
|
118
|
-
const STORE_TOKEN = dippy.createToken('store');
|
|
119
|
-
/**
|
|
120
|
-
* @description
|
|
121
|
-
* Custom middlewares for working with store state
|
|
122
|
-
*/
|
|
123
|
-
const STORE_MIDDLEWARE = dippy.createToken('storeMiddleware', { multi: true });
|
|
124
|
-
/**
|
|
125
|
-
* @description
|
|
126
|
-
* Начальное состояние для клиента
|
|
127
|
-
*/
|
|
128
|
-
const INITIAL_APP_STATE_TOKEN = dippy.createToken('initialAppState');
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* @description
|
|
132
|
-
* Logger implementation
|
|
133
|
-
*/
|
|
134
|
-
const LOGGER_TOKEN = dippy.createToken('logger');
|
|
135
|
-
/**
|
|
136
|
-
* @description
|
|
137
|
-
* Hook to be able to modify logger on initialization
|
|
138
|
-
*/
|
|
139
|
-
const LOGGER_INIT_HOOK = dippy.createToken('loggerHook');
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @description
|
|
143
|
-
* Instance for managing client requests (request headers, query-parameters, cookies etc).
|
|
144
|
-
* Mostly used on server, but has partial functional for browser for simplification build isomorphic app
|
|
145
|
-
*/
|
|
146
|
-
const REQUEST_MANAGER_TOKEN = dippy.createToken('requestManager');
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* @description
|
|
150
|
-
* Instance for managing client response (response headers, cookies, response body).
|
|
151
|
-
* Mostly used on server, but has partial functional for browser for simplification build isomorphic app
|
|
152
|
-
*/
|
|
153
|
-
const RESPONSE_MANAGER_TOKEN = dippy.createToken('responseManager');
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* @description
|
|
157
|
-
* Instance that used for managing env data on the server and on the client
|
|
158
|
-
*/
|
|
159
|
-
const ENV_MANAGER_TOKEN = dippy.createToken('environmentManager');
|
|
160
|
-
const ENV_USED_TOKEN = dippy.createToken('envUsed', { multi: true });
|
|
161
|
-
|
|
162
|
-
const EXECUTION_CONTEXT_MANAGER_TOKEN = dippy.createToken('common ExecutionContextManager');
|
|
163
|
-
const ROOT_EXECUTION_CONTEXT_TOKEN = dippy.createToken('common rootExecutionContext');
|
|
164
|
-
const COMMAND_LINE_EXECUTION_CONTEXT_TOKEN = dippy.createToken('common commandLineExecutionContext');
|
|
165
|
-
|
|
166
|
-
exports.ACTION_CONDITIONALS = ACTION_CONDITIONALS;
|
|
167
|
-
exports.ACTION_EXECUTION_TOKEN = ACTION_EXECUTION_TOKEN;
|
|
168
|
-
exports.ACTION_PAGE_RUNNER_TOKEN = ACTION_PAGE_RUNNER_TOKEN;
|
|
169
|
-
exports.ACTION_REGISTRY_TOKEN = ACTION_REGISTRY_TOKEN;
|
|
170
|
-
exports.ADDITIONAL_BUNDLE_TOKEN = ADDITIONAL_BUNDLE_TOKEN;
|
|
171
|
-
exports.BUNDLE_MANAGER_TOKEN = BUNDLE_MANAGER_TOKEN;
|
|
172
|
-
exports.CLEAR_CACHE_TOKEN = CLEAR_CACHE_TOKEN;
|
|
173
|
-
exports.COMBINE_REDUCERS = COMBINE_REDUCERS;
|
|
174
|
-
exports.COMMAND_LINE_EXECUTION_CONTEXT_TOKEN = COMMAND_LINE_EXECUTION_CONTEXT_TOKEN;
|
|
175
|
-
exports.COMPONENT_REGISTRY_TOKEN = COMPONENT_REGISTRY_TOKEN;
|
|
176
|
-
exports.CONTEXT_TOKEN = CONTEXT_TOKEN;
|
|
177
|
-
exports.CREATE_CACHE_TOKEN = CREATE_CACHE_TOKEN;
|
|
178
|
-
exports.DISPATCHER_CONTEXT_TOKEN = DISPATCHER_CONTEXT_TOKEN;
|
|
179
|
-
exports.DISPATCHER_TOKEN = DISPATCHER_TOKEN;
|
|
180
|
-
exports.ENV_MANAGER_TOKEN = ENV_MANAGER_TOKEN;
|
|
181
|
-
exports.ENV_USED_TOKEN = ENV_USED_TOKEN;
|
|
182
|
-
exports.EXECUTION_CONTEXT_MANAGER_TOKEN = EXECUTION_CONTEXT_MANAGER_TOKEN;
|
|
183
|
-
exports.HOOK_TOKEN = HOOK_TOKEN;
|
|
184
|
-
exports.INITIAL_APP_STATE_TOKEN = INITIAL_APP_STATE_TOKEN;
|
|
185
|
-
exports.LOGGER_INIT_HOOK = LOGGER_INIT_HOOK;
|
|
186
|
-
exports.LOGGER_TOKEN = LOGGER_TOKEN;
|
|
187
|
-
exports.PUBSUB_FACTORY_TOKEN = PUBSUB_FACTORY_TOKEN;
|
|
188
|
-
exports.PUBSUB_TOKEN = PUBSUB_TOKEN;
|
|
189
|
-
exports.REGISTER_CLEAR_CACHE_TOKEN = REGISTER_CLEAR_CACHE_TOKEN;
|
|
190
|
-
exports.REQUEST_MANAGER_TOKEN = REQUEST_MANAGER_TOKEN;
|
|
191
|
-
exports.RESPONSE_MANAGER_TOKEN = RESPONSE_MANAGER_TOKEN;
|
|
192
|
-
exports.ROOT_EXECUTION_CONTEXT_TOKEN = ROOT_EXECUTION_CONTEXT_TOKEN;
|
|
193
|
-
exports.ROOT_PUBSUB_TOKEN = ROOT_PUBSUB_TOKEN;
|
|
194
|
-
exports.STORE_MIDDLEWARE = STORE_MIDDLEWARE;
|
|
195
|
-
exports.STORE_TOKEN = STORE_TOKEN;
|
|
5
|
+
var bundle = require('./bundle.js');
|
|
6
|
+
var context = require('./context.js');
|
|
7
|
+
var action = require('./action.js');
|
|
8
|
+
var hook = require('./hook.js');
|
|
9
|
+
var pubsub = require('./pubsub.js');
|
|
10
|
+
var cache = require('./cache.js');
|
|
11
|
+
var componentRegistry = require('./componentRegistry.js');
|
|
12
|
+
var state = require('./state.js');
|
|
13
|
+
var logger = require('./logger.js');
|
|
14
|
+
var requestManager = require('./requestManager.js');
|
|
15
|
+
var responseManager = require('./responseManager.js');
|
|
16
|
+
var env = require('./env.js');
|
|
17
|
+
var execution = require('./execution.js');
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
exports.ADDITIONAL_BUNDLE_TOKEN = bundle.ADDITIONAL_BUNDLE_TOKEN;
|
|
22
|
+
exports.BUNDLE_MANAGER_TOKEN = bundle.BUNDLE_MANAGER_TOKEN;
|
|
23
|
+
exports.CONTEXT_TOKEN = context.CONTEXT_TOKEN;
|
|
24
|
+
exports.ACTION_CONDITIONALS = action.ACTION_CONDITIONALS;
|
|
25
|
+
exports.ACTION_EXECUTION_TOKEN = action.ACTION_EXECUTION_TOKEN;
|
|
26
|
+
exports.ACTION_PAGE_RUNNER_TOKEN = action.ACTION_PAGE_RUNNER_TOKEN;
|
|
27
|
+
exports.ACTION_REGISTRY_TOKEN = action.ACTION_REGISTRY_TOKEN;
|
|
28
|
+
exports.HOOK_TOKEN = hook.HOOK_TOKEN;
|
|
29
|
+
exports.PUBSUB_FACTORY_TOKEN = pubsub.PUBSUB_FACTORY_TOKEN;
|
|
30
|
+
exports.PUBSUB_TOKEN = pubsub.PUBSUB_TOKEN;
|
|
31
|
+
exports.ROOT_PUBSUB_TOKEN = pubsub.ROOT_PUBSUB_TOKEN;
|
|
32
|
+
exports.CLEAR_CACHE_TOKEN = cache.CLEAR_CACHE_TOKEN;
|
|
33
|
+
exports.CREATE_CACHE_TOKEN = cache.CREATE_CACHE_TOKEN;
|
|
34
|
+
exports.REGISTER_CLEAR_CACHE_TOKEN = cache.REGISTER_CLEAR_CACHE_TOKEN;
|
|
35
|
+
exports.COMPONENT_REGISTRY_TOKEN = componentRegistry.COMPONENT_REGISTRY_TOKEN;
|
|
36
|
+
exports.COMBINE_REDUCERS = state.COMBINE_REDUCERS;
|
|
37
|
+
exports.DISPATCHER_CONTEXT_TOKEN = state.DISPATCHER_CONTEXT_TOKEN;
|
|
38
|
+
exports.DISPATCHER_TOKEN = state.DISPATCHER_TOKEN;
|
|
39
|
+
exports.INITIAL_APP_STATE_TOKEN = state.INITIAL_APP_STATE_TOKEN;
|
|
40
|
+
exports.STORE_MIDDLEWARE = state.STORE_MIDDLEWARE;
|
|
41
|
+
exports.STORE_TOKEN = state.STORE_TOKEN;
|
|
42
|
+
exports.LOGGER_INIT_HOOK = logger.LOGGER_INIT_HOOK;
|
|
43
|
+
exports.LOGGER_TOKEN = logger.LOGGER_TOKEN;
|
|
44
|
+
exports.REQUEST_MANAGER_TOKEN = requestManager.REQUEST_MANAGER_TOKEN;
|
|
45
|
+
exports.RESPONSE_MANAGER_TOKEN = responseManager.RESPONSE_MANAGER_TOKEN;
|
|
46
|
+
exports.ENV_MANAGER_TOKEN = env.ENV_MANAGER_TOKEN;
|
|
47
|
+
exports.ENV_USED_TOKEN = env.ENV_USED_TOKEN;
|
|
48
|
+
exports.COMMAND_LINE_EXECUTION_CONTEXT_TOKEN = execution.COMMAND_LINE_EXECUTION_CONTEXT_TOKEN;
|
|
49
|
+
exports.EXECUTION_CONTEXT_MANAGER_TOKEN = execution.EXECUTION_CONTEXT_MANAGER_TOKEN;
|
|
50
|
+
exports.ROOT_EXECUTION_CONTEXT_TOKEN = execution.ROOT_EXECUTION_CONTEXT_TOKEN;
|
package/lib/logger.es.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createToken } from '@tinkoff/dippy';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* Logger implementation
|
|
6
|
+
*/
|
|
7
|
+
const LOGGER_TOKEN = createToken('logger');
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* Hook to be able to modify logger on initialization
|
|
11
|
+
*/
|
|
12
|
+
const LOGGER_INIT_HOOK = createToken('loggerHook');
|
|
13
|
+
|
|
14
|
+
export { LOGGER_INIT_HOOK, LOGGER_TOKEN };
|
package/lib/logger.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dippy = require('@tinkoff/dippy');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* Logger implementation
|
|
10
|
+
*/
|
|
11
|
+
const LOGGER_TOKEN = dippy.createToken('logger');
|
|
12
|
+
/**
|
|
13
|
+
* @description
|
|
14
|
+
* Hook to be able to modify logger on initialization
|
|
15
|
+
*/
|
|
16
|
+
const LOGGER_INIT_HOOK = dippy.createToken('loggerHook');
|
|
17
|
+
|
|
18
|
+
exports.LOGGER_INIT_HOOK = LOGGER_INIT_HOOK;
|
|
19
|
+
exports.LOGGER_TOKEN = LOGGER_TOKEN;
|
package/lib/pubsub.es.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createToken } from '@tinkoff/dippy';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* Factory for creating pubsub instances
|
|
6
|
+
*/
|
|
7
|
+
const PUBSUB_FACTORY_TOKEN = createToken('pubsubFactory');
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* Singleton pubsub instance
|
|
11
|
+
*/
|
|
12
|
+
const PUBSUB_TOKEN = createToken('pubsub');
|
|
13
|
+
/**
|
|
14
|
+
* @description
|
|
15
|
+
* Request pubsub instance that is created for every client
|
|
16
|
+
*/
|
|
17
|
+
const ROOT_PUBSUB_TOKEN = createToken('rootPubsub');
|
|
18
|
+
|
|
19
|
+
export { PUBSUB_FACTORY_TOKEN, PUBSUB_TOKEN, ROOT_PUBSUB_TOKEN };
|
package/lib/pubsub.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dippy = require('@tinkoff/dippy');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* Factory for creating pubsub instances
|
|
10
|
+
*/
|
|
11
|
+
const PUBSUB_FACTORY_TOKEN = dippy.createToken('pubsubFactory');
|
|
12
|
+
/**
|
|
13
|
+
* @description
|
|
14
|
+
* Singleton pubsub instance
|
|
15
|
+
*/
|
|
16
|
+
const PUBSUB_TOKEN = dippy.createToken('pubsub');
|
|
17
|
+
/**
|
|
18
|
+
* @description
|
|
19
|
+
* Request pubsub instance that is created for every client
|
|
20
|
+
*/
|
|
21
|
+
const ROOT_PUBSUB_TOKEN = dippy.createToken('rootPubsub');
|
|
22
|
+
|
|
23
|
+
exports.PUBSUB_FACTORY_TOKEN = PUBSUB_FACTORY_TOKEN;
|
|
24
|
+
exports.PUBSUB_TOKEN = PUBSUB_TOKEN;
|
|
25
|
+
exports.ROOT_PUBSUB_TOKEN = ROOT_PUBSUB_TOKEN;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createToken } from '@tinkoff/dippy';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* Instance for managing client requests (request headers, query-parameters, cookies etc).
|
|
6
|
+
* Mostly used on server, but has partial functional for browser for simplification build isomorphic app
|
|
7
|
+
*/
|
|
8
|
+
const REQUEST_MANAGER_TOKEN = createToken('requestManager');
|
|
9
|
+
|
|
10
|
+
export { REQUEST_MANAGER_TOKEN };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dippy = require('@tinkoff/dippy');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* Instance for managing client requests (request headers, query-parameters, cookies etc).
|
|
10
|
+
* Mostly used on server, but has partial functional for browser for simplification build isomorphic app
|
|
11
|
+
*/
|
|
12
|
+
const REQUEST_MANAGER_TOKEN = dippy.createToken('requestManager');
|
|
13
|
+
|
|
14
|
+
exports.REQUEST_MANAGER_TOKEN = REQUEST_MANAGER_TOKEN;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createToken } from '@tinkoff/dippy';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* Instance for managing client response (response headers, cookies, response body).
|
|
6
|
+
* Mostly used on server, but has partial functional for browser for simplification build isomorphic app
|
|
7
|
+
*/
|
|
8
|
+
const RESPONSE_MANAGER_TOKEN = createToken('responseManager');
|
|
9
|
+
|
|
10
|
+
export { RESPONSE_MANAGER_TOKEN };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dippy = require('@tinkoff/dippy');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* Instance for managing client response (response headers, cookies, response body).
|
|
10
|
+
* Mostly used on server, but has partial functional for browser for simplification build isomorphic app
|
|
11
|
+
*/
|
|
12
|
+
const RESPONSE_MANAGER_TOKEN = dippy.createToken('responseManager');
|
|
13
|
+
|
|
14
|
+
exports.RESPONSE_MANAGER_TOKEN = RESPONSE_MANAGER_TOKEN;
|
package/lib/state.es.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createToken } from '@tinkoff/dippy';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* dispatcher implementation
|
|
6
|
+
* Реализация dispatcher
|
|
7
|
+
*/
|
|
8
|
+
const DISPATCHER_TOKEN = createToken('dispatcher');
|
|
9
|
+
/**
|
|
10
|
+
* @description
|
|
11
|
+
* dispatcher context implementation
|
|
12
|
+
*/
|
|
13
|
+
const DISPATCHER_CONTEXT_TOKEN = createToken('dispatcherContext');
|
|
14
|
+
/**
|
|
15
|
+
* @description
|
|
16
|
+
* Token for adding stores that were created with createReducer
|
|
17
|
+
*/
|
|
18
|
+
const COMBINE_REDUCERS = createToken('combineReducers', { multi: true });
|
|
19
|
+
/**
|
|
20
|
+
* @description
|
|
21
|
+
* Common app store
|
|
22
|
+
*/
|
|
23
|
+
const STORE_TOKEN = createToken('store');
|
|
24
|
+
/**
|
|
25
|
+
* @description
|
|
26
|
+
* Custom middlewares for working with store state
|
|
27
|
+
*/
|
|
28
|
+
const STORE_MIDDLEWARE = createToken('storeMiddleware', { multi: true });
|
|
29
|
+
/**
|
|
30
|
+
* @description
|
|
31
|
+
* Начальное состояние для клиента
|
|
32
|
+
*/
|
|
33
|
+
const INITIAL_APP_STATE_TOKEN = createToken('initialAppState');
|
|
34
|
+
|
|
35
|
+
export { COMBINE_REDUCERS, DISPATCHER_CONTEXT_TOKEN, DISPATCHER_TOKEN, INITIAL_APP_STATE_TOKEN, STORE_MIDDLEWARE, STORE_TOKEN };
|
package/lib/state.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dippy = require('@tinkoff/dippy');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* dispatcher implementation
|
|
10
|
+
* Реализация dispatcher
|
|
11
|
+
*/
|
|
12
|
+
const DISPATCHER_TOKEN = dippy.createToken('dispatcher');
|
|
13
|
+
/**
|
|
14
|
+
* @description
|
|
15
|
+
* dispatcher context implementation
|
|
16
|
+
*/
|
|
17
|
+
const DISPATCHER_CONTEXT_TOKEN = dippy.createToken('dispatcherContext');
|
|
18
|
+
/**
|
|
19
|
+
* @description
|
|
20
|
+
* Token for adding stores that were created with createReducer
|
|
21
|
+
*/
|
|
22
|
+
const COMBINE_REDUCERS = dippy.createToken('combineReducers', { multi: true });
|
|
23
|
+
/**
|
|
24
|
+
* @description
|
|
25
|
+
* Common app store
|
|
26
|
+
*/
|
|
27
|
+
const STORE_TOKEN = dippy.createToken('store');
|
|
28
|
+
/**
|
|
29
|
+
* @description
|
|
30
|
+
* Custom middlewares for working with store state
|
|
31
|
+
*/
|
|
32
|
+
const STORE_MIDDLEWARE = dippy.createToken('storeMiddleware', { multi: true });
|
|
33
|
+
/**
|
|
34
|
+
* @description
|
|
35
|
+
* Начальное состояние для клиента
|
|
36
|
+
*/
|
|
37
|
+
const INITIAL_APP_STATE_TOKEN = dippy.createToken('initialAppState');
|
|
38
|
+
|
|
39
|
+
exports.COMBINE_REDUCERS = COMBINE_REDUCERS;
|
|
40
|
+
exports.DISPATCHER_CONTEXT_TOKEN = DISPATCHER_CONTEXT_TOKEN;
|
|
41
|
+
exports.DISPATCHER_TOKEN = DISPATCHER_TOKEN;
|
|
42
|
+
exports.INITIAL_APP_STATE_TOKEN = INITIAL_APP_STATE_TOKEN;
|
|
43
|
+
exports.STORE_MIDDLEWARE = STORE_MIDDLEWARE;
|
|
44
|
+
exports.STORE_TOKEN = STORE_TOKEN;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/tokens-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.72.0",
|
|
4
4
|
"description": "Tramvai tokens for @tramvai/module-common",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.es.js",
|
|
@@ -14,21 +14,20 @@
|
|
|
14
14
|
"url": "git@github.com:Tinkoff/tramvai.git"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "tramvai-build --
|
|
18
|
-
"watch": "tsc -w"
|
|
19
|
-
"build-for-publish": "true"
|
|
17
|
+
"build": "tramvai-build --forPublish --preserveModules",
|
|
18
|
+
"watch": "tsc -w"
|
|
20
19
|
},
|
|
21
20
|
"dependencies": {
|
|
22
21
|
"@tinkoff/lru-cache-nano": "^7.8.1",
|
|
23
|
-
"@tinkoff/url": "0.8.
|
|
24
|
-
"@tramvai/react": "2.
|
|
25
|
-
"@tramvai/tokens-core": "2.
|
|
22
|
+
"@tinkoff/url": "0.8.5",
|
|
23
|
+
"@tramvai/react": "2.72.0",
|
|
24
|
+
"@tramvai/tokens-core": "2.72.0",
|
|
26
25
|
"node-abort-controller": "^3.0.1"
|
|
27
26
|
},
|
|
28
27
|
"peerDependencies": {
|
|
29
|
-
"@tinkoff/dippy": "0.8.
|
|
30
|
-
"@tinkoff/logger": "0.10.
|
|
31
|
-
"@tramvai/types-actions-state-context": "2.
|
|
28
|
+
"@tinkoff/dippy": "0.8.13",
|
|
29
|
+
"@tinkoff/logger": "0.10.58",
|
|
30
|
+
"@tramvai/types-actions-state-context": "2.72.0",
|
|
32
31
|
"react": ">=16.8",
|
|
33
32
|
"tslib": "^2.4.0"
|
|
34
33
|
},
|