@twin.org/identity-models 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.
@@ -8,6 +8,13 @@ export class DidContextIdHandler {
8
8
  * Runtime name for the class.
9
9
  */
10
10
  static CLASS_NAME = "DidContextIdHandler";
11
+ /**
12
+ * The class name of the component.
13
+ * @returns The class name.
14
+ */
15
+ className() {
16
+ return DidContextIdHandler.CLASS_NAME;
17
+ }
11
18
  /**
12
19
  * Get the short form of the DID which is the last part.
13
20
  * @param value The full context id value.
@@ -18,7 +25,7 @@ export class DidContextIdHandler {
18
25
  // If the ID part is hex, convert to base64 for a shorter representation.
19
26
  if (HexHelper.hasPrefix(parts.id) && HexHelper.isHex(parts.id, true)) {
20
27
  const bytes = Converter.hexToBytes(parts.id);
21
- return Converter.bytesToBase64(bytes);
28
+ return Converter.bytesToBase64Url(bytes);
22
29
  }
23
30
  return parts.id;
24
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"didContextIdHandler.js","sourceRoot":"","sources":["../../../src/contextIdHandlers/didContextIdHandler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAC/B;;OAEG;IACI,MAAM,CAAU,UAAU,yBAAyC;IAE1E;;;;OAIG;IACI,KAAK,CAAC,KAAa;QACzB,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/B,yEAAyE;QACzE,IAAI,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC;YACtE,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC7C,OAAO,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,KAAK,CAAC,EAAE,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAa;QACzB,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,UAAU,WAAiB,KAAK,CAAC,CAAC;IACjE,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IContextIdHandler } from \"@twin.org/context\";\nimport { Converter, HexHelper } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { Did } from \"../types/did.js\";\n\n/**\n * Context Id handler for testing as a DID.\n */\nexport class DidContextIdHandler implements IContextIdHandler {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<DidContextIdHandler>();\n\n\t/**\n\t * Get the short form of the DID which is the last part.\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\tconst parts = Did.parse(value);\n\t\t// If the ID part is hex, convert to base64 for a shorter representation.\n\t\tif (HexHelper.hasPrefix(parts.id) && HexHelper.isHex(parts.id, true)) {\n\t\t\tconst bytes = Converter.hexToBytes(parts.id);\n\t\t\treturn Converter.bytesToBase64(bytes);\n\t\t}\n\t\treturn parts.id;\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\tDid.guard(DidContextIdHandler.CLASS_NAME, nameof(value), value);\n\t}\n}\n"]}
1
+ {"version":3,"file":"didContextIdHandler.js","sourceRoot":"","sources":["../../../src/contextIdHandlers/didContextIdHandler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAC/B;;OAEG;IACI,MAAM,CAAU,UAAU,yBAAyC;IAE1E;;;OAGG;IACI,SAAS;QACf,OAAO,mBAAmB,CAAC,UAAU,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAa;QACzB,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/B,yEAAyE;QACzE,IAAI,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC;YACtE,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC7C,OAAO,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,KAAK,CAAC,EAAE,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAa;QACzB,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,UAAU,WAAiB,KAAK,CAAC,CAAC;IACjE,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IContextIdHandler } from \"@twin.org/context\";\nimport { Converter, HexHelper } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { Did } from \"../types/did.js\";\n\n/**\n * Context Id handler for testing as a DID.\n */\nexport class DidContextIdHandler implements IContextIdHandler {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<DidContextIdHandler>();\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 DidContextIdHandler.CLASS_NAME;\n\t}\n\n\t/**\n\t * Get the short form of the DID which is the last part.\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\tconst parts = Did.parse(value);\n\t\t// If the ID part is hex, convert to base64 for a shorter representation.\n\t\tif (HexHelper.hasPrefix(parts.id) && HexHelper.isHex(parts.id, true)) {\n\t\t\tconst bytes = Converter.hexToBytes(parts.id);\n\t\t\treturn Converter.bytesToBase64Url(bytes);\n\t\t}\n\t\treturn parts.id;\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\tDid.guard(DidContextIdHandler.CLASS_NAME, nameof(value), value);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IIdentityVerifiableCredentialRevokeRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerifiableCredentialRevokeRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to revoke a verifiable credential.\n */\nexport interface IIdentityVerifiableCredentialRevokeRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to revoke the verification credential for.\n\t\t */\n\t\tidentity: string;\n\n\t\t/**\n\t\t * The revocation index to revoke.\n\t\t */\n\t\trevocationIndex: number;\n\t};\n}\n"]}
1
+ {"version":3,"file":"IIdentityVerifiableCredentialRevokeRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerifiableCredentialRevokeRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to revoke a verifiable credential.\n */\nexport interface IIdentityVerifiableCredentialRevokeRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to revoke the verification credential for.\n\t\t */\n\t\tidentity: string;\n\n\t\t/**\n\t\t * The revocation index to revoke.\n\t\t */\n\t\trevocationIndex: string;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IIdentityVerifiableCredentialUnrevokeRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to unrevoke a verifiable credential.\n */\nexport interface IIdentityVerifiableCredentialUnrevokeRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to unrevoke the verification credential for.\n\t\t */\n\t\tidentity: string;\n\n\t\t/**\n\t\t * The revocation index to unrevoke.\n\t\t */\n\t\trevocationIndex: number;\n\t};\n}\n"]}
1
+ {"version":3,"file":"IIdentityVerifiableCredentialUnrevokeRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to unrevoke a verifiable credential.\n */\nexport interface IIdentityVerifiableCredentialUnrevokeRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to unrevoke the verification credential for.\n\t\t */\n\t\tidentity: string;\n\n\t\t/**\n\t\t * The revocation index to unrevoke.\n\t\t */\n\t\trevocationIndex: string;\n\t};\n}\n"]}
@@ -7,6 +7,11 @@ export declare class DidContextIdHandler 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
  * Get the short form of the DID which is the last part.
12
17
  * @param value The full context id value.
@@ -13,6 +13,6 @@ export interface IIdentityVerifiableCredentialRevokeRequest {
13
13
  /**
14
14
  * The revocation index to revoke.
15
15
  */
16
- revocationIndex: number;
16
+ revocationIndex: string;
17
17
  };
18
18
  }
@@ -13,6 +13,6 @@ export interface IIdentityVerifiableCredentialUnrevokeRequest {
13
13
  /**
14
14
  * The revocation index to unrevoke.
15
15
  */
16
- revocationIndex: number;
16
+ revocationIndex: string;
17
17
  };
18
18
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,87 @@
1
1
  # @twin.org/identity-service-models - Changelog
2
2
 
3
+ ## [0.0.3-next.10](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.3-next.9...identity-models-v0.0.3-next.10) (2026-01-15)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **identity-models:** Synchronize repo versions
9
+
10
+ ## [0.0.3-next.9](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.3-next.8...identity-models-v0.0.3-next.9) (2026-01-14)
11
+
12
+
13
+ ### Miscellaneous Chores
14
+
15
+ * **identity-models:** Synchronize repo versions
16
+
17
+ ## [0.0.3-next.8](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.3-next.7...identity-models-v0.0.3-next.8) (2026-01-14)
18
+
19
+
20
+ ### Miscellaneous Chores
21
+
22
+ * **identity-models:** Synchronize repo versions
23
+
24
+ ## [0.0.3-next.7](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.3-next.6...identity-models-v0.0.3-next.7) (2026-01-13)
25
+
26
+
27
+ ### Miscellaneous Chores
28
+
29
+ * **identity-models:** Synchronize repo versions
30
+
31
+ ## [0.0.3-next.6](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.3-next.5...identity-models-v0.0.3-next.6) (2025-11-26)
32
+
33
+
34
+ ### Miscellaneous Chores
35
+
36
+ * **identity-models:** Synchronize repo versions
37
+
38
+ ## [0.0.3-next.5](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.3-next.4...identity-models-v0.0.3-next.5) (2025-11-20)
39
+
40
+
41
+ ### Features
42
+
43
+ * update did context handler definition ([02aa59a](https://github.com/twinfoundation/identity/commit/02aa59ae8100b1afb2325ea858411fc3e4d9d1e9))
44
+
45
+ ## [0.0.3-next.4](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.3-next.3...identity-models-v0.0.3-next.4) (2025-11-17)
46
+
47
+
48
+ ### Features
49
+
50
+ * add context id features ([#62](https://github.com/twinfoundation/identity/issues/62)) ([e02ecca](https://github.com/twinfoundation/identity/commit/e02ecca9c45a849104bfbf7bc18a1f44e6eea8a1))
51
+ * add expiration date option to vc creation ([73e05e1](https://github.com/twinfoundation/identity/commit/73e05e1ae61112c7e056889969751f4ff82d9f29))
52
+ * add identity remove ([eebc13f](https://github.com/twinfoundation/identity/commit/eebc13f4c2cd994d2d9cce4da2128fb346c80ba7))
53
+ * add idHelper class ([57c8bdb](https://github.com/twinfoundation/identity/commit/57c8bdb81efaa163b5e83f8a7f16f3764d12fd75))
54
+ * add validate-locales ([04d74b4](https://github.com/twinfoundation/identity/commit/04d74b4d1ebe42672e8ca75a7bdb8e3556afd0be))
55
+ * eslint migration to flat config ([fd6246d](https://github.com/twinfoundation/identity/commit/fd6246d566280b6d5d10a108eb1e92c4b510f2f2))
56
+ * identity key separator use slash ([1319d0d](https://github.com/twinfoundation/identity/commit/1319d0d07164a36b3ec279e6421b8835ffefc3d3))
57
+ * update framework core ([c824497](https://github.com/twinfoundation/identity/commit/c82449709af0215eb7af496cf687c93fb30b5ae0))
58
+ * use shared store mechanism ([#27](https://github.com/twinfoundation/identity/issues/27)) ([ce41f3f](https://github.com/twinfoundation/identity/commit/ce41f3fc3da1b206ec06da7ea5b2c968f788804d))
59
+
60
+
61
+ ### Bug Fixes
62
+
63
+ * didContextIdHandler tests ([dc7b555](https://github.com/twinfoundation/identity/commit/dc7b5558e47117475b7f1fa1686d3ed7e0906563))
64
+ * Import path and bump version ([#21](https://github.com/twinfoundation/identity/issues/21)) ([ccea845](https://github.com/twinfoundation/identity/commit/ccea845bf32562267280bc1b3dde1c9af1a00360))
65
+ * Install sdk-wasm ([#20](https://github.com/twinfoundation/identity/issues/20)) ([75ec14e](https://github.com/twinfoundation/identity/commit/75ec14e072f8c219863a1c028a3b0783802086e9))
66
+ * query params force coercion ([d9347d2](https://github.com/twinfoundation/identity/commit/d9347d29d4a9cc58759f30f5d8526de864ea7522))
67
+ * stricter pathParam types ([a174cdf](https://github.com/twinfoundation/identity/commit/a174cdf0ca4272bee35fcf20ab7e8e4e17b8b6f4))
68
+ * use base64Url for tenant id short form so it doesn't include slash ([53b9e27](https://github.com/twinfoundation/identity/commit/53b9e27351f20e2689734581c252a23527657926))
69
+ * Use resolver component ([#22](https://github.com/twinfoundation/identity/issues/22)) ([d0b3a32](https://github.com/twinfoundation/identity/commit/d0b3a321c7f9f966d397a880d752e9f2c0a98a27))
70
+
71
+ ## [0.0.3-next.3](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.3-next.2...identity-models-v0.0.3-next.3) (2025-11-17)
72
+
73
+
74
+ ### Miscellaneous Chores
75
+
76
+ * **identity-models:** Synchronize repo versions
77
+
78
+ ## [0.0.3-next.2](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.3-next.1...identity-models-v0.0.3-next.2) (2025-11-14)
79
+
80
+
81
+ ### Bug Fixes
82
+
83
+ * use base64Url for tenant id short form so it doesn't include slash ([53b9e27](https://github.com/twinfoundation/identity/commit/53b9e27351f20e2689734581c252a23527657926))
84
+
3
85
  ## [0.0.3-next.1](https://github.com/twinfoundation/identity/compare/identity-models-v0.0.3-next.0...identity-models-v0.0.3-next.1) (2025-11-11)
4
86
 
5
87
 
@@ -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`
@@ -18,6 +18,6 @@ The identity to revoke the verification credential for.
18
18
 
19
19
  #### revocationIndex
20
20
 
21
- > **revocationIndex**: `number`
21
+ > **revocationIndex**: `string`
22
22
 
23
23
  The revocation index to revoke.
@@ -18,6 +18,6 @@ The identity to unrevoke the verification credential for.
18
18
 
19
19
  #### revocationIndex
20
20
 
21
- > **revocationIndex**: `number`
21
+ > **revocationIndex**: `string`
22
22
 
23
23
  The revocation index to unrevoke.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/identity-models",
3
- "version": "0.0.3-next.1",
3
+ "version": "0.0.3-next.10",
4
4
  "description": "Models which define the structure of the contracts and connectors",
5
5
  "repository": {
6
6
  "type": "git",