@twin.org/identity-models 0.0.3-next.3 → 0.0.3-next.5

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.
@@ -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,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 * 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
+ {"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,38 @@
1
1
  # @twin.org/identity-service-models - Changelog
2
2
 
3
+ ## [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)
4
+
5
+
6
+ ### Features
7
+
8
+ * update did context handler definition ([02aa59a](https://github.com/twinfoundation/identity/commit/02aa59ae8100b1afb2325ea858411fc3e4d9d1e9))
9
+
10
+ ## [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)
11
+
12
+
13
+ ### Features
14
+
15
+ * add context id features ([#62](https://github.com/twinfoundation/identity/issues/62)) ([e02ecca](https://github.com/twinfoundation/identity/commit/e02ecca9c45a849104bfbf7bc18a1f44e6eea8a1))
16
+ * add expiration date option to vc creation ([73e05e1](https://github.com/twinfoundation/identity/commit/73e05e1ae61112c7e056889969751f4ff82d9f29))
17
+ * add identity remove ([eebc13f](https://github.com/twinfoundation/identity/commit/eebc13f4c2cd994d2d9cce4da2128fb346c80ba7))
18
+ * add idHelper class ([57c8bdb](https://github.com/twinfoundation/identity/commit/57c8bdb81efaa163b5e83f8a7f16f3764d12fd75))
19
+ * add validate-locales ([04d74b4](https://github.com/twinfoundation/identity/commit/04d74b4d1ebe42672e8ca75a7bdb8e3556afd0be))
20
+ * eslint migration to flat config ([fd6246d](https://github.com/twinfoundation/identity/commit/fd6246d566280b6d5d10a108eb1e92c4b510f2f2))
21
+ * identity key separator use slash ([1319d0d](https://github.com/twinfoundation/identity/commit/1319d0d07164a36b3ec279e6421b8835ffefc3d3))
22
+ * update framework core ([c824497](https://github.com/twinfoundation/identity/commit/c82449709af0215eb7af496cf687c93fb30b5ae0))
23
+ * use shared store mechanism ([#27](https://github.com/twinfoundation/identity/issues/27)) ([ce41f3f](https://github.com/twinfoundation/identity/commit/ce41f3fc3da1b206ec06da7ea5b2c968f788804d))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * didContextIdHandler tests ([dc7b555](https://github.com/twinfoundation/identity/commit/dc7b5558e47117475b7f1fa1686d3ed7e0906563))
29
+ * Import path and bump version ([#21](https://github.com/twinfoundation/identity/issues/21)) ([ccea845](https://github.com/twinfoundation/identity/commit/ccea845bf32562267280bc1b3dde1c9af1a00360))
30
+ * Install sdk-wasm ([#20](https://github.com/twinfoundation/identity/issues/20)) ([75ec14e](https://github.com/twinfoundation/identity/commit/75ec14e072f8c219863a1c028a3b0783802086e9))
31
+ * query params force coercion ([d9347d2](https://github.com/twinfoundation/identity/commit/d9347d29d4a9cc58759f30f5d8526de864ea7522))
32
+ * stricter pathParam types ([a174cdf](https://github.com/twinfoundation/identity/commit/a174cdf0ca4272bee35fcf20ab7e8e4e17b8b6f4))
33
+ * use base64Url for tenant id short form so it doesn't include slash ([53b9e27](https://github.com/twinfoundation/identity/commit/53b9e27351f20e2689734581c252a23527657926))
34
+ * Use resolver component ([#22](https://github.com/twinfoundation/identity/issues/22)) ([d0b3a32](https://github.com/twinfoundation/identity/commit/d0b3a321c7f9f966d397a880d752e9f2c0a98a27))
35
+
3
36
  ## [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)
4
37
 
5
38
 
@@ -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.3",
3
+ "version": "0.0.3-next.5",
4
4
  "description": "Models which define the structure of the contracts and connectors",
5
5
  "repository": {
6
6
  "type": "git",