@twin.org/api-tenant-processor 0.0.3-next.4 → 0.0.3-next.6

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.
@@ -7,6 +7,13 @@ export class TenantIdContextIdHandler {
7
7
  * Runtime name for the class.
8
8
  */
9
9
  static CLASS_NAME = "TenantIdContextIdHandler";
10
+ /**
11
+ * The class name of the component.
12
+ * @returns The class name.
13
+ */
14
+ className() {
15
+ return TenantIdContextIdHandler.CLASS_NAME;
16
+ }
10
17
  /**
11
18
  * The short form of the tenant id is the base64 version to compact.
12
19
  * @param value The full context id value.
@@ -1 +1 @@
1
- {"version":3,"file":"tenantIdContextIdHandler.js","sourceRoot":"","sources":["../../src/tenantIdContextIdHandler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGnD;;GAEG;AACH,MAAM,OAAO,wBAAwB;IACpC;;OAEG;IACI,MAAM,CAAU,UAAU,8BAA8C;IAE/E;;;;OAIG;IACI,KAAK,CAAC,KAAa;QACzB,OAAO,SAAS,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAChE,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAa;QACzB,MAAM,CAAC,eAAe,CAAC,wBAAwB,CAAC,UAAU,WAAiB,KAAK,EAAE,EAAE,CAAC,CAAC;IACvF,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IContextIdHandler } from \"@twin.org/context\";\nimport { Converter, Guards } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\n\n/**\n * Context Id handler for testing as a tenant id.\n */\nexport class TenantIdContextIdHandler implements IContextIdHandler {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<TenantIdContextIdHandler>();\n\n\t/**\n\t * The short form of the tenant id is the base64 version to compact.\n\t * @param value The full context id value.\n\t * @returns Short form string.\n\t */\n\tpublic short(value: string): string {\n\t\treturn Converter.bytesToBase64Url(Converter.hexToBytes(value));\n\t}\n\n\t/**\n\t * Guard the value ensuring length.\n\t * @param value The value to guard.\n\t * @throws GeneralError if the value is too short.\n\t */\n\tpublic guard(value: string): void {\n\t\tGuards.stringHexLength(TenantIdContextIdHandler.CLASS_NAME, nameof(value), value, 32);\n\t}\n}\n"]}
1
+ {"version":3,"file":"tenantIdContextIdHandler.js","sourceRoot":"","sources":["../../src/tenantIdContextIdHandler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGnD;;GAEG;AACH,MAAM,OAAO,wBAAwB;IACpC;;OAEG;IACI,MAAM,CAAU,UAAU,8BAA8C;IAE/E;;;OAGG;IACI,SAAS;QACf,OAAO,wBAAwB,CAAC,UAAU,CAAC;IAC5C,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAa;QACzB,OAAO,SAAS,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAChE,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAa;QACzB,MAAM,CAAC,eAAe,CAAC,wBAAwB,CAAC,UAAU,WAAiB,KAAK,EAAE,EAAE,CAAC,CAAC;IACvF,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IContextIdHandler } from \"@twin.org/context\";\nimport { Converter, Guards } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\n\n/**\n * Context Id handler for testing as a tenant id.\n */\nexport class TenantIdContextIdHandler implements IContextIdHandler {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<TenantIdContextIdHandler>();\n\n\t/**\n\t * The class name of the component.\n\t * @returns The class name.\n\t */\n\tpublic className(): string {\n\t\treturn TenantIdContextIdHandler.CLASS_NAME;\n\t}\n\n\t/**\n\t * The short form of the tenant id is the base64 version to compact.\n\t * @param value The full context id value.\n\t * @returns Short form string.\n\t */\n\tpublic short(value: string): string {\n\t\treturn Converter.bytesToBase64Url(Converter.hexToBytes(value));\n\t}\n\n\t/**\n\t * Guard the value ensuring length.\n\t * @param value The value to guard.\n\t * @throws GeneralError if the value is too short.\n\t */\n\tpublic guard(value: string): void {\n\t\tGuards.stringHexLength(TenantIdContextIdHandler.CLASS_NAME, nameof(value), value, 32);\n\t}\n}\n"]}
@@ -7,6 +7,11 @@ export declare class TenantIdContextIdHandler implements IContextIdHandler {
7
7
  * Runtime name for the class.
8
8
  */
9
9
  static readonly CLASS_NAME: string;
10
+ /**
11
+ * The class name of the component.
12
+ * @returns The class name.
13
+ */
14
+ className(): string;
10
15
  /**
11
16
  * The short form of the tenant id is the base64 version to compact.
12
17
  * @param value The full context id value.
package/docs/changelog.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.6](https://github.com/twinfoundation/api/compare/api-tenant-processor-v0.0.3-next.5...api-tenant-processor-v0.0.3-next.6) (2025-11-20)
4
+
5
+
6
+ ### Features
7
+
8
+ * check tenant id in auth if set ([937ba0c](https://github.com/twinfoundation/api/commit/937ba0cd790038556a7b2af251e52b43cb059df4))
9
+ * check tenant id in auth if set ([66f7337](https://github.com/twinfoundation/api/commit/66f73374d3cf4c1c85ea96ec74bb30712fb84dd7))
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * The following workspace dependencies were updated
15
+ * dependencies
16
+ * @twin.org/api-models bumped from 0.0.3-next.5 to 0.0.3-next.6
17
+
18
+ ## [0.0.3-next.5](https://github.com/twinfoundation/api/compare/api-tenant-processor-v0.0.3-next.4...api-tenant-processor-v0.0.3-next.5) (2025-11-14)
19
+
20
+
21
+ ### Miscellaneous Chores
22
+
23
+ * **api-tenant-processor:** Synchronize repo versions
24
+
25
+
26
+ ### Dependencies
27
+
28
+ * The following workspace dependencies were updated
29
+ * dependencies
30
+ * @twin.org/api-models bumped from 0.0.3-next.4 to 0.0.3-next.5
31
+
3
32
  ## [0.0.3-next.4](https://github.com/twinfoundation/api/compare/api-tenant-processor-v0.0.3-next.3...api-tenant-processor-v0.0.3-next.4) (2025-11-14)
4
33
 
5
34
 
@@ -26,6 +26,24 @@ Runtime name for the class.
26
26
 
27
27
  ## Methods
28
28
 
29
+ ### className()
30
+
31
+ > **className**(): `string`
32
+
33
+ The class name of the component.
34
+
35
+ #### Returns
36
+
37
+ `string`
38
+
39
+ The class name.
40
+
41
+ #### Implementation of
42
+
43
+ `IContextIdHandler.className`
44
+
45
+ ***
46
+
29
47
  ### short()
30
48
 
31
49
  > **short**(`value`): `string`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/api-tenant-processor",
3
- "version": "0.0.3-next.4",
3
+ "version": "0.0.3-next.6",
4
4
  "description": "API Tenant Processor for converting and api key to a tenant id.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,7 +14,7 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/api-models": "0.0.3-next.4",
17
+ "@twin.org/api-models": "0.0.3-next.6",
18
18
  "@twin.org/context": "next",
19
19
  "@twin.org/core": "next",
20
20
  "@twin.org/entity": "next",