@tramvai/tokens-common 4.25.0 → 4.26.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/env.d.ts +10 -3
- package/lib/env.es.js +5 -1
- package/lib/env.js +5 -0
- package/lib/index.es.js +1 -1
- package/lib/index.js +1 -0
- package/package.json +4 -4
package/lib/env.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export interface EnvironmentManager {
|
|
2
2
|
get(name: string): string | undefined;
|
|
3
3
|
getInt(name: string, def: number): number;
|
|
4
|
-
getAll(): Record<string, string>;
|
|
4
|
+
getAll(): Record<string, string | undefined>;
|
|
5
5
|
update(result: Record<string, string>): void;
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated use CLIENT_ENV_MANAGER_TOKEN
|
|
8
8
|
*/
|
|
9
|
-
clientUsed(): Record<string, string>;
|
|
9
|
+
clientUsed(): Record<string, string | undefined>;
|
|
10
10
|
/**
|
|
11
11
|
* @deprecated use CLIENT_ENV_MANAGER_TOKEN
|
|
12
12
|
*/
|
|
@@ -15,7 +15,7 @@ export interface EnvironmentManager {
|
|
|
15
15
|
export interface ClientEnvironmentRepository {
|
|
16
16
|
get(name: string): string | undefined;
|
|
17
17
|
set(name: string, value: string): void;
|
|
18
|
-
getAll(): Record<string, string>;
|
|
18
|
+
getAll(): Record<string, string | undefined>;
|
|
19
19
|
update(result: Record<string, string>): void;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
@@ -65,4 +65,11 @@ export interface EnvParameter {
|
|
|
65
65
|
export declare const ENV_USED_TOKEN: EnvParameter[] & {
|
|
66
66
|
__type?: "multi token" | undefined;
|
|
67
67
|
};
|
|
68
|
+
export type EnvTemplate = {
|
|
69
|
+
key: string;
|
|
70
|
+
fn: (...args: any[]) => string;
|
|
71
|
+
};
|
|
72
|
+
export declare const ENV_TEMPLATE_TOKEN: EnvTemplate & {
|
|
73
|
+
__type?: "multi token" | undefined;
|
|
74
|
+
};
|
|
68
75
|
//# sourceMappingURL=env.d.ts.map
|
package/lib/env.es.js
CHANGED
|
@@ -16,5 +16,9 @@ const CLIENT_ENV_REPOSITORY_TOKEN = createToken('clientEnvironmentManager', {
|
|
|
16
16
|
scope: Scope.REQUEST,
|
|
17
17
|
});
|
|
18
18
|
const ENV_USED_TOKEN = createToken('envUsed', { multi: true });
|
|
19
|
+
const ENV_TEMPLATE_TOKEN = createToken('env template token', {
|
|
20
|
+
multi: true,
|
|
21
|
+
scope: Scope.SINGLETON,
|
|
22
|
+
});
|
|
19
23
|
|
|
20
|
-
export { CLIENT_ENV_REPOSITORY_TOKEN, ENV_MANAGER_TOKEN, ENV_USED_TOKEN };
|
|
24
|
+
export { CLIENT_ENV_REPOSITORY_TOKEN, ENV_MANAGER_TOKEN, ENV_TEMPLATE_TOKEN, ENV_USED_TOKEN };
|
package/lib/env.js
CHANGED
|
@@ -20,7 +20,12 @@ const CLIENT_ENV_REPOSITORY_TOKEN = dippy.createToken('clientEnvironmentManager'
|
|
|
20
20
|
scope: dippy.Scope.REQUEST,
|
|
21
21
|
});
|
|
22
22
|
const ENV_USED_TOKEN = dippy.createToken('envUsed', { multi: true });
|
|
23
|
+
const ENV_TEMPLATE_TOKEN = dippy.createToken('env template token', {
|
|
24
|
+
multi: true,
|
|
25
|
+
scope: dippy.Scope.SINGLETON,
|
|
26
|
+
});
|
|
23
27
|
|
|
24
28
|
exports.CLIENT_ENV_REPOSITORY_TOKEN = CLIENT_ENV_REPOSITORY_TOKEN;
|
|
25
29
|
exports.ENV_MANAGER_TOKEN = ENV_MANAGER_TOKEN;
|
|
30
|
+
exports.ENV_TEMPLATE_TOKEN = ENV_TEMPLATE_TOKEN;
|
|
26
31
|
exports.ENV_USED_TOKEN = ENV_USED_TOKEN;
|
package/lib/index.es.js
CHANGED
|
@@ -9,6 +9,6 @@ export { COMBINE_REDUCERS, DISPATCHER_CONTEXT_TOKEN, DISPATCHER_TOKEN, INITIAL_A
|
|
|
9
9
|
export { LOGGER_INIT_HOOK, LOGGER_REMOTE_REPORTER, LOGGER_SHARED_CONTEXT, LOGGER_TOKEN } from './logger.es.js';
|
|
10
10
|
export { REQUEST_MANAGER_TOKEN } from './requestManager.es.js';
|
|
11
11
|
export { RESPONSE_MANAGER_TOKEN } from './responseManager.es.js';
|
|
12
|
-
export { CLIENT_ENV_REPOSITORY_TOKEN, ENV_MANAGER_TOKEN, ENV_USED_TOKEN } from './env.es.js';
|
|
12
|
+
export { CLIENT_ENV_REPOSITORY_TOKEN, ENV_MANAGER_TOKEN, ENV_TEMPLATE_TOKEN, ENV_USED_TOKEN } from './env.es.js';
|
|
13
13
|
export { COMMAND_LINE_EXECUTION_CONTEXT_TOKEN, EXECUTION_CONTEXT_MANAGER_TOKEN, ROOT_EXECUTION_CONTEXT_TOKEN } from './execution.es.js';
|
|
14
14
|
export { ASYNC_LOCAL_STORAGE_TOKEN } from './async-local-storage.es.js';
|
package/lib/index.js
CHANGED
|
@@ -50,6 +50,7 @@ exports.REQUEST_MANAGER_TOKEN = requestManager.REQUEST_MANAGER_TOKEN;
|
|
|
50
50
|
exports.RESPONSE_MANAGER_TOKEN = responseManager.RESPONSE_MANAGER_TOKEN;
|
|
51
51
|
exports.CLIENT_ENV_REPOSITORY_TOKEN = env.CLIENT_ENV_REPOSITORY_TOKEN;
|
|
52
52
|
exports.ENV_MANAGER_TOKEN = env.ENV_MANAGER_TOKEN;
|
|
53
|
+
exports.ENV_TEMPLATE_TOKEN = env.ENV_TEMPLATE_TOKEN;
|
|
53
54
|
exports.ENV_USED_TOKEN = env.ENV_USED_TOKEN;
|
|
54
55
|
exports.COMMAND_LINE_EXECUTION_CONTEXT_TOKEN = execution.COMMAND_LINE_EXECUTION_CONTEXT_TOKEN;
|
|
55
56
|
exports.EXECUTION_CONTEXT_MANAGER_TOKEN = execution.EXECUTION_CONTEXT_MANAGER_TOKEN;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/tokens-common",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.26.0",
|
|
4
4
|
"description": "Tramvai tokens for @tramvai/module-common",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.es.js",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@tinkoff/lru-cache-nano": "^7.9.0",
|
|
22
22
|
"@tinkoff/url": "0.10.1",
|
|
23
|
-
"@tramvai/react": "4.
|
|
24
|
-
"@tramvai/tokens-core": "4.
|
|
23
|
+
"@tramvai/react": "4.26.0",
|
|
24
|
+
"@tramvai/tokens-core": "4.26.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@tinkoff/dippy": "0.10.8",
|
|
28
28
|
"@tinkoff/logger": "0.10.276",
|
|
29
|
-
"@tramvai/types-actions-state-context": "4.
|
|
29
|
+
"@tramvai/types-actions-state-context": "4.26.0",
|
|
30
30
|
"react": ">=16.8",
|
|
31
31
|
"tslib": "^2.4.0"
|
|
32
32
|
},
|