@twin.org/context 0.0.3-next.1 → 0.0.3-next.10

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.
@@ -1,4 +1,2 @@
1
- // Copyright 2024 IOTA Stiftung.
2
- // SPDX-License-Identifier: Apache-2.0.
3
1
  export {};
4
2
  //# sourceMappingURL=IContextIdHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IContextIdHandler.js","sourceRoot":"","sources":["../../../src/models/IContextIdHandler.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Interface describing a context ID handler.\n */\nexport interface IContextIdHandler {\n\t/**\n\t * The short form version of the context ID, should be unique enough to partition data.\n\t * @param value The full context ID value.\n\t * @returns The short form version of the context ID.\n\t */\n\tshort?(value: string): string;\n\n\t/**\n\t * Performs a runtime guard on the provided context ID value.\n\t * @param value The context ID value to guard.\n\t * @throws Guard error if the value is invalid.\n\t */\n\tguard?(value: string): void;\n}\n"]}
1
+ {"version":3,"file":"IContextIdHandler.js","sourceRoot":"","sources":["../../../src/models/IContextIdHandler.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\n\n/**\n * Interface describing a context ID handler.\n */\nexport interface IContextIdHandler extends IComponent {\n\t/**\n\t * The short form version of the context ID, should be unique enough to partition data.\n\t * @param value The full context ID value.\n\t * @returns The short form version of the context ID.\n\t */\n\tshort?(value: string): string;\n\n\t/**\n\t * Performs a runtime guard on the provided context ID value.\n\t * @param value The context ID value to guard.\n\t * @throws Guard error if the value is invalid.\n\t */\n\tguard?(value: string): void;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { BaseError, GeneralError } from "@twin.org/core";
1
+ import { BaseError, GeneralError, Is, SharedStore } from "@twin.org/core";
2
2
  /**
3
3
  * Class to maintain context ids and execute an async method.
4
4
  */
@@ -7,10 +7,6 @@ export class ContextIdStore {
7
7
  * Runtime name for the class.
8
8
  */
9
9
  static CLASS_NAME = "ContextIdStore";
10
- /**
11
- * The async local storage for the context ids.
12
- */
13
- static _storage;
14
10
  /**
15
11
  * Execute the method wrapped in the context.
16
12
  * @param contextIds The context IDs.
@@ -18,32 +14,37 @@ export class ContextIdStore {
18
14
  * @returns Nothing.
19
15
  */
20
16
  static async run(contextIds, asyncMethod) {
21
- return (await ContextIdStore.createStorage()).run(contextIds, asyncMethod);
17
+ const storage = await ContextIdStore.getStorage();
18
+ return storage.run(contextIds, asyncMethod);
22
19
  }
23
20
  /**
24
21
  * Get the context IDs.
25
22
  * @returns The context IDs.
26
23
  */
27
24
  static async getContextIds() {
28
- return (await ContextIdStore.createStorage()).getStore();
25
+ const storage = await ContextIdStore.getStorage();
26
+ return storage.getStore();
29
27
  }
30
28
  /**
31
- * Create the storage if it doesn't exist.
29
+ * Get the storage and create it if it doesn't exist.
32
30
  * @returns The storage.
33
31
  */
34
- static async createStorage() {
35
- if (!ContextIdStore._storage) {
32
+ static async getStorage() {
33
+ let asyncHooksStore = SharedStore.get("asyncHooks");
34
+ if (Is.empty(asyncHooksStore?.contextIds)) {
36
35
  try {
37
36
  const hooks = await import("node:async_hooks");
38
- ContextIdStore._storage = new hooks.AsyncLocalStorage({
37
+ asyncHooksStore = asyncHooksStore ?? {};
38
+ asyncHooksStore.contextIds = new hooks.AsyncLocalStorage({
39
39
  name: "AsyncContextIdsStorage"
40
40
  });
41
41
  }
42
42
  catch (err) {
43
43
  throw new GeneralError(ContextIdStore.CLASS_NAME, "asyncHooksNotAvailable", undefined, BaseError.fromError(err));
44
44
  }
45
+ SharedStore.set("asyncHooks", asyncHooksStore);
45
46
  }
46
- return ContextIdStore._storage;
47
+ return asyncHooksStore.contextIds;
47
48
  }
48
49
  }
49
50
  //# sourceMappingURL=contextIdStore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contextIdStore.js","sourceRoot":"","sources":["../../../src/utils/contextIdStore.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAIzD;;GAEG;AACH,MAAM,OAAO,cAAc;IAC1B;;OAEG;IACI,MAAM,CAAU,UAAU,oBAAoC;IAErE;;OAEG;IACK,MAAM,CAAC,QAAQ,CAAiC;IAExD;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAc,UAAuB,EAAE,WAAoB;QACjF,OAAO,CAAC,MAAM,cAAc,CAAC,aAAa,EAAE,CAAC,CAAC,GAAG,CAAI,UAAU,EAAE,WAAW,CAAC,CAAC;IAC/E,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,aAAa;QAChC,OAAO,CAAC,MAAM,cAAc,CAAC,aAAa,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,KAAK,CAAC,aAAa;QACjC,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;YAC9B,IAAI,CAAC;gBACJ,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;gBAC/C,cAAc,CAAC,QAAQ,GAAG,IAAI,KAAK,CAAC,iBAAiB,CAAc;oBAClE,IAAI,EAAE,wBAAwB;iBAC9B,CAAC,CAAC;YACJ,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,MAAM,IAAI,YAAY,CACrB,cAAc,CAAC,UAAU,EACzB,wBAAwB,EACxB,SAAS,EACT,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CACxB,CAAC;YACH,CAAC;QACF,CAAC;QACD,OAAO,cAAc,CAAC,QAAQ,CAAC;IAChC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { AsyncLocalStorage } from \"node:async_hooks\";\nimport { BaseError, GeneralError } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport type { IContextIds } from \"../models/IContextIds.js\";\n\n/**\n * Class to maintain context ids and execute an async method.\n */\nexport class ContextIdStore {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<ContextIdStore>();\n\n\t/**\n\t * The async local storage for the context ids.\n\t */\n\tprivate static _storage: AsyncLocalStorage<IContextIds>;\n\n\t/**\n\t * Execute the method wrapped in the context.\n\t * @param contextIds The context IDs.\n\t * @param asyncMethod The async method to run.\n\t * @returns Nothing.\n\t */\n\tpublic static async run<T = unknown>(contextIds: IContextIds, asyncMethod: () => T): Promise<T> {\n\t\treturn (await ContextIdStore.createStorage()).run<T>(contextIds, asyncMethod);\n\t}\n\n\t/**\n\t * Get the context IDs.\n\t * @returns The context IDs.\n\t */\n\tpublic static async getContextIds(): Promise<IContextIds | undefined> {\n\t\treturn (await ContextIdStore.createStorage()).getStore();\n\t}\n\n\t/**\n\t * Create the storage if it doesn't exist.\n\t * @returns The storage.\n\t */\n\tprivate static async createStorage(): Promise<AsyncLocalStorage<IContextIds>> {\n\t\tif (!ContextIdStore._storage) {\n\t\t\ttry {\n\t\t\t\tconst hooks = await import(\"node:async_hooks\");\n\t\t\t\tContextIdStore._storage = new hooks.AsyncLocalStorage<IContextIds>({\n\t\t\t\t\tname: \"AsyncContextIdsStorage\"\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\tthrow new GeneralError(\n\t\t\t\t\tContextIdStore.CLASS_NAME,\n\t\t\t\t\t\"asyncHooksNotAvailable\",\n\t\t\t\t\tundefined,\n\t\t\t\t\tBaseError.fromError(err)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn ContextIdStore._storage;\n\t}\n}\n"]}
1
+ {"version":3,"file":"contextIdStore.js","sourceRoot":"","sources":["../../../src/utils/contextIdStore.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI1E;;GAEG;AACH,MAAM,OAAO,cAAc;IAC1B;;OAEG;IACI,MAAM,CAAU,UAAU,oBAAoC;IAErE;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAc,UAAuB,EAAE,WAAoB;QACjF,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,UAAU,EAAE,CAAC;QAClD,OAAO,OAAO,CAAC,GAAG,CAAI,UAAU,EAAE,WAAW,CAAC,CAAC;IAChD,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,aAAa;QAChC,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,UAAU,EAAE,CAAC;QAClD,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU;QAC7B,IAAI,eAAe,GAAG,WAAW,CAAC,GAAG,CACpC,YAAY,CACZ,CAAC;QAEF,IAAI,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,UAAU,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC;gBACJ,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;gBAC/C,eAAe,GAAG,eAAe,IAAI,EAAE,CAAC;gBACxC,eAAe,CAAC,UAAU,GAAG,IAAI,KAAK,CAAC,iBAAiB,CAAc;oBACrE,IAAI,EAAE,wBAAwB;iBAC9B,CAAC,CAAC;YACJ,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,MAAM,IAAI,YAAY,CACrB,cAAc,CAAC,UAAU,EACzB,wBAAwB,EACxB,SAAS,EACT,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CACxB,CAAC;YACH,CAAC;YACD,WAAW,CAAC,GAAG,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,eAAe,CAAC,UAAU,CAAC;IACnC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { AsyncLocalStorage } from \"node:async_hooks\";\nimport { BaseError, GeneralError, Is, SharedStore } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport type { IContextIds } from \"../models/IContextIds.js\";\n\n/**\n * Class to maintain context ids and execute an async method.\n */\nexport class ContextIdStore {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<ContextIdStore>();\n\n\t/**\n\t * Execute the method wrapped in the context.\n\t * @param contextIds The context IDs.\n\t * @param asyncMethod The async method to run.\n\t * @returns Nothing.\n\t */\n\tpublic static async run<T = unknown>(contextIds: IContextIds, asyncMethod: () => T): Promise<T> {\n\t\tconst storage = await ContextIdStore.getStorage();\n\t\treturn storage.run<T>(contextIds, asyncMethod);\n\t}\n\n\t/**\n\t * Get the context IDs.\n\t * @returns The context IDs.\n\t */\n\tpublic static async getContextIds(): Promise<IContextIds | undefined> {\n\t\tconst storage = await ContextIdStore.getStorage();\n\t\treturn storage.getStore();\n\t}\n\n\t/**\n\t * Get the storage and create it if it doesn't exist.\n\t * @returns The storage.\n\t */\n\tpublic static async getStorage(): Promise<AsyncLocalStorage<IContextIds>> {\n\t\tlet asyncHooksStore = SharedStore.get<{ contextIds?: AsyncLocalStorage<IContextIds> }>(\n\t\t\t\"asyncHooks\"\n\t\t);\n\n\t\tif (Is.empty(asyncHooksStore?.contextIds)) {\n\t\t\ttry {\n\t\t\t\tconst hooks = await import(\"node:async_hooks\");\n\t\t\t\tasyncHooksStore = asyncHooksStore ?? {};\n\t\t\t\tasyncHooksStore.contextIds = new hooks.AsyncLocalStorage<IContextIds>({\n\t\t\t\t\tname: \"AsyncContextIdsStorage\"\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\tthrow new GeneralError(\n\t\t\t\t\tContextIdStore.CLASS_NAME,\n\t\t\t\t\t\"asyncHooksNotAvailable\",\n\t\t\t\t\tundefined,\n\t\t\t\t\tBaseError.fromError(err)\n\t\t\t\t);\n\t\t\t}\n\t\t\tSharedStore.set(\"asyncHooks\", asyncHooksStore);\n\t\t}\n\t\treturn asyncHooksStore.contextIds;\n\t}\n}\n"]}
@@ -1,7 +1,8 @@
1
+ import type { IComponent } from "@twin.org/core";
1
2
  /**
2
3
  * Interface describing a context ID handler.
3
4
  */
4
- export interface IContextIdHandler {
5
+ export interface IContextIdHandler extends IComponent {
5
6
  /**
6
7
  * The short form version of the context ID, should be unique enough to partition data.
7
8
  * @param value The full context ID value.
@@ -1,3 +1,4 @@
1
+ import type { AsyncLocalStorage } from "node:async_hooks";
1
2
  import type { IContextIds } from "../models/IContextIds.js";
2
3
  /**
3
4
  * Class to maintain context ids and execute an async method.
@@ -7,10 +8,6 @@ export declare class ContextIdStore {
7
8
  * Runtime name for the class.
8
9
  */
9
10
  static readonly CLASS_NAME: string;
10
- /**
11
- * The async local storage for the context ids.
12
- */
13
- private static _storage;
14
11
  /**
15
12
  * Execute the method wrapped in the context.
16
13
  * @param contextIds The context IDs.
@@ -24,8 +21,8 @@ export declare class ContextIdStore {
24
21
  */
25
22
  static getContextIds(): Promise<IContextIds | undefined>;
26
23
  /**
27
- * Create the storage if it doesn't exist.
24
+ * Get the storage and create it if it doesn't exist.
28
25
  * @returns The storage.
29
26
  */
30
- private static createStorage;
27
+ static getStorage(): Promise<AsyncLocalStorage<IContextIds>>;
31
28
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,184 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.10](https://github.com/twinfoundation/framework/compare/context-v0.0.3-next.9...context-v0.0.3-next.10) (2026-01-07)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **context:** Synchronize repo versions
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/core bumped from 0.0.3-next.9 to 0.0.3-next.10
16
+ * @twin.org/nameof bumped from 0.0.3-next.9 to 0.0.3-next.10
17
+ * devDependencies
18
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.9 to 0.0.3-next.10
19
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.9 to 0.0.3-next.10
20
+ * @twin.org/validate-locales bumped from 0.0.3-next.9 to 0.0.3-next.10
21
+
22
+ ## [0.0.3-next.9](https://github.com/twinfoundation/framework/compare/context-v0.0.3-next.8...context-v0.0.3-next.9) (2026-01-05)
23
+
24
+
25
+ ### Miscellaneous Chores
26
+
27
+ * **context:** Synchronize repo versions
28
+
29
+
30
+ ### Dependencies
31
+
32
+ * The following workspace dependencies were updated
33
+ * dependencies
34
+ * @twin.org/core bumped from 0.0.3-next.8 to 0.0.3-next.9
35
+ * @twin.org/nameof bumped from 0.0.3-next.8 to 0.0.3-next.9
36
+ * devDependencies
37
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.8 to 0.0.3-next.9
38
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.8 to 0.0.3-next.9
39
+ * @twin.org/validate-locales bumped from 0.0.3-next.8 to 0.0.3-next.9
40
+
41
+ ## [0.0.3-next.8](https://github.com/twinfoundation/framework/compare/context-v0.0.3-next.7...context-v0.0.3-next.8) (2025-11-26)
42
+
43
+
44
+ ### Miscellaneous Chores
45
+
46
+ * **context:** Synchronize repo versions
47
+
48
+
49
+ ### Dependencies
50
+
51
+ * The following workspace dependencies were updated
52
+ * dependencies
53
+ * @twin.org/core bumped from 0.0.3-next.7 to 0.0.3-next.8
54
+ * @twin.org/nameof bumped from 0.0.3-next.7 to 0.0.3-next.8
55
+ * devDependencies
56
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.7 to 0.0.3-next.8
57
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.7 to 0.0.3-next.8
58
+ * @twin.org/validate-locales bumped from 0.0.3-next.7 to 0.0.3-next.8
59
+
60
+ ## [0.0.3-next.7](https://github.com/twinfoundation/framework/compare/context-v0.0.3-next.6...context-v0.0.3-next.7) (2025-11-25)
61
+
62
+
63
+ ### Features
64
+
65
+ * add context id features ([#206](https://github.com/twinfoundation/framework/issues/206)) ([ef0d4ee](https://github.com/twinfoundation/framework/commit/ef0d4ee11a4f5fc6cc6f52a4958ce905c04ee13b))
66
+ * context id handler derives from component ([c868ec2](https://github.com/twinfoundation/framework/commit/c868ec21d3a576d4faa222bf130270a21936e50e))
67
+
68
+
69
+ ### Bug Fixes
70
+
71
+ * use singleton pattern for context storage ([c69f358](https://github.com/twinfoundation/framework/commit/c69f358e45361b45d4e46f19846cd5b8c99b0ccd))
72
+ * use singleton pattern for context storage ([5cc706a](https://github.com/twinfoundation/framework/commit/5cc706a2bbfc601fa3d00f3efd8b764052e9f91d))
73
+
74
+
75
+ ### Dependencies
76
+
77
+ * The following workspace dependencies were updated
78
+ * dependencies
79
+ * @twin.org/core bumped from 0.0.3-next.6 to 0.0.3-next.7
80
+ * @twin.org/nameof bumped from 0.0.3-next.6 to 0.0.3-next.7
81
+ * devDependencies
82
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.6 to 0.0.3-next.7
83
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.6 to 0.0.3-next.7
84
+ * @twin.org/validate-locales bumped from 0.0.3-next.6 to 0.0.3-next.7
85
+
86
+ ## [0.0.3-next.6](https://github.com/twinfoundation/framework/compare/context-v0.0.3-next.5...context-v0.0.3-next.6) (2025-11-25)
87
+
88
+
89
+ ### Miscellaneous Chores
90
+
91
+ * **context:** Synchronize repo versions
92
+
93
+
94
+ ### Dependencies
95
+
96
+ * The following workspace dependencies were updated
97
+ * dependencies
98
+ * @twin.org/core bumped from 0.0.3-next.5 to 0.0.3-next.6
99
+ * @twin.org/nameof bumped from 0.0.3-next.5 to 0.0.3-next.6
100
+ * devDependencies
101
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.5 to 0.0.3-next.6
102
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.5 to 0.0.3-next.6
103
+ * @twin.org/validate-locales bumped from 0.0.3-next.5 to 0.0.3-next.6
104
+
105
+ ## [0.0.3-next.5](https://github.com/twinfoundation/framework/compare/context-v0.0.3-next.4...context-v0.0.3-next.5) (2025-11-20)
106
+
107
+
108
+ ### Features
109
+
110
+ * context id handler derives from component ([c868ec2](https://github.com/twinfoundation/framework/commit/c868ec21d3a576d4faa222bf130270a21936e50e))
111
+
112
+
113
+ ### Dependencies
114
+
115
+ * The following workspace dependencies were updated
116
+ * dependencies
117
+ * @twin.org/core bumped from 0.0.3-next.4 to 0.0.3-next.5
118
+ * @twin.org/nameof bumped from 0.0.3-next.4 to 0.0.3-next.5
119
+ * devDependencies
120
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.4 to 0.0.3-next.5
121
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.4 to 0.0.3-next.5
122
+ * @twin.org/validate-locales bumped from 0.0.3-next.4 to 0.0.3-next.5
123
+
124
+ ## [0.0.3-next.4](https://github.com/twinfoundation/framework/compare/context-v0.0.3-next.3...context-v0.0.3-next.4) (2025-11-13)
125
+
126
+
127
+ ### Bug Fixes
128
+
129
+ * use singleton pattern for context storage ([c69f358](https://github.com/twinfoundation/framework/commit/c69f358e45361b45d4e46f19846cd5b8c99b0ccd))
130
+ * use singleton pattern for context storage ([5cc706a](https://github.com/twinfoundation/framework/commit/5cc706a2bbfc601fa3d00f3efd8b764052e9f91d))
131
+
132
+
133
+ ### Dependencies
134
+
135
+ * The following workspace dependencies were updated
136
+ * dependencies
137
+ * @twin.org/core bumped from 0.0.3-next.3 to 0.0.3-next.4
138
+ * @twin.org/nameof bumped from 0.0.3-next.3 to 0.0.3-next.4
139
+ * devDependencies
140
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.3 to 0.0.3-next.4
141
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.3 to 0.0.3-next.4
142
+ * @twin.org/validate-locales bumped from 0.0.3-next.3 to 0.0.3-next.4
143
+
144
+ ## [0.0.3-next.3](https://github.com/twinfoundation/framework/compare/context-v0.0.3-next.2...context-v0.0.3-next.3) (2025-11-12)
145
+
146
+
147
+ ### Miscellaneous Chores
148
+
149
+ * **context:** Synchronize repo versions
150
+
151
+
152
+ ### Dependencies
153
+
154
+ * The following workspace dependencies were updated
155
+ * dependencies
156
+ * @twin.org/core bumped from 0.0.3-next.2 to 0.0.3-next.3
157
+ * @twin.org/nameof bumped from 0.0.3-next.2 to 0.0.3-next.3
158
+ * devDependencies
159
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.2 to 0.0.3-next.3
160
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.2 to 0.0.3-next.3
161
+ * @twin.org/validate-locales bumped from 0.0.3-next.2 to 0.0.3-next.3
162
+
163
+ ## [0.0.3-next.2](https://github.com/twinfoundation/framework/compare/context-v0.0.3-next.1...context-v0.0.3-next.2) (2025-11-12)
164
+
165
+
166
+ ### Miscellaneous Chores
167
+
168
+ * **context:** Synchronize repo versions
169
+
170
+
171
+ ### Dependencies
172
+
173
+ * The following workspace dependencies were updated
174
+ * dependencies
175
+ * @twin.org/core bumped from 0.0.3-next.1 to 0.0.3-next.2
176
+ * @twin.org/nameof bumped from 0.0.3-next.1 to 0.0.3-next.2
177
+ * devDependencies
178
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.1 to 0.0.3-next.2
179
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.1 to 0.0.3-next.2
180
+ * @twin.org/validate-locales bumped from 0.0.3-next.1 to 0.0.3-next.2
181
+
3
182
  ## [0.0.3-next.1](https://github.com/twinfoundation/framework/compare/context-v0.0.3-next.0...context-v0.0.3-next.1) (2025-11-10)
4
183
 
5
184
 
@@ -67,3 +67,17 @@ Get the context IDs.
67
67
  `Promise`\<[`IContextIds`](../interfaces/IContextIds.md) \| `undefined`\>
68
68
 
69
69
  The context IDs.
70
+
71
+ ***
72
+
73
+ ### getStorage()
74
+
75
+ > `static` **getStorage**(): `Promise`\<`AsyncLocalStorage`\<[`IContextIds`](../interfaces/IContextIds.md)\>\>
76
+
77
+ Get the storage and create it if it doesn't exist.
78
+
79
+ #### Returns
80
+
81
+ `Promise`\<`AsyncLocalStorage`\<[`IContextIds`](../interfaces/IContextIds.md)\>\>
82
+
83
+ The storage.
@@ -2,6 +2,10 @@
2
2
 
3
3
  Interface describing a context ID handler.
4
4
 
5
+ ## Extends
6
+
7
+ - `IComponent`
8
+
5
9
  ## Methods
6
10
 
7
11
  ### short()?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/context",
3
- "version": "0.0.3-next.1",
3
+ "version": "0.0.3-next.10",
4
4
  "description": "Helper methods/classes for context handling",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,8 +14,8 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/core": "0.0.3-next.1",
18
- "@twin.org/nameof": "0.0.3-next.1"
17
+ "@twin.org/core": "0.0.3-next.10",
18
+ "@twin.org/nameof": "0.0.3-next.10"
19
19
  },
20
20
  "main": "./dist/es/index.js",
21
21
  "types": "./dist/types/index.d.ts",